gitweb.git
Merge branch 'master' of https://github.com/vnwildman/gitJiang Xin Fri, 17 Feb 2017 16:54:49 +0000 (00:54 +0800)

Merge branch 'master' of https://github.com/vnwildman/git

* 'master' of https://github.com/vnwildman/git:
l10n: vi.po: Updated Vietnamese translation (3137t)

Merge branch 'master' of https://github.com/Softcatala... Jiang Xin Fri, 17 Feb 2017 16:49:06 +0000 (00:49 +0800)

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

* 'master' of https://github.com/Softcatala/git-po:
l10n: update Catalan translation

l10n: vi.po: Updated Vietnamese translation (3137t)Tran Ngoc Quan Fri, 17 Feb 2017 06:51:34 +0000 (13:51 +0700)

l10n: vi.po: Updated Vietnamese translation (3137t)

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

Hopefully the final batch of mini-topics before the... Junio C Hamano Thu, 16 Feb 2017 22:46:35 +0000 (14:46 -0800)

Hopefully the final batch of mini-topics before the final

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

Merge branch 'jk/tempfile-ferror-fclose-confusion'Junio C Hamano Thu, 16 Feb 2017 22:45:15 +0000 (14:45 -0800)

Merge branch 'jk/tempfile-ferror-fclose-confusion'

Code clean-up.

* jk/tempfile-ferror-fclose-confusion:
tempfile: avoid "ferror | fclose" trick

Merge branch 'dp/submodule-doc-markup-fix'Junio C Hamano Thu, 16 Feb 2017 22:45:15 +0000 (14:45 -0800)

Merge branch 'dp/submodule-doc-markup-fix'

Doc fix.

* dp/submodule-doc-markup-fix:
config.txt: fix formatting of submodule.alternateErrorStrategy section

Merge branch 'jk/reset-to-break-a-commit-doc-updated'Junio C Hamano Thu, 16 Feb 2017 22:45:14 +0000 (14:45 -0800)

Merge branch 'jk/reset-to-break-a-commit-doc-updated'

Doc update.

* jk/reset-to-break-a-commit-doc-updated:
reset: add an example of how to split a commit into two

Merge branch 'jk/reset-to-break-a-commit-doc'Junio C Hamano Thu, 16 Feb 2017 22:45:14 +0000 (14:45 -0800)

Merge branch 'jk/reset-to-break-a-commit-doc'

Doc update.

* jk/reset-to-break-a-commit-doc:
Revert "reset: add an example of how to split a commit into two"

Merge branch 'js/mingw-isatty'Junio C Hamano Thu, 16 Feb 2017 22:45:13 +0000 (14:45 -0800)

Merge branch 'js/mingw-isatty'

A hotfix for a topic already in 'master'.

* js/mingw-isatty:
mingw: make stderr unbuffered again

Merge branch 'rs/strbuf-cleanup-in-rmdir-recursively'Junio C Hamano Thu, 16 Feb 2017 22:45:13 +0000 (14:45 -0800)

Merge branch 'rs/strbuf-cleanup-in-rmdir-recursively'

Code clean-up.

* rs/strbuf-cleanup-in-rmdir-recursively:
rm: reuse strbuf for all remove_dir_recursively() calls, again

Merge branch 'rs/ls-files-partial-optim'Junio C Hamano Thu, 16 Feb 2017 22:45:13 +0000 (14:45 -0800)

Merge branch 'rs/ls-files-partial-optim'

"ls-files" run with pathspec has been micro-optimized to avoid
having to memmove(3) unnecessary bytes.

* rs/ls-files-partial-optim:
ls-files: move only kept cache entries in prune_cache()
ls-files: pass prefix length explicitly to prune_cache()

Merge branch 'rs/cocci-check-free-only-null'Junio C Hamano Thu, 16 Feb 2017 22:45:13 +0000 (14:45 -0800)

Merge branch 'rs/cocci-check-free-only-null'

A new coccinelle rule that catches a check of !pointer before the
pointer is free(3)d, which most likely is a bug.

* rs/cocci-check-free-only-null:
cocci: detect useless free(3) calls

Merge branch 'ls/p4-path-encoding'Junio C Hamano Thu, 16 Feb 2017 22:45:12 +0000 (14:45 -0800)

Merge branch 'ls/p4-path-encoding'

When "git p4" imports changelist that removes paths, it failed to
convert pathnames when the p4 used encoding different from the one
used on the Git side. This has been corrected.

* ls/p4-path-encoding:
git-p4: fix git-p4.pathEncoding for removed files

tempfile: avoid "ferror | fclose" trickJeff King Thu, 16 Feb 2017 21:31:40 +0000 (16:31 -0500)

tempfile: avoid "ferror | fclose" trick

The current code wants to record an error condition from
either ferror() or fclose(), but makes sure that we always
call both functions. So it can't use logical-OR "||", which
would short-circuit when ferror() is true. Instead, it uses
bitwise-OR "|" to evaluate both functions and set one or
more bits in the "err" flag if they reported a failure.

Unlike logical-OR, though, bitwise-OR does not introduce a
sequence point, and the order of evaluation for its operands
is unspecified. So a compiler would be free to generate code
which calls fclose() first, and then ferror() on the
now-freed filehandle.

There's no indication that this has happened in practice,
but let's write it out in a way that follows the standard.

Noticed-by: Andreas Schwab <schwab@linux-m68k.org>
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

config.txt: fix formatting of submodule.alternateErrorS... David Pursehouse Thu, 16 Feb 2017 05:05:35 +0000 (14:05 +0900)

config.txt: fix formatting of submodule.alternateErrorStrategy section

Add missing `::` after the title.

Signed-off-by: David Pursehouse <dpursehouse@collab.net>
Acked-by: Stefan Beller <sbeller@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

reset: add an example of how to split a commit into twoJacob Keller Thu, 16 Feb 2017 00:22:12 +0000 (16:22 -0800)

reset: add an example of how to split a commit into two

It is often useful to break a commit into multiple parts that are more
logical separations. This can be tricky to learn how to do without the
brute-force method if re-writing code or commit messages from scratch.

Add a section to the git-reset documentation which shows an example
process for how to use git add -p and git commit -c HEAD@{1} to
interactively break a commit apart and re-use the original commit
message as a starting point when making the new commit message.

Signed-off-by: Jacob Keller <jacob.keller@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Revert "reset: add an example of how to split a commit... Junio C Hamano Thu, 16 Feb 2017 21:35:50 +0000 (13:35 -0800)

Revert "reset: add an example of how to split a commit into two"

This reverts commit 7326451bedaa67d29afe02184b166e28d9393c91; a
better rewrite will be queued separately.

bisect_next_all: convert xsnprintf to xstrfmtMaxim Moseychuk Thu, 16 Feb 2017 17:07:12 +0000 (20:07 +0300)

bisect_next_all: convert xsnprintf to xstrfmt

Git can't run bisect between 2048+ commits if use russian
translation, because the translated string is too long for the fixed
buffer it uses (this can be reproduced "LANG=ru_RU.UTF8 git bisect
start v4.9 v4.8" on linux sources).

Use xstrfmt() to format the message string to sufficiently sized
buffer instead to fix this.

Signed-off-by: Maxim Moseychuk <franchesko.salias.hudro.pedros@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

stop_progress_msg: convert xsnprintf to xstrfmtMaxim Moseychuk Thu, 16 Feb 2017 17:07:13 +0000 (20:07 +0300)

stop_progress_msg: convert xsnprintf to xstrfmt

Simplify code by replacing buffer allocation with a call to xstrfmt().

Signed-off-by: Maxim Moseychuk <franchesko.salias.hudro.pedros@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

l10n: update Catalan translationJordi Mas Thu, 16 Feb 2017 04:10:04 +0000 (05:10 +0100)

l10n: update Catalan translation

Signed-off-by: Jordi Mas <jmas@softcatala.org>

A bit more for -rc2Junio C Hamano Wed, 15 Feb 2017 22:58:25 +0000 (14:58 -0800)

A bit more for -rc2

Merge branch 'tg/stash-doc-cleanup'Junio C Hamano Wed, 15 Feb 2017 22:56:41 +0000 (14:56 -0800)

Merge branch 'tg/stash-doc-cleanup'

The documentation explained what "git stash" does to the working
tree (after stashing away the local changes) in terms of "reset
--hard", which was exposing an unnecessary implementation detail.

* tg/stash-doc-cleanup:
Documentation/stash: remove mention of git reset --hard

Merge branch 'jk/doc-submodule-markup-fix'Junio C Hamano Wed, 15 Feb 2017 22:56:40 +0000 (14:56 -0800)

Merge branch 'jk/doc-submodule-markup-fix'

Doc markup fix.

* jk/doc-submodule-markup-fix:
docs/git-submodule: fix unbalanced quote

Merge branch 'jk/doc-remote-helpers-markup-fix'Junio C Hamano Wed, 15 Feb 2017 22:56:40 +0000 (14:56 -0800)

Merge branch 'jk/doc-remote-helpers-markup-fix'

Doc markup fix.

* jk/doc-remote-helpers-markup-fix:
docs/gitremote-helpers: fix unbalanced quotes

show-branch: use skip_prefix to drop magic numbersJeff King Wed, 15 Feb 2017 21:40:52 +0000 (16:40 -0500)

show-branch: use skip_prefix to drop magic numbers

We make several starts_with() calls, only to advance
pointers. This is exactly what skip_prefix() is for, which
lets us avoid manually-counted magic numbers.

Helped-by: Pranit Bauva <pranit.bauva@gmail.com>
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Merge branch 'sb/doc-unify-bottom'Junio C Hamano Wed, 15 Feb 2017 20:54:20 +0000 (12:54 -0800)

Merge branch 'sb/doc-unify-bottom'

Doc clean-up.

* sb/doc-unify-bottom:
Documentation: unify bottom "part of git suite" lines

Merge branch 'sb/push-options-via-transport'Junio C Hamano Wed, 15 Feb 2017 20:54:19 +0000 (12:54 -0800)

Merge branch 'sb/push-options-via-transport'

The push-options given via the "--push-options" option were not
passed through to external remote helpers such as "smart HTTP" that
are invoked via the transport helper.

* sb/push-options-via-transport:
push options: pass push options to the transport helper

Merge branch 'cw/completion'Junio C Hamano Wed, 15 Feb 2017 20:54:19 +0000 (12:54 -0800)

Merge branch 'cw/completion'

More command line completion (in contrib/) for recent additions.

* cw/completion:
completion: recognize more long-options
completion: teach remote subcommands to complete options
completion: teach replace to complete options
completion: teach ls-remote to complete options
completion: improve bash completion for git-add
completion: add subcommand completion for rerere
completion: teach submodule subcommands to complete options

Merge branch 'rs/swap'Junio C Hamano Wed, 15 Feb 2017 20:54:19 +0000 (12:54 -0800)

Merge branch 'rs/swap'

Code clean-up.

* rs/swap:
graph: use SWAP macro
diff: use SWAP macro
use SWAP macro
apply: use SWAP macro
add SWAP macro

Merge branch 'sb/submodule-doc'Junio C Hamano Wed, 15 Feb 2017 20:54:18 +0000 (12:54 -0800)

Merge branch 'sb/submodule-doc'

Doc updates.

* sb/submodule-doc:
submodule update documentation: don't repeat ourselves
submodule documentation: add options to the subcommand

grep: treat revs the same for --untracked as for -... Jeff King Tue, 14 Feb 2017 21:54:36 +0000 (16:54 -0500)

grep: treat revs the same for --untracked as for --no-index

git-grep has always disallowed grepping in a tree (as
opposed to the working directory) with both --untracked
and --no-index. But we traditionally did so by first
collecting the revs, and then complaining when any were
provided.

The --no-index option recently learned to detect revs
much earlier. This has two user-visible effects:

- we don't bother to resolve revision names at all. So
when there's a rev/path ambiguity, we always choose to
treat it as a path.

- likewise, when you do specify a revision without "--",
the error you get is "no such path" and not "--untracked
cannot be used with revs".

The rationale for doing this with --no-index is that it is
meant to be used outside a repository, and so parsing revs
at all does not make sense.

This patch gives --untracked the same treatment. While it
_is_ meant to be used in a repository, it is explicitly
about grepping the non-repository contents. Telling the user
"we found a rev, but you are not allowed to use revs" is
not really helpful compared to "we treated your argument as
a path, and could not find it".

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

remote helpers: avoid blind fall-back to ".git" when... Jonathan Nieder Tue, 14 Feb 2017 20:36:19 +0000 (15:36 -0500)

remote helpers: avoid blind fall-back to ".git" when setting GIT_DIR

To push from or fetch to the current repository, remote helpers need
to know what repository that is. Accordingly, Git sets the GIT_DIR
environment variable to the path to the current repository when
invoking remote helpers.

There is a special case it does not handle: "git ls-remote" and "git
archive --remote" can be run to inspect a remote repository without
being run from any local repository. GIT_DIR is not useful in this
scenario:

- if we are not in a repository, we don't need to set GIT_DIR to
override an existing GIT_DIR value from the environment. If GIT_DIR
is present then we would be in a repository if it were valid and
would have called die() if it weren't.

- not setting GIT_DIR may cause a helper to do the usual discovery
walk to find the repository. But we know we're not in one, or we
would have found it ourselves. So in the worst case it may expend
a little extra effort to try to find a repository and fail (for
example, remote-curl would do this to try to find repository-level
configuration).

So leave GIT_DIR unset in this case. This makes GIT_DIR easier to
understand for remote helper authors and makes transport code less of
a special case for repository discovery.

Noticed using b1ef400e (setup_git_env: avoid blind fall-back to
".git", 2016-10-20) from 'next':

$ cd /tmp
$ git ls-remote https://kernel.googlesource.com/pub/scm/git/git
fatal: BUG: setup_git_env called without repository

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

remote: avoid reading $GIT_DIR config in non-repoJeff King Tue, 14 Feb 2017 20:33:28 +0000 (15:33 -0500)

remote: avoid reading $GIT_DIR config in non-repo

The "git ls-remote" command can be run outside of a
repository, but needs to look up configured remotes. The
config code is smart enough to handle this case itself, but
we also check the historical "branches" and "remotes" paths
in $GIT_DIR. The git_path() function causes us to blindly
look at ".git/remotes", even if we know we aren't in a git
repository.

For now, this is just an unlikely bug (you probably don't
have such a file if you're not in a repository), but it will
become more obvious once we merge b1ef400ee (setup_git_env:
avoid blind fall-back to ".git", 2016-10-20):

[now]
$ git ls-remote
fatal: No remote configured to list refs from.

[with b1ef400ee]
$ git ls-remote
fatal: BUG: setup_git_env called without repository

We can fix this by skipping these sources entirely when
we're outside of a repository.

The test is a little more complex than the demonstration
above. Rather than detect the correct behavior by parsing
the error message, we can actually set up a case where the
remote name we give is a valid repository, but b1ef400ee
would cause us to die in the configuration step.

This test doesn't fail now, but it future-proofs us for the
b1ef400ee change.

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

show-branch: store resolved head in heap bufferJeff King Tue, 14 Feb 2017 17:27:45 +0000 (12:27 -0500)

show-branch: store resolved head in heap buffer

We resolve HEAD and copy the result to a fixed-size buffer
with memcpy, never checking that it actually fits. This bug
dates back to 8098a178b (Add git-symbolic-ref, 2005-09-30).
Before that we used readlink(), which took a maximum buffer
size.

We can fix this by using resolve_refdup(), which duplicates
the buffer on the heap. That also lets us just check
for a NULL pointer to see if we have resolved HEAD, and
drop the extra head_p variable.

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

show-branch: drop head_len variableJeff King Tue, 14 Feb 2017 17:26:01 +0000 (12:26 -0500)

show-branch: drop head_len variable

We copy the result of resolving HEAD into a buffer and keep
track of its length. But we never actually use the length
for anything besides the copy. Let's stop passing it around.

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

grep: do not diagnose misspelt revs with --no-indexJeff King Tue, 14 Feb 2017 06:08:09 +0000 (01:08 -0500)

grep: do not diagnose misspelt revs with --no-index

If we are using --no-index, then our arguments cannot be
revs in the first place. Not only is it pointless to
diagnose them, but if we are not in a repository, we should
not be trying to resolve any names.

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

grep: avoid resolving revision names in --no-index... Jeff King Tue, 14 Feb 2017 06:07:29 +0000 (01:07 -0500)

grep: avoid resolving revision names in --no-index case

We disallow the use of revisions with --no-index, but we
don't actually check and complain until well after we've
parsed the revisions.

This is the cause of a few problems:

1. We shouldn't be calling get_sha1() at all when we aren't
in a repository, as it might access the ref or object
databases. For now, this should generally just return
failure, but eventually it will become a BUG().

2. When there's a "--" disambiguator and you're outside a
repository, we'll complain early with "unable to resolve
revision". But we can give a much more specific error.

3. When there isn't a "--" disambiguator, we still do the
normal rev/path checks. This is silly, as we know we
cannot have any revs with --no-index. Everything we see
must be a path.

Outside of a repository this doesn't matter (since we
know it won't resolve), but inside one, we may complain
unnecessarily if a filename happens to also match a
refname.

This patch skips the get_sha1() call entirely in the
no-index case, and behaves as if it failed (with the
exception of giving a better error message).

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

grep: fix "--" rev/pathspec disambiguationJeff King Tue, 14 Feb 2017 06:05:55 +0000 (01:05 -0500)

grep: fix "--" rev/pathspec disambiguation

If we see "git grep pattern rev -- file" then we apply the
usual rev/pathspec disambiguation rules: any "rev" before
the "--" must be a revision, and we do not need to apply the
verify_non_filename() check.

But there are two bugs here:

1. We keep a seen_dashdash flag to handle this case, but
we set it in the same left-to-right pass over the
arguments in which we parse "rev".

So when we see "rev", we do not yet know that there is
a "--", and we mistakenly complain if there is a
matching file.

We can fix this by making a preliminary pass over the
arguments to find the "--", and only then checking the rev
arguments.

2. If we can't resolve "rev" but there isn't a dashdash,
that's OK. We treat it like a path, and complain later
if it doesn't exist.

But if there _is_ a dashdash, then we know it must be a
rev, and should treat it as such, complaining if it
does not resolve. The current code instead ignores it
and tries to treat it like a path.

This patch fixes both bugs, and tries to comment the parsing
flow a bit better.

It adds tests that cover the two bugs, but also some related
situations (which already worked, but this confirms that our
fixes did not break anything).

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

grep: re-order rev-parsing loopJeff King Tue, 14 Feb 2017 06:04:17 +0000 (01:04 -0500)

grep: re-order rev-parsing loop

We loop over the arguments, but every branch of the loop
hits either a "continue" or a "break". Surely we can make
this simpler.

The final conditional is:

if (arg is a rev) {
... handle rev ...
continue;
}
break;

We can rewrite this as:

if (arg is not a rev)
break;

... handle rev ...

That makes the flow a little bit simpler, and will make
things much easier to follow when we add more logic in
future patches.

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

grep: do not unnecessarily query repo for "--"Jonathan Tan Tue, 14 Feb 2017 06:03:03 +0000 (01:03 -0500)

grep: do not unnecessarily query repo for "--"

When running a command of the form

git grep --no-index pattern -- path

in the absence of a Git repository, an error message will be printed:

fatal: BUG: setup_git_env called without repository

This is because "git grep" tries to interpret "--" as a rev. "git grep"
has always tried to first interpret "--" as a rev for at least a few
years, but this issue was upgraded from a pessimization to a bug in
commit 59332d1 ("Resurrect "git grep --no-index"", 2010-02-06), which
calls get_sha1 regardless of whether --no-index was specified. This bug
appeared to be benign until commit b1ef400 ("setup_git_env: avoid blind
fall-back to ".git"", 2016-10-20) when Git was taught to die in this
situation. (This "git grep" bug appears to be one of the bugs that
commit b1ef400 is meant to flush out.)

Therefore, always interpret "--" as signaling the end of options,
instead of trying to interpret it as a rev first.

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

grep: move thread initialization a little lowerJeff King Tue, 14 Feb 2017 06:02:38 +0000 (01:02 -0500)

grep: move thread initialization a little lower

Originally, we set up the threads for grep before parsing
the non-option arguments. In 53b8d931b (grep: disable
threading in non-worktree case, 2011-12-12), the thread code
got bumped lower in the function because it now needed to
know whether we got any revision arguments.

That put a big block of code in between the parsing of revs
and the parsing of pathspecs, both of which share some loop
variables. That makes it harder to read the code than the
original, where the shared loops were right next to each
other.

Let's bump the thread initialization until after all of the
parsing is done.

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

mingw: make stderr unbuffered againJohannes Schindelin Mon, 13 Feb 2017 22:34:06 +0000 (23:34 +0100)

mingw: make stderr unbuffered again

When removing the hack for isatty(), we actually removed more than just
an isatty() hack: we removed the hack where internal data structures of
the MSVC runtime are modified in order to redirect stdout/stderr.

Instead of using that hack (that does not work with newer versions of
the runtime, anyway), we replaced it by reopening the respective file
descriptors.

What we forgot was to mark stderr as unbuffered again.

Reported by Hannes Sixt. Fixed with Jeff Hostetler's assistance.

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

gc: ignore old gc.log filesDavid Turner Fri, 10 Feb 2017 21:28:22 +0000 (16:28 -0500)

gc: ignore old gc.log files

A server can end up in a state where there are lots of unreferenced
loose objects (say, because many users are doing a bunch of rebasing
and pushing their rebased branches). Running "git gc --auto" in
this state would cause a gc.log file to be created, preventing
future auto gcs, causing pack files to pile up. Since many git
operations are O(n) in the number of pack files, this would lead to
poor performance.

Git should never get itself into a state where it refuses to do any
maintenance, just because at some point some piece of the maintenance
didn't make progress.

Teach Git to ignore gc.log files which are older than (by default)
one day old, which can be tweaked via the gc.logExpiry configuration
variable. That way, these pack files will get cleaned up, if
necessary, at least once per day. And operators who find a need for
more-frequent gcs can adjust gc.logExpiry to meet their needs.

There is also some cleanup: a successful manual gc, or a
warning-free auto gc with an old log file, will remove any old
gc.log files.

It might still happen that manual intervention is required
(e.g. because the repo is corrupt), but at the very least it won't
be because Git is too dumb to try again.

Signed-off-by: David Turner <dturner@twosigma.com>
Helped-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

rm: reuse strbuf for all remove_dir_recursively() calls... René Scharfe Sat, 11 Feb 2017 19:51:08 +0000 (20:51 +0100)

rm: reuse strbuf for all remove_dir_recursively() calls, again

Don't throw the memory allocated for remove_dir_recursively() away after
a single call, use it for the other entries as well instead.

This change was done before in deb8e15a (rm: reuse strbuf for all
remove_dir_recursively() calls), but was reverted as a side-effect of
55856a35 (rm: absorb a submodules git dir before deletion). Reinstate
the optimization.

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

Documentation/stash: remove mention of git reset -... Thomas Gummerer Sun, 12 Feb 2017 21:54:14 +0000 (21:54 +0000)

Documentation/stash: remove mention of git reset --hard

Don't mention git reset --hard in the documentation for git stash save.
It's an implementation detail that doesn't matter to the end user and
thus shouldn't be exposed to them. In addition it's not quite true for
git stash -p, and will not be true when a filename argument to limit the
stash to a few files is introduced.

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

docs/git-submodule: fix unbalanced quoteJeff King Mon, 13 Feb 2017 21:05:49 +0000 (16:05 -0500)

docs/git-submodule: fix unbalanced quote

The documentation gives an example of the submodule foreach
command that uses both backticks and single-quotes. We stick
the whole thing inside "+" markers to make it monospace, but
the inside punctuation still needs escaping. We handle the
backticks with "{backtick}", and use backslash-escaping for
the single-quotes.

But we missed the escaping on the second quote. Fortunately,
asciidoc renders this unbalanced quote as we want (showing
the quote), but asciidoctor does not. We could fix it by
adding the missing backslash.

However, let's take a step back. Even when rendered
correctly, it's hard to read a long command stuck into the
middle of a paragraph, and the important punctuation is hard
to notice. Let's instead bump it into its own single-line
code block. That makes both the source and the rendered
result more readable, and as a bonus we don't have to worry
about quoting at all.

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

docs/gitremote-helpers: fix unbalanced quotesJeff King Mon, 13 Feb 2017 20:38:35 +0000 (15:38 -0500)

docs/gitremote-helpers: fix unbalanced quotes

Each of these options is missing the closing single-quote on
the option name. This understandably confuses asciidoc,
which ends up rendering a stray quote, like:

option cloning {'true|false}

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

ls-files: move only kept cache entries in prune_cache()René Scharfe Fri, 10 Feb 2017 20:03:30 +0000 (21:03 +0100)

ls-files: move only kept cache entries in prune_cache()

prune_cache() first identifies those entries at the start of the sorted
array that can be discarded. Then it moves the rest of the entries up.
Last it identifies the unwanted trailing entries among the moved ones
and cuts them off.

Change the order: Identify both start *and* end of the range to keep
first and then move only those entries to the top. The resulting code
is slightly shorter and a bit more efficient.

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

ls-files: pass prefix length explicitly to prune_cache()René Scharfe Fri, 10 Feb 2017 19:42:28 +0000 (20:42 +0100)

ls-files: pass prefix length explicitly to prune_cache()

The function prune_cache() relies on the fact that it is only called on
max_prefix and sneakily uses the matching global variable max_prefix_len
directly. Tighten its interface by passing both the string and its
length as parameters. While at it move the NULL check into the function
to collect all cache-pruning related logic in one place.

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

Merge branch 'master' of git://github.com/nafmo/git... Jiang Xin Mon, 13 Feb 2017 16:19:11 +0000 (00:19 +0800)

Merge branch 'master' of git://github.com/nafmo/git-l10n-sv

* 'master' of git://github.com/nafmo/git-l10n-sv:
l10n: sv.po: Update Swedish translation (3137t0f0u)

Merge branch 'fr_v2.11.0_rnd1' of git://github.com... Jiang Xin Mon, 13 Feb 2017 16:17:21 +0000 (00:17 +0800)

Merge branch 'fr_v2.11.0_rnd1' of git://github.com/jnavila/git

* 'fr_v2.11.0_rnd1' of git://github.com/jnavila/git:
l10n: fr.po: v2.11-rc0 first round
l10n: fr.po: Fix a typo in the French translation
l10n: fr.po: Remove gender specific adjectives
l10n: fr.po: Fix typos

cocci: detect useless free(3) callsRené Scharfe Sat, 11 Feb 2017 13:58:44 +0000 (14:58 +0100)

cocci: detect useless free(3) calls

Add a semantic patch for removing checks that cause free(3) to only be
called with a NULL pointer, as that must be a programming mistake.

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

l10n: sv.po: Update Swedish translation (3137t0f0u)Peter Krefting Sat, 11 Feb 2017 19:19:48 +0000 (20:19 +0100)

l10n: sv.po: Update Swedish translation (3137t0f0u)

Signed-off-by: Peter Krefting <peter@softwolves.pp.se>

l10n: fr.po: v2.11-rc0 first roundJean-Noel Avila Wed, 8 Feb 2017 20:36:33 +0000 (21:36 +0100)

l10n: fr.po: v2.11-rc0 first round

Signed-off-by: Jean-Noel Avila <jn.avila@free.fr>

l10n: ko.po: Update Korean translationChangwoo Ryu Sat, 11 Feb 2017 02:29:32 +0000 (11:29 +0900)

l10n: ko.po: Update Korean translation

Signed-off-by: Changwoo Ryu <cwryu@debian.org>

git-p4: fix git-p4.pathEncoding for removed filesLars Schneider Thu, 9 Feb 2017 15:06:56 +0000 (16:06 +0100)

git-p4: fix git-p4.pathEncoding for removed files

In a9e38359e3 we taught git-p4 a way to re-encode path names from what
was used in Perforce to UTF-8. This path re-encoding worked properly for
"added" paths. "Removed" paths were not re-encoded and therefore
different from the "added" paths. Consequently, these files were not
removed in a git-p4 cloned Git repository because the path names did not
match.

Fix this by moving the re-encoding to a place that affects "added" and
"removed" paths. Add a test to demonstrate the issue.

Signed-off-by: Lars Schneider <larsxschneider@gmail.com>
Reviewed-by: Luke Diamand <luke@diamand.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Git 2.12-rc1 v2.12.0-rc1Junio C Hamano Fri, 10 Feb 2017 20:54:23 +0000 (12:54 -0800)

Git 2.12-rc1

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

Merge branch 'nd/rev-list-all-includes-HEAD-doc'Junio C Hamano Fri, 10 Feb 2017 20:52:27 +0000 (12:52 -0800)

Merge branch 'nd/rev-list-all-includes-HEAD-doc'

Doc update.

* nd/rev-list-all-includes-HEAD-doc:
rev-list-options.txt: update --all about HEAD

Merge branch 'rs/fill-directory-optim'Junio C Hamano Fri, 10 Feb 2017 20:52:27 +0000 (12:52 -0800)

Merge branch 'rs/fill-directory-optim'

Code clean-up.

* rs/fill-directory-optim:
dir: avoid allocation in fill_directory()

Merge branch 'jk/log-graph-name-only'Junio C Hamano Fri, 10 Feb 2017 20:52:26 +0000 (12:52 -0800)

Merge branch 'jk/log-graph-name-only'

"git log --graph" did not work well with "--name-only", even though
other forms of "diff" output were handled correctly.

* jk/log-graph-name-only:
diff: print line prefix for --name-only output

Merge branch 'da/t7800-cleanup'Junio C Hamano Fri, 10 Feb 2017 20:52:26 +0000 (12:52 -0800)

Merge branch 'da/t7800-cleanup'

Test updates.

* da/t7800-cleanup:
t7800: replace "wc -l" with test_line_count

Merge branch 'dl/difftool-doc-no-gui-option'Junio C Hamano Fri, 10 Feb 2017 20:52:26 +0000 (12:52 -0800)

Merge branch 'dl/difftool-doc-no-gui-option'

Doc update.

* dl/difftool-doc-no-gui-option:
Document the --no-gui option in difftool

Merge branch 'js/difftool-builtin'Junio C Hamano Fri, 10 Feb 2017 20:52:25 +0000 (12:52 -0800)

Merge branch 'js/difftool-builtin'

A few hot-fixes to C-rewrite of "git difftool".

* js/difftool-builtin:
t7800: simplify basic usage test
difftool: fix bug when printing usage

Merge branch 'rs/p5302-create-repositories-before-tests'Junio C Hamano Fri, 10 Feb 2017 20:52:25 +0000 (12:52 -0800)

Merge branch 'rs/p5302-create-repositories-before-tests'

Adjust a perf test to new world order where commands that do
require a repository are really strict about having a repository.

* rs/p5302-create-repositories-before-tests:
p5302: create repositories for index-pack results explicitly

Merge branch 'ps/worktree-prune-help-fix'Junio C Hamano Fri, 10 Feb 2017 20:52:25 +0000 (12:52 -0800)

Merge branch 'ps/worktree-prune-help-fix'

Incorrect usage help message for "git worktree prune" has been fixed.

* ps/worktree-prune-help-fix:
worktree: fix option descriptions for `prune`

Merge branch 'ew/complete-svn-authorship-options'Junio C Hamano Fri, 10 Feb 2017 20:52:24 +0000 (12:52 -0800)

Merge branch 'ew/complete-svn-authorship-options'

Correct command line completion (in contrib/) on "git svn"

* ew/complete-svn-authorship-options:
completion: fix git svn authorship switches

Merge branch 'jk/reset-to-break-a-commit-doc'Junio C Hamano Fri, 10 Feb 2017 20:52:23 +0000 (12:52 -0800)

Merge branch 'jk/reset-to-break-a-commit-doc'

A minor doc update.

* jk/reset-to-break-a-commit-doc:
reset: add an example of how to split a commit into two

Merge branch 'bw/push-submodule-only'Junio C Hamano Fri, 10 Feb 2017 20:52:23 +0000 (12:52 -0800)

Merge branch 'bw/push-submodule-only'

Add missing documentation update to a recent topic.

* bw/push-submodule-only:
completion: add completion for --recurse-submodules=only
doc: add doc for git-push --recurse-submodules=only

mingw: use OpenSSL's SHA-1 routinesJeff Hostetler Thu, 9 Feb 2017 22:27:49 +0000 (23:27 +0100)

mingw: use OpenSSL's SHA-1 routines

Use OpenSSL's SHA-1 routines rather than builtin block-sha1 routines.
This improves performance on SHA1 operations on Intel processors.

OpenSSL 1.0.2 has made considerable performance improvements and
support the Intel hardware acceleration features. See:
https://software.intel.com/en-us/articles/improving-openssl-performance
https://software.intel.com/en-us/articles/intel-sha-extensions

To test this I added/staged a single file in a gigantic
repository having a 450MB index file. The code in read-cache.c
verifies the header SHA as it reads the index and computes a new
header SHA as it writes out the new index. Therefore, in this test
the SHA code must process 900MB of data. Testing was done on an
Intel I7-4770 CPU @ 3.40GHz (Intel64, Family 6, Model 60) CPU.

The block-sha1 version averaged 5.27 seconds.
The OpenSSL version averaged 4.50 seconds.

================================================================

$ echo xxx >> project.mk
$ time /e/blk_sha/bin/git.exe add project.mk

real 0m5.207s
user 0m0.000s
sys 0m0.250s

$ echo xxx >> project.mk
$ time /e/blk_sha/bin/git.exe add project.mk

real 0m5.362s
user 0m0.015s
sys 0m0.234s

$ echo xxx >> project.mk
$ time /e/blk_sha/bin/git.exe add project.mk

real 0m5.300s
user 0m0.016s
sys 0m0.250s

$ echo xxx >> project.mk
$ time /e/blk_sha/bin/git.exe add project.mk

real 0m5.216s
user 0m0.000s
sys 0m0.250s

================================================================
$ echo xxx >> project.mk
$ time /e/openssl/bin/git.exe add project.mk

real 0m4.431s
user 0m0.000s
sys 0m0.250s

$ echo xxx >> project.mk
$ time /e/openssl/bin/git.exe add project.mk

real 0m4.478s
user 0m0.000s
sys 0m0.265s

$ echo xxx >> project.mk
$ time /e/openssl/bin/git.exe add project.mk

real 0m4.690s
user 0m0.000s
sys 0m0.250s

$ echo xxx >> project.mk
$ time /e/openssl/bin/git.exe add project.mk

real 0m4.420s
user 0m0.000s
sys 0m0.234s

================================================================

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

Documentation: unify bottom "part of git suite" linesStefan Beller Thu, 9 Feb 2017 01:29:30 +0000 (17:29 -0800)

Documentation: unify bottom "part of git suite" lines

We currently have 168 man pages that mention they are part of Git, you
can check yourself easily via:
$ git grep "Part of the linkgit:git\[1\] suite" |wc -l
168
However some have a trailing period, i.e.
$ git grep "Part of the linkgit:git\[1\] suite." |wc -l
8

Unify the bottom line in all man pages to not end with a period.

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

push options: pass push options to the transport helperStefan Beller Wed, 8 Feb 2017 22:04:00 +0000 (14:04 -0800)

push options: pass push options to the transport helper

When using non-builtin protocols relying on a transport helper
(such as http), push options are not propagated to the helper.

The user could ask for push options and a push would seemingly succeed,
but the push options would never be transported to the server,
misleading the users expectation.

Fix this by propagating the push options to the transport helper.

This is only addressing the first issue of
(1) the helper protocol does not propagate push-option
(2) the http helper is not prepared to handle push-option

Once we fix (2), the http transport helper can make use of push options
as well, but that happens as a follow up. (1) is a bug fix, whereas (2)
is a feature, which is why we only do (1) here.

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

diff: print line prefix for --name-only outputJeff King Wed, 8 Feb 2017 20:31:15 +0000 (15:31 -0500)

diff: print line prefix for --name-only output

If you run "git log --graph --name-only", the pathnames are
not indented to go along with their matching commits (unlike
all of the other diff formats). We need to output the line
prefix for each item before writing it.

The tests cover both --name-status and --name-only. The
former actually gets this right already, because it builds
on the --raw format functions. It's only --name-only which
uses its own code (and this fix mirrors the code in
diff_flush_raw()).

Note that the tests don't follow our usual style of setting
up the "expect" output inside the test block. This matches
the surrounding style, but more importantly it is easier to
read: we don't have to worry about embedded single-quotes,
and the leading indentation is more obvious.

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

dir: avoid allocation in fill_directory()René Scharfe Tue, 7 Feb 2017 22:04:25 +0000 (23:04 +0100)

dir: avoid allocation in fill_directory()

Pass the match member of the first pathspec item directly to
read_directory() instead of using common_prefix() to duplicate it first,
thus avoiding memory duplication, strlen(3) and free(3).

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

rev-list-options.txt: update --all about HEADNguyễn Thái Ngọc Duy Wed, 8 Feb 2017 06:06:41 +0000 (13:06 +0700)

rev-list-options.txt: update --all about HEAD

This is the document patch for f0298cf1c6 (revision walker: include a
detached HEAD in --all - 2009-01-16).

Even though that commit is about detached HEAD, as Jeff pointed out,
always adding HEAD in that case may have subtle differences with
--source or --exclude. So the document mentions nothing about the
detached-ness.

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

t7800: replace "wc -l" with test_line_countDavid Aguilar Tue, 7 Feb 2017 09:17:00 +0000 (01:17 -0800)

t7800: replace "wc -l" with test_line_count

Make t7800 easier to debug by capturing output into temporary files and
using test_line_count to make assertions on those files.

Signed-off-by: David Aguilar <davvid@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Merge branch 'da/difftool-dir-diff-fix' into da/t7800... Junio C Hamano Wed, 8 Feb 2017 21:36:03 +0000 (13:36 -0800)

Merge branch 'da/difftool-dir-diff-fix' into da/t7800-cleanup

* da/difftool-dir-diff-fix:
difftool: fix dir-diff index creation when in a subdirectory

t7800: simplify basic usage testDavid Aguilar Tue, 7 Feb 2017 09:16:59 +0000 (01:16 -0800)

t7800: simplify basic usage test

Use "test_line_count" instead of "wc -l", use "git -C" instead of a
subshell, and use test_expect_code when calling difftool. Ease
debugging by capturing output into temporary files.

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

Document the --no-gui option in difftoolDenton Liu Tue, 7 Feb 2017 06:32:07 +0000 (22:32 -0800)

Document the --no-gui option in difftool

Prior to this, the `--no-gui` option was not documented in the manpage.
This commit introduces this into the manpage

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

worktree: fix option descriptions for `prune`Patrick Steinhardt Mon, 6 Feb 2017 13:13:59 +0000 (14:13 +0100)

worktree: fix option descriptions for `prune`

The `verbose` and `expire` options of the `git worktree prune`
subcommand have wrong descriptions in that they pretend to relate to
objects. But as the git-worktree(1) correctly states, these options have
nothing to do with objects but only with worktrees. Fix the description
accordingly.

Signed-off-by: Patrick Steinhardt <patrick.steinhardt@elego.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

p5302: create repositories for index-pack results expli... René Scharfe Sun, 5 Feb 2017 11:43:29 +0000 (12:43 +0100)

p5302: create repositories for index-pack results explicitly

Before 7176a314 (index-pack: complain when --stdin is used outside of a
repo) index-pack silently created a non-existing target directory; now
the command refuses to work unless it's used against a valid repository.
That causes p5302 to fail, which relies on the former behavior. Fix it
by setting up the destinations for its performance tests using git init.

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

completion: fix git svn authorship switchesEric Wong Sun, 5 Feb 2017 02:18:57 +0000 (02:18 +0000)

completion: fix git svn authorship switches

--add-author-from and --use-log-author are for "git svn dcommit",
not "git svn (init|clone)"

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

difftool: fix bug when printing usageDavid Aguilar Sun, 5 Feb 2017 21:23:38 +0000 (13:23 -0800)

difftool: fix bug when printing usage

"git difftool -h" reports an error:

fatal: BUG: setup_git_env called without repository

Defer repository setup so that the help option processing happens before
the repository is initialized.

Add tests to ensure that the basic usage works inside and outside of a
repository.

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

l10n: fr.po: Fix a typo in the French translationAnthony Ramine Sun, 1 Jan 2017 12:56:46 +0000 (13:56 +0100)

l10n: fr.po: Fix a typo in the French translation

Signed-off-by: Anthony Ramine <n.oxyde@gmail.com>

l10n: fr.po: Remove gender specific adjectivesJoachim Jablon Fri, 16 Dec 2016 15:56:31 +0000 (16:56 +0100)

l10n: fr.po: Remove gender specific adjectives

Signed-off-by: Joachim Jablon <ewjoachim@gmail.com>
Reviewed-by: Jean-Noel Avila <jn.avila@free.fr>

l10n: fr.po: Fix typosJoachim Jablon Sun, 18 Dec 2016 01:16:06 +0000 (02:16 +0100)

l10n: fr.po: Fix typos

Reviewed-by: Jean-Noel Avila <jn.avila@free.fr>
Signed-off-by: Joachim Jablon <ewjoachim@gmail.com>

reset: add an example of how to split a commit into twoJacob Keller Fri, 3 Feb 2017 20:28:33 +0000 (12:28 -0800)

reset: add an example of how to split a commit into two

It is often useful to break a commit into multiple parts that are more
logical separations. This can be tricky to learn how to do without the
brute-force method if re-writing code or commit messages from scratch.

Add a section to the git-reset documentation which shows an example
process for how to use git add -p and git commit -c HEAD@{1} to
interactively break a commit apart and re-use the original commit
message as a starting point when making the new commit message.

Signed-off-by: Jacob Keller <jacob.keller@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

completion: recognize more long-optionsCornelius Weig Fri, 3 Feb 2017 11:01:59 +0000 (12:01 +0100)

completion: recognize more long-options

Command completion only recognizes a subset of the available options for
the various git commands. The set of recognized options needs to balance
between having all useful options and to not clutter the terminal.

This commit adds all long-options that are mentioned in the man-page
synopsis of the respective git command. Possibly dangerous options are
not included in this set, to avoid accidental data loss. The added
options are:

- apply: --recount --directory=
- archive: --output
- branch: --column --no-column --sort= --points-at
- clone: --no-single-branch --shallow-submodules
- commit: --patch --short --date --allow-empty
- describe: --first-parent
- fetch, pull: --unshallow --update-shallow
- fsck: --name-objects
- grep: --break --heading --show-function --function-context
--untracked --no-index
- mergetool: --prompt --no-prompt
- reset: --keep
- revert: --strategy= --strategy-option=
- shortlog: --email
- tag: --merged --no-merged --create-reflog

Signed-off-by: Cornelius Weig <cornelius.weig@tngtech.com>
Helped-by: Johannes Sixt <j6t@kdbg.org>
Reviewed-by: SZEDER Gábor <szeder.dev@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

completion: teach remote subcommands to complete optionsCornelius Weig Fri, 3 Feb 2017 11:01:58 +0000 (12:01 +0100)

completion: teach remote subcommands to complete options

Git-remote needs to complete remote names, its subcommands, and options
thereof. In addition to the existing subcommand and remote name
completion, do also complete the options

- add: --track --master --fetch --tags --no-tags --mirror=
- set-url: --push --add --delete
- get-url: --push --all
- prune: --dry-run

Signed-off-by: Cornelius Weig <cornelius.weig@tngtech.com>
Reviewed-by: SZEDER Gábor <szeder.dev@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

completion: teach replace to complete optionsCornelius Weig Fri, 3 Feb 2017 11:01:57 +0000 (12:01 +0100)

completion: teach replace to complete options

Git-replace needs to complete references and its own options. In
addition to the existing references completions, do also complete the
options --edit --graft --format= --list --delete.

Signed-off-by: Cornelius Weig <cornelius.weig@tngtech.com>
Reviewed-by: SZEDER Gábor <szeder.dev@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

completion: teach ls-remote to complete optionsCornelius Weig Fri, 3 Feb 2017 11:01:56 +0000 (12:01 +0100)

completion: teach ls-remote to complete options

ls-remote needs to complete remote names and its own options. In
addition to the existing remote name completions, do also complete
the options --heads, --tags, --refs, --get-url, and --symref.

Signed-off-by: Cornelius Weig <cornelius.weig@tngtech.com>
Reviewed-by: SZEDER Gábor <szeder.dev@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

completion: improve bash completion for git-addCornelius Weig Fri, 3 Feb 2017 11:01:55 +0000 (12:01 +0100)

completion: improve bash completion for git-add

Command completion for git-add did not recognize some long-options.
This commits adds completion for all long-options that are mentioned in
the man-page synopsis. In addition, if the user specified `--update` or
`-u`, path completion will only suggest modified tracked files.

Signed-off-by: Cornelius Weig <cornelius.weig@tngtech.com>
Reviewed-by: SZEDER Gábor <szeder.dev@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

completion: add subcommand completion for rerereCornelius Weig Fri, 3 Feb 2017 11:01:54 +0000 (12:01 +0100)

completion: add subcommand completion for rerere

Managing recorded resolutions requires command-line usage of git-rerere.
Added subcommand completion for rerere and path completion for its
subcommand forget.

Signed-off-by: Cornelius Weig <cornelius.weig@tngtech.com>
Reviewed-by: SZEDER Gábor <szeder.dev@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

completion: teach submodule subcommands to complete... Cornelius Weig Fri, 3 Feb 2017 11:01:53 +0000 (12:01 +0100)

completion: teach submodule subcommands to complete options

Each submodule subcommand has specific long-options. Therefore, teach
bash completion to support option completion based on the current
subcommand. All long-options that are mentioned in the man-page synopsis
are added.

Signed-off-by: Cornelius Weig <cornelius.weig@tngtech.com>
Reviewed-by: SZEDER Gábor <szeder.dev@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

l10n: git.pot: v2.12.0 round 1 (239 new, 15 removed)Jiang Xin Sat, 4 Feb 2017 05:02:24 +0000 (13:02 +0800)

l10n: git.pot: v2.12.0 round 1 (239 new, 15 removed)

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

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

Merge branch 'master' of git://github.com/git-l10n... Jiang Xin Sat, 4 Feb 2017 04:57:15 +0000 (12:57 +0800)

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

* 'master' of git://github.com/git-l10n/git-po:
l10n: bg: Updated Bulgarian translation (2913t+0f+0u)
l10n: fixes to Catalan translation
l10n: zh_CN: review for git v2.11.0 l10n
l10n: New Catalan translation maintainer

Git 2.12-rc0 v2.12.0-rc0Junio C Hamano Fri, 3 Feb 2017 19:29:52 +0000 (11:29 -0800)

Git 2.12-rc0

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

Merge branch 'cw/log-updates-for-all-refs-really'Junio C Hamano Fri, 3 Feb 2017 19:25:19 +0000 (11:25 -0800)

Merge branch 'cw/log-updates-for-all-refs-really'

The "core.logAllRefUpdates" that used to be boolean has been
enhanced to take 'always' as well, to record ref updates to refs
other than the ones that are expected to be updated (i.e. branches,
remote-tracking branches and notes).

* cw/log-updates-for-all-refs-really:
doc: add note about ignoring '--no-create-reflog'
update-ref: add test cases for bare repository
refs: add option core.logAllRefUpdates = always
config: add markup to core.logAllRefUpdates doc

Merge branch 'pl/complete-diff-submodule-diff'Junio C Hamano Fri, 3 Feb 2017 19:25:19 +0000 (11:25 -0800)

Merge branch 'pl/complete-diff-submodule-diff'

The command line completion (in contrib/) learned that
"git diff --submodule=" can take "diff" as a recently added option.

* pl/complete-diff-submodule-diff:
Completion: Add support for --submodule=diff

Merge branch 'rs/object-id'Junio C Hamano Fri, 3 Feb 2017 19:25:19 +0000 (11:25 -0800)

Merge branch 'rs/object-id'

"uchar [40]" to "struct object_id" conversion continues.

* rs/object-id:
checkout: convert post_checkout_hook() to struct object_id
use oidcpy() for copying hashes between instances of struct object_id
use oid_to_hex_r() for converting struct object_id hashes to hex strings

Merge branch 'js/re-running-failed-tests'Junio C Hamano Fri, 3 Feb 2017 19:25:19 +0000 (11:25 -0800)

Merge branch 'js/re-running-failed-tests'

"make -C t failed" will now run only the tests that failed in the
previous run. This is usable only when prove is not use, and gives
a useless error message when run after "make clean", but otherwise
is serviceable.

* js/re-running-failed-tests:
t/Makefile: add a rule to re-run previously-failed tests