gitweb.git
mingw: safe-guard a bit more against getenv() problemsJohannes Schindelin Fri, 15 Feb 2019 15:17:45 +0000 (07:17 -0800)

mingw: safe-guard a bit more against getenv() problems

Running up to v2.21.0, we fixed two bugs that were made prominent by the
Windows-specific change to retain copies of only the 30 latest getenv()
calls' returned strings, invalidating any copies of previous getenv()
calls' return values.

While this really shines a light onto bugs of the form where we hold
onto getenv()'s return values without copying them, it is also a real
problem for users.

And even if Jeff King's patches merged via 773e408881 (Merge branch
'jk/save-getenv-result', 2019-01-29) provide further work on that front,
we are far from done. Just one example: on Windows, we unset environment
variables when spawning new processes, which potentially invalidates
strings that were previously obtained via getenv(), and therefore we
have to duplicate environment values that are somehow involved in
spawning new processes (e.g. GIT_MAN_VIEWER in show_man_page()).

We do not have a chance to investigate, let address, all of those issues
in time for v2.21.0, so let's at least help Windows users by increasing
the number of getenv() calls' return values that are kept valid. The
number 64 was determined by looking at the average number of getenv()
calls per process in the entire test suite run on Windows (which is
around 40) and then adding a bit for good measure. And it is a power of
two (which would have hit yesterday's theme perfectly).

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

submodule: document default behaviorDenton Liu Fri, 15 Feb 2019 09:26:41 +0000 (01:26 -0800)

submodule: document default behavior

submodule's default behavior wasn't documented in both git-submodule.txt
and in the usage text of git-submodule. Document the default behavior
similar to how git-remote does it.

Signed-off-by: Denton Liu <liu.denton@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

l10n: Fixes to Catalan translationJordi Mas Fri, 15 Feb 2019 15:43:59 +0000 (16:43 +0100)

l10n: Fixes to Catalan translation

Signed-off-by: Jordi Mas <jmas@softcatala.org>

l10n: git.pot: v2.21.0 round 2 (3 new, 3 removed)Jiang Xin Fri, 15 Feb 2019 02:12:14 +0000 (10:12 +0800)

l10n: git.pot: v2.21.0 round 2 (3 new, 3 removed)

Introduce 3 update messages for v2.21.0 l10n round 2 from commit
32ceace39f (Fix typos in translatable strings for v2.21.0, 2019-02-11).

Signed-off-by: Jiang Xin <worldhello.net@gmail.com>

Merge branch 'master' of git://git./git/gitJiang Xin Fri, 15 Feb 2019 02:09:07 +0000 (10:09 +0800)

Merge branch 'master' of git://git./git/git

ref-filter: drop unused "sz" parametersJeff King Thu, 14 Feb 2019 05:51:03 +0000 (00:51 -0500)

ref-filter: drop unused "sz" parameters

Many of our grab_* functions, which parse the object content, take a
buf/sz pair of the object bytes. However, the functions which actually
parse the buffers (like find_wholine() and find_subpos()) never look at
"sz", and instead use functions like strchr() and strchrnul() that
assume the result is NUL-terminated.

This is OK in practice (and common for Git's parsing code), since we
always allocate an extra NUL when loading an object into memory (and
likewise, we are OK with stopping parsing if a commit or tag contains an
embedded NUL).

Let's drop these extra "sz" parameters, as they are misleading about how
the functions intend to access the buffer. We can drop from both the
functions mentioned above, which in turn lets us drop from their
callers, cascading all the way up to the top-level grab_values().

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

ref-filter: drop unused "obj" parametersJeff King Thu, 14 Feb 2019 05:50:58 +0000 (00:50 -0500)

ref-filter: drop unused "obj" parameters

The grab_person() and grab_sub_body_contents() functions take both an
object struct and a buf/sz pair of the object bytes. However, they use
only the latter, since "struct object" does not contain the parsed ident
(nor the whole commit message, of course).

Let's get rid of these misleading "struct object" parameters. It's
possible we may want them in the future (e.g., to generate error
messages that mention the object id), but since these are static
functions, we can easily add them back in later (and if we do want that
information, it's likely we'd pass it through a more generalized
"parsing context" struct anyway).

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

ref-filter: drop unused buf/sz pairsJeff King Thu, 14 Feb 2019 05:50:54 +0000 (00:50 -0500)

ref-filter: drop unused buf/sz pairs

The grab_tag_values() and grab_commit_values() functions take both the
"struct object" as well as the buf/sz pair for the actual object bytes.
However, neither function uses the latter, as they pull the data
directly from the parsed object struct.

Let's get rid of these misleading parameters.

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

files-backend: drop refs parameter from split_symref_up... Jeff King Thu, 14 Feb 2019 05:50:46 +0000 (00:50 -0500)

files-backend: drop refs parameter from split_symref_update()

This parameter was added in fcc42ea0c9 (split_symref_update(): add a
files_ref_store argument, 2016-09-04) without comment, but never used.
The splitting is purely mechanical, and doesn't depend on the particular
ref-store. Let's drop this parameter in the name of simplicity.

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

pack-objects: drop unused parameter from oe_map_new_pack()Jeff King Thu, 14 Feb 2019 05:50:32 +0000 (00:50 -0500)

pack-objects: drop unused parameter from oe_map_new_pack()

Since 43fa44fa3b (pack-objects: move in_pack out of struct object_entry,
2018-04-14), we store the source pack for each object as a small index
rather than as a pointer. When we see a new pack that has no allocated
index, we fall back to generating an array of pointers by calling
oe_map_new_pack().

Perhaps counter-intuitively, that function does not need to actually see
our new index-less pack. It only allocates and populates the array with
the existing packs, after which oe_set_in_pack() actually adds the new
pack to the array.

Let's drop the unused "struct packed_git" argument to oe_map_new_pack()
to avoid confusion.

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

merge-recursive: drop several unused parametersJeff King Thu, 14 Feb 2019 05:50:02 +0000 (00:50 -0500)

merge-recursive: drop several unused parameters

There are a few functions related to directory renames that have unused
parameters. After consulting with the author in [1], these seem to be
leftover cruft from the development process, and not signs of any bug.
Let's drop them.

[1] https://public-inbox.org/git/CABPp-BHobf8wbBsXF97scNQCzkxQukziODRXq6JOOWq61cAd9g@mail.gmail.com/

Helped-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

diff: drop complete_rewrite parameter from run_external... Jeff King Thu, 14 Feb 2019 05:49:42 +0000 (00:49 -0500)

diff: drop complete_rewrite parameter from run_external_diff()

Our builtin_diff() wants to know whether break-detection found a
complete rewrite, because it changes how the diff is shown. However,
when calling out to an external diff, we don't pass this information
along (and doing so would require designing a new interface to the
user-provided program).

Let's drop the unused parameter to make this fact more clear.

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

diff: drop unused emit data parameter from sane_truncat... Jeff King Thu, 14 Feb 2019 05:48:27 +0000 (00:48 -0500)

diff: drop unused emit data parameter from sane_truncate_line()

We pass the "struct emit_callback" (which contains all of the context
for our diff) into sane_truncate_line(), but that function doesn't
actually use it. In theory we might eventually develop a diff option
that impacts this, but in the meantime let's not mislead anybody reading
the code. Since the function is static, it would be easy to pass it
again if it should ever become useful.

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

diff: drop unused color reset parametersJeff King Thu, 14 Feb 2019 05:48:13 +0000 (00:48 -0500)

diff: drop unused color reset parameters

Several of the emit_* functions take a "reset" color parameter, but
never actually look at it (instead, they call into emit_diff_symbol,
which handles the colors itself). Let's drop these unused parameters.

Note that emit_line() does still take a color/reset pair, and actually
uses it. It cannot be refactored to match these other functions because
it's the thing that emit_diff_symbol eventually calls into (i.e., it
does not by itself know which colors to use, and must be told by the
caller).

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

diff: drop options parameter from diffcore_fix_diff_index()Jeff King Thu, 14 Feb 2019 05:48:03 +0000 (00:48 -0500)

diff: drop options parameter from diffcore_fix_diff_index()

The sole purpose of this function is to fix the sorting order of the
queued diff entries. It doesn't need to know about any diff options, so
we can drop the unused parameter.

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

t5304: rename "sha1" variables to "oid"Jeff King Thu, 14 Feb 2019 11:07:36 +0000 (06:07 -0500)

t5304: rename "sha1" variables to "oid"

Let's make the script less jarring to read in a post-sha1 world by
using more hash-agnostic variable names.

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

prune: check SEEN flag for reachabilityJeff King Thu, 14 Feb 2019 04:38:21 +0000 (23:38 -0500)

prune: check SEEN flag for reachability

The git-prune command checks reachability by doing a traversal, and then
checking whether a given object exists in the global object hash. This
can yield false positives if any other part of the code had to create an
object struct for some reason. It's not clear whether this is even
possible, but it's more robust to rely on something a little more
concrete: the SEEN flag set by our traversal.

Note that there is a slight possibility of regression here, as we're
relying on mark_reachable_objects() to consistently set the flag.
However, it has always done so, and we're already relying on that fact
in prune_shallow(), which is called as part of git-prune. So this is
making these two parts of the prune operation more consistent.

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

prune: use bitmaps for reachability traversalJeff King Thu, 14 Feb 2019 04:37:43 +0000 (23:37 -0500)

prune: use bitmaps for reachability traversal

Pruning generally has to traverse the whole commit graph in order to
see which objects are reachable. This is the exact problem that
reachability bitmaps were meant to solve, so let's use them (if they're
available, of course).

Here are timings on git.git:

Test HEAD^ HEAD
------------------------------------------------------------------------
5304.6: prune with bitmaps 3.65(3.56+0.09) 1.01(0.92+0.08) -72.3%

And on linux.git:

Test HEAD^ HEAD
--------------------------------------------------------------------------
5304.6: prune with bitmaps 35.05(34.79+0.23) 3.00(2.78+0.21) -91.4%

The tests show a pretty optimal case, as we'll have just repacked and
should have pretty good coverage of all refs with our bitmaps. But
that's actually pretty realistic: normally prune is run via "gc" right
after repacking.

A few notes on the implementation:

- the change is actually in reachable.c, so it would improve
reachability traversals by "reflog expire --stale-fix", as well.
Those aren't performed regularly, though (a normal "git gc" doesn't
use --stale-fix), so they're not really worth measuring. There's a
low chance of regressing that caller, since the use of bitmaps is
totally transparent from the caller's perspective.

- The bitmap case could actually get away without creating a "struct
object", and instead the caller could just look up each object id in
the bitmap result. However, this would be a marginal improvement in
runtime, and it would make the callers much more complicated. They'd
have to handle both the bitmap and non-bitmap cases separately, and
in the case of git-prune, we'd also have to tweak prune_shallow(),
which relies on our SEEN flags.

- Because we do create real object structs, we go through a few
contortions to create ones of the right type. This isn't strictly
necessary (lookup_unknown_object() would suffice), but it's more
memory efficient to use the correct types, since we already know
them.

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

prune: lazily perform reachability traversalJeff King Thu, 14 Feb 2019 04:35:22 +0000 (23:35 -0500)

prune: lazily perform reachability traversal

The general strategy of "git prune" is to do a full reachability walk,
then for each loose object see if we found it in our walk. But if we
don't have any loose objects, we don't need to do the expensive walk in
the first place.

This patch postpones that walk until the first time we need to see its
results.

Note that this is really a specific case of a more general optimization,
which is that we could traverse only far enough to find the object under
consideration (i.e., stop the traversal when we find it, then pick up
again when asked about the next object, etc). That could save us in some
instances from having to do a full walk. But it's actually a bit tricky
to do with our traversal code, and you'd need to do a full walk anyway
if you have even a single unreachable object (which you generally do, if
any objects are actually left after running git-repack).

So in practice this lazy-load of the full walk catches one easy but
common case (i.e., you've just repacked via git-gc, and there's nothing
unreachable).

The perf script is fairly contrived, but it does show off the
improvement:

Test HEAD^ HEAD
-------------------------------------------------------------------------
5304.4: prune with no objects 3.66(3.60+0.05) 0.00(0.00+0.00) -100.0%

and would let us know if we accidentally regress this optimization.

Note also that we need to take special care with prune_shallow(), which
relies on us having performed the traversal. So this optimization can
only kick in for a non-shallow repository. Since this is easy to get
wrong and is not covered by existing tests, let's add an extra test to
t5304 that covers this case explicitly.

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

Merge branch 'ea/rebase-compat-doc-fix'Junio C Hamano Thu, 14 Feb 2019 22:28:22 +0000 (14:28 -0800)

Merge branch 'ea/rebase-compat-doc-fix'

* ea/rebase-compat-doc-fix:
docs/git-rebase: remove redundant entry in incompatible options list

Merge branch 'jc/no-grepping-for-strerror-in-tests'Junio C Hamano Thu, 14 Feb 2019 22:28:21 +0000 (14:28 -0800)

Merge branch 'jc/no-grepping-for-strerror-in-tests'

* jc/no-grepping-for-strerror-in-tests:
t1404: do not rely on the exact phrasing of strerror()

Merge branch 'jt/fetch-v2-sideband'Junio C Hamano Thu, 14 Feb 2019 22:28:20 +0000 (14:28 -0800)

Merge branch 'jt/fetch-v2-sideband'

"git fetch" and "git upload-pack" learned to send all exchange over
the sideband channel while talking the v2 protocol.

* jt/fetch-v2-sideband:
t/lib-httpd: pass GIT_TEST_SIDEBAND_ALL through Apache

Merge branch 'en/rebase-merge-on-sequencer'Junio C Hamano Thu, 14 Feb 2019 22:28:20 +0000 (14:28 -0800)

Merge branch 'en/rebase-merge-on-sequencer'

"git rebase --merge" as been reimplemented by reusing the internal
machinery used for "git rebase -i".

* en/rebase-merge-on-sequencer:
git-rebase.txt: update to reflect merge now implemented on sequencer

git-rebase.txt: update to reflect merge now implemented... Elijah Newren Thu, 14 Feb 2019 20:25:41 +0000 (12:25 -0800)

git-rebase.txt: update to reflect merge now implemented on sequencer

Since commit 8fe9c3f21dff (Merge branch 'en/rebase-merge-on-sequencer',
2019-02-06), --merge now uses the interactive backend (and matches its
behavior) so there is no separate merge backend anymore. Fix an
oversight in the docs that should have been updated with the previous
change.

Signed-off-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

t/lib-httpd: pass GIT_TEST_SIDEBAND_ALL through ApacheTodd Zullinger Thu, 14 Feb 2019 06:35:13 +0000 (01:35 -0500)

t/lib-httpd: pass GIT_TEST_SIDEBAND_ALL through Apache

07c3c2aa16 ("tests: define GIT_TEST_SIDEBAND_ALL", 2019-01-16) added
GIT_TEST_SIDEBAND_ALL to the apache.conf PassEnv list. Avoid warnings
from Apache when the variable is unset, as we do for GIT_VALGRIND* and
GIT_TRACE, from f628825481 ("t/lib-httpd: handle running under
--valgrind", 2012-07-24) and 89c57ab3f0 ("t: pass GIT_TRACE through
Apache", 2015-03-13), respectively.

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

t1404: do not rely on the exact phrasing of strerror()Junio C Hamano Thu, 14 Feb 2019 20:16:20 +0000 (12:16 -0800)

t1404: do not rely on the exact phrasing of strerror()

Not even in C locale, it is wrong to expect that the exact phrasing
"File exists" is used to show EEXIST.

Reported-by: Randall S. Becker <rsbecker@nexbridge.com>
Helped-by: Duy Nguyen <pclouds@gmail.com>
Helped-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

docs/git-rebase: remove redundant entry in incompatible... Emilio Cobos Álvarez Wed, 13 Feb 2019 23:44:33 +0000 (00:44 +0100)

docs/git-rebase: remove redundant entry in incompatible options list

The --autosquash option is implied by the earlier --[no-]autosquash
entry in the list.

Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>
Reviewed-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Git 2.21-rc1 v2.21.0-rc1Junio C Hamano Thu, 14 Feb 2019 02:18:11 +0000 (18:18 -0800)

Git 2.21-rc1

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

Merge branch 'ab/rebase-test-fix'Junio C Hamano Thu, 14 Feb 2019 02:18:43 +0000 (18:18 -0800)

Merge branch 'ab/rebase-test-fix'

* ab/rebase-test-fix:
rebase: fix regression in rebase.useBuiltin=false test mode

Merge branch 'rb/no-dev-zero-in-test'Junio C Hamano Thu, 14 Feb 2019 02:18:43 +0000 (18:18 -0800)

Merge branch 'rb/no-dev-zero-in-test'

* rb/no-dev-zero-in-test:
t5562: replace /dev/zero with a pipe from generate_zero_bytes
t5318: replace use of /dev/zero with generate_zero_bytes
test-lib-functions.sh: add generate_zero_bytes function

Merge branch 'rs/bash-is-in-coreutils-on-nonstop'Junio C Hamano Thu, 14 Feb 2019 02:18:43 +0000 (18:18 -0800)

Merge branch 'rs/bash-is-in-coreutils-on-nonstop'

* rs/bash-is-in-coreutils-on-nonstop:
config.mak.uname: move location of bash on NonStop to CoreUtils

Merge branch 'js/mingw-host-cpu'Junio C Hamano Thu, 14 Feb 2019 02:18:43 +0000 (18:18 -0800)

Merge branch 'js/mingw-host-cpu'

Windows update.

* js/mingw-host-cpu:
mingw: use a more canonical method to fix the CPU reporting

Merge branch 'sg/stress-test'Junio C Hamano Thu, 14 Feb 2019 02:18:42 +0000 (18:18 -0800)

Merge branch 'sg/stress-test'

Test improvement.

* sg/stress-test:
test-lib: fix non-portable pattern bracket expressions
test-lib: make '--stress' more bisect-friendly

Merge branch 'kd/t0028-octal-del-is-377-not-777'Junio C Hamano Thu, 14 Feb 2019 02:18:42 +0000 (18:18 -0800)

Merge branch 'kd/t0028-octal-del-is-377-not-777'

Test fix.

* kd/t0028-octal-del-is-377-not-777:
t0028: fix wrong octal values for BOM in setup

Merge branch 'bc/utf16-portability-fix'Junio C Hamano Thu, 14 Feb 2019 02:18:41 +0000 (18:18 -0800)

Merge branch 'bc/utf16-portability-fix'

The code and tests assume that the system supplied iconv() would
always use BOM in its output when asked to encode to UTF-16 (or
UTF-32), but apparently some implementations output big-endian
without BOM. A compile-time knob has been added to help such
systems (e.g. NonStop) to add BOM to the output to increase
portability.

* bc/utf16-portability-fix:
utf8: handle systems that don't write BOM for UTF-16

Merge branch 'nd/fileno-may-be-macro'Junio C Hamano Thu, 14 Feb 2019 02:18:41 +0000 (18:18 -0800)

Merge branch 'nd/fileno-may-be-macro'

* nd/fileno-may-be-macro:
git-compat-util: work around fileno(fp) that is a macro

Merge branch 'nd/get-oid-with-context-returns-an-enum'Junio C Hamano Thu, 14 Feb 2019 02:18:41 +0000 (18:18 -0800)

Merge branch 'nd/get-oid-with-context-returns-an-enum'

* nd/get-oid-with-context-returns-an-enum:
get_oid_with_context(): match prototype and implementation

Merge branch 'rj/sequencer-sign-off-header-static'Junio C Hamano Thu, 14 Feb 2019 02:18:41 +0000 (18:18 -0800)

Merge branch 'rj/sequencer-sign-off-header-static'

Code clean-up.

* rj/sequencer-sign-off-header-static:
sequencer: make sign_off_header a file local symbol

rebase: fix regression in rebase.useBuiltin=false test... Ævar Arnfjörð Bjarmason Wed, 13 Feb 2019 21:49:08 +0000 (22:49 +0100)

rebase: fix regression in rebase.useBuiltin=false test mode

Fix a recently introduced regression in c762aada1a ("rebase -x: sanity
check command", 2019-01-29) triggered when running the tests with
GIT_TEST_REBASE_USE_BUILTIN=false. See 62c23938fa ("tests: add a
special setup where rebase.useBuiltin is off", 2018-11-14) for how
that test mode works.

As discussed on-list[1] it's not worth it to implement the sanity
check in the legacy rebase code, we plan to remove it after the 2.21
release. So let's do the bare minimum to make the tests pass under the
GIT_TEST_REBASE_USE_BUILTIN=false special setup.

1. https://public-inbox.org/git/xmqqva1nbeno.fsf@gitster-ct.c.googlers.com/

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

mingw: use a more canonical method to fix the CPU reportingJohannes Schindelin Wed, 13 Feb 2019 10:19:49 +0000 (02:19 -0800)

mingw: use a more canonical method to fix the CPU reporting

In `git version --build-options`, we report also the CPU, but in Git for
Windows we actually cross-compile the 32-bit version in a 64-bit Git for
Windows, so we cannot rely on the auto-detected value.

In 3815f64b0dd9 (mingw: fix CPU reporting in `git version
--build-options`, 2019-02-07), we fixed this by a Windows-only
workaround, making use of magic pre-processor constants, which works in
GCC, but most likely not all C compilers.

As pointed out by Eric Sunshine, there is a better way, anyway: to set
the Makefile variable HOST_CPU explicitly for cross-compiled Git. So
let's do that!

This reverts commit 3815f64b0dd983bdbf9242a0547706d5d81cb3e6 partially.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

tests: avoid syntax triggering old dash bugÆvar Arnfjörð Bjarmason Wed, 13 Feb 2019 11:59:51 +0000 (12:59 +0100)

tests: avoid syntax triggering old dash bug

Avoid a bug in dash that's been fixed ever since its
ec2c84d ("[PARSER] Fix clobbering of checkkwd", 2011-03-15)[1] first
released with dash v0.5.7 in July 2011. This failing test was
introduced in 5f9674243d ("config: add --expiry-date", 2017-11-18).

This fixes 1/2 tests failing on Debian Lenny & Squeeze. The other
failure is due to 1b42f45255 ("git-svn: apply "svn.pathnameencoding"
before URL encoding", 2016-02-09).

The dash bug is triggered by this test because the heredoc contains a
command embedded in "$()" with a "{}" block coming right after
it. Refactoring the "$()" to e.g. be a variable that was set earlier
will also work around it, but let's instead break up the "EOF" and the
"{}".

An earlier version of this patch[2] mitigated the issue by breaking
the "$()" out of the "{}" block, that worked, but just because it
broke up the "EOF" and "{}" block. Putting e.g. "echo &&" between the
two would also work.

1. https://git.kernel.org/pub/scm/utils/dash/dash.git/
2. https://public-inbox.org/git/20181127164253.9832-1-avarab@gmail.com/

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

config.mak.uname: move location of bash on NonStop... Randall S. Becker Sat, 9 Feb 2019 17:26:11 +0000 (12:26 -0500)

config.mak.uname: move location of bash on NonStop to CoreUtils

The default bash is now officially in /usr/coreutils/bin instead
of in /usr/local/bin. This version of bash is more stable and
recommended for all use as of the J06.22 and L18.02 operating
system revision levels. This new version provides more stability
of test results.

Signed-off-by: Randall S. Becker <rsbecker@nexbridge.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

read-cache.c: fix writing "link" index ext with null... Nguyễn Thái Ngọc Duy Wed, 13 Feb 2019 09:51:29 +0000 (16:51 +0700)

read-cache.c: fix writing "link" index ext with null base oid

Since commit 7db118303a (unpack_trees: fix breakage when o->src_index !=
o->dst_index - 2018-04-23) and changes in merge code to use separate
index_state for source and destination, when doing a merge with split
index activated, we may run into this line in unpack_trees():

o->result.split_index = init_split_index(&o->result);

This is by itself not wrong. But this split index information is not
fully populated (and it's only so when move_cache_to_base_index() is
called, aka force splitting the index, or loading index_state from a
file). Both "base_oid" and "base" in this case remain null.

So when writing the main index down, we link to this index with null
oid (default value after init_split_index()), which also means "no split
index" internally. This triggers an incorrect base index refresh:

warning: could not freshen shared index '.../sharedindex.0{40}'

This patch makes sure we will not refresh null base_oid (because the
file is never there). It also makes sure not to write "link" extension
with null base_oid in the first place (no point having it at
all). Read code already has protection against null base_oid.

There is also another side fix in remove_split_index() that causes a
crash when doing "git update-index --no-split-index" when base_oid in
the index file is null. In this case we will not load
istate->split_index->base but we dereference it anyway and are rewarded
with a segfault. This should not happen anymore, but it's still wrong to
dereference a potential NULL pointer, especially when we do check for
NULL pointer in the next code.

Reported-by: Luke Diamand <luke@diamand.org>
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

t5562: replace /dev/zero with a pipe from generate_zero... Randall S. Becker Sat, 9 Feb 2019 18:59:30 +0000 (13:59 -0500)

t5562: replace /dev/zero with a pipe from generate_zero_bytes

To help platforms that lack /dev/zero (e.g. NonStop), replace use
of /dev/zero to feed "git http-backend" with a pipe of output from
the generate_zero_bytes helper.

Signed-off-by: Randall S. Becker <rsbecker@nexbridge.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

t5318: replace use of /dev/zero with generate_zero_bytesRandall S. Becker Sat, 9 Feb 2019 18:59:29 +0000 (13:59 -0500)

t5318: replace use of /dev/zero with generate_zero_bytes

There are platforms (e.g. NonStop) that lack /dev/zero; use the
generate_zero_bytes helper we just introduced to append stream
of NULs at the end of the file.

The original, even though it uses "dd seek=... count=..." to make it
look like it is overwriting the middle part of an existing file, has
truncated the file before this step with another use of "dd", which
may make it tricky to see why this rewrite is a correct one.

Signed-off-by: Randall S. Becker <rsbecker@nexbridge.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

get_oid_with_context(): match prototype and implementationDuy Nguyen Tue, 12 Feb 2019 12:43:23 +0000 (19:43 +0700)

get_oid_with_context(): match prototype and implementation

The get_oid_with_context() function is declared to return an enum in
cache.h, but defined to return an int in sha1-name.c. The compiler
notices this on AIX and rejects the build, since d1dd94b308 (Do not
print 'dangling' for cat-file in case of ambiguity - 2019-01-17) was
merged.

Return the correct type from the implementation to fix this.

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

git-compat-util: work around fileno(fp) that is a macroDuy Nguyen Tue, 12 Feb 2019 14:14:41 +0000 (21:14 +0700)

git-compat-util: work around fileno(fp) that is a macro

On various BSD's, fileno(fp) is implemented as a macro that directly
accesses the fields in the FILE * object, which breaks a function that
accepts a "void *fp" parameter and calls fileno(fp) and expect it to
work.

Work it around by adding a compile-time knob FILENO_IS_A_MACRO that
inserts a real helper function in the middle of the callchain.

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

test-lib-functions.sh: add generate_zero_bytes functionRandall S. Becker Sat, 9 Feb 2019 18:59:28 +0000 (13:59 -0500)

test-lib-functions.sh: add generate_zero_bytes function

t5318 and t5562 used /dev/zero, which is not portable. This function
provides both a fixed block of NUL bytes and an infinite stream of NULs.

Signed-off-by: Randall S. Becker <rsbecker@nexbridge.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

RelNotes/2.21: misc typo/English fixupsJeff King Tue, 12 Feb 2019 06:33:04 +0000 (01:33 -0500)

RelNotes/2.21: misc typo/English fixups

These are just some small fixes I noticed doing a complete read-through
(there are a few cases I left that are incomplete or abbreviated
sentences, but I think those are OK in this sort of bullet-list style).

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

RelNotes/2.21: tweak "--date=auto" mentionJeff King Tue, 12 Feb 2019 06:32:48 +0000 (01:32 -0500)

RelNotes/2.21: tweak "--date=auto" mention

In the feature that was eventually committed, "--date=auto" doesn't do
anything. It was generalized to "--date=auto:<format>".

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

Merge branch 'nd/imap-send-typofix'Junio C Hamano Tue, 12 Feb 2019 17:00:25 +0000 (09:00 -0800)

Merge branch 'nd/imap-send-typofix'

* nd/imap-send-typofix:
imap-send.c: add a missing space in error message

imap-send.c: add a missing space in error messageNguyễn Thái Ngọc Duy Mon, 11 Feb 2019 09:40:11 +0000 (16:40 +0700)

imap-send.c: add a missing space in error message

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

utf8: handle systems that don't write BOM for UTF-16brian m. carlson Tue, 12 Feb 2019 00:52:06 +0000 (00:52 +0000)

utf8: handle systems that don't write BOM for UTF-16

When serializing UTF-16 (and UTF-32), there are three possible ways to
write the stream. One can write the data with a BOM in either big-endian
or little-endian format, or one can write the data without a BOM in
big-endian format.

Most systems' iconv implementations choose to write it with a BOM in
some endianness, since this is the most foolproof, and it is resistant
to misinterpretation on Windows, where UTF-16 and the little-endian
serialization are very common. For compatibility with Windows and to
avoid accidental misuse there, Git always wants to write UTF-16 with a
BOM, and will refuse to read UTF-16 without it.

However, musl's iconv implementation writes UTF-16 without a BOM,
relying on the user to interpret it as big-endian. This causes t0028 and
the related functionality to fail, since Git won't read the file without
a BOM.

Add a Makefile and #define knob, ICONV_OMITS_BOM, that can be set if the
iconv implementation has this behavior. When set, Git will write a BOM
manually for UTF-16 and UTF-32 and then force the data to be written in
UTF-16BE or UTF-32BE. We choose big-endian behavior here because the
tests use the raw "UTF-16" encoding, which will be big-endian when the
implementation requires this knob to be set.

Update the tests to detect this case and write test data with an added
BOM if necessary. Always write the BOM in the tests in big-endian
format, since all iconv implementations that omit a BOM must use
big-endian serialization according to the Unicode standard.

Preserve the existing behavior for systems which do not have this knob
enabled, since they may use optimized implementations, including
defaulting to the native endianness, which may improve performance.

Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

t0028: fix wrong octal values for BOM in setupKevin Daudt Mon, 11 Feb 2019 21:38:18 +0000 (22:38 +0100)

t0028: fix wrong octal values for BOM in setup

The setup code uses octal values with printf to generate a BOM for
UTF-16/32 BE/LE. It specifically uses '\777' to emit a 0xff byte. This
relies on the fact that most shells truncate the value above 0o377.

Ash however interprets '\777' as '\77' + a literal '7', resulting in an
invalid BOM.

Fix this by using the proper value of 0xff: '\377'.

Signed-off-by: Kevin Daudt <me@ikke.info>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

test-lib: fix non-portable pattern bracket expressionsSZEDER Gábor Mon, 11 Feb 2019 19:58:03 +0000 (20:58 +0100)

test-lib: fix non-portable pattern bracket expressions

Use a '!' character to start a non-matching pattern bracket
expression, as specified by POSIX in Shell Command Language section
2.13.1 Patterns Matching a Single Character [1].

I used '^' instead in three places in the previous three commits, to
verify that the arguments of the '--stress=' and '--stress-limit='
options and the values of various '*_PORT' environment variables are
valid numbers. With certain shells, at least with dash (upstream and
in Ubuntu 14.04) and mksh, this led to various undesired behaviors:

# error message in case of a valid number
$ ~/src/dash/src/dash ./t3903-stash.sh --stress=8
error: --stress=<N> requires the number of jobs to run

# not the expected error message
$ ~/src/dash/src/dash ./t3903-stash.sh --stress=foo
./t3903-stash.sh: 238: test: Illegal number: foo

# no error message at all?!
$ mksh ./t3903-stash.sh --stress=foo
$ echo $?
0

Some other shells, e.g. Bash (even in posix mode), ksh, dash in Ubuntu
16.04 or later, are apparently happy to accept '^' just as well.

[1] http://pubs.opengroup.org/onlinepubs/009695399/utilities/xcu_chap02.html#tag_02_13

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

prune-packed: check for too many argumentsRamsay Jones Mon, 11 Feb 2019 17:23:40 +0000 (17:23 +0000)

prune-packed: check for too many arguments

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

sequencer: make sign_off_header a file local symbolRamsay Jones Mon, 11 Feb 2019 17:16:58 +0000 (17:16 +0000)

sequencer: make sign_off_header a file local symbol

Commit d0aaa46fd3 ("commit: move empty message checks to libgit",
2017-11-10) removes the last use of 'sign_off_header' outside of
the "sequencer.c" source file. Remove the extern declaration from
the header file and mark the definition of the symbol with the
static keyword.

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

config.mak.uname: add FREAD_READS_DIRECTORIES for NonSt... Randall S. Becker Sun, 10 Feb 2019 00:20:16 +0000 (19:20 -0500)

config.mak.uname: add FREAD_READS_DIRECTORIES for NonStop platform

The NonStop platform needs this configuration item specified as
UnfortunatelyYes so that config directory files are correctly processed.

Signed-off-by: Randall S. Becker <rsbecker@nexbridge.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Fix typos in translatable strings for v2.21.0Jean-Noël Avila Mon, 11 Feb 2019 06:44:53 +0000 (07:44 +0100)

Fix typos in translatable strings for v2.21.0

Signed-off-by: Jean-Noël Avila <jn.avila@free.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

test: caution on our version of 'yes'Junio C Hamano Sat, 9 Feb 2019 18:25:26 +0000 (10:25 -0800)

test: caution on our version of 'yes'

During a review of a patch, we noticed that we use our own imitation
of 'yes' with the limit of 99 lines. It is very tempting to lift this
arbitrary limit, but the limit is there for a reason.

Add an in-code comment to prevent future developers from wasting
their time.

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

l10n: git.pot: v2.21.0 round 1 (214 new, 38 removed)Jiang Xin Sat, 9 Feb 2019 12:54:56 +0000 (20:54 +0800)

l10n: git.pot: v2.21.0 round 1 (214 new, 38 removed)

Generate po/git.pot from v2.21.0-rc0-30-g11ad41d4cb (Seventh batch for 2.21)
for git v2.21.0 l10n round 1.

Signed-off-by: Jiang Xin <worldhello.net@gmail.com>

Merge branch 'master' of git://github.com/git-l10n... Jiang Xin Sat, 9 Feb 2019 12:53:46 +0000 (20:53 +0800)

Merge branch 'master' of git://github.com/git-l10n/git-po

Seventh batch for 2.21Junio C Hamano Sat, 9 Feb 2019 04:45:48 +0000 (20:45 -0800)

Seventh batch for 2.21

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

Merge branch 'js/mingw-host-cpu'Junio C Hamano Sat, 9 Feb 2019 04:44:53 +0000 (20:44 -0800)

Merge branch 'js/mingw-host-cpu'

Windows update.

* js/mingw-host-cpu:
mingw: fix CPU reporting in `git version --build-options`

Merge branch 'js/fuzz-commit-graph-update'Junio C Hamano Sat, 9 Feb 2019 04:44:53 +0000 (20:44 -0800)

Merge branch 'js/fuzz-commit-graph-update'

Update to the fuzzer.

* js/fuzz-commit-graph-update:
object: fix leak of shallow_stat
fuzz-commit-graph: initialize repo object

Merge branch 'kl/pretty-doc-markup-fix'Junio C Hamano Sat, 9 Feb 2019 04:44:52 +0000 (20:44 -0800)

Merge branch 'kl/pretty-doc-markup-fix'

Doc update.

* kl/pretty-doc-markup-fix:
doc: prevent overflowing <code> tag in rendered HTML

Merge branch 'sg/ci-parallel-build'Junio C Hamano Sat, 9 Feb 2019 04:44:52 +0000 (20:44 -0800)

Merge branch 'sg/ci-parallel-build'

Build update.

* sg/ci-parallel-build:
ci: clear and mark MAKEFLAGS exported just once
ci: make sure we build Git parallel

Merge branch 'ld/git-p4-remove-flakey-test'Junio C Hamano Sat, 9 Feb 2019 04:44:52 +0000 (20:44 -0800)

Merge branch 'ld/git-p4-remove-flakey-test'

A flakey "p4" test has been removed.

* ld/git-p4-remove-flakey-test:
git-p4: remove ticket expiry test

Merge branch 'js/rebase-i-redo-exec-fix'Junio C Hamano Sat, 9 Feb 2019 04:44:52 +0000 (20:44 -0800)

Merge branch 'js/rebase-i-redo-exec-fix'

For "rebase -i --reschedule-failed-exec", we do not want the "-y"
shortcut after all.

* js/rebase-i-redo-exec-fix:
Revert "rebase: introduce a shortcut for --reschedule-failed-exec"

Merge branch 'nd/checkout-noisy-unmerge'Junio C Hamano Sat, 9 Feb 2019 04:44:51 +0000 (20:44 -0800)

Merge branch 'nd/checkout-noisy-unmerge'

"git checkout [<tree-ish>] <pathspec>" started reporting the number
of paths that have got updated recently, but the same messages were
given when "git checkout -m <pathspec>" to unresolve conflicts that
have just been resolved. The message now reports these unresolved
paths separately from the paths that are checked out from the index.

* nd/checkout-noisy-unmerge:
checkout: count and print -m paths separately
checkout: update count-checkouts messages

Merge branch 'js/smart-http-detect-remote-error'Junio C Hamano Sat, 9 Feb 2019 04:44:51 +0000 (20:44 -0800)

Merge branch 'js/smart-http-detect-remote-error'

Some errors from the other side coming over smart HTTP transport
were not noticed, which has been corrected.

* js/smart-http-detect-remote-error:
t5551: test server-side ERR packet
remote-curl: tighten "version 2" check for smart-http
remote-curl: refactor smart-http discovery

Merge branch 'ds/coverage-prove'Junio C Hamano Sat, 9 Feb 2019 04:44:51 +0000 (20:44 -0800)

Merge branch 'ds/coverage-prove'

A new target "coverage-prove" to run the coverage test under
"prove" has been added.

* ds/coverage-prove:
Makefile: add coverage-prove target

Merge branch 'tz/gpg-test-fix'Junio C Hamano Sat, 9 Feb 2019 04:44:50 +0000 (20:44 -0800)

Merge branch 'tz/gpg-test-fix'

Test fix.

* tz/gpg-test-fix:
t/lib-gpg: drop redundant killing of gpg-agent
t/lib-gpg: quote path to ${GNUPGHOME}/trustlist.txt

Merge branch 'os/rebase-runs-post-checkout-hook'Junio C Hamano Sat, 9 Feb 2019 04:44:50 +0000 (20:44 -0800)

Merge branch 'os/rebase-runs-post-checkout-hook'

Test fix.

* os/rebase-runs-post-checkout-hook:
t5403: correct bash ambiguous redirect error in subtest 8 by quoting $GIT_DIR

test-lib: make '--stress' more bisect-friendlySZEDER Gábor Fri, 8 Feb 2019 11:50:45 +0000 (12:50 +0100)

test-lib: make '--stress' more bisect-friendly

Let's suppose that a test somehow becomes flaky between 'master' and
'pu', and tends to fail within the first 50 repetitions when run with
'--stress'. In such a case we could use 'git bisect' to find the
culprit: if the test script fails with '--stress', then the commit is
definitely bad, but if it survives, say, 300 repetitions, then we could
consider it good with reasonable confidence.

Unfortunately, all this could only be done manually, because
'--stress' would run the test script repeatedly for all eternity on a
good commit, and it would exit with success even when it found a
failure on a bad commit.

So let's make '--stress' usable with 'git bisect run':

- Make it exit with failure if a failure is found.

- Add the '--stress-limit=<N>' option to repeat the test script
at most N times in each of the parallel jobs, and exit with
success when the limit is reached.

And then we could simply run something like:

$ git bisect start origin/pu master
$ git bisect run sh -c 'make && cd t &&
./t1234-foo.sh --stress --stress-limit=300'

Sure, as a brand new feature it won't be any useful right now, but in
a release or three most cooking topics will already contain this, so
we could automatically bisect at least newly introduced flakiness.

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

t5403: correct bash ambiguous redirect error in subtest... Randall S. Becker Fri, 8 Feb 2019 11:32:33 +0000 (06:32 -0500)

t5403: correct bash ambiguous redirect error in subtest 8 by quoting $GIT_DIR

The embedded blanks in the full path of the test git repository cased bash
to generate an ambugious redirect error.

Signed-off-by: Randall S. Becker <rsbecker@nexbridge.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

.mailmap: map Clemens Buchacher's mail addressesJohannes Schindelin Fri, 8 Feb 2019 10:01:20 +0000 (02:01 -0800)

.mailmap: map Clemens Buchacher's mail addresses

We have three email addresses for Clemens in our commit history, two of
them bouncing. Let's map the latter to the only one that still works.

Pointed out by Gábor Szeder.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

t/lib-gpg: drop redundant killing of gpg-agentTodd Zullinger Fri, 8 Feb 2019 03:17:46 +0000 (22:17 -0500)

t/lib-gpg: drop redundant killing of gpg-agent

In 53fc999306 ("gpg-interface t: extend the existing GPG tests with
GPGSM", 2018-07-20), the gpgconf call which kills gpg-agent was copied
from the existing gpg setup code.

The reason for killing gpg-agent is given in 29ff1f8f74 ("t: lib-gpg:
flush gpg agent on startup", 2017-07-20):

When running gpg-relevant tests, a gpg-daemon is spawned for each
GNUPGHOME used. This daemon may stay running after the test and cache
file descriptors for the trash directories, even after the trash
directory is removed. This leads to ENOENT errors when attempting to
create files if tests are run multiple times.

Add a cleanup script to force flushing the gpg-agent for that GNUPGHOME
(if any) before setting up the GPG relevant-environment.

Killing gpg-agent once per test is sufficient.

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

t/lib-gpg: quote path to ${GNUPGHOME}/trustlist.txtTodd Zullinger Fri, 8 Feb 2019 03:17:45 +0000 (22:17 -0500)

t/lib-gpg: quote path to ${GNUPGHOME}/trustlist.txt

When gpgsm is installed, lib-gpg.sh attempts to update trustlist.txt to
relax the checking of some root certificate requirements. The path to
"${GNUPGHOME}" contains spaces which cause an "ambiguous redirect"
warning when bash is used to run the tests:

$ bash t7030-verify-tag.sh
/git/t/lib-gpg.sh: line 66: ${GNUPGHOME}/trustlist.txt: ambiguous redirect
ok 1 - create signed tags
ok 2 # skip create signed tags x509 (missing GPGSM)
...

No warning is issued when using bash called as /bin/sh, dash, or mksh.

Quote the path to ensure the redirect works as intended and sets the
GPGSM prereq. While we're here, drop the space after ">>".

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

log,diff-tree: add --combined-all-paths optionElijah Newren Fri, 8 Feb 2019 01:12:46 +0000 (17:12 -0800)

log,diff-tree: add --combined-all-paths option

The combined diff format for merges will only list one filename, even if
rename or copy detection is active. For example, with raw format one
might see:

::100644 100644 100644 fabadb8 cc95eb0 4866510 MM describe.c
::100755 100755 100755 52b7a2d 6d1ac04 d2ac7d7 RM bar.sh
::100644 100644 100644 e07d6c5 9042e82 ee91881 RR phooey.c

This doesn't let us know what the original name of bar.sh was in the
first parent, and doesn't let us know what either of the original names
of phooey.c were in either of the parents. In contrast, for non-merge
commits, raw format does provide original filenames (and a rename score
to boot). In order to also provide original filenames for merge
commits, add a --combined-all-paths option (which must be used with
either -c or --cc, and is likely only useful with rename or copy
detection active) so that we can print tab-separated filenames when
renames are involved. This transforms the above output to:

::100644 100644 100644 fabadb8 cc95eb0 4866510 MM desc.c desc.c desc.c
::100755 100755 100755 52b7a2d 6d1ac04 d2ac7d7 RM foo.sh bar.sh bar.sh
::100644 100644 100644 e07d6c5 9042e82 ee91881 RR fooey.c fuey.c phooey.c

Further, in patch format, this changes the from/to headers so that
instead of just having one "from" header, we get one for each parent.
For example, instead of having

--- a/phooey.c
+++ b/phooey.c

we would see

--- a/fooey.c
--- a/fuey.c
+++ b/phooey.c

Signed-off-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

mingw: fix CPU reporting in `git version --build-options`Johannes Schindelin Thu, 7 Feb 2019 10:46:06 +0000 (02:46 -0800)

mingw: fix CPU reporting in `git version --build-options`

We cannot rely on `uname -m` in Git for Windows' SDK to tell us what
architecture we are compiling for, as we can compile both 32-bit and
64-bit `git.exe` from a 64-bit SDK, but the `uname -m` in that SDK will
always report `x86_64`.

So let's go back to our original design. And make it explicitly
Windows-specific.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

object: fix leak of shallow_statJosh Steadmon Thu, 7 Feb 2019 20:05:54 +0000 (12:05 -0800)

object: fix leak of shallow_stat

In eee4502baaf ("shallow: migrate shallow information into the object
parser", 2018-05-17), we added a stat_validity pointer into the
parsed_object_pool struct, but did not add code to free this in
parsed_object_pool_clear(). This leak was found by fuzz-commit-graph.

Clear the struct and then free it in parsed_object_pool_clear() to
prevent the leak.

Signed-off-by: Josh Steadmon <steadmon@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

fuzz-commit-graph: initialize repo objectJosh Steadmon Thu, 7 Feb 2019 20:05:53 +0000 (12:05 -0800)

fuzz-commit-graph: initialize repo object

Various #DEFINE "constants" in commit-graph.c now depend on
the_hash_algo->rawsz, but this object must be initialized before it can
be used.

Signed-off-by: Josh Steadmon <steadmon@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

doc: prevent overflowing <code> tag in rendered HTMLKatrin Leinweber Thu, 7 Feb 2019 19:16:37 +0000 (20:16 +0100)

doc: prevent overflowing <code> tag in rendered HTML

Add an apparently missing back-tick to fix a multi-line <code> section
on https://git-scm.com/docs/git-log which seems to have been caused by
commit 18fb7ffc ("pretty: respect color settings [...]", 2017-07-13).

Signed-off-by: Katrin Leinweber <katrin.leinweber@uni-konstanz.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

ci: clear and mark MAKEFLAGS exported just onceJunio C Hamano Thu, 7 Feb 2019 19:36:28 +0000 (11:36 -0800)

ci: clear and mark MAKEFLAGS exported just once

Clearing it once upfront, and turning all the assignment into
appending, would future-proof the code even more, to prevent
mistakes the previous one fixed from happening again.

Also, mark the variable exported just once at the beginning. There
is no point in marking it exported repeatedly.

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

ci: make sure we build Git parallelSZEDER Gábor Thu, 7 Feb 2019 18:37:36 +0000 (19:37 +0100)

ci: make sure we build Git parallel

Commit 2c8921db2b (travis-ci: build with the right compiler,
2019-01-17) started to use MAKEFLAGS to specify which compiler to use
to build Git. A bit later, and in a different topic branch commit
eaa62291ff (ci: inherit --jobs via MAKEFLAGS in run-build-and-tests,
2019-01-27) started to use MAKEFLAGS as well. Unfortunately, there is
a semantic conflict between these two commits: both of them set
MAKEFLAGS, and since the line adding CC from 2c8921db2b comes later in
'ci/lib.sh', it overwrites the number of parallel jobs added in
eaa62291ff.

Consequently, since both commits have been merged all our CI jobs have
been building Git, building its documentation, and applying semantic
patches sequentially, making all build jobs a bit slower. Running
the test suite is unaffected, because the number of test jobs comes
from GIT_PROVE_OPTS.

Append to MAKEFLAGS when setting the compiler to use, to ensure that
the number of parallel jobs to use is preserved.

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

Git 2.21-rc0 v2.21.0-rc0Junio C Hamano Thu, 7 Feb 2019 05:30:09 +0000 (21:30 -0800)

Git 2.21-rc0

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

Merge branch 'jk/add-ignore-errors-bit-assignment-fix'Junio C Hamano Thu, 7 Feb 2019 06:05:30 +0000 (22:05 -0800)

Merge branch 'jk/add-ignore-errors-bit-assignment-fix'

A hotfix to an incomplete fix made earlier.

* jk/add-ignore-errors-bit-assignment-fix:
add_to_index(): convert forgotten HASH_RENORMALIZE check

Merge branch 'rj/sparse-flags'Junio C Hamano Thu, 7 Feb 2019 06:05:30 +0000 (22:05 -0800)

Merge branch 'rj/sparse-flags'

Use of the sparse tool got easier to customize from the command
line to help developers.

* rj/sparse-flags:
Makefile: improve SPARSE_FLAGS customisation
config.mak.uname: remove obsolete SPARSE_FLAGS setting

Merge branch 'bc/fetch-pack-clear-alternate-shallow'Junio C Hamano Thu, 7 Feb 2019 06:05:30 +0000 (22:05 -0800)

Merge branch 'bc/fetch-pack-clear-alternate-shallow'

"git fetch" over protocol v2 that needs to make a second connection
to backfill tags did not clear a variable that holds shallow
repository information correctly, leading to an access of freed
piece of memory.

* bc/fetch-pack-clear-alternate-shallow:
fetch-pack: clear alternate shallow in one more place
fetch-pack: clear alternate shallow when complete

Merge branch 'ma/doc-diff-usage-fix'Junio C Hamano Thu, 7 Feb 2019 06:05:29 +0000 (22:05 -0800)

Merge branch 'ma/doc-diff-usage-fix'

Running "Documentation/doc-diff x" from anywhere other than the
top-level of the working tree did not show the usage string
correctly, which has been fixed.

* ma/doc-diff-usage-fix:
doc-diff: don't `cd_to_toplevel`

Merge branch 'ab/diff-tree-doc-fix'Junio C Hamano Thu, 7 Feb 2019 06:05:29 +0000 (22:05 -0800)

Merge branch 'ab/diff-tree-doc-fix'

Doc fix.

* ab/diff-tree-doc-fix:
diff-tree doc: correct & remove wrong documentation

Merge branch 'ss/describe-dirty-in-the-right-directory'Junio C Hamano Thu, 7 Feb 2019 06:05:29 +0000 (22:05 -0800)

Merge branch 'ss/describe-dirty-in-the-right-directory'

"git --work-tree=$there --git-dir=$here describe --dirty" did not
work correctly as it did not pay attention to the location of the
worktree specified by the user by mistake, which has been
corrected.

* ss/describe-dirty-in-the-right-directory:
t6120: test for describe with a bare repository
describe: setup working tree for --dirty

Merge branch 'sg/travis-osx-brew-breakage-workaround'Junio C Hamano Thu, 7 Feb 2019 06:05:28 +0000 (22:05 -0800)

Merge branch 'sg/travis-osx-brew-breakage-workaround'

The way the OSX build jobs updates its build environment used the
"--quiet" option to "brew update" command, but it wasn't all that
quiet to be useful. The use of the option has been replaced with
an explicit redirection to the /dev/null (which incidentally would
have worked around a breakage by recent updates to homebrew, which
has fixed itself already).

* sg/travis-osx-brew-breakage-workaround:
travis-ci: make the OSX build jobs' 'brew update' more quiet

Merge branch 'nd/commit-doc'Junio C Hamano Thu, 7 Feb 2019 06:05:28 +0000 (22:05 -0800)

Merge branch 'nd/commit-doc'

Doc update.

* nd/commit-doc:
git-commit.txt: better description what it does

Merge branch 'sl/const'Junio C Hamano Thu, 7 Feb 2019 06:05:27 +0000 (22:05 -0800)

Merge branch 'sl/const'

Code cleanup.

* sl/const:
various: tighten constness of some local variables

Merge branch 'sh/submodule-summary-abbrev-fix'Junio C Hamano Thu, 7 Feb 2019 06:05:27 +0000 (22:05 -0800)

Merge branch 'sh/submodule-summary-abbrev-fix'

The "git submodule summary" subcommand showed shortened commit
object names by mechanically truncating them at 7-hexdigit, which
has been improved to let "rev-parse --short" scale the length of
the abbreviation with the size of the repository.

* sh/submodule-summary-abbrev-fix:
git-submodule.sh: shorten submodule SHA-1s using rev-parse

Merge branch 'nd/help-align-command-desc'Junio C Hamano Thu, 7 Feb 2019 06:05:27 +0000 (22:05 -0800)

Merge branch 'nd/help-align-command-desc'

Output from "git help" was not correctly aligned, which has been
fixed.

* nd/help-align-command-desc:
help: align the longest command in the command listing

Merge branch 'jk/loose-object-cache-oid'Junio C Hamano Thu, 7 Feb 2019 06:05:27 +0000 (22:05 -0800)

Merge branch 'jk/loose-object-cache-oid'

Code clean-up.

* jk/loose-object-cache-oid:
prefer "hash mismatch" to "sha1 mismatch"
sha1-file: avoid "sha1 file" for generic use in messages
sha1-file: prefer "loose object file" to "sha1 file" in messages
sha1-file: drop has_sha1_file()
convert has_sha1_file() callers to has_object_file()
sha1-file: convert pass-through functions to object_id
sha1-file: modernize loose header/stream functions
sha1-file: modernize loose object file functions
http: use struct object_id instead of bare sha1
update comment references to sha1_object_info()
sha1-file: fix outdated sha1 comment references

Merge branch 'pw/rebase-x-sanity-check'Junio C Hamano Thu, 7 Feb 2019 06:05:26 +0000 (22:05 -0800)

Merge branch 'pw/rebase-x-sanity-check'

"git rebase -x $cmd" did not reject multi-line command, even though
the command is incapable of handling such a command. It now is
rejected upfront.

* pw/rebase-x-sanity-check:
rebase -x: sanity check command