gitweb.git
Merge branch 'sg/skip-prefix-in-prettify-refname'Junio C Hamano Tue, 28 Mar 2017 21:05:59 +0000 (14:05 -0700)

Merge branch 'sg/skip-prefix-in-prettify-refname'

Code cleanup.

* sg/skip-prefix-in-prettify-refname:
refs.c: use skip_prefix() in prettify_refname()

Merge branch 'ab/branch-list-doc'Junio C Hamano Tue, 28 Mar 2017 21:05:59 +0000 (14:05 -0700)

Merge branch 'ab/branch-list-doc'

Doc update.

* ab/branch-list-doc:
branch doc: update description for `--list`
branch doc: change `git branch <pattern>` to use `<branchname>`

Merge branch 'jk/pager-in-use'Junio C Hamano Tue, 28 Mar 2017 21:05:58 +0000 (14:05 -0700)

Merge branch 'jk/pager-in-use'

Code clean-up.

* jk/pager-in-use:
pager_in_use: use git_env_bool()

Merge branch 'tg/stash-push-fixup'Junio C Hamano Tue, 28 Mar 2017 21:05:58 +0000 (14:05 -0700)

Merge branch 'tg/stash-push-fixup'

Recent enhancement to "git stash push" command to support pathspec
to allow only a subset of working tree changes to be stashed away
was found to be too chatty and exposed the internal implementation
detail (e.g. when it uses reset to match the index to HEAD before
doing other things, output from reset seeped out). These, and
other chattyness has been fixed.

* tg/stash-push-fixup:
stash: keep untracked files intact in stash -k
stash: pass the pathspec argument to git reset
stash: don't show internal implementation details

Merge branch 'sb/checkout-recurse-submodules'Junio C Hamano Tue, 28 Mar 2017 21:05:58 +0000 (14:05 -0700)

Merge branch 'sb/checkout-recurse-submodules'

"git checkout" is taught the "--recurse-submodules" option.

* sb/checkout-recurse-submodules:
builtin/read-tree: add --recurse-submodules switch
builtin/checkout: add --recurse-submodules switch
entry.c: create submodules when interesting
unpack-trees: check if we can perform the operation for submodules
unpack-trees: pass old oid to verify_clean_submodule
update submodules: add submodule_move_head
submodule.c: get_super_prefix_or_empty
update submodules: move up prepare_submodule_repo_env
submodules: introduce check to see whether to touch a submodule
update submodules: add a config option to determine if submodules are updated
update submodules: add submodule config parsing
make is_submodule_populated gently
lib-submodule-update.sh: define tests for recursing into submodules
lib-submodule-update.sh: replace sha1 by hash
lib-submodule-update: teach test_submodule_content the -C <dir> flag
lib-submodule-update.sh: do not use ./. as submodule remote
lib-submodule-update.sh: reorder create_lib_submodule_repo
submodule--helper.c: remove duplicate code
connect_work_tree_and_git_dir: safely create leading directories

Merge branch 'bw/grep-recurse-submodules'Junio C Hamano Tue, 28 Mar 2017 21:05:57 +0000 (14:05 -0700)

Merge branch 'bw/grep-recurse-submodules'

Build fix for NO_PTHREADS build.

* bw/grep-recurse-submodules:
grep: fix builds with with no thread support
grep: set default output method

Eighth batch for 2.13Junio C Hamano Mon, 27 Mar 2017 18:00:12 +0000 (11:00 -0700)

Eighth batch for 2.13

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

Merge branch 'km/config-grammofix'Junio C Hamano Mon, 27 Mar 2017 17:59:29 +0000 (10:59 -0700)

Merge branch 'km/config-grammofix'

Doc update.

* km/config-grammofix:
doc/config: grammar fixes for core.{editor,commentChar}

Merge branch 'sb/t3600-rephrase'Junio C Hamano Mon, 27 Mar 2017 17:59:28 +0000 (10:59 -0700)

Merge branch 'sb/t3600-rephrase'

A test retitling.

* sb/t3600-rephrase:
t3600: rename test to describe its functionality

Merge branch 'sb/describe-broken'Junio C Hamano Mon, 27 Mar 2017 17:59:27 +0000 (10:59 -0700)

Merge branch 'sb/describe-broken'

"git describe --dirty" dies when it cannot be determined if the
state in the working tree matches that of HEAD (e.g. broken
repository or broken submodule). The command learned a new option
"git describe --broken" to give "$name-broken" (where $name is the
description of HEAD) in such a case.

* sb/describe-broken:
builtin/describe: introduce --broken flag

Merge branch 'sb/push-options-via-transport'Junio C Hamano Mon, 27 Mar 2017 17:59:27 +0000 (10:59 -0700)

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

Recently we started passing the "--push-options" through the
external remote helper interface; now the "smart HTTP" remote
helper understands what to do with the passed information.

* sb/push-options-via-transport:
remote-curl: allow push options
send-pack: send push options correctly in stateless-rpc case

Merge branch 'km/t1400-modernization'Junio C Hamano Mon, 27 Mar 2017 17:59:26 +0000 (10:59 -0700)

Merge branch 'km/t1400-modernization'

Code clean-up.

* km/t1400-modernization:
t1400: use test_when_finished for cleanup
t1400: remove a set of unused output files
t1400: use test_path_is_* helpers
t1400: set core.logAllRefUpdates in "logged by touch" tests
t1400: rename test descriptions to be unique

Merge branch 'jk/prefix-filename'Junio C Hamano Mon, 27 Mar 2017 17:59:26 +0000 (10:59 -0700)

Merge branch 'jk/prefix-filename'

Code clean-up with minor bugfixes.

* jk/prefix-filename:
bundle: use prefix_filename with bundle path
prefix_filename: simplify windows #ifdef
prefix_filename: return newly allocated string
prefix_filename: drop length parameter
prefix_filename: move docstring to header file
hash-object: fix buffer reuse with --path in a subdirectory

Merge branch 'jc/lint-runaway-here-doc'Junio C Hamano Mon, 27 Mar 2017 17:59:25 +0000 (10:59 -0700)

Merge branch 'jc/lint-runaway-here-doc'

The test framework learned to detect unterminated here documents.

* jc/lint-runaway-here-doc:
tests: lint for run-away here-doc

Merge branch 'st/verify-tag'Junio C Hamano Mon, 27 Mar 2017 17:59:22 +0000 (10:59 -0700)

Merge branch 'st/verify-tag'

A few unterminated here documents in tests were fixed, which in
turn revealed incorrect expectations the tests make. These tests
have been updated.

* st/verify-tag:
t7004, t7030: fix here-doc syntax errors

Merge branch 'sb/submodule-update-initial-runs-custom... Junio C Hamano Mon, 27 Mar 2017 17:59:21 +0000 (10:59 -0700)

Merge branch 'sb/submodule-update-initial-runs-custom-script'

A test fix.

* sb/submodule-update-initial-runs-custom-script:
t7406: correct test case for submodule-update initial population

Merge branch 'jk/quote-env-path-list-component'Junio C Hamano Mon, 27 Mar 2017 17:59:21 +0000 (10:59 -0700)

Merge branch 'jk/quote-env-path-list-component'

A test fix.

* jk/quote-env-path-list-component:
t5615: fix a here-doc syntax error

Sync with 2.12.2Junio C Hamano Fri, 24 Mar 2017 20:31:01 +0000 (13:31 -0700)

Sync with 2.12.2

Seventh batch for 2.13Junio C Hamano Fri, 24 Mar 2017 20:30:34 +0000 (13:30 -0700)

Seventh batch for 2.13

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

Merge branch 'jk/sha1dc'Junio C Hamano Fri, 24 Mar 2017 20:07:38 +0000 (13:07 -0700)

Merge branch 'jk/sha1dc'

The "detect attempt to create collisions" variant of SHA-1
implementation by Marc Stevens (CWI) and Dan Shumow (Microsoft)
has been integrated and made the default.

* jk/sha1dc:
Makefile: make DC_SHA1 the default
t0013: add a basic sha1 collision detection test
Makefile: add DC_SHA1 knob
sha1dc: disable safe_hash feature
sha1dc: adjust header includes for git
sha1dc: add collision-detecting sha1 implementation

Merge branch 'sg/test-with-stdin'Junio C Hamano Fri, 24 Mar 2017 20:07:38 +0000 (13:07 -0700)

Merge branch 'sg/test-with-stdin'

Teach the "debug" helper used in the test framework that allows a
command to run under "gdb" to make the session interactive.

* sg/test-with-stdin:
tests: make the 'test_pause' helper work in non-verbose mode
tests: create an interactive gdb session with the 'debug' helper

Merge branch 'rs/update-hook-optim'Junio C Hamano Fri, 24 Mar 2017 20:07:37 +0000 (13:07 -0700)

Merge branch 'rs/update-hook-optim'

Code clean-up.

* rs/update-hook-optim:
receive-pack: simplify run_update_post_hook()

Merge branch 'rs/shortlog-cleanup'Junio C Hamano Fri, 24 Mar 2017 20:07:37 +0000 (13:07 -0700)

Merge branch 'rs/shortlog-cleanup'

Code clean-up.

* rs/shortlog-cleanup:
shortlog: don't set after_subject to an empty string

Merge branch 'rs/path-name-safety-cleanup'Junio C Hamano Fri, 24 Mar 2017 20:07:36 +0000 (13:07 -0700)

Merge branch 'rs/path-name-safety-cleanup'

Code clean-up.

* rs/path-name-safety-cleanup:
revision: remove declaration of path_name()

Merge branch 'rs/http-push-cleanup'Junio C Hamano Fri, 24 Mar 2017 20:07:35 +0000 (13:07 -0700)

Merge branch 'rs/http-push-cleanup'

Code clean-up.

* rs/http-push-cleanup:
http-push: don't check return value of lookup_unknown_object()

Merge branch 'js/regexec-buf'Junio C Hamano Fri, 24 Mar 2017 20:07:35 +0000 (13:07 -0700)

Merge branch 'js/regexec-buf'

Fix for potential segv introduced in v2.11.0 and later (also
v2.10.2).

* js/regexec-buf:
pickaxe: fix segfault with '-S<...> --pickaxe-regex'

Merge branch 'jk/execv-dashed-external'Junio C Hamano Fri, 24 Mar 2017 20:07:34 +0000 (13:07 -0700)

Merge branch 'jk/execv-dashed-external'

Fix for NO_PTHREADS build.

* jk/execv-dashed-external:
run-command: fix segfault when cleaning forked async process

Merge branch 'dl/credential-cache-socket-in-xdg-cache'Junio C Hamano Fri, 24 Mar 2017 20:07:34 +0000 (13:07 -0700)

Merge branch 'dl/credential-cache-socket-in-xdg-cache'

The default location "~/.git-credential-cache/socket" for the
socket used to communicate with the credential-cache daemon has
been moved to "~/.cache/git/credential/socket".

* dl/credential-cache-socket-in-xdg-cache:
credential-cache: add tests for XDG functionality
credential-cache: use XDG_CACHE_HOME for socket
path.c: add xdg_cache_home

Git 2.12.2 v2.12.2Junio C Hamano Fri, 24 Mar 2017 19:59:15 +0000 (12:59 -0700)

Git 2.12.2

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

Merge branch 'ab/doc-no-option-notation-fix' into maintJunio C Hamano Fri, 24 Mar 2017 19:57:55 +0000 (12:57 -0700)

Merge branch 'ab/doc-no-option-notation-fix' into maint

Doc fix.

* ab/doc-no-option-notation-fix:
doc: change erroneous --[no]-whatever into --[no-]whatever

Merge branch 'ab/push-default-doc-fix' into maintJunio C Hamano Fri, 24 Mar 2017 19:57:54 +0000 (12:57 -0700)

Merge branch 'ab/push-default-doc-fix' into maint

Doc fix.

* ab/push-default-doc-fix:
push: mention "push.default=tracking" in the documentation

Merge branch 'nd/commit-hook-doc-fix' into maintJunio C Hamano Fri, 24 Mar 2017 19:57:54 +0000 (12:57 -0700)

Merge branch 'nd/commit-hook-doc-fix' into maint

Doc fix.

* nd/commit-hook-doc-fix:
git-commit.txt: list post-rewrite in HOOKS section

Merge branch 'jc/config-case-cmdline-take-2' into maintJunio C Hamano Fri, 24 Mar 2017 19:57:54 +0000 (12:57 -0700)

Merge branch 'jc/config-case-cmdline-take-2' into maint

The code to parse "git -c VAR=VAL cmd" and set configuration
variable for the duration of cmd had two small bugs, which have
been fixed.
This supersedes jc/config-case-cmdline topic that has been discarded.

* jc/config-case-cmdline-take-2:
config: use git_config_parse_key() in git_config_parse_parameter()
config: move a few helper functions up

Merge branch 'jk/grep-no-index-fix' into maintJunio C Hamano Fri, 24 Mar 2017 19:57:53 +0000 (12:57 -0700)

Merge branch 'jk/grep-no-index-fix' into maint

The code to parse the command line "git grep <patterns>... <rev>
[[--] <pathspec>...]" has been cleaned up, and a handful of bugs
have been fixed (e.g. we used to check "--" if it is a rev).

* jk/grep-no-index-fix:
grep: treat revs the same for --untracked as for --no-index
grep: do not diagnose misspelt revs with --no-index
grep: avoid resolving revision names in --no-index case
grep: fix "--" rev/pathspec disambiguation
grep: re-order rev-parsing loop
grep: do not unnecessarily query repo for "--"
grep: move thread initialization a little lower

Merge branch 'jn/remote-helpers-with-git-dir' into... Junio C Hamano Fri, 24 Mar 2017 19:57:53 +0000 (12:57 -0700)

Merge branch 'jn/remote-helpers-with-git-dir' into maint

"git ls-remote" and "git archive --remote" are designed to work
without being in a directory under Git's control. However, recent
updates revealed that we randomly look into a directory called
.git/ without actually doing necessary set-up when working in a
repository. Stop doing so.

* jn/remote-helpers-with-git-dir:
remote helpers: avoid blind fall-back to ".git" when setting GIT_DIR
remote: avoid reading $GIT_DIR config in non-repo

Merge branch 'sb/submodule-config-parse-ignore-fix... Junio C Hamano Fri, 24 Mar 2017 19:57:52 +0000 (12:57 -0700)

Merge branch 'sb/submodule-config-parse-ignore-fix' into maint

Code to read submodule.<name>.ignore config did not state the
variable name correctly when giving an error message diagnosing
misconfiguration.

* sb/submodule-config-parse-ignore-fix:
submodule-config: correct error reporting for invalid ignore value

Merge branch 'jk/push-deadlock-regression-fix' into... Junio C Hamano Fri, 24 Mar 2017 19:57:52 +0000 (12:57 -0700)

Merge branch 'jk/push-deadlock-regression-fix' into maint

"git push" had a handful of codepaths that could lead to a deadlock
when unexpected error happened, which has been fixed.

* jk/push-deadlock-regression-fix:
send-pack: report signal death of pack-objects
send-pack: read "unpack" status even on pack-objects failure
send-pack: improve unpack-status error messages
send-pack: use skip_prefix for parsing unpack status
send-pack: extract parsing of "unpack" response
receive-pack: fix deadlock when we cannot create tmpdir

mailmap: use Michael J Gruber's new addressMichael J Gruber Fri, 24 Mar 2017 14:01:36 +0000 (15:01 +0100)

mailmap: use Michael J Gruber's new address

Map both old addresses to the new, hopefully more permanent one.

Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
Signed-off-by: Michael J Gruber <git@grubix.eu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

pager_in_use: use git_env_bool()Jeff King Fri, 24 Mar 2017 18:59:12 +0000 (14:59 -0400)

pager_in_use: use git_env_bool()

The pager_in_use() function predates git_env_bool(), but
ends up doing the same thing. Let's make use of the latter,
which is shorter and less repetitive.

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

t7004, t7030: fix here-doc syntax errorsSantiago Torres Thu, 23 Mar 2017 22:28:47 +0000 (18:28 -0400)

t7004, t7030: fix here-doc syntax errors

Jan Palus noticed that some here-doc are spelled incorrectly,
resulting the entire remainder of the test snippet being slurped
into the "expect" file as if it were data, e.g. in this sequence

cat >expect <<EOF &&
... expectation ...
EOF
git $cmd_being_tested >actual &&
test_cmp expect actual

the last command of the test is "cat" that sends everything to
'expect' and succeeds.

Fixing these issues in t7004 and t7030 reveals that "git tag -v"
and "git verify-tag" with their --format option do not work as the
test was expecting originally. Instead of showing both valid tags
and tags with incorrect signatures on their output, tags that do not
pass verification are omitted from the output. Another breakage that
is uncovered is that these tests must be restricted to environment
where gpg is available.

Arguably, that is a safer behaviour, and because the format
specifiers like %(tag) do not have a way to show if the signature
verifies correctly, the command with the --format option cannot be
used to get a list of tags annotated with their signature validity
anyway.

For now, let's fix the here-doc syntax, update the expectation to
match the reality, and update the test prerequisite.

Maybe later when we extend the --format language available to "git
tag -v" and "git verify-tag" to include things like "%(gpg:status)",
we may want to change the behaviour so that piping a list of tag
names into

xargs git verify-tag --format='%(gpg:status) %(tag)'

becomes a good way to produce such a list, but that is a separate
topic.

Noticed-by: Jan Palus <jan.palus@gmail.com>
Helped-by: Jeff King <peff@peff.net>
Signed-off-by: Santiago Torres <santiago@nyu.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

branch doc: update description for `--list`Junio C Hamano Fri, 24 Mar 2017 04:17:00 +0000 (21:17 -0700)

branch doc: update description for `--list`

The paragraph begins with a sample command line `git branch <name>`
that has nothing to do with the option being described. Remove it,
but use the space to instead show that multiple patterns can be
given.

Also mention the unfortunate `-l` that can be easily confused with
it.

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

branch doc: change `git branch <pattern>` to use `... Ævar Arnfjörð Bjarmason Thu, 23 Mar 2017 12:03:26 +0000 (12:03 +0000)

branch doc: change `git branch <pattern>` to use `<branchname>`

Change an example for `git branch <pattern>` to say `git branch
<branchname>` to be consistent with the synopsis. This changes
documentation added in d8d33736b5 ("branch: allow pattern arguments",
2011-08-28).

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

tests: lint for run-away here-docJunio C Hamano Thu, 23 Mar 2017 05:43:18 +0000 (22:43 -0700)

tests: lint for run-away here-doc

We found a few run-away here documents that are started with an
end-of-here-doc marker that is incorrectly spelled, e.g.

git some command >actual &&
cat <<EOF >expect
...
EOF &&
test_cmp expect actual

which ends up slurping the entire remainder of the script as if it
were the data. Often the command that gets misused like this exits
without failure (e.g. "cat" in the above example), which makes the
command appear to work, without ever executing the remainder of the
test.

Piggy-back on the test that catches &&-chain breakage to detect this
case as well.

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

doc/config: grammar fixes for core.{editor,commentChar}Kyle Meyer Thu, 23 Mar 2017 17:32:16 +0000 (13:32 -0400)

doc/config: grammar fixes for core.{editor,commentChar}

Signed-off-by: Kyle Meyer <kyle@kyleam.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

refs.c: use skip_prefix() in prettify_refname()SZEDER Gábor Thu, 23 Mar 2017 15:50:12 +0000 (16:50 +0100)

refs.c: use skip_prefix() in prettify_refname()

This eliminates three magic numbers.

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

Merge branch 'js/rebase-helper'Junio C Hamano Thu, 23 Mar 2017 18:20:46 +0000 (11:20 -0700)

Merge branch 'js/rebase-helper'

A hotfix for a regression fix

* js/rebase-helper:
sequencer: fix missing newline

sequencer: fix missing newlineBrandon Williams Thu, 23 Mar 2017 17:02:33 +0000 (10:02 -0700)

sequencer: fix missing newline

When using rebase --interactive where one of the lines is marked as
'edit' this is the resulting output:

Stopped at ec3b9c4... stuffYou can amend the commit now, with

git commit --amend

Once you are satisfied with your changes, run

git rebase --continue

A newline character is missing at the end of the "Stopped at ..." line and
before the "You can amend ..." line. This patch fixes the malformed output by
adding the missing newline character to the end of the "Stopped at ..." line.

Signed-off-by: Brandon Williams <bmwill@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

remote-curl: allow push optionsBrandon Williams Wed, 22 Mar 2017 22:22:00 +0000 (15:22 -0700)

remote-curl: allow push options

Teach remote-curl to understand push options and to be able to convey
them across HTTP.

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

send-pack: send push options correctly in stateless... Brandon Williams Wed, 22 Mar 2017 22:21:59 +0000 (15:21 -0700)

send-pack: send push options correctly in stateless-rpc case

"git send-pack --stateless-rpc" puts each request in a sequence of pkt-lines
followed by a flush-pkt. The push option code forgot about this and sends push
options and their terminating delimiter as ordinary pkt-lines that get their
length header stripped off by remote-curl before being sent to the server.

The result is multiple malformed requests, which the server rejects.

Fortunately send-pack --stateless-rpc already is aware of this "pkt-line within
pkt-line" framing for the update commands that precede push options. Handle
push options the same way.

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

t7406: correct test case for submodule-update initial... Junio C Hamano Wed, 22 Mar 2017 22:12:07 +0000 (15:12 -0700)

t7406: correct test case for submodule-update initial population

There are three issues with the test:

* The syntax of the here-doc was wrong, such that the entire test was
sucked into the here-doc, which is why the test succeeded.

* The variable $submodulesha1 was not expanded as it was inside a quoted
here text. We do not want to quote EOF marker for this.

* The redirection from the git command to the output file for comparison
was wrong as the -C operator from git doesn't apply to the redirect path.
Also we're interested in stderr of that command.

Noticed-by: Jan Palus <jan.palus@gmail.com>
Signed-off-by: Stefan Beller <sbeller@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

stash: keep untracked files intact in stash -kThomas Gummerer Tue, 21 Mar 2017 22:12:19 +0000 (22:12 +0000)

stash: keep untracked files intact in stash -k

Currently when there are untracked changes in a file "one" and in a file
"two" in the repository and the user uses:

git stash push -k one

all changes in "two" are wiped out completely. That is clearly not the
intended result. Make sure that only the files given in the pathspec
are changed when git stash push -k <pathspec> is used.

Reported-by: Jeff King <peff@peff.net>
Signed-off-by: Thomas Gummerer <t.gummerer@gmail.com>
Reviewed-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

stash: pass the pathspec argument to git resetThomas Gummerer Tue, 21 Mar 2017 22:12:18 +0000 (22:12 +0000)

stash: pass the pathspec argument to git reset

For "git stash -p --no-keep-index", the pathspec argument is currently
not passed to "git reset". This means that changes that are staged but
that are excluded from the pathspec still get unstaged by git stash -p.

Make sure that doesn't happen by passing the pathspec argument to the
git reset in question, bringing the behaviour in line with "git stash --
<pathspec>".

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

stash: don't show internal implementation detailsThomas Gummerer Tue, 21 Mar 2017 22:12:17 +0000 (22:12 +0000)

stash: don't show internal implementation details

git stash push uses other git commands internally. Currently it only
passes the -q flag to those if the -q flag is passed to git stash. when
using 'git stash push -p -q --no-keep-index', it doesn't even pass the
flag on to the internal reset at all.

It really is enough for the user to know that the stash is created,
without bothering them with the internal details of what's happening.
Always pass the -q flag to the internal git clean and git reset
commands, to avoid unnecessary and potentially confusing output.

Reported-by: Jeff King <peff@peff.net>
Signed-off-by: Thomas Gummerer <t.gummerer@gmail.com>
Reviewed-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

t5615: fix a here-doc syntax errorJunio C Hamano Wed, 22 Mar 2017 19:56:43 +0000 (12:56 -0700)

t5615: fix a here-doc syntax error

This came as part of jk/quote-env-path-list-component and was merged
to 2.11.1 and later.

Noticed-by: Jan Palus <jan.palus@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

builtin/describe: introduce --broken flagStefan Beller Tue, 21 Mar 2017 22:57:18 +0000 (15:57 -0700)

builtin/describe: introduce --broken flag

git-describe tells you the version number you're at, or errors out, e.g.
when you run it outside of a repository, which may happen when downloading
a tar ball instead of using git to obtain the source code.

To keep this property of only erroring out, when not in a repository,
severe (submodule) errors must be downgraded to reporting them gently
instead of having git-describe error out completely.

To achieve that a flag '--broken' is introduced, which is in the same
vein as '--dirty' but uses an actual child process to check for dirtiness.
When that child dies unexpectedly, we'll append '-broken' instead of
'-dirty'.

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

t3600: rename test to describe its functionalityStefan Beller Tue, 21 Mar 2017 21:08:02 +0000 (14:08 -0700)

t3600: rename test to describe its functionality

This was an oversight in 55856a35b2 (rm: absorb a submodules git dir
before deletion, 2016-12-27), as the body of the test changed without
adapting the test subject.

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

Sync with maintJunio C Hamano Tue, 21 Mar 2017 22:11:38 +0000 (15:11 -0700)

Sync with maint

Sixth batch for 2.13Junio C Hamano Tue, 21 Mar 2017 22:11:13 +0000 (15:11 -0700)

Sixth batch for 2.13

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

Merge branch 'nd/commit-hook-doc-fix'Junio C Hamano Tue, 21 Mar 2017 22:07:20 +0000 (15:07 -0700)

Merge branch 'nd/commit-hook-doc-fix'

Doc fix.

* nd/commit-hook-doc-fix:
git-commit.txt: list post-rewrite in HOOKS section

Merge branch 'ab/push-default-doc-fix'Junio C Hamano Tue, 21 Mar 2017 22:07:19 +0000 (15:07 -0700)

Merge branch 'ab/push-default-doc-fix'

Doc fix.

* ab/push-default-doc-fix:
push: mention "push.default=tracking" in the documentation

Merge branch 'ab/doc-no-option-notation-fix'Junio C Hamano Tue, 21 Mar 2017 22:07:19 +0000 (15:07 -0700)

Merge branch 'ab/doc-no-option-notation-fix'

Doc fix.

* ab/doc-no-option-notation-fix:
doc: change erroneous --[no]-whatever into --[no-]whatever

Merge branch 'sb/wt-status-cleanup'Junio C Hamano Tue, 21 Mar 2017 22:07:18 +0000 (15:07 -0700)

Merge branch 'sb/wt-status-cleanup'

Code clean-up.

* sb/wt-status-cleanup:
wt-status: simplify by using for_each_string_list_item

Merge branch 'js/rebase-helper'Junio C Hamano Tue, 21 Mar 2017 22:07:18 +0000 (15:07 -0700)

Merge branch 'js/rebase-helper'

Recent update to "rebase -i" started showing a message that is not
a warning with "warning:" prefix by mistake. This has been fixed.

* js/rebase-helper:
sequencer: drop "warning:" when stopping for edit

Merge branch 'nd/conditional-config-include'Junio C Hamano Tue, 21 Mar 2017 22:07:18 +0000 (15:07 -0700)

Merge branch 'nd/conditional-config-include'

The configuration file learned a new "includeIf.<condition>.path"
that includes the contents of the given path only when the
condition holds. This allows you to say "include this work-related
bit only in the repositories under my ~/work/ directory".

* nd/conditional-config-include:
config: add conditional include
config.txt: reflow the second include.path paragraph
config.txt: clarify multiple key values in include.path

Merge branch 'jk/pack-name-cleanups'Junio C Hamano Tue, 21 Mar 2017 22:07:17 +0000 (15:07 -0700)

Merge branch 'jk/pack-name-cleanups'

Code clean-up.

* jk/pack-name-cleanups:
index-pack: make pointer-alias fallbacks safer
replace snprintf with odb_pack_name()
odb_pack_keep(): stop generating keepfile name
sha1_file.c: make pack-name helper globally accessible
move odb_* declarations out of git-compat-util.h

Merge branch 'sb/submodule-config-parse-ignore-fix'Junio C Hamano Tue, 21 Mar 2017 22:07:17 +0000 (15:07 -0700)

Merge branch 'sb/submodule-config-parse-ignore-fix'

Code to read submodule.<name>.ignore config did not state the
variable name correctly when giving an error message diagnosing
misconfiguration.

* sb/submodule-config-parse-ignore-fix:
submodule-config: correct error reporting for invalid ignore value

Merge branch 'mg/prompt-describe-tags'Junio C Hamano Tue, 21 Mar 2017 22:07:17 +0000 (15:07 -0700)

Merge branch 'mg/prompt-describe-tags'

The command line prompt (in contrib/) learned a new 'tag' style
that can be specified with GIT_PS1_DESCRIBE_STYLE, to describe a
detached HEAD with "git describe --tags".

* mg/prompt-describe-tags:
git-prompt: add a describe style for any tags

Merge branch 'jk/rev-parse-cleanup'Junio C Hamano Tue, 21 Mar 2017 22:07:16 +0000 (15:07 -0700)

Merge branch 'jk/rev-parse-cleanup'

Code clean-up.

* jk/rev-parse-cleanup:
rev-parse: simplify parsing of ref options
rev-parse: add helper for parsing "--foo/--foo="
rev-parse: use skip_prefix when parsing options

Prepare for 2.12.2Junio C Hamano Tue, 21 Mar 2017 22:04:12 +0000 (15:04 -0700)

Prepare for 2.12.2

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

Merge branch 'jh/send-email-one-cc' into maintJunio C Hamano Tue, 21 Mar 2017 22:03:30 +0000 (15:03 -0700)

Merge branch 'jh/send-email-one-cc' into maint

"Cc:" on the trailer part does not have to conform to RFC strictly,
unlike in the e-mail header. "git send-email" has been updated to
ignore anything after '>' when picking addresses, to allow non-address
cruft like " # stable 4.4" after the address.

* jh/send-email-one-cc:
send-email: only allow one address per body tag

Merge branch 'jk/t6300-cleanup' into maintJunio C Hamano Tue, 21 Mar 2017 22:03:30 +0000 (15:03 -0700)

Merge branch 'jk/t6300-cleanup' into maint

A test that creates a confusing branch whose name is HEAD has been
corrected not to do so.

* jk/t6300-cleanup:
t6300: avoid creating refs/heads/HEAD

Merge branch 'rs/commit-parsing-optim' into maintJunio C Hamano Tue, 21 Mar 2017 22:03:29 +0000 (15:03 -0700)

Merge branch 'rs/commit-parsing-optim' into maint

The code that parses header fields in the commit object has been
updated for (micro)performance and code hygiene.

* rs/commit-parsing-optim:
commit: don't check for space twice when looking for header
commit: be more precise when searching for headers

Merge branch 'jk/show-branch-lift-name-len-limit' into... Junio C Hamano Tue, 21 Mar 2017 22:03:29 +0000 (15:03 -0700)

Merge branch 'jk/show-branch-lift-name-len-limit' into maint

"git show-branch" expected there were only very short branch names
in the repository and used a fixed-length buffer to hold them
without checking for overflow.

* jk/show-branch-lift-name-len-limit:
show-branch: use skip_prefix to drop magic numbers
show-branch: store resolved head in heap buffer
show-branch: drop head_len variable

Merge branch 'jk/tempfile-ferror-fclose-confusion'... Junio C Hamano Tue, 21 Mar 2017 22:03:28 +0000 (15:03 -0700)

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

A caller of tempfile API that uses stdio interface to write to
files may ignore errors while writing, which is detected when
tempfile is closed (with a call to ferror()). By that time, the
original errno that may have told us what went wrong is likely to
be long gone and was overwritten by an irrelevant value.
close_tempfile() now resets errno to EIO to make errno at least
predictable.

* jk/tempfile-ferror-fclose-confusion:
tempfile: set errno to a known value before calling ferror()

Merge branch 'rl/remote-allow-missing-branch-name-merge... Junio C Hamano Tue, 21 Mar 2017 22:03:28 +0000 (15:03 -0700)

Merge branch 'rl/remote-allow-missing-branch-name-merge' into maint

"git remote rm X", when a branch has remote X configured as the
value of its branch.*.remote, tried to remove branch.*.remote and
branch.*.merge and failed if either is unset.

* rl/remote-allow-missing-branch-name-merge:
remote: ignore failure to remove missing branch.<name>.merge

Merge branch 'dt/gc-ignore-old-gc-logs' into maintJunio C Hamano Tue, 21 Mar 2017 22:03:28 +0000 (15:03 -0700)

Merge branch 'dt/gc-ignore-old-gc-logs' into maint

A "gc.log" file left by a backgrounded "gc --auto" disables further
automatic gc; it has been taught to run at least once a day (by
default) by ignoring a stale "gc.log" file that is too old.

* dt/gc-ignore-old-gc-logs:
gc: ignore old gc.log files

Merge branch 'jt/upload-pack-error-report' into maintJunio C Hamano Tue, 21 Mar 2017 22:03:27 +0000 (15:03 -0700)

Merge branch 'jt/upload-pack-error-report' into maint

"git upload-pack", which is a counter-part of "git fetch", did not
report a request for a ref that was not advertised as invalid.
This is generally not a problem (because "git fetch" will stop
before making such a request), but is the right thing to do.

* jt/upload-pack-error-report:
upload-pack: report "not our ref" to client

Merge branch 'rs/sha1-file-plug-fallback-base-leak... Junio C Hamano Tue, 21 Mar 2017 22:03:27 +0000 (15:03 -0700)

Merge branch 'rs/sha1-file-plug-fallback-base-leak' into maint

A leak in a codepath to read from a packed object in (rare) cases
has been plugged.

* rs/sha1-file-plug-fallback-base-leak:
sha1_file: release fallback base's memory in unpack_entry()

Merge branch 'ss/remote-bzr-hg-placeholder-wo-python... Junio C Hamano Tue, 21 Mar 2017 22:03:26 +0000 (15:03 -0700)

Merge branch 'ss/remote-bzr-hg-placeholder-wo-python' into maint

There is no need for Python only to give a few messages to the
standard error stream, but we somehow did.

* ss/remote-bzr-hg-placeholder-wo-python:
contrib: git-remote-{bzr,hg} placeholders don't need Python

Merge branch 'jc/diff-populate-filespec-size-only-fix... Junio C Hamano Tue, 21 Mar 2017 22:03:26 +0000 (15:03 -0700)

Merge branch 'jc/diff-populate-filespec-size-only-fix' into maint

"git diff --quiet" relies on the size field in diff_filespec to be
correctly populated, but diff_populate_filespec() helper function
made an incorrect short-cut when asked only to populate the size
field for paths that need to go through convert_to_git() (e.g. CRLF
conversion).

* jc/diff-populate-filespec-size-only-fix:
diff: do not short-cut CHECK_SIZE_ONLY check in diff_populate_filespec()

Merge branch 'jk/http-walker-buffer-underflow-fix'... Junio C Hamano Tue, 21 Mar 2017 22:03:25 +0000 (15:03 -0700)

Merge branch 'jk/http-walker-buffer-underflow-fix' into maint

"Dumb http" transport used to misparse a nonsense http-alternates
response, which has been fixed.

* jk/http-walker-buffer-underflow-fix:
http-walker: fix buffer underflow processing remote alternates

Merge branch 'mg/status-porcelain-no-i18n' into maintJunio C Hamano Tue, 21 Mar 2017 22:03:25 +0000 (15:03 -0700)

Merge branch 'mg/status-porcelain-no-i18n' into maint

"git status --porcelain" is supposed to give a stable output, but a
few strings were left as translatable by mistake.

* mg/status-porcelain-no-i18n:
git-status: make porcelain more robust

Merge branch 'ps/docs-diffcore' into maintJunio C Hamano Tue, 21 Mar 2017 22:03:25 +0000 (15:03 -0700)

Merge branch 'ps/docs-diffcore' into maint

Doc update.

* ps/docs-diffcore:
docs/diffcore: unquote "Complete Rewrites" in headers
docs/diffcore: fix grammar in diffcore-rename header

Merge branch 'ew/markdown-url-in-readme' into maintJunio C Hamano Tue, 21 Mar 2017 22:03:24 +0000 (15:03 -0700)

Merge branch 'ew/markdown-url-in-readme' into maint

Doc update.

* ew/markdown-url-in-readme:
README: create HTTP/HTTPS links from URLs in Markdown

Merge branch 'rj/remove-unused-mktemp' into maintJunio C Hamano Tue, 21 Mar 2017 22:03:24 +0000 (15:03 -0700)

Merge branch 'rj/remove-unused-mktemp' into maint

Code cleanup.

* rj/remove-unused-mktemp:
wrapper.c: remove unused gitmkstemps() function
wrapper.c: remove unused git_mkstemp() function

Merge branch 'jk/ewah-use-right-type-in-sizeof' into... Junio C Hamano Tue, 21 Mar 2017 22:03:23 +0000 (15:03 -0700)

Merge branch 'jk/ewah-use-right-type-in-sizeof' into maint

Code clean-up.

* jk/ewah-use-right-type-in-sizeof:
ewah: fix eword_t/uint64_t confusion

bundle: use prefix_filename with bundle pathJeff King Tue, 21 Mar 2017 01:31:27 +0000 (21:31 -0400)

bundle: use prefix_filename with bundle path

We may take the path to a bundle file as an argument, and
need to adjust the filename based on the prefix we
discovered while setting up the git directory. We do so
manually into a fixed-size buffer, but using
prefix_filename() is the normal way.

Besides being more concise, there are two subtle
improvements:

1. The original inserted a "/" between the two paths, even
though the "prefix" argument always has the "/"
appended. That means that:

cd subdir && git bundle verify ../foo.bundle

was looking at (and reporting) subdir//../foo.bundle.
Harmless, but ugly. Using prefix_filename() gets this
right.

2. The original checked for an absolute path by looking
for a leading '/'. It should have been using
is_absolute_path(), which also covers more cases on
Windows (backslashes and dos drive prefixes).

But it's easier still to just pass the name to
prefix_filename(), which handles this case
automatically.

Note that we'll just leak the resulting buffer in the name
of simplicity, since it needs to last through the duration
of the program anyway.

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

prefix_filename: simplify windows #ifdefJeff King Tue, 21 Mar 2017 01:30:41 +0000 (21:30 -0400)

prefix_filename: simplify windows #ifdef

The prefix_filename function used to do an early return when
there was no prefix on non-Windows platforms, but always
allocated on Windows so that it could call convert_slashes().

Now that the function always allocates, we can unify the
logic and make convert_slashes() the only conditional part.

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

prefix_filename: return newly allocated stringJeff King Tue, 21 Mar 2017 01:28:49 +0000 (21:28 -0400)

prefix_filename: return newly allocated string

The prefix_filename() function returns a pointer to static
storage, which makes it easy to use dangerously. We already
fixed one buggy caller in hash-object recently, and the
calls in apply.c are suspicious (I didn't dig in enough to
confirm that there is a bug, but we call the function once
in apply_all_patches() and then again indirectly from
parse_chunk()).

Let's make it harder to get wrong by allocating the return
value. For simplicity, we'll do this even when the prefix is
empty (and we could just return the original file pointer).
That will cause us to allocate sometimes when we wouldn't
otherwise need to, but this function isn't called in
performance critical code-paths (and it already _might_
allocate on any given call, so a caller that cares about
performance is questionable anyway).

The downside is that the callers need to remember to free()
the result to avoid leaking. Most of them already used
xstrdup() on the result, so we know they are OK. The
remainder have been converted to use free() as appropriate.

I considered retaining a prefix_filename_unsafe() for cases
where we know the static lifetime is OK (and handling the
cleanup is awkward). This is only a handful of cases,
though, and it's not worth the mental energy in worrying
about whether the "unsafe" variant is OK to use in any
situation.

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

prefix_filename: drop length parameterJeff King Tue, 21 Mar 2017 01:22:28 +0000 (21:22 -0400)

prefix_filename: drop length parameter

This function takes the prefix as a ptr/len pair, but in
every caller the length is exactly strlen(ptr). Let's
simplify the interface and just take the string. This saves
callers specifying it (and in some cases handling a NULL
prefix).

In a handful of cases we had the length already without
calling strlen, so this is technically slower. But it's not
likely to matter (after all, if the prefix is non-empty
we'll allocate and copy it into a buffer anyway).

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

prefix_filename: move docstring to header fileJeff King Tue, 21 Mar 2017 01:21:27 +0000 (21:21 -0400)

prefix_filename: move docstring to header file

This is a public function, so we should make its
documentation available near the declaration.

While we're at it, we can give a few details about how it
works.

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

hash-object: fix buffer reuse with --path in a subdirectoryJeff King Tue, 21 Mar 2017 01:20:42 +0000 (21:20 -0400)

hash-object: fix buffer reuse with --path in a subdirectory

The hash-object command uses prefix_filename() without
duplicating its return value. Since that function returns a
static buffer, the value is overwritten by subsequent calls.

This can cause incorrect results when we use --path along
with hashing a file by its relative path, both of which need
to call prefix_filename(). We overwrite the filename
computed for --path, effectively ignoring it.

We can fix this by calling xstrdup on the return value. Note
that we don't bother freeing the "vpath" instance, as it
remains valid until the program exit.

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

t1400: use test_when_finished for cleanupKyle Meyer Tue, 21 Mar 2017 00:56:16 +0000 (20:56 -0400)

t1400: use test_when_finished for cleanup

Move cleanup lines that occur after test blocks into
test_when_finished calls within the test bodies. Don't move cleanup
lines that seem to be related to mutiple tests rather than a single
test.

Signed-off-by: Kyle Meyer <kyle@kyleam.com>
Reviewed-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

t1400: remove a set of unused output filesKyle Meyer Tue, 21 Mar 2017 00:56:15 +0000 (20:56 -0400)

t1400: remove a set of unused output files

This test case redirects stdout and stderr to output files, but,
unlike the other cases of redirection in the t1400 tests, these files
are not examined downstream. Remove the redirection so that the
output is visible when running the tests verbosely.

Signed-off-by: Kyle Meyer <kyle@kyleam.com>
Reviewed-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

t1400: use test_path_is_* helpersKyle Meyer Tue, 21 Mar 2017 00:56:14 +0000 (20:56 -0400)

t1400: use test_path_is_* helpers

Signed-off-by: Kyle Meyer <kyle@kyleam.com>
Reviewed-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

t1400: set core.logAllRefUpdates in "logged by touch... Kyle Meyer Tue, 21 Mar 2017 00:56:13 +0000 (20:56 -0400)

t1400: set core.logAllRefUpdates in "logged by touch" tests

A group of update-ref tests verifies that logs are created when either
the log file for the ref already exists or core.logAllRefUpdates is
"true". However, when the default for core.logAllRefUpdates was
changed in 0bee59186 (Enable reflogs by default in any repository with
a working directory., 2006-12-14), the setup for the tests was not
updated. As a result, the "logged by touch" tests would pass even if
the log file did not exist (i.e., if "--create-reflog" was removed
from the first "git update-ref" call).

Update the "logged by touch" tests to disable core.logAllRefUpdates
explicitly so that the behavior does not depend on the default value.
While we're here, update the "logged by config" tests to use
test_config() rather than setting core.logAllRefUpdates to "true"
outside of the tests.

Signed-off-by: Kyle Meyer <kyle@kyleam.com>
Reviewed-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

t1400: rename test descriptions to be uniqueKyle Meyer Tue, 21 Mar 2017 00:56:12 +0000 (20:56 -0400)

t1400: rename test descriptions to be unique

A few tests share their description with another test. Extend the
descriptions to indicate how the tests differ.

Signed-off-by: Kyle Meyer <kyle@kyleam.com>
Reviewed-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Sync with 2.12.1Junio C Hamano Mon, 20 Mar 2017 20:56:09 +0000 (13:56 -0700)

Sync with 2.12.1

Merge branch 'js/difftool-builtin'Junio C Hamano Mon, 20 Mar 2017 20:56:00 +0000 (13:56 -0700)

Merge branch 'js/difftool-builtin'

"git difftool --dir-diff" used to die a controlled death giving a
"fatal" message when encountering a locally modified symbolic link,
but it started segfaulting since v2.12. This has been fixed.

* js/difftool-builtin:
difftool: handle modified symlinks in dir-diff mode
t7800: cleanup cruft left behind by tests
t7800: remove whitespace before redirect

Git 2.12.1 v2.12.1Junio C Hamano Mon, 20 Mar 2017 20:17:08 +0000 (13:17 -0700)

Git 2.12.1

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