gitweb.git
http: give curl version warnings consistentlyJunio C Hamano Thu, 25 Oct 2018 03:22:22 +0000 (12:22 +0900)

http: give curl version warnings consistently

When a requested feature cannot be activated because the version of
cURL library used to build Git with is too old, most of the codepaths
give a warning like "$Feature is not supported with cURL < $Version",
marked for l10n. A few of them, however, did not follow that pattern
and said things like "$Feature is not activated, your curl version is
too old (>= $Version)", and without marking them for l10n.

Update these to match the style of the majority of warnings and mark
them for l10n.

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

http: when using Secure Channel, ignore sslCAInfo by... Johannes Schindelin Thu, 25 Oct 2018 18:53:56 +0000 (11:53 -0700)

http: when using Secure Channel, ignore sslCAInfo by default

As of cURL v7.60.0, the Secure Channel backend can use the certificate
bundle provided via `http.sslCAInfo`, but that would override the
Windows Certificate Store. Since this is not desirable by default, let's
tell Git to not ask cURL to use that bundle by default when the `schannel`
backend was configured via `http.sslBackend`, unless
`http.schannelUseSSLCAInfo` overrides this behavior.

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

http: add support for disabling SSL revocation checks... Brendan Forster Thu, 25 Oct 2018 18:53:55 +0000 (11:53 -0700)

http: add support for disabling SSL revocation checks in cURL

This adds support for a new http.schannelCheckRevoke config value.

This config value is only used if http.sslBackend is set to "schannel",
which forces cURL to use the Windows Certificate Store when validating
server certificates associated with a remote server.

This config value should only be set to "false" if you are in an
environment where revocation checks are blocked by the network, with
no alternative options.

This is only supported in cURL 7.44 or later.

Note: originally, we wanted to call the config setting
`http.schannel.checkRevoke`. This, however, does not work: the `http.*`
config settings can be limited to specific URLs via `http.<url>.*`
(and this feature would mistake `schannel` for a URL).

Helped by Agustín Martín Barbero.

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

upload-pack: fix broken if/else chain in config callbackJeff King Wed, 24 Oct 2018 07:27:52 +0000 (03:27 -0400)

upload-pack: fix broken if/else chain in config callback

The upload_pack_config() callback uses an if/else chain
like:

if (!strcmp(var, "a"))
...
else if (!strcmp(var, "b"))
...
etc

This works as long as the conditions are mutually exclusive,
but one of them is not. 20b20a22f8 (upload-pack: provide a
hook for running pack-objects, 2016-05-18) added:

else if (current_config_scope() != CONFIG_SCOPE_REPO) {
... check some more options ...
}

That was fine in that commit, because it came at the end of
the chain. But later, 10ac85c785 (upload-pack: add object
filtering for partial clone, 2017-12-08) did this:

else if (current_config_scope() != CONFIG_SCOPE_REPO) {
... check some more options ...
} else if (!strcmp("uploadpack.allowfilter", var))
...

We'd always check the scope condition first, meaning we'd
_only_ respect allowfilter when it's in the repo config. You
can see this with:

git -c uploadpack.allowfilter=true upload-pack . | head -1

which will not advertise the filter capability (but will
after this patch). We never noticed because:

- our tests always set it in the repo config

- in protocol v2, we use a different code path that
actually calls repo_config_get_bool() separately, so
that _does_ work. Real-world people experimenting with
this may be using v2.

The more recent uploadpack.allowrefinwant option is in the
same boat.

There are a few possible fixes:

1. Bump the scope conditional back to the bottom of the
chain. But that just means somebody else is likely to
make the same mistake later.

2. Make the conditional more like the others. I.e.:

else if (!current_config_scope() != CONFIG_SCOPE_REPO &&
!strcmp(var, "uploadpack.notallowedinrepo"))

This works, but the idea of the original structure was
that we may grow multiple sensitive options like this.

3. Pull it out of the chain entirely. The chain mostly
serves to avoid extra strcmp() calls after we've found
a match. But it's not worth caring about those. In the
worst case, when there isn't a match, we're already
hitting every strcmp (and this happens regularly for
stuff like "core.bare", etc).

This patch does (3).

Signed-off-by: Jeff King <peff@peff.net>
Reviewed-by: Josh Steadmon <steadmon@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

rebase -i: recognize short commands without argumentsJohannes Sixt Thu, 25 Oct 2018 20:47:45 +0000 (22:47 +0200)

rebase -i: recognize short commands without arguments

The sequencer instruction 'b', short for 'break', is rejected:

error: invalid line 2: b

The reason is that the parser expects all short commands to have
an argument. Permit short commands without arguments.

Signed-off-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

archive: initialize archivers earlierJosh Steadmon Thu, 25 Oct 2018 20:32:14 +0000 (13:32 -0700)

archive: initialize archivers earlier

Initialize archivers as soon as possible when running git-archive.
Various non-obvious behavior depends on having the archivers
initialized, such as determining the desired archival format from the
provided filename.

Since 08716b3c11 ("archive: refactor file extension format-guessing",
2011-06-21), archive_format_from_filename() has used the registered
archivers to match filenames (provided via --output) to archival
formats. However, when git-archive is executed with --remote, format
detection happens before the archivers have been registered. This causes
archives from remotes to always be generated as TAR files, regardless of
the actual filename (unless an explicit --format is provided).

This patch fixes that behavior; archival format is determined properly
from the output filename, even when --remote is used.

Helped-by: Jeff King <peff@peff.net>
Signed-off-by: Josh Steadmon <steadmon@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

compat: make sure git_mmap is not expected to writeCarlo Marcelo Arenas Belón Tue, 23 Oct 2018 12:35:19 +0000 (05:35 -0700)

compat: make sure git_mmap is not expected to write

in f48000fc ("Yank writing-back support from gitfakemmap.", 2005-10-08)
support for writting back changes was removed but the specific prot
flag that would be used was not checked for

Signed-off-by: Carlo Marcelo Arenas Belón <carenas@gmail.com>
Acked-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

range-diff: allow to diff files regardless of submodule... Lucas De Marchi Wed, 24 Oct 2018 19:46:17 +0000 (12:46 -0700)

range-diff: allow to diff files regardless of submodule config

If we have `submodule.diff = log' in the configuration file
or `--submodule=log' is given as argument, range-diff fails
to compare both diffs and we only get the following output:

Submodule a 0000000...0000000 (new submodule)

Even if the repository doesn't have any submodule.

That's because the mode in diff_filespec is not correct and when
flushing the diff, down in builtin_diff() we will enter the condition:

if (o->submodule_format == DIFF_SUBMODULE_LOG &&
(!one->mode || S_ISGITLINK(one->mode)) &&
(!two->mode || S_ISGITLINK(two->mode))) {
show_submodule_summary(o, one->path ? one->path : two->path,
&one->oid, &two->oid,
two->dirty_submodule);
return;

It turns out that S_ISGITLINK will return true (mode == 0160000 here).
Similar thing happens if submodule.diff is "diff".

Do like it's done in grep.c when calling fill_filespec() and force it to
be recognized as a file by adding S_IFREG to the mode.

Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>
Acked-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

howto/using-merge-subtree: mention --allow-unrelated... Uwe Kleine-König Wed, 24 Oct 2018 08:04:52 +0000 (10:04 +0200)

howto/using-merge-subtree: mention --allow-unrelated-histories

Without passing --allow-unrelated-histories the command sequence
fails as intended since commit e379fdf34fee ("merge: refuse to create
too cool a merge by default"). To setup a subtree merging unrelated
histories is normal, so add the option to the howto document.

Signed-off-by: Uwe Kleine-König <uwe@kleine-koenig.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

doc: document diff/merge.guitool config keysDenton Liu Wed, 24 Oct 2018 16:25:43 +0000 (12:25 -0400)

doc: document diff/merge.guitool config keys

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

completion: support `git mergetool --[no-]gui`Denton Liu Wed, 24 Oct 2018 16:25:37 +0000 (12:25 -0400)

completion: support `git mergetool --[no-]gui`

Signed-off-by: Denton Liu <liu.denton@gmail.com>
Signed-off-by: Anmol Mago <anmolmago@gmail.com>
Signed-off-by: Brian Ho <briankyho@gmail.com>
Signed-off-by: David Lu <david.lu97@outlook.com>
Signed-off-by: Ryan Wang <shirui.wang@hotmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

mergetool: accept -g/--[no-]gui as argumentsDenton Liu Wed, 24 Oct 2018 16:25:31 +0000 (12:25 -0400)

mergetool: accept -g/--[no-]gui as arguments

In line with how difftool accepts a -g/--[no-]gui option, make mergetool
accept the same option in order to use the `merge.guitool` variable to
find the default mergetool instead of `merge.tool`.

Signed-off-by: Denton Liu <liu.denton@gmail.com>
Signed-off-by: Anmol Mago <anmolmago@gmail.com>
Signed-off-by: Brian Ho <briankyho@gmail.com>
Signed-off-by: David Lu <david.lu97@outlook.com>
Signed-off-by: Ryan Wang <shirui.wang@hotmail.com>
Acked-by: David Aguilar <davvid@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

repack -ad: prune the list of shallow commitsJohannes Schindelin Wed, 24 Oct 2018 15:56:13 +0000 (08:56 -0700)

repack -ad: prune the list of shallow commits

`git repack` can drop unreachable commits without further warning,
making the corresponding entries in `.git/shallow` invalid, which causes
serious problems when deepening the branches.

One scenario where unreachable commits are dropped by `git repack` is
when a `git fetch --prune` (or even a `git fetch` when a ref was
force-pushed in the meantime) can make a commit unreachable that was
reachable before.

Therefore it is not safe to assume that a `git repack -adlf` will keep
unreachable commits alone (under the assumption that they had not been
packed in the first place, which is an assumption at least some of Git's
code seems to make).

This is particularly important to keep in mind when looking at the
`.git/shallow` file: if any commits listed in that file become
unreachable, it is not a problem, but if they go missing, it *is* a
problem. One symptom of this problem is that a deepening fetch may now
fail with

fatal: error in object: unshallow <commit-hash>

To avoid this problem, let's prune the shallow list in `git repack` when
the `-d` option is passed, unless `-A` is passed, too (which would force
the now-unreachable objects to be turned into loose objects instead of
being deleted). Additionally, we also need to take `--keep-reachable`
and `--unpack-unreachable=<date>` into account.

Note: an alternative solution discussed during the review of this patch
was to teach `git fetch` to simply ignore entries in .git/shallow if the
corresponding commits do not exist locally. A quick test, however,
revealed that the .git/shallow file is written during a shallow *clone*,
in which case the commits do not exist, either, but the "shallow" line
*does* need to be sent. Therefore, this approach would be a lot more
finicky than the approach presented by the this patch.

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

shallow: offer to prune only non-existing entriesJohannes Schindelin Wed, 24 Oct 2018 15:56:12 +0000 (08:56 -0700)

shallow: offer to prune only non-existing entries

The `prune_shallow()` function wants a full reachability check to be
completed before it goes to work, to ensure that all unreachable entries
are removed from the shallow file.

However, in the upcoming patch we do not even want to go that far. We
really only need to remove entries corresponding to pruned commits, i.e.
to commits that no longer exist.

Let's support that use case.

Rather than extending the signature of `prune_shallow()` to accept
another Boolean, let's turn it into a bit field and declare constants,
for readability.

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

repack: point out a bug handling stale shallow infoJohannes Schindelin Wed, 24 Oct 2018 15:56:10 +0000 (08:56 -0700)

repack: point out a bug handling stale shallow info

A `git fetch --prune` can turn previously-reachable objects unreachable,
even commits that are in the `shallow` list. A subsequent `git repack
-ad` will then unceremoniously drop those unreachable commits, and the
`shallow` list will become stale. This means that when we try to fetch
with a larger `--depth` the next time, we may end up with:

fatal: error in object: unshallow <commit-hash>

Reported by Alejandro Pauly.

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

t5410: use longer path for sample scriptJeff King Wed, 24 Oct 2018 07:37:06 +0000 (03:37 -0400)

t5410: use longer path for sample script

t5410 creates a sample script "alternate-refs", and sets
core.alternateRefsCommand to just "alternate-refs". That
shouldn't work, as "." is not in our $PATH, and so we should
not find it.

However, due to a bug in run-command.c, we sometimes find it
anyway! Even more confusing, this bug is only in the
fork-based version of run-command. So the test passes on
Linux (etc), but fails on Windows.

In preparation for fixing the run-command bug, let's use a
more complete path here.

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

t0061: adjust to test-tool transitionJunio C Hamano Thu, 25 Oct 2018 02:41:09 +0000 (11:41 +0900)

t0061: adjust to test-tool transition

run-command: mark path lookup errors with ENOENTJeff King Wed, 24 Oct 2018 07:38:00 +0000 (03:38 -0400)

run-command: mark path lookup errors with ENOENT

Since commit e3a434468f (run-command: use the
async-signal-safe execv instead of execvp, 2017-04-19),
prepare_cmd() does its own PATH lookup for any commands we
run (on non-Windows platforms).

However, its logic does not match the old execvp call when
we fail to find a matching entry in the PATH. Instead of
feeding the name directly to execv, execvp would consider
that an ENOENT error. By continuing and passing the name
directly to execv, we effectively behave as if "." was
included at the end of the PATH. This can have confusing and
even dangerous results.

The fix itself is pretty straight-forward. There's a new
test in t0061 to cover this explicitly, and I've also added
a duplicate of the ENOENT test to ensure that we return the
correct errno for this case.

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

khash: silence -Wunused-function for delta-islandsCarlo Marcelo Arenas Belón Tue, 23 Oct 2018 21:50:20 +0000 (14:50 -0700)

khash: silence -Wunused-function for delta-islands

showing the following when compiled with latest clang (OpenBSD, Fedors
and macOS):

delta-islands.c:23:1: warning: unused function 'kh_destroy_str'
[-Wunused-function]
delta-islands.c:23:1: warning: unused function 'kh_clear_str'
[-Wunused-function]
delta-islands.c:23:1: warning: unused function 'kh_del_str' [-Wunused-function]

Reported-by: René Scharfe <l.s.r@web.de>
Suggested-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Carlo Marcelo Arenas Belón <carenas@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

commit-slabs: move MAYBE_UNUSED outCarlo Marcelo Arenas Belón Tue, 23 Oct 2018 21:50:19 +0000 (14:50 -0700)

commit-slabs: move MAYBE_UNUSED out

after 36da893114 ("config.mak.dev: enable -Wunused-function", 2018-10-18)
it is expected to be used to prevent -Wunused-function warnings for code
that was macro generated

Signed-off-by: Carlo Marcelo Arenas Belón <carenas@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

mingw: fix getcwd when the parent directory cannot... Anton Serbulov Tue, 23 Oct 2018 10:52:49 +0000 (03:52 -0700)

mingw: fix getcwd when the parent directory cannot be queried

`GetLongPathName()` function may fail when it is unable to query
the parent directory of a path component to determine the long name
for that component. It happens, because it uses `FindFirstFile()`
function for each next short part of path. The `FindFirstFile()`
requires `List Directory` and `Synchronize` desired access for a calling
process.

In case of lacking such permission for some part of path,
the `GetLongPathName()` returns 0 as result and `GetLastError()`
returns ERROR_ACCESS_DENIED.

`GetFinalPathNameByHandle()` function can help in such cases, because
it requires `Read Attributes` and `Synchronize` desired access to the
target path only.

The `GetFinalPathNameByHandle()` function was introduced on
`Windows Server 2008/Windows Vista`. So we need to load it dynamically.

`CreateFile()` parameters:
`lpFileName` = path to the current directory
`dwDesiredAccess` = 0 (it means `Read Attributes` and `Synchronize`)
`dwShareMode` = FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE
(it prevents `Sharing Violation`)
`lpSecurityAttributes` = NULL (default security attributes)
`dwCreationDisposition` = OPEN_EXISTING
(required to obtain a directory handle)
`dwFlagsAndAttributes` = FILE_FLAG_BACKUP_SEMANTICS
(required to obtain a directory handle)
`hTemplateFile` = NULL (when opening an existing file or directory,
`CreateFile` ignores this parameter)

The string that is returned by `GetFinalPathNameByHandle()` function
uses the \\?\ syntax. To skip the prefix and convert backslashes
to slashes, the `normalize_ntpath()` mingw function will be used.

Note: `GetFinalPathNameByHandle()` function returns a final path.
It is the path that is returned when a path is fully resolved.
For example, for a symbolic link named "C:\tmp\mydir" that points to
"D:\yourdir", the final path would be "D:\yourdir".

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

mingw: ensure `getcwd()` reports the correct caseJohannes Schindelin Tue, 23 Oct 2018 10:52:48 +0000 (03:52 -0700)

mingw: ensure `getcwd()` reports the correct case

When switching the current working directory, say, in PowerShell, it is
quite possible to use a different capitalization than the one that is
recorded on disk. While doing the same in `cmd.exe` adjusts the
capitalization magically, that does not happen in PowerShell so that
`getcwd()` returns the current directory in a different way than is
recorded on disk.

Typically this creates no problems except when you call

git log .

in a subdirectory called, say, "GIT/" but you switched to "Git/" and
your `getcwd()` reports the latter, then Git won't understand that you
wanted to see the history as per the `GIT/` subdirectory but it thinks you
wanted to see the history of some directory that may have existed in the
past (but actually never did).

So let's be extra careful to adjust the capitalization of the current
directory before working with it.

Reported by a few PowerShell power users ;-)

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

mingw: load system libraries the recommended wayJohannes Schindelin Tue, 23 Oct 2018 10:51:49 +0000 (03:51 -0700)

mingw: load system libraries the recommended way

When we access IPv6-related functions, we load the corresponding system
library using the `LoadLibrary()` function, which is not the recommended
way to load system libraries.

In practice, it does not make a difference: the `ws2_32.dll` library
containing the IPv6 functions is already loaded into memory, so
LoadLibrary() simply reuses the already-loaded library.

Still, recommended way is recommended way, so let's use that instead.

While at it, also adjust the code in contrib/ that loads system libraries.

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

rebase --autostash: fix issue with dirty submodulesJohannes Schindelin Tue, 23 Oct 2018 19:57:17 +0000 (12:57 -0700)

rebase --autostash: fix issue with dirty submodules

Since we cannot stash dirty submodules, there is no use in requiring
them to be clean (or stash them when they are not).

This brings the built-in rebase in line with the previous, scripted
version, which also did not care about dirty submodules (but it was
admittedly not very easy to figure that out).

This fixes https://github.com/git-for-windows/git/issues/1820

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

rebase --autostash: demonstrate a problem with dirty... Johannes Schindelin Tue, 23 Oct 2018 19:57:16 +0000 (12:57 -0700)

rebase --autostash: demonstrate a problem with dirty submodules

It has been reported that dirty submodules cause problems with the
built-in rebase when it is asked to autostash. The symptom is:

fatal: Unexpected stash response: ''

This patch adds a regression test that demonstrates that bug.

Original report: https://github.com/git-for-windows/git/issues/1820

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

mingw: implement nanosecond-precision file timesKarsten Blees Tue, 23 Oct 2018 10:23:22 +0000 (03:23 -0700)

mingw: implement nanosecond-precision file times

We no longer use any of MSVCRT's stat-functions, so there's no need to
stick to a CRT-compatible 'struct stat' either.

Define and use our own POSIX-2013-compatible 'struct stat' with nanosecond-
precision file times.

Note: This can cause performance issues when using Git variants with
different file time resolutions, as the timestamps are stored in the Git
index: after updating the index with a Git variant that uses
second-precision file times, a nanosecond-aware Git will think that
pretty much every single file listed in the index is out of date.

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

mingw: replace MSVCRT's fstat() with a Win32-based... Karsten Blees Tue, 23 Oct 2018 10:23:21 +0000 (03:23 -0700)

mingw: replace MSVCRT's fstat() with a Win32-based implementation

fstat() is the only stat-related CRT function for which we don't have a
full replacement yet (and thus the only reason to stick with MSVCRT's
'struct stat' definition).

Fully implement fstat(), in preparation of implementing a POSIX 2013
compatible 'struct stat' with nanosecond-precision file times.

This allows us also to implement some clever code to handle pipes and
character devices in our own way.

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

mingw: factor out code to set stat() dataJohannes Schindelin Tue, 23 Oct 2018 10:23:19 +0000 (03:23 -0700)

mingw: factor out code to set stat() data

In our fstat() emulation, we convert the file metadata from Win32 data
structures to an emulated POSIX structure.

To structure the code better, let's factor that part out into its own
function.

Note: it would be tempting to try to unify this code with the part of
do_lstat() that does the same thing, but they operate on different data
structures: BY_HANDLE_FILE_INFORMATION vs WIN32_FILE_ATTRIBUTE_DATA. So
unfortunately, they cannot be unified.

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

Documentation/config.txt: fix typo in core.alternateRef... Taylor Blau Tue, 23 Oct 2018 01:32:04 +0000 (18:32 -0700)

Documentation/config.txt: fix typo in core.alternateRefsCommand

In [1] Git learned about 'core.alternateRefsCommand', and with it, the
accompanying documentation. However, this documentation included a typo
involving the verb tense of "produced".

Match the tense of the surrounding bits by correcting this typo.

[1]: 89284c1d6c (transport.c: introduce core.alternateRefsCommand,
2018-10-08)

Signed-off-by: Taylor Blau <me@ttaylorr.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

fsck: s/++i > 1/i++/Junio C Hamano Wed, 24 Oct 2018 01:25:12 +0000 (10:25 +0900)

fsck: s/++i > 1/i++/

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

cocci: simplify "if (++u > 1)" to "if (u++)"Junio C Hamano Wed, 24 Oct 2018 01:10:10 +0000 (10:10 +0900)

cocci: simplify "if (++u > 1)" to "if (u++)"

It is more common to use post-increment than pre-increment when the
side effect is the primary thing we want in our code and in C in
general (unlike C++).

Initializing a variable to 0, incrementing it every time we do
something, and checking if we have already done that thing to guard
the code to do that thing, is easier to understand when written

if (u++)
; /* we've done that! */
else
do_it(); /* just once. */

but if you try to use pre-increment, you end up with a less natural
looking

if (++u > 1)

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

t7501: rename commit test to comply with naming conventionStephen P. Smith Tue, 23 Oct 2018 03:53:41 +0000 (20:53 -0700)

t7501: rename commit test to comply with naming convention

The naming convention was documented [1] but this script was not
renamed.

The original commit message indicates the script tests basic commit
functionality. Clean up the test name by changing the file name to
specify the intent as documented in the initial commit.

[1] f50c9f76c ("Rename some test scripts and describe the naming convention", 2005-05-15)

Signed-off-by: Stephen P. Smith <ischis2@cox.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

t7500: rename commit tests script to comply with naming... Stephen P. Smith Tue, 23 Oct 2018 03:53:40 +0000 (20:53 -0700)

t7500: rename commit tests script to comply with naming convention

When the test naming convention was documented[1] the commit script
was not renamed.

Update the test description to note that the tests fall into four
general categories: template, sign-off, -F and squash tests.

Chose to not add "File" to the new script name as that did not seem to
convey the current test contents for that switch.

[1] f50c9f76c ("Rename some test scripts and describe the naming convention", 2005-05-15)

Signed-off-by: Stephen P. Smith <ischis2@cox.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

t7502: rename commit test script to comply with naming... Stephen P. Smith Tue, 23 Oct 2018 03:53:39 +0000 (20:53 -0700)

t7502: rename commit test script to comply with naming convention

When the test naming convention was documented[1] the commit script
was not renamed.

The test description for t7502 indicates that the test file is to
contain porcelain type options for the commit command.

The tests don't fall into a single category. There are tests for
cleanup, sign-off, multiple message options, etc.

Rename the t7502-commit.sh to t7502-commit-porcelain.sh which reflects
the high level nature and usage of the options to commit.

[1] f50c9f76c ("Rename some test scripts and describe the naming convention", 2005-05-15)

Signed-off-by: Stephen P. Smith <ischis2@cox.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

t7509: cleanup description and filenameStephen P. Smith Tue, 23 Oct 2018 03:53:38 +0000 (20:53 -0700)

t7509: cleanup description and filename

Rename test and update the test description to explicitly state that
included tests all relate to commit authorship. The t7509-commit.sh
file was not renamed when other scripts were updated in compliance
with the test naming convention.

[1] f50c9f76c ("Rename some test scripts and describe the naming convention", 2005-05-15)

Signed-off-by: Stephen P. Smith <ischis2@cox.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

t2000: rename and combine checkout clash testsStephen P. Smith Tue, 23 Oct 2018 03:53:37 +0000 (20:53 -0700)

t2000: rename and combine checkout clash tests

In an earlier patch some tests scripts were renamed and a naming
convention was documented. [1]

Merge t2000-checkout-cache-clash.sh and t2001-checkout-cache-clash.sh into
t2000-conflict-when-checking-files-out.sh.

[1] f50c9f76c ("Rename some test scripts and describe the naming convention", 2005-05-15)

Signed-off-by: Stephen P. Smith <ischis2@cox.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

exclude-promisor-objects: declare when option is allowedMatthew DeVore Tue, 23 Oct 2018 01:13:42 +0000 (18:13 -0700)

exclude-promisor-objects: declare when option is allowed

The --exclude-promisor-objects option causes some funny behavior in at
least two commands: log and blame. It causes a BUG crash:

$ git log --exclude-promisor-objects
BUG: revision.c:2143: exclude_promisor_objects can only be used
when fetch_if_missing is 0
Aborted
[134]

Fix this such that the option is treated like any other unknown option.
The commands that must support it are limited, so declare in those
commands that the flag is supported. In particular:

pack-objects
prune
rev-list

The commands were found by searching for logic which parses
--exclude-promisor-objects outside of revision.c. Extra logic outside of
revision.c is needed because fetch_if_missing must be turned on before
revision.c sees the option or it will BUG-crash. The above list is
supported by the fact that no other command is introspectively invoked
by another command passing --exclude-promisor-object.

Signed-off-by: Matthew DeVore <matvore@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Documentation/git-log.txt: do not show --exclude-promis... Matthew DeVore Tue, 23 Oct 2018 01:13:41 +0000 (18:13 -0700)

Documentation/git-log.txt: do not show --exclude-promisor-objects

Do not suggest that --exclude-promisor-objects is supported by git-log,
since it currently BUG-crashes and it's not necessary to support it.
Options that control behavior for promisor objects should be limited to
a small number of commands.

Signed-off-by: Matthew DeVore <matvore@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

send-email: explicitly disable authenticationJoshua Watt Tue, 23 Oct 2018 03:24:25 +0000 (22:24 -0500)

send-email: explicitly disable authentication

It can be necessary to disable SMTP authentication by a mechanism other
than sendemail.smtpuser being undefined. For example, if the user has
sendemail.smtpuser set globally but wants to disable authentication
locally in one repository.

--smtp-auth and sendemail.smtpauth now understand the value 'none' which
means to disable authentication completely, even if an authentication
user is specified.

The value 'none' is lower case to avoid conflicts with any RFC 4422
authentication mechanisms.

The user may also specify the command line argument --no-smtp-auth as a
shorthand for --smtp-auth=none

Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

rebase (autostash): use an explicit OID to apply the... Johannes Schindelin Mon, 22 Oct 2018 22:15:05 +0000 (15:15 -0700)

rebase (autostash): use an explicit OID to apply the stash

When `git stash apply <argument>` sees an argument that consists only of
digits, it tries to be smart and interpret it as `stash@{<number>}`.

Unfortunately, an all-digit hash (which is unlikely but still possible)
is therefore misinterpreted as `stash@{<n>}` reflog.

To prevent that from happening, let's append `^0` after the stash hash,
to make sure that it is interpreted as an OID rather than as a number.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Reviewed-by: SZEDER Gábor <szeder.dev@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

rebase (autostash): store the full OID in <state-dir... Johannes Schindelin Mon, 22 Oct 2018 22:15:03 +0000 (15:15 -0700)

rebase (autostash): store the full OID in <state-dir>/autostash

It was reported by Gábor Szeder and analyzed by Alban Gruin that the
built-in rebase stores only abbreviated stash hashes in the `autostash`
file.

This is problematic e.g. in t5520-pull.sh, where the abbreviated hash is
so short that it sometimes consists only of digits, which are
subsequently mistaken ("DWIMmed") for numbers by `git stash apply`.

Let's align the behavior of the built-in rebase with the scripted rebase
and store the full stash hash instead. That makes it a lot less likely
that it consists only of digits.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Reviewed-by: SZEDER Gábor <szeder.dev@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

rebase (autostash): avoid duplicate call to state_dir_p... Johannes Schindelin Mon, 22 Oct 2018 22:15:02 +0000 (15:15 -0700)

rebase (autostash): avoid duplicate call to state_dir_path()

We already called that function at this point, and stored the result in
the `path` variable. We might just as well use it ;-)

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Reviewed-by: SZEDER Gábor <szeder.dev@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

doc: fix formatting in git-update-refAndreas Heiduk Mon, 22 Oct 2018 20:45:46 +0000 (22:45 +0200)

doc: fix formatting in git-update-ref

Remove the parapgraph numbers from lines explaining the reflog format
and typeset these lines in monospace.

Signed-off-by: Andreas Heiduk <asheiduk@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

doc: fix indentation of listing blocks in gitweb.conf.txtAndreas Heiduk Mon, 22 Oct 2018 20:45:45 +0000 (22:45 +0200)

doc: fix indentation of listing blocks in gitweb.conf.txt

'gitweb.conf.txt' uses inconsistent indentation in listing blocks and a mix
of listing blocks and literal paragraphs. Both didn't look pretty in the
rendered HTML page.

Signed-off-by: Andreas Heiduk <asheiduk@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

doc: fix descripion for 'git tag --format'Andreas Heiduk Mon, 22 Oct 2018 20:45:44 +0000 (22:45 +0200)

doc: fix descripion for 'git tag --format'

The '--format=<format>' is now listed in the 'OPTIONS' section, not only
the '<format>' string itself. The description moved up a few paragraphs
because '<format>' is not a standalone paramater but a parameter for the
option '--format'.

Signed-off-by: Andreas Heiduk <asheiduk@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

doc: fix inappropriate monospace formattingAndreas Heiduk Mon, 22 Oct 2018 20:45:43 +0000 (22:45 +0200)

doc: fix inappropriate monospace formatting

Signed-off-by: Andreas Heiduk <asheiduk@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

doc: fix ASCII art tab spacingAndreas Heiduk Mon, 22 Oct 2018 20:45:42 +0000 (22:45 +0200)

doc: fix ASCII art tab spacing

Followup to 5dd05ebf ("doc: fix merge-base ASCII art tab spacing", 2016-10-21)

Signed-off-by: Andreas Heiduk <asheiduk@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

doc: clarify boundaries of 'git worktree list --porcelain'Andreas Heiduk Mon, 22 Oct 2018 20:45:41 +0000 (22:45 +0200)

doc: clarify boundaries of 'git worktree list --porcelain'

Defined delimiters for 'git worktree list --porcelain' make the format
easier to parse in scripts. For example

sed -n '/^worktree ID$/,/^$/p'

extracts only the information for the worktree 'ID'.

The format did not changed since [1], only the guaranty is added.

[1] bb9c03b82a (worktree: add 'list' command, 2015-10-08)

Signed-off-by: Andreas Heiduk <asheiduk@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

gpg-interface.c: obtain primary key fingerprint as... Michał Górny Mon, 22 Oct 2018 16:38:21 +0000 (18:38 +0200)

gpg-interface.c: obtain primary key fingerprint as well

Obtain the primary key fingerprint off VALIDSIG status message,
and expose it via %GP format.

Signed-off-by: Michał Górny <mgorny@gentoo.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

gpg-interface.c: support getting key fingerprint via... Michał Górny Mon, 22 Oct 2018 16:38:20 +0000 (18:38 +0200)

gpg-interface.c: support getting key fingerprint via %GF format

Support processing VALIDSIG status that provides additional information
for valid signatures. Use this information to propagate signing key
fingerprint and expose it via %GF pretty format. This format can be
used to build safer key verification systems that verify the key via
complete fingerprint rather than short/long identifier provided by %GK.

Signed-off-by: Michał Górny <mgorny@gentoo.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

gpg-interface.c: use flags to determine key/signer... Michał Górny Mon, 22 Oct 2018 16:38:19 +0000 (18:38 +0200)

gpg-interface.c: use flags to determine key/signer info presence

Replace the logic used to determine whether key and signer information
is present to use explicit flags in sigcheck_gpg_status[] array. This
is more future-proof, since it makes it possible to add additional
statuses without having to explicitly update the conditions.

Signed-off-by: Michał Górny <mgorny@gentoo.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

commit-reach: fix cast in compare_commits_by_gen()René Scharfe Mon, 1 Oct 2018 19:16:01 +0000 (21:16 +0200)

commit-reach: fix cast in compare_commits_by_gen()

The elements of the array to be sorted are commit pointers, so the
comparison function gets handed references to these pointers, not
pointers to commit objects. Cast to the right type and dereference
once to correctly get the commit reference.

Found using Clang's ASan and t5500.

Signed-off-by: Rene Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

completion: fix __gitcomp_builtin no longer consider... Nguyễn Thái Ngọc Duy Sun, 21 Oct 2018 08:37:31 +0000 (10:37 +0200)

completion: fix __gitcomp_builtin no longer consider extra options

__gitcomp_builtin() has the main completion list provided by

git xxx --git-completion-helper

but the caller can also add extra options that is not provided by
--git-completion-helper. The only call site that does this is "git
difftool" completion.

This support is broken by b221b5ab9b (completion: collapse extra
--no-.. options - 2018-06-06), which adds a special value "--" to mark
that the rest of the options can be hidden by default. The commit
forgets the fact that extra options are appended after
"$(git xxx --git-completion-helper)", i.e. after this "--", and will
be incorrectly hidden as well.

Prepend the extra options before "$(git xxx --git-completion-helper)"
to avoid this.

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

gpg-interface.c: detect and reject multiple signatures... Michał Górny Sat, 20 Oct 2018 19:30:20 +0000 (21:30 +0200)

gpg-interface.c: detect and reject multiple signatures on commits

GnuPG supports creating signatures consisting of multiple signature
packets. If such a signature is verified, it outputs all the status
messages for each signature separately. However, git currently does not
account for such scenario and gets terribly confused over getting
multiple *SIG statuses.

For example, if a malicious party alters a signed commit and appends
a new untrusted signature, git is going to ignore the original bad
signature and report untrusted commit instead. However, %GK and %GS
format strings may still expand to the data corresponding
to the original signature, potentially tricking the scripts into
trusting the malicious commit.

Given that the use of multiple signatures is quite rare, git does not
support creating them without jumping through a few hoops, and finally
supporting them properly would require extensive API improvement, it
seems reasonable to just reject them at the moment.

Signed-off-by: Michał Górny <mgorny@gentoo.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

read-cache: use of memory after it is freedCarlo Marcelo Arenas Belón Sat, 20 Oct 2018 07:33:34 +0000 (00:33 -0700)

read-cache: use of memory after it is freed

introduced with c46c406ae1e (trace.h: support nested performance tracing)
on Aug 18, 2018 but not affecting maint

Signed-off-by: Carlo Marcelo Arenas Belón <carenas@gmail.com>
Acked-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

submodule.c: remove some of the_repository referencesNguyễn Thái Ngọc Duy Fri, 19 Oct 2018 17:34:43 +0000 (19:34 +0200)

submodule.c: remove some of the_repository references

Commit 174d131fc9 (submodule.c: remove implicit dependency on
the_index - 2018-09-21) makes collect_changed_submodules() take a
"struct index_state *" as argument even if it's not really used. My
bad.

Instead of deleting this argument and fixing up all call sites. Let's
take this opportunity to remove some the_repository instead because
there's one or two in this function (and two more in its callback).
The callers can also get rid of some the_repository.

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

diff: don't attempt to strip prefix from absolute Windo... Johannes Sixt Fri, 19 Oct 2018 16:58:07 +0000 (18:58 +0200)

diff: don't attempt to strip prefix from absolute Windows paths

git diff can be invoked with absolute paths. Typically, this triggers
the --no-index case. Then the absolute paths remain in the file names
that are printed in the output.

There is one peculiarity, though: When the command is invoked from a
a sub-directory in a repository, then it is attempted to strip the
sub-directory from the beginning of relative paths. Yet, to detect a
relative path the code just checks for an initial forward slash.
This mistakes a Windows style path like "D:/base" as a relative path
and the output looks like this, for example:

D:\dir\test\one>git -P diff --numstat D:\dir\base D:\dir\diff
1 1 ir/{base => diff}/1.txt

where the correct output should be

D:\dir\test\one>git -P diff --numstat D:\dir\base D:\dir\diff
1 1 D:/dir/{base => diff}/1.txt

If the sub-directory where 'git diff' is invoked is sufficiently deep
that the prefix becomes longer than the path to be printed, then the
subsequent code accesses the path out of bounds.

Use is_absolute_path() to detect Windows style absolute paths.

One might wonder whether the check for a directory separator that
is visible in the patch context should be changed from == '/' to
is_dir_sep() or not. It turns out not to be necessary. That code
only ever investigates paths that have undergone pathspec
normalization, after which there are only forward slashes even on
Windows.

Signed-off-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

receive: denyCurrentBranch=updateinstead should not... Junio C Hamano Fri, 19 Oct 2018 04:57:35 +0000 (13:57 +0900)

receive: denyCurrentBranch=updateinstead should not blindly update

The handling of receive.denyCurrentBranch=updateInstead was added to
a switch statement that handles other values of the variable, but
all the other case arms only checked a condition to reject the
attempted push, or let later logic in the same function to still
intervene, so that a push that does not fast-forward (which is
checked after the switch statement in question) is still rejected.

But the handling of updateInstead incorrectly took immediate effect,
without giving other checks a chance to intervene.

Instead of calling update_worktree() that causes the side effect
immediately, just note the fact that we will need to call the
function later, and first give other checks a chance to reject the
request. After the update-hook gets a chance to reject the push
(which happens as the last step in a series of checks), call
update_worktree() when we earlier detected the need to.

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

pack-objects (mingw): initialize `packing_data` mutex... Johannes Schindelin Tue, 16 Oct 2018 21:02:52 +0000 (14:02 -0700)

pack-objects (mingw): initialize `packing_data` mutex in the correct spot

In 9ac3f0e5b3e4 (pack-objects: fix performance issues on packing large
deltas, 2018-07-22), a mutex was introduced that is used to guard the
call to set the delta size. This commit even added code to initialize
it, but at an incorrect spot: in `init_threaded_search()`, while the
call to `oe_set_delta_size()` (and hence to `packing_data_lock()`) can
happen in the call chain `check_object()` <- `get_object_details()` <-
`prepare_pack()` <- `cmd_pack_objects()`, which is long before the
`prepare_pack()` function calls `ll_find_deltas()` (which initializes
the threaded search).

Another tell-tale that the mutex was initialized in an incorrect spot is
that the function to initialize it lives in builtin/, while the code
that uses the mutex is defined in a libgit.a header file.

Let's use a more appropriate function: `prepare_packing_data()`, which
not only lives in libgit.a, but *has* to be called before the
`packing_data` struct is used that contains that mutex.

This fixes https://github.com/git-for-windows/git/issues/1839.

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

pack-objects (mingw): demonstrate a segmentation fault... Johannes Schindelin Tue, 16 Oct 2018 21:02:50 +0000 (14:02 -0700)

pack-objects (mingw): demonstrate a segmentation fault with large deltas

There is a problem in the way 9ac3f0e5b3e4 (pack-objects: fix
performance issues on packing large deltas, 2018-07-22) initializes that
mutex in the `packing_data` struct. The problem manifests in a
segmentation fault on Windows, when a mutex (AKA critical section) is
accessed without being initialized. (With pthreads, you apparently do
not really have to initialize them?)

This was reported in https://github.com/git-for-windows/git/issues/1839.

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

pack-objects: fix typo 'detla' -> 'delta'Johannes Schindelin Tue, 16 Oct 2018 21:02:49 +0000 (14:02 -0700)

pack-objects: fix typo 'detla' -> 'delta'

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

Fifth batch for 2.20Junio C Hamano Fri, 19 Oct 2018 04:52:51 +0000 (13:52 +0900)

Fifth batch for 2.20

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

Merge branch 'jt/cache-tree-allow-missing-object-in... Junio C Hamano Fri, 19 Oct 2018 04:34:08 +0000 (13:34 +0900)

Merge branch 'jt/cache-tree-allow-missing-object-in-partial-clone'

In a partial clone that will lazily be hydrated from the
originating repository, we generally want to avoid "does this
object exist (locally)?" on objects that we deliberately omitted
when we created the clone. The cache-tree codepath (which is used
to write a tree object out of the index) however insisted that the
object exists, even for paths that are outside of the partial
checkout area. The code has been updated to avoid such a check.

* jt/cache-tree-allow-missing-object-in-partial-clone:
cache-tree: skip some blob checks in partial clone

Merge branch 'tb/filter-alternate-refs'Junio C Hamano Fri, 19 Oct 2018 04:34:08 +0000 (13:34 +0900)

Merge branch 'tb/filter-alternate-refs'

When pushing into a repository that borrows its objects from an
alternate object store, "git receive-pack" that responds to the
push request on the other side lists the tips of refs in the
alternate to reduce the amount of objects transferred. This
sometimes is detrimental when the number of refs in the alternate
is absurdly large, in which case the bandwidth saved in potentially
fewer objects transferred is wasted in excessively large ref
advertisement. The alternate refs that are advertised are now
configurable with a pair of configuration variables.

* tb/filter-alternate-refs:
transport.c: introduce core.alternateRefsPrefixes
transport.c: introduce core.alternateRefsCommand
transport.c: extract 'fill_alternate_refs_command'
transport: drop refnames from for_each_alternate_ref

Merge branch 'jt/avoid-ls-refs'Junio C Hamano Fri, 19 Oct 2018 04:34:07 +0000 (13:34 +0900)

Merge branch 'jt/avoid-ls-refs'

Over some transports, fetching objects with an exact commit object
name can be done without first seeing the ref advertisements. The
code has been optimized to exploit this.

* jt/avoid-ls-refs:
fetch: do not list refs if fetching only hashes
transport: list refs before fetch if necessary
transport: do not list refs if possible
transport: allow skipping of ref listing

Merge branch 'ds/commit-graph-leakfix'Junio C Hamano Fri, 19 Oct 2018 04:34:07 +0000 (13:34 +0900)

Merge branch 'ds/commit-graph-leakfix'

Code clean-up.

* ds/commit-graph-leakfix:
commit-graph: reduce initial oid allocation
builtin/commit-graph.c: UNLEAK variables
commit-graph: clean up leaked memory during write

Merge branch 'jt/non-blob-lazy-fetch'Junio C Hamano Fri, 19 Oct 2018 04:34:07 +0000 (13:34 +0900)

Merge branch 'jt/non-blob-lazy-fetch'

A partial clone that is configured to lazily fetch missing objects
will on-demand issue a "git fetch" request to the originating
repository to fill not-yet-obtained objects. The request has been
optimized for requesting a tree object (and not the leaf blob
objects contained in it) by telling the originating repository that
no blobs are needed.

* jt/non-blob-lazy-fetch:
fetch-pack: exclude blobs when lazy-fetching trees
fetch-pack: avoid object flags if no_dependents

Merge branch 'pw/diff-color-moved-ws-fix'Junio C Hamano Fri, 19 Oct 2018 04:34:06 +0000 (13:34 +0900)

Merge branch 'pw/diff-color-moved-ws-fix'

Various fixes to "diff --color-moved-ws".

* pw/diff-color-moved-ws-fix:
diff --color-moved: fix a memory leak
diff --color-moved-ws: fix another memory leak
diff --color-moved-ws: fix a memory leak
diff --color-moved-ws: fix out of bounds string access
diff --color-moved-ws: fix double free crash

Merge branch 'rs/oidset-on-khash'Junio C Hamano Fri, 19 Oct 2018 04:34:06 +0000 (13:34 +0900)

Merge branch 'rs/oidset-on-khash'

The oidset API was built on top of the oidmap API which in turn is
on the hashmap API. Replace the implementation to build on top of
the khash API and gain performance.

* rs/oidset-on-khash:
oidset: uninline oidset_init()
oidset: use khash
khash: factor out kh_release_*
fetch-pack: load tip_oids eagerly iff needed
fetch-pack: factor out is_unmatched_ref()

Merge branch 'rs/grep-no-recursive'Junio C Hamano Fri, 19 Oct 2018 04:34:05 +0000 (13:34 +0900)

Merge branch 'rs/grep-no-recursive'

Unlike "grep", "git grep" by default recurses to the whole tree.
The command learned "git grep --recursive" option, so that "git
grep --no-recursive" can serve as a synonym to setting the
max-depth to 0.

* rs/grep-no-recursive:
grep: add -r/--[no-]recursive

Merge branch 'nd/help-commands-verbose-by-default'Junio C Hamano Fri, 19 Oct 2018 04:34:05 +0000 (13:34 +0900)

Merge branch 'nd/help-commands-verbose-by-default'

"git help -a" and "git help -av" give different pieces of
information, and generally the "verbose" version is more friendly
to the new users. "git help -a" by default now uses the more
verbose output (with "--no-verbose", you can go back to the
original). Also "git help -av" now lists aliases and external
commands, which it did not used to.

* nd/help-commands-verbose-by-default:
help -a: improve and make --verbose default

Merge branch 'jc/how-to-document-api'Junio C Hamano Fri, 19 Oct 2018 04:34:05 +0000 (13:34 +0900)

Merge branch 'jc/how-to-document-api'

Doc update.

* jc/how-to-document-api:
CodingGuidelines: document the API in *.h files

Merge branch 'sm/show-superproject-while-conflicted'Junio C Hamano Fri, 19 Oct 2018 04:34:04 +0000 (13:34 +0900)

Merge branch 'sm/show-superproject-while-conflicted'

A corner-case bugfix.

* sm/show-superproject-while-conflicted:
rev-parse: --show-superproject-working-tree should work during a merge

Merge branch 'jt/fetch-tips-in-partial-clone'Junio C Hamano Fri, 19 Oct 2018 04:34:04 +0000 (13:34 +0900)

Merge branch 'jt/fetch-tips-in-partial-clone'

"git fetch $repo $object" in a partial clone did not correctly
fetch the asked-for object that is referenced by an object in
promisor packfile, which has been fixed.

* jt/fetch-tips-in-partial-clone:
fetch: in partial clone, check presence of targets
connected: document connectivity in partial clones

Merge branch 'nd/status-refresh-progress'Junio C Hamano Fri, 19 Oct 2018 04:34:03 +0000 (13:34 +0900)

Merge branch 'nd/status-refresh-progress'

"git status" learns to show progress bar when refreshing the index
takes a long time.

* nd/status-refresh-progress:
status: show progress bar if refreshing the index takes too long

Merge branch 'bp/read-cache-parallel'Junio C Hamano Fri, 19 Oct 2018 04:34:03 +0000 (13:34 +0900)

Merge branch 'bp/read-cache-parallel'

A new extension to the index file has been introduced, which allows
the file to be read in parallel.

* bp/read-cache-parallel:
read-cache: load cache entries on worker threads
ieot: add Index Entry Offset Table (IEOT) extension
read-cache: load cache extensions on a worker thread
config: add new index.threads config setting
eoie: add End of Index Entry (EOIE) extension
read-cache: clean up casting and byte decoding
read-cache.c: optimize reading index format v4

Merge branch 'bp/rename-test-env-var'Junio C Hamano Fri, 19 Oct 2018 04:34:03 +0000 (13:34 +0900)

Merge branch 'bp/rename-test-env-var'

Some environment variables that control the runtime options of Git
used during tests are getting renamed for consistency.

* bp/rename-test-env-var:
t0000: do not get self-test disrupted by environment warnings
preload-index: update GIT_FORCE_PRELOAD_TEST support
read-cache: update TEST_GIT_INDEX_VERSION support
fsmonitor: update GIT_TEST_FSMONITOR support
preload-index: use git_env_bool() not getenv() for customization
t/README: correct spelling of "uncommon"

Merge branch 'ss/wt-status-committable'Junio C Hamano Fri, 19 Oct 2018 04:34:02 +0000 (13:34 +0900)

Merge branch 'ss/wt-status-committable'

Code clean-up in the internal machinery used by "git status" and
"git commit --dry-run".

* ss/wt-status-committable:
roll wt_status_state into wt_status and populate in the collect phase
wt-status.c: set the committable flag in the collect phase
t7501: add test of "commit --dry-run --short"
wt-status: rename commitable to committable
wt-status.c: move has_unmerged earlier in the file

Merge branch 'nd/the-index'Junio C Hamano Fri, 19 Oct 2018 04:34:02 +0000 (13:34 +0900)

Merge branch 'nd/the-index'

Various codepaths in the core-ish part learn to work on an
arbitrary in-core index structure, not necessarily the default
instance "the_index".

* nd/the-index: (23 commits)
revision.c: reduce implicit dependency the_repository
revision.c: remove implicit dependency on the_index
ws.c: remove implicit dependency on the_index
tree-diff.c: remove implicit dependency on the_index
submodule.c: remove implicit dependency on the_index
line-range.c: remove implicit dependency on the_index
userdiff.c: remove implicit dependency on the_index
rerere.c: remove implicit dependency on the_index
sha1-file.c: remove implicit dependency on the_index
patch-ids.c: remove implicit dependency on the_index
merge.c: remove implicit dependency on the_index
merge-blobs.c: remove implicit dependency on the_index
ll-merge.c: remove implicit dependency on the_index
diff-lib.c: remove implicit dependency on the_index
read-cache.c: remove implicit dependency on the_index
diff.c: remove implicit dependency on the_index
grep.c: remove implicit dependency on the_index
diff.c: remove the_index dependency in textconv() functions
blame.c: rename "repo" argument to "r"
combine-diff.c: remove implicit dependency on the_index
...

Merge branch 'nd/complete-fetch-multiple-args'Junio C Hamano Fri, 19 Oct 2018 04:34:01 +0000 (13:34 +0900)

Merge branch 'nd/complete-fetch-multiple-args'

Teach bash completion that "git fetch --multiple" only takes remote
names as arguments and no refspecs.

* nd/complete-fetch-multiple-args:
completion: support "git fetch --multiple"

upload-pack: clear flags before each v2 requestJonathan Tan Thu, 18 Oct 2018 20:43:29 +0000 (13:43 -0700)

upload-pack: clear flags before each v2 request

Suppose a server has the following commit graph:

A B
\ /
O

We create a client by cloning A from the server with depth 1, and add
many commits to it (so that future fetches span multiple requests due to
lengthy negotiation). If it then fetches B using protocol v2, the fetch
spanning multiple requests, the resulting packfile does not contain O
even though the client did report that A is shallow.

This is because upload_pack_v2() can be called multiple times while
processing the same session. During the 2nd and all subsequent
invocations, some object flags remain from the previous invocations. In
particular, CLIENT_SHALLOW remains, preventing process_shallow() from
adding client-reported shallows to the "shallows" array, and hence
pack-objects not knowing about these client-reported shallows.

Therefore, teach upload_pack_v2() to clear object flags at the start of
each invocation. This has some other results:

- THEY_HAVE gates addition of objects to have_obj in process_haves().
Previously in upload_pack_v2(), have_obj needed to be static because
once an object is added to have_obj, it is never readded and thus we
needed to retain the contents of have_obj between invocations. Now
that flags are cleared, this is no longer necessary. This patch does
not change the behavior of ok_to_give_up() (THEY_HAVE is still set on
each "have") and got_oid() (used only in non-v2)); THEY_HAVE is not
used in any other function.

- WANTED gates addition of objects to want_obj in parse_want() and
parse_want_ref(). It is also used in receive_needs(), but that is
only used in non-v2. For the same reasons as THEY_HAVE, want_obj no
longer needs to be static in upload_pack_v2().

- CLIENT_SHALLOW is changed as discussed above.

Clearing of the other 5 flags does not affect functionality in v2. (Note
that in non-v2, upload_pack() is only called once per process, so each
invocation starts with blank flags anyway.)

- OUR_REF is only used in non-v2.

- COMMON_KNOWN is only used as a scratch flag in ok_to_give_up().

- SHALLOW is passed to invocations in deepen() and
deepen_by_rev_list(), but upload-pack doesn't use it.

- NOT_SHALLOW is used by send_shallow() and send_unshallow(), but
invocations of those functions are always preceded by code that sets
NOT_SHALLOW on the appropriate objects.

- HIDDEN_REF is only used in non-v2.

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

upload-pack: make want_obj not globalJonathan Tan Thu, 18 Oct 2018 20:43:28 +0000 (13:43 -0700)

upload-pack: make want_obj not global

Because upload_pack_v2() can be invoked multiple times in the same
process, the static variable want_obj may not be empty when it is
invoked. To make further analysis of this situation easier, make the
variable local; analysis will be done in a subsequent patch.

The new local variable in upload_pack_v2() is static to preserve
existing behavior; this is not necessary in upload_pack() because
upload_pack() is only invoked once per process.

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

upload-pack: make have_obj not globalJonathan Tan Thu, 18 Oct 2018 20:43:27 +0000 (13:43 -0700)

upload-pack: make have_obj not global

Because upload_pack_v2() can be invoked multiple times in the same
process, the static variable have_obj may not be empty when it is
invoked. To make further analysis of this situation easier, make the
variable local; analysis will be done in a subsequent patch.

The new local variable in upload_pack_v2() is static to preserve
existing behavior; this is not necessary in upload_pack() because
upload_pack() is only invoked once per process.

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

commit-reach: fix first-parent heuristicDerrick Stolee Thu, 18 Oct 2018 17:24:40 +0000 (10:24 -0700)

commit-reach: fix first-parent heuristic

The algorithm in can_all_from_reach_with_flags() performs a depth-
first-search, terminated by generation number, intending to use
a hueristic that "important" commits are found in the first-parent
history. This heuristic is valuable in scenarios like fetch
negotiation.

However, there is a problem! After the search finds a target commit,
it should pop all commits off the stack and mark them as "can reach".
This logic is incorrect, so the algorithm instead walks all reachable
commits above the generation-number cutoff.

The existing algorithm is still an improvement over the previous
algorithm, as the worst-case complexity went from quadratic to linear.
The performance measurement at the time was good, but not dramatic.
By fixing this heuristic, we reduce the number of walked commits.

We can also re-run the performance tests from commit 4fbcca4e
"commit-reach: make can_all_from_reach... linear".

Performance was measured on the Linux repository using
'test-tool reach can_all_from_reach'. The input included rows seeded by
tag values. The "small" case included X-rows as v4.[0-9]* and Y-rows as
v3.[0-9]*. This mimics a (very large) fetch that says "I have all major
v3 releases and want all major v4 releases." The "large" case included
X-rows as "v4.*" and Y-rows as "v3.*". This adds all release-candidate
tags to the set, which does not greatly increase the number of objects
that are considered, but does increase the number of 'from' commits,
demonstrating the quadratic nature of the previous code.

Small Case:

4fbcca4e~1: 0.85 s
4fbcca4e: 0.26 s (num_walked: 1,011,035)
HEAD: 0.14 s (num_walked: 8,601)

Large Case:

4fbcca4e~1: 24.0 s
4fbcca4e: 0.12 s (num_walked: 503,925)
HEAD: 0.06 s (num_walked: 217,243)

Signed-off-by: Derrick Stolee <dstolee@microsoft.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

ref-filter: free item->value and item->value->sOlga Telezhnaya Thu, 18 Oct 2018 07:28:54 +0000 (07:28 +0000)

ref-filter: free item->value and item->value->s

Release item->value.
Initialize item->value->s dynamically and then release its resources.
Release some local variables.

Final goal of this patch is to reduce number of memory leaks.

Signed-off-by: Olga Telezhnaia <olyatelezhnaya@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

ls-remote: release memory instead of UNLEAKOlga Telezhnaya Thu, 18 Oct 2018 07:28:54 +0000 (07:28 +0000)

ls-remote: release memory instead of UNLEAK

Use ref_array_clear() to release memory instead of UNLEAK macros.

Signed-off-by: Olga Telezhnaia <olyatelezhnaya@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

ref-filter: free memory from used_atomOlga Telezhnaya Thu, 18 Oct 2018 07:28:54 +0000 (07:28 +0000)

ref-filter: free memory from used_atom

Release memory from used_atom variable for reducing number of memory
leaks.

Signed-off-by: Olga Telezhnaia <olyatelezhnaya@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

multi-pack-index: avoid dead store for struct progressCarlo Marcelo Arenas Belón Thu, 18 Oct 2018 18:59:20 +0000 (11:59 -0700)

multi-pack-index: avoid dead store for struct progress

it is initialized unconditionally by a call to start_progress
below.

Signed-off-by: Carlo Marcelo Arenas Belón <carenas@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

unpack-trees: avoid dead store for struct progressCarlo Marcelo Arenas Belón Thu, 18 Oct 2018 18:46:04 +0000 (11:46 -0700)

unpack-trees: avoid dead store for struct progress

it is unconditionally initialized a few lines below

Signed-off-by: Carlo Marcelo Arenas Belón <carenas@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

config.mak.dev: enable -Wunused-functionJeff King Thu, 18 Oct 2018 07:05:22 +0000 (03:05 -0400)

config.mak.dev: enable -Wunused-function

We explicitly omitted -Wunused-function when we added
-Wextra, but there is no need: the current code compiles
cleanly with it. And it's worth having, since it can let you
know when there are cascading effects from a cleanup (e.g.,
deleting one function lets you delete its static helpers).

There are cases where we may need an unused function to
exist, but we can handle these easily:

- macro-generated code like commit-slab; there we have the
MAYBE_UNUSED annotation to silence the compiler

- conditional compilation, where we may or may not need a
static helper. These generally fall into one of two
categories:

- the call should not be conditional, but rather the
function body itself should be (and may just be a
no-op on one side of the #if). That keeps the
conditional pollution out of the main code.

- call-chains of static helpers should all be in the
same #if block, so they are all-or-nothing

And if there's some case that doesn't cover, we still
have MAYBE_UNUSED as a fallback.

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

ci: add optional test variablesDerrick Stolee Wed, 17 Oct 2018 13:00:34 +0000 (06:00 -0700)

ci: add optional test variables

The commit-graph and multi-pack-index features introduce optional
data structures that are not required for normal Git operations.
It is important to run the normal test suite without them enabled,
but it is helpful to also run the test suite using them.

Our continuous integration scripts include a second test stage that
runs with optional GIT_TEST_* variables enabled. Add the following
two variables to that stage:

GIT_TEST_COMMIT_GRAPH
GIT_TEST_MULTI_PACK_INDEX

This will slow down the operation, as we build a commit-graph file
after every 'git commit' operation and build a multi-pack-index
during every 'git repack' operation. However, it is important that
future changes are compatible with these features.

Signed-off-by: Derrick Stolee <dstolee@microsoft.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

merge-recursive: avoid showing conflicts with merge... Elijah Newren Tue, 16 Oct 2018 20:19:48 +0000 (13:19 -0700)

merge-recursive: avoid showing conflicts with merge branch before HEAD

We want to load unmerged entries from HEAD into the index at stage 2 and
from MERGE_HEAD into stage 3. Similarly, folks expect merge conflicts
to look like

<<<<<<<< HEAD
content from our side
========
content from their side
>>>>>>>> MERGE_HEAD

not

<<<<<<<< MERGE_HEAD
content from their side
========
content from our side
>>>>>>>> HEAD

The correct order usually comes naturally and for free, but with renames
we often have data in the form {rename_branch, other_branch}, and
working relative to the rename first (e.g. for rename/add) is more
convenient elsewhere in the code. Address the slight impedance
mismatch by having some functions re-call themselves with flipped
arguments when the branch order is reversed.

Note that setup_rename_conflict_info() has one asymmetry in it, in
setting dst_entry1->processed=0 but not doing similarly for
dst_entry2->processed. When dealing with rename/rename and similar
conflicts, we do not want the processing to happen twice, so the
desire to only set one of the entries to unprocessed is intentional.
So, while this change modifies which branch's entry will be marked as
unprocessed, that dovetails nicely with putting HEAD first so that we
get the index stage entries and conflict markers in the right order.

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

merge-recursive: improve auto-merging messages with... Elijah Newren Tue, 16 Oct 2018 20:19:47 +0000 (13:19 -0700)

merge-recursive: improve auto-merging messages with path collisions

Each individual file involved in a rename could have also been modified
on both sides of history, meaning it may need to have content merges.
If two such files are renamed into the same location, then on top of the
two natural auto-merging messages we also have to two-way merge the
result, giving us messages that look like

Auto-merging somefile.c (was somecase.c)
Auto-merging somefile.c (was somefolder.c)
Auto-merging somefile.c

However, despite the fact that I was the one who put the "(was %s)"
portions into the messages (and just a few months ago), I was still
initially confused when running into a rename/rename(2to1) case and
wondered if somefile.c had been merged three times. Update this to
instead be:

Auto-merging version of somefile.c from somecase.c
Auto-merging version of somefile.c from someportfolio.c
Auto-merging somefile.c

This is an admittedly long set of messages for a single path, but you
only get all three messages when dealing with the rare case of a
rename/rename(2to1) conflict where both sides of both original files
were also modified, in conflicting ways.

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

headers: normalize the spelling of some header guardsRamsay Jones Wed, 17 Oct 2018 22:13:26 +0000 (23:13 +0100)

headers: normalize the spelling of some header guards

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

list-objects: support for skipping tree traversalMatthew DeVore Thu, 18 Oct 2018 00:39:15 +0000 (17:39 -0700)

list-objects: support for skipping tree traversal

The tree:0 filter does not need to traverse the trees that it has
filtered out, so optimize list-objects and list-objects-filter to skip
traversing the trees entirely. Before this patch, we iterated over all
children of the tree, and did nothing for all of them, which was
wasteful.

Signed-off-by: Matthew DeVore <matvore@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

test-tool: show tool list on errorJeff King Wed, 17 Oct 2018 09:25:07 +0000 (05:25 -0400)

test-tool: show tool list on error

Before we switched to one big test-tool binary, if you
forgot the name of a tool, you could use tab-completion in
the shell to get a hint. But these days, all you get is:

$ t/helper/test-tool approxidate
fatal: There is no test named 'approxidate'

and you're stuck reading the source code to find it. Let's
print a list of the available tools in this case.

Signed-off-by: Jeff King <peff@peff.net>
Reviewed-by: Derrick Stolee <dstolee@microsoft.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

doc: fix small typo in git show-branchSaulius Gurklys Wed, 17 Oct 2018 05:37:41 +0000 (08:37 +0300)

doc: fix small typo in git show-branch

Fix small typo as in document <glob> is used not <globs>.

Signed-off-by: Saulius Gurklys <s4uliu5@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

builtin/submodule--helper: remove debugging leftover... Stefan Beller Tue, 16 Oct 2018 23:45:50 +0000 (16:45 -0700)

builtin/submodule--helper: remove debugging leftover tracing

I noticed 74d4731da1 (submodule--helper: replace connect-gitdir-workingtree
by ensure-core-worktree, 2018-08-13) had two leftover debugging statements
when reading The coverage report [1]. Remove them.

https://public-inbox.org/git/e30a9c05-87d8-1f2b-182c-6d6a5fefe43c@gmail.com/

Signed-off-by: Stefan Beller <sbeller@google.com>
Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

branch: trivial style fixTao Qingyun Tue, 16 Oct 2018 14:19:20 +0000 (22:19 +0800)

branch: trivial style fix

Signed-off-by: Tao Qingyun <taoqy@ls-a.me>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

submodule helper: convert relative URL to absolute... Stefan Beller Tue, 16 Oct 2018 17:27:03 +0000 (10:27 -0700)

submodule helper: convert relative URL to absolute URL if needed

The submodule helper update_clone called by "git submodule update",
clones submodules if needed. As submodules used to have the URL indicating
if they were active, the step to resolve relative URLs was done in the
"submodule init" step. Nowadays submodules can be configured active without
calling an explicit init, e.g. via configuring submodule.active.

When trying to obtain submodules that are set active this way, we'll
fallback to the URL found in the .gitmodules, which may be relative to the
superproject, but we do not resolve it, yet:

git clone https://gerrit.googlesource.com/gerrit
cd gerrit && grep url .gitmodules
url = ../plugins/codemirror-editor
...
git config submodule.active .
git submodule update
fatal: repository '../plugins/codemirror-editor' does not exist
fatal: clone of '../plugins/codemirror-editor' into submodule path '/tmp/gerrit/plugins/codemirror-editor' failed
Failed to clone 'plugins/codemirror-editor'. Retry scheduled
[...]
fatal: clone of '../plugins/codemirror-editor' into submodule path '/tmp/gerrit/plugins/codemirror-editor' failed
Failed to clone 'plugins/codemirror-editor' a second time, aborting
[...]

To resolve the issue, factor out the function that resolves the relative
URLs in "git submodule init" (in the submodule helper in the init_submodule
function) and call it at the appropriate place in the update_clone helper.

Reported-by: Jaewoong Jung <jungjw@google.com>
Signed-off-by: Stefan Beller <sbeller@google.com>
Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>