gitweb.git
Merge branch 'sb/merge-commit-msg-hook' into nextJunio C Hamano Mon, 25 Sep 2017 06:31:53 +0000 (15:31 +0900)

Merge branch 'sb/merge-commit-msg-hook' into next

Add documentation for a topic that has recently graduated to the
'master' branch.

* sb/merge-commit-msg-hook:
Documentation/githooks: mention merge in commit-msg hook

Merge branch 'jt/fast-export-copy-modify-fix' into... Junio C Hamano Sun, 24 Sep 2017 10:39:43 +0000 (19:39 +0900)

Merge branch 'jt/fast-export-copy-modify-fix' into next

"git fast-export" with -M/-C option issued "copy" instruction on a
path that is simultaneously modified, which was incorrect.

* jt/fast-export-copy-modify-fix:
fast-export: do not copy from modified file

Merge branch 'jk/revision-remove-cmdline-pathspec'... Junio C Hamano Sun, 24 Sep 2017 10:39:42 +0000 (19:39 +0900)

Merge branch 'jk/revision-remove-cmdline-pathspec' into next

Code clean-up that also plugs memory leaks.

* jk/revision-remove-cmdline-pathspec:
pathspec doc: parse_pathspec does not maintain references to args
revision: replace "struct cmdline_pathspec" with argv_array

Merge branch 'tb/test-lint-echo-e' into nextJunio C Hamano Sun, 24 Sep 2017 10:39:42 +0000 (19:39 +0900)

Merge branch 'tb/test-lint-echo-e' into next

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

Merge branch 'mk/describe-match-with-all' into nextJunio C Hamano Sun, 24 Sep 2017 10:39:42 +0000 (19:39 +0900)

Merge branch 'mk/describe-match-with-all' into next

"git describe --match <pattern>" has been taught to play well with
the "--all" option.

* mk/describe-match-with-all:
describe: teach --match to handle branches and remotes

Merge branch 'mh/for-each-string-list-item-empty-fix... Junio C Hamano Sun, 24 Sep 2017 10:39:41 +0000 (19:39 +0900)

Merge branch 'mh/for-each-string-list-item-empty-fix' into next

Code cmp.std.c nitpick.

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

Merge branch 'jk/info-alternates-fix' into nextJunio C Hamano Sun, 24 Sep 2017 10:39:41 +0000 (19:39 +0900)

Merge branch 'jk/info-alternates-fix' into next

A regression fix for 2.11 that made the code to read the list of
alternate object stores overrun the end of the string.

* jk/info-alternates-fix:
read_info_alternates: warn on non-trivial errors
read_info_alternates: read contents into strbuf

Merge branch 'rj/test-ulimit-on-windows' into nextJunio C Hamano Sun, 24 Sep 2017 10:39:41 +0000 (19:39 +0900)

Merge branch 'rj/test-ulimit-on-windows' into next

On Cygwin, "ulimit -s" does not report failure but it does not work
at all, which causes an unexpected success of some tests that
expect failures under a limited stack situation. This has been
fixed.

* rj/test-ulimit-on-windows:
t9010-*.sh: skip all tests if the PIPE prereq is missing
test-lib: use more compact expression in PIPE prerequisite
test-lib: don't use ulimit in test prerequisites on cygwin

Merge branch 'ow/rev-parse-is-shallow-repo' into nextJunio C Hamano Sun, 24 Sep 2017 10:39:41 +0000 (19:39 +0900)

Merge branch 'ow/rev-parse-is-shallow-repo' into next

"git rev-parse" learned "--is-shallow-repository", that is to be
used in a way similar to existing "--is-bare-repository" and
friends.

* ow/rev-parse-is-shallow-repo:
rev-parse: rev-parse: add --is-shallow-repository

Merge branch 'ks/test-readme-phrasofix' into nextJunio C Hamano Sun, 24 Sep 2017 10:39:40 +0000 (19:39 +0900)

Merge branch 'ks/test-readme-phrasofix' into next

Doc updates.

* ks/test-readme-phrasofix:
t/README: fix typo and grammatically improve a sentence

Merge branch 'jm/status-ignored-directory-optim' into... Junio C Hamano Sun, 24 Sep 2017 10:39:40 +0000 (19:39 +0900)

Merge branch 'jm/status-ignored-directory-optim' into next

"git status --ignored", when noticing that a directory without any
tracked path is ignored, still enumerated all the ignored paths in
the directory, which is unnecessary. The codepath has been
optimized to avoid this overhead.

* jm/status-ignored-directory-optim:
Improve performance of git status --ignored

Merge branch 'bc/rev-parse-parseopt-fix' into nextJunio C Hamano Sun, 24 Sep 2017 10:39:40 +0000 (19:39 +0900)

Merge branch 'bc/rev-parse-parseopt-fix' into next

Recent versions of "git rev-parse --parseopt" did not parse the
option specification that does not have the optional flags (*=?!)
correctly, which has been corrected.

* bc/rev-parse-parseopt-fix:
git-rebase: don't ignore unexpected command line arguments
rev-parse parseopt: interpret any whitespace as start of help text
rev-parse parseopt: do not search help text for flag chars
t1502: demonstrate rev-parse --parseopt option mis-parsing

Merge branch 'aw/gc-lockfile-fscanf-fix' into nextJunio C Hamano Sun, 24 Sep 2017 10:39:40 +0000 (19:39 +0900)

Merge branch 'aw/gc-lockfile-fscanf-fix' into next

"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

Merge branch 'jk/describe-omit-some-refs' into nextJunio C Hamano Sun, 24 Sep 2017 10:39:39 +0000 (19:39 +0900)

Merge branch 'jk/describe-omit-some-refs' into next

"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

Merge branch 'hv/mv-nested-submodules-test' into nextJunio C Hamano Sun, 24 Sep 2017 10:39:38 +0000 (19:39 +0900)

Merge branch 'hv/mv-nested-submodules-test' into next

A test to demonstrate "git mv" failing to adjust nested submodules
has been added.

* hv/mv-nested-submodules-test:
add test for bug in git-mv for recursive submodules

Merge branch 'bw/git-clang-format' into nextJunio C Hamano Sun, 24 Sep 2017 10:39:38 +0000 (19:39 +0900)

Merge branch 'bw/git-clang-format' into next

"make style" runs git-clang-format to help developers by pointing
out coding style issues.

* bw/git-clang-format:
Makefile: add style build rule
clang-format: outline the git project's coding style

Merge branch 'ls/travis-scriptify' into nextJunio C Hamano Sun, 24 Sep 2017 10:39:37 +0000 (19:39 +0900)

Merge branch 'ls/travis-scriptify' into next

The scripts to drive TravisCI has been reorganized and then an
optimization to avoid spending cycles on a branch whose tip is
tagged has been implemented.

* ls/travis-scriptify:
travis-ci: fix "skip_branch_tip_with_tag()" string comparison

Documentation/githooks: mention merge in commit-msg... Stefan Beller Thu, 21 Sep 2017 20:29:54 +0000 (13:29 -0700)

Documentation/githooks: mention merge in commit-msg hook

The commit-msg hook is invoked by both commit and merge now.

Reported-by: Kaartic Sivaraam <kaarticsivaraam91196@gmail.com>
Signed-off-by: Stefan Beller <sbeller@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

travis-ci: fix "skip_branch_tip_with_tag()" string... Lars Schneider Thu, 21 Sep 2017 20:48:30 +0000 (22:48 +0200)

travis-ci: fix "skip_branch_tip_with_tag()" string comparison

09f5e97 ("travis-ci: skip a branch build if equal tag is present",
2017-09-17) introduced the "skip_branch_tip_with_tag" function with
a broken string comparison. Fix it!

Reported-by: SZEDER Gábor <szeder.dev@gmail.com>
Signed-off-by: Lars Schneider <larsxschneider@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

pathspec doc: parse_pathspec does not maintain referenc... Jonathan Nieder Thu, 21 Sep 2017 04:41:12 +0000 (21:41 -0700)

pathspec doc: parse_pathspec does not maintain references to args

The command line arguments passed to main() are valid for the life of
a program, but the same is not true for all other argv-style arrays
(e.g. when a caller creates an argv_array). Clarify that
parse_pathspec does not rely on the argv passed to it to remain valid.

This makes it easier to tell that callers like "git rev-list --stdin"
are safe and ensures that that is more likely to remain true as the
implementation of parse_pathspec evolves.

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Sync with masterJunio C Hamano Thu, 21 Sep 2017 04:40:33 +0000 (13:40 +0900)

Sync with master

* master:

Merge branch 'jk/leak-checkers'Junio C Hamano Thu, 21 Sep 2017 04:38:37 +0000 (13:38 +0900)

Merge branch 'jk/leak-checkers'

Many of our programs consider that it is OK to release dynamic
storage that is used throughout the life of the program by simply
exiting, but this makes it harder to leak detection tools to avoid
reporting false positives. Plug many existing leaks and introduce
a mechanism for developers to mark that the region of memory
pointed by a pointer is not lost/leaking to help these tools.

* jk/leak-checkers:
git-compat-util: make UNLEAK less error-prone

fast-export: do not copy from modified fileJonathan Tan Wed, 20 Sep 2017 23:55:02 +0000 (16:55 -0700)

fast-export: do not copy from modified file

When run with the "-C" option, fast-export writes 'C' commands in its
output whenever the internal diff mechanism detects a file copy,
indicating that fast-import should copy the given existing file to the
given new filename. However, the diff mechanism works against the
prior version of the file, whereas fast-import uses whatever is current.
This causes issues when a commit both modifies a file and uses it as the
source for a copy.

Therefore, teach fast-export to refrain from writing 'C' when it has
already written a modification command for a file.

An existing test in t9350-fast-export is also fixed in this patch. The
existing line "C file6 file7" copies the wrong version of file6, but it
has coincidentally worked because file7 was subsequently overridden.

Reported-by: Juraj Oršulić <juraj.orsulic@fer.hr>
Signed-off-by: Jonathan Tan <jonathantanmy@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

revision: replace "struct cmdline_pathspec" with argv_arrayJeff King Wed, 20 Sep 2017 20:36:59 +0000 (16:36 -0400)

revision: replace "struct cmdline_pathspec" with argv_array

We assemble an array of strings in a custom struct,
NULL-terminate the result, and then pass it to
parse_pathspec().

But then we never free the array or the individual strings
(nor can we do the latter, as they are heap-allocated when
they come from stdin but not when they come from the
passed-in argv).

Let's swap this out for an argv_array. It does the same
thing with fewer lines of code, and it's safe to call
argv_array_clear() at the end to avoid a memory leak.

Reported-by: Martin Ågren <martin.agren@gmail.com>
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

test-lint: echo -e (or -E) is not portableTorsten 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>

Merge branch 'jk/leak-checkers' into nextJunio C Hamano Wed, 20 Sep 2017 06:04:16 +0000 (15:04 +0900)

Merge branch 'jk/leak-checkers' into next

Many of our programs consider that it is OK to release dynamic
storage that is used throughout the life of the program by simply
exiting, but this makes it harder to leak detection tools to avoid
reporting false positives. Plug many existing leaks and introduce
a mechanism for developers to mark that the region of memory
pointed by a pointer is not lost/leaking to help these tools.

* jk/leak-checkers:
git-compat-util: make UNLEAK less error-prone

git-compat-util: make UNLEAK less error-proneJonathan Tan Tue, 19 Sep 2017 22:10:04 +0000 (15:10 -0700)

git-compat-util: make UNLEAK less error-prone

Commit 0e5bba5 ("add UNLEAK annotation for reducing leak false
positives", 2017-09-08) introduced an UNLEAK macro to be used as
"UNLEAK(var);", but its existing definitions leave semicolons that act
as empty statements, which will lead to syntax errors, e.g.

if (condition)
UNLEAK(var);
else
something_else(var);

would be broken with two statements between if (condition) and else.
Lose the excess semicolon from the end of the macro replacement text.

Signed-off-by: Jonathan Tan <jonathantanmy@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

for_each_string_list_item: avoid undefined behavior... 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>

describe: teach --match to handle branches and remotesMax Kirillov Wed, 20 Sep 2017 01:10:10 +0000 (04:10 +0300)

describe: teach --match to handle branches and remotes

When `git describe` uses `--match`, it matches only tags, basically
ignoring the `--all` argument even when it is specified.

Fix it by also matching branch name and $remote_name/$remote_branch_name,
for remote-tracking references, with the specified patterns. Update
documentation accordingly and add tests.

Signed-off-by: Max Kirillov <max@max630.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Merge branch 'jk/describe-omit-some-refs' into mk/descr... Junio C Hamano Wed, 20 Sep 2017 04:30:01 +0000 (13:30 +0900)

Merge branch 'jk/describe-omit-some-refs' into mk/describe-match-with-all

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

read_info_alternates: warn on non-trivial errorsJeff King Tue, 19 Sep 2017 19:41:10 +0000 (15:41 -0400)

read_info_alternates: warn on non-trivial errors

When we fail to open $GIT_DIR/info/alternates, we silently
assume there are no alternates. This is the right thing to
do for ENOENT, but not for other errors.

A hard error is probably overkill here. If we fail to read
an alternates file then either we'll complete our operation
anyway, or we'll fail to find some needed object. Either
way, a warning is good idea. And we already have a helper
function to handle this pattern; let's just call
warn_on_fopen_error().

Note that technically the errno from strbuf_read_file()
might be from a read() error, not open(). But since read()
would never return ENOENT or ENOTDIR, and since it produces
a generic "unable to access" error, it's suitable for
handling errors from either.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Merge branch 'jk/info-alternates-fix-2.11' into jk... Junio C Hamano Wed, 20 Sep 2017 02:33:06 +0000 (11:33 +0900)

Merge branch 'jk/info-alternates-fix-2.11' into jk/info-alternates-fix

* jk/info-alternates-fix-2.11:
read_info_alternates: read contents into strbuf

read_info_alternates: read contents into strbufJeff King Tue, 19 Sep 2017 19:41:07 +0000 (15:41 -0400)

read_info_alternates: read contents into strbuf

This patch fixes a regression in v2.11.1 where we might read
past the end of an mmap'd buffer. It was introduced in
cf3c635210.

The link_alt_odb_entries() function has always taken a
ptr/len pair as input. Until cf3c635210 (alternates: accept
double-quoted paths, 2016-12-12), we made a copy of those
bytes in a string. But after that commit, we switched to
parsing the input left-to-right, and we ignore "len"
totally, instead reading until we hit a NUL.

This has mostly gone unnoticed for a few reasons:

1. All but one caller passes a NUL-terminated string, with
"len" pointing to the NUL.

2. The remaining caller, read_info_alternates(), passes in
an mmap'd file. Unless the file is an exact multiple of
the page size, it will generally be followed by NUL
padding to the end of the page, which just works.

The easiest way to demonstrate the problem is to build with:

make SANITIZE=address NO_MMAP=Nope test

Any test which involves $GIT_DIR/info/alternates will fail,
as the mmap emulation (correctly) does not add an extra NUL,
and ASAN complains about reading past the end of the buffer.

One solution would be to teach link_alt_odb_entries() to
respect "len". But it's actually a bit tricky, since we
depend on unquote_c_style() under the hood, and it has no
ptr/len variant.

We could also just make a NUL-terminated copy of the input
bytes and operate on that. But since all but one caller
already is passing a string, instead let's just fix that
caller to provide NUL-terminated input in the first place,
by swapping out mmap for strbuf_read_file().

There's no advantage to using mmap on the alternates file.
It's not expected to be large (and anyway, we're copying its
contents into an in-memory linked list). Nor is using
git_open() buying us anything here, since we don't keep the
descriptor open for a long period of time.

Let's also drop the "len" parameter entirely from
link_alt_odb_entries(), since it's completely ignored. That
will avoid any new callers re-introducing a similar bug.

Reported-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Sync with masterJunio C Hamano Tue, 19 Sep 2017 03:53:13 +0000 (12:53 +0900)

Sync with master

* master:
The eighth batch for 2.15

Merge branch 'nm/imap-send-with-curl' into nextJunio C Hamano Tue, 19 Sep 2017 03:52:28 +0000 (12:52 +0900)

Merge branch 'nm/imap-send-with-curl' into next

"git imap-send" has our own implementation of the protocol and also
can use more recent libCurl with the imap protocol support. Update
the latter so that it can use the credential subsystem, and then
make it the default option to use, so that we can eventually
deprecate and remove the former.

* nm/imap-send-with-curl:
imap-send: use curl by default when possible
imap_send: setup_curl: retreive credentials if not set in config file
imap-send: add wrapper to get server credentials if needed
imap-send: return with error if curl failed

Merge branch 'ks/commit-do-not-touch-cut-line' into... Junio C Hamano Tue, 19 Sep 2017 03:52:28 +0000 (12:52 +0900)

Merge branch 'ks/commit-do-not-touch-cut-line' into next

The explanation of the cut-line in the commit log editor has been
slightly tweaked.

* ks/commit-do-not-touch-cut-line:
commit-template: change a message to be more intuitive

Merge branch 'tg/refs-allowed-flags' into nextJunio C Hamano Tue, 19 Sep 2017 03:52:28 +0000 (12:52 +0900)

Merge branch 'tg/refs-allowed-flags' into next

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

Merge branch 'rs/archive-excluded-directory' into nextJunio C Hamano Tue, 19 Sep 2017 03:52:27 +0000 (12:52 +0900)

Merge branch 'rs/archive-excluded-directory' into next

"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

Merge branch 'ks/help-alias-label' into nextJunio C Hamano Tue, 19 Sep 2017 03:52:27 +0000 (12:52 +0900)

Merge branch 'ks/help-alias-label' into next

"git help co" now says "co is aliased to ...", not "git co is".

* ks/help-alias-label:
help: change a message to be more precise

Merge branch 'jn/per-repo-object-store-fixes' into... Junio C Hamano Tue, 19 Sep 2017 03:52:27 +0000 (12:52 +0900)

Merge branch 'jn/per-repo-object-store-fixes' into next

Step #0 of a planned & larger series to make the in-core object
store per in-core repository object.

* jn/per-repo-object-store-fixes:
replace-objects: evaluate replacement refs without using the object store
push, fetch: error out for submodule entries not pointing to commits
pack: make packed_git_mru global a value instead of a pointer

Merge branch 'jk/write-in-full-fix' into nextJunio C Hamano Tue, 19 Sep 2017 03:52:27 +0000 (12:52 +0900)

Merge branch 'jk/write-in-full-fix' into next

Many codepaths did not diagnose write failures correctly when disks
go full, due to their misuse of write_in_full() helper function,
which have been corrected.

* jk/write-in-full-fix:
read_pack_header: handle signed/unsigned comparison in read result
config: flip return value of store_write_*()
notes-merge: use ssize_t for write_in_full() return value
pkt-line: check write_in_full() errors against "< 0"
convert less-trivial versions of "write_in_full() != len"
avoid "write_in_full(fd, buf, len) != len" pattern
get-tar-commit-id: check write_in_full() return against 0
config: avoid "write_in_full(fd, buf, len) < len" pattern

Merge branch 'ez/doc-duplicated-words-fix' into nextJunio C Hamano Tue, 19 Sep 2017 03:52:26 +0000 (12:52 +0900)

Merge branch 'ez/doc-duplicated-words-fix' into next

Typofix.

* ez/doc-duplicated-words-fix:
doc: fix minor typos (extra/duplicated words)

Merge branch 'kd/doc-for-each-ref' into nextJunio C Hamano Tue, 19 Sep 2017 03:52:26 +0000 (12:52 +0900)

Merge branch 'kd/doc-for-each-ref' into next

Doc update.

* kd/doc-for-each-ref:
doc/for-each-ref: explicitly specify option names
doc/for-each-ref: consistently use '=' to between argument names and values

Merge branch 'cc/subprocess-handshake-missing-capabilit... Junio C Hamano Tue, 19 Sep 2017 03:52:26 +0000 (12:52 +0900)

Merge branch 'cc/subprocess-handshake-missing-capabilities' into next

Finishing touches to a topic already in 'master'.

* cc/subprocess-handshake-missing-capabilities:
subprocess: loudly die when subprocess asks for an unsupported capability

Merge branch 'kw/write-index-reduce-alloc' into nextJunio C Hamano Tue, 19 Sep 2017 03:52:26 +0000 (12:52 +0900)

Merge branch 'kw/write-index-reduce-alloc' into next

A hotfix to a topic already in 'master'.

* kw/write-index-reduce-alloc:
read-cache: fix index corruption with index v4
Add t/helper/test-write-cache to .gitignore

t9010-*.sh: skip all tests if the PIPE prereq is missingRamsay Jones Sun, 17 Sep 2017 22:58:18 +0000 (23:58 +0100)

t9010-*.sh: skip all tests if the PIPE prereq is missing

Every test in this file, except one, is marked with the PIPE prereq.
However, that lone test ('set up svn repo'), only performs some setup
work and checks whether the following test should be executed (by
setting an additional SVNREPO prerequisite). Since the following test
also requires the PIPE prerequisite, performing the setup test, when the
PIPE preequisite is missing, is simply wasted effort. Use the skip-all
test facility to skip all tests when the PIPE prerequisite is missing.

Signed-off-by: Ramsay Jones <ramsay@ramsayjones.plus.com>
Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

test-lib: use more compact expression in PIPE prerequisiteRamsay Jones Sun, 17 Sep 2017 22:56:00 +0000 (23:56 +0100)

test-lib: use more compact expression in PIPE prerequisite

Signed-off-by: Ramsay Jones <ramsay@ramsayjones.plus.com>
Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Improve performance of git status --ignoredJameson Miller Mon, 18 Sep 2017 17:24:33 +0000 (13:24 -0400)

Improve performance of git status --ignored

Improve the performance of the directory listing logic when it wants to list
non-empty ignored directories. In order to show non-empty ignored directories,
the existing logic will recursively iterate through all contents of an ignored
directory. This change introduces the optimization to stop iterating through
the contents once it finds the first file. This can have a significant
improvement in 'git status --ignored' performance in repositories with a large
number of files in ignored directories.

For an example of the performance difference on an example repository with
196,000 files in 400 ignored directories:

| Command | Time (s) |
| -------------------------- | --------- |
| git status | 1.2 |
| git status --ignored (old) | 3.9 |
| git status --ignored (new) | 1.4 |

Signed-off-by: Jameson Miller <jamill@microsoft.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

rev-parse: rev-parse: add --is-shallow-repositoryØystein Walle Mon, 18 Sep 2017 17:04:29 +0000 (19:04 +0200)

rev-parse: rev-parse: add --is-shallow-repository

Running `git fetch --unshallow` on a repo that is not in fact shallow
produces a fatal error message. Add a helper to rev-parse that scripters
can use to determine whether a repo is shallow or not.

Signed-off-by: Øystein Walle <oystwa@gmail.com>
Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

git-rebase: don't ignore unexpected command line argumentsBrandon Casey Sun, 17 Sep 2017 22:28:17 +0000 (15:28 -0700)

git-rebase: don't ignore unexpected command line arguments

Currently, git-rebase will silently ignore any unexpected command-line
switches and arguments (the command-line produced by git rev-parse).
This allowed the rev-parse bug, fixed in the preceding commits, to go
unnoticed. Let's make sure that doesn't happen again. We shouldn't be
ignoring unexpected arguments. Let's not.

Signed-off-by: Brandon Casey <drafnel@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

rev-parse parseopt: interpret any whitespace as start... Brandon Casey Sun, 17 Sep 2017 22:28:16 +0000 (15:28 -0700)

rev-parse parseopt: interpret any whitespace as start of help text

Currently, rev-parse only interprets a space ' ' character as the
delimiter between the option spec and the help text. So if a tab
character is placed between the option spec and the help text, it will
be interpreted as part of the long option name or as part of the arg
hint. If it is interpreted as part of the long option name, then
rev-parse will produce what will be interpreted as multiple arguments
on the command line.

For example, the following option spec (note: there is a <tab> between
"frotz" and "enable"):

frotz enable frotzing

will produce the following set expression when --frotz is used:

set -- --frotz --

instead of this:

set -- --frotz enable --

Mark t1502.2 as fixed.

Signed-off-by: Brandon Casey <drafnel@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

rev-parse parseopt: do not search help text for flag... Brandon Casey Sun, 17 Sep 2017 22:28:15 +0000 (15:28 -0700)

rev-parse parseopt: do not search help text for flag chars

When searching for flag characters in the option spec, we should ensure
the search stays within the bounds of the option spec and does not enter
the help text portion of the spec. So when we find the boundary white
space marking the start of the help text, let's mark it with a nul
character. Then when we search for flag characters starting from the
beginning of the string we'll stop at the nul and won't enter the help
text.

Now, the following option spec:

exclame this does something!

will produce this 'set' expression when --exclame is specified:

set -- --exclame --

instead of this one:

set -- --exclame this does something --

Mark t1502.4 and t1502.5 as fixed.

Signed-off-by: Brandon Casey <drafnel@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

t1502: demonstrate rev-parse --parseopt option mis... Brandon Casey Sun, 17 Sep 2017 22:28:14 +0000 (15:28 -0700)

t1502: demonstrate rev-parse --parseopt option mis-parsing

Since commit 2d893df rev-parse will scan forward from the beginning of
the option string looking for a flag character. If there are no flag
characters then the scan will spill over into the help text and will
interpret the characters preceding the "flag" as part of the option-spec
i.e. the long option name.

For example, the following option spec:

exclame this does something!

will produce this 'set' expression when --exclame is specified:

set -- --exclame this does something --

which will be interpreted as four separate parameters by the shell. And
will produce a help string that looks like:

--exclame this does something
this does something!

git-rebase.sh has such an option (--autosquash), and so will add extra
parameters to the 'set' expression when --autosquash is used.
git-rebase continues to work correctly though because when it parses the
arguments, it ignores ones that it does not recognize.

Also, rev-parse --parseopt does not currently interpret a tab character
as a delimiter between the option spec and the help text. If a tab is
used at the end of the option spec, before the help text, and before a
space has been specified, then rev-parse will interpret the tab as part
of the preceding component (either the long name or the arg hint).

For example, the following option spec (note: there is a <tab> between
"frotz" and "enable"):

frotz enable frotzing

will produce this 'set' expression when --frotz is specified:

set -- --frotz enable --

which will be interpreted as 2 separate arguments by the shell.

git-rebase.sh has one of these too (--keep-empty). In this case the tab
is immediately followed by spaces so there are no additional parameters
produced on the command line. The only side-effect is misalignment in
the help text.

Signed-off-by: Brandon Casey <drafnel@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

t/README: fix typo and grammatically improve a sentenceKaartic Sivaraam Sun, 17 Sep 2017 10:18:15 +0000 (10:18 +0000)

t/README: fix typo and grammatically improve a sentence

Signed-off-by: Kaartic Sivaraam <kaarticsivaraam91196@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

The eighth batch for 2.15Junio C Hamano Tue, 19 Sep 2017 01:55:19 +0000 (10:55 +0900)

The eighth batch for 2.15

Signed-off-by: Junio C Hamano <gitster@pobox.com>

Merge branch 'rk/commit-tree-make-F-verbatim'Junio C Hamano Tue, 19 Sep 2017 01:47:57 +0000 (10:47 +0900)

Merge branch 'rk/commit-tree-make-F-verbatim'

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

Merge branch 'rs/strbuf-leakfix'Junio C Hamano Tue, 19 Sep 2017 01:47:57 +0000 (10:47 +0900)

Merge branch 'rs/strbuf-leakfix'

Many leaks of strbuf have been fixed.

* rs/strbuf-leakfix: (34 commits)
wt-status: release strbuf after use in wt_longstatus_print_tracking()
wt-status: release strbuf after use in read_rebase_todolist()
vcs-svn: release strbuf after use in end_revision()
utf8: release strbuf on error return in strbuf_utf8_replace()
userdiff: release strbuf after use in userdiff_get_textconv()
transport-helper: release strbuf after use in process_connect_service()
sequencer: release strbuf after use in save_head()
shortlog: release strbuf after use in insert_one_record()
sha1_file: release strbuf on error return in index_path()
send-pack: release strbuf on error return in send_pack()
remote: release strbuf after use in set_url()
remote: release strbuf after use in migrate_file()
remote: release strbuf after use in read_remote_branches()
refs: release strbuf on error return in write_pseudoref()
notes: release strbuf after use in notes_copy_from_stdin()
merge: release strbuf after use in write_merge_heads()
merge: release strbuf after use in save_state()
mailinfo: release strbuf on error return in handle_boundary()
mailinfo: release strbuf after use in handle_from()
help: release strbuf on error return in exec_woman_emacs()
...

Merge branch 'jk/shortlog-ident-cleanup'Junio C Hamano Tue, 19 Sep 2017 01:47:56 +0000 (10:47 +0900)

Merge branch 'jk/shortlog-ident-cleanup'

Code clean-up.

* jk/shortlog-ident-cleanup:
shortlog: skip format/parse roundtrip for internal traversal

Merge branch 'mh/packed-ref-transactions'Junio C Hamano Tue, 19 Sep 2017 01:47:56 +0000 (10:47 +0900)

Merge branch 'mh/packed-ref-transactions'

Implement transactional update to the packed-ref representation of
references.

* mh/packed-ref-transactions:
files_transaction_finish(): delete reflogs before references
packed-backend: rip out some now-unused code
files_ref_store: use a transaction to update packed refs
t1404: demonstrate two problems with reference transactions
files_initial_transaction_commit(): use a transaction for packed refs
prune_refs(): also free the linked list
files_pack_refs(): use a reference transaction to write packed refs
packed_delete_refs(): implement method
packed_ref_store: implement reference transactions
struct ref_transaction: add a place for backends to store data
packed-backend: don't adjust the reference count on lock/unlock

Merge branch 'kw/merge-recursive-cleanup'Junio C Hamano Tue, 19 Sep 2017 01:47:56 +0000 (10:47 +0900)

Merge branch 'kw/merge-recursive-cleanup'

A leakfix and code clean-up.

* kw/merge-recursive-cleanup:
merge-recursive: change current file dir string_lists to hashmap
merge-recursive: remove return value from get_files_dirs
merge-recursive: fix memory leak

Merge branch 'sb/merge-commit-msg-hook'Junio C Hamano Tue, 19 Sep 2017 01:47:56 +0000 (10:47 +0900)

Merge branch 'sb/merge-commit-msg-hook'

As "git commit" to conclude a conflicted "git merge" honors the
commit-msg hook, "git merge" that recoreds a merge commit that
cleanly auto-merges should, but it didn't.

* sb/merge-commit-msg-hook:
builtin/merge: honor commit-msg hook for merges

Merge branch 'jk/leak-checkers'Junio C Hamano Tue, 19 Sep 2017 01:47:55 +0000 (10:47 +0900)

Merge branch 'jk/leak-checkers'

Many of our programs consider that it is OK to release dynamic
storage that is used throughout the life of the program by simply
exiting, but this makes it harder to leak detection tools to avoid
reporting false positives. Plug many existing leaks and introduce
a mechanism for developers to mark that the region of memory
pointed by a pointer is not lost/leaking to help these tools.

* jk/leak-checkers:
add UNLEAK annotation for reducing leak false positives
set_git_dir: handle feeding gitdir to itself
repository: free fields before overwriting them
reset: free allocated tree buffers
reset: make tree counting less confusing
config: plug user_config leak
update-index: fix cache entry leak in add_one_file()
add: free leaked pathspec after add_files_to_cache()
test-lib: set LSAN_OPTIONS to abort by default
test-lib: --valgrind should not override --verbose-log

Merge branch 'nm/pull-submodule-recurse-config'Junio C Hamano Tue, 19 Sep 2017 01:47:55 +0000 (10:47 +0900)

Merge branch 'nm/pull-submodule-recurse-config'

"git -c submodule.recurse=yes pull" did not work as if the
"--recurse-submodules" option was given from the command line.
This has been corrected.

* nm/pull-submodule-recurse-config:
pull: honor submodule.recurse config option
pull: fix cli and config option parsing order

Merge branch 'mh/packed-ref-store-prep'Junio C Hamano Tue, 19 Sep 2017 01:47:55 +0000 (10:47 +0900)

Merge branch 'mh/packed-ref-store-prep'

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

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

Merge branch 'ma/remove-config-maybe-bool'Junio C Hamano Tue, 19 Sep 2017 01:47:55 +0000 (10:47 +0900)

Merge branch 'ma/remove-config-maybe-bool'

Finishing touches to a recent topic.

* ma/remove-config-maybe-bool:
config: remove git_config_maybe_bool

Merge branch 'jk/system-path-cleanup'Junio C Hamano Tue, 19 Sep 2017 01:47:55 +0000 (10:47 +0900)

Merge branch 'jk/system-path-cleanup'

Code clean-up.

* jk/system-path-cleanup:
git_extract_argv0_path: do nothing without RUNTIME_PREFIX
system_path: move RUNTIME_PREFIX to a sub-function

Merge branch 'jh/hashmap-disable-counting'Junio C Hamano Tue, 19 Sep 2017 01:47:54 +0000 (10:47 +0900)

Merge branch 'jh/hashmap-disable-counting'

Our hashmap implementation in hashmap.[ch] is not thread-safe when
adding a new item needs to expand the hashtable by rehashing; add
an API to disable the automatic rehashing to work it around.

* jh/hashmap-disable-counting:
hashmap: add API to disable item counting when threaded

Merge branch 'bb/doc-eol-dirty'Junio C Hamano Tue, 19 Sep 2017 01:47:54 +0000 (10:47 +0900)

Merge branch 'bb/doc-eol-dirty'

Doc update.

* bb/doc-eol-dirty:
Documentation: mention that `eol` can change the dirty status of paths

Merge branch 'jt/packmigrate'Junio C Hamano Tue, 19 Sep 2017 01:47:53 +0000 (10:47 +0900)

Merge branch 'jt/packmigrate'

Remove unneeded file added by a topic already in 'master'.

* jt/packmigrate:
Remove inadvertently added outgoing/packfile.h

Merge branch 'jk/incore-lockfile-removal'Junio C Hamano Tue, 19 Sep 2017 01:47:53 +0000 (10:47 +0900)

Merge branch 'jk/incore-lockfile-removal'

The long-standing rule that an in-core lockfile instance, once it
is used, must not be freed, has been lifted and the lockfile and
tempfile APIs have been updated to reduce the chance of programming
errors.

* jk/incore-lockfile-removal:
stop leaking lock structs in some simple cases
ref_lock: stop leaking lock_files
lockfile: update lifetime requirements in documentation
tempfile: auto-allocate tempfiles on heap
tempfile: remove deactivated list entries
tempfile: use list.h for linked list
tempfile: release deactivated strbufs instead of resetting
tempfile: robustify cleanup handler
tempfile: factor out deactivation
tempfile: factor out activation
tempfile: replace die("BUG") with BUG()
tempfile: handle NULL tempfile pointers gracefully
tempfile: prefer is_tempfile_active to bare access
lockfile: do not rollback lock on failed close
tempfile: do not delete tempfile on failed close
always check return value of close_tempfile
verify_signed_buffer: prefer close_tempfile() to close()
setup_temporary_shallow: move tempfile struct into function
setup_temporary_shallow: avoid using inactive tempfile
write_index_as_tree: cleanup tempfile on error

Merge branch 'nd/prune-in-worktree'Junio C Hamano Tue, 19 Sep 2017 01:47:53 +0000 (10:47 +0900)

Merge branch 'nd/prune-in-worktree'

"git gc" and friends when multiple worktrees are used off of a
single repository did not consider the index and per-worktree refs
of other worktrees as the root for reachability traversal, making
objects that are in use only in other worktrees to be subject to
garbage collection.

* nd/prune-in-worktree:
refs.c: reindent get_submodule_ref_store()
refs.c: remove fallback-to-main-store code get_submodule_ref_store()
rev-list: expose and document --single-worktree
revision.c: --reflog add HEAD reflog from all worktrees
files-backend: make reflog iterator go through per-worktree reflog
revision.c: --all adds HEAD from all worktrees
refs: remove dead for_each_*_submodule()
refs.c: move for_each_remote_ref_submodule() to submodule.c
revision.c: use refs_for_each*() instead of for_each_*_submodule()
refs: add refs_head_ref()
refs: move submodule slash stripping code to get_submodule_ref_store
refs.c: refactor get_submodule_ref_store(), share common free block
revision.c: --indexed-objects add objects from all worktrees
revision.c: refactor add_index_objects_to_pending()
refs.c: use is_dir_sep() in resolve_gitlink_ref()
revision.h: new flag in struct rev_info wrt. worktree-related refs

Merge branch 'ma/split-symref-update-fix'Junio C Hamano Tue, 19 Sep 2017 01:47:53 +0000 (10:47 +0900)

Merge branch 'ma/split-symref-update-fix'

A leakfix.

* ma/split-symref-update-fix:
refs/files-backend: add `refname`, not "HEAD", to list
refs/files-backend: correct return value in lock_ref_for_update
refs/files-backend: fix memory leak in lock_ref_for_update
refs/files-backend: add longer-scoped copy of string to list

Merge branch 'mh/notes-cleanup'Junio C Hamano Tue, 19 Sep 2017 01:47:52 +0000 (10:47 +0900)

Merge branch 'mh/notes-cleanup'

Code clean-up.

* mh/notes-cleanup:
load_subtree(): check that `prefix_len` is in the expected range
load_subtree(): declare some variables to be `size_t`
hex_to_bytes(): simpler replacement for `get_oid_hex_segment()`
get_oid_hex_segment(): don't pad the rest of `oid`
load_subtree(): combine some common code
get_oid_hex_segment(): return 0 on success
load_subtree(): only consider blobs to be potential notes
load_subtree(): check earlier whether an internal node is a tree entry
load_subtree(): separate logic for internal vs. terminal entries
load_subtree(): fix incorrect comment
load_subtree(): reduce the scope of some local variables
load_subtree(): remove unnecessary conditional
notes: make GET_NIBBLE macro more robust

Merge branch 'mg/timestamp-t-fix'Junio C Hamano Tue, 19 Sep 2017 01:47:52 +0000 (10:47 +0900)

Merge branch 'mg/timestamp-t-fix'

A mismerge fix.

* mg/timestamp-t-fix:
name-rev: change ULONG_MAX to TIME_MAX

Merge branch 'ma/pkt-line-leakfix'Junio C Hamano Tue, 19 Sep 2017 01:47:52 +0000 (10:47 +0900)

Merge branch 'ma/pkt-line-leakfix'

A leakfix.

* ma/pkt-line-leakfix:
pkt-line: re-'static'-ify buffer in packet_write_fmt_1()

Merge branch 'jk/config-lockfile-leak-fix'Junio C Hamano Tue, 19 Sep 2017 01:47:51 +0000 (10:47 +0900)

Merge branch 'jk/config-lockfile-leak-fix'

A leakfix.

* jk/config-lockfile-leak-fix:
config: use a static lock_file struct

Merge branch 'dw/diff-highlight-makefile-fix'Junio C Hamano Tue, 19 Sep 2017 01:47:50 +0000 (10:47 +0900)

Merge branch 'dw/diff-highlight-makefile-fix'

Build clean-up.

* dw/diff-highlight-makefile-fix:
diff-highlight: add clean target to Makefile

Merge branch 'ti/external-sha1dc'Junio C Hamano Tue, 19 Sep 2017 01:47:50 +0000 (10:47 +0900)

Merge branch 'ti/external-sha1dc'

Platforms that ship with a separate sha1 with collision detection
library can link to it instead of using the copy we ship as part of
our source tree.

* ti/external-sha1dc:
sha1dc: allow building with the external sha1dc library
sha1dc: build git plumbing code more explicitly

gc: call fscanf() with %<len>s, not %<len>c, when readi... 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>

describe: fix matching to actually match all patternsMax 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>

add test for bug in git-mv for recursive submodulesHeiko Voigt Fri, 15 Sep 2017 11:50:21 +0000 (13:50 +0200)

add test for bug in git-mv for recursive submodules

When using git-mv with a submodule it will detect that and update the
paths for its configurations (.gitmodules, worktree and gitfile). This
does not work for recursive submodules where a user renames the root
submodule.

We discovered this fact when working on on-demand fetch for renamed
submodules. Lets add a test to document.

Signed-off-by: Heiko Voigt <hvoigt@hvoigt.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

imap-send: use curl by default when possibleNicolas Morey-Chaisemartin Thu, 14 Sep 2017 07:52:11 +0000 (09:52 +0200)

imap-send: use curl by default when possible

Set curl as the runtime default when it is available.
When linked against older curl versions (< 7_34_0) or without curl,
use the legacy imap implementation.

The goal is to validate feature parity between the legacy and
the curl implementation, deprecate the legacy implementation
later on and in the long term, hopefully drop it altogether.

Signed-off-by: Nicolas Morey-Chaisemartin <nicolas@morey-chaisemartin.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

imap_send: setup_curl: retreive credentials if not... Nicolas Morey-Chaisemartin Thu, 14 Sep 2017 07:52:06 +0000 (09:52 +0200)

imap_send: setup_curl: retreive credentials if not set in config file

Up to this point, the curl mode only supported getting the username
and password from the gitconfig file while the legacy mode could also
fetch them using the credential API.

Signed-off-by: Nicolas Morey-Chaisemartin <nicolas@morey-chaisemartin.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

imap-send: add wrapper to get server credentials if... Nicolas Morey-Chaisemartin Thu, 14 Sep 2017 07:52:02 +0000 (09:52 +0200)

imap-send: add wrapper to get server credentials if needed

Signed-off-by: Nicolas Morey-Chaisemartin <nicolas@morey-chaisemartin.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

imap-send: return with error if curl failedNicolas Morey-Chaisemartin Thu, 14 Sep 2017 07:51:57 +0000 (09:51 +0200)

imap-send: return with error if curl failed

curl_append_msgs_to_imap always returned 0, whether curl failed or not.
Return a proper status so git imap-send will exit with an error code
if something wrong happened.

Signed-off-by: Nicolas Morey-Chaisemartin <nicolas@morey-chaisemartin.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

commit-template: change a message to be more intuitiveKaartic Sivaraam Wed, 13 Sep 2017 13:05:38 +0000 (13:05 +0000)

commit-template: change a message to be more intuitive

It's not good to use the phrase 'do not touch' to convey the
information that the cut-line should not be modified or removed as
it could possibly be mis-interpreted by a person who doesn't know
that the word 'touch' has the meaning of 'tamper with'. Further, it
could make translations a little difficult as it might not have the
intended meaning in a few languages when translated as such.

So, use more intuitive terms in the sentence.

Signed-off-by: Kaartic Sivaraam <kaarticsivaraam91196@gmail.com>
Helped-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

test-lib: don't use ulimit in test prerequisites on... Ramsay Jones Thu, 14 Sep 2017 17:24:41 +0000 (18:24 +0100)

test-lib: don't use ulimit in test prerequisites on cygwin

On cygwin (and MinGW), the 'ulimit' built-in bash command does not have
the desired effect of limiting the resources of new processes, at least
for the stack and file descriptors. However, it always returns success
and leads to several test prerequisites being erroneously set to true.

Add a check for cygwin and MinGW to the prerequisite expressions, using
a 'test_have_prereq !MINGW,!CYGWIN' clause, to guard against using ulimit.
This affects the prerequisite expressions for the ULIMIT_STACK_SIZE,
CMDLINE_LIMIT and ULIMIT_FILE_DESCRIPTORS prerequisites.

Signed-off-by: Ramsay Jones <ramsay@ramsayjones.plus.com>
Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Merge branch 'ls/travis-scriptify' into nextJunio C Hamano Thu, 14 Sep 2017 08:40:40 +0000 (17:40 +0900)

Merge branch 'ls/travis-scriptify' into next

The scripts to drive TravisCI has been reorganized and then an
optimization to avoid spending cycles on a branch whose tip is
tagged has been implemented.

* ls/travis-scriptify:
travis: dedent a few scripts that are indented overly deeply
travis-ci: skip a branch build if equal tag is present
travis-ci: move Travis CI code into dedicated scripts

Merge branch 'rk/commit-tree-make-F-verbatim' into... Junio C Hamano Thu, 14 Sep 2017 08:40:39 +0000 (17:40 +0900)

Merge branch 'rk/commit-tree-make-F-verbatim' into next

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

Merge branch 'rs/strbuf-leakfix' into nextJunio C Hamano Thu, 14 Sep 2017 08:40:39 +0000 (17:40 +0900)

Merge branch 'rs/strbuf-leakfix' into next

Many leaks of strbuf have been fixed.

* rs/strbuf-leakfix: (34 commits)
wt-status: release strbuf after use in wt_longstatus_print_tracking()
wt-status: release strbuf after use in read_rebase_todolist()
vcs-svn: release strbuf after use in end_revision()
utf8: release strbuf on error return in strbuf_utf8_replace()
userdiff: release strbuf after use in userdiff_get_textconv()
transport-helper: release strbuf after use in process_connect_service()
sequencer: release strbuf after use in save_head()
shortlog: release strbuf after use in insert_one_record()
sha1_file: release strbuf on error return in index_path()
send-pack: release strbuf on error return in send_pack()
remote: release strbuf after use in set_url()
remote: release strbuf after use in migrate_file()
remote: release strbuf after use in read_remote_branches()
refs: release strbuf on error return in write_pseudoref()
notes: release strbuf after use in notes_copy_from_stdin()
merge: release strbuf after use in write_merge_heads()
merge: release strbuf after use in save_state()
mailinfo: release strbuf on error return in handle_boundary()
mailinfo: release strbuf after use in handle_from()
help: release strbuf on error return in exec_woman_emacs()
...

Merge branch 'jk/shortlog-ident-cleanup' into nextJunio C Hamano Thu, 14 Sep 2017 08:40:39 +0000 (17:40 +0900)

Merge branch 'jk/shortlog-ident-cleanup' into next

Code clean-up.

* jk/shortlog-ident-cleanup:
shortlog: skip format/parse roundtrip for internal traversal

Merge branch 'mh/packed-ref-transactions' into nextJunio C Hamano Thu, 14 Sep 2017 08:40:39 +0000 (17:40 +0900)

Merge branch 'mh/packed-ref-transactions' into next

Implement transactional update to the packed-ref representation of
references.

* mh/packed-ref-transactions:
files_transaction_finish(): delete reflogs before references
packed-backend: rip out some now-unused code
files_ref_store: use a transaction to update packed refs
t1404: demonstrate two problems with reference transactions
files_initial_transaction_commit(): use a transaction for packed refs
prune_refs(): also free the linked list
files_pack_refs(): use a reference transaction to write packed refs
packed_delete_refs(): implement method
packed_ref_store: implement reference transactions
struct ref_transaction: add a place for backends to store data
packed-backend: don't adjust the reference count on lock/unlock

Merge branch 'kw/merge-recursive-cleanup' into nextJunio C Hamano Thu, 14 Sep 2017 08:40:38 +0000 (17:40 +0900)

Merge branch 'kw/merge-recursive-cleanup' into next

A leakfix and code clean-up.

* kw/merge-recursive-cleanup:
merge-recursive: change current file dir string_lists to hashmap
merge-recursive: remove return value from get_files_dirs
merge-recursive: fix memory leak

Merge branch 'sb/merge-commit-msg-hook' into nextJunio C Hamano Thu, 14 Sep 2017 08:40:38 +0000 (17:40 +0900)

Merge branch 'sb/merge-commit-msg-hook' into next

As "git commit" to conclude a conflicted "git merge" honors the
commit-msg hook, "git merge" that recoreds a merge commit that
cleanly auto-merges should, but it didn't.

* sb/merge-commit-msg-hook:
builtin/merge: honor commit-msg hook for merges

Merge branch 'mg/name-rev-tests-with-short-stack' into... Junio C Hamano Thu, 14 Sep 2017 08:40:38 +0000 (17:40 +0900)

Merge branch 'mg/name-rev-tests-with-short-stack' into next

A handful of tests to demonstrates a recursive implementation of
"name-rev" hurts.

* mg/name-rev-tests-with-short-stack:
t6120: test describe and name-rev with deep repos
t6120: clean up state after breaking repo
t6120: test name-rev --all and --stdin
t7004: move limited stack prereq to test-lib

Merge branch 'jk/leak-checkers' into nextJunio C Hamano Thu, 14 Sep 2017 08:40:38 +0000 (17:40 +0900)

Merge branch 'jk/leak-checkers' into next

Many of our programs consider that it is OK to release dynamic
storage that is used throughout the life of the program by simply
exiting, but this makes it harder to leak detection tools to avoid
reporting false positives. Plug many existing leaks and introduce
a mechanism for developers to mark that the region of memory
pointed by a pointer is not lost/leaking to help these tools.

* jk/leak-checkers:
add UNLEAK annotation for reducing leak false positives
set_git_dir: handle feeding gitdir to itself
repository: free fields before overwriting them
reset: free allocated tree buffers
reset: make tree counting less confusing
config: plug user_config leak
update-index: fix cache entry leak in add_one_file()
add: free leaked pathspec after add_files_to_cache()
test-lib: set LSAN_OPTIONS to abort by default
test-lib: --valgrind should not override --verbose-log

Merge branch 'nm/pull-submodule-recurse-config' into... Junio C Hamano Thu, 14 Sep 2017 08:40:38 +0000 (17:40 +0900)

Merge branch 'nm/pull-submodule-recurse-config' into next

"git -c submodule.recurse=yes pull" did not work as if the
"--recurse-submodules" option was given from the command line.
This has been corrected.

* nm/pull-submodule-recurse-config:
pull: honor submodule.recurse config option
pull: fix cli and config option parsing order

Merge branch 'mh/packed-ref-store-prep' into nextJunio C Hamano Thu, 14 Sep 2017 08:40:37 +0000 (17:40 +0900)

Merge branch 'mh/packed-ref-store-prep' into next

Finishing touches to a recent topic.

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

Merge branch 'ma/remove-config-maybe-bool' into nextJunio C Hamano Thu, 14 Sep 2017 08:40:37 +0000 (17:40 +0900)

Merge branch 'ma/remove-config-maybe-bool' into next

Finishing touches to a recent topic.

* ma/remove-config-maybe-bool:
config: remove git_config_maybe_bool

Merge branch 'jk/system-path-cleanup' into nextJunio C Hamano Thu, 14 Sep 2017 08:40:37 +0000 (17:40 +0900)

Merge branch 'jk/system-path-cleanup' into next

Code clean-up.

* jk/system-path-cleanup:
git_extract_argv0_path: do nothing without RUNTIME_PREFIX
system_path: move RUNTIME_PREFIX to a sub-function