gitweb.git
Merge branch 'nd/clone-case-smashing-warning'Junio C Hamano Wed, 21 Nov 2018 11:39:02 +0000 (20:39 +0900)

Merge branch 'nd/clone-case-smashing-warning'

Recently added check for case smashing filesystems did not
correctly utilize the cached stat information, leading to false
breakage detected by our test suite, which has been corrected.

* nd/clone-case-smashing-warning:
clone: fix colliding file detection on APFS

Merge branch 'tz/build-tech-midx-doc'Junio C Hamano Wed, 21 Nov 2018 11:39:02 +0000 (20:39 +0900)

Merge branch 'tz/build-tech-midx-doc'

A documentation page that is referred to by other pages was not
built by mistake, which has been corrected.

* tz/build-tech-midx-doc:
Documentation: build technical/multi-pack-index

Merge branch 'jn/eoie-ieot'Junio C Hamano Wed, 21 Nov 2018 11:39:02 +0000 (20:39 +0900)

Merge branch 'jn/eoie-ieot'

As the warning message shown by existing versions of Git for
unknown index extensions is a bit too alarming, two new extensions
are held back and not written by default for the upcoming release.

* jn/eoie-ieot:
index: make index.threads=true enable ieot and eoie
ieot: default to not writing IEOT section
eoie: default to not writing EOIE section

Merge branch 'cc/delta-islands'Junio C Hamano Wed, 21 Nov 2018 11:39:02 +0000 (20:39 +0900)

Merge branch 'cc/delta-islands'

A few issues in the implementation of "delta-islands" feature has
been corrected.

* cc/delta-islands:
pack-objects: fix off-by-one in delta-island tree-depth computation
pack-objects: zero-initialize tree_depth/layer arrays
pack-objects: fix tree_depth and layer invariants

Merge branch 'js/rebase-am-options-fix'Junio C Hamano Wed, 21 Nov 2018 11:39:01 +0000 (20:39 +0900)

Merge branch 'js/rebase-am-options-fix'

Recently, built-in "rebase" tightened the error checking for a few
options that are passed to underlying "am", but we forgot to make
the matching change to the scripted version, which has been
corrected.

* js/rebase-am-options-fix:
legacy-rebase: backport -C<n> and --whitespace=<option> checks

Merge branch 'js/builtin-rebase-perf-fix-err-fix'Junio C Hamano Wed, 21 Nov 2018 11:39:01 +0000 (20:39 +0900)

Merge branch 'js/builtin-rebase-perf-fix-err-fix'

The object name of the tree reported in a recently added error
message was wrong, which has been corrected.

* js/builtin-rebase-perf-fix-err-fix:
rebase: warn about the correct tree's OID

index: make index.threads=true enable ieot and eoieJonathan Nieder Tue, 20 Nov 2018 06:14:26 +0000 (22:14 -0800)

index: make index.threads=true enable ieot and eoie

If a user explicitly sets

[index]
threads = true

to read the index using multiple threads, ensure that index writes
include the offset table by default to make that possible. This
ensures that the user's intent of turning on threading is respected.

In other words, permit the following configurations:

- index.threads and index.recordOffsetTable unspecified: do not write
the offset table yet (to avoid alarming the user with "ignoring IEOT
extension" messages when an older version of Git accesses the
repository) but do make use of multiple threads to read the index if
the supporting offset table is present.

This can also be requested explicitly by setting index.threads=true,
0, or >1 and index.recordOffsetTable=false.

- index.threads=false or 1: do not write the offset table, and do not
make use of the offset table.

One can set index.recordOffsetTable=false as well, to be more
explicit.

- index.threads=true, 0, or >1 and index.recordOffsetTable unspecified:
write the offset table and make use of threads at read time.

This can also be requested by setting index.threads=true, 0, >1, or
unspecified and index.recordOffsetTable=true.

Fortunately the complication is temporary: once most Git installations
have upgraded to a version with support for the IEOT and EOIE
extensions, we can flip the defaults for index.recordEndOfIndexEntries
and index.recordOffsetTable to true and eliminate the settings.

Helped-by: Ben Peart <benpeart@microsoft.com>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

clone: fix colliding file detection on APFSNguyễn Thái Ngọc Duy Tue, 20 Nov 2018 16:28:53 +0000 (17:28 +0100)

clone: fix colliding file detection on APFS

Commit b878579ae7 (clone: report duplicate entries on case-insensitive
filesystems - 2018-08-17) adds a warning to user when cloning a repo
with case-sensitive file names on a case-insensitive file system. The
"find duplicate file" check was doing by comparing inode number (and
only fall back to fspathcmp() when inode is known to be unreliable
because fspathcmp() can't cover all case folding cases).

The inode check is very simple, and wrong. It compares between a
32-bit number (sd_ino) and potentially a 64-bit number (st_ino). When
an inode is larger than 2^32 (which seems to be the case for APFS), it
will be truncated and stored in sd_ino, but comparing with itself will
fail.

As a result, instead of showing a pair of files that have the same
name, we show just one file (marked before the beginning of the
loop). We fail to find the original one.

The fix could be just a simple type cast (*)

dup->ce_stat_data.sd_ino == (unsigned int)st->st_ino

but this is no longer a reliable test, there are 4G possible inodes
that can match sd_ino because we only match the lower 32 bits instead
of full 64 bits.

There are two options to go. Either we ignore inode and go with
fspathcmp() on Apple platform. This means we can't do accurate inode
check on HFS anymore, or even on APFS when inode numbers are still
below 2^32.

Or we just to to reduce the odds of matching a wrong file by checking
more attributes, counting mostly on st_size because st_xtime is likely
the same. This patch goes with this direction, hoping that false
positive chances are too small to be seen in practice.

While at there, enable the test on Cygwin (verified working by Ramsay
Jones)

(*) this is also already done inside match_stat_data()

Reported-by: Carlo Arenas <carenas@gmail.com>
Helped-by: Ramsay Jones <ramsay@ramsayjones.plus.com>
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Documentation: build technical/multi-pack-indexTodd Zullinger Tue, 20 Nov 2018 18:04:54 +0000 (13:04 -0500)

Documentation: build technical/multi-pack-index

The git-multi-pack-index doc links to technical/multi-pack-index.html.
Ensure it is built to prevent a broken link.

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

pack-objects: fix off-by-one in delta-island tree-depth... Jeff King Tue, 20 Nov 2018 09:50:53 +0000 (04:50 -0500)

pack-objects: fix off-by-one in delta-island tree-depth computation

When delta-islands are in use, we need to record the deepest path at
which we find each tree and blob. Our loop to do so counts slashes, so
"foo" is depth 0, "foo/bar" is depth 1, and so on.

However, this neglects root trees, which are represented by the empty
string. Those also have depth 0, but are at a layer above "foo". Thus,
"foo" should be 1, "foo/bar" at 2, and so on. We use this depth to
topo-sort the trees in resolve_tree_islands(). As a result, we may fail
to visit a root tree before the sub-trees it contains, and therefore not
correctly pass down the island marks.

That in turn could lead to missing some delta opportunities (objects are
in the same island, but we didn't realize it) or creating unwanted
cross-island deltas (one object is in an island another isn't, but we
don't realize). In practice, it seems to have only a small effect. Some
experiments on the real-world git/git fork network at GitHub showed an
improvement of only 0.14% in the resulting clone size.

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

pack-objects: zero-initialize tree_depth/layer arraysJeff King Tue, 20 Nov 2018 09:48:57 +0000 (04:48 -0500)

pack-objects: zero-initialize tree_depth/layer arrays

Commit 108f530385 (pack-objects: move tree_depth into 'struct
packing_data', 2018-08-16) started maintaining a tree_depth array that
matches the "objects" array. We extend the array when:

1. The objects array is extended, in which case we use realloc to
extend the tree_depth array.

2. A caller asks to store a tree_depth for object N, and this is the
first such request; we create the array from scratch and store the
value for N.

In the latter case, though, we use regular xmalloc(), and the depth
values for any objects besides N is undefined. This happens to not
trigger a bug with the current code, but the reasons are quite subtle:

- we never ask about the depth for any object with index i < N. This is
because we store the depth immediately for all trees and blobs. So
any such "i" must be a non-tree, and therefore we will never need to
care about its depth (in fact, we really only care about the depth of
trees).

- there are no objects at this point with index i > N, because we
always fill in the depth for a tree immediately after its object
entry is created (we may still allocate uninitialized depth entries,
but they'll be initialized by packlist_alloc() when it initializes
the entry in the "objects" array).

So it works, but only by chance. To be defensive, let's zero the array,
which matches the "unset" values which would be handed out by
oe_tree_depth() already.

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

pack-objects: fix tree_depth and layer invariantsJeff King Tue, 20 Nov 2018 09:46:38 +0000 (04:46 -0500)

pack-objects: fix tree_depth and layer invariants

Commit 108f530385 (pack-objects: move tree_depth into 'struct
packing_data', 2018-08-16) dynamically manages a tree_depth array in
packing_data that maintains one of these invariants:

1. tree_depth is NULL (i.e., the requested options don't require us to
track tree depths)

2. tree_depth is non-NULL and has as many entries as the "objects"
array

We maintain (2) by:

a. When the objects array grows, grow tree_depth to the same size
(unless it's NULL, in which case we can leave it).

b. When a caller asks to set a depth via oe_set_tree_depth(), if
tree_depth is NULL we allocate it.

But in (b), we use the number of stored objects, _not_ the allocated
size of the objects array. So we can run into a situation like this:

1. packlist_alloc() needs to store the Nth object, so it grows the
objects array to M, where M > N.

2. oe_set_tree_depth() wants to store a depth, so it allocates an
array of length N. Now we've violated our invariant.

3. packlist_alloc() needs to store the N+1th object. But it _doesn't_
grow the objects array, since N <= M still holds. We try to assign
to tree_depth[N+1], which is out of bounds.

That doesn't happen in our test scripts, because the repositories they
use are so small, but it's easy to trigger by running:

echo HEAD | git pack-objects --revs --delta-islands --stdout >/dev/null

in any reasonably-sized repo (like git.git).

We can fix it by always growing the array to match pack->nr_alloc, not
pack->nr_objects. Likewise for the "layer" array from fe0ac2fb7f
(pack-objects: move 'layer' into 'struct packing_data', 2018-08-16),
which has the same bug.

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

rebase: warn about the correct tree's OIDJohannes Schindelin Tue, 20 Nov 2018 09:44:33 +0000 (01:44 -0800)

rebase: warn about the correct tree's OID

This was a simple copy/paste error, and an obvious one at that: if we
cannot fill the tree descriptor, we should show an error message about
*that* tree, not another one.

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

ieot: default to not writing IEOT sectionJonathan Nieder Tue, 20 Nov 2018 06:12:22 +0000 (22:12 -0800)

ieot: default to not writing IEOT section

As with EOIE, popular versions of Git do not support the new IEOT
extension yet. When accessing a Git repository written by a more
modern version of Git, they correctly ignore the unrecognized section,
but in the process they loudly warn

ignoring IEOT extension

resulting in confusion for users. Introduce the index extension more
gently by not writing it yet in this first version with support for
it. Soon, once sufficiently many users are running a modern version
of Git, we can flip the default so users benefit from this index
extension by default.

Introduce a '[index] recordOffsetTable' configuration variable to
control whether the new index extension is written.

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

eoie: default to not writing EOIE sectionJonathan Nieder Tue, 20 Nov 2018 06:11:47 +0000 (22:11 -0800)

eoie: default to not writing EOIE section

Since 3b1d9e04 (eoie: add End of Index Entry (EOIE) extension,
2018-10-10) Git defaults to writing the new EOIE section when writing
out an index file. Usually that is a good thing because it improves
threaded performance, but when a Git repository is shared with older
versions of Git, it produces a confusing warning:

$ git status
ignoring EOIE extension
HEAD detached at 371ed0defa
nothing to commit, working tree clean

Let's introduce the new index extension more gently. First we'll roll
out the new version of Git that understands it, and then once
sufficiently many users are using such a version, we can flip the
default to writing it by default.

Introduce a '[index] recordEndOfIndexEntries' configuration variable
to allow interested users to benefit from this index extension early.

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

legacy-rebase: backport -C<n> and --whitespace=<option... Johannes Schindelin Tue, 20 Nov 2018 20:02:01 +0000 (12:02 -0800)

legacy-rebase: backport -C<n> and --whitespace=<option> checks

Since 04519d720114 (rebase: validate -C<n> and --whitespace=<mode>
parameters early, 2018-11-14), the built-in rebase validates the -C and
--whitespace arguments early. As this commit also introduced a
regression test for this, and as a later commit introduced the
GIT_TEST_REBASE_USE_BUILTIN mode to run tests, we now have a
"regression" in the scripted version of `git rebase` on our hands.

Backport the validation to fix this.

Reported-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Prepare for 2.20-rc1Junio C Hamano Mon, 19 Nov 2018 07:06:54 +0000 (16:06 +0900)

Prepare for 2.20-rc1

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

Merge branch 'sb/cocci-pending'Junio C Hamano Mon, 19 Nov 2018 07:24:41 +0000 (16:24 +0900)

Merge branch 'sb/cocci-pending'

A coding convention around the Coccinelle semantic patches to have
two classes to ease code migration process has been proposed and
its support has been added to the Makefile.

* sb/cocci-pending:
coccicheck: introduce 'pending' semantic patches

Merge branch 'js/test-git-installed'Junio C Hamano Mon, 19 Nov 2018 07:24:41 +0000 (16:24 +0900)

Merge branch 'js/test-git-installed'

Update the "test installed Git" mode of our test suite to work better.

* js/test-git-installed:
tests: explicitly use `git.exe` on Windows
tests: do not require Git to be built when testing an installed Git
t/lib-gettext: test installed git-sh-i18n if GIT_TEST_INSTALLED is set
tests: respect GIT_TEST_INSTALLED when initializing repositories
tests: fix GIT_TEST_INSTALLED's PATH to include t/helper/

Merge branch 'dd/poll-dot-h'Junio C Hamano Mon, 19 Nov 2018 07:24:41 +0000 (16:24 +0900)

Merge branch 'dd/poll-dot-h'

A build update.

* dd/poll-dot-h:
git-compat-util: prefer poll.h to sys/poll.h

Merge branch 'tb/print-size-t-with-uintmax-format'Junio C Hamano Mon, 19 Nov 2018 07:24:41 +0000 (16:24 +0900)

Merge branch 'tb/print-size-t-with-uintmax-format'

Code preparation to replace ulong vars with size_t vars where
appropriate.

* tb/print-size-t-with-uintmax-format:
Upcast size_t variables to uintmax_t when printing

Merge branch 'tb/xcurl-off-t'Junio C Hamano Mon, 19 Nov 2018 07:24:40 +0000 (16:24 +0900)

Merge branch 'tb/xcurl-off-t'

The xcurl_off_t() helper function is used to cast size_t to
curl_off_t, but some compilers gave warnings against the code to
ensure the casting is done without wraparound, when size_t is
narrower than curl_off_t. This warning has been squelched.

* tb/xcurl-off-t:
remote-curl.c: xcurl_off_t is not portable (on 32 bit platfoms)

Merge branch 'nd/format-patch-cover-letter-stat-width'Junio C Hamano Mon, 19 Nov 2018 07:24:40 +0000 (16:24 +0900)

Merge branch 'nd/format-patch-cover-letter-stat-width'

"git format-patch --stat=<width>" can be used to specify the width
used by the diffstat (shown in the cover letter).

* nd/format-patch-cover-letter-stat-width:
format-patch: respect --stat in cover letter's diffstat

Merge branch 'ds/push-squelch-ambig-warning'Junio C Hamano Mon, 19 Nov 2018 07:24:40 +0000 (16:24 +0900)

Merge branch 'ds/push-squelch-ambig-warning'

"git push" used to check ambiguities between object-names and
refnames while processing the list of refs' old and new values,
which was unnecessary (as it knew that it is feeding raw object
names). This has been optimized out.

* ds/push-squelch-ambig-warning:
pack-objects: ignore ambiguous object warnings

Merge branch 'ab/dynamic-gettext-poison'Junio C Hamano Mon, 19 Nov 2018 07:24:39 +0000 (16:24 +0900)

Merge branch 'ab/dynamic-gettext-poison'

Our testing framework uses a special i18n "poisoned localization"
feature to find messages that ought to stay constant but are
incorrectly marked to be translated. This feature has been made
into a runtime option (it used to be a compile-time option).

* ab/dynamic-gettext-poison:
Makefile: ease dynamic-gettext-poison transition
i18n: make GETTEXT_POISON a runtime option

RelNotes: name the release properlyJunio C Hamano Sun, 18 Nov 2018 23:23:09 +0000 (08:23 +0900)

RelNotes: name the release properly

In the title, we should state for which version this release notes
document is about.

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

Git 2.20-rc0 v2.20.0-rc0Junio C Hamano Sun, 18 Nov 2018 09:24:49 +0000 (18:24 +0900)

Git 2.20-rc0

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

Merge branch 'jk/close-duped-fd-before-unlock-for-bundle'Junio C Hamano Sun, 18 Nov 2018 09:23:59 +0000 (18:23 +0900)

Merge branch 'jk/close-duped-fd-before-unlock-for-bundle'

When "git bundle" aborts due to an empty commit ranges
(i.e. resulting in an empty pack), it left a file descriptor to an
lockfile open, which resulted in leftover lockfile on Windows where
you cannot remove a file with an open file descriptor. This has
been corrected.

* jk/close-duped-fd-before-unlock-for-bundle:
bundle: dup() output descriptor closer to point-of-use

Merge branch 'ab/rebase-in-c-escape-hatch'Junio C Hamano Sun, 18 Nov 2018 09:23:59 +0000 (18:23 +0900)

Merge branch 'ab/rebase-in-c-escape-hatch'

The recently merged "rebase in C" has an escape hatch to use the
scripted version when necessary, but it hasn't been documented,
which has been corrected.

* ab/rebase-in-c-escape-hatch:
tests: add a special setup where rebase.useBuiltin is off
rebase doc: document rebase.useBuiltin

Merge branch 'js/rebase-am-options'Junio C Hamano Sun, 18 Nov 2018 09:23:59 +0000 (18:23 +0900)

Merge branch 'js/rebase-am-options'

The way "git rebase" parses and forwards the command line options
meant for underlying "git am" has been revamped, which fixed for
options with parameters that were not passed correctly.

* js/rebase-am-options:
rebase: validate -C<n> and --whitespace=<mode> parameters early
rebase: really just passthru the `git am` options

Merge branch 'sg/ref-filter-wo-repository'Junio C Hamano Sun, 18 Nov 2018 09:23:59 +0000 (18:23 +0900)

Merge branch 'sg/ref-filter-wo-repository'

"git ls-remote --sort=<thing>" can feed an object that is not yet
available into the comparison machinery and segfault, which has
been corrected to check such a request upfront and reject it.

* sg/ref-filter-wo-repository:
ref-filter: don't look for objects when outside of a repository

Merge branch 'nd/doc-extensions'Junio C Hamano Sun, 18 Nov 2018 09:23:58 +0000 (18:23 +0900)

Merge branch 'nd/doc-extensions'

Doc update.

* nd/doc-extensions:
doc: move extensions.worktreeConfig to the right place

Merge branch 'js/fuzz-cxxflags'Junio C Hamano Sun, 18 Nov 2018 09:23:58 +0000 (18:23 +0900)

Merge branch 'js/fuzz-cxxflags'

The build procedure to link for fuzzing test has been made
customizable with a new Makefile variable.

* js/fuzz-cxxflags:
Makefile: use FUZZ_CXXFLAGS for linking fuzzers

Merge branch 'js/mingw-msdn-url'Junio C Hamano Sun, 18 Nov 2018 09:23:58 +0000 (18:23 +0900)

Merge branch 'js/mingw-msdn-url'

The URL to an MSDN page in a comment has been updated.

* js/mingw-msdn-url:
mingw: replace an obsolete link with the superseding one

Merge branch 'js/mingw-create-hard-link'Junio C Hamano Sun, 18 Nov 2018 09:23:58 +0000 (18:23 +0900)

Merge branch 'js/mingw-create-hard-link'

Windows update.

* js/mingw-create-hard-link:
mingw: use `CreateHardLink()` directly

Merge branch 'js/config-sequence'Junio C Hamano Sun, 18 Nov 2018 09:23:57 +0000 (18:23 +0900)

Merge branch 'js/config-sequence'

A sanity check for start-up sequence has been added in the config
API codepath.

* js/config-sequence:
config: report a bug if git_dir exists without commondir

Merge branch 'lj/mingw-pthread-cond'Junio C Hamano Sun, 18 Nov 2018 09:23:57 +0000 (18:23 +0900)

Merge branch 'lj/mingw-pthread-cond'

Code simplification.

* lj/mingw-pthread-cond:
win32: replace pthread_cond_*() with much simpler code

Merge branch 'nd/command-list-gen-fix'Junio C Hamano Sun, 18 Nov 2018 09:23:57 +0000 (18:23 +0900)

Merge branch 'nd/command-list-gen-fix'

Build tweak.

* nd/command-list-gen-fix:
build: fix broken command-list.h generation with core.autocrlf

Merge branch 'ag/p3400-force-checkout'Junio C Hamano Sun, 18 Nov 2018 09:23:57 +0000 (18:23 +0900)

Merge branch 'ag/p3400-force-checkout'

Perf test tweak.

* ag/p3400-force-checkout:
p3400: replace calls to `git checkout -b' by `git checkout -B'

Merge branch 'cb/notes-freeing-always-null-fix'Junio C Hamano Sun, 18 Nov 2018 09:23:57 +0000 (18:23 +0900)

Merge branch 'cb/notes-freeing-always-null-fix'

Code cleanup.

* cb/notes-freeing-always-null-fix:
builtin/notes: remove unnecessary free

Merge branch 'js/rebase-r-and-merge-head'Junio C Hamano Sun, 18 Nov 2018 09:23:56 +0000 (18:23 +0900)

Merge branch 'js/rebase-r-and-merge-head'

Bugfix for the recently graduated "git rebase --rebase-merges".

* js/rebase-r-and-merge-head:
status: rebase and merge can be in progress at the same time
built-in rebase --skip/--abort: clean up stale .git/<name> files
rebase -i: include MERGE_HEAD into files to clean up
rebase -r: do not write MERGE_HEAD unless needed
rebase -r: demonstrate bug with conflicting merges

Merge branch 'js/apply-recount-allow-noop'Junio C Hamano Sun, 18 Nov 2018 09:23:56 +0000 (18:23 +0900)

Merge branch 'js/apply-recount-allow-noop'

When editing a patch in a "git add -i" session, a hunk could be
made to no-op. The "git apply" program used to reject a patch with
such a no-op hunk to catch user mistakes, but it is now updated to
explicitly allow a no-op hunk in an edited patch.

* js/apply-recount-allow-noop:
apply --recount: allow "no-op hunks"

Merge branch 'ra/rev-parse-exclude-glob'Junio C Hamano Sun, 18 Nov 2018 09:23:56 +0000 (18:23 +0900)

Merge branch 'ra/rev-parse-exclude-glob'

"rev-parse --exclude=<pattern> --branches=<pattern>" etc. did not
quite work, which has been corrected.

* ra/rev-parse-exclude-glob:
refs: fix some exclude patterns being ignored
refs: show --exclude failure with --branches/tags/remotes=glob

Merge branch 'js/builtin-rebase-perf-fix'Junio C Hamano Sun, 18 Nov 2018 09:23:55 +0000 (18:23 +0900)

Merge branch 'js/builtin-rebase-perf-fix'

Code clean-up with correction to make the reimplemented "git
rebase" a more faithful rewrite of the original, which also regains
performance.

* js/builtin-rebase-perf-fix:
built-in rebase: reinstate `checkout -q` behavior where appropriate
rebase: prepare reset_head() for more flags
rebase: consolidate clean-up code before leaving reset_head()

Merge branch 'js/mailmap'Junio C Hamano Sun, 18 Nov 2018 09:23:55 +0000 (18:23 +0900)

Merge branch 'js/mailmap'

Update the mailmap to unify multiple entries for the authors with
commits since v2.10.

* js/mailmap:
Update .mailmap

Merge branch 'js/rebase-autostash-detach-fix'Junio C Hamano Sun, 18 Nov 2018 09:23:55 +0000 (18:23 +0900)

Merge branch 'js/rebase-autostash-detach-fix'

"git rebase --autostash" did not correctly re-attach the HEAD at times.

* js/rebase-autostash-detach-fix:
built-in rebase --autostash: leave the current branch alone if possible
built-in rebase: demonstrate regression with --autostash

Merge branch 'ab/range-diff-no-patch'Junio C Hamano Sun, 18 Nov 2018 09:23:54 +0000 (18:23 +0900)

Merge branch 'ab/range-diff-no-patch'

The "--no-patch" option, which can be used to get a high-level
overview without the actual line-by-line patch difference shown, of
the "range-diff" command was earlier broken, which has been
corrected.

* ab/range-diff-no-patch:
range-diff: make diff option behavior (e.g. --stat) consistent
range-diff: fix regression in passing along diff options
range-diff doc: add a section about output stability

Merge branch 'jk/verify-sig-merge-into-void'Junio C Hamano Sun, 18 Nov 2018 09:23:54 +0000 (18:23 +0900)

Merge branch 'jk/verify-sig-merge-into-void'

"git merge" and "git pull" that merges into an unborn branch used
to completely ignore "--verify-signatures", which has been
corrected.

* jk/verify-sig-merge-into-void:
pull: handle --verify-signatures for unborn branch
merge: handle --verify-signatures for unborn branch
merge: extract verify_merge_signature() helper

Merge branch 'js/mingw-res-rebuild'Junio C Hamano Sun, 18 Nov 2018 09:23:53 +0000 (18:23 +0900)

Merge branch 'js/mingw-res-rebuild'

Windows build update.

* js/mingw-res-rebuild:
Windows: force-recompile git.res for differing architectures

Merge branch 'jk/unused-parameter-fixes'Junio C Hamano Sun, 18 Nov 2018 09:23:53 +0000 (18:23 +0900)

Merge branch 'jk/unused-parameter-fixes'

Various functions have been audited for "-Wunused-parameter" warnings
and bugs in them got fixed.

* jk/unused-parameter-fixes:
midx: double-check large object write loop
assert NOARG/NONEG behavior of parse-options callbacks
parse-options: drop OPT_DATE()
apply: return -1 from option callback instead of calling exit(1)
cat-file: report an error on multiple --batch options
tag: mark "--message" option with NONEG
show-branch: mark --reflog option as NONEG
format-patch: mark "--no-numbered" option with NONEG
status: mark --find-renames option with NONEG
cat-file: mark batch options with NONEG
pack-objects: mark index-version option as NONEG
ls-files: mark exclude options as NONEG
am: handle --no-patch-format option
apply: mark include/exclude options as NONEG

Merge branch 'jk/curl-ldflags'Junio C Hamano Sun, 18 Nov 2018 09:23:53 +0000 (18:23 +0900)

Merge branch 'jk/curl-ldflags'

The way -lcurl library gets linked has been simplified by taking
advantage of the fact that we can just ask curl-config command how.

* jk/curl-ldflags:
build: link with curl-defined linker flags

Merge branch 'mg/gpg-fingerprint-test'Junio C Hamano Sun, 18 Nov 2018 09:23:53 +0000 (18:23 +0900)

Merge branch 'mg/gpg-fingerprint-test'

Add a few tests for a topic already in 'master'.

* mg/gpg-fingerprint-test:
t/t7510-signed-commit.sh: add signing subkey to Eris Discordia key
t/t7510-signed-commit.sh: Add %GP to custom format checks

Merge branch 'nd/pthreads'Junio C Hamano Sun, 18 Nov 2018 09:23:52 +0000 (18:23 +0900)

Merge branch 'nd/pthreads'

The codebase has been cleaned up to reduce "#ifndef NO_PTHREADS".

* nd/pthreads:
Clean up pthread_create() error handling
read-cache.c: initialize copy_len to shut up gcc 8
read-cache.c: reduce branching based on HAVE_THREADS
read-cache.c: remove #ifdef NO_PTHREADS
pack-objects: remove #ifdef NO_PTHREADS
preload-index.c: remove #ifdef NO_PTHREADS
grep: clean up num_threads handling
grep: remove #ifdef NO_PTHREADS
attr.c: remove #ifdef NO_PTHREADS
name-hash.c: remove #ifdef NO_PTHREADS
index-pack: remove #ifdef NO_PTHREADS
send-pack.c: move async's #ifdef NO_PTHREADS back to run-command.c
run-command.h: include thread-utils.h instead of pthread.h
thread-utils: macros to unconditionally compile pthreads API

Merge branch 'ds/reachable-topo-order'Junio C Hamano Sun, 18 Nov 2018 09:23:52 +0000 (18:23 +0900)

Merge branch 'ds/reachable-topo-order'

The revision walker machinery learned to take advantage of the
commit generation numbers stored in the commit-graph file.

* ds/reachable-topo-order:
t6012: make rev-list tests more interesting
revision.c: generation-based topo-order algorithm
commit/revisions: bookkeeping before refactoring
revision.c: begin refactoring --topo-order logic
test-reach: add rev-list tests
test-reach: add run_three_modes method
prio-queue: add 'peek' operation

bundle: dup() output descriptor closer to point-of-useJeff King Fri, 16 Nov 2018 09:43:59 +0000 (04:43 -0500)

bundle: dup() output descriptor closer to point-of-use

When writing a bundle to a file, the bundle code actually creates
"your.bundle.lock" using our lockfile interface. We feed that output
descriptor to a child git-pack-objects via run-command, which has the
quirk that it closes the output descriptor in the parent.

To avoid confusing the lockfile code (which still thinks the descriptor
is valid), we dup() it, and operate on the duplicate.

However, this has a confusing side effect: after the dup() but before we
call pack-objects, we have _two_ descriptors open to the lockfile. If we
call die() during that time, the lockfile code will try to clean up the
partially-written file. It knows to close() the file before unlinking,
since on some platforms (i.e., Windows) the open file would block the
deletion. But it doesn't know about the duplicate descriptor. On
Windows, triggering an error at the right part of the code will result
in the cleanup failing and the lockfile being left in the filesystem.

We can solve this by moving the dup() much closer to start_command(),
shrinking the window in which we have the second descriptor open. It's
easy to place this in such a way that no die() is possible. We could
still die due to a signal in the exact wrong moment, but we already
tolerate races there (e.g., a signal could come before we manage to put
the file on the cleanup list in the first place).

As a bonus, this shields create_bundle() itself from the duplicate-fd
trick, and we can simplify its error handling (note that the lock
rollback now happens unconditionally, but that's OK; it's a noop if we
didn't open the lock in the first place).

The included test uses an empty bundle to cause a failure at the right
spot in the code, because that's easy to trigger (the other likely
errors are write() problems like ENOSPC). Note that it would already
pass on non-Windows systems (because they are happy to unlink an
already-open file).

Based-on-a-patch-by: Gaël Lhez <gael.lhez@gmail.com>
Signed-off-by: Jeff King <peff@peff.net>
Tested-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

tests: add a special setup where rebase.useBuiltin... Ævar Arnfjörð Bjarmason Wed, 14 Nov 2018 09:15:06 +0000 (09:15 +0000)

tests: add a special setup where rebase.useBuiltin is off

Add a GIT_TEST_REBASE_USE_BUILTIN=false test mode which is equivalent
to running with rebase.useBuiltin=false. This is needed to spot that
we're not introducing any regressions in the legacy rebase version
while we're carrying both it and the new builtin version.

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

rebase doc: document rebase.useBuiltinÆvar Arnfjörð Bjarmason Wed, 14 Nov 2018 09:15:05 +0000 (09:15 +0000)

rebase doc: document rebase.useBuiltin

The rebase.useBuiltin variable introduced in 55071ea248 ("rebase:
start implementing it as a builtin", 2018-08-07) was turned on by
default in 5541bd5b8f ("rebase: default to using the builtin rebase",
2018-08-08), but had no documentation.

Let's document it so that users who run into any stability issues with
the C rewrite know there's an escape hatch[1], and make it clear that
needing to turn off builtin rebase means you've found a bug in git.

1. https://public-inbox.org/git/87y39w1wc2.fsf@evledraar.gmail.com/

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

mingw: replace an obsolete link with the superseding oneJohannes Schindelin Thu, 15 Nov 2018 11:22:40 +0000 (03:22 -0800)

mingw: replace an obsolete link with the superseding one

The MSDN documentation has been superseded by Microsoft Docs (which is
backed by a repository on GitHub containing many, many files in Markdown
format).

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

Makefile: use FUZZ_CXXFLAGS for linking fuzzersJosh Steadmon Wed, 14 Nov 2018 19:41:47 +0000 (11:41 -0800)

Makefile: use FUZZ_CXXFLAGS for linking fuzzers

OSS-Fuzz requires C++-specific flags to link fuzzers. Passing these in
CFLAGS causes lots of build warnings. Using separate FUZZ_CXXFLAGS
avoids this.

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

tests: explicitly use `git.exe` on WindowsJohannes Schindelin Wed, 14 Nov 2018 16:32:11 +0000 (08:32 -0800)

tests: explicitly use `git.exe` on Windows

On Windows, when we refer to `/an/absolute/path/to/git`, it magically
resolves `git.exe` at that location. Except if something of the name
`git` exists next to that `git.exe`. So if we call `$BUILD_DIR/git`, it
will find `$BUILD_DIR/git.exe` *only* if there is not, say, a directory
called `$BUILD_DIR/git`.

Such a directory, however, exists in Git for Windows when building with
Visual Studio (our Visual Studio project generator defaults to putting
the build files into a directory whose name is the base name of the
corresponding `.exe`).

In the bin-wrappers/* scripts, we already take pains to use `git.exe`
rather than `git`, as this could pick up the wrong thing on Windows
(i.e. if there exists a `git` file or directory in the build directory).

Now we do the same in the tests' start-up code.

This also helps when testing an installed Git, as there might be even
more likely some stray file or directory in the way.

Note: the only way we can record whether the `.exe` suffix is by writing
it to the `GIT-BUILD-OPTIONS` file and sourcing it at the beginning of
`t/test-lib.sh`. This is not a requirement introduced by this patch, but
we move the call to be able to use the `$X` variable that holds the file
extension, if any.

Note also: the many, many calls to `git this` and `git that` are
unaffected, as the regular PATH search will find the `.exe` files on
Windows (and not be confused by a directory of the name `git` that is
in one of the directories listed in the `PATH` variable), while
`/path/to/git` would not, per se, know that it is looking for an
executable and happily prefer such a directory.

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

tests: do not require Git to be built when testing... Johannes Schindelin Wed, 14 Nov 2018 16:32:10 +0000 (08:32 -0800)

tests: do not require Git to be built when testing an installed Git

We really only need the test helpers to be built in the worktree in that
case, but that is not what we test for.

On the other hand it is a perfect opportunity to verify that
`GIT_TEST_INSTALLED` points to a working Git.

So let's test the appropriate Git executable. While at it, also adjust
the error message in the `GIT_TEST_INSTALLED` case.

This patch is best viewed with `-w --patience`.

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

doc: move extensions.worktreeConfig to the right placeNguyễn Thái Ngọc Duy Wed, 14 Nov 2018 16:02:47 +0000 (17:02 +0100)

doc: move extensions.worktreeConfig to the right place

All config extensions are described in technical/repository-version.txt.
I made a mistake of adding it in config.txt instead. This patch moves
it back to where it belongs.

Since repository-version.txt is not part of officially generated
documents (it's not even part of DOC_HTML target), it's only visible
to developers who read plain .txt files. Let's include it in
gitrepository-layout.5 for more visibility. Some minor asciidoc fixes
are required in repository-version.txt to make this happen.

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

ref-filter: don't look for objects when outside of... SZEDER Gábor Wed, 14 Nov 2018 12:27:25 +0000 (13:27 +0100)

ref-filter: don't look for objects when outside of a repository

The command 'git ls-remote --sort=authordate <remote>' segfaults when
run outside of a repository, ever since the introduction of its
'--sort' option in 1fb20dfd8e (ls-remote: create '--sort' option,
2018-04-09).

While in general the 'git ls-remote' command can be run outside of a
repository just fine, its '--sort=<key>' option with certain keys does
require access to the referenced objects. This sorting is implemented
using the generic ref-filter sorting facility, which already handles
missing objects gracefully with the appropriate 'missing object
deadbeef for HEAD' message. However, being generic means that it
checks replace refs while trying to retrieve an object, and while
doing so it accesses the 'git_replace_ref_base' variable, which has
not been initialized and is still a NULL pointer when outside of a
repository, thus causing the segfault.

Make ref-filter more careful upfront while parsing the format string,
and make it error out when encountering a format atom requiring object
access when we are not in a repository. Also add a test to ensure
that 'git ls-remote --sort' fails gracefully when executed outside of
a repository.

Reported-by: H.Merijn Brand <h.m.brand@xs4all.nl>
Signed-off-by: SZEDER Gábor <szeder.dev@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

config: report a bug if git_dir exists without commondirJohannes Schindelin Wed, 14 Nov 2018 13:59:02 +0000 (05:59 -0800)

config: report a bug if git_dir exists without commondir

This did happen at some stage, and was fixed relatively quickly. Make
sure that we detect very quickly, too, should that happen again.

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

rebase: validate -C<n> and --whitespace=<mode> paramete... Johannes Schindelin Wed, 14 Nov 2018 16:25:31 +0000 (08:25 -0800)

rebase: validate -C<n> and --whitespace=<mode> parameters early

It is a good idea to error out early upon seeing, say, `-Cbad`, rather
than starting the rebase only to have the `--am` backend complain later.

Let's do this.

The only options accepting parameters which we pass through to `git am`
(which may, or may not, forward them to `git apply`) are `-C` and
`--whitespace`. The other options we pass through do not accept
parameters, so we do not have to validate them here.

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

rebase: really just passthru the `git am` optionsJohannes Schindelin Wed, 14 Nov 2018 16:25:29 +0000 (08:25 -0800)

rebase: really just passthru the `git am` options

Currently, we parse the options intended for `git am` as if we wanted to
handle them in `git rebase`, and then reconstruct them painstakingly to
define the `git_am_opt` variable.

However, there is a much better way (that I was unaware of, at the time
when I mentored Pratik to implement these options): OPT_PASSTHRU_ARGV.
It is intended for exactly this use case, where command-line options
want to be parsed into a separate `argv_array`.

Let's use this feature.

Incidentally, this also allows us to address a bug discovered by Phillip
Wood, where the built-in rebase failed to understand that the `-C`
option takes an optional argument.

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

git-compat-util: prefer poll.h to sys/poll.hĐoàn Trần Công Danh Wed, 14 Nov 2018 01:10:43 +0000 (08:10 +0700)

git-compat-util: prefer poll.h to sys/poll.h

POSIX specifies that <poll.h> is the correct header for poll(2)
whereas <sys/poll.h> is only needed for some old libc.

Let's follow the POSIX way by default.

This effectively eliminates musl's warning:

warning redirecting incorrect #include <sys/poll.h> to <poll.h>

Signed-off-by: Đoàn Trần Công Danh <congdanhqx@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

range-diff: make diff option behavior (e.g. --stat... Ævar Arnfjörð Bjarmason Tue, 13 Nov 2018 18:55:58 +0000 (18:55 +0000)

range-diff: make diff option behavior (e.g. --stat) consistent

Make the behavior when diff options (e.g. "--stat") are passed
consistent with how "diff" behaves.

Before 73a834e9e2 ("range-diff: relieve callers of low-level
configuration burden", 2018-07-22) running range-diff with "--stat"
would produce stat output and the diff output, as opposed to how
"diff" behaves where once "--stat" is specified "--patch" also needs
to be provided to emit the patch output.

As noted in a previous change ("range-diff doc: add a section about
output stability", 2018-11-07) the "--stat" output with "range-diff"
is useless at the moment.

But we should behave consistently with "diff" in anticipation of such
output being useful in the future, because it would make for confusing
UI if "diff" and "range-diff" behaved differently when it came to how
they interpret diff options.

The new behavior is also consistent with the existing documentation
added in ba931edd28 ("range-diff: populate the man page",
2018-08-13). See "[...]also accepts the regular diff options[...]" in
git-range-diff(1).

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

win32: replace pthread_cond_*() with much simpler codeLoo Rong Jie Tue, 13 Nov 2018 18:52:35 +0000 (10:52 -0800)

win32: replace pthread_cond_*() with much simpler code

The Win32 CONDITION_VARIABLE has better performance and is easier to
maintain, as the code is a lot shorter now (the semantics of the
CONDITION_VARIABLE matches the pthread_cond_t very well).

Note: CONDITION_VARIABLE is not available in Windows XP and below,
but the declared minimal Windows version required to build and run
Git for Windows is Windows Vista (which is also beyond its
end-of-life, but for less long than Windows XP), so that's okay.

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

mingw: use `CreateHardLink()` directlyJohannes Schindelin Tue, 13 Nov 2018 14:37:02 +0000 (06:37 -0800)

mingw: use `CreateHardLink()` directly

The function `CreateHardLink()` is available in all supported Windows
versions (even since Windows XP), so there is no more need to resolve it
at runtime.

Helped-by: Max Kirillov <max@max630.net>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

t/lib-gettext: test installed git-sh-i18n if GIT_TEST_I... Johannes Schindelin Mon, 12 Nov 2018 13:48:36 +0000 (05:48 -0800)

t/lib-gettext: test installed git-sh-i18n if GIT_TEST_INSTALLED is set

It makes very, very little sense to test the built git-sh-i18n when the
user asked specifically to test another one.

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

tests: respect GIT_TEST_INSTALLED when initializing... Johannes Schindelin Mon, 12 Nov 2018 13:48:34 +0000 (05:48 -0800)

tests: respect GIT_TEST_INSTALLED when initializing repositories

It really makes very, very little sense to use a different git
executable than the one the caller indicated via setting the environment
variable GIT_TEST_INSTALLED.

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

tests: fix GIT_TEST_INSTALLED's PATH to include t/helper/Johannes Schindelin Mon, 12 Nov 2018 13:48:33 +0000 (05:48 -0800)

tests: fix GIT_TEST_INSTALLED's PATH to include t/helper/

We really need to be able to find the test helpers... Really. This
change was forgotten when we moved the test helpers into t/helper/

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

coccicheck: introduce 'pending' semantic patchesSZEDER Gábor Sat, 10 Nov 2018 00:10:52 +0000 (16:10 -0800)

coccicheck: introduce 'pending' semantic patches

Teach `make coccicheck` to avoid patches named "*.pending.cocci" and
handle them separately in a new `make coccicheck-pending` instead.
This means that we can separate "critical" patches from "FYI" patches.
The former target can continue causing Travis to fail its static
analysis job, while the latter can let us keep an eye on ongoing
(pending) transitions without them causing too much fallout.

Document the intended use-cases around these two targets.
As the process around the pending patches is not yet fully explored,
leave that out.

Signed-off-by: SZEDER Gábor <szeder.dev@gmail.com>
Based-on-work-by: SZEDER Gábor <szeder.dev@gmail.com>
Signed-off-by: Stefan Beller <sbeller@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Tenth batch for 2.20Junio C Hamano Tue, 13 Nov 2018 13:13:52 +0000 (22:13 +0900)

Tenth batch for 2.20

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

Merge branch 'nd/complete-format-patch'Junio C Hamano Tue, 13 Nov 2018 13:37:28 +0000 (22:37 +0900)

Merge branch 'nd/complete-format-patch'

The support for format-patch (and send-email) by the command-line
completion script (in contrib/) has been simplified a bit.

* nd/complete-format-patch:
completion: use __gitcomp_builtin for format-patch

Merge branch 'nd/tree-walk-path-exclusion'Junio C Hamano Tue, 13 Nov 2018 13:37:28 +0000 (22:37 +0900)

Merge branch 'nd/tree-walk-path-exclusion'

Pathspec matching against a tree object were buggy when negative
pathspec elements were involved, which has been fixed.

* nd/tree-walk-path-exclusion:
tree-walk.c: fix overoptimistic inclusion in :(exclude) matching

Merge branch 'sg/travis-install-dependencies'Junio C Hamano Tue, 13 Nov 2018 13:37:27 +0000 (22:37 +0900)

Merge branch 'sg/travis-install-dependencies'

The procedure to install dependencies before testing at Travis CI
is getting revamped for both simplicity and flexibility, taking
advantage of the recent move to the vm-based environment.

* sg/travis-install-dependencies:
travis-ci: install packages in 'ci/install-dependencies.sh'

Merge branch 'bp/add-diff-files-optim'Junio C Hamano Tue, 13 Nov 2018 13:37:27 +0000 (22:37 +0900)

Merge branch 'bp/add-diff-files-optim'

"git add" needs to internally run "diff-files" equivalent, and the
codepath learned the same optimization as "diff-files" has to run
lstat(2) in parallel to find which paths have been updated in the
working tree.

* bp/add-diff-files-optim:
add: speed up cmd_add() by utilizing read_cache_preload()

Merge branch 'jk/xdiff-interface'Junio C Hamano Tue, 13 Nov 2018 13:37:27 +0000 (22:37 +0900)

Merge branch 'jk/xdiff-interface'

The interface into "xdiff" library used to discover the offset and
size of a generated patch hunk by first formatting it into the
textual hunk header "@@ -n,m +k,l @@" and then parsing the numbers
out. A new interface has been introduced to allow callers a more
direct access to them.

* jk/xdiff-interface:
xdiff-interface: drop parse_hunk_header()
range-diff: use a hunk callback
diff: convert --check to use a hunk callback
combine-diff: use an xdiff hunk callback
diff: use hunk callback for word-diff
diff: discard hunk headers for patch-ids earlier
diff: avoid generating unused hunk header lines
xdiff-interface: provide a separate consume callback for hunks
xdiff: provide a separate emit callback for hunks

Merge branch 'jk/misc-unused-fixes'Junio C Hamano Tue, 13 Nov 2018 13:37:26 +0000 (22:37 +0900)

Merge branch 'jk/misc-unused-fixes'

Assorted fixes for bugs found while auditing -Wunused-parameter
warnings.

* jk/misc-unused-fixes:
approxidate: fix NULL dereference in date_time()
pathspec: handle non-terminated strings with :(attr)
approxidate: handle pending number for "specials"
rev-list: handle flags for --indexed-objects

Merge branch 'nd/per-worktree-ref-iteration'Junio C Hamano Tue, 13 Nov 2018 13:37:26 +0000 (22:37 +0900)

Merge branch 'nd/per-worktree-ref-iteration'

The code to traverse objects for reachability, used to decide what
objects are unreferenced and expendable, have been taught to also
consider per-worktree refs of other worktrees as starting points to
prevent data loss.

* nd/per-worktree-ref-iteration:
git-worktree.txt: correct linkgit command name
reflog expire: cover reflog from all worktrees
fsck: check HEAD and reflog from other worktrees
fsck: move fsck_head_link() to get_default_heads() to avoid some globals
revision.c: better error reporting on ref from different worktrees
revision.c: correct a parameter name
refs: new ref types to make per-worktree refs visible to all worktrees
Add a place for (not) sharing stuff between worktrees
refs.c: indent with tabs, not spaces

Merge branch 'bp/refresh-index-using-preload'Junio C Hamano Tue, 13 Nov 2018 13:37:25 +0000 (22:37 +0900)

Merge branch 'bp/refresh-index-using-preload'

The helper function to refresh the cached stat information in the
in-core index has learned to perform the lstat() part of the
operation in parallel on multi-core platforms.

* bp/refresh-index-using-preload:
refresh_index: remove unnecessary calls to preload_index()
speed up refresh_index() by utilizing preload_index()

Merge branch 'ag/rebase-i-in-c'Junio C Hamano Tue, 13 Nov 2018 13:37:25 +0000 (22:37 +0900)

Merge branch 'ag/rebase-i-in-c'

Code clean-up for a topic already in 'master'.

* ag/rebase-i-in-c:
sequencer.c: remove a stray semicolon

Merge branch 'al/send-email-auto-cte-fixup'Junio C Hamano Tue, 13 Nov 2018 13:37:25 +0000 (22:37 +0900)

Merge branch 'al/send-email-auto-cte-fixup'

"git send-email --transfer-encoding=..." in recent versions of Git
sometimes produced an empty "Content-Transfer-Encoding:" header,
which has been corrected.

* al/send-email-auto-cte-fixup:
send-email: avoid empty transfer encoding header

Merge branch 'ds/add-missing-tags'Junio C Hamano Tue, 13 Nov 2018 13:37:24 +0000 (22:37 +0900)

Merge branch 'ds/add-missing-tags'

The history traversal used to implement the tag-following has been
optimized by introducing a new helper.

* ds/add-missing-tags:
remote: make add_missing_tags() linear
test-reach: test get_reachable_subset
commit-reach: implement get_reachable_subset

Merge branch 'sh/mingw-safer-compat-poll'Junio C Hamano Tue, 13 Nov 2018 13:37:24 +0000 (22:37 +0900)

Merge branch 'sh/mingw-safer-compat-poll'

Windows fix.

* sh/mingw-safer-compat-poll:
poll: use GetTickCount64() to avoid wrap-around issues

Merge branch 'js/rebase-p-tests'Junio C Hamano Tue, 13 Nov 2018 13:37:24 +0000 (22:37 +0900)

Merge branch 'js/rebase-p-tests'

In preparation to the day when we can deprecate and remove the
"rebase -p", make sure we can skip and later remove tests for
it.

* js/rebase-p-tests:
tests: optionally skip `git rebase -p` tests
t3418: decouple test cases from a previous `rebase -p` test case
t3404: decouple some test cases from outcomes of previous test cases

Merge branch 'pw/am-rebase-read-author-script'Junio C Hamano Tue, 13 Nov 2018 13:37:23 +0000 (22:37 +0900)

Merge branch 'pw/am-rebase-read-author-script'

Unify code to read the author-script used in "git am" and the
commands that use the sequencer machinery, e.g. "git rebase -i".

* pw/am-rebase-read-author-script:
sequencer: use read_author_script()
add read_author_script() to libgit
am: rename read_author_script()
am: improve author-script error reporting
am: don't die in read_author_script()

Merge branch 'jc/war-on-string-list'Junio C Hamano Tue, 13 Nov 2018 13:37:23 +0000 (22:37 +0900)

Merge branch 'jc/war-on-string-list'

Replace three string-list instances used as look-up tables in "git
fetch" with hashmaps.

* jc/war-on-string-list:
fetch: replace string-list used as a look-up table with a hashmap

Merge branch 'ag/rev-parse-all-exclude-fix'Junio C Hamano Tue, 13 Nov 2018 13:37:23 +0000 (22:37 +0900)

Merge branch 'ag/rev-parse-all-exclude-fix'

"git rev-parse --exclude=* --branches --branches" (i.e. first
saying "add only things that do not match '*' out of all branches"
and then adding all branches, without any exclusion this time")
worked as expected, but "--exclude=* --all --all" did not work the
same way, which has been fixed.

* ag/rev-parse-all-exclude-fix:
rev-parse: clear --exclude list after 'git rev-parse --all'

Merge branch 'jt/tighten-fetch-proto-v2-response'Junio C Hamano Tue, 13 Nov 2018 13:37:22 +0000 (22:37 +0900)

Merge branch 'jt/tighten-fetch-proto-v2-response'

"git fetch" was a bit loose in parsing resposes from the other side
when talking over the protocol v2.

* jt/tighten-fetch-proto-v2-response:
fetch-pack: be more precise in parsing v2 response

Merge branch 'ao/submodule-wo-gitmodules-checked-out'Junio C Hamano Tue, 13 Nov 2018 13:37:22 +0000 (22:37 +0900)

Merge branch 'ao/submodule-wo-gitmodules-checked-out'

The submodule support has been updated to read from the blob at
HEAD:.gitmodules when the .gitmodules file is missing from the
working tree.

* ao/submodule-wo-gitmodules-checked-out:
t/helper: add test-submodule-nested-repo-config
submodule: support reading .gitmodules when it's not in the working tree
submodule: add a helper to check if it is safe to write to .gitmodules
t7506: clean up .gitmodules properly before setting up new scenario
submodule: use the 'submodule--helper config' command
submodule--helper: add a new 'config' subcommand
t7411: be nicer to future tests and really clean things up
t7411: merge tests 5 and 6
submodule: factor out a config_set_in_gitmodules_file_gently function
submodule: add a print_config_from_gitmodules() helper

Merge branch 'nb/worktree-api-doc'Junio C Hamano Tue, 13 Nov 2018 13:37:21 +0000 (22:37 +0900)

Merge branch 'nb/worktree-api-doc'

Code readability fix.

* nb/worktree-api-doc:
worktree: rename is_worktree_locked to worktree_lock_reason
worktree: update documentation for lock_reason and lock_reason_valid

Merge branch 'ma/sequencer-do-reset-saner-loop-termination'Junio C Hamano Tue, 13 Nov 2018 13:37:21 +0000 (22:37 +0900)

Merge branch 'ma/sequencer-do-reset-saner-loop-termination'

Code readability fix.

* ma/sequencer-do-reset-saner-loop-termination:
sequencer: break out of loop explicitly

Merge branch 'js/mingw-utf8-env'Junio C Hamano Tue, 13 Nov 2018 13:37:21 +0000 (22:37 +0900)

Merge branch 'js/mingw-utf8-env'

Windows fix.

* js/mingw-utf8-env:
mingw: reencode environment variables on the fly (UTF-16 <-> UTF-8)
t7800: fix quoting

Merge branch 'js/mingw-perl5lib'Junio C Hamano Tue, 13 Nov 2018 13:37:20 +0000 (22:37 +0900)

Merge branch 'js/mingw-perl5lib'

Windows fix.

* js/mingw-perl5lib:
mingw: unset PERL5LIB by default
config: move Windows-specific config settings into compat/mingw.c
config: allow for platform-specific core.* config settings
config: rename `dummy` parameter to `cb` in git_default_config()

Merge branch 'js/mingw-isatty-and-dup2'Junio C Hamano Tue, 13 Nov 2018 13:37:20 +0000 (22:37 +0900)

Merge branch 'js/mingw-isatty-and-dup2'

Windows fix.

* js/mingw-isatty-and-dup2:
mingw: fix isatty() after dup2()

Merge branch 'ab/pack-tests-cleanup'Junio C Hamano Tue, 13 Nov 2018 13:37:20 +0000 (22:37 +0900)

Merge branch 'ab/pack-tests-cleanup'

A couple of tests used to leave the repository in a state that is
deliberately corrupt, which have been corrected.

* ab/pack-tests-cleanup:
index-pack tests: don't leave test repo dirty at end
pack-objects tests: don't leave test .git corrupt at end
pack-objects test: modernize style

Merge branch 'ds/test-multi-pack-index'Junio C Hamano Tue, 13 Nov 2018 13:37:19 +0000 (22:37 +0900)

Merge branch 'ds/test-multi-pack-index'

Tests for the recently introduced multi-pack index machinery.

* ds/test-multi-pack-index:
packfile: close multi-pack-index in close_all_packs
multi-pack-index: define GIT_TEST_MULTI_PACK_INDEX
midx: close multi-pack-index on repack
midx: fix broken free() in close_midx()