gitweb.git
Merge branch 'bp/fsmonitor'Junio C Hamano Tue, 21 Nov 2017 05:07:50 +0000 (14:07 +0900)

Merge branch 'bp/fsmonitor'

We learned to talk to watchman to speed up "git status" and other
operations that need to see which paths have been modified.

* bp/fsmonitor:
fsmonitor: preserve utf8 filenames in fsmonitor-watchman log
fsmonitor: read entirety of watchman output
fsmonitor: MINGW support for watchman integration
fsmonitor: add a performance test
fsmonitor: add a sample integration script for Watchman
fsmonitor: add test cases for fsmonitor extension
split-index: disable the fsmonitor extension when running the split index test
fsmonitor: add a test tool to dump the index extension
update-index: add fsmonitor support to update-index
ls-files: Add support in ls-files to display the fsmonitor valid bit
fsmonitor: add documentation for the fsmonitor extension.
fsmonitor: teach git to optionally utilize a file system monitor to speed up detecting new or changed files.
update-index: add a new --force-write-index option
preload-index: add override to enable testing preload-index
bswap: add 64 bit endianness helper get_be64

Almost ready for 2.15.1Junio C Hamano Tue, 21 Nov 2017 05:07:08 +0000 (14:07 +0900)

Almost ready for 2.15.1

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

Merge branch 'rs/sequencer-rewrite-file-cleanup' into... Junio C Hamano Tue, 21 Nov 2017 05:05:33 +0000 (14:05 +0900)

Merge branch 'rs/sequencer-rewrite-file-cleanup' into maint

Code cleanup.

* rs/sequencer-rewrite-file-cleanup:
sequencer.c: check return value of close() in rewrite_file()
sequencer: use O_TRUNC to truncate files
sequencer: factor out rewrite_file()

Merge branch 'cb/t4201-robustify' into maintJunio C Hamano Tue, 21 Nov 2017 05:05:33 +0000 (14:05 +0900)

Merge branch 'cb/t4201-robustify' into maint

A test update.

* cb/t4201-robustify:
t4201: make use of abbreviation in the test more robust

Merge branch 'tz/fsf-address-update' into maintJunio C Hamano Tue, 21 Nov 2017 05:05:32 +0000 (14:05 +0900)

Merge branch 'tz/fsf-address-update' into maint

Replace the mailing address of FSF to a URL, as FSF prefers.

* tz/fsf-address-update:
Replace Free Software Foundation address in license notices
Replace Free Software Foundation address in license notices

Merge branch 'ad/rebase-i-serie-typofix' into maintJunio C Hamano Tue, 21 Nov 2017 05:05:32 +0000 (14:05 +0900)

Merge branch 'ad/rebase-i-serie-typofix' into maint

Typofix.

* ad/rebase-i-serie-typofix:
rebase -i: fix comment typo

Merge branch 'jk/info-alternates-fix' into maintJunio C Hamano Tue, 21 Nov 2017 05:05:31 +0000 (14:05 +0900)

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

We used to add an empty alternate object database to the system
that does not help anything; it has been corrected.

* jk/info-alternates-fix:
link_alt_odb_entries: make empty input a noop

Merge branch 'ab/pcre-v2' into maintJunio C Hamano Tue, 21 Nov 2017 05:05:30 +0000 (14:05 +0900)

Merge branch 'ab/pcre-v2' into maint

Building with NO_LIBPCRE1_JIT did not disable it, which has been fixed.

* ab/pcre-v2:
grep: fix NO_LIBPCRE1_JIT to fully disable JIT

Merge branch 'sr/wrapper-quote-filenames' into maintJunio C Hamano Tue, 21 Nov 2017 05:05:29 +0000 (14:05 +0900)

Merge branch 'sr/wrapper-quote-filenames' into maint

Some error messages did not quote filenames shown in it, which have
been fixed.

* sr/wrapper-quote-filenames:
wrapper.c: consistently quote filenames in error messages

Merge branch 'bw/rebase-i-ignored-submodule-fix' into... Junio C Hamano Tue, 21 Nov 2017 05:05:29 +0000 (14:05 +0900)

Merge branch 'bw/rebase-i-ignored-submodule-fix' into maint

"git rebase -i" recently started misbehaving when a submodule that
is configured with 'submodule.<name>.ignore' is dirty; this has
been corrected.

* bw/rebase-i-ignored-submodule-fix:
wt-status: actually ignore submodules when requested

connect: correct style of C-style commentJonathan Nieder Mon, 20 Nov 2017 22:04:58 +0000 (14:04 -0800)

connect: correct style of C-style comment

Documentation/CodingGuidelines explains:

- Multi-line comments include their delimiters on separate lines from
the text. E.g.

/*
* A very long
* multi-line comment.
*/

Reported-by: Brandon Williams <bmwill@google.com>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

ssh: 'simple' variant does not support --portJonathan Nieder Mon, 20 Nov 2017 21:31:01 +0000 (13:31 -0800)

ssh: 'simple' variant does not support --port

When trying to connect to an ssh:// URL with port explicitly specified
and the ssh command configured with GIT_SSH does not support such a
setting, it is less confusing to error out than to silently suppress
the port setting and continue.

This requires updating the GIT_SSH setting in t5603-clone-dirname.sh.
That test is about the directory name produced when cloning various
URLs. It uses an ssh wrapper that ignores all its arguments but does
not declare that it supports a port argument; update it to set
GIT_SSH_VARIANT=ssh to do so. (Real-life ssh wrappers that pass a
port argument to OpenSSH would also support -G and would not require
such an update.)

Reported-by: William Yan <wyan@google.com>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Acked-by: Stefan Beller <sbeller@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

ssh: 'simple' variant does not support -4/-6Jonathan Nieder Mon, 20 Nov 2017 21:30:30 +0000 (13:30 -0800)

ssh: 'simple' variant does not support -4/-6

If the user passes -4/--ipv4 or -6/--ipv6 to "git fetch" or "git push"
and the ssh command configured with GIT_SSH does not support such a
setting, error out instead of ignoring the option and continuing.

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

ssh: 'auto' variant to select between 'ssh' and 'simple'Jonathan Nieder Mon, 20 Nov 2017 21:30:04 +0000 (13:30 -0800)

ssh: 'auto' variant to select between 'ssh' and 'simple'

Android's "repo" tool is a tool for managing a large codebase
consisting of multiple smaller repositories, similar to Git's
submodule feature. Starting with Git 94b8ae5a (ssh: introduce a
'simple' ssh variant, 2017-10-16), users noticed that it stopped
handling the port in ssh:// URLs.

The cause: when it encounters ssh:// URLs, repo pre-connects to the
server and sets GIT_SSH to a helper ".repo/repo/git_ssh" that reuses
that connection. Before 94b8ae5a, the helper was assumed to support
OpenSSH options for lack of a better guess and got passed a -p option
to set the port. After that patch, it uses the new default of a
simple helper that does not accept an option to set the port.

The next release of "repo" will set GIT_SSH_VARIANT to "ssh" to avoid
that. But users of old versions and of other similar GIT_SSH
implementations would not get the benefit of that fix.

So update the default to use OpenSSH options again, with a twist. As
observed in 94b8ae5a, we cannot assume that $GIT_SSH always handles
OpenSSH options: common helpers such as travis-ci's dpl[*] are
configured using GIT_SSH and do not accept OpenSSH options. So make
the default a new variant "auto", with the following behavior:

1. First, check for a recognized basename, like today.

2. If the basename is not recognized, check whether $GIT_SSH supports
OpenSSH options by running

$GIT_SSH -G <options> <host>

This returns status 0 and prints configuration in OpenSSH if it
recognizes all <options> and returns status 255 if it encounters
an unrecognized option. A wrapper script like

exec ssh -- "$@"

would fail with

ssh: Could not resolve hostname -g: Name or service not known

, correctly reflecting that it does not support OpenSSH options.
The command is run with stdin, stdout, and stderr redirected to
/dev/null so even a command that expects a terminal would exit
immediately.

3. Based on the result from step (2), behave like "ssh" (if it
succeeded) or "simple" (if it failed).

This way, the default ssh variant for unrecognized commands can handle
both the repo and dpl cases as intended.

This autodetection has been running on Google workstations since
2017-10-23 with no reported negative effects.

[*] https://github.com/travis-ci/dpl/blob/6c3fddfda1f2a85944c544446b068bac0a77c049/lib/dpl/provider.rb#L215

Reported-by: William Yan <wyan@google.com>
Improved-by: Jonathan Tan <jonathantanmy@google.com>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

connect: split ssh option computation to its own functionJonathan Nieder Mon, 20 Nov 2017 21:26:19 +0000 (13:26 -0800)

connect: split ssh option computation to its own function

This puts the determination of options to pass to each ssh variant
(see ssh.variant in git-config(1)) in one place.

A follow-up patch will use this in an initial dry run to detect which
variant to use when the ssh command is ambiguous.

No functional change intended yet.

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

connect: split ssh command line options into separate... Jonathan Nieder Mon, 20 Nov 2017 22:19:43 +0000 (14:19 -0800)

connect: split ssh command line options into separate function

The git_connect function is growing long. Split the portion that
discovers an ssh command and options it accepts before the service
name and path to a separate function to make it easier to read.

No functional change intended.

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

connect: split git:// setup into a separate functionJonathan Nieder Mon, 20 Nov 2017 21:23:27 +0000 (13:23 -0800)

connect: split git:// setup into a separate function

The git_connect function is growing long. Split the
PROTO_GIT-specific portion to a separate function to make it easier to
read.

No functional change intended.

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

connect: move no_fork fallback to git_tcp_connectJonathan Nieder Mon, 20 Nov 2017 21:22:54 +0000 (13:22 -0800)

connect: move no_fork fallback to git_tcp_connect

git_connect has the structure

struct child_process *conn = &no_fork;

...
switch (protocol) {
case PROTO_GIT:
if (git_use_proxy(hostandport))
conn = git_proxy_connect(fd, hostandport);
else
git_tcp_connect(fd, hostandport, flags);
...
break;
case PROTO_SSH:
conn = xmalloc(sizeof(*conn));
child_process_init(conn);
argv_array_push(&conn->args, ssh);
...
break;
...
return conn;

In all cases except the git_tcp_connect case, conn is explicitly
assigned a value. Make the code clearer by explicitly assigning
'conn = &no_fork' in the tcp case and eliminating the default so the
compiler can ensure conn is always correctly assigned.

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

ssh test: make copy_ssh_wrapper_as clean up after itselfJonathan Nieder Tue, 21 Nov 2017 01:49:19 +0000 (17:49 -0800)

ssh test: make copy_ssh_wrapper_as clean up after itself

Simplify by not allowing the copied ssh wrapper to persist between
tests. This way, tests can be safely reordered, added, and removed
with less fear of hidden side effects.

This also avoids having to call setup_ssh_wrapper to restore the value
of GIT_SSH after this battery of tests, since it means each test will
restore it individually.

Noticed because on Windows, if `uplink.exe` exists, the MSYS2 Bash
will overwrite that when redirecting via `>uplink`. A proposed test
wrote a script to 'uplink' after a previous test created uplink.exe
using copy_ssh_wrapper_as, so the script written with '>uplink' had
the wrong filename and failed.

Reported-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Acked-by: Brandon Williams <bmwill@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

everything_local: use "quick" object existence checkJeff King Mon, 20 Nov 2017 20:29:21 +0000 (15:29 -0500)

everything_local: use "quick" object existence check

In b495697b82 (fetch-pack: avoid repeatedly re-scanning pack
directory, 2013-01-26), we noticed that everything_local()
could waste time trying to find and parse objects which we
_expect_ to be missing. The solution was to put
has_sha1_file() in front of parse_object() to skip the
more-expensive parse attempt.

That optimization was negated later when has_sha1_file()
learned to do the same re-scan in 45e8a74873 (has_sha1_file:
re-check pack directory before giving up, 2013-08-30).

We can restore it by using the "quick" flag to tell
has_sha1_file (actually has_object_file these days) that we
prefer speed to thoroughness for this call. See also the
fixes in 5827a0354 and 0eeb077be7 for prior art and
discussion on using the "quick" flag for these cases.

The recently-added performance regression test in p5551
demonstrates the problem. You can see the original fix:

Test b495697b82^ b495697b82
--------------------------------------------------------
5551.4: fetch 1.68(1.33+0.35) 0.87(0.69+0.18) -48.2%

and then the regression:

Test 45e8a74873^ 45e8a74873
---------------------------------------------------------
5551.4: fetch 0.96(0.77+0.19) 2.55(2.04+0.50) +165.6%

and now our fix:

Test HEAD^ HEAD
--------------------------------------------------------
5551.4: fetch 7.21(6.58+0.63) 5.47(5.04+0.43) -24.1%

You can also see that other things have gotten a lot slower
since 2013. We'll deal with those in separate patches.

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

p5551: add a script to test fetch pack-dir rescansJeff King Mon, 20 Nov 2017 20:28:28 +0000 (15:28 -0500)

p5551: add a script to test fetch pack-dir rescans

Since fetch often deals with object-ids we don't have (yet),
it's an easy mistake for it to use a function like
parse_object() that gives the correct result (e.g., NULL)
but does so very slowly (because after failing to find the
object, we re-scan the pack directory looking for new
packs).

The regular test suite won't catch this because the end
result is correct, but we would want to know about
performance regressions, too. Let's add a test to the
regression suite.

Note that this uses a synthetic repository that has a large
number of packs. That's not ideal, as it means we're not
testing what "normal" users see (in fact, some of these
problems have existed for ages without anybody noticing
simply because a rescan on a normal repository just isn't
that expensive).

So what we're really looking for here is the spike you'd
notice in a pathological case (a lot of unknown objects
coming into a repo with a lot of packs). If that's fast,
then the normal cases should be, too.

Note that the test also makes liberal use of $MODERN_GIT for
setup; some of these regressions go back a ways, and we
should be able to use it to find the problems there.

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

t/perf/lib-pack: use fast-import checkpoint to create... Jeff King Mon, 20 Nov 2017 20:27:19 +0000 (15:27 -0500)

t/perf/lib-pack: use fast-import checkpoint to create packs

We currently use fast-import only to create a large number
of objects, and then run O(n) invocations of pack-objects to
turn them into packs.

We can do this faster by just asking fast-import to
checkpoint and create a pack for each (after telling it
not to turn loose tiny packs).

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

p5550: factor out nonsense-pack creationJeff King Mon, 20 Nov 2017 20:26:43 +0000 (15:26 -0500)

p5550: factor out nonsense-pack creation

We have a function to create a bunch of irrelevant packs to
measure the expense of reprepare_packed_git(). Let's make
that available to other perf scripts.

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

git-jump: give contact instructions in the READMEJeff King Mon, 20 Nov 2017 19:18:46 +0000 (14:18 -0500)

git-jump: give contact instructions in the README

Let's make it clear how patches should flow into
contrib/git-jump. The normal Git maintainer does not
necessarily care about things in contrib/, and authors of
individual components should be the ones giving the final
review/ack for a patch. Ditto for bug reports, which are
likely to get more attention from the area expert.

Signed-off-by: Jeff King <peff@peff.net>
Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

contrib/git-jump: allow to configure the grep commandBeat Bolli Sun, 19 Nov 2017 23:05:36 +0000 (00:05 +0100)

contrib/git-jump: allow to configure the grep command

Add the configuration option "jump.grepCmd" that allows to configure the
command that is used to search in grep mode. This allows the users of
git-jump to use ag(1) or ack(1) as search engines.

Signed-off-by: Beat Bolli <dev+git@drbeat.li>
Reviewed-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

pull: pass -4/-6 option to 'git fetch'Shuyu Wei Sun, 19 Nov 2017 11:01:32 +0000 (19:01 +0800)

pull: pass -4/-6 option to 'git fetch'

The -4/-6 option should be passed through to 'git fetch' to be
consistent with the man page.

Signed-off-by: Wei Shuyu <wsy@dogben.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

grep: show non-empty lines before functions with -WRené Scharfe Sat, 18 Nov 2017 18:08:08 +0000 (19:08 +0100)

grep: show non-empty lines before functions with -W

Non-empty lines before a function definition are most likely comments
for that function and thus relevant. Include them in function context.

Such a non-empty line might also belong to the preceding function if
there is no separating blank line. Stop extending the context upwards
also at the next function line to make sure only one extra function body
is shown at most.

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

grep: update boundary variable for pre-contextRené Scharfe Sat, 18 Nov 2017 18:07:13 +0000 (19:07 +0100)

grep: update boundary variable for pre-context

Function context can be bigger than -A/-B/-C context. To find the
beginning of the combined context we search backwards. Currently we
check at each loop iteration what we're looking for and determine the
effective upper boundary based on that.

Simplify this a bit by setting the variable "from" to the lowest unshown
line number up front if we're looking for a function line and set it
back to the required -B/-C context line number when we find one. This
prepares the ground for the next patch; no functional change intended.

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

t7810: improve check of -W with user-defined function... René Scharfe Sat, 18 Nov 2017 18:06:16 +0000 (19:06 +0100)

t7810: improve check of -W with user-defined function lines

The check for function context (-W) together with user-defined function
line patterns reuses hello.c and pretends it's written in a language in
which function lines contain either "printf" or a trailing curly brace.
That's a bit obscure.

Make the test easier to read by adding a small PowerShell script, using
a simple, but meaningful expression, and separating out checks for
different aspects into dedicated tests instead of simply matching the
whole output byte for byte.

Also include a test for showing comments before function lines like git

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

xdiff: show non-empty lines before functions with -WRené Scharfe Sat, 18 Nov 2017 18:05:19 +0000 (19:05 +0100)

xdiff: show non-empty lines before functions with -W

Non-empty lines before a function definition are most likely comments
for that function and thus relevant. Include them in function context.

Such a non-empty line might also belong to the preceeding function if
there is no separating blank line. Stop extending the context upwards
also at the next function line to make sure only one extra function body
is shown at most.

Original-patch-by: Vegard Nossum <vegard.nossum@oracle.com>
Signed-off-by: Rene Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

xdiff: factor out is_func_rec()René Scharfe Sat, 18 Nov 2017 18:04:40 +0000 (19:04 +0100)

xdiff: factor out is_func_rec()

Add a helper for checking if a given record is a function line. It
frees callers from having to deal with the buffer arguments of
match_func_rec().

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

t4051: add test for comments preceding function linesRené Scharfe Sat, 18 Nov 2017 18:04:00 +0000 (19:04 +0100)

t4051: add test for comments preceding function lines

When showing function context it would be helpful to show comments
immediately before declarations, as they are most likely relevant.

Add a test for that, but without specifying the choice of lines too
rigidly in the test---we may want to stop before and not include
"/*" in the future, for example.

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

git-rebase: clean up dashed-usages in messagesKaartic Sivaraam Mon, 20 Nov 2017 15:26:52 +0000 (20:56 +0530)

git-rebase: clean up dashed-usages in messages

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

branch: change default of `pager.branch` to "on"Martin Ågren Sun, 19 Nov 2017 15:03:50 +0000 (16:03 +0100)

branch: change default of `pager.branch` to "on"

This is similar to ff1e72483 (tag: change default of `pager.tag` to
"on", 2017-08-02) and is safe now that we do not consider `pager.branch`
at all when we are not listing branches. This change will help with
listing many branches, but will not hurt users of `git branch
--edit-description` as it would have before the previous commit.

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

branch: respect `pager.branch` in list-mode onlyMartin Ågren Sun, 19 Nov 2017 15:03:49 +0000 (16:03 +0100)

branch: respect `pager.branch` in list-mode only

Similar to de121ffe5 (tag: respect `pager.tag` in list-mode only,
2017-08-02), use the DELAY_PAGER_CONFIG-mechanism to only respect
`pager.branch` when we are listing branches.

We have two possibilities of generalizing what that earlier commit made
to `git tag`. One is to interpret, e.g., --set-upstream-to as "it does
not use an editor, so we should page". Another, the one taken by this
commit, is to say "it does not list, so let's not page". That is in line
with the approach of the series on `pager.tag` and in particular the
wording in Documentation/git-tag.txt, which this commit reuses for
git-branch.txt.

This fixes the failing test added in the previous commit. Also adapt the
test for whether `git branch --set-upstream-to` respects `pager.branch`.

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

t7006: add tests for how git branch paginatesMartin Ågren Sun, 19 Nov 2017 15:03:48 +0000 (16:03 +0100)

t7006: add tests for how git branch paginates

The next couple of commits will change how `git branch` handles
`pager.branch`, similar to how de121ffe5 (tag: respect `pager.tag` in
list-mode only, 2017-08-02) and ff1e72483 (tag: change default of
`pager.tag` to "on", 2017-08-02) changed `git tag`.

Add tests in this area to make sure that we don't regress and so that
the upcoming commits can be made clearer by adapting the tests. Add some
tests for `--list` (implied), one for `--edit-description`, and one for
`--set-upstream-to` as a representative of "something other than the
first two".

In particular, use `test_expect_failure` to document that we currently
respect the pager-configuration with `--edit-description`. The current
behavior is buggy since the pager interferes with the editor and makes
the end result completely broken. See also b3ee740c8 (t7006: add tests
for how git tag paginates, 2017-08-02).

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

config: flip return value of write_section()René Scharfe Sat, 18 Nov 2017 10:20:04 +0000 (11:20 +0100)

config: flip return value of write_section()

d9bd4cbb9cc (config: flip return value of store_write_*()) made
write_section() follow the convention of write(2) to return -1 on error
and the number of written bytes on success. 3b48045c6c7 (Merge branch
'sd/branch-copy') changed it back to returning 0 on error and 1 on
success, but left its callers still checking for negative values.

Let write_section() follow the convention of write(2) again to meet the
expectations of its callers.

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

config: add --expiry-dateHaaris Mehmood Sat, 18 Nov 2017 02:27:27 +0000 (02:27 +0000)

config: add --expiry-date

Add --expiry-date as a data-type for config files when
'git config --get' is used. This will return any relative
or fixed dates from config files as timestamps.

This is useful for scripts (e.g. gc.reflogexpire) that work
with timestamps so that '2.weeks' can be converted to a format
acceptable by those scripts/functions.

Following the convention of git_config_pathname(), move
the helper function required for this feature from
builtin/reflog.c to builtin/config.c where other similar
functions exist (e.g. for --bool or --path), and match
the order of parameters with other functions (i.e. output
pointer as first parameter).

Signed-off-by: Haaris Mehmood <hsed@unimetic.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

rebase: use mboxrd format to avoid split errorsEric Wong Sat, 18 Nov 2017 01:01:16 +0000 (01:01 +0000)

rebase: use mboxrd format to avoid split errors

The mboxrd format allows the use of embedded "From " lines in
commit messages without being misinterpreted by mailsplit

Reported-by: Florian Weimer <fweimer@redhat.com>
Signed-off-by: Eric Wong <e@80x24.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

apply: update line lengths for --inaccurate-eofRené Scharfe Thu, 16 Nov 2017 18:50:31 +0000 (19:50 +0100)

apply: update line lengths for --inaccurate-eof

Some diff implementations don't report missing newlines at the end of
files. Applying such a patch can cause a newline character to be
added inadvertently. The option --inaccurate-eof of git apply can be
used to remove trailing newlines if needed.

apply_one_fragment() cuts it off from the buffers for preimage and
postimage. Before it does, it builds an array with the lengths of each
line for both. Make sure to update the length of the last line in
these line info structures as well to keep them consistent with their
respective buffer.

Without this fix the added test fails; git apply dies and reports:

fatal: BUG: caller miscounted postlen: asked 1, orig = 1, used = 2

That sanity check is only called if whitespace changes are ignored.

Reported-by: Mahmoud Al-Qudsi <mqudsi@neosmart.net>
Signed-off-by: Rene Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

completion: add '--copy' option to 'git branch'Todd Zullinger Thu, 16 Nov 2017 17:09:06 +0000 (12:09 -0500)

completion: add '--copy' option to 'git branch'

In 52d59cc645 (branch: add a --copy (-c) option to go with --move (-m),
2017-06-18), `git branch` learned a `--copy` option. Include it when
providing command completions.

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

add: introduce "--renormalize"Torsten Bögershausen Thu, 16 Nov 2017 16:38:28 +0000 (17:38 +0100)

add: introduce "--renormalize"

Make it safer to normalize the line endings in a repository.
Files that had been commited with CRLF will be commited with LF.

The old way to normalize a repo was like this:

# Make sure that there are not untracked files
$ echo "* text=auto" >.gitattributes
$ git read-tree --empty
$ git add .
$ git commit -m "Introduce end-of-line normalization"

The user must make sure that there are no untracked files,
otherwise they would have been added and tracked from now on.

The new "add --renormalize" does not add untracked files:

$ echo "* text=auto" >.gitattributes
$ git add --renormalize .
$ git commit -m "Introduce end-of-line normalization"

Note that "git add --renormalize <pathspec>" is the short form for
"git add -u --renormalize <pathspec>".

While at it, document that the same renormalization may be needed,
whenever a clean filter is added or changed.

Helped-By: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Torsten Bögershausen <tboegi@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

branch doc: remove --set-upstream from synopsisTodd Zullinger Thu, 16 Nov 2017 07:46:43 +0000 (02:46 -0500)

branch doc: remove --set-upstream from synopsis

Support for the --set-upstream option was removed in 52668846ea
(builtin/branch: stop supporting the "--set-upstream" option,
2017-08-17), after a long deprecation period.

Remove the option from the command synopsis for consistency. Replace
another reference to it in the description of `--delete` with
`--set-upstream-to`.

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

sequencer: reschedule pick if index can't be lockedPhillip Wood Wed, 15 Nov 2017 10:41:25 +0000 (10:41 +0000)

sequencer: reschedule pick if index can't be locked

If the index cannot be locked in do_recursive_merge(), issue an
error message and go on to the error recovery codepath, instead of
dying. When the commit cannot be picked, it needs to be rescheduled
when performing an interactive rebase, but just dying there won't
allow that to happen, and when the user runs 'git rebase --continue'
rather than 'git rebase --abort', the commit gets silently dropped.

Signed-off-by: Phillip Wood <phillip.wood@dunelm.org.uk>

config: avoid "write_in_full(fd, buf, len) != len"... Phillip Wood Wed, 15 Nov 2017 12:40:43 +0000 (12:40 +0000)

config: avoid "write_in_full(fd, buf, len) != len" pattern

As explained in commit 06f46f237 (avoid "write_in_full(fd, buf, len)
!= len" pattern, 2017–09–13) the return value of write_in_full() is
either -1 or the requested number of bytes. As such comparing the
return value to an unsigned value such as strbuf.len will fail to
catch errors. Change the code to use the preferred '< 0' check.

Signed-off-by: Phillip Wood <phillip.wood@dunelm.org.uk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

merge-recursive: handle addition of submodule on our... Elijah Newren Tue, 14 Nov 2017 17:31:24 +0000 (09:31 -0800)

merge-recursive: handle addition of submodule on our side of history

The code for a newly added path assumed that the path was a normal file,
and thus checked for there being a directory still being in the way of
the file. Note that since unpack_trees() does path-in-the-way checks
already, the only way for there to be a directory in the way at this
point in the code, is if there is some kind of D/F conflict in the merge.

For a submodule addition on HEAD's side of history, the submodule would
have already been present. This means that we do expect there to be a
directory present but should not consider it to be "in the way"; instead,
it's the expected submodule. So, when there's a submodule addition from
HEAD's side, don't bother checking the working copy for a directory in
the way.

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

Sync with maintJunio C Hamano Wed, 15 Nov 2017 03:17:43 +0000 (12:17 +0900)

Sync with maint

RelNotes: the fourth batch for 2.16Junio C Hamano Wed, 15 Nov 2017 03:17:08 +0000 (12:17 +0900)

RelNotes: the fourth batch for 2.16

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

Merge branch 'bp/read-index-from-skip-verification'Junio C Hamano Wed, 15 Nov 2017 03:14:37 +0000 (12:14 +0900)

Merge branch 'bp/read-index-from-skip-verification'

Drop (perhaps overly cautious) sanity check before using the index
read from the filesystem at runtime.

* bp/read-index-from-skip-verification:
read_index_from(): speed index loading by skipping verification of the entry order

Merge branch 'bc/submitting-patches-in-asciidoc'Junio C Hamano Wed, 15 Nov 2017 03:14:36 +0000 (12:14 +0900)

Merge branch 'bc/submitting-patches-in-asciidoc'

The SubmittingPatches document has been converted to produce an
HTML version via AsciiDoc/Asciidoctor.

* bc/submitting-patches-in-asciidoc:
Documentation: convert SubmittingPatches to AsciiDoc
Documentation: enable compat-mode for Asciidoctor

Merge branch 'sb/bisect-run-empty'Junio C Hamano Wed, 15 Nov 2017 03:14:36 +0000 (12:14 +0900)

Merge branch 'sb/bisect-run-empty'

"git bisect run" that did not specify any command to run used to go
ahead and treated all commits to be tested as 'good'. This has
been corrected by making the command error out.

* sb/bisect-run-empty:
bisect run: die if no command is given

Merge branch 'rd/bisect-view-is-visualize'Junio C Hamano Wed, 15 Nov 2017 03:14:36 +0000 (12:14 +0900)

Merge branch 'rd/bisect-view-is-visualize'

Doc and message updates to teach users "bisect view" is a synonym
for "bisect visualize".

* rd/bisect-view-is-visualize:
bisect: mention "view" as an alternative to "visualize"

Merge branch 'jk/info-alternates-fix'Junio C Hamano Wed, 15 Nov 2017 03:14:36 +0000 (12:14 +0900)

Merge branch 'jk/info-alternates-fix'

We used to add an empty alternate object database to the system
that does not help anything; it has been corrected.

* jk/info-alternates-fix:
link_alt_odb_entries: make empty input a noop

Merge branch 'cb/t4201-robustify'Junio C Hamano Wed, 15 Nov 2017 03:14:35 +0000 (12:14 +0900)

Merge branch 'cb/t4201-robustify'

A test update.

* cb/t4201-robustify:
t4201: make use of abbreviation in the test more robust

Merge branch 'ab/pcre-v2'Junio C Hamano Wed, 15 Nov 2017 03:14:34 +0000 (12:14 +0900)

Merge branch 'ab/pcre-v2'

Building with NO_LIBPCRE1_JIT did not disable it, which has been fixed.

* ab/pcre-v2:
grep: fix NO_LIBPCRE1_JIT to fully disable JIT

Merge branch 'tz/fsf-address-update'Junio C Hamano Wed, 15 Nov 2017 03:14:33 +0000 (12:14 +0900)

Merge branch 'tz/fsf-address-update'

* tz/fsf-address-update:
Replace Free Software Foundation address in license notices
Replace Free Software Foundation address in license notices

Merge branch 'ad/rebase-i-serie-typofix'Junio C Hamano Wed, 15 Nov 2017 03:14:33 +0000 (12:14 +0900)

Merge branch 'ad/rebase-i-serie-typofix'

* ad/rebase-i-serie-typofix:
rebase -i: fix comment typo

Merge branch 'ab/mediawiki-namespace'Junio C Hamano Wed, 15 Nov 2017 03:14:32 +0000 (12:14 +0900)

Merge branch 'ab/mediawiki-namespace'

The remote-helper for talking to MediaWiki has been updated to
work with mediawiki namespaces.

* ab/mediawiki-namespace:
remote-mediawiki: show progress while fetching namespaces
remote-mediawiki: process namespaces in order
remote-mediawiki: support fetching from (Main) namespace
remote-mediawiki: skip virtual namespaces
remote-mediawiki: show known namespace choices on failure
remote-mediawiki: allow fetching namespaces with spaces
remote-mediawiki: add namespace support

Merge branch 'ma/reduce-heads-leakfix'Junio C Hamano Wed, 15 Nov 2017 03:14:32 +0000 (12:14 +0900)

Merge branch 'ma/reduce-heads-leakfix'

Leak fixes.

* ma/reduce-heads-leakfix:
reduce_heads: fix memory leaks
builtin/merge-base: free commit lists

Merge branch 'js/for-each-ref-remote-name-and-ref'Junio C Hamano Wed, 15 Nov 2017 03:14:32 +0000 (12:14 +0900)

Merge branch 'js/for-each-ref-remote-name-and-ref'

The "--format=..." option "git for-each-ref" takes learned to show
the name of the 'remote' repository and the ref at the remote side
that is affected for 'upstream' and 'push' via "%(push:remotename)"
and friends.

* js/for-each-ref-remote-name-and-ref:
for-each-ref: test :remotename and :remoteref
for-each-ref: let upstream/push report the remote ref name
for-each-ref: let upstream/push optionally report the remote name

Merge branch 'jt/submodule-tests-cleanup'Junio C Hamano Wed, 15 Nov 2017 03:14:31 +0000 (12:14 +0900)

Merge branch 'jt/submodule-tests-cleanup'

* jt/submodule-tests-cleanup:
Tests: clean up and document submodule helpers

Merge branch 'cc/git-packet-pm'Junio C Hamano Wed, 15 Nov 2017 03:14:31 +0000 (12:14 +0900)

Merge branch 'cc/git-packet-pm'

Parts of a test to drive the long-running content filter interface
has been split into its own module, hopefully to eventually become
reusable.

* cc/git-packet-pm:
Git/Packet.pm: extract parts of t0021/rot13-filter.pl for reuse
t0021/rot13-filter: add capability functions
t0021/rot13-filter: refactor checking final lf
t0021/rot13-filter: add packet_initialize()
t0021/rot13-filter: improve error message
t0021/rot13-filter: improve 'if .. elsif .. else' style
t0021/rot13-filter: refactor packet reading functions
t0021/rot13-filter: fix list comparison

Merge branch 'bw/rebase-i-ignored-submodule-fix'Junio C Hamano Wed, 15 Nov 2017 03:14:30 +0000 (12:14 +0900)

Merge branch 'bw/rebase-i-ignored-submodule-fix'

"git rebase -i" recently started misbehaving when a submodule that
is configured with 'submodule.<name>.ignore' is dirty; this has
been corrected.

* bw/rebase-i-ignored-submodule-fix:
wt-status: actually ignore submodules when requested

Merge branch 'mh/tidy-ref-update-flags'Junio C Hamano Wed, 15 Nov 2017 03:14:29 +0000 (12:14 +0900)

Merge branch 'mh/tidy-ref-update-flags'

Code clean-up in refs API implementation.

* mh/tidy-ref-update-flags:
refs: update some more docs to use "oid" rather than "sha1"
write_packed_entry(): take `object_id` arguments
refs: rename constant `REF_ISPRUNING` to `REF_IS_PRUNING`
refs: rename constant `REF_NODEREF` to `REF_NO_DEREF`
refs: tidy up and adjust visibility of the `ref_update` flags
ref_transaction_add_update(): remove a check
ref_transaction_update(): die on disallowed flags
prune_ref(): call `ref_transaction_add_update()` directly
files_transaction_prepare(): don't leak flags to packed transaction

Merge branch 'sr/wrapper-quote-filenames'Junio C Hamano Wed, 15 Nov 2017 03:14:29 +0000 (12:14 +0900)

Merge branch 'sr/wrapper-quote-filenames'

Some error messages did not quote filenames shown in it, which have
been fixed.

* sr/wrapper-quote-filenames:
wrapper.c: consistently quote filenames in error messages

Merge branch 'ma/bisect-leakfix'Junio C Hamano Wed, 15 Nov 2017 03:14:28 +0000 (12:14 +0900)

Merge branch 'ma/bisect-leakfix'

Leak fixes.

* ma/bisect-leakfix:
bisect: fix memory leak when returning best element
bisect: fix off-by-one error in `best_bisection_sorted()`
bisect: fix memory leak in `find_bisection()`
bisect: change calling-convention of `find_bisection()`

Merge branch 'rs/sequencer-rewrite-file-cleanup'Junio C Hamano Wed, 15 Nov 2017 03:14:28 +0000 (12:14 +0900)

Merge branch 'rs/sequencer-rewrite-file-cleanup'

Code cleanup.

* rs/sequencer-rewrite-file-cleanup:
sequencer.c: check return value of close() in rewrite_file()
sequencer: use O_TRUNC to truncate files
sequencer: factor out rewrite_file()

Merge branch 'ao/merge-verbosity-getenv-just-once'Junio C Hamano Wed, 15 Nov 2017 03:14:28 +0000 (12:14 +0900)

Merge branch 'ao/merge-verbosity-getenv-just-once'

Code cleanup.

* ao/merge-verbosity-getenv-just-once:
merge-recursive: check GIT_MERGE_VERBOSITY only once

Merge branch 'mh/avoid-rewriting-packed-refs'Junio C Hamano Wed, 15 Nov 2017 03:14:27 +0000 (12:14 +0900)

Merge branch 'mh/avoid-rewriting-packed-refs'

Recent update to the refs infrastructure implementation started
rewriting packed-refs file more often than before; this has been
optimized again for most trivial cases.

* mh/avoid-rewriting-packed-refs:
files-backend: don't rewrite the `packed-refs` file unnecessarily
t1409: check that `packed-refs` is not rewritten unnecessarily

Merge branch 'rs/imap-send-next-arg-fix'Junio C Hamano Wed, 15 Nov 2017 03:14:26 +0000 (12:14 +0900)

Merge branch 'rs/imap-send-next-arg-fix'

Error checking in "git imap-send" for empty response has been
improved.

* rs/imap-send-next-arg-fix:
imap-send: handle missing response codes gracefully
imap-send: handle NULL return of next_arg()

Merge branch 'ab/mediawiki-name-truncation'Junio C Hamano Wed, 15 Nov 2017 03:14:25 +0000 (12:14 +0900)

Merge branch 'ab/mediawiki-name-truncation'

The remote-helper for talking to MediaWiki has been updated to
truncate an overlong pagename so that ".mw" suffix can still be
added.

* ab/mediawiki-name-truncation:
remote-mediawiki: limit filenames to legal

Start preparation for 2.15.1Junio C Hamano Wed, 15 Nov 2017 03:04:22 +0000 (12:04 +0900)

Start preparation for 2.15.1

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

Merge branch 'ks/mailmap' into maintJunio C Hamano Wed, 15 Nov 2017 03:05:04 +0000 (12:05 +0900)

Merge branch 'ks/mailmap' into maint

* ks/mailmap:
mailmap: use Kaartic Sivaraam's new address

Merge branch 'jm/relnotes-2.15-typofix' into maintJunio C Hamano Wed, 15 Nov 2017 03:05:04 +0000 (12:05 +0900)

Merge branch 'jm/relnotes-2.15-typofix' into maint

Typofix.

* jm/relnotes-2.15-typofix:
fix typos in 2.15.0 release notes

Merge branch 'cn/diff-indent-no-longer-is-experimental... Junio C Hamano Wed, 15 Nov 2017 03:05:04 +0000 (12:05 +0900)

Merge branch 'cn/diff-indent-no-longer-is-experimental' into maint

Doc update.

* cn/diff-indent-no-longer-is-experimental:
diff: --indent-heuristic is no longer experimental

Merge branch 'js/mingw-redirect-std-handles' into maintJunio C Hamano Wed, 15 Nov 2017 03:05:03 +0000 (12:05 +0900)

Merge branch 'js/mingw-redirect-std-handles' into maint

MinGW updates.

* js/mingw-redirect-std-handles:
mingw: document the standard handle redirection
mingw: optionally redirect stderr/stdout via the same handle
mingw: add experimental feature to redirect standard handles

Merge branch 'js/wincred-empty-cred' into maintJunio C Hamano Wed, 15 Nov 2017 03:05:03 +0000 (12:05 +0900)

Merge branch 'js/wincred-empty-cred' into maint

MinGW updates.

* js/wincred-empty-cred:
wincred: handle empty username/password correctly
t0302: check helper can handle empty credentials

Merge branch 'js/mingw-full-version-in-resources' into... Junio C Hamano Wed, 15 Nov 2017 03:05:03 +0000 (12:05 +0900)

Merge branch 'js/mingw-full-version-in-resources' into maint

MinGW updates.

* js/mingw-full-version-in-resources:
mingw: include the full version information in the resources

Merge branch 'dk/libsecret-unlock-to-load-fix' into... Junio C Hamano Wed, 15 Nov 2017 03:05:02 +0000 (12:05 +0900)

Merge branch 'dk/libsecret-unlock-to-load-fix' into maint

The credential helper for libsecret (in contrib/) has been improved
to allow possibly prompting the end user to unlock secrets that are
currently locked (otherwise the secrets may not be loaded).

* dk/libsecret-unlock-to-load-fix:
credential-libsecret: unlock locked secrets

Merge branch 'js/early-config' into maintJunio C Hamano Wed, 15 Nov 2017 03:05:01 +0000 (12:05 +0900)

Merge branch 'js/early-config' into maint

Correct start-up sequence so that a repository could be placed
immediately under the root directory again (which was broken at
around Git 2.13).

* js/early-config:
setup: avoid double slashes when looking for HEAD

Merge branch 'ad/5580-unc-tests-on-cygwin' into maintJunio C Hamano Wed, 15 Nov 2017 03:05:00 +0000 (12:05 +0900)

Merge branch 'ad/5580-unc-tests-on-cygwin' into maint

UNC paths are also relevant in Cygwin builds and they are now
tested just like Mingw builds.

* ad/5580-unc-tests-on-cygwin:
t5580: add Cygwin support

Merge branch 'ao/diff-populate-filespec-lstat-errorpath... Junio C Hamano Wed, 15 Nov 2017 03:04:59 +0000 (12:04 +0900)

Merge branch 'ao/diff-populate-filespec-lstat-errorpath-fix' into maint

After an error from lstat(), diff_populate_filespec() function
sometimes still went ahead and used invalid data in struct stat,
which has been fixed.

* ao/diff-populate-filespec-lstat-errorpath-fix:
diff: fix lstat() error handling in diff_populate_filespec()

Merge branch 'sb/blame-config-doc' into maintJunio C Hamano Wed, 15 Nov 2017 03:04:59 +0000 (12:04 +0900)

Merge branch 'sb/blame-config-doc' into maint

Description of blame.{showroot,blankboundary,showemail,date}
configuration variables have been added to "git config --help".

* sb/blame-config-doc:
config: document blame configuration

Merge branch 'tb/complete-checkout' into maintJunio C Hamano Wed, 15 Nov 2017 03:04:58 +0000 (12:04 +0900)

Merge branch 'tb/complete-checkout' into maint

Command line completion (in contrib/) update.

* tb/complete-checkout:
completion: add remaining flags to checkout

Merge branch 'jc/check-ref-format-oor' into maintJunio C Hamano Wed, 15 Nov 2017 03:04:57 +0000 (12:04 +0900)

Merge branch 'jc/check-ref-format-oor' into maint

"git check-ref-format --branch @{-1}" bit a "BUG()" when run
outside a repository for obvious reasons; clarify the documentation
and make sure we do not even try to expand the at-mark magic in
such a case, but still call the validation logic for branch names.

* jc/check-ref-format-oor:
check-ref-format doc: --branch validates and expands <branch>
check-ref-format --branch: strip refs/heads/ using skip_prefix
check-ref-format --branch: do not expand @{...} outside repository

Merge branch 'jc/t5601-copy-workaround' into maintJunio C Hamano Wed, 15 Nov 2017 03:04:56 +0000 (12:04 +0900)

Merge branch 'jc/t5601-copy-workaround' into maint

A (possibly flakey) test fix.

* jc/t5601-copy-workaround:
t5601: rm the target file of cp that could still be executing

Merge branch 'jk/rebase-i-exec-gitdir-fix' into maintJunio C Hamano Wed, 15 Nov 2017 03:04:56 +0000 (12:04 +0900)

Merge branch 'jk/rebase-i-exec-gitdir-fix' into maint

A recent regression in "git rebase -i" that broke execution of git
commands from subdirectories via "exec" insn has been fixed.

* jk/rebase-i-exec-gitdir-fix:
sequencer: pass absolute GIT_DIR to exec commands

Merge branch 'bw/grep-recurse-submodules' into maintJunio C Hamano Wed, 15 Nov 2017 03:04:55 +0000 (12:04 +0900)

Merge branch 'bw/grep-recurse-submodules' into maint

A broken access to object databases in recent update to "git grep
--recurse-submodules" has been fixed.

* bw/grep-recurse-submodules:
grep: take the read-lock when adding a submodule

Merge branch 'js/submodule-in-excluded' into maintJunio C Hamano Wed, 15 Nov 2017 03:04:54 +0000 (12:04 +0900)

Merge branch 'js/submodule-in-excluded' into maint

"git status --ignored -u" did not stop at a working tree of a
separate project that is embedded in an ignored directory and
listed files in that other project, instead of just showing the
directory itself as ignored.

* js/submodule-in-excluded:
status: do not get confused by submodules in excluded directories

Merge branch 'ao/check-resolve-ref-unsafe-result' into... Junio C Hamano Wed, 15 Nov 2017 03:04:53 +0000 (12:04 +0900)

Merge branch 'ao/check-resolve-ref-unsafe-result' into maint

"git commit", after making a commit, did not check for errors when
asking on what branch it made the commit, which has been correted.

* ao/check-resolve-ref-unsafe-result:
commit: check result of resolve_ref_unsafe

Merge branch 'jk/misc-resolve-ref-unsafe-fixes' into... Junio C Hamano Wed, 15 Nov 2017 03:04:52 +0000 (12:04 +0900)

Merge branch 'jk/misc-resolve-ref-unsafe-fixes' into maint

Some codepaths did not check for errors when asking what branch the
HEAD points at, which have been fixed.

* jk/misc-resolve-ref-unsafe-fixes:
worktree: handle broken symrefs in find_shared_symref()
log: handle broken HEAD in decoration check
remote: handle broken symrefs
test-ref-store: avoid passing NULL to printf

Merge branch 'sb/diff-color-moved-use-xdl-recmatch... Junio C Hamano Wed, 15 Nov 2017 03:04:52 +0000 (12:04 +0900)

Merge branch 'sb/diff-color-moved-use-xdl-recmatch' into maint

Instead of using custom line comparison and hashing functions to
implement "moved lines" coloring in the diff output, use the pair
of these functions from lower-layer xdiff/ code.

* sb/diff-color-moved-use-xdl-recmatch:
diff.c: get rid of duplicate implementation
xdiff-interface: export comparing and hashing strings

Merge branch 'jk/diff-color-moved-fix' into maintJunio C Hamano Wed, 15 Nov 2017 03:04:51 +0000 (12:04 +0900)

Merge branch 'jk/diff-color-moved-fix' into maint

The experimental "color moved lines differently in diff output"
feature was buggy around "ignore whitespace changes" edges, whihch
has been corrected.

* jk/diff-color-moved-fix:
diff: handle NULs in get_string_hash()
diff: fix whitespace-skipping with --color-moved
t4015: test the output of "diff --color-moved -b"
t4015: check "negative" case for "-w --color-moved"
t4015: refactor --color-moved whitespace test

Merge branch 'kd/auto-col-with-pager-fix' into maintJunio C Hamano Wed, 15 Nov 2017 03:04:50 +0000 (12:04 +0900)

Merge branch 'kd/auto-col-with-pager-fix' into maint

"auto" as a value for the columnar output configuration ought to
judge "is the output consumed by humans?" with the same criteria as
"auto" for coloured output configuration, i.e. either the standard
output stream is going to tty, or a pager is in use. We forgot the
latter, which has been fixed.

* kd/auto-col-with-pager-fix:
column: do not include pager.c
column: show auto columns when pager is active

Merge branch 'sg/travis-fixes' into maintJunio C Hamano Wed, 15 Nov 2017 03:04:49 +0000 (12:04 +0900)

Merge branch 'sg/travis-fixes' into maint

TravisCI build updates.

* sg/travis-fixes:
travis-ci: don't build Git for the static analysis job
travis-ci: fix running P4 and Git LFS tests in Linux build jobs

builtin/branch: remove redundant check for HEADKaartic Sivaraam Tue, 14 Nov 2017 11:42:59 +0000 (17:12 +0530)

builtin/branch: remove redundant check for HEAD

The lower level code has been made to handle this case for the
sake of consistency. This has made this check redundant.

So, remove the redundant check.

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

branch: correctly reject refs/heads/{-dash,HEAD}Junio C Hamano Tue, 14 Nov 2017 11:42:58 +0000 (17:12 +0530)

branch: correctly reject refs/heads/{-dash,HEAD}

strbuf_check_branch_ref() is the central place where many codepaths
see if a proposed name is suitable for the name of a branch. It was
designed to allow us to get stricter than the check_refname_format()
check used for refnames in general, and we already use it to reject
a branch whose name begins with a '-'. The function gets a strbuf
and a string "name", and returns non-zero if the name is not
appropriate as the name for a branch. When the name is good, it
places the full refname for the branch with the proposed name in the
strbuf before it returns.

However, it turns out that one caller looks at what is in the strbuf
even when the function returns an error. Make the function populate
the strbuf even when it returns an error. That way, when "-dash" is
given as name, "refs/heads/-dash" is placed in the strbuf when
returning an error to copy_or_rename_branch(), which notices that
the user is trying to recover with "git branch -m -- -dash dash" to
rename "-dash" to "dash".

While at it, use the same mechanism to also reject "HEAD" as a
branch name.

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

notes: send "Automatic notes merge failed" messages... Todd Zullinger Tue, 14 Nov 2017 16:17:52 +0000 (11:17 -0500)

notes: send "Automatic notes merge failed" messages to stderr

All other error messages from notes use stderr. Do the same when
alerting users of an unresolved notes merge.

Fix the output redirection in t3310 and t3320 as well. Previously, the
tests directed output to a file, but stderr was either not captured or
not sent to the file due to the order of the redirection operators.

Signed-off-by: Todd Zullinger <tmz@pobox.com>
Acked-by: Johan Herland <johan@herland.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

completion: add git config sendemail.tocmdRasmus Villemoes Mon, 13 Nov 2017 14:14:43 +0000 (15:14 +0100)

completion: add git config sendemail.tocmd

Signed-off-by: Rasmus Villemoes <rv@rasmusvillemoes.dk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Documentation/config: add sendemail.tocmd to list prece... Rasmus Villemoes Mon, 13 Nov 2017 14:14:42 +0000 (15:14 +0100)

Documentation/config: add sendemail.tocmd to list preceding "See git-send-email(1)"

Signed-off-by: Rasmus Villemoes <rv@rasmusvillemoes.dk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>