OSDN Git Service

git-core/git.git
6 years agoMerge branch 'ar/request-pull-phrasofix' into maint
Junio C Hamano [Wed, 18 Oct 2017 05:19:04 +0000 (14:19 +0900)]
Merge branch 'ar/request-pull-phrasofix' into maint

Spell the name of our system as "Git" in the output from
request-pull script.

* ar/request-pull-phrasofix:
  request-pull: capitalise "Git" to make it a proper noun

6 years agoMerge branch 'jc/merge-x-theirs-docfix' into maint
Junio C Hamano [Wed, 18 Oct 2017 05:19:03 +0000 (14:19 +0900)]
Merge branch 'jc/merge-x-theirs-docfix' into maint

The documentation for '-X<option>' for merges was misleadingly
written to suggest that "-s theirs" exists, which is not the case.

* jc/merge-x-theirs-docfix:
  merge-strategies: avoid implying that "-s theirs" exists

6 years agoMerge branch 'rs/mailinfo-qp-decode-fix' into maint
Junio C Hamano [Wed, 18 Oct 2017 05:19:03 +0000 (14:19 +0900)]
Merge branch 'rs/mailinfo-qp-decode-fix' into maint

"git mailinfo" was loose in decoding quoted printable and produced
garbage when the two letters after the equal sign are not
hexadecimal.  This has been fixed.

* rs/mailinfo-qp-decode-fix:
  mailinfo: don't decode invalid =XY quoted-printable sequences

6 years agoMerge branch 'ik/userdiff-html-h-element-fix' into maint
Junio C Hamano [Wed, 18 Oct 2017 05:19:02 +0000 (14:19 +0900)]
Merge branch 'ik/userdiff-html-h-element-fix' into maint

The built-in pattern to detect the "function header" for HTML did
not match <H1>..<H6> elements without any attributes, which has
been fixed.

* ik/userdiff-html-h-element-fix:
  userdiff: fix HTML hunk header regexp

6 years agoMerge branch 'jk/diff-blob' into maint
Junio C Hamano [Wed, 18 Oct 2017 05:19:01 +0000 (14:19 +0900)]
Merge branch 'jk/diff-blob' into maint

"git cat-file --textconv" started segfaulting recently, which
has been corrected.

* jk/diff-blob:
  cat-file: handle NULL object_context.path

6 years agoMerge branch 'jk/describe-omit-some-refs' into maint
Junio C Hamano [Wed, 18 Oct 2017 05:19:01 +0000 (14:19 +0900)]
Merge branch 'jk/describe-omit-some-refs' into maint

"git describe --match" learned to take multiple patterns in v2.13
series, but the feature ignored the patterns after the first one
and did not work at all.  This has been fixed.

* jk/describe-omit-some-refs:
  describe: fix matching to actually match all patterns

6 years agoMerge branch 'mh/for-each-string-list-item-empty-fix' into maint
Junio C Hamano [Wed, 18 Oct 2017 05:19:00 +0000 (14:19 +0900)]
Merge branch 'mh/for-each-string-list-item-empty-fix' into maint

Code cmp.std.c nitpick.

* mh/for-each-string-list-item-empty-fix:
  for_each_string_list_item: avoid undefined behavior for empty list

6 years agoMerge branch 'tb/test-lint-echo-e' into maint
Junio C Hamano [Wed, 18 Oct 2017 05:18:59 +0000 (14:18 +0900)]
Merge branch 'tb/test-lint-echo-e' into maint

The test linter has been taught that we do not like "echo -e".

* tb/test-lint-echo-e:
  test-lint: echo -e (or -E) is not portable

6 years agoMerge branch 'aw/gc-lockfile-fscanf-fix' into maint
Junio C Hamano [Wed, 18 Oct 2017 05:18:59 +0000 (14:18 +0900)]
Merge branch 'aw/gc-lockfile-fscanf-fix' into maint

"git gc" tries to avoid running two instances at the same time by
reading and writing pid/host from and to a lock file; it used to
use an incorrect fscanf() format when reading, which has been
corrected.

* aw/gc-lockfile-fscanf-fix:
  gc: call fscanf() with %<len>s, not %<len>c, when reading hostname

6 years agoMerge branch 'tg/refs-allowed-flags' into maint
Junio C Hamano [Wed, 18 Oct 2017 05:18:58 +0000 (14:18 +0900)]
Merge branch 'tg/refs-allowed-flags' into maint

API error-proofing which happens to also squelch warnings from GCC.

* tg/refs-allowed-flags:
  refs: strip out not allowed flags from ref_transaction_update

6 years agoMerge branch 'rs/archive-excluded-directory' into maint
Junio C Hamano [Wed, 18 Oct 2017 05:18:58 +0000 (14:18 +0900)]
Merge branch 'rs/archive-excluded-directory' into maint

"git archive", especially when used with pathspec, stored an empty
directory in its output, even though Git itself never does so.
This has been fixed.

* rs/archive-excluded-directory:
  archive: don't add empty directories to archives

6 years agoMerge branch 'rk/commit-tree-make-F-verbatim' into maint
Junio C Hamano [Wed, 18 Oct 2017 05:18:58 +0000 (14:18 +0900)]
Merge branch 'rk/commit-tree-make-F-verbatim' into maint

Unlike "git commit-tree < file", "git commit-tree -F file" did not
pass the contents of the file verbatim and instead completed an
incomplete line at the end, if exists.  The latter has been updated
to match the behaviour of the former.

* rk/commit-tree-make-F-verbatim:
  commit-tree: do not complete line in -F input

6 years agoMerge branch 'mh/packed-ref-store-prep' into maint
Junio C Hamano [Wed, 18 Oct 2017 05:18:58 +0000 (14:18 +0900)]
Merge branch 'mh/packed-ref-store-prep' into maint

Fix regression to "gitk --bisect" by a recent update.

* mh/packed-ref-store-prep:
  rev-parse: don't trim bisect refnames

6 years agoMerge branch 'mm/send-email-cc-cruft' into maint
Junio C Hamano [Wed, 18 Oct 2017 05:18:58 +0000 (14:18 +0900)]
Merge branch 'mm/send-email-cc-cruft' into maint

In addition to "cc: <a@dd.re.ss> # cruft", "cc: a@dd.re.ss # cruft"
was taught to "git send-email" as a valid way to tell it that it
needs to also send a carbon copy to <a@dd.re.ss> in the trailer
section.

* mm/send-email-cc-cruft:
  send-email: don't use Mail::Address, even if available
  send-email: fix garbage removal after address

6 years agoMerge branch 'rs/strbuf-getwholeline-fix' into maint
Junio C Hamano [Wed, 18 Oct 2017 05:18:57 +0000 (14:18 +0900)]
Merge branch 'rs/strbuf-getwholeline-fix' into maint

A helper function to read a single whole line into strbuf
mistakenly triggered OOM error at EOF under certain conditions,
which has been fixed.

* rs/strbuf-getwholeline-fix:
  strbuf: clear errno before calling getdelim(3)

6 years agorequest-pull: capitalise "Git" to make it a proper noun
Ann T Ropea [Tue, 3 Oct 2017 00:08:38 +0000 (00:08 +0000)]
request-pull: capitalise "Git" to make it a proper noun

Of the many ways to spell the three-letter word, the variant "Git"
should be used when referring to a repository in a description; or, in
general, when it is used as a proper noun.

We thus change the pull-request template message so that it reads

   "...in the Git repository at:"

Besides, this brings us in line with the documentation, see
Documentation/howto/using-signed-tag-in-pull-request.txt

Signed-off-by: Ann T Ropea <bedhanger@gmx.de>
Acked-by: Jonathan Nieder <jrnieder@gmail.com>
Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
6 years agomerge-strategies: avoid implying that "-s theirs" exists
Junio C Hamano [Mon, 25 Sep 2017 05:34:23 +0000 (14:34 +0900)]
merge-strategies: avoid implying that "-s theirs" exists

The description of `-Xours` merge option has a parenthetical note
that tells the readers that it is very different from `-s ours`,
which is correct, but the description of `-Xtheirs` that follows it
carelessly says "this is the opposite of `ours`", giving a false
impression that the readers also need to be warned that it is very
different from `-s theirs`, which in reality does not even exist.

Clarify it a bit to avoid misleading readers.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
6 years agomailinfo: don't decode invalid =XY quoted-printable sequences
René Scharfe [Sat, 23 Sep 2017 18:04:40 +0000 (20:04 +0200)]
mailinfo: don't decode invalid =XY quoted-printable sequences

Decode =XY in quoted-printable segments only if X and Y are hexadecimal
digits, otherwise just copy them.  That's at least better than
interpreting negative results from hexval() as a character.

Reported-by: Jeff King <peff@peff.net>
Signed-off-by: Rene Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
6 years agouserdiff: fix HTML hunk header regexp
Ilya Kantor [Sat, 23 Sep 2017 07:53:47 +0000 (10:53 +0300)]
userdiff: fix HTML hunk header regexp

Current HTML header regexp doesn't match headers without attributes.

So it fails to match <h1>...</h1>, while <h1 class="smth">...</h1> matches.

Make attributes optional to fix this.  The regexp is still far from
perfect, but now it at least handles the common case.

Signed-off-by: Ilya Kantor <iliakan@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
6 years agoGit 2.14.2 v2.14.2
Junio C Hamano [Fri, 22 Sep 2017 05:51:37 +0000 (14:51 +0900)]
Git 2.14.2

Signed-off-by: Junio C Hamano <gitster@pobox.com>
6 years agoSync with 2.13.6
Junio C Hamano [Fri, 22 Sep 2017 05:50:02 +0000 (14:50 +0900)]
Sync with 2.13.6

Signed-off-by: Junio C Hamano <gitster@pobox.com>
6 years agoGit 2.13.6 v2.13.6
Junio C Hamano [Fri, 22 Sep 2017 05:49:24 +0000 (14:49 +0900)]
Git 2.13.6

Signed-off-by: Junio C Hamano <gitster@pobox.com>
6 years agoSync with 2.12.5
Junio C Hamano [Fri, 22 Sep 2017 05:48:08 +0000 (14:48 +0900)]
Sync with 2.12.5

Signed-off-by: Junio C Hamano <gitster@pobox.com>
6 years agoGit 2.12.5 v2.12.5
Junio C Hamano [Fri, 22 Sep 2017 05:47:41 +0000 (14:47 +0900)]
Git 2.12.5

Signed-off-by: Junio C Hamano <gitster@pobox.com>
6 years agoSync with 2.11.4
Junio C Hamano [Fri, 22 Sep 2017 05:45:30 +0000 (14:45 +0900)]
Sync with 2.11.4

Signed-off-by: Junio C Hamano <gitster@pobox.com>
6 years agoGit 2.11.4 v2.11.4
Junio C Hamano [Fri, 22 Sep 2017 05:44:45 +0000 (14:44 +0900)]
Git 2.11.4

Signed-off-by: Junio C Hamano <gitster@pobox.com>
6 years agoSync with 2.10.5
Junio C Hamano [Fri, 22 Sep 2017 05:43:13 +0000 (14:43 +0900)]
Sync with 2.10.5

Signed-off-by: Junio C Hamano <gitster@pobox.com>
6 years agoGit 2.10.5 v2.10.5
Junio C Hamano [Fri, 22 Sep 2017 05:42:22 +0000 (14:42 +0900)]
Git 2.10.5

Signed-off-by: Junio C Hamano <gitster@pobox.com>
6 years agoMerge branch 'jk/safe-pipe-capture' into maint-2.10
Junio C Hamano [Fri, 22 Sep 2017 05:34:34 +0000 (14:34 +0900)]
Merge branch 'jk/safe-pipe-capture' into maint-2.10

6 years agoMerge branch 'jk/cvsimport-quoting' into maint-2.10
Junio C Hamano [Fri, 22 Sep 2017 05:34:34 +0000 (14:34 +0900)]
Merge branch 'jk/cvsimport-quoting' into maint-2.10

6 years agoMerge branch 'jc/cvsserver' into maint-2.10
Junio C Hamano [Fri, 22 Sep 2017 05:34:34 +0000 (14:34 +0900)]
Merge branch 'jc/cvsserver' into maint-2.10

6 years agoMerge branch 'jk/git-shell-drop-cvsserver' into maint-2.10
Junio C Hamano [Fri, 22 Sep 2017 05:34:34 +0000 (14:34 +0900)]
Merge branch 'jk/git-shell-drop-cvsserver' into maint-2.10

6 years agocat-file: handle NULL object_context.path
Jeff King [Thu, 21 Sep 2017 06:21:40 +0000 (02:21 -0400)]
cat-file: handle NULL object_context.path

Commit dc944b65f1 (get_sha1_with_context: dynamically
allocate oc->path, 2017-05-19) changed the rules that
callers must follow for seeing if we parsed a path in the
object name. The rules switched from "check if the oc.path
buffer is empty" to "check if the oc.path pointer is NULL".
But that commit forgot to update some sites in
cat_one_file(), meaning we might dereference a NULL pointer.

You can see this by making a path-aware request like
--textconv without specifying --path, and giving an object
name that doesn't have a path in it. Like:

  git cat-file --textconv HEAD

which will reliably segfault.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
6 years agotest-lint: echo -e (or -E) is not portable
Torsten Bögershausen [Sun, 17 Sep 2017 05:43:18 +0000 (07:43 +0200)]
test-lint: echo -e (or -E) is not portable

Some implementations of `echo` support the '-e' option to enable
backslash interpretation of the following string.
As an addition, they support '-E' to turn it off.

However, none of these are portable, POSIX doesn't even mention them,
and many implementations don't support them.

A check for '-n' is already done in check-non-portable-shell.pl,
extend it to cover '-n', '-e' or '-E'.

Signed-off-by: Torsten Bögershausen <tboegi@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
6 years agofor_each_string_list_item: avoid undefined behavior for empty list
Michael Haggerty [Wed, 20 Sep 2017 05:27:05 +0000 (22:27 -0700)]
for_each_string_list_item: avoid undefined behavior for empty list

If you pass a newly initialized or newly cleared `string_list` to
`for_each_string_list_item()`, then the latter does

    for (
            item = (list)->items; /* NULL */
            item < (list)->items + (list)->nr; /* NULL + 0 */
            ++item)

Even though this probably works almost everywhere, it is undefined
behavior, and it could plausibly cause highly-optimizing compilers to
misbehave.  C99 section 6.5.6 paragraph 8 explains:

    If both the pointer operand and the result point to elements
    of the same array object, or one past the last element of the
    array object, the evaluation shall not produce an overflow;
    otherwise, the behavior is undefined.

and (6.3.2.3.3) a null pointer does not point to anything.

Guard the loop with a NULL check to make the intent crystal clear to
even the most pedantic compiler.  A suitably clever compiler could let
the NULL check only run in the first iteration, but regardless, this
overhead is likely to be dwarfed by the work to be done on each item.

This problem was noticed by Coverity.

[jn: using a NULL check instead of a placeholder empty list;
 fleshed out the commit message based on mailing list discussion]

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
6 years agogc: call fscanf() with %<len>s, not %<len>c, when reading hostname
Junio C Hamano [Sun, 17 Sep 2017 03:16:55 +0000 (12:16 +0900)]
gc: call fscanf() with %<len>s, not %<len>c, when reading hostname

Earlier in this codepath, we (ab)used "%<len>c" to read the hostname
recorded in the lockfile into locking_host[HOST_NAME_MAX + 1] while
substituting <len> with the actual value of HOST_NAME_MAX.

This turns out to be incorrect, as it is an instruction to read
exactly the specified number of bytes.  Because we are trying to
read at most that many bytes, we should be using "%<len>s" instead.

Helped-by: A. Wilcox <awilfox@adelielinux.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
6 years agodescribe: fix matching to actually match all patterns
Max Kirillov [Sat, 16 Sep 2017 05:53:44 +0000 (08:53 +0300)]
describe: fix matching to actually match all patterns

`git describe --match` with multiple patterns matches only first pattern.
If it fails, next patterns are not tried.

Fix it, add test cases and update existing test which has wrong
expectation.

Signed-off-by: Max Kirillov <max@max630.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
6 years agoarchive: don't add empty directories to archives
René Scharfe [Tue, 12 Sep 2017 22:43:57 +0000 (00:43 +0200)]
archive: don't add empty directories to archives

While git doesn't track empty directories, git archive can be tricked
into putting some into archives.  One way is to construct an empty tree
object, as t5004 does.  While that is supported by the object database,
it can't be represented in the index and thus it's unlikely to occur in
the wild.

Another way is using the literal name of a directory in an exclude
pathspec -- its contents are are excluded, but the directory stub is
included.  That's inconsistent: exclude pathspecs containing wildcards
don't leave empty directories in the archive.

Yet another way is have a few levels of nested subdirectories (e.g.
d1/d2/d3/file1) and ignoring the entries at the leaves (e.g. file1).
The directories with the ignored content are ignored as well (e.g. d3),
but their empty parents are included (e.g. d2).

As empty directories are not supported by git, they should also not be
written into archives.  If an empty directory is really needed then it
can be tracked and archived by placing an empty .gitignore file in it.

There already is a mechanism in place for suppressing empty directories.
When read_tree_recursive() encounters a directory excluded by a pathspec
then it enters it anyway because it might contain included entries.  It
calls the callback function before it is able to decide if the directory
is actually needed.  For that reason git archive adds directories to a
queue and writes entries for them only when it encounters the first
child item -- but currently only if pathspecs with wildcards are used.

Queue *all* directories, no matter if there even are pathspecs present.
This prevents git archive from writing entries for empty directories in
all cases.

Suggested-by: Jeff King <peff@peff.net>
Signed-off-by: Rene Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
6 years agorefs: strip out not allowed flags from ref_transaction_update
Thomas Gummerer [Tue, 12 Sep 2017 22:59:21 +0000 (23:59 +0100)]
refs: strip out not allowed flags from ref_transaction_update

Callers are only allowed to pass certain flags into
ref_transaction_update, other flags are internal to it.  To prevent
mistakes from the callers, strip the internal only flags out before
continuing.

This was noticed because of a compiler warning gcc 7.1.1 issued about
passing a NULL parameter as second parameter to memcpy (through
hashcpy):

In file included from refs.c:5:0:
refs.c: In function ‘ref_transaction_verify’:
cache.h:948:2: error: argument 2 null where non-null expected [-Werror=nonnull]
  memcpy(sha_dst, sha_src, GIT_SHA1_RAWSZ);
  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from git-compat-util.h:165:0,
                 from cache.h:4,
                 from refs.c:5:
/usr/include/string.h:43:14: note: in a call to function ‘memcpy’ declared here
 extern void *memcpy (void *__restrict __dest, const void *__restrict __src,
              ^~~~~~

The call to hascpy in ref_transaction_add_update is protected by the
passed in flags, but as we only add flags there, gcc notices
REF_HAVE_NEW or REF_HAVE_OLD flags could be passed in from the outside,
which would potentially result in passing in NULL as second parameter to
memcpy.

Fix both the compiler warning, and make the interface safer for its
users by stripping the internal flags out.

Suggested-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Thomas Gummerer <t.gummerer@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
6 years agocvsimport: shell-quote variable used in backticks
Jeff King [Mon, 11 Sep 2017 14:24:26 +0000 (10:24 -0400)]
cvsimport: shell-quote variable used in backticks

We run `git rev-parse` though the shell, and quote its
argument only with single-quotes. This prevents most
metacharacters from being a problem, but misses the obvious
case when $name itself has single-quotes in it. We can fix
this by applying the usual shell-quoting formula.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
6 years agoarchimport: use safe_pipe_capture for user input
Jeff King [Mon, 11 Sep 2017 14:24:11 +0000 (10:24 -0400)]
archimport: use safe_pipe_capture for user input

Refnames can contain shell metacharacters which need to be
passed verbatim to sub-processes. Using safe_pipe_capture
skips the shell entirely.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
6 years agoshell: drop git-cvsserver support by default
Jeff King [Mon, 11 Sep 2017 15:27:51 +0000 (11:27 -0400)]
shell: drop git-cvsserver support by default

The git-cvsserver script is old and largely unmaintained
these days. But git-shell allows untrusted users to run it
out of the box, significantly increasing its attack surface.

Let's drop it from git-shell's list of internal handlers so
that it cannot be run by default.  This is not backwards
compatible. But given the age and development activity on
CVS-related parts of Git, this is likely to impact very few
users, while helping many more (i.e., anybody who runs
git-shell and had no intention of supporting CVS).

There's no configuration mechanism in git-shell for us to
add a boolean and flip it to "off". But there is a mechanism
for adding custom commands, and adding CVS support here is
fairly trivial. Let's document it to give guidance to
anybody who really is still running cvsserver.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
6 years agocvsserver: use safe_pipe_capture for `constant commands` as well
Junio C Hamano [Mon, 11 Sep 2017 05:45:54 +0000 (14:45 +0900)]
cvsserver: use safe_pipe_capture for `constant commands` as well

This is not strictly necessary, but it is a good code hygiene.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
6 years agocvsserver: use safe_pipe_capture instead of backticks
joernchen [Mon, 11 Sep 2017 05:45:09 +0000 (14:45 +0900)]
cvsserver: use safe_pipe_capture instead of backticks

This makes the script pass arguments that are derived from end-user
input in safer way when invoking subcommands.

Reported-by: joernchen <joernchen@phenoelit.de>
Signed-off-by: joernchen <joernchen@phenoelit.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
6 years agocvsserver: move safe_pipe_capture() to the main package
Junio C Hamano [Mon, 11 Sep 2017 05:44:24 +0000 (14:44 +0900)]
cvsserver: move safe_pipe_capture() to the main package

As a preparation for replacing `command` with a call to this
function from outside GITCVS::updater package, move it to the main
package.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
6 years agoRelNotes: further fixes for 2.14.2 from the master front
Junio C Hamano [Sun, 10 Sep 2017 08:06:09 +0000 (17:06 +0900)]
RelNotes: further fixes for 2.14.2 from the master front

Signed-off-by: Junio C Hamano <gitster@pobox.com>
6 years agoMerge branch 'jt/doc-pack-objects-fix' into maint
Junio C Hamano [Sun, 10 Sep 2017 08:03:10 +0000 (17:03 +0900)]
Merge branch 'jt/doc-pack-objects-fix' into maint

Doc updates.

* jt/doc-pack-objects-fix:
  Doc: clarify that pack-objects makes packs, plural

6 years agoMerge branch 'jn/vcs-svn-cleanup' into maint
Junio C Hamano [Sun, 10 Sep 2017 08:03:09 +0000 (17:03 +0900)]
Merge branch 'jn/vcs-svn-cleanup' into maint

Code clean-up.

* jn/vcs-svn-cleanup:
  vcs-svn: move remaining repo_tree functions to fast_export.h
  vcs-svn: remove repo_delete wrapper function
  vcs-svn: remove custom mode constants
  vcs-svn: remove more unused prototypes and declarations

6 years agoMerge branch 'bc/vcs-svn-cleanup' into maint
Junio C Hamano [Sun, 10 Sep 2017 08:03:08 +0000 (17:03 +0900)]
Merge branch 'bc/vcs-svn-cleanup' into maint

Code clean-up.

* bc/vcs-svn-cleanup:
  vcs-svn: rename repo functions to "svn_repo"
  vcs-svn: remove unused prototypes

6 years agoMerge branch 'jk/doc-the-this' into maint
Junio C Hamano [Sun, 10 Sep 2017 08:03:07 +0000 (17:03 +0900)]
Merge branch 'jk/doc-the-this' into maint

Doc clean-up.

* jk/doc-the-this:
  doc: fix typo in sendemail.identity

6 years agoMerge branch 'rs/commit-h-single-parent-cleanup' into maint
Junio C Hamano [Sun, 10 Sep 2017 08:03:07 +0000 (17:03 +0900)]
Merge branch 'rs/commit-h-single-parent-cleanup' into maint

Code clean-up.

* rs/commit-h-single-parent-cleanup:
  commit: remove unused inline function single_parent()

6 years agoMerge branch 'mg/format-ref-doc-fix' into maint
Junio C Hamano [Sun, 10 Sep 2017 08:03:06 +0000 (17:03 +0900)]
Merge branch 'mg/format-ref-doc-fix' into maint

Doc fix.

* mg/format-ref-doc-fix:
  Documentation/git-for-each-ref: clarify peeling of tags for --format
  Documentation: use proper wording for ref format strings

6 years agoMerge branch 'sb/submodule-parallel-update' into maint
Junio C Hamano [Sun, 10 Sep 2017 08:03:06 +0000 (17:03 +0900)]
Merge branch 'sb/submodule-parallel-update' into maint

Code clean-up.

* sb/submodule-parallel-update:
  submodule.sh: remove unused variable

6 years agoMerge branch 'hv/t5526-andand-chain-fix' into maint
Junio C Hamano [Sun, 10 Sep 2017 08:03:05 +0000 (17:03 +0900)]
Merge branch 'hv/t5526-andand-chain-fix' into maint

Test fix.

* hv/t5526-andand-chain-fix:
  t5526: fix some broken && chains

6 years agoMerge branch 'sb/sha1-file-cleanup' into maint
Junio C Hamano [Sun, 10 Sep 2017 08:03:04 +0000 (17:03 +0900)]
Merge branch 'sb/sha1-file-cleanup' into maint

Code clean-up.

* sb/sha1-file-cleanup:
  sha1_file: make read_info_alternates static

6 years agoMerge branch 'rs/t1002-do-not-use-sum' into maint
Junio C Hamano [Sun, 10 Sep 2017 08:03:04 +0000 (17:03 +0900)]
Merge branch 'rs/t1002-do-not-use-sum' into maint

Test simplification.

* rs/t1002-do-not-use-sum:
  t1002: stop using sum(1)

6 years agoMerge branch 'ah/doc-empty-string-is-false' into maint
Junio C Hamano [Sun, 10 Sep 2017 08:03:03 +0000 (17:03 +0900)]
Merge branch 'ah/doc-empty-string-is-false' into maint

Doc update.

* ah/doc-empty-string-is-false:
  doc: clarify "config --bool" behaviour with empty string

6 years agoMerge branch 'rs/merge-microcleanup' into maint
Junio C Hamano [Sun, 10 Sep 2017 08:03:02 +0000 (17:03 +0900)]
Merge branch 'rs/merge-microcleanup' into maint

Code clean-up.

* rs/merge-microcleanup:
  merge: use skip_prefix()

6 years agoMerge branch 'rs/find-pack-entry-bisection' into maint
Junio C Hamano [Sun, 10 Sep 2017 08:03:02 +0000 (17:03 +0900)]
Merge branch 'rs/find-pack-entry-bisection' into maint

Code clean-up.

* rs/find-pack-entry-bisection:
  sha1_file: avoid comparison if no packed hash matches the first byte

6 years agoMerge branch 'rs/apply-lose-prefix-length' into maint
Junio C Hamano [Sun, 10 Sep 2017 08:03:01 +0000 (17:03 +0900)]
Merge branch 'rs/apply-lose-prefix-length' into maint

Code clean-up.

* rs/apply-lose-prefix-length:
  apply: remove prefix_length member from apply_state

6 years agoMerge branch 'rj/add-chmod-error-message' into maint
Junio C Hamano [Sun, 10 Sep 2017 08:03:00 +0000 (17:03 +0900)]
Merge branch 'rj/add-chmod-error-message' into maint

Message fix.

* rj/add-chmod-error-message:
  builtin/add: add detail to a 'cannot chmod' error message

6 years agoMerge branch 'jk/hashcmp-memcmp' into maint
Junio C Hamano [Sun, 10 Sep 2017 08:02:59 +0000 (17:02 +0900)]
Merge branch 'jk/hashcmp-memcmp' into maint

Code clean-up.

* jk/hashcmp-memcmp:
  hashcmp: use memcmp instead of open-coded loop

6 years agoMerge branch 'rs/t3700-clean-leftover' into maint
Junio C Hamano [Sun, 10 Sep 2017 08:02:58 +0000 (17:02 +0900)]
Merge branch 'rs/t3700-clean-leftover' into maint

A test fix.

* rs/t3700-clean-leftover:
  t3700: fix broken test under !POSIXPERM

6 years agoMerge branch 'jc/perl-git-comment-typofix' into maint
Junio C Hamano [Sun, 10 Sep 2017 08:02:57 +0000 (17:02 +0900)]
Merge branch 'jc/perl-git-comment-typofix' into maint

A comment fix.

* jc/perl-git-comment-typofix:
  perl/Git.pm: typofix in a comment

6 years agoMerge branch 'mf/no-dashed-subcommands' into maint
Junio C Hamano [Sun, 10 Sep 2017 08:02:56 +0000 (17:02 +0900)]
Merge branch 'mf/no-dashed-subcommands' into maint

Code clean-up.

* mf/no-dashed-subcommands:
  scripts: use "git foo" not "git-foo"

6 years agoMerge branch 'ab/ref-filter-no-contains' into maint
Junio C Hamano [Sun, 10 Sep 2017 08:02:56 +0000 (17:02 +0900)]
Merge branch 'ab/ref-filter-no-contains' into maint

A test fix.

* ab/ref-filter-no-contains:
  tests: don't give unportable ">" to "test" built-in, use -gt

6 years agoMerge branch 'rs/archive-excluded-directory' into maint
Junio C Hamano [Sun, 10 Sep 2017 08:02:55 +0000 (17:02 +0900)]
Merge branch 'rs/archive-excluded-directory' into maint

"git archive" did not work well with pathspecs and the
export-ignore attribute.

We may want to resurrect the "we don't archive an empty directory"
bonus patch, but I do not mind merging the above early to 'next'
and leave it as a separate follow-up enhancement.
cf. <20170820090629.tumvqwzkromcykjf@sigill.intra.peff.net>

* rs/archive-excluded-directory:
  archive: don't queue excluded directories
  archive: factor out helper functions for handling attributes
  t5001: add tests for export-ignore attributes and exclude pathspecs

6 years agoMerge branch 'mg/killed-merge' into maint
Junio C Hamano [Sun, 10 Sep 2017 08:02:55 +0000 (17:02 +0900)]
Merge branch 'mg/killed-merge' into maint

Killing "git merge --edit" before the editor returns control left
the repository in a state with MERGE_MSG but without MERGE_HEAD,
which incorrectly tells the subsequent "git commit" that there was
a squash merge in progress.  This has been fixed.

* mg/killed-merge:
  merge: save merge state earlier
  merge: split write_merge_state in two
  merge: clarify call chain
  Documentation/git-merge: explain --continue

6 years agoMerge branch 'tb/apply-with-crlf' into maint
Junio C Hamano [Sun, 10 Sep 2017 08:02:55 +0000 (17:02 +0900)]
Merge branch 'tb/apply-with-crlf' into maint

"git apply" that is used as a better "patch -p1" failed to apply a
taken from a file with CRLF line endings to a file with CRLF line
endings.  The root cause was because it misused convert_to_git()
that tried to do "safe-crlf" processing by looking at the index
entry at the same path, which is a nonsense---in that mode, "apply"
is not working on the data in (or derived from) the index at all.
This has been fixed.

* tb/apply-with-crlf:
  apply: file commited with CRLF should roundtrip diff and apply
  convert: add SAFE_CRLF_KEEP_CRLF

6 years agoMerge branch 'cc/subprocess-handshake-missing-capabilities' into maint
Junio C Hamano [Sun, 10 Sep 2017 08:02:55 +0000 (17:02 +0900)]
Merge branch 'cc/subprocess-handshake-missing-capabilities' into maint

When handshake with a subprocess filter notices that the process
asked for an unknown capability, Git did not report what program
the offending subprocess was running.  This has been corrected.

We may want a follow-up fix to tighten the error checking, though.

* cc/subprocess-handshake-missing-capabilities:
  sub-process: print the cmd when a capability is unsupported

6 years agoMerge branch 'as/grep-quiet-no-match-exit-code-fix' into maint
Junio C Hamano [Sun, 10 Sep 2017 08:02:55 +0000 (17:02 +0900)]
Merge branch 'as/grep-quiet-no-match-exit-code-fix' into maint

"git grep -L" and "git grep --quiet -L" reported different exit
codes; this has been corrected.

* as/grep-quiet-no-match-exit-code-fix:
  git-grep: correct exit code with --quiet and -L

6 years agoMerge branch 'kd/stash-with-bash-4.4' into maint
Junio C Hamano [Sun, 10 Sep 2017 08:02:54 +0000 (17:02 +0900)]
Merge branch 'kd/stash-with-bash-4.4' into maint

bash 4.4 or newer gave a warning on NUL byte in command
substitution done in "git stash"; this has been squelched.

* kd/stash-with-bash-4.4:
  stash: prevent warning about null bytes in input

6 years agoMerge branch 'rs/win32-syslog-leakfix' into maint
Junio C Hamano [Sun, 10 Sep 2017 08:02:54 +0000 (17:02 +0900)]
Merge branch 'rs/win32-syslog-leakfix' into maint

Memory leak in an error codepath has been plugged.

* rs/win32-syslog-leakfix:
  win32: plug memory leak on realloc() failure in syslog()

6 years agoMerge branch 'rs/unpack-entry-leakfix' into maint
Junio C Hamano [Sun, 10 Sep 2017 08:02:53 +0000 (17:02 +0900)]
Merge branch 'rs/unpack-entry-leakfix' into maint

Memory leak in an error codepath has been plugged.

* rs/unpack-entry-leakfix:
  sha1_file: release delta_stack on error in unpack_entry()

6 years agoMerge branch 'rs/fsck-obj-leakfix' into maint
Junio C Hamano [Sun, 10 Sep 2017 08:02:52 +0000 (17:02 +0900)]
Merge branch 'rs/fsck-obj-leakfix' into maint

Memory leak in an error codepath has been plugged.

* rs/fsck-obj-leakfix:
  fsck: free buffers on error in fsck_obj()

6 years agoMerge branch 'ur/svn-local-zone' into maint
Junio C Hamano [Sun, 10 Sep 2017 08:02:52 +0000 (17:02 +0900)]
Merge branch 'ur/svn-local-zone' into maint

"git svn" used with "--localtime" option did not compute the tz
offset for the timestamp in question and instead always used the
current time, which has been corrected.

* ur/svn-local-zone:
  git svn fetch: Create correct commit timestamp when using --localtime

6 years agoMerge branch 'pw/am-signoff' into maint
Junio C Hamano [Sun, 10 Sep 2017 08:02:51 +0000 (17:02 +0900)]
Merge branch 'pw/am-signoff' into maint

"git am -s" has been taught that some input may end with a trailer
block that is not Signed-off-by: and it should refrain from adding
an extra blank line before adding a new sign-off in such a case.

* pw/am-signoff:
  am: fix signoff when other trailers are present

6 years agoMerge branch 'rs/in-obsd-basename-dirname-take-const' into maint
Junio C Hamano [Sun, 10 Sep 2017 08:02:51 +0000 (17:02 +0900)]
Merge branch 'rs/in-obsd-basename-dirname-take-const' into maint

Portability fix.

* rs/in-obsd-basename-dirname-take-const:
  test-path-utils: handle const parameter of basename and dirname

6 years agoMerge branch 'rs/t4062-obsd' into maint
Junio C Hamano [Sun, 10 Sep 2017 08:02:51 +0000 (17:02 +0900)]
Merge branch 'rs/t4062-obsd' into maint

Test portability fix.

* rs/t4062-obsd:
  t4062: use less than 256 repetitions in regex

6 years agoMerge branch 'rs/obsd-getcwd-workaround' into maint
Junio C Hamano [Sun, 10 Sep 2017 08:02:50 +0000 (17:02 +0900)]
Merge branch 'rs/obsd-getcwd-workaround' into maint

Test portability fix for BSDs.

* rs/obsd-getcwd-workaround:
  t0001: skip test with restrictive permissions if getpwd(3) respects them

6 years agoMerge branch 'bw/clone-recursive-quiet' into maint
Junio C Hamano [Sun, 10 Sep 2017 08:02:49 +0000 (17:02 +0900)]
Merge branch 'bw/clone-recursive-quiet' into maint

"git clone --recurse-submodules --quiet" did not pass the quiet
option down to submodules.

* bw/clone-recursive-quiet:
  clone: teach recursive clones to respect -q

6 years agoMerge branch 'pw/sequence-rerere-autoupdate' into maint
Junio C Hamano [Sun, 10 Sep 2017 08:02:49 +0000 (17:02 +0900)]
Merge branch 'pw/sequence-rerere-autoupdate' into maint

Commands like "git rebase" accepted the --rerere-autoupdate option
from the command line, but did not always use it.  This has been
fixed.

* pw/sequence-rerere-autoupdate:
  cherry-pick/revert: reject --rerere-autoupdate when continuing
  cherry-pick/revert: remember --rerere-autoupdate
  t3504: use test_commit
  rebase -i: honor --rerere-autoupdate
  rebase: honor --rerere-autoupdate
  am: remember --rerere-autoupdate setting

6 years agoMerge branch 'bw/push-options-recursively-to-submodules' into maint
Junio C Hamano [Sun, 10 Sep 2017 08:02:49 +0000 (17:02 +0900)]
Merge branch 'bw/push-options-recursively-to-submodules' into maint

"git push --recurse-submodules $there HEAD:$target" was not
propagated down to the submodules, but now it is.

* bw/push-options-recursively-to-submodules:
  submodule--helper: teach push-check to handle HEAD

6 years agoMerge branch 'ma/pager-per-subcommand-action' into maint
Junio C Hamano [Sun, 10 Sep 2017 08:02:48 +0000 (17:02 +0900)]
Merge branch 'ma/pager-per-subcommand-action' into maint

The "tag.pager" configuration variable was useless for those who
actually create tag objects, as it interfered with the use of an
editor.  A new mechanism has been introduced for commands to enable
pager depending on what operation is being carried out to fix this,
and then "git tag -l" is made to run pager by default.

If this works out OK, I think there are low-hanging fruits in
other commands like "git branch" that outputs long list in one mode
while taking input in another.

* ma/pager-per-subcommand-action:
  git.c: ignore pager.* when launching builtin as dashed external
  tag: change default of `pager.tag` to "on"
  tag: respect `pager.tag` in list-mode only
  t7006: add tests for how git tag paginates
  git.c: provide setup_auto_pager()
  git.c: let builtins opt for handling `pager.foo` themselves
  builtin.h: take over documentation from api-builtin.txt

6 years agoMerge branch 'jk/rev-list-empty-input' into maint
Junio C Hamano [Sun, 10 Sep 2017 08:02:48 +0000 (17:02 +0900)]
Merge branch 'jk/rev-list-empty-input' into maint

"git log --tag=no-such-tag" showed log starting from HEAD, which
has been fixed---it now shows nothing.

* jk/rev-list-empty-input:
  revision: do not fallback to default when rev_input_given is set
  rev-list: don't show usage when we see empty ref patterns
  revision: add rev_input_given flag
  t6018: flesh out empty input/output rev-list tests

6 years agoMerge branch 'st/lib-gpg-kill-stray-agent' into maint
Junio C Hamano [Sun, 10 Sep 2017 08:02:48 +0000 (17:02 +0900)]
Merge branch 'st/lib-gpg-kill-stray-agent' into maint

Some versions of GnuPG fails to kill gpg-agent it auto-spawned
and such a left-over agent can interfere with a test.  Work it
around by attempting to kill one before starting a new test.

* st/lib-gpg-kill-stray-agent:
  t: lib-gpg: flush gpg agent on startup

6 years agocommit-tree: do not complete line in -F input
Ross Kabus [Thu, 7 Sep 2017 14:41:11 +0000 (10:41 -0400)]
commit-tree: do not complete line in -F input

"git commit-tree -F <file>", unlike "cat <file> | git
commit-tree" (i.e. feeding the same contents from the standard
input), added a missing final newline when the input ended in an
incomplete line.

Correct this inconsistency by leaving the incomplete line as-is,
as erring on the side of not touching the input is preferrable
and expected for a plumbing command like "commit-tree".

Signed-off-by: Ross Kabus <rkabus@aerotech.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
6 years agorev-parse: don't trim bisect refnames
Jeff King [Wed, 6 Sep 2017 11:53:10 +0000 (07:53 -0400)]
rev-parse: don't trim bisect refnames

Using for_each_ref_in() with a full refname has always been
a questionable practice, but it became an error with
b9c8e7f2fb (prefix_ref_iterator: don't trim too much,
2017-05-22), making "git rev-parse --bisect" pretty reliably
show a BUG.

Commit 03df567fbf (for_each_bisect_ref(): don't trim
refnames, 2017-06-18) fixed this case for revision.c, but
rev-parse handles this option on its own. We can use the
same solution here (and piggy-back on its test).

Signed-off-by: Jeff King <peff@peff.net>
Acked-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
6 years agosend-email: don't use Mail::Address, even if available
Matthieu Moy [Wed, 23 Aug 2017 10:21:02 +0000 (12:21 +0200)]
send-email: don't use Mail::Address, even if available

Using Mail::Address made sense when we didn't have a proper parser. We
now have a reasonable address parser, and using Mail::Address
_if available_ causes much more trouble than it gives benefits:

* Developers typically test one version, not both.

* Users may not be aware that installing Mail::Address will change the
  behavior. They may complain about the behavior in one case without
  knowing that Mail::Address is involved.

* Having this optional Mail::Address makes it tempting to anwser "please
  install Mail::Address" to users instead of fixing our own code. We've
  reached the stage where bugs in our parser should be fixed, not worked
  around.

Signed-off-by: Matthieu Moy <git@matthieu-moy.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
6 years agosend-email: fix garbage removal after address
Matthieu Moy [Wed, 23 Aug 2017 10:21:01 +0000 (12:21 +0200)]
send-email: fix garbage removal after address

This is a followup over 9d33439 (send-email: only allow one address
per body tag, 2017-02-20). The first iteration did allow writting

Cc: <foo@example.com> # garbage
but did so by matching the regex ([^>]*>?), i.e. stop after the first
instance of '>'. However, it did not properly deal with

Cc: foo@example.com # garbage
Fix this using a new function strip_garbage_one_address, which does
essentially what the old ([^>]*>?) was doing, but dealing with more
corner-cases. Since we've allowed

Cc: "Foo # Bar" <foobar@example.com>
in previous versions, it makes sense to continue allowing it (but we
still remove any garbage after it). OTOH, when an address is given
without quoting, we just take the first word and ignore everything
after.

Signed-off-by: Matthieu Moy <git@matthieu-moy.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
6 years agoPrepare for 2.14.2
Junio C Hamano [Wed, 23 Aug 2017 21:36:03 +0000 (14:36 -0700)]
Prepare for 2.14.2

Signed-off-by: Junio C Hamano <gitster@pobox.com>
6 years agoMerge branch 'jt/t1450-fsck-corrupt-packfile' into maint
Junio C Hamano [Wed, 23 Aug 2017 21:33:52 +0000 (14:33 -0700)]
Merge branch 'jt/t1450-fsck-corrupt-packfile' into maint

A test update.

* jt/t1450-fsck-corrupt-packfile:
  tests: ensure fsck fails on corrupt packfiles

6 years agoMerge branch 'jb/t8008-cleanup' into maint
Junio C Hamano [Wed, 23 Aug 2017 21:33:52 +0000 (14:33 -0700)]
Merge branch 'jb/t8008-cleanup' into maint

Code clean-up.

* jb/t8008-cleanup:
  t8008: rely on rev-parse'd HEAD instead of sha1 value

6 years agoMerge branch 'jt/subprocess-handshake' into maint
Junio C Hamano [Wed, 23 Aug 2017 21:33:52 +0000 (14:33 -0700)]
Merge branch 'jt/subprocess-handshake' into maint

Code cleanup.

* jt/subprocess-handshake:
  sub-process: refactor handshake to common function
  Documentation: migrate sub-process docs to header
  convert: add "status=delayed" to filter process protocol
  convert: refactor capabilities negotiation
  convert: move multiple file filter error handling to separate function
  convert: put the flags field before the flag itself for consistent style
  t0021: write "OUT <size>" only on success
  t0021: make debug log file name configurable
  t0021: keep filter log files on comparison

6 years agoMerge branch 'dc/fmt-merge-msg-microcleanup' into maint
Junio C Hamano [Wed, 23 Aug 2017 21:33:52 +0000 (14:33 -0700)]
Merge branch 'dc/fmt-merge-msg-microcleanup' into maint

Code cleanup.

* dc/fmt-merge-msg-microcleanup:
  fmt-merge-msg: fix coding style

6 years agoMerge branch 'ah/doc-wserrorhighlight' into maint
Junio C Hamano [Wed, 23 Aug 2017 21:33:51 +0000 (14:33 -0700)]
Merge branch 'ah/doc-wserrorhighlight' into maint

Doc update.

* ah/doc-wserrorhighlight:
  doc: add missing values "none" and "default" for diff.wsErrorHighlight

6 years agoMerge branch 'cc/ref-is-hidden-microcleanup' into maint
Junio C Hamano [Wed, 23 Aug 2017 21:33:50 +0000 (14:33 -0700)]
Merge branch 'cc/ref-is-hidden-microcleanup' into maint

Code cleanup.

* cc/ref-is-hidden-microcleanup:
  refs: use skip_prefix() in ref_is_hidden()

6 years agoMerge branch 'js/run-process-parallel-api-fix' into maint
Junio C Hamano [Wed, 23 Aug 2017 21:33:49 +0000 (14:33 -0700)]
Merge branch 'js/run-process-parallel-api-fix' into maint

API fix.

* js/run-process-parallel-api-fix:
  run_processes_parallel: change confusing task_cb convention

6 years agoMerge branch 'rs/pack-objects-pbase-cleanup' into maint
Junio C Hamano [Wed, 23 Aug 2017 21:33:48 +0000 (14:33 -0700)]
Merge branch 'rs/pack-objects-pbase-cleanup' into maint

Code clean-up.

* rs/pack-objects-pbase-cleanup:
  pack-objects: remove unnecessary NULL check

6 years agoMerge branch 'jt/fsck-code-cleanup' into maint
Junio C Hamano [Wed, 23 Aug 2017 21:33:48 +0000 (14:33 -0700)]
Merge branch 'jt/fsck-code-cleanup' into maint

Code clean-up.

* jt/fsck-code-cleanup:
  fsck: cleanup unused variable
  object: remove "used" field from struct object
  fsck: remove redundant parse_tree() invocation