gitweb.git
Git 2.18-rc1 v2.18.0-rc1Junio C Hamano Mon, 4 Jun 2018 12:41:41 +0000 (21:41 +0900)

Git 2.18-rc1

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

Merge branch 'bc/t3430-fixup'Junio C Hamano Mon, 4 Jun 2018 12:39:50 +0000 (21:39 +0900)

Merge branch 'bc/t3430-fixup'

Test fix.

* bc/t3430-fixup:
t3430: test clean-up

Merge branch 'bw/refspec-api'Junio C Hamano Mon, 4 Jun 2018 12:39:50 +0000 (21:39 +0900)

Merge branch 'bw/refspec-api'

Hotfix.

* bw/refspec-api:
refspec-api: avoid uninitialized field in refspec item

Merge branch 'tg/doc-sec-list'Junio C Hamano Mon, 4 Jun 2018 12:39:49 +0000 (21:39 +0900)

Merge branch 'tg/doc-sec-list'

Doc update.

* tg/doc-sec-list:
note git-security@googlegroups.com in more places
SubmittingPatches: replace numbered attributes with names

Merge branch 'rd/p4-doc-markup-env'Junio C Hamano Mon, 4 Jun 2018 12:39:49 +0000 (21:39 +0900)

Merge branch 'rd/p4-doc-markup-env'

Doc markup update.

* rd/p4-doc-markup-env:
p4.txt: Use backquotes for variable names

Merge branch 'nd/remote-update-doc'Junio C Hamano Mon, 4 Jun 2018 12:39:48 +0000 (21:39 +0900)

Merge branch 'nd/remote-update-doc'

"git remote update" can take both a single remote nickname and a
nickname for remote groups, but only one of them was documented.

* nd/remote-update-doc:
remote: doc typofix
remote.txt: update documentation for 'update' command

Merge branch 'jt/submodule-pull-recurse-rebase'Junio C Hamano Mon, 4 Jun 2018 12:39:48 +0000 (21:39 +0900)

Merge branch 'jt/submodule-pull-recurse-rebase'

"git pull -recurse-submodules --rebase", when the submodule
repository's history did not have anything common between ours and
the upstream's, failed to execute. We need to fetch from them to
continue even in such a case.

* jt/submodule-pull-recurse-rebase:
submodule: do not pass null OID to setup_revisions

remote: doc typofixDuy Nguyen Wed, 30 May 2018 15:37:01 +0000 (17:37 +0200)

remote: doc typofix

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

update-ref --stdin: use skip_prefix()SZEDER Gábor Sun, 3 Jun 2018 14:36:51 +0000 (16:36 +0200)

update-ref --stdin: use skip_prefix()

Use skip_prefix() instead of starts_with() and strcmp() when parsing
'git update-ref's stdin to avoid a couple of magic numbers.

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

sha1-file.c: correct $GITDIR to $GIT_DIR in a commentRobert P. J. Day Sun, 3 Jun 2018 14:32:50 +0000 (10:32 -0400)

sha1-file.c: correct $GITDIR to $GIT_DIR in a comment

Fix single misspelling of $GITDIR to correct $GIT_DIR in a comment.

Signed-off-by: Robert P. J. Day <rpjday@crashcourse.ca>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

sequencer.c: plug leaks in do_pick_commitStefan Beller Fri, 1 Jun 2018 20:01:45 +0000 (13:01 -0700)

sequencer.c: plug leaks in do_pick_commit

Going to leave, we additionally free the author and commit message
and make sure to call update_abort_safety_file().

Signed-off-by: Stefan Beller <sbeller@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

t9104: kosherly remove remote refsChristian Couder Fri, 1 Jun 2018 05:08:33 +0000 (07:08 +0200)

t9104: kosherly remove remote refs

As there are plans to implement other ref storage systems,
let's use a way to remove remote refs that does not depend
on refs being files.

This makes it clear to readers that this test does not
depend on which ref backend is used.

Suggested-by: Michael Haggerty <mhagger@alum.mit.edu>
Helped-by: Jeff King <peff@peff.net>
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

t3430: test clean-upbrian m. carlson Fri, 1 Jun 2018 17:46:39 +0000 (17:46 +0000)

t3430: test clean-up

Remove unnecessary test_tick etc...

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

upload-pack: reject shallow requests that would return... Nguyễn Thái Ngọc Duy Sat, 26 May 2018 11:35:18 +0000 (13:35 +0200)

upload-pack: reject shallow requests that would return nothing

Shallow clones with --shallow-since or --shalow-exclude work by
running rev-list to get all reachable commits, then draw a boundary
between reachable and unreachable and send "shallow" requests based on
that.

The code does miss one corner case: if rev-list returns nothing, we'll
have no border and we'll send no shallow requests back to the client
(i.e. no history cuts). This essentially means a full clone (or a full
branch if the client requests just one branch). One example is the
oldest commit is older than what is specified by --shallow-since.

To avoid this, if rev-list returns nothing, we abort the clone/fetch.
The user could adjust their request (e.g. --shallow-since further back
in the past) and retry.

Another possible option for this case is to fall back to a default
depth (like depth 1). But I don't like too much magic that way because
we may return something unexpected to the user. If they request
"history since 2008" and we return a single depth at 2000, that might
break stuff for them. It is better to tell them that something is
wrong and let them take the best course of action.

Note that we need to die() in get_shallow_commits_by_rev_list()
instead of just checking for empty result from its caller
deepen_by_rev_list() and handling the error there. The reason is,
empty result could be a valid case: if you have commits in year 2013
and you request --shallow-since=year.2000 then you should get a full
clone (i.e. empty result).

Reported-by: Andreas Krey <a.krey@gmx.de>
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Merge branch 'fr_2.18_round1' of git://github.com/jnavi... Jiang Xin Sun, 3 Jun 2018 23:58:22 +0000 (07:58 +0800)

Merge branch 'fr_2.18_round1' of git://github.com/jnavila/git

* 'fr_2.18_round1' of git://github.com/jnavila/git:
l10n: fr.po v2.18 round 1

l10n: fr.po v2.18 round 1Jean-Noël Avila Sun, 3 Jun 2018 14:36:32 +0000 (16:36 +0200)

l10n: fr.po v2.18 round 1

Signed-off-by: Jean-Noël Avila <jn.avila@free.fr>

l10n: vi(3470t): Updated Vietnamese translation for... Tran Ngoc Quan Sun, 3 Jun 2018 06:43:13 +0000 (13:43 +0700)

l10n: vi(3470t): Updated Vietnamese translation for v2.18.0

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

l10n: es.po: Spanish update for v2.18.0 round 1Christopher Diaz Riveros Fri, 1 Jun 2018 04:10:47 +0000 (23:10 -0500)

l10n: es.po: Spanish update for v2.18.0 round 1

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

A bit more topics before -rc1Junio C Hamano Fri, 1 Jun 2018 06:16:15 +0000 (15:16 +0900)

A bit more topics before -rc1

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

Merge branch 'bw/ref-prefix-for-configured-refspec'Junio C Hamano Fri, 1 Jun 2018 06:15:35 +0000 (15:15 +0900)

Merge branch 'bw/ref-prefix-for-configured-refspec'

* bw/ref-prefix-for-configured-refspec:
fetch: do not pass ref-prefixes for fetch by exact SHA1

fetch: do not pass ref-prefixes for fetch by exact... Jonathan Nieder Thu, 31 May 2018 07:23:39 +0000 (00:23 -0700)

fetch: do not pass ref-prefixes for fetch by exact SHA1

When v2.18.0-rc0~10^2~1 (refspec: consolidate ref-prefix generation
logic, 2018-05-16) factored out the ref-prefix generation code for
reuse, it left out the 'if (!item->exact_sha1)' test in the original
ref-prefix generation code. As a result, fetches by SHA-1 generate
ref-prefixes as though the SHA-1 being fetched were an abbreviated ref
name:

$ GIT_TRACE_PACKET=1 bin-wrappers/git -c protocol.version=2 \
fetch origin 12039e008f9a4e3394f3f94f8ea897785cb09448
[...]
packet: fetch> ref-prefix 12039e008f9a4e3394f3f94f8ea897785cb09448
packet: fetch> ref-prefix refs/12039e008f9a4e3394f3f94f8ea897785cb09448
packet: fetch> ref-prefix refs/tags/12039e008f9a4e3394f3f94f8ea897785cb09448
packet: fetch> ref-prefix refs/heads/12039e008f9a4e3394f3f94f8ea897785cb09448
packet: fetch> ref-prefix refs/remotes/12039e008f9a4e3394f3f94f8ea897785cb09448
packet: fetch> ref-prefix refs/remotes/12039e008f9a4e3394f3f94f8ea897785cb09448/HEAD
packet: fetch> 0000

If there is another ref name on the command line or the object being
fetched is already available locally, then that's mostly harmless.
But otherwise, we error out with

fatal: no matching remote head

since the server did not send any refs we are interested in. Filter
out the exact_sha1 refspecs to avoid this.

This patch adds a test to check this behavior that notices another
behavior difference between protocol v0 and v2 in the process. Add a
NEEDSWORK comment to clear it up.

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

Merge branch 'cc/tests-without-assuming-ref-files-backend'Junio C Hamano Fri, 1 Jun 2018 06:06:41 +0000 (15:06 +0900)

Merge branch 'cc/tests-without-assuming-ref-files-backend'

Quite a many tests assumed that newly created refs are made as
loose refs using the files backend, which have been updated to use
proper plumbing like rev-parse and update-ref, to avoid breakage
once we start using different ref backends.

* cc/tests-without-assuming-ref-files-backend:
t990X: use '.git/objects' as 'deep inside .git' path
t: make many tests depend less on the refs being files

Merge branch 'rd/init-typo'Junio C Hamano Fri, 1 Jun 2018 06:06:40 +0000 (15:06 +0900)

Merge branch 'rd/init-typo'

Message fix.

* rd/init-typo:
init: fix grammar in "templates not found" msg

Merge branch 'js/rebase-recreate-merge'Junio C Hamano Fri, 1 Jun 2018 06:06:40 +0000 (15:06 +0900)

Merge branch 'js/rebase-recreate-merge'

Hotfixes.

* js/rebase-recreate-merge:
sequencer: ensure labels that are object IDs are rewritten
git-rebase--interactive: fix copy-paste mistake

Merge branch 'rd/tag-doc-lightweight'Junio C Hamano Fri, 1 Jun 2018 06:06:39 +0000 (15:06 +0900)

Merge branch 'rd/tag-doc-lightweight'

Docfix.

* rd/tag-doc-lightweight:
tag: clarify in the doc that a tag can refer to a non-commit object

Merge branch 'rd/doc-options-placeholder'Junio C Hamano Fri, 1 Jun 2018 06:06:39 +0000 (15:06 +0900)

Merge branch 'rd/doc-options-placeholder'

Docfix.

* rd/doc-options-placeholder:
Use proper syntax for replaceables in command docs

Merge branch 'en/rev-parse-invalid-range'Junio C Hamano Fri, 1 Jun 2018 06:06:39 +0000 (15:06 +0900)

Merge branch 'en/rev-parse-invalid-range'

"git rev-parse Y..." etc. misbehaved when given endpoints were
not committishes.

* en/rev-parse-invalid-range:
rev-parse: check lookup'ed commit references for NULL

Merge branch 'ld/p4-unshelve'Junio C Hamano Fri, 1 Jun 2018 06:06:38 +0000 (15:06 +0900)

Merge branch 'ld/p4-unshelve'

"git p4" learned to "unshelve" shelved commit from P4.

* ld/p4-unshelve:
git-p4: add unshelve command

Merge branch 'nd/use-opt-int-set-f'Junio C Hamano Fri, 1 Jun 2018 06:06:38 +0000 (15:06 +0900)

Merge branch 'nd/use-opt-int-set-f'

Code simplification.

* nd/use-opt-int-set-f:
Use OPT_SET_INT_F() for cmdline option specification

Merge branch 'pa/import-tars-long-names'Junio C Hamano Fri, 1 Jun 2018 06:06:38 +0000 (15:06 +0900)

Merge branch 'pa/import-tars-long-names'

The import-tars script (in contrib/) has been taught to handle
tarballs with overly long paths that use PAX extended headers.

* pa/import-tars-long-names:
import-tars: read overlong names from pax extended header

Merge branch 'nd/command-list'Junio C Hamano Fri, 1 Jun 2018 06:06:37 +0000 (15:06 +0900)

Merge branch 'nd/command-list'

The list of commands with their various attributes were spread
across a few places in the build procedure, but it now is getting a
bit more consolidated to allow more automation.

* nd/command-list:
completion: allow to customize the completable command list
completion: add and use --list-cmds=alias
completion: add and use --list-cmds=nohelpers
Move declaration for alias.c to alias.h
completion: reduce completable command list
completion: let git provide the completable command list
command-list.txt: documentation and guide line
help: use command-list.txt for the source of guides
help: add "-a --verbose" to list all commands with synopsis
git: support --list-cmds=list-<category>
completion: implement and use --list-cmds=main,others
git --list-cmds: collect command list in a string_list
git.c: convert --list-* to --list-cmds=*
Remove common-cmds.h
help: use command-list.h for common command list
generate-cmds.sh: export all commands to command-list.h
generate-cmds.sh: factor out synopsis extract code

submodule--helper: plug mem leak in print_default_remoteStefan Beller Wed, 30 May 2018 17:03:02 +0000 (10:03 -0700)

submodule--helper: plug mem leak in print_default_remote

Signed-off-by: Stefan Beller <sbeller@google.com>
Acked-by: Johannes Schindelin <johannes.schindelin@gmx.de>
[jc: no need for remote to be const char *]
Signed-off-by: Junio C Hamano <gitster@pobox.com>

index-pack: handle --strict checks of non-repo packsJeff King Thu, 31 May 2018 22:45:31 +0000 (18:45 -0400)

index-pack: handle --strict checks of non-repo packs

Commit 73c3f0f704 (index-pack: check .gitmodules files with
--strict, 2018-05-04) added a call to add_packed_git(), with
the intent that the newly-indexed objects would be available
to the process when we run fsck_finish(). But that's not
what add_packed_git() does. It only allocates the struct,
and you must install_packed_git() on the result. So that
call was effectively doing nothing (except leaking a
struct).

But wait, we passed all of the tests! Does that mean we
don't need the call at all?

For normal cases, no. When we run "index-pack --stdin"
inside a repository, we write the new pack into the object
directory. If fsck_finish() needs to access one of the new
objects, then our initial lookup will fail to find it, but
we'll follow up by running reprepare_packed_git() and
looking again. That logic was meant to handle somebody else
repacking simultaneously, but it ends up working for us
here.

But there is a case that does need this, that we were not
testing. You can run "git index-pack foo.pack" on any file,
even when it is not inside the object directory. Or you may
not even be in a repository at all! This case fails without
doing the proper install_packed_git() call.

We can make this work by adding the install call.

Note that we should be prepared to handle add_packed_git()
failing. We can just silently ignore this case, though. If
fsck_finish() later needs the objects and they're not
available, it will complain itself. And if it doesn't
(because we were able to resolve the whole fsck in the first
pass), then it actually isn't an interesting error at all.

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

prepare_commit_graft: treat non-repository as a noopJeff King Thu, 31 May 2018 22:42:53 +0000 (18:42 -0400)

prepare_commit_graft: treat non-repository as a noop

The parse_commit_buffer() function consults lookup_commit_graft()
to see if we need to rewrite parents. The latter will look
at $GIT_DIR/info/grafts. If you're outside of a repository,
then this will trigger a BUG() as of b1ef400eec (setup_git_env:
avoid blind fall-back to ".git", 2016-10-20).

It's probably uncommon to actually parse a commit outside of
a repository, but you can see it in action with:

cd /not/a/git/repo
git index-pack --strict /some/file.pack

This works fine without --strict, but the fsck checks will
try to parse any commits, triggering the BUG(). We can fix
that by teaching the graft code to behave as if there are no
grafts when we aren't in a repository.

Arguably index-pack (and fsck) are wrong to consider grafts
at all. So another solution is to disable grafts entirely
for those commands. But given that the graft feature is
deprecated anyway, it's not worth even thinking through the
ramifications that might have.

There is one other corner case I considered here. What
should:

cd /not/a/git/repo
export GIT_GRAFT_FILE=/file/with/grafts
git index-pack --strict /some/file.pack

do? We don't have a repository, but the user has pointed us
directly at a graft file, which we could respect. I believe
this case did work that way prior to b1ef400eec. However,
fixing it now would be pretty invasive. Back then we would
just call into setup_git_env() even without a repository.
But these days it actually takes a git_dir argument. So
there would be a fair bit of refactoring of the setup code
involved.

Given the obscurity of this case, plus the fact that grafts
are deprecated and probably shouldn't work under index-pack
anyway, it's not worth pursuing further. This patch at least
un-breaks the common case where you're _not_ using grafts,
but we BUG() anyway trying to even find that out.

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

refspec-api: avoid uninitialized field in refspec itemJunio C Hamano Fri, 1 Jun 2018 02:33:19 +0000 (11:33 +0900)

refspec-api: avoid uninitialized field in refspec item

When parse_refspec() function was created at 3eec3700 ("refspec:
factor out parsing a single refspec", 2018-05-16) to take a caller
supplied piece of memory to fill parsed refspec_item, it forgot that
a refspec without colon must set item->dst to NULL to let the users
of refspec know that the result of the fetch does not get stored in
an ref on our side.

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

refs/packed-backend.c: close fd of empty fileStefan Beller Wed, 30 May 2018 17:03:00 +0000 (10:03 -0700)

refs/packed-backend.c: close fd of empty file

Signed-off-by: Stefan Beller <sbeller@google.com>
Acked-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

p4.txt: Use backquotes for variable namesRobert P. J. Day Wed, 30 May 2018 13:04:00 +0000 (09:04 -0400)

p4.txt: Use backquotes for variable names

For consistency, use backquotes when referring to environment
variables, as is done in other man pages.

Signed-off-by: Robert P. J. Day <rpjday@crashcourse.ca>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

remote.txt: update documentation for 'update' commandDuy Nguyen Wed, 30 May 2018 15:37:01 +0000 (17:37 +0200)

remote.txt: update documentation for 'update' command

Commit b344e1614b (git remote update: Fallback to remote if group does
not exist - 2009-04-06) lets "git remote update" accept individual
remotes as well. Previously this command only accepted remote
groups. The commit updates the command syntax but not the actual
document of this subcommand. Update it.

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

completion: complete remote names tooŁukasz Stelmach Fri, 25 May 2018 10:48:42 +0000 (12:48 +0200)

completion: complete remote names too

"git remote update" accepts both groups and single remotes.

Signed-off-by: Łukasz Stelmach <l.stelmach@samsung.com>
Reviewed-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

RelNotes: remove duplicate release noteElijah Newren Thu, 31 May 2018 03:24:14 +0000 (20:24 -0700)

RelNotes: remove duplicate release note

In the 2.18 cycle, directory rename detection was merged, then reverted,
then reworked in such a way to fix another prominent bug in addition to
the original problem causing it to be reverted. When the reworked series
was merged, we ended up with two nearly duplicate release notes. Remove
the second copy, but preserve the information about the extra bug fix.

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

rebase: remove -p code from git-rebase--interactive.shAlban Gruin Mon, 28 May 2018 12:34:22 +0000 (14:34 +0200)

rebase: remove -p code from git-rebase--interactive.sh

All the code specific to preserve-merges was moved to
git-rebase--preserve-merges.sh, and so it’s useless to keep it
here.

The intent of this commit is to clean this script as much as possible to
prepare a peaceful conversion as a builtin written in C.

Signed-off-by: Alban Gruin <alban.gruin@gmail.com>

rebase: use the new git-rebase--preserve-merges.shAlban Gruin Mon, 28 May 2018 12:34:21 +0000 (14:34 +0200)

rebase: use the new git-rebase--preserve-merges.sh

Create a new type of rebase, "preserve-merges", used when rebase is
called with -p.

Before that, the type for preserve-merges was "interactive", and some
places of this script compared $type to "interactive". Instead, the code
now checks if $interactive_rebase is empty or not, as it is set to
"explicit" when calling an interactive rebase (and, possibly, one of its
submodes), and "implied" when calling one of its
submodes (eg. preserve-merges) *without* interactive rebase.

It also detects the presence of the directory "$merge_dir"/rewritten
left by the preserve-merges script when calling rebase --continue,
--skip, etc., and, if it exists, sets the rebase mode to
preserve-merges. In this case, interactive_rebase is set to "explicit",
as "implied" would break some tests.

Signed-off-by: Alban Gruin <alban.gruin@gmail.com>

rebase: strip unused code in git-rebase--preserve-merges.shAlban Gruin Mon, 28 May 2018 12:34:20 +0000 (14:34 +0200)

rebase: strip unused code in git-rebase--preserve-merges.sh

This removes the code coming from git-rebase--interactive.sh that is not
needed by preserve-merges, and changes the header comment accordingly.

In a following commit, the -p code from git-rebase--interactive.sh will
be stripped out. As preserve-merges’ successor is already in the works,
this will be the only script to be converted.

This also seems to fix a bug where a failure in
`pick_one_preserving_merges()` would fallback to the non-preserve-merges
`pick_one()`.

Signed-off-by: Alban Gruin <alban.gruin@gmail.com>

rebase: introduce a dedicated backend for --preserve... Alban Gruin Mon, 28 May 2018 12:34:19 +0000 (14:34 +0200)

rebase: introduce a dedicated backend for --preserve-merges

This duplicates git-rebase--interactive.sh to
git-rebase--preserve-merges.sh. This is done to split -p from -i. No
modifications are made to this file here, but any code that is not used
by -p will be stripped in the next commit.

Signed-off-by: Alban Gruin <alban.gruin@gmail.com>

note git-security@googlegroups.com in more placesThomas Gummerer Wed, 30 May 2018 20:52:55 +0000 (21:52 +0100)

note git-security@googlegroups.com in more places

Add a mention of the security mailing list to the README, and to
Documentation/SubmittingPatches.. 2caa7b8d27 ("git manpage: note
git-security@googlegroups.com", 2018-03-08) already added it to the
man page, but for developers either the README, or the documentation
on how to contribute (SubmittingPatches) may be the first place to
look.

Use the same wording as we already have on the git-scm.com website and
in the man page for the README, while the wording is adjusted in
SubmittingPatches to match the surrounding document better.

Signed-off-by: Thomas Gummerer <t.gummerer@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

SubmittingPatches: replace numbered attributes with... Thomas Gummerer Wed, 30 May 2018 20:52:54 +0000 (21:52 +0100)

SubmittingPatches: replace numbered attributes with names

Use names instead of numbers for the AsciiDoc attributes that are used
for the footnotes. We will add more footnotes in subsequent commits,
and attributes should ideally all be unique. Having named attributes
will help ensure uniqueness, and we won't have to re-number the
attributes if we add a footnote earlier in the document.

In addition it also clarifies that the attribute name/number is not
related to the number the footnote will get in the output.

Signed-off-by: Thomas Gummerer <t.gummerer@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

l10n: git.pot: v2.18.0 round 1 (108 new, 14 removed)Jiang Xin Thu, 31 May 2018 15:35:22 +0000 (23:35 +0800)

l10n: git.pot: v2.18.0 round 1 (108 new, 14 removed)

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

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

Merge remote-tracking branch 'git-po/maint'Jiang Xin Thu, 31 May 2018 15:30:13 +0000 (23:30 +0800)

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

* git-po/maint:
l10n: TEAMS: remove inactive de team members
l10n: de.po: fix typos
l10n: Update Catalan translation

Git 2.18-rc0 v2.18.0-rc0Junio C Hamano Wed, 30 May 2018 12:51:57 +0000 (21:51 +0900)

Git 2.18-rc0

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

Merge branch 'bw/remote-curl-compressed-responses'Junio C Hamano Wed, 30 May 2018 12:51:29 +0000 (21:51 +0900)

Merge branch 'bw/remote-curl-compressed-responses'

Our HTTP client code used to advertise that we accept gzip encoding
from the other side; instead, just let cURL library to advertise
and negotiate the best one.

* bw/remote-curl-compressed-responses:
remote-curl: accept compressed responses with protocol v2
remote-curl: accept all encodings supported by curl

Merge branch 'ma/unpack-trees-free-msgs'Junio C Hamano Wed, 30 May 2018 12:51:29 +0000 (21:51 +0900)

Merge branch 'ma/unpack-trees-free-msgs'

Leak plugging.

* ma/unpack-trees-free-msgs:
unpack_trees_options: free messages when done
argv-array: return the pushed string from argv_push*()
merge-recursive: provide pair of `unpack_trees_{start,finish}()`
merge: setup `opts` later in `checkout_fast_forward()`

Merge branch 'bc/hash-independent-tests'Junio C Hamano Wed, 30 May 2018 12:51:28 +0000 (21:51 +0900)

Merge branch 'bc/hash-independent-tests'

Many tests hardcode the raw object names, which would change once
we migrate away from SHA-1. While some of them must test against
exact object names, most of them do not have to use hardcoded
constants in the test. The latter kind of tests have been updated
to test the moral equivalent of the original without hardcoding the
actual object names.

* bc/hash-independent-tests: (28 commits)
t5300: abstract away SHA-1-specific constants
t4208: abstract away SHA-1-specific constants
t4045: abstract away SHA-1-specific constants
t4042: abstract away SHA-1-specific constants
t4205: sort log output in a hash-independent way
t/lib-diff-alternative: abstract away SHA-1-specific constants
t4030: abstract away SHA-1-specific constants
t4029: abstract away SHA-1-specific constants
t4029: fix test indentation
t4022: abstract away SHA-1-specific constants
t4020: abstract away SHA-1-specific constants
t4014: abstract away SHA-1-specific constants
t4008: abstract away SHA-1-specific constants
t4007: abstract away SHA-1-specific constants
t3905: abstract away SHA-1-specific constants
t3702: abstract away SHA-1-specific constants
t3103: abstract away SHA-1-specific constants
t2203: abstract away SHA-1-specific constants
t: skip pack tests if not using SHA-1
t4044: skip test if not using SHA-1
...

Merge branch 'ma/regex-no-regfree-after-comp-fail'Junio C Hamano Wed, 30 May 2018 12:51:28 +0000 (21:51 +0900)

Merge branch 'ma/regex-no-regfree-after-comp-fail'

We used to call regfree() after regcomp() failed in some codepaths,
which have been corrected.

* ma/regex-no-regfree-after-comp-fail:
regex: do not call `regfree()` if compilation fails

Merge branch 'ma/config-store-data-clear'Junio C Hamano Wed, 30 May 2018 12:51:28 +0000 (21:51 +0900)

Merge branch 'ma/config-store-data-clear'

Leak plugging.

* ma/config-store-data-clear:
config: let `config_store_data_clear()` handle `key`
config: let `config_store_data_clear()` handle `value_regex`
config: free resources of `struct config_store_data`

Merge branch 'jk/snprintf-truncation'Junio C Hamano Wed, 30 May 2018 12:51:27 +0000 (21:51 +0900)

Merge branch 'jk/snprintf-truncation'

Avoid unchecked snprintf() to make future code auditing easier.

* jk/snprintf-truncation:
fmt_with_err: add a comment that truncation is OK
shorten_unambiguous_ref: use xsnprintf
fsmonitor: use internal argv_array of struct child_process
log_write_email_headers: use strbufs
http: use strbufs instead of fixed buffers

Merge branch 'jk/config-blob-sans-repo'Junio C Hamano Wed, 30 May 2018 12:51:27 +0000 (21:51 +0900)

Merge branch 'jk/config-blob-sans-repo'

Error codepath fix.

* jk/config-blob-sans-repo:
config: die when --blob is used outside a repository

Merge branch 'sb/submodule-merge-in-merge-recursive'Junio C Hamano Wed, 30 May 2018 12:51:27 +0000 (21:51 +0900)

Merge branch 'sb/submodule-merge-in-merge-recursive'

By code restructuring of submodule merge in merge-recursive,
informational messages from the codepath are now given using the
same mechanism as other output, and honor the merge.verbosity
configuration. The code also learned to give a few new messages
when a submodule three-way merge resolves cleanly when one side
records a descendant of the commit chosen by the other side.

* sb/submodule-merge-in-merge-recursive:
merge-recursive: give notice when submodule commit gets fast-forwarded
merge-recursive: i18n submodule merge output and respect verbosity
submodule.c: move submodule merging to merge-recursive.c

Merge branch 'js/empty-config-section-fix'Junio C Hamano Wed, 30 May 2018 12:51:26 +0000 (21:51 +0900)

Merge branch 'js/empty-config-section-fix'

Error codepath fix.

* js/empty-config-section-fix:
config: a user-provided invalid section is not a BUG

Merge branch 'bw/ref-prefix-for-configured-refspec'Junio C Hamano Wed, 30 May 2018 12:51:26 +0000 (21:51 +0900)

Merge branch 'bw/ref-prefix-for-configured-refspec'

"git fetch $there $refspec" that talks over protocol v2 can take
advantage of server-side ref filtering; the code has been extended
so that this mechanism triggers also when fetching with configured
refspec.

* bw/ref-prefix-for-configured-refspec: (38 commits)
fetch: generate ref-prefixes when using a configured refspec
refspec: consolidate ref-prefix generation logic
submodule: convert push_unpushed_submodules to take a struct refspec
remote: convert check_push_refs to take a struct refspec
remote: convert match_push_refs to take a struct refspec
http-push: store refspecs in a struct refspec
transport: remove transport_verify_remote_names
send-pack: store refspecs in a struct refspec
transport: convert transport_push to take a struct refspec
push: convert to use struct refspec
push: check for errors earlier
remote: convert match_explicit_refs to take a struct refspec
remote: convert get_ref_match to take a struct refspec
remote: convert query_refspecs to take a struct refspec
remote: convert apply_refspecs to take a struct refspec
remote: convert get_stale_heads to take a struct refspec
fetch: convert prune_refs to take a struct refspec
fetch: convert get_ref_map to take a struct refspec
fetch: convert do_fetch to take a struct refspec
refspec: remove the deprecated functions
...

Merge branch 'sb/grep-die-on-unreadable-index'Junio C Hamano Wed, 30 May 2018 12:51:26 +0000 (21:51 +0900)

Merge branch 'sb/grep-die-on-unreadable-index'

Error behaviour of "git grep" when it cannot read the index was
inconsistent with other commands that uses the index, which has
been corrected to error out early.

* sb/grep-die-on-unreadable-index:
grep: handle corrupt index files early

The seventh batch for 2.18Junio C Hamano Wed, 30 May 2018 05:10:34 +0000 (14:10 +0900)

The seventh batch for 2.18

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

Merge branch 'sb/submodule-update-try-harder'Junio C Hamano Wed, 30 May 2018 05:04:12 +0000 (14:04 +0900)

Merge branch 'sb/submodule-update-try-harder'

"git submodule update" attempts two different kinds of "git fetch"
against the upstream repository to grab a commit bound at the
submodule's path, but it incorrectly gave up if the first kind
(i.e. a normal fetch) failed, making the second "last resort" one
(i.e. fetching an exact commit object by object name) ineffective.
This has been corrected.

* sb/submodule-update-try-harder:
git-submodule.sh: try harder to fetch a submodule

Merge branch 'lm/credential-netrc'Junio C Hamano Wed, 30 May 2018 05:04:11 +0000 (14:04 +0900)

Merge branch 'lm/credential-netrc'

Update credential-netrc helper (in contrib/) to allow customizing
the GPG used to decrypt the encrypted .netrc file.

* lm/credential-netrc:
git-credential-netrc: accept gpg option
git-credential-netrc: adapt to test framework for git

Merge branch 'ab/get-short-oid'Junio C Hamano Wed, 30 May 2018 05:04:11 +0000 (14:04 +0900)

Merge branch 'ab/get-short-oid'

When a short hexadecimal string is used to name an object but there
are multiple objects that share the string as the prefix of their
names, the code lists these ambiguous candidates in a help message.
These object names are now sorted according to their types for
easier eyeballing.

* ab/get-short-oid:
get_short_oid: sort ambiguous objects by type, then SHA-1
sha1-name.c: move around the collect_ambiguous() function
git-p4: change "commitish" typo to "committish"
sha1-array.h: align function arguments
sha1-name.c: remove stray newline

Merge branch 'jt/partial-clone-proto-v2'Junio C Hamano Wed, 30 May 2018 05:04:10 +0000 (14:04 +0900)

Merge branch 'jt/partial-clone-proto-v2'

Transfer protocol v2 learned to support the partial clone.

* jt/partial-clone-proto-v2:
{fetch,upload}-pack: support filter in protocol v2
upload-pack: read config when serving protocol v2
upload-pack: fix error message typo

Merge branch 'bc/object-id'Junio C Hamano Wed, 30 May 2018 05:04:10 +0000 (14:04 +0900)

Merge branch 'bc/object-id'

Conversion from uchar[20] to struct object_id continues.

* bc/object-id: (42 commits)
merge-one-file: compute empty blob object ID
add--interactive: compute the empty tree value
Update shell scripts to compute empty tree object ID
sha1_file: only expose empty object constants through git_hash_algo
dir: use the_hash_algo for empty blob object ID
sequencer: use the_hash_algo for empty tree object ID
cache-tree: use is_empty_tree_oid
sha1_file: convert cached object code to struct object_id
builtin/reset: convert use of EMPTY_TREE_SHA1_BIN
builtin/receive-pack: convert one use of EMPTY_TREE_SHA1_HEX
wt-status: convert two uses of EMPTY_TREE_SHA1_HEX
submodule: convert several uses of EMPTY_TREE_SHA1_HEX
sequencer: convert one use of EMPTY_TREE_SHA1_HEX
merge: convert empty tree constant to the_hash_algo
builtin/merge: switch tree functions to use object_id
builtin/am: convert uses of EMPTY_TREE_SHA1_BIN to the_hash_algo
sha1-file: add functions for hex empty tree and blob OIDs
builtin/receive-pack: avoid hard-coded constants for push certs
diff: specify abbreviation size in terms of the_hash_algo
upload-pack: replace use of several hard-coded constants
...

Merge branch 'sb/blame-color'Junio C Hamano Wed, 30 May 2018 05:04:09 +0000 (14:04 +0900)

Merge branch 'sb/blame-color'

"git blame" learns to unhighlight uninteresting metadata from the
originating commit on lines that are the same as the previous one,
and also paint lines in different colors depending on the age of
the commit.

* sb/blame-color:
builtin/blame: add new coloring scheme config
builtin/blame: highlight recently changed lines
builtin/blame: dim uninteresting metadata lines

Merge branch 'cf/submodule-progress-dissociate'Junio C Hamano Wed, 30 May 2018 05:04:09 +0000 (14:04 +0900)

Merge branch 'cf/submodule-progress-dissociate'

"git submodule update" and "git submodule add" supported the
"--reference" option to borrow objects from a neighbouring local
repository like "git clone" does, but lacked the more recent
invention "--dissociate". Also "git submodule add" has been taught
to take the "--progress" option.

* cf/submodule-progress-dissociate:
submodule: add --dissociate option to add/update commands
submodule: add --progress option to add command
submodule: clean up substitutions in script

Merge branch 'sg/complete-paths'Junio C Hamano Wed, 30 May 2018 05:04:08 +0000 (14:04 +0900)

Merge branch 'sg/complete-paths'

Command line completion (in contrib/) learned to complete pathnames
for various commands better.

* sg/complete-paths:
t9902-completion: exercise __git_complete_index_file() directly
completion: don't return with error from __gitcomp_file_direct()
completion: fill COMPREPLY directly when completing paths
completion: improve handling quoted paths in 'git ls-files's output
completion: remove repeated dirnames with 'awk' during path completion
t9902-completion: ignore COMPREPLY element order in some tests
completion: use 'awk' to strip trailing path components
completion: let 'ls-files' and 'diff-index' filter matching paths
completion: improve handling quoted paths on the command line
completion: support completing non-ASCII pathnames
completion: simplify prefix path component handling during path completion
completion: move __git_complete_index_file() next to its helpers
t9902-completion: add tests demonstrating issues with quoted pathnames

Merge branch 'nd/travis-gcc-8'Junio C Hamano Wed, 30 May 2018 05:04:08 +0000 (14:04 +0900)

Merge branch 'nd/travis-gcc-8'

Developer support. Use newer GCC on one of the builds done at
TravisCI.org to get more warnings and errors diagnosed.

* nd/travis-gcc-8:
travis-ci: run gcc-8 on linux-gcc jobs

Merge branch 'nd/pack-struct-commit'Junio C Hamano Wed, 30 May 2018 05:04:08 +0000 (14:04 +0900)

Merge branch 'nd/pack-struct-commit'

Memory optimization.

* nd/pack-struct-commit:
commit.h: rearrange 'index' to shrink struct commit

Merge branch 'ma/create-pseudoref-with-null-old-oid'Junio C Hamano Wed, 30 May 2018 05:04:08 +0000 (14:04 +0900)

Merge branch 'ma/create-pseudoref-with-null-old-oid'

"git update-ref A B" is supposed to ensure that ref A does not yet
exist when B is a NULL OID, but this check was not done correctly
for pseudo-refs outside refs/ hierarchy, e.g. MERGE_HEAD.

* ma/create-pseudoref-with-null-old-oid:
refs: handle zero oid for pseudorefs
t1400: add tests around adding/deleting pseudorefs
refs.c: refer to "object ID", not "sha1", in error messages

Merge branch 'jk/unavailable-can-be-missing'Junio C Hamano Wed, 30 May 2018 05:04:07 +0000 (14:04 +0900)

Merge branch 'jk/unavailable-can-be-missing'

Code clean-up to turn history traversal more robust in a
semi-corrupt repository.

* jk/unavailable-can-be-missing:
mark_parents_uninteresting(): avoid most allocation
mark_parents_uninteresting(): replace list with stack
mark_parents_uninteresting(): drop missing object check
mark_tree_contents_uninteresting(): drop missing object check

Merge branch 'bp/status-rename-config'Junio C Hamano Wed, 30 May 2018 05:04:07 +0000 (14:04 +0900)

Merge branch 'bp/status-rename-config'

"git status" learned to honor a new status.renames configuration to
skip rename detection, which could be useful for those who want to
do so without disabling the default rename detection done by the
"git diff" command.

* bp/status-rename-config:
add status config and command line options for rename detection

Merge branch 'js/use-bug-macro'Junio C Hamano Wed, 30 May 2018 05:04:07 +0000 (14:04 +0900)

Merge branch 'js/use-bug-macro'

Developer support update, by using BUG() macro instead of die() to
mark codepaths that should not happen more clearly.

* js/use-bug-macro:
BUG_exit_code: fix sparse "symbol not declared" warning
Convert remaining die*(BUG) messages
Replace all die("BUG: ...") calls by BUG() ones
run-command: use BUG() to report bugs, not die()
test-tool: help verifying BUG() code paths

Merge branch 'rs/no-null-ptr-arith-in-fast-export'Junio C Hamano Wed, 30 May 2018 05:04:06 +0000 (14:04 +0900)

Merge branch 'rs/no-null-ptr-arith-in-fast-export'

Code clean-up to avoid non-standard-conformant pointer arithmetic.

* rs/no-null-ptr-arith-in-fast-export:
fast-export: avoid NULL pointer arithmetic

Merge branch 'nd/repo-clear-keep-the-index'Junio C Hamano Wed, 30 May 2018 05:04:05 +0000 (14:04 +0900)

Merge branch 'nd/repo-clear-keep-the-index'

the_repository->index is not a allocated piece of memory but
repo_clear() indiscriminately attempted to free(3) it, which has
been corrected.

* nd/repo-clear-keep-the-index:
repository: fix free problem with repo_clear(the_repository)

Merge branch 'ma/lockfile-cleanup'Junio C Hamano Wed, 30 May 2018 05:04:05 +0000 (14:04 +0900)

Merge branch 'ma/lockfile-cleanup'

Code clean-up to adjust to a more recent lockfile API convention that
allows lockfile instances kept on the stack.

* ma/lockfile-cleanup:
lock_file: move static locks into functions
lock_file: make function-local locks non-static
refs.c: do not die if locking fails in `delete_pseudoref()`
refs.c: do not die if locking fails in `write_pseudoref()`
t/helper/test-write-cache: clean up lock-handling

Merge branch 'sg/t6500-no-redirect-of-stdin'Junio C Hamano Wed, 30 May 2018 05:04:04 +0000 (14:04 +0900)

Merge branch 'sg/t6500-no-redirect-of-stdin'

Test cleanup.

* sg/t6500-no-redirect-of-stdin:
t6050-replace: don't disable stdin for the whole test script

Merge branch 'bp/merge-rename-config'Junio C Hamano Wed, 30 May 2018 05:04:04 +0000 (14:04 +0900)

Merge branch 'bp/merge-rename-config'

With merge.renames configuration set to false, the recursive merge
strategy can be told not to spend cycles trying to find renamed
paths and merge them accordingly.

* bp/merge-rename-config:
merge: pass aggressive when rename detection is turned off
merge: add merge.renames config setting
merge: update documentation for {merge,diff}.renameLimit

Merge branch 'js/sequencer-and-root-commits'Junio C Hamano Wed, 30 May 2018 05:04:04 +0000 (14:04 +0900)

Merge branch 'js/sequencer-and-root-commits'

The implementation of "git rebase -i --root" has been updated to use
the sequencer machinery more.

* js/sequencer-and-root-commits:
rebase --rebase-merges: root commits can be cousins, too
rebase --rebase-merges: a "merge" into a new root is a fast-forward
sequencer: allow introducing new root commits
rebase -i --root: let the sequencer handle even the initial part
sequencer: learn about the special "fake root commit" handling
sequencer: extract helper to update active_cache_tree

Merge branch 'dd/send-email-reedit'Junio C Hamano Wed, 30 May 2018 05:04:03 +0000 (14:04 +0900)

Merge branch 'dd/send-email-reedit'

"git send-email" can sometimes offer confirmation dialog "Send this
email?" with choices 'Yes', 'No', 'Quit', and 'All'. A new action
'Edit' has been added to this dialog's choice.

* dd/send-email-reedit:
git-send-email: allow re-editing of message

init: fix grammar in "templates not found" msgRobert P. J. Day Tue, 29 May 2018 12:14:35 +0000 (08:14 -0400)

init: fix grammar in "templates not found" msg

Signed-off-by: Robert P. J. Day <rpjday@crashcourse.ca>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

sequencer: ensure labels that are object IDs are rewrittenbrian m. carlson Tue, 29 May 2018 16:32:36 +0000 (16:32 +0000)

sequencer: ensure labels that are object IDs are rewritten

When writing the todo script for --rebase-merges, we try to find a label
for certain commits. If the label ends up being a valid object ID, such
as when we merge a detached commit, we want to rewrite it so it is no
longer a valid object ID.

However, the code path that does this checks for its length to be
equivalent to GIT_SHA1_RAWSZ, which isn't correct, since what we are
reading is a hex object ID. Instead, check for the length being
equivalent to that of a hex object ID. Use the_hash_algo so this code
works regardless of the hash size.

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

t990X: use '.git/objects' as 'deep inside .git' pathChristian Couder Sat, 26 May 2018 06:47:45 +0000 (08:47 +0200)

t990X: use '.git/objects' as 'deep inside .git' path

Tests t9902-completion.sh and t9903-bash-prompt.sh each have tests
that check what happens when we are "in the '.git' directory" and
when we are "deep inside the '.git' directory".

To test the case when we are "deep inside the '.git' directory" the
test scripts used to perform a `cd .git/refs/heads`.

As there are plans to implement other ref storage systems, let's
use '.git/objects' instead of '.git/refs/heads' as the "deep inside
the '.git' directory" path.

This makes it clear to readers that these tests do not depend on
which ref backend is used.

The internals of the loose refs backend are still tested in
t1400-update-ref.sh.

Helped-by: SZEDER Gábor <szeder.dev@gmail.com>
Signed-off-by: David Turner <dturner@twopensource.com>
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Reviewed-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Sync with Git 2.17.1Junio C Hamano Tue, 29 May 2018 08:09:58 +0000 (17:09 +0900)

Sync with Git 2.17.1

* maint: (25 commits)
Git 2.17.1
Git 2.16.4
Git 2.15.2
Git 2.14.4
Git 2.13.7
fsck: complain when .gitmodules is a symlink
index-pack: check .gitmodules files with --strict
unpack-objects: call fsck_finish() after fscking objects
fsck: call fsck_finish() after fscking objects
fsck: check .gitmodules content
fsck: handle promisor objects in .gitmodules check
fsck: detect gitmodules files
fsck: actually fsck blob data
fsck: simplify ".git" check
index-pack: make fsck error message more specific
verify_path: disallow symlinks in .gitmodules
update-index: stat updated files earlier
verify_dotfile: mention case-insensitivity in comment
verify_path: drop clever fallthrough
skip_prefix: add case-insensitive variant
...

completion: complete general config vars in two stepsNguyễn Thái Ngọc Duy Sun, 27 May 2018 18:28:00 +0000 (20:28 +0200)

completion: complete general config vars in two steps

There are 581 config variables as of now when you do "git config
<tab>" which can fill up a few screens and is not very helpful when
you have to look through columns of text to find what you want.

This patch instead shows you only first level when you do

git config <tab>

There are 78 items, which use up 8 rows in my screen. Compared to
screens of text, it's pretty good. Once you have chosen you first
level, e.g. color:

git config color.<tab>

will show you all color.*

This is not a new idea. branch.* and remote.* completion already does
this for second and third levels. For those variables, you'll need to
<tab> three times to get full variable name.

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

log-tree: allow to customize 'grafted' colorNguyễn Thái Ngọc Duy Sat, 26 May 2018 13:55:31 +0000 (15:55 +0200)

log-tree: allow to customize 'grafted' color

Commit 76f5df305b (log: decorate grafted commits with "grafted" -
2011-08-18) lets us decorate grafted commits but I forgot about the
color.decorate.* config.

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

completion: support case-insensitive config varsNguyễn Thái Ngọc Duy Sat, 26 May 2018 13:55:30 +0000 (15:55 +0200)

completion: support case-insensitive config vars

Config variables are case-insensitive but this case/esac construct is
case-sensitive by default. For bash v4, it'll be easy. For platforms
that are stuck with older versions, we need an external command, but
that is not that critical. And where this additional overhead matters
the most is Windows, but luckily Git for Windows ships with Bash v4.

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

completion: keep other config var completion in camelCaseNguyễn Thái Ngọc Duy Sat, 26 May 2018 13:55:29 +0000 (15:55 +0200)

completion: keep other config var completion in camelCase

The last patch makes "git config <tab>" shows camelCase names because
that's what's in the source: config.txt. There are still a couple
manual var completion in this code. Let's make them follow the naming
convention as well.

In theory we could automate this part too because we have the
information. But let's stick to one step at a time and leave this for
later.

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

completion: drop the hard coded list of config varsNguyễn Thái Ngọc Duy Sat, 26 May 2018 13:55:28 +0000 (15:55 +0200)

completion: drop the hard coded list of config vars

The new help option --config-for-completion is a machine friendlier
version of --config where all the placeholders and wildcards are
dropped, leaving only the good, completable prefixes for
git-completion.bash to consume.

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

am: move advice.amWorkDir parsing back to advice.cNguyễn Thái Ngọc Duy Sat, 26 May 2018 13:55:27 +0000 (15:55 +0200)

am: move advice.amWorkDir parsing back to advice.c

The only benefit from this move (apart from cleaner code) is that
advice.amWorkDir should now show up in `git help --config`. There
should be no regression since advice config is always read by the
git_default_config().

While at there, use advise() like other code. We now get "hint: "
prefix and the output is stderr instead of stdout (which is also the
reason for the test update because stderr is checked in a following
test and the extra advice can fail it).

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

advice: keep config name in camelCase in advice_config[]Nguyễn Thái Ngọc Duy Sat, 26 May 2018 13:55:26 +0000 (15:55 +0200)

advice: keep config name in camelCase in advice_config[]

For parsing, we don't really need this because the main config parser
will lowercase everything so we can do exact matching. But this array
now is also used for printing in `git help --config`. Keep camelCase
so we have a nice printout.

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

fsck: produce camelCase config key namesNguyễn Thái Ngọc Duy Sat, 26 May 2018 13:55:25 +0000 (15:55 +0200)

fsck: produce camelCase config key names

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

help: add --config to list all available configNguyễn Thái Ngọc Duy Sat, 26 May 2018 13:55:24 +0000 (15:55 +0200)

help: add --config to list all available config

Sometimes it helps to list all available config vars so the user can
search for something they want. The config man page can also be used
but it's harder to search if you want to focus on the variable name,
for example.

This is not the best way to collect the available config since it's
not precise. Ideally we should have a centralized list of config in C
code (pretty much like 'struct option'), but that's a lot more work.
This will do for now.

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

fsck: factor out msg_id_info[] lazy initialization... Nguyễn Thái Ngọc Duy Sat, 26 May 2018 13:55:23 +0000 (15:55 +0200)

fsck: factor out msg_id_info[] lazy initialization code

This array will be used by some other function than parse_msg_id() in
the following commit. Factor out this prep code so it could be called
from that one.

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

grep: keep all colors in an arrayNguyễn Thái Ngọc Duy Sat, 26 May 2018 13:55:22 +0000 (15:55 +0200)

grep: keep all colors in an array

This is more inline with how we handle color slots in other code. It
also allows us to get the list of configurable color slots later.

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

Add and use generic name->id mapping code for color... Nguyễn Thái Ngọc Duy Sat, 26 May 2018 13:55:21 +0000 (15:55 +0200)

Add and use generic name->id mapping code for color slot parsing

Instead of hard coding the name-to-id mapping in C code, keep it in an
array and use a common function to do the parsing. This reduces code
and also allows us to list all possible color slots later.

This starts using C99 designated initializers more for convenience
(the first designated initializers have been introduced in builtin/clean.c
for some time without complaints)

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

Merge branch 'nd/command-list' into nd/complete-config... Junio C Hamano Tue, 29 May 2018 05:51:14 +0000 (14:51 +0900)

Merge branch 'nd/command-list' into nd/complete-config-vars

* nd/command-list:
completion: allow to customize the completable command list
completion: add and use --list-cmds=alias
completion: add and use --list-cmds=nohelpers
Move declaration for alias.c to alias.h
completion: reduce completable command list
completion: let git provide the completable command list
command-list.txt: documentation and guide line
help: use command-list.txt for the source of guides
help: add "-a --verbose" to list all commands with synopsis
git: support --list-cmds=list-<category>
completion: implement and use --list-cmds=main,others
git --list-cmds: collect command list in a string_list
git.c: convert --list-* to --list-cmds=*
Remove common-cmds.h
help: use command-list.h for common command list
generate-cmds.sh: export all commands to command-list.h
generate-cmds.sh: factor out synopsis extract code

completion: suppress some -no- optionsNguyễn Thái Ngọc Duy Sun, 27 May 2018 08:38:27 +0000 (10:38 +0200)

completion: suppress some -no- options

Most --no- options do have some use, even if rarely to negate some
option that's specified in an alias.

These options --no-ours and --no-theirs however have no clear
semantics. If I specify "--ours --no-theirs", the second will reset
writeout stage and is equivalent of "--no-ours --no-theirs" which is
not that easy to see. Drop them. You can either switch from --ours to
--theirs and back but you can never negate them.

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