gitweb.git
Merge branch 'master' of git://github.com/alshopov... Jiang Xin Sat, 17 Mar 2018 03:24:53 +0000 (11:24 +0800)

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

* 'master' of git://github.com/alshopov/git-po:
l10n: bg.po: Updated Bulgarian translation (3376t)

l10n: vi.po(3376t): Updated Vietnamese translation... Tran Ngoc Quan Sat, 17 Mar 2018 00:53:33 +0000 (07:53 +0700)

l10n: vi.po(3376t): Updated Vietnamese translation for v2.17

Signed-off-by: Tran Ngoc Quan <vnwildman@gmail.com>

RelNotes: add details on Perl module changesTodd Zullinger Fri, 16 Mar 2018 22:07:48 +0000 (18:07 -0400)

RelNotes: add details on Perl module changes

Document changes to core and non-core Perl module handling in 2.17.

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

l10n: bg.po: Updated Bulgarian translation (3376t)Alexander Shopov Fri, 16 Mar 2018 08:55:13 +0000 (09:55 +0100)

l10n: bg.po: Updated Bulgarian translation (3376t)

Signed-off-by: Alexander Shopov <ash@kambanaria.org>

l10n: es.po: Update Spanish translation 2.17.0Christopher Diaz Riveros Fri, 16 Mar 2018 02:55:20 +0000 (21:55 -0500)

l10n: es.po: Update Spanish translation 2.17.0

Signed-off-by: Christopher Diaz Riveros <chrisadr@gentoo.org>

Merge remote-tracking branch 'git-po/maint'Jiang Xin Thu, 15 Mar 2018 23:36:32 +0000 (07:36 +0800)

Merge remote-tracking branch 'git-po/maint'

* git-po/maint:
l10n: es.po: fixes to Spanish translation

l10n: git.pot: v2.17.0 round 1 (132 new, 44 removed)Jiang Xin Thu, 15 Mar 2018 23:34:52 +0000 (07:34 +0800)

l10n: git.pot: v2.17.0 round 1 (132 new, 44 removed)

Generate po/git.pot from v2.17.0-rc0 for git v2.17.0 l10n round 1.

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

Git 2.17-rc0 v2.17.0-rc0Junio C Hamano Thu, 15 Mar 2018 22:01:05 +0000 (15:01 -0700)

Git 2.17-rc0

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

Merge branch 'tl/userdiff-csharp-async'Junio C Hamano Thu, 15 Mar 2018 22:00:47 +0000 (15:00 -0700)

Merge branch 'tl/userdiff-csharp-async'

Update funcname pattern used for C# to recognize "async" keyword.

* tl/userdiff-csharp-async:
userdiff.c: add C# async keyword in diff pattern

Merge branch 'sg/cvs-tests-with-x'Junio C Hamano Thu, 15 Mar 2018 22:00:46 +0000 (15:00 -0700)

Merge branch 'sg/cvs-tests-with-x'

Allow running a couple of tests with "sh -x".

* sg/cvs-tests-with-x:
t9402-git-cvsserver-refs: don't check the stderr of a subshell
t9400-git-cvsserver-server: don't rely on the output of 'test_cmp'

Merge branch 'ab/man-sec-list'Junio C Hamano Thu, 15 Mar 2018 22:00:46 +0000 (15:00 -0700)

Merge branch 'ab/man-sec-list'

Doc update.

* ab/man-sec-list:
git manpage: note git-security@googlegroups.com

Merge branch 'ab/perl-fixes'Junio C Hamano Thu, 15 Mar 2018 22:00:46 +0000 (15:00 -0700)

Merge branch 'ab/perl-fixes'

Clean-up to various pieces of Perl code we have.

* ab/perl-fixes:
perl Git::LoadCPAN: emit better errors under NO_PERL_CPAN_FALLBACKS
Makefile: add NO_PERL_CPAN_FALLBACKS knob
perl: move the perl/Git/FromCPAN tree to perl/FromCPAN
perl: generalize the Git::LoadCPAN facility
perl: move CPAN loader wrappers to another namespace
perl: update our copy of Mail::Address
perl: update our ancient copy of Error.pm
git-send-email: unconditionally use Net::{SMTP,Domain}
Git.pm: hard-depend on the File::{Temp,Spec} modules
gitweb: hard-depend on the Digest::MD5 5.8 module
Git.pm: add the "use warnings" pragma
Git.pm: remove redundant "use strict" from sub-package
perl: *.pm files should not have the executable bit

Merge branch 'cl/send-email-reply-to'Junio C Hamano Thu, 15 Mar 2018 22:00:45 +0000 (15:00 -0700)

Merge branch 'cl/send-email-reply-to'

"git send-email" learned "--reply-to=<address>" option.

* cl/send-email-reply-to:
send-email: support separate Reply-To address
send-email: rename variable for clarity

Merge branch 'np/send-email-header-parsing'Junio C Hamano Thu, 15 Mar 2018 22:00:45 +0000 (15:00 -0700)

Merge branch 'np/send-email-header-parsing'

Code refactoring.

* np/send-email-header-parsing:
send-email: extract email-parsing code into a subroutine

t/t3200: fix a typo in a test descriptionKaartic Sivaraam Sat, 10 Mar 2018 15:54:16 +0000 (21:24 +0530)

t/t3200: fix a typo in a test description

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

http: fix an unused variable warning for 'curl_no_proxy'Ramsay Jones Wed, 14 Mar 2018 21:56:06 +0000 (21:56 +0000)

http: fix an unused variable warning for 'curl_no_proxy'

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

Makefile: optionally symlink libexec/git-core binaries... Ævar Arnfjörð Bjarmason Tue, 13 Mar 2018 20:39:35 +0000 (20:39 +0000)

Makefile: optionally symlink libexec/git-core binaries to bin/git

Add a INSTALL_SYMLINKS option which if enabled, changes the default
hardlink installation method to one where the relevant binaries in
libexec/git-core are symlinked back to ../../bin, instead of being
hardlinked.

This new option also overrides the behavior of the existing
NO_*_HARDLINKS variables which in some cases would produce symlinks
within to libexec/, e.g. "git-add" symlinked to "git" which would be
copy of the "git" found in bin/, now "git-add" in libexec/ is always
going to be symlinked to the "git" found in the bin/ directory.

This option is being added because:

1) I think it makes what we're doing a lot more obvious. E.g. I'd
never noticed that the libexec binaries were really just hardlinks
since e.g. ls(1) won't show that in any obvious way. You need to
start stat(1)-ing things and look at the inodes to see what's
going on.

2) Some tools have very crappy support for hardlinks, e.g. the Git
shipped with GitLab is much bigger than it should be because
they're using a chef module that doesn't know about hardlinks, see
https://github.com/chef/omnibus/issues/827

I've also ran into other related issues that I think are explained
by this, e.g. compiling git with debugging and rpm refusing to
install a ~200MB git package with 2GB left on the FS, I think that
was because it doesn't consider hardlinks, just the sum of the
byte size of everything in the package.

As for the implementation, the "../../bin" noted above will vary given
some given some values of "../.." and "bin" depending on the depth of
the gitexecdir relative to the destdir, and the "bindir" target,
e.g. setting "bindir=/tmp/git/binaries gitexecdir=foo/bar/baz" will do
the right thing and produce this result:

$ file /tmp/git/foo/bar/baz/git-add
/tmp/git/foo/bar/baz/git-add: symbolic link to ../../../binaries/git

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

Makefile: add a gitexecdir_relative variableÆvar Arnfjörð Bjarmason Tue, 13 Mar 2018 20:39:34 +0000 (20:39 +0000)

Makefile: add a gitexecdir_relative variable

This variable will be e.g. "libexec/git-core" if
gitexecdir=/tmp/git/libexec/git-core is given. It'll be used by a
subsequent change.

This is stolen from the yet-to-be integrated (needs resubmission)
"Makefile: add Perl runtime prefix support" patch on the mailing
list. See
<20180108030239.92036-3-dnj@google.com> (https://public-inbox.org/git/20180108030239.92036-3-dnj@google.com/).

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

Makefile: fix broken bindir_relative variableÆvar Arnfjörð Bjarmason Tue, 13 Mar 2018 20:39:33 +0000 (20:39 +0000)

Makefile: fix broken bindir_relative variable

Change the bindir_relative variable to work like the other *_relative
variables, which are computed as a function of the absolute
path. Before this change, supplying e.g. bindir=/tmp/git/binaries to
the Makefile would yield a bindir_relative of just "bin", as opposed
to "binaries".

This logic was originally added back in 026fa0d5ad ("Move computation
of absolute paths from Makefile to runtime (in preparation for
RUNTIME_PREFIX)", 2009-01-18), then later in 971f85388f ("Makefile:
make mandir, htmldir and infodir absolute", 2013-02-24) when
more *_relative variables were added those new variables didn't have
this bug, but bindir_relative was never fixed.

There is a small change in behavior here, which is that setting
bindir_relative as an argument to the Makefile won't work anymore, I
think that's fine, since this was always intended as an internal
variable (e.g. INSTALL documents bindir=*, not bindir_relative=*).

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

worktree prune: improve prune logic when worktree is... Nguyễn Thái Ngọc Duy Thu, 15 Mar 2018 16:44:12 +0000 (17:44 +0100)

worktree prune: improve prune logic when worktree is moved

Automatic detection of worktree relocation by a user (via 'mv', for
instance) was removed by 618244e160 (worktree: stop supporting moving
worktrees manually - 2016-01-22). Prior to that,
.git/worktrees/<tag>/gitdir was updated whenever the worktree was
accessed in order to let the pruning logic know that the worktree was
"active" even if it disappeared for a while (due to being located on
removable media, for instance).

"git worktree move" has come so we don't really need this, but since
it's easy to do, perhaps we could keep supporting manual worktree move
a bit longer. Notice that when a worktree is active, the "index" file
should be updated pretty often in common case. The logic is updated to
check for index mtime to see if the worktree is alive.

The old logic of checking gitdir's mtime is dropped because nobody
updates it anyway. The new corner case is, if the index file does not
exist, we immediately remove the stale worktree. But if the "index"
file does not exist, you may have a bigger problem.

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

worktree: delete dead codeNguyễn Thái Ngọc Duy Thu, 15 Mar 2018 16:44:11 +0000 (17:44 +0100)

worktree: delete dead code

This "link" was a feature in early iterations of multiple worktree
functionality for some reason it was dropped [1]. Since nobody creates
this "link", there's no need to check it.

This is mostly used to let the user moves a worktree manually [2]. If
you move a worktree within the same file system, this hard link count
lets us know the worktree is still there even if we don't know where it
is.

We support 'worktree move' now and don't need this anymore.

[1] last appearance in v4 message-id:
1393675983-3232-25-git-send-email-pclouds@gmail.com
and the reason in v5 was "revisit later", message-id:
1394246900-31535-1-git-send-email-pclouds@gmail.com
[2] 23af91d102 (prune: strategies for linked checkouts - 2014-11-30)

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

gc.txt: more details about what gc doesNguyễn Thái Ngọc Duy Thu, 15 Mar 2018 16:44:10 +0000 (17:44 +0100)

gc.txt: more details about what gc does

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

Fix bugs preventing adding updated cache entries to... Ben Peart Thu, 15 Mar 2018 15:25:20 +0000 (11:25 -0400)

Fix bugs preventing adding updated cache entries to the name hash

Update replace_index_entry() to clear the CE_HASHED flag from the new cache
entry so that it can add it to the name hash in set_index_entry()

Fix refresh_cache_ent() to use the copy_cache_entry() macro instead of memcpy()
so that it doesn't incorrectly copy the hash state from the old entry.

Signed-off-by: Ben Peart <benpeart@microsoft.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

filter-branch: return 2 when nothing to rewriteMichele Locati Thu, 15 Mar 2018 17:09:18 +0000 (18:09 +0100)

filter-branch: return 2 when nothing to rewrite

Using the --state-branch option allows us to perform incremental filtering.
This may lead to having nothing to rewrite in subsequent filtering, so we need
a way to recognize this case.
So, let's exit with 2 instead of 1 when this "error" occurs.

Signed-off-by: Michele Locati <michele@locati.it>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

shortlog: disallow left-over arguments outside repoMartin Ågren Wed, 14 Mar 2018 21:34:19 +0000 (22:34 +0100)

shortlog: disallow left-over arguments outside repo

If we are outside a repo and have any arguments left after
option-parsing, `setup_revisions()` will try to do its job and
something like this will happen:

$ git shortlog v2.16.0..
BUG: environment.c:183: git environment hasn't been setup
Aborted (core dumped)

The usage is wrong, but we could obviously handle this better. Note that
commit abe549e179 (shortlog: do not require to run from inside a git
repository, 2008-03-14) explicitly enabled `git shortlog` to run from
outside a repo, since we do not need a repo for parsing data from stdin.

Disallow left-over arguments when run from outside a repo.

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

fetch-pack: do not check links for partial fetchJonathan Tan Wed, 14 Mar 2018 18:42:41 +0000 (11:42 -0700)

fetch-pack: do not check links for partial fetch

When doing a partial clone or fetch with transfer.fsckobjects=1, use the
--fsck-objects instead of the --strict flag when invoking index-pack so
that links are not checked, only objects. This is because incomplete
links are expected when doing a partial clone or fetch.

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

index-pack: support checking objects but not linksJonathan Tan Wed, 14 Mar 2018 18:42:40 +0000 (11:42 -0700)

index-pack: support checking objects but not links

The index-pack command currently supports the
--check-self-contained-and-connected argument, for internal use only,
that instructs it to only check for broken links and not broken objects.
For partial clones, we need the inverse, so add a --fsck-objects
argument that checks for broken objects and not broken links, also for
internal use only.

This will be used by fetch-pack in a subsequent patch.

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

Makefile: make USE_LIBPCRE=YesPlease mean v2, not v1Ævar Arnfjörð Bjarmason Sun, 11 Mar 2018 13:26:09 +0000 (13:26 +0000)

Makefile: make USE_LIBPCRE=YesPlease mean v2, not v1

Change the USE_LIBPCRE flag from being an alias for USE_LIBPCRE1 to
being an alias for USE_LIBPCRE2.

When support for v2 was added in my 94da9193a6 ("grep: add support for
PCRE v2", 2017-06-01) the existing USE_LIBPCRE flag was left as
meaning v1, with a note that this would likely change in a future
release. That optional support for v2 first made it into Git version
2.14.0.

The PCRE v2 support has been shown to be stable, and the upstream PCRE
project is highly encouraging downstream users to move to v2, so it
makes sense to give packagers of Git who haven't heard the news about
PCRE v2 a further nudge to move to v2.

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

configure: detect redundant --with-libpcre & --with... Ævar Arnfjörð Bjarmason Sun, 11 Mar 2018 13:26:08 +0000 (13:26 +0000)

configure: detect redundant --with-libpcre & --with-libpcre1

The --with-libpcre option is a synonym for the --with-libpcre1 flag,
but the configure script allowed for redundantly specifying both.

Nothing broke as a result of this, but it's confusing, so let's
disallow it.

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

configure: fix a regression in PCRE v1 detectionÆvar Arnfjörð Bjarmason Sun, 11 Mar 2018 13:26:07 +0000 (13:26 +0000)

configure: fix a regression in PCRE v1 detection

Change the check for PCRE v1 to disable the --with-libpcre1 option if
the pcre_version() function can't be found in the pcre library. I
unintentionally changed this in my 94da9193a6 ("grep: add support for
PCRE v2", 2017-06-01) while renaming moving some variables.

The intent of this check ever since it was added in
a119f91e57 ("configure: Check for libpcre", 2011-05-09) is to
second-guess the user and turn off an explicitly provided
--with-libpcre if the library can't be found.

I don't think that behavior makes any sense, we shouldn't be
second-guessing the user with an auto-detection, but changing that
needs a bigger refactoring of this script, and only has marginal
benefits. So let's fix it to work as it was intended to work again.

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

Merge branch 'nd/parseopt-completion'Junio C Hamano Wed, 14 Mar 2018 19:01:06 +0000 (12:01 -0700)

Merge branch 'nd/parseopt-completion'

Teach parse-options API an option to help the completion script,
and make use of the mechanism in command line completion.

* nd/parseopt-completion: (45 commits)
completion: more subcommands in _git_notes()
completion: complete --{reuse,reedit}-message= for all notes subcmds
completion: simplify _git_notes
completion: don't set PARSE_OPT_NOCOMPLETE on --rerere-autoupdate
completion: use __gitcomp_builtin in _git_worktree
completion: use __gitcomp_builtin in _git_tag
completion: use __gitcomp_builtin in _git_status
completion: use __gitcomp_builtin in _git_show_branch
completion: use __gitcomp_builtin in _git_rm
completion: use __gitcomp_builtin in _git_revert
completion: use __gitcomp_builtin in _git_reset
completion: use __gitcomp_builtin in _git_replace
remote: force completing --mirror= instead of --mirror
completion: use __gitcomp_builtin in _git_remote
completion: use __gitcomp_builtin in _git_push
completion: use __gitcomp_builtin in _git_pull
completion: use __gitcomp_builtin in _git_notes
completion: use __gitcomp_builtin in _git_name_rev
completion: use __gitcomp_builtin in _git_mv
completion: use __gitcomp_builtin in _git_merge_base
...

Merge branch 'nd/object-allocation-comments'Junio C Hamano Wed, 14 Mar 2018 19:01:06 +0000 (12:01 -0700)

Merge branch 'nd/object-allocation-comments'

Code doc update.

* nd/object-allocation-comments:
object.h: realign object flag allocation comment
object.h: update flag allocation comment

Merge branch 'jk/smart-http-protocol-doc-fix'Junio C Hamano Wed, 14 Mar 2018 19:01:05 +0000 (12:01 -0700)

Merge branch 'jk/smart-http-protocol-doc-fix'

A doc update.

* jk/smart-http-protocol-doc-fix:
smart-http: document flush after "# service" line

Merge branch 'jk/add-i-diff-filter'Junio C Hamano Wed, 14 Mar 2018 19:01:05 +0000 (12:01 -0700)

Merge branch 'jk/add-i-diff-filter'

The "interactive.diffFilter" used by "git add -i" must retain
one-to-one correspondence between its input and output, but it was
not enforced and caused end-user confusion. We now at least make
sure the filtered result has the same number of lines as its input
to detect a broken filter.

* jk/add-i-diff-filter:
add--interactive: detect bogus diffFilter output
t3701: add a test for interactive.diffFilter

Merge branch 'nd/worktree-move'Junio C Hamano Wed, 14 Mar 2018 19:01:05 +0000 (12:01 -0700)

Merge branch 'nd/worktree-move'

"git worktree" learned move and remove subcommands.

* nd/worktree-move:
t2028: fix minor error and issues in newly-added "worktree move" tests
worktree remove: allow it when $GIT_WORK_TREE is already gone
worktree remove: new command
worktree move: refuse to move worktrees with submodules
worktree move: accept destination as directory
worktree move: new command
worktree.c: add update_worktree_location()
worktree.c: add validate_worktree()

Merge branch 'pw/add-p-recount'Junio C Hamano Wed, 14 Mar 2018 19:01:04 +0000 (12:01 -0700)

Merge branch 'pw/add-p-recount'

"git add -p" has been lazy in coalescing split patches before
passing the result to underlying "git apply", leading to corner
case bugs; the logic to prepare the patch to be applied after hunk
selections has been tightened.

* pw/add-p-recount:
add -p: don't rely on apply's '--recount' option
add -p: fix counting when splitting and coalescing
add -p: calculate offset delta for edited patches
add -p: adjust offsets of subsequent hunks when one is skipped
t3701: add failing test for pathological context lines
t3701: don't hard code sha1 hash values
t3701: use test_write_lines and write_script
t3701: indent here documents
add -i: add function to format hunk header

Merge branch 'ab/pre-auto-gc-battery'Junio C Hamano Wed, 14 Mar 2018 19:01:04 +0000 (12:01 -0700)

Merge branch 'ab/pre-auto-gc-battery'

A sample auto-gc hook (in contrib/) to skip auto-gc while on
battery has been updated to almost always allow running auto-gc
unless on_ac_power command is absolutely sure that we are on
battery power (earlier, it skipped unless the command is sure that
we are on ac power).

* ab/pre-auto-gc-battery:
hooks/pre-auto-gc-battery: allow gc to run on non-laptops

Merge branch 'sg/test-x'Junio C Hamano Wed, 14 Mar 2018 19:01:03 +0000 (12:01 -0700)

Merge branch 'sg/test-x'

Running test scripts under -x option of the shell is often not a
useful way to debug them, because the error messages from the
commands tests try to capture and inspect are contaminated by the
tracing output by the shell. An earlier work done to make it more
pleasant to run tests under -x with recent versions of bash is
extended to cover posix shells that do not support BASH_XTRACEFD.

* sg/test-x:
travis-ci: run tests with '-x' tracing
t/README: add a note about don't saving stderr of compound commands
t1510-repo-setup: mark as untraceable with '-x'
t9903-bash-prompt: don't check the stderr of __git_ps1()
t5570-git-daemon: don't check the stderr of a subshell
t5526: use $TRASH_DIRECTORY to specify the path of GIT_TRACE log file
t5500-fetch-pack: don't check the stderr of a subshell
t3030-merge-recursive: don't check the stderr of a subshell
t1507-rev-parse-upstream: don't check the stderr of a shell function
t: add means to disable '-x' tracing for individual test scripts
t: prevent '-x' tracing from interfering with test helpers' stderr

Merge branch 'rj/test-i18ngrep'Junio C Hamano Wed, 14 Mar 2018 19:01:03 +0000 (12:01 -0700)

Merge branch 'rj/test-i18ngrep'

Test updates.

* rj/test-i18ngrep:
t5536: simplify checking of messages output to stderr
t4151: consolidate multiple calls to test_i18ngrep

Merge branch 'ma/roll-back-lockfiles'Junio C Hamano Wed, 14 Mar 2018 19:01:03 +0000 (12:01 -0700)

Merge branch 'ma/roll-back-lockfiles'

Some codepaths used to take a lockfile and did not roll it back;
they are automatically rolled back at program exit, so there is no
real "breakage", but it still is a good practice to roll back when
you are done with a lockfile.

* ma/roll-back-lockfiles:
sequencer: do not roll back lockfile unnecessarily
merge: always roll back lock in `checkout_fast_forward()`
merge-recursive: always roll back lock in `merge_recursive_generic()`
sequencer: always roll back lock in `do_recursive_merge()`
sequencer: make lockfiles non-static

Merge branch 'nd/diff-stat-with-summary'Junio C Hamano Wed, 14 Mar 2018 19:01:02 +0000 (12:01 -0700)

Merge branch 'nd/diff-stat-with-summary'

"git diff" and friends learned "--compact-summary" that shows the
information usually given with the "--summary" option on the same
line as the diffstat output of the "--stat" option (which saves
vertical space and keeps info on a single path at the same place).

* nd/diff-stat-with-summary:
diff: add --compact-summary
diff.c: refactor pprint_rename() to use strbuf

fetch-pack.c: use oidset to check existence of loose... Takuto Ikuta Wed, 14 Mar 2018 06:32:42 +0000 (15:32 +0900)

fetch-pack.c: use oidset to check existence of loose object

When fetching from a repository with large number of refs, because to
check existence of each refs in local repository to packed and loose
objects, 'git fetch' ends up doing a lot of lstat(2) to non-existing
loose form, which makes it slow.

Instead of making as many lstat(2) calls as the refs the remote side
advertised to see if these objects exist in the loose form, first
enumerate all the existing loose objects in hashmap beforehand and use
it to check existence of them if the number of refs is larger than the
number of loose objects.

With this patch, the number of lstat(2) calls in `git fetch` is reduced
from 411412 to 13794 for chromium repository, it has more than 480000
remote refs.

I took time stat of `git fetch` when fetch-pack happens for chromium
repository 3 times on linux with SSD.
* with this patch
8.105s
8.309s
7.640s
avg: 8.018s

* master
12.287s
11.175s
12.227s
avg: 11.896s

On my MacBook Air which has slower lstat(2).
* with this patch
14.501s

* master
1m16.027s

`git fetch` on slow disk will be improved largely.

Signed-off-by: Takuto Ikuta <tikuta@chromium.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

convert: convert to struct object_idbrian m. carlson Mon, 12 Mar 2018 02:27:56 +0000 (02:27 +0000)

convert: convert to struct object_id

Convert convert.c to struct object_id. Add a use of the_hash_algo to
replace hard-coded constants and change a strbuf_add to a strbuf_addstr
to avoid another hard-coded constant.

Note that a strict conversion using the hexsz constant would cause
problems in the future if the internal and user-visible hash algorithms
differed, as anticipated by the hash function transition plan.

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

sha1_file: introduce a constant for max header lengthbrian m. carlson Mon, 12 Mar 2018 02:27:55 +0000 (02:27 +0000)

sha1_file: introduce a constant for max header length

There were several instances of 32 sprinkled throughout this file, all
of which were used for allocating a buffer to store the header of an
object. Introduce a constant, MAX_HEADER_LEN, for this purpose.

Note that this constant is slightly larger than required; the longest
possible header is 28 (7 for "commit", 1 for a space, 20 for a 63-bit
length in decimal, and 1 for the NUL). However, the overallocation
should not cause any problems, so leave it as it is.

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

Convert lookup_replace_object to struct object_idbrian m. carlson Mon, 12 Mar 2018 02:27:54 +0000 (02:27 +0000)

Convert lookup_replace_object to struct object_id

Convert both the argument and the return value to be pointers to struct
object_id. Update the callers and their internals to deal with the new
type. Remove several temporaries which are no longer needed.

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

sha1_file: convert read_sha1_file to struct object_idbrian m. carlson Mon, 12 Mar 2018 02:27:53 +0000 (02:27 +0000)

sha1_file: convert read_sha1_file to struct object_id

Convert read_sha1_file to take a pointer to struct object_id and rename
it read_object_file. Do the same for read_sha1_file_extended.

Convert one use in grep.c to use the new function without any other code
change, since the pointer being passed is a void pointer that is already
initialized with a pointer to struct object_id. Update the declaration
and definitions of the modified functions, and apply the following
semantic patch to convert the remaining callers:

@@
expression E1, E2, E3;
@@
- read_sha1_file(E1.hash, E2, E3)
+ read_object_file(&E1, E2, E3)

@@
expression E1, E2, E3;
@@
- read_sha1_file(E1->hash, E2, E3)
+ read_object_file(E1, E2, E3)

@@
expression E1, E2, E3, E4;
@@
- read_sha1_file_extended(E1.hash, E2, E3, E4)
+ read_object_file_extended(&E1, E2, E3, E4)

@@
expression E1, E2, E3, E4;
@@
- read_sha1_file_extended(E1->hash, E2, E3, E4)
+ read_object_file_extended(E1, E2, E3, E4)

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

sha1_file: convert read_object_with_reference to object_idbrian m. carlson Mon, 12 Mar 2018 02:27:52 +0000 (02:27 +0000)

sha1_file: convert read_object_with_reference to object_id

Convert read_object_with_reference to take pointers to struct object_id.
Update the internals of the function accordingly.

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

tree-walk: convert tree entry functions to object_idbrian m. carlson Mon, 12 Mar 2018 02:27:51 +0000 (02:27 +0000)

tree-walk: convert tree entry functions to object_id

Convert get_tree_entry and find_tree_entry to take pointers to struct
object_id.

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

streaming: convert istream internals to struct object_idbrian m. carlson Mon, 12 Mar 2018 02:27:50 +0000 (02:27 +0000)

streaming: convert istream internals to struct object_id

Convert the various open_istream variants to take a pointer to struct
object_id. Introduce a temporary, which will be removed later, to work
around the fact that lookup_replace_object still returns a pointer to
unsigned char.

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

tree-walk: convert get_tree_entry_follow_symlinks inter... brian m. carlson Mon, 12 Mar 2018 02:27:49 +0000 (02:27 +0000)

tree-walk: convert get_tree_entry_follow_symlinks internals to object_id

Convert the internals of this function to use struct object_id. This is
one of the last remaining callers of read_sha1_file_extended that has
not been converted yet.

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

builtin/notes: convert static functions to object_idbrian m. carlson Mon, 12 Mar 2018 02:27:48 +0000 (02:27 +0000)

builtin/notes: convert static functions to object_id

Convert the remaining static functions to take pointers to struct
object_id.

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

builtin/fmt-merge-msg: convert remaining code to object_idbrian m. carlson Mon, 12 Mar 2018 02:27:47 +0000 (02:27 +0000)

builtin/fmt-merge-msg: convert remaining code to object_id

We were using the util pointer, which is a pointer to void, as an
unsigned char pointer. The pointer actually points to a struct
origin_data, which has a struct object_id as its first member, which in
turn has an unsigned char array as its first member, so this was valid.
Since we want to convert this to struct object_id, simply change the
pointer we're using.

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

sha1_file: convert sha1_object_info* to object_idbrian m. carlson Mon, 12 Mar 2018 02:27:46 +0000 (02:27 +0000)

sha1_file: convert sha1_object_info* to object_id

Convert sha1_object_info and sha1_object_info_extended to take pointers
to struct object_id and rename them to use "oid" instead of "sha1" in
their names. Update the declaration and definition and apply the
following semantic patch, plus the standard object_id transforms:

@@
expression E1, E2;
@@
- sha1_object_info(E1.hash, E2)
+ oid_object_info(&E1, E2)

@@
expression E1, E2;
@@
- sha1_object_info(E1->hash, E2)
+ oid_object_info(E1, E2)

@@
expression E1, E2, E3;
@@
- sha1_object_info_extended(E1.hash, E2, E3)
+ oid_object_info_extended(&E1, E2, E3)

@@
expression E1, E2, E3;
@@
- sha1_object_info_extended(E1->hash, E2, E3)
+ oid_object_info_extended(E1, E2, E3)

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

Convert remaining callers of sha1_object_info_extended... brian m. carlson Mon, 12 Mar 2018 02:27:45 +0000 (02:27 +0000)

Convert remaining callers of sha1_object_info_extended to object_id

Convert the remaining caller of sha1_object_info_extended to use struct
object_id. Introduce temporaries, which will be removed later, since
there is a dependency loop between sha1_object_info_extended and
lookup_replace_object_extended. This allows us to convert the code in a
piecemeal fashion instead of all at once.

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

packfile: convert unpack_entry to struct object_idbrian m. carlson Mon, 12 Mar 2018 02:27:44 +0000 (02:27 +0000)

packfile: convert unpack_entry to struct object_id

Convert unpack_entry and read_object to use struct object_id.

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

sha1_file: convert retry_bad_packed_offset to struct... brian m. carlson Mon, 12 Mar 2018 02:27:43 +0000 (02:27 +0000)

sha1_file: convert retry_bad_packed_offset to struct object_id

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

sha1_file: convert assert_sha1_type to object_idbrian m. carlson Mon, 12 Mar 2018 02:27:42 +0000 (02:27 +0000)

sha1_file: convert assert_sha1_type to object_id

Convert this function to take a pointer to struct object_id and rename
it to assert_oid_type.

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

builtin/mktree: convert to struct object_idbrian m. carlson Mon, 12 Mar 2018 02:27:41 +0000 (02:27 +0000)

builtin/mktree: convert to struct object_id

Convert this file to use struct object_id. Modify one use of
get_sha1_hex into parse_oid_hex; this is safe since we get the data from
a strbuf.

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

streaming: convert open_istream to use struct object_idbrian m. carlson Mon, 12 Mar 2018 02:27:40 +0000 (02:27 +0000)

streaming: convert open_istream to use struct object_id

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

sha1_file: convert check_sha1_signature to struct object_idbrian m. carlson Mon, 12 Mar 2018 02:27:39 +0000 (02:27 +0000)

sha1_file: convert check_sha1_signature to struct object_id

Convert this function to take a pointer to struct object_id and rename
it check_object_signature. Introduce temporaries to convert the return
values of lookup_replace_object and lookup_replace_object_extended into
struct object_id.

The temporaries are needed because in order to convert
lookup_replace_object, open_istream needs to be converted, and
open_istream needs check_sha1_signature to be converted, causing a loop
of dependencies. The temporaries will be removed in a future patch.

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

sha1_file: convert read_loose_object to use struct... brian m. carlson Mon, 12 Mar 2018 02:27:38 +0000 (02:27 +0000)

sha1_file: convert read_loose_object to use struct object_id

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

builtin/index-pack: convert struct ref_delta_entry... brian m. carlson Mon, 12 Mar 2018 02:27:37 +0000 (02:27 +0000)

builtin/index-pack: convert struct ref_delta_entry to object_id

Convert this struct to use a member of type object_id. Convert various
static functions as well.

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

archive: convert sha1_file_to_archive to struct object_idbrian m. carlson Mon, 12 Mar 2018 02:27:36 +0000 (02:27 +0000)

archive: convert sha1_file_to_archive to struct object_id

Convert this function to take a pointer to struct object_id and rename
it object_file_to_archive.

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

archive: convert write_archive_entry_fn_t to object_idbrian m. carlson Mon, 12 Mar 2018 02:27:35 +0000 (02:27 +0000)

archive: convert write_archive_entry_fn_t to object_id

Convert the write_archive_entry_fn_t type to use a pointer to struct
object_id. Convert various static functions in the tar and zip
archivers also.

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

builtin/mktag: convert to struct object_idbrian m. carlson Mon, 12 Mar 2018 02:27:34 +0000 (02:27 +0000)

builtin/mktag: convert to struct object_id

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

replace_object: convert struct replace_object to object_idbrian m. carlson Mon, 12 Mar 2018 02:27:33 +0000 (02:27 +0000)

replace_object: convert struct replace_object to object_id

Convert the two members of this struct to be instances of struct
object_id. Adjust the various functions in this file accordingly.

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

send-pack: convert remaining functions to struct object_idbrian m. carlson Mon, 12 Mar 2018 02:27:32 +0000 (02:27 +0000)

send-pack: convert remaining functions to struct object_id

Convert the remaining function, feed_object, to use struct object_id.

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

http-walker: convert struct object_request to use struc... brian m. carlson Mon, 12 Mar 2018 02:27:31 +0000 (02:27 +0000)

http-walker: convert struct object_request to use struct object_id

Convert struct object_request to use struct object_id by updating the
definition and applying the following semantic patch, plus the standard
object_id transforms:

@@
struct object_request E1;
@@
- E1.sha1
+ E1.oid.hash

@@
struct object_request *E1;
@@
- E1->sha1
+ E1->oid.hash

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

Convert find_unique_abbrev* to struct object_idbrian m. carlson Mon, 12 Mar 2018 02:27:30 +0000 (02:27 +0000)

Convert find_unique_abbrev* to struct object_id

Convert find_unique_abbrev and find_unique_abbrev_r to each take a
pointer to struct object_id.

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

wt-status: convert struct wt_status_state to object_idbrian m. carlson Mon, 12 Mar 2018 02:27:29 +0000 (02:27 +0000)

wt-status: convert struct wt_status_state to object_id

Convert the various *_sha1 members to use struct object_id instead.

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

strbuf: convert strbuf_add_unique_abbrev to use struct... brian m. carlson Mon, 12 Mar 2018 02:27:28 +0000 (02:27 +0000)

strbuf: convert strbuf_add_unique_abbrev to use struct object_id

Convert the declaration and definition of strbuf_add_unique_abbrev to
make it take a pointer to struct object_id. Predeclare the struct in
strbuf.h, as cache.h includes strbuf.h before it declares the struct,
and otherwise the struct declaration would have the wrong scope.

Apply the following semantic patch, along with the standard object_id
transforms, to adjust the callers:

@@
expression E1, E2, E3;
@@
- strbuf_add_unique_abbrev(E1, E2.hash, E3);
+ strbuf_add_unique_abbrev(E1, &E2, E3);

@@
expression E1, E2, E3;
@@
- strbuf_add_unique_abbrev(E1, E2->hash, E3);
+ strbuf_add_unique_abbrev(E1, E2, E3);

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

ref-filter: convert grab_objectname to struct object_idbrian m. carlson Mon, 12 Mar 2018 02:27:27 +0000 (02:27 +0000)

ref-filter: convert grab_objectname to struct object_id

This is necessary in order to convert find_unique_abbrev.

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

tree: convert read_tree_recursive to struct object_idbrian m. carlson Mon, 12 Mar 2018 02:27:26 +0000 (02:27 +0000)

tree: convert read_tree_recursive to struct object_id

Convert the callback functions for read_tree_recursive to take a pointer
to struct object_id.

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

resolve-undo: convert struct resolve_undo_info to object_idbrian m. carlson Mon, 12 Mar 2018 02:27:25 +0000 (02:27 +0000)

resolve-undo: convert struct resolve_undo_info to object_id

Convert the sha1 member of this struct to be an array of struct
object_id instead. This change is needed to convert find_unique_abbrev.

Convert some instances of hard-coded constants to use the_hash_algo as
well.

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

cache-tree: convert remnants to struct object_idbrian m. carlson Mon, 12 Mar 2018 02:27:24 +0000 (02:27 +0000)

cache-tree: convert remnants to struct object_id

Convert the remaining portions of cache-tree.c to use struct object_id.
Convert several instances of 20 to use the_hash_algo instead.

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

cache-tree: convert write_*_as_tree to object_idbrian m. carlson Mon, 12 Mar 2018 02:27:23 +0000 (02:27 +0000)

cache-tree: convert write_*_as_tree to object_id

Convert write_index_as_tree and write_cache_as_tree to use struct
object_id.

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

builtin/write-tree: convert to struct object_idbrian m. carlson Mon, 12 Mar 2018 02:27:22 +0000 (02:27 +0000)

builtin/write-tree: convert to struct object_id

This is needed to convert parts of the cache-tree code.

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

bulk-checkin: convert index_bulk_checkin to struct... brian m. carlson Mon, 12 Mar 2018 02:27:21 +0000 (02:27 +0000)

bulk-checkin: convert index_bulk_checkin to struct object_id

Convert the index_bulk_checkin function, and the static functions it
calls, to use pointers to struct object_id.

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

shortlog: add usage-string for stdin-readingMartin Ågren Sat, 10 Mar 2018 11:52:11 +0000 (12:52 +0100)

shortlog: add usage-string for stdin-reading

This has been missing since we learned to print usage, way back in
4e27fb06f (add commit count options to git-shortlog, 2006-10-06).

While at it, drop the [] around "<path>...". This matches `git log -h`
and Documentation/git-{short}log.txt. It formally makes it look like we
do not allow `git shortlog --`, but we gain readability and consistency.

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

git-shortlog.txt: reorder usagesMartin Ågren Sat, 10 Mar 2018 11:52:10 +0000 (12:52 +0100)

git-shortlog.txt: reorder usages

The first usage we give is the original one where, e.g., `git log` is
piped through `git shortlog`. The description that follows reads the
other way round, by first focusing on the general behavior, then ending
with the behavior when reading from stdin.

It is also a tiny bit odd that what is probably the most common usage
and the one a reader is probably looking for is not at the top of the
list. Of course, it is only a two-item list, so it is not _that_ hard to
find... The next commit will add the original usage to the usage string
in builtin/shortlog.c, and it feels more natural to do so below the
most common usage. To avoid being inconsistent, reorder these two
usages here first.

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

sha1_file: restore OBJECT_INFO_QUICK functionalityJonathan Tan Tue, 13 Mar 2018 15:30:29 +0000 (08:30 -0700)

sha1_file: restore OBJECT_INFO_QUICK functionality

Support for the OBJECT_INFO_QUICK flag in sha1_object_info_extended()
was added in commit dfdd4afcf9 ("sha1_file: teach
sha1_object_info_extended more flags", 2017-06-26) in order to support
commit e83e71c5e1 ("sha1_file: refactor has_sha1_file_with_flags",
2017-06-26), but it was inadvertently removed in commit 8b4c0103a9
("sha1_file: support lazily fetching missing objects", 2017-12-08).

Restore this functionality.

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

t9402-git-cvsserver-refs: don't check the stderr of... SZEDER Gábor Thu, 8 Mar 2018 12:38:44 +0000 (13:38 +0100)

t9402-git-cvsserver-refs: don't check the stderr of a subshell

Four 'cvs diff' related tests in 't9402-git-cvsserver-refs.sh' fail
when the test script is run with '-x' tracing (and using a shell other
than a Bash version supporting BASH_XTRACEFD). The reason for those
failures is that the tests check the emptiness of a subshell's stderr,
which includes the trace of commands executed in that subshell as
well, throwing off the emptiness check.

Save the stdout and stderr of the invoked 'cvs' command instead of the
whole subshell, so the latter remains free from tracing output. (Note
that changing how stdout is saved is only done for the sake of
consistency, it's not necessary for correctness.)

After this change t9402 passes with '-x', even when running with
/bin/sh.

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

t9400-git-cvsserver-server: don't rely on the output... SZEDER Gábor Thu, 8 Mar 2018 22:44:58 +0000 (23:44 +0100)

t9400-git-cvsserver-server: don't rely on the output of 'test_cmp'

The test 'cvs update (-p)' redirects and checks 'test_cmp's stdout and
even its stderr. The commit introducing this test in 6e8937a084
(cvsserver: Add test for update -p, 2008-03-27) doesn't discuss why,
in fact its log message only consists of that subject line. Anyway,
weird as it is, it kind of made sense due to the way that test was
structured:

After a bit of preparation, this test updates four files via CVS and
checks their contents using 'test_cmp', but it does so in a for loop
iterating over the names of those four files. Now, the exit status of
a for loop is the exit status of the last command executed in the
loop, meaning that the test can't simply rely on the exit code of
'test_cmp' in the loop's body. Instead, the test works it around by
relying on the stdout of 'test_cmp' being silent on success and
showing the diff on failure, as it appends the stdout of all four
'test_cmp' invocations to a single file and checks that file's
emptiness after the loop (with 'test -z "$(cat ...)"', no less; there
was no 'test_must_be_empty' back then). Furthermore, the test
redirects the stderr of those 'test_cmp' invocations to this file,
too: while 'test_cmp' itself doesn't output anything to stderr, the
invoked 'diff' or 'cmp' commands do send their error messages there,
e.g. if they can't open a file because its name was misspelled.

This also makes this test fail when the test script is run with '-x'
tracing (and using a shell other than a Bash version supporting
BASH_XTRACEFD), because 'test_cmp's stderr contains the trace of the
'diff' command executed inside the helper function, throwing off the
subsequent emptiness check.

Stop relying on 'test_cmp's output and instead run 'test_cmp a b ||
return 1' in the for loop in order to make 'test_cmp's error code fail
the test. Furthermore, add the missing && after the cvs command to
create a && chain in the loop's body.

After this change t9400 passes with '-x', even when running with
/bin/sh.

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

Eighth batch for 2.17Junio C Hamano Thu, 8 Mar 2018 20:42:06 +0000 (12:42 -0800)

Eighth batch for 2.17

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

Merge branch 'ag/userdiff-go-funcname'Junio C Hamano Thu, 8 Mar 2018 20:36:30 +0000 (12:36 -0800)

Merge branch 'ag/userdiff-go-funcname'

"git diff" and friends learned funcname patterns for Go language
source files.

* ag/userdiff-go-funcname:
userdiff: add built-in pattern for golang

Merge branch 'ab/gc-auto-in-commit'Junio C Hamano Thu, 8 Mar 2018 20:36:30 +0000 (12:36 -0800)

Merge branch 'ab/gc-auto-in-commit'

"git commit" used to run "gc --auto" near the end, which was lost
when the command was reimplemented in C by mistake.

* ab/gc-auto-in-commit:
commit: run git gc --auto just before the post-commit hook

Merge branch 'bp/untracked-cache-noflush'Junio C Hamano Thu, 8 Mar 2018 20:36:30 +0000 (12:36 -0800)

Merge branch 'bp/untracked-cache-noflush'

Writing out the index file when the only thing that changed in it
is the untracked cache information is often wasteful, and this has
been optimized out.

* bp/untracked-cache-noflush:
untracked cache: use git_env_bool() not getenv() for customization
dir.c: don't flag the index as dirty for changes to the untracked cache

Merge branch 'rs/perf-repeat-thrice-by-default'Junio C Hamano Thu, 8 Mar 2018 20:36:29 +0000 (12:36 -0800)

Merge branch 'rs/perf-repeat-thrice-by-default'

Perf test regression fix.

* rs/perf-repeat-thrice-by-default:
perf: use GIT_PERF_REPEAT_COUNT=3 by default even without config file

Merge branch 'mk/doc-pretty-fill'Junio C Hamano Thu, 8 Mar 2018 20:36:29 +0000 (12:36 -0800)

Merge branch 'mk/doc-pretty-fill'

Docfix.

* mk/doc-pretty-fill:
docs/pretty-formats: fix typo '% <(<N>)' -> '%<|(<N>)'

Merge branch 'jc/test-must-be-empty'Junio C Hamano Thu, 8 Mar 2018 20:36:27 +0000 (12:36 -0800)

Merge branch 'jc/test-must-be-empty'

Test framework tweak to catch developer thinko.

* jc/test-must-be-empty:
test_must_be_empty: make sure the file exists, not just empty

Merge branch 'ds/mark-parents-uninteresting-optim'Junio C Hamano Thu, 8 Mar 2018 20:36:27 +0000 (12:36 -0800)

Merge branch 'ds/mark-parents-uninteresting-optim'

Micro optimization in revision traversal code.

* ds/mark-parents-uninteresting-optim:
revision.c: reduce object database queries

Merge branch 'ds/find-unique-abbrev-optim'Junio C Hamano Thu, 8 Mar 2018 20:36:26 +0000 (12:36 -0800)

Merge branch 'ds/find-unique-abbrev-optim'

While finding unique object name abbreviation, the code may
accidentally have read beyond the end of the array of object names
in a pack.

* ds/find-unique-abbrev-optim:
sha1_name: fix uninitialized memory errors

Merge branch 'sg/subtree-signed-commits'Junio C Hamano Thu, 8 Mar 2018 20:36:25 +0000 (12:36 -0800)

Merge branch 'sg/subtree-signed-commits'

"git subtree" script (in contrib/) scripted around "git log", whose
output got affected by end-user configuration like log.showsignature

* sg/subtree-signed-commits:
subtree: fix add and pull for GPG-signed commits

Merge branch 'rv/grep-cleanup'Junio C Hamano Thu, 8 Mar 2018 20:36:25 +0000 (12:36 -0800)

Merge branch 'rv/grep-cleanup'

Threaded "git grep" has been optimized to avoid allocation in code
section that is covered under a mutex.

* rv/grep-cleanup:
grep: simplify grep_oid and grep_file
grep: move grep_source_init outside critical section

Merge branch 'ot/ref-filter-cleanup'Junio C Hamano Thu, 8 Mar 2018 20:36:24 +0000 (12:36 -0800)

Merge branch 'ot/ref-filter-cleanup'

Code cleanup.

* ot/ref-filter-cleanup:
ref-filter: get rid of goto
ref-filter: get rid of duplicate code

Merge branch 'jh/status-no-ahead-behind'Junio C Hamano Thu, 8 Mar 2018 20:36:24 +0000 (12:36 -0800)

Merge branch 'jh/status-no-ahead-behind'

"git status" can spend a lot of cycles to compute the relation
between the current branch and its upstream, which can now be
disabled with "--no-ahead-behind" option.

* jh/status-no-ahead-behind:
status: support --no-ahead-behind in long format
status: update short status to respect --no-ahead-behind
status: add --[no-]ahead-behind to status and commit for V2 format.
stat_tracking_info: return +1 when branches not equal

Merge branch 'sg/travis-build-during-script-phase'Junio C Hamano Thu, 8 Mar 2018 20:36:23 +0000 (12:36 -0800)

Merge branch 'sg/travis-build-during-script-phase'

Build the executable in 'script' phase in Travis CI integration, to
follow the established practice, rather than during 'before_script'
phase. This allows the CI categorize the failures better ('failed'
is project's fault, 'errored' is build environment's).

* sg/travis-build-during-script-phase:
travis-ci: build Git during the 'script' phase

git manpage: note git-security@googlegroups.comÆvar Arnfjörð Bjarmason Thu, 8 Mar 2018 15:08:20 +0000 (15:08 +0000)

git manpage: note git-security@googlegroups.com

Add a mention of the security mailing list to the "Reporting Bugs"
section. There's a mention of this list at
https://git-scm.com/community but none in git.git itself.

The copy is pasted from the git-scm.com website. Let's use the same
wording in both places.

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

userdiff.c: add C# async keyword in diff patternThomas Levesque Thu, 8 Mar 2018 11:05:32 +0000 (11:05 +0000)

userdiff.c: add C# async keyword in diff pattern

Currently C# async methods are not shown in diff hunk headers. I just
added the async keyword to the csharp method pattern so that they are
properly detected.

Signed-off-by: Thomas Levesque <thomas.levesque@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

completion: more subcommands in _git_notes()Nguyễn Thái Ngọc Duy Wed, 7 Mar 2018 01:05:04 +0000 (08:05 +0700)

completion: more subcommands in _git_notes()

Two subcommands are added for completion: merge and get-ref. get-ref
is more like plumbing. But since it does not share the prefix with any
other subcommands, it won't slow anybody down.

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