gitweb.git
Merge branch 'tb/blame-force-read-cache-to-workaround... Junio C Hamano Wed, 13 Apr 2016 21:12:40 +0000 (14:12 -0700)

Merge branch 'tb/blame-force-read-cache-to-workaround-safe-crlf'

When running "git blame $path" with unnormalized data in the index
for the path, the data in the working tree was blamed, even though
"git add" would not have changed what is already in the index, due
to "safe crlf" that disables the line-end conversion. It has been
corrected.

* tb/blame-force-read-cache-to-workaround-safe-crlf:
correct blame for files commited with CRLF

Merge branch 'mg/complete-cherry-mark-to-log'Junio C Hamano Wed, 13 Apr 2016 21:12:39 +0000 (14:12 -0700)

Merge branch 'mg/complete-cherry-mark-to-log'

The completion scripts (in contrib/) did not include the
"--cherry-mark" option when completing "git log <HT>".

* mg/complete-cherry-mark-to-log:
completion: complete --cherry-mark for git log

Merge branch 'ep/trace-doc-sample-fix'Junio C Hamano Wed, 13 Apr 2016 21:12:38 +0000 (14:12 -0700)

Merge branch 'ep/trace-doc-sample-fix'

Fix a typo in an example in the trace API documentation.

* ep/trace-doc-sample-fix:
api-trace.txt: fix typo

Merge branch 'jc/makefile-redirection-stderr'Junio C Hamano Wed, 13 Apr 2016 21:12:37 +0000 (14:12 -0700)

Merge branch 'jc/makefile-redirection-stderr'

A minor fix in the Makefile.

* jc/makefile-redirection-stderr:
Makefile: fix misdirected redirections

Merge branch 'lt/pretty-expand-tabs'Junio C Hamano Wed, 13 Apr 2016 21:12:36 +0000 (14:12 -0700)

Merge branch 'lt/pretty-expand-tabs'

When "git log" shows the log message indented by 4-spaces, the
remainder of a line after a HT does not align in the way the author
originally intended. The command now expands tabs by default in
such a case, and allows the users to override it with a new option,
'--no-expand-tabs'.

* lt/pretty-expand-tabs:
pretty: test --expand-tabs
pretty: allow tweaking tabwidth in --expand-tabs
pretty: enable --expand-tabs by default for selected pretty formats
pretty: expand tabs in indented logs to make things line up properly

Merge branch 'mj/pull-rebase-autostash'Junio C Hamano Wed, 13 Apr 2016 21:12:36 +0000 (14:12 -0700)

Merge branch 'mj/pull-rebase-autostash'

"git pull --rebase" learned "--[no-]autostash" option, so that
the rebase.autostash configuration variable set to true can be
overridden from the command line.

* mj/pull-rebase-autostash:
t5520: test --[no-]autostash with pull.rebase=true
t5520: reduce commom lines of code
t5520: factor out common "failing autostash" code
t5520: factor out common "successful autostash" code
t5520: use better test to check stderr output
t5520: ensure consistent test conditions
t5520: use consistent capitalization in test titles
pull --rebase: add --[no-]autostash flag
git-pull.c: introduce git_pull_config()

Merge branch 'jn/mergetools-examdiff'Junio C Hamano Wed, 13 Apr 2016 21:12:36 +0000 (14:12 -0700)

Merge branch 'jn/mergetools-examdiff'

"git mergetools" learned to drive ExamDiff.

* jn/mergetools-examdiff:
mergetools: add support for ExamDiff
mergetools: create mergetool_find_win32_cmd() helper function for winmerge

Merge branch 'es/format-patch-doc-hide-no-patch'Junio C Hamano Wed, 13 Apr 2016 21:12:35 +0000 (14:12 -0700)

Merge branch 'es/format-patch-doc-hide-no-patch'

"git format-patch --help" showed `-s` and `--no-patch` as if these
are valid options to the command. We already hide `--patch` option
from the documentation, because format-patch is about showing the
diff, and the documentation now hides these options as well.

* es/format-patch-doc-hide-no-patch:
git-format-patch.txt: don't show -s as shorthand for multiple options

Merge branch 'js/mingw-tests-2.8'Junio C Hamano Wed, 13 Apr 2016 21:12:34 +0000 (14:12 -0700)

Merge branch 'js/mingw-tests-2.8'

Code clean-up.

* js/mingw-tests-2.8:
Windows: shorten code by re-using convert_slashes()

Merge branch 'cc/apply'Junio C Hamano Wed, 13 Apr 2016 21:12:34 +0000 (14:12 -0700)

Merge branch 'cc/apply'

Minor code clean-up.

* cc/apply:
builtin/apply: free patch when parse_chunk() fails
builtin/apply: handle parse_binary() failure
apply: remove unused call to free() in gitdiff_{old,new}name()
builtin/apply: get rid of useless 'name' variable

Merge branch 'sb/misc-cleanups'Junio C Hamano Wed, 13 Apr 2016 21:12:34 +0000 (14:12 -0700)

Merge branch 'sb/misc-cleanups'

Assorted minor clean-ups.

* sb/misc-cleanups:
credential-cache, send_request: close fd when done
bundle: don't leak an fd in case of early return
abbrev_sha1_in_line: don't leak memory
notes: don't leak memory in git_config_get_notes_strategy

Merge branch 'sk/send-pack-all-fix'Junio C Hamano Wed, 13 Apr 2016 21:12:33 +0000 (14:12 -0700)

Merge branch 'sk/send-pack-all-fix'

"git send-pack --all <there>" was broken when its command line
option parsing was written in the 2.6 timeframe.

* sk/send-pack-all-fix:
git-send-pack: fix --all option when used with directory

Merge branch 'sg/diff-multiple-identical-renames'Junio C Hamano Wed, 13 Apr 2016 21:12:32 +0000 (14:12 -0700)

Merge branch 'sg/diff-multiple-identical-renames'

"git diff -M" used to work better when two originally identical
files A and B got renamed to X/A and X/B by pairing A to X/A and B
to X/B, but this was broken in the 2.0 timeframe.

* sg/diff-multiple-identical-renames:
diffcore: fix iteration order of identical files during rename detection

Merge branch 'kn/for-each-tag-branch'Junio C Hamano Wed, 13 Apr 2016 21:12:31 +0000 (14:12 -0700)

Merge branch 'kn/for-each-tag-branch'

A minor documentation update.

* kn/for-each-tag-branch:
for-each-ref: fix description of '--contains' in manpage

Merge branch 'ky/branch-d-worktree'Junio C Hamano Wed, 13 Apr 2016 21:12:30 +0000 (14:12 -0700)

Merge branch 'ky/branch-d-worktree'

When "git worktree" feature is in use, "git branch -d" allowed
deletion of a branch that is checked out in another worktree

* ky/branch-d-worktree:
branch -d: refuse deleting a branch which is currently checked out

Merge branch 'rz/worktree-no-checkout'Junio C Hamano Wed, 13 Apr 2016 21:12:30 +0000 (14:12 -0700)

Merge branch 'rz/worktree-no-checkout'

"git worktree add" can be given "--no-checkout" option to only
create an empty worktree without checking out the files.

* rz/worktree-no-checkout:
worktree: add: introduce --checkout option

Merge branch 'rt/rebase-i-shorten-stop-report'Junio C Hamano Wed, 13 Apr 2016 21:12:30 +0000 (14:12 -0700)

Merge branch 'rt/rebase-i-shorten-stop-report'

The commit object name reported when "rebase -i" stops has been
shortened.

* rt/rebase-i-shorten-stop-report:
rebase-i: print an abbreviated hash when stop for editing

Merge branch 'rt/completion-help'Junio C Hamano Wed, 13 Apr 2016 21:12:29 +0000 (14:12 -0700)

Merge branch 'rt/completion-help'

Shell completion (in contrib/) updates.

* rt/completion-help:
completion: add 'revisions' and 'everyday' to 'git help'
completion: add option '--guides' to 'git help'

Merge branch 'ak/use-hashmap-iter-first-in-submodule... Junio C Hamano Wed, 13 Apr 2016 21:12:29 +0000 (14:12 -0700)

Merge branch 'ak/use-hashmap-iter-first-in-submodule-config'

Minor code cleanup.

* ak/use-hashmap-iter-first-in-submodule-config:
submodule-config: use hashmap_iter_first()

Merge branch 'jk/check-repository-format'Junio C Hamano Wed, 13 Apr 2016 21:12:28 +0000 (14:12 -0700)

Merge branch 'jk/check-repository-format'

The repository set-up sequence has been streamlined (the biggest
change is that there is no longer git_config_early()), so that we
do not attempt to look into refs/* when we know we do not have a
Git repository.

* jk/check-repository-format:
verify_repository_format: mark messages for translation
setup: drop repository_format_version global
setup: unify repository version callbacks
init: use setup.c's repo version verification
setup: refactor repo format reading and verification
config: drop git_config_early
check_repository_format_gently: stop using git_config_early
lazily load core.sharedrepository
wrap shared_repository global in get/set accessors
setup: document check_repository_format()

merge-octopus: abort if index does not match HEADElijah Newren Sun, 10 Apr 2016 06:13:38 +0000 (23:13 -0700)

merge-octopus: abort if index does not match HEAD

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

t6044: new merge testcases for when index doesn't match... Elijah Newren Sun, 10 Apr 2016 06:13:37 +0000 (23:13 -0700)

t6044: new merge testcases for when index doesn't match HEAD

With one exception, we require the index to exactly match the
current HEAD commit at the time git merge is invoked. This
expectation was even documented in git-merge.txt until commit
ebef7e5 (Documentation: simplify How Merge Works, 2010-01-23).

Most merge strategies enforced this requirement, but it turns out
not all did. The current exceptions were the following two:

* ff updates
* octopus merges

ff updates actually will error out if the staged change is to a path
modified between HEAD and the commit being merged. If the path(s)
that are staged are files unrelated to the changes between these two
commits, though, then an ff update will just keep these staged
changes around after the merge. This is the one exception we
expected to the abort-merge-if- index-doesn't-match-HEAD rule.

For octopus merges, the rule should be enforced. Unfortunately, the
current behavior of the code is to ignore the difference and use the
staged changes in place of whatever is in HEAD as it proceeds to
perform the merge. So if the staged changes can be cleanly merged
with all the other heads, then the staged changes will just be
incorported into the resulting commit. If the staged changes cannot
be cleanly merged with all the other heads, the merge is not aborted
-- merge conflicts are simply reported as if HEAD had originally
contained whatever the index did.

Add testcases that check our expectations. A subsequent commit will
correct the erroneous octopus merge behavior.

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

builtin/merge.c: fix a bug with trivial mergesElijah Newren Sun, 10 Apr 2016 06:13:40 +0000 (23:13 -0700)

builtin/merge.c: fix a bug with trivial merges

If read_tree_trivial() succeeds and produces a tree that is already
in the object store, then the index is not written to disk, leaving
it out-of-sync with both HEAD and the working tree.

In order to write the index back out to disk after a merge,
write_index_locked() needs to be called. For most merge strategies, this
is done from try_merge_strategy(). For fast forward updates, this is
done from checkout_fast_forward(). When trivial merges work, the call to
write_index_locked() is buried a little deeper:

merge_trivial()
-> write_tree_trivial()
-> write_cache_as_tree()
-> write_index_as_tree()
-> write_locked_index()

However, it is only called when !cache_tree_fully_valid(), which is how
this bug is triggered. But that also shows why this bug doesn't affect
any other merge strategies or cases.

Add a direct call to write_index_locked() from merge_trivial() to fix
this issue. Since the indirect call to write_locked_index() was
conditional on cache_tree_fully_valid(), it won't be written twice.

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

t7605: add a testcase demonstrating a bug with trivial... Elijah Newren Sun, 10 Apr 2016 06:13:39 +0000 (23:13 -0700)

t7605: add a testcase demonstrating a bug with trivial merges

Repeating a trivial merge more than once will leave the index out of
sync, despite being clean before the merge and operating on the
exact same heads as the first run. The recorded merge has the
correct tree and the working tree is brought up to date, it is just
the index that is left as it was before the merge. Every attempt to
repeat the merge beyond the first will leave the index in the same
weird out-of-sync state.

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

t3404: use write_scriptJunio C Hamano Tue, 12 Apr 2016 16:59:59 +0000 (09:59 -0700)

t3404: use write_script

The test uses hardcoded #!/bin/sh to create a pre-commit hook
script. Because the generated script uses $(command substitution),
which is not supported by /bin/sh on some platforms (e.g. Solaris),
the resulting pre-commit always fails.

Which is not noticeable as the test that uses the hook is about
checking the behaviour of the command when the hook fails ;-), but
nevertheless it is not testing what we wanted to test.

Use write_script so that the resulting script is run under the same
shell our scripted Porcelain commands are run, which must support
the necessary $(construct).

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

t1020: do not overuse printf and use write_scriptJunio C Hamano Sun, 10 Apr 2016 19:01:30 +0000 (12:01 -0700)

t1020: do not overuse printf and use write_script

The test prepares a sample file "dir/two" with a single incomplete
line in it with "printf", and also prepares a small helper script
"diff" to create a file with a single incomplete line in it, again
with "printf". The output from the latter is compared with an
expected output, again prepared with "printf" hence lacking the
final LF. There is no reason for this test to be using files with
an incomplete line at the end, and these look more like a mistake
of not using

printf "%s\n" "string to be written"

and using

printf "string to be written"

Depending on what would be in $GIT_PREFIX, using the latter form
could be a bug waiting to happen. Correct them.

Also, the test uses hardcoded #!/bin/sh to create a small helper
script. For a small task like what the generated script does, it
does not matter too much in that what appears as /bin/sh would not
be _so_ broken, but while we are at it, use write_script instead,
which happens to make the result easier to read by reducing need
of one level of quoting.

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

t5532: use write_scriptJeff King Sat, 9 Apr 2016 21:04:30 +0000 (17:04 -0400)

t5532: use write_script

The recent cleanup in b7cbbff switched t5532's use of
backticks to $(). This matches our normal shell style, which
is good. But it also breaks the test on Solaris, where
/bin/sh does not understand $().

Our normal shell style assumes a modern-ish shell which
knows about $(). However, some tests create small helper
scripts and just write "#!/bin/sh" into them. These scripts
either need to go back to using backticks, or they need to
respect $SHELL_PATH. The easiest way to do the latter is to
use write_script.

While we're at it, let's also stick the script creation
inside a test_expect block (our usual style), and split the
perl snippet into its own script (to prevent quoting
madness).

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

refs: on symref reflog expire, lock symref not referrentDavid Turner Thu, 7 Apr 2016 19:03:11 +0000 (15:03 -0400)

refs: on symref reflog expire, lock symref not referrent

When locking a symbolic ref to expire a reflog, lock the symbolic
ref (using REF_NODEREF) instead of its referent.

Add a test for this.

Signed-off-by: David Turner <dturner@twopensource.com>
Reviewed-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

refs: move resolve_ref_unsafe into common codeDavid Turner Thu, 7 Apr 2016 19:03:10 +0000 (15:03 -0400)

refs: move resolve_ref_unsafe into common code

Now that resolve_ref_unsafe's only interaction with the backend is
through read_raw_ref, we can move it into the common code. Later,
we'll replace read_raw_ref with a backend function.

Signed-off-by: David Turner <dturner@twopensource.com>
Reviewed-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

show_head_ref(): check the result of resolve_ref_namesp... Michael Haggerty Thu, 7 Apr 2016 19:03:09 +0000 (15:03 -0400)

show_head_ref(): check the result of resolve_ref_namespace()

Only use the result of resolve_ref_namespace() if it is non-NULL.

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: David Turner <dturner@twopensource.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

check_aliased_update(): check that dst_name is non... Michael Haggerty Thu, 7 Apr 2016 19:03:08 +0000 (15:03 -0400)

check_aliased_update(): check that dst_name is non-NULL

If there is an error in resolve_ref_unsafe(), it returns NULL. We check
for this case, but not until after calling strip_namespace(). Instead,
call strip_namespace() *after* the NULL check.

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: David Turner <dturner@twopensource.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

checkout_paths(): remove unneeded flag variableMichael Haggerty Thu, 7 Apr 2016 19:03:07 +0000 (15:03 -0400)

checkout_paths(): remove unneeded flag variable

It is never read, so we can pass NULL to resolve_ref_unsafe().

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: David Turner <dturner@twopensource.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

cmd_merge(): remove unneeded flag variableMichael Haggerty Thu, 7 Apr 2016 19:03:06 +0000 (15:03 -0400)

cmd_merge(): remove unneeded flag variable

It is never read, so we can pass NULL to resolve_ref_unsafe().

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: David Turner <dturner@twopensource.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

fsck_head_link(): remove unneeded flag variableMichael Haggerty Thu, 7 Apr 2016 19:03:05 +0000 (15:03 -0400)

fsck_head_link(): remove unneeded flag variable

It is never read, so we can pass NULL to resolve_ref_unsafe().

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: David Turner <dturner@twopensource.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

read_raw_ref(): change flags parameter to unsigned intMichael Haggerty Thu, 7 Apr 2016 19:03:04 +0000 (15:03 -0400)

read_raw_ref(): change flags parameter to unsigned int

read_raw_ref() is going to be part of the vtable for reference backends,
so clean up its interface to use "unsigned int flags" rather than "int
flags". Its caller still uses signed int for its flags arguments. But
changing that would touch a lot of code, so leave it for now.

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: David Turner <dturner@twopensource.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

files-backend: inline resolve_ref_1() into resolve_ref_... Michael Haggerty Thu, 7 Apr 2016 19:03:03 +0000 (15:03 -0400)

files-backend: inline resolve_ref_1() into resolve_ref_unsafe()

resolve_ref_unsafe() wasn't doing anything useful anymore.

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: David Turner <dturner@twopensource.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

read_raw_ref(): manage own scratch spaceMichael Haggerty Thu, 7 Apr 2016 19:03:02 +0000 (15:03 -0400)

read_raw_ref(): manage own scratch space

Instead of creating scratch space in resolve_ref_unsafe() and passing
it down through resolve_ref_1 to read_raw_ref(), teach read_raw_ref()
to manage its own scratch space. This reduces coupling across the
functions at the cost of some extra allocations.

Also, when read_raw_ref() is implemented for different reference
backends, the other implementations might have different scratch
space requirements.

Note that we now preserve errno across the calls to strbuf_release(),
which calls free() and can thus theoretically overwrite errno.

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: David Turner <dturner@twopensource.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

files-backend: break out ref readingDavid Turner Thu, 7 Apr 2016 19:03:01 +0000 (15:03 -0400)

files-backend: break out ref reading

Refactor resolve_ref_1 in terms of a new function read_raw_ref, which
is responsible for reading ref data from the ref storage.

Later, we will make read_raw_ref a pluggable backend function, and make
resolve_ref_unsafe common.

Signed-off-by: David Turner <dturner@twopensource.com>
Helped-by: Duy Nguyen <pclouds@gmail.com>
Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

resolve_ref_1(): eliminate local variable "bad_name"Michael Haggerty Thu, 7 Apr 2016 19:03:00 +0000 (15:03 -0400)

resolve_ref_1(): eliminate local variable "bad_name"

We can use (*flags & REF_BAD_NAME) for that purpose.

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: David Turner <dturner@twopensource.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

resolve_ref_1(): reorder codeMichael Haggerty Thu, 7 Apr 2016 19:02:59 +0000 (15:02 -0400)

resolve_ref_1(): reorder code

There is no need to adjust *flags if we're just about to fail.

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: David Turner <dturner@twopensource.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

resolve_ref_1(): eliminate local variableMichael Haggerty Thu, 7 Apr 2016 19:02:58 +0000 (15:02 -0400)

resolve_ref_1(): eliminate local variable

In place of `buf`, use `refname`, which is anyway a better description
of what is being pointed at.

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: David Turner <dturner@twopensource.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

resolve_ref_unsafe(): ensure flags is always setMichael Haggerty Thu, 7 Apr 2016 19:02:57 +0000 (15:02 -0400)

resolve_ref_unsafe(): ensure flags is always set

If the caller passes flags==NULL, then set it to point at a local
scratch variable. This removes the need for a lot of "if (flags)"
guards in resolve_ref_1() and resolve_missing_loose_ref().

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: David Turner <dturner@twopensource.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

resolve_ref_unsafe(): use for loop to count up to MAXDEPTHMichael Haggerty Thu, 7 Apr 2016 19:02:56 +0000 (15:02 -0400)

resolve_ref_unsafe(): use for loop to count up to MAXDEPTH

The loop's there anyway; we might as well use it.

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: David Turner <dturner@twopensource.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

resolve_missing_loose_ref(): simplify semanticsMichael Haggerty Thu, 7 Apr 2016 19:02:55 +0000 (15:02 -0400)

resolve_missing_loose_ref(): simplify semantics

Make resolve_missing_loose_ref() only responsible for looking up a
packed reference, without worrying about whether we want to read or
write the reference and without setting errno on failure. Move the other
logic to the caller.

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: David Turner <dturner@twopensource.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

t1430: improve test coverage of deletion of badly-named... Michael Haggerty Thu, 7 Apr 2016 19:02:54 +0000 (15:02 -0400)

t1430: improve test coverage of deletion of badly-named refs

Check "branch -d broken...ref"

Check various combinations of

* Deleting using "update-ref -d"
* Deleting using "update-ref --no-deref -d"
* Deleting using "branch -d"

in the following combinations of symref -> ref:

* badname -> broken...ref
* badname -> broken...ref (dangling)
* broken...symref -> master
* broken...symref -> idonotexist (dangling)

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: David Turner <dturner@twopensource.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

t1430: test for-each-ref in the presence of badly-named... Michael Haggerty Thu, 7 Apr 2016 19:02:53 +0000 (15:02 -0400)

t1430: test for-each-ref in the presence of badly-named refs

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: David Turner <dturner@twopensource.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

t1430: don't rely on symbolic-ref for creating broken... Michael Haggerty Thu, 7 Apr 2016 19:02:52 +0000 (15:02 -0400)

t1430: don't rely on symbolic-ref for creating broken symrefs

It's questionable whether it should even work.

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: David Turner <dturner@twopensource.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

t1430: clean up broken refs/tags/shadowMichael Haggerty Thu, 7 Apr 2016 19:02:51 +0000 (15:02 -0400)

t1430: clean up broken refs/tags/shadow

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: David Turner <dturner@twopensource.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

t1430: test the output and error of some commands more... Michael Haggerty Thu, 7 Apr 2016 19:02:50 +0000 (15:02 -0400)

t1430: test the output and error of some commands more carefully

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: David Turner <dturner@twopensource.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

refs: move for_each_*ref* functions into common codeDavid Turner Thu, 7 Apr 2016 19:02:49 +0000 (15:02 -0400)

refs: move for_each_*ref* functions into common code

Make do_for_each_ref take a submodule as an argument instead of a
ref_cache. Since all for_each_*ref* functions are defined in terms of
do_for_each_ref, we can then move them into the common code.

Later, we can simply make do_for_each_ref into a backend function.

Signed-off-by: David Turner <dturner@twopensource.com>
Reviewed-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

refs: move head_ref{,_submodule} to the common codeDavid Turner Thu, 7 Apr 2016 19:02:48 +0000 (15:02 -0400)

refs: move head_ref{,_submodule} to the common code

These don't use any backend-specific functions. These were previously
defined in terms of the do_head_ref helper function, but since they
are otherwise identical, we don't need that function.

Signed-off-by: David Turner <dturner@twopensource.com>
Reviewed-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

git_config_set_multivar_in_file: handle "unset" errorsJeff King Sat, 9 Apr 2016 17:43:54 +0000 (13:43 -0400)

git_config_set_multivar_in_file: handle "unset" errors

We pass off to the "_gently" form to do the real work, and
just die() if it returned an error. However, our die message
de-references "value", which may be NULL if the request was
to unset a variable. Nobody using glibc noticed, because it
simply prints "(null)", which is good enough for the test
suite (and presumably very few people run across this in
practice). But other libc implementations (like Solaris) may
segfault.

Let's not only fix that, but let's make the message more
clear about what is going on in the "unset" case.

Reported-by: "Tom G. Christensen" <tgc@jupiterrise.com>
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

git_config_set_multivar_in_file: all non-zero returns... Jeff King Sat, 9 Apr 2016 17:42:54 +0000 (13:42 -0400)

git_config_set_multivar_in_file: all non-zero returns are errors

This function is just a thin wrapper for the "_gently" form
of the function. But the gently form is designed to feed
builtin/config.c, which passes our return code directly to
its exit status, and thus uses positive error values for
some cases. We check only negative values, meaning we would
fail to die in some cases (e.g., a malformed key).

This may or may not be triggerable in practice; we tend to
use this non-gentle form only when setting internal
variables, which would not have malformed keys.

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

config: lower-case first word of error stringsJeff King Sat, 9 Apr 2016 17:42:31 +0000 (13:42 -0400)

config: lower-case first word of error strings

This follows our usual style (both throughout git, and
throughout the rest of this file).

This covers the whole file, but note that I left the capitalization in
the multi-sentence:

error: malformed value...
error: Must be one of ...

because it helps make it clear that we are starting a new sentence in
the second one.

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

http: differentiate socks5:// and socks5h://Junio C Hamano Fri, 8 Apr 2016 19:16:06 +0000 (12:16 -0700)

http: differentiate socks5:// and socks5h://

Felix Ruess <felix.ruess@gmail.com> noticed that with configuration

$ git config --global 'http.proxy=socks5h://127.0.0.1:1080'

connections to remote sites time out, waiting for DNS resolution.

The logic to detect various flavours of SOCKS proxy and ask the
libcurl layer to use appropriate one understands the proxy string
that begin with socks5, socks4a, etc., but does not know socks5h,
and we end up using CURLPROXY_SOCKS5. The correct one to use is
CURLPROXY_SOCKS5_HOSTNAME.

https://curl.haxx.se/libcurl/c/CURLOPT_PROXY.html says

..., socks5h:// (the last one to enable socks5 and asking the
proxy to do the resolving, also known as CURLPROXY_SOCKS5_HOSTNAME
type).

which is consistent with the way the breakage was reported.

Tested-by: Felix Ruess <felix.ruess@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Third batch for post 2.8 cycleJunio C Hamano Fri, 8 Apr 2016 21:34:11 +0000 (14:34 -0700)

Third batch for post 2.8 cycle

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

Merge branch 'ss/msvc'Junio C Hamano Fri, 8 Apr 2016 21:29:13 +0000 (14:29 -0700)

Merge branch 'ss/msvc'

Build updates for MSVC.

* ss/msvc:
MSVC: use shipped headers instead of fallback definitions
MSVC: vsnprintf in Visual Studio 2015 doesn't need SNPRINTF_SIZE_CORR any more

Merge branch 'oa/doc-diff-check'Junio C Hamano Fri, 8 Apr 2016 21:29:13 +0000 (14:29 -0700)

Merge branch 'oa/doc-diff-check'

A minor documentation update.

* oa/doc-diff-check:
Documentation: git diff --check detects conflict markers

Merge branch 'pb/opt-cmdmode-doc'Junio C Hamano Fri, 8 Apr 2016 21:29:12 +0000 (14:29 -0700)

Merge branch 'pb/opt-cmdmode-doc'

Minor API documentation update.

* pb/opt-cmdmode-doc:
api-parse-options.txt: document OPT_CMDMODE()

Merge branch 'nd/apply-report-skip'Junio C Hamano Fri, 8 Apr 2016 21:29:12 +0000 (14:29 -0700)

Merge branch 'nd/apply-report-skip'

"git apply -v" learned to report paths in the patch that were
skipped via --include/--exclude mechanism or being outside the
current working directory.

* nd/apply-report-skip:
apply: report patch skipping in verbose mode

Merge branch 'nd/apply-doc'Junio C Hamano Fri, 8 Apr 2016 21:29:12 +0000 (14:29 -0700)

Merge branch 'nd/apply-doc'

A minor documentation update.

* nd/apply-doc:
git-apply.txt: mention the behavior inside a subdir
git-apply.txt: remove a space

Merge branch 'jc/merge-refuse-new-root'Junio C Hamano Fri, 8 Apr 2016 21:29:11 +0000 (14:29 -0700)

Merge branch 'jc/merge-refuse-new-root'

"git merge" used to allow merging two branches that have no common
base by default, which led to a brand new history of an existing
project created and then get pulled by an unsuspecting maintainer,
which allowed an unnecessary parallel history merged into the
existing project. The command has been taught not to allow this by
default, with an escape hatch "--allow-unrelated-histories" option
to be used in a rare event that merges histories of two projects
that started their lives independently.

* jc/merge-refuse-new-root:
merge: refuse to create too cool a merge by default

configure: remove checking for HMAC_CTX_cleanupKazuki Yamaguchi Fri, 8 Apr 2016 16:22:16 +0000 (01:22 +0900)

configure: remove checking for HMAC_CTX_cleanup

We don't need it, as we no longer use HMAC_CTX_cleanup() directly.

Signed-off-by: Kazuki Yamaguchi <k@rhe.jp>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

imap-send: avoid deprecated TLSv1_method()Kazuki Yamaguchi Fri, 8 Apr 2016 16:22:15 +0000 (01:22 +0900)

imap-send: avoid deprecated TLSv1_method()

Use SSLv23_method always and disable SSL if needed.

TLSv1_method() function is deprecated in OpenSSL 1.1.0 and the compiler
emits a warning.

SSLv23_method() is also deprecated, but the alternative, TLS_method(),
is new in OpenSSL 1.1.0 so requires checking by configure. Stick to
SSLv23_method() for now (this is aliased to TLS_method()).

Signed-off-by: Kazuki Yamaguchi <k@rhe.jp>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

imap-send: check NULL return of SSL_CTX_new()Kazuki Yamaguchi Fri, 8 Apr 2016 16:22:14 +0000 (01:22 +0900)

imap-send: check NULL return of SSL_CTX_new()

SSL_CTX_new() may fail with return value NULL.

Signed-off-by: Kazuki Yamaguchi <k@rhe.jp>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

imap-send: use HMAC() function provided by OpenSSLKazuki Yamaguchi Fri, 8 Apr 2016 16:22:13 +0000 (01:22 +0900)

imap-send: use HMAC() function provided by OpenSSL

Fix compile errors with OpenSSL 1.1.0.

HMAC_CTX is made opaque and HMAC_CTX_cleanup is removed in OpenSSL
1.1.0. But since we just want to calculate one HMAC, we can use HMAC()
here, which exists since OpenSSL 0.9.6 at least.

Signed-off-by: Kazuki Yamaguchi <k@rhe.jp>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

set_worktree_head_symref(): fix error messageKazuki Yamaguchi Fri, 8 Apr 2016 08:03:07 +0000 (17:03 +0900)

set_worktree_head_symref(): fix error message

Emit an informative error when failed to hold lock of HEAD.

2233066e (refs: add a new function set_worktree_head_symref,
2016-03-27) added set_worktree_head_symref(), but this is missing a
call to unable_to_lock_message() after hold_lock_file_for_update()
fails, so it emits an empty error message:

% git branch -m oldname newname
error:
error: HEAD of working tree /path/to/wt is not updated
fatal: Branch renamed to newname, but HEAD is not updated!

Thanks to Eric Sunshine for pointing this out.

Signed-off-by: Kazuki Yamaguchi <k@rhe.jp>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

commit: do not ignore an empty message given by -m ''Jeff King Thu, 7 Apr 2016 19:56:26 +0000 (12:56 -0700)

commit: do not ignore an empty message given by -m ''

When f9568530 (builtin-commit: resurrect behavior for multiple -m
options, 2007-11-11) converted a "char *message" to "struct strbuf
message" to hold the messages given with the "-m" option, it
incorrectly changed the checks "did we get a message with the -m
option?" to "is message.len 0?". Later, we noticed one breakage
from this change and corrected it with 25206778 (commit: don't start
editor if empty message is given with -m, 2013-05-25).

However, "we got a message with -m, even though an empty one, so we
shouldn't be launching an editor" was not the only breakage.

* "git commit --amend -m '' --allow-empty", even though it looks
strange, is a valid request to amend the commit to have no
message at all. Due to the misdetection of the presence of -m on
the command line, we ended up keeping the log messsage from the
original commit.

* "git commit -m "$msg" -F file" should be rejected whether $msg is
an empty string or not, but due to the same bug, was not rejected
when $msg is empty.

* "git -c template=file -m "$msg"" should ignore the template even
when $msg is empty, but it didn't and instead used the contents
from the template file.

Correct these by checking have_option_m, which the earlier 25206778
introduced to fix the same bug.

Reported-by: Adam Dinwoodie <adam@dinwoodie.org>
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

commit: --amend -m '' silently fails to wipe messageAdam Dinwoodie Wed, 6 Apr 2016 17:15:03 +0000 (18:15 +0100)

commit: --amend -m '' silently fails to wipe message

`git commit --amend -m ''` seems to be an unambiguous request to blank a
commit message, but it actually leaves the commit message as-is. That's
the case regardless of whether `--allow-empty-message` is specified, and
doesn't so much as drop a non-zero return code.

Add failing tests to show this behaviour.

Signed-off-by: Adam Dinwoodie <adam@dinwoodie.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

setup.c: do not feed NULL to "%.*s" even with precision 0Junio C Hamano Thu, 7 Apr 2016 19:38:18 +0000 (12:38 -0700)

setup.c: do not feed NULL to "%.*s" even with precision 0

A recent update 75faa45a (replace trivial malloc + sprintf / strcpy
calls with xstrfmt, 2015-09-24) rewrote

prepare an empty buffer
if (len)
append the first len bytes of "prefix" to the buffer
append "path" to the buffer

that computed "path", optionally prefixed by "prefix", into

xstrfmt("%.*s%s", len, prefix, path);

However, passing a NULL pointer to the printf(3) family of functions
to format it with %s conversion, even with the precision set to 0,
i.e.

xstrfmt("%.*s", 0, NULL)

yields undefined results, at least on some platforms.

Avoid this problem by substituting prefix with "" when len==0, as
prefix can legally be NULL in that case. This would mimick the
intent of the original code better.

Reported-by: Tom G. Christensen <tgc@jupiterrise.com>
Helped-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

rerere: adjust 'forget' to multi-variant world orderJunio C Hamano Mon, 28 Mar 2016 21:48:13 +0000 (14:48 -0700)

rerere: adjust 'forget' to multi-variant world order

Because conflicts with the same contents inside conflict blocks
enclosed by "<<<<<<<" and ">>>>>>>" can now have multiple variants
to help three-way merge to adjust to the differences outside the
conflict blocks, "rerere forget $path" needs to be taught that there
may be multiple recorded resolutions that share the same conflict
hash (which groups the conflicts with "the same contents inside
conflict blocks"), among which there are some that would not be
relevant to the conflict we are looking at. These "other variants"
that happen to share the same conflict hash should not be cleared,
and the variant that would apply to the current conflict may not be
the zero-th one (which is the only one that is cleared by the
current code).

After finding the conflict hash, iterate over the existing variants
and try to resolve the conflict using each of them to find the one
that "cleanly" resolves the current conflict. That is the one we
want to forget and record the preimage for, so that the user can
record the corrected resolution.

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

rerere: split code to call ll_merge() furtherJunio C Hamano Fri, 11 Mar 2016 22:53:05 +0000 (14:53 -0800)

rerere: split code to call ll_merge() further

The merge() helper function is given an existing rerere ID (i.e. the
name of the .git/rr-cache/* subdirectory, and the variant number)
that identifies one <preimage, postimage> pair, try to see if the
conflicted state in the given path can be resolved by using the pair,
and if this succeeds, then update the conflicted path with the
result in the working tree.

To implement rerere_forget() in the multiple variant world, we'd
need a helper to do the "see if a <preimage, postimage> pair cleanly
resolves a conflicted state we have in-core" part, without actually
touching any file in the working tree, in order to identify which
variant(s) to remove. Split the logic to do so into a separate
helper function try_merge() out of merge().

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

rerere: move code related to "forget" togetherJunio C Hamano Mon, 14 Mar 2016 22:10:39 +0000 (15:10 -0700)

rerere: move code related to "forget" together

"rerere forget" is the only user of handle_cache() helper, which in
turn is the only user of rerere_io that reads from an in-core buffer
whose getline method is implemented as rerere_mem_getline(). Gather
them together.

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

rerere: gc and clearJunio C Hamano Tue, 8 Mar 2016 20:11:00 +0000 (12:11 -0800)

rerere: gc and clear

Adjust "git rerere gc" and "git rerere clear" to the new world order
with rerere database with multiple variants for the same shape of
conflicts.

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

send-email: do not load Data::DumperEric Wong Wed, 6 Apr 2016 20:25:38 +0000 (20:25 +0000)

send-email: do not load Data::Dumper

We never used Data::Dumper in this script. The only reference
of it was always commented out and removed over a decade ago in
commit 4bc87a28be020a6bf7387161c65ea3d8e4a0228b
("send-email: Change from Mail::Sendmail to Net::SMTP")

Signed-off-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

send-email: more meaningful Message-IDEric Wong Wed, 6 Apr 2016 20:07:14 +0000 (20:07 +0000)

send-email: more meaningful Message-ID

Using a YYYYmmddHHMMSS date representation is more meaningful to
humans, especially when used for lookups on NNTP servers or linking
to archive sites via Message-ID (e.g. mid.gmane.org or
mid.mail-archive.com). This timestamp format more easily gives a
reader of the URL itself a rough date of a linked message compared
to having them calculate the seconds since the Unix epoch.

Furthermore, having the MUA name in the Message-ID seems to be a
rare oddity I haven't noticed outside of git-send-email. We
already have an optional X-Mailer header field to advertise for
us, so extending the Message-ID by 15 characters can make for
unpleasant Message-ID-based URLs to archive sites.

Signed-off-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Second batch for post 2.8 cycleJunio C Hamano Wed, 6 Apr 2016 18:44:24 +0000 (11:44 -0700)

Second batch for post 2.8 cycle

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

Merge branch 'la/tag-force-signing-annotated-tags'Junio C Hamano Wed, 6 Apr 2016 18:39:13 +0000 (11:39 -0700)

Merge branch 'la/tag-force-signing-annotated-tags'

"git tag" can create an annotated tag without explicitly given an
"-a" (or "-s") option (i.e. when a tag message is given). A new
configuration variable, tag.forceSignAnnotated, can be used to tell
the command to create signed tag in such a situation.

* la/tag-force-signing-annotated-tags:
tag: add the option to force signing of annotated tags

Merge branch 'jk/submodule-c-credential'Junio C Hamano Wed, 6 Apr 2016 18:39:12 +0000 (11:39 -0700)

Merge branch 'jk/submodule-c-credential'

"git -c credential.<var>=<value> submodule" can now be used to
propagate configuration variables related to credential helper
down to the submodules.

* jk/submodule-c-credential:
git_config_push_parameter: handle empty GIT_CONFIG_PARAMETERS
git: submodule honor -c credential.* from command line
quote: implement sq_quotef()
submodule: fix segmentation fault in submodule--helper clone
submodule: fix submodule--helper clone usage
submodule: check argc count for git submodule--helper clone
submodule: don't pass empty string arguments to submodule--helper clone

Merge branch 'jv/merge-nothing-into-void'Junio C Hamano Wed, 6 Apr 2016 18:39:11 +0000 (11:39 -0700)

Merge branch 'jv/merge-nothing-into-void'

"git merge FETCH_HEAD" dereferenced NULL pointer when merging
nothing into an unborn history (which is arguably unusual usage,
which perhaps was the reason why nobody noticed it).

* jv/merge-nothing-into-void:
merge: fix NULL pointer dereference when merging nothing into void

Merge branch 'ss/commit-squash-msg'Junio C Hamano Wed, 6 Apr 2016 18:39:10 +0000 (11:39 -0700)

Merge branch 'ss/commit-squash-msg'

When "git merge --squash" stopped due to conflict, the concluding
"git commit" failed to read in the SQUASH_MSG that shows the log
messages from all the squashed commits.

* ss/commit-squash-msg:
commit: do not lose SQUASH_MSG contents

Merge branch 'sb/rebase-x'Junio C Hamano Wed, 6 Apr 2016 18:39:09 +0000 (11:39 -0700)

Merge branch 'sb/rebase-x'

"git rebase -x" can be used without passing "-i" option.

* sb/rebase-x:
t3404: cleanup double empty lines between tests
rebase: decouple --exec from --interactive

Merge branch 'jk/test-httpd-config-nosystem'Junio C Hamano Wed, 6 Apr 2016 18:39:08 +0000 (11:39 -0700)

Merge branch 'jk/test-httpd-config-nosystem'

The tests that involve running httpd leaked the system-wide
configuration in /etc/gitconfig to the tested environment.

* jk/test-httpd-config-nosystem:
t/lib-httpd: pass through GIT_CONFIG_NOSYSTEM env

Merge branch 'jk/send-email-rtrim-mailrc-alias'Junio C Hamano Wed, 6 Apr 2016 18:39:07 +0000 (11:39 -0700)

Merge branch 'jk/send-email-rtrim-mailrc-alias'

"git send-email" had trouble parsing alias file in mailrc format
when lines in it had trailing whitespaces on them.

* jk/send-email-rtrim-mailrc-alias:
send-email: ignore trailing whitespace in mailrc alias file

Merge branch 'jk/credential-cache-comment-exit'Junio C Hamano Wed, 6 Apr 2016 18:39:06 +0000 (11:39 -0700)

Merge branch 'jk/credential-cache-comment-exit'

A code clarification.

* jk/credential-cache-comment-exit:
credential-cache--daemon: clarify "exit" action semantics

Merge branch 'sb/clone-t57-t56'Junio C Hamano Wed, 6 Apr 2016 18:39:05 +0000 (11:39 -0700)

Merge branch 'sb/clone-t57-t56'

Rename bunch of tests on "git clone" for better organization.

* sb/clone-t57-t56:
clone tests: rename t57* => t56*

Merge branch 'ls/p4-map-user'Junio C Hamano Wed, 6 Apr 2016 18:39:05 +0000 (11:39 -0700)

Merge branch 'ls/p4-map-user'

"git p4" now allows P4 author names to be mapped to Git author
names.

* ls/p4-map-user:
git-p4: map a P4 user to Git author name and email address

Merge branch 'cc/doc-recommend-performance-trace-to... Junio C Hamano Wed, 6 Apr 2016 18:39:04 +0000 (11:39 -0700)

Merge branch 'cc/doc-recommend-performance-trace-to-file'

A minor documentation update.

* cc/doc-recommend-performance-trace-to-file:
Documentation: talk about pager in api-trace.txt

Merge branch 'pb/t7502-drop-dup'Junio C Hamano Wed, 6 Apr 2016 18:39:03 +0000 (11:39 -0700)

Merge branch 'pb/t7502-drop-dup'

Code clean-up.

* pb/t7502-drop-dup:
t/t7502 : drop duplicate test

Merge branch 'da/mergetool-delete-delete-conflict'Junio C Hamano Wed, 6 Apr 2016 18:39:02 +0000 (11:39 -0700)

Merge branch 'da/mergetool-delete-delete-conflict'

"git mergetool" did not work well with conflicts that both sides
deleted.

* da/mergetool-delete-delete-conflict:
mergetool: honor tempfile configuration when resolving delete conflicts
mergetool: support delete/delete conflicts

Merge branch 'sb/submodule-parallel-update'Junio C Hamano Wed, 6 Apr 2016 18:39:01 +0000 (11:39 -0700)

Merge branch 'sb/submodule-parallel-update'

A major part of "git submodule update" has been ported to C to take
advantage of the recently added framework to run download tasks in
parallel.

* sb/submodule-parallel-update:
clone: allow an explicit argument for parallel submodule clones
submodule update: expose parallelism to the user
submodule helper: remove double 'fatal: ' prefix
git submodule update: have a dedicated helper for cloning
run_processes_parallel: rename parameters for the callbacks
run_processes_parallel: treat output of children as byte array
submodule update: direct error message to stderr
fetching submodules: respect `submodule.fetchJobs` config option
submodule-config: drop check against NULL
submodule-config: keep update strategy around

Merge branch 'ss/receive-pack-parse-options'Junio C Hamano Wed, 6 Apr 2016 18:38:59 +0000 (11:38 -0700)

Merge branch 'ss/receive-pack-parse-options'

The command line argument parser for "receive-pack" has been
rewritten to use parse-options.

* ss/receive-pack-parse-options:
builtin/receive-pack.c: use parse_options API

Merge branch 'ss/exc-flag-is-a-collection-of-bits'Junio C Hamano Wed, 6 Apr 2016 18:38:59 +0000 (11:38 -0700)

Merge branch 'ss/exc-flag-is-a-collection-of-bits'

Code clean-up.

* ss/exc-flag-is-a-collection-of-bits:
dir: store EXC_FLAG_* values in unsigned integers

correct blame for files commited with CRLFTorsten Bögershausen Tue, 5 Apr 2016 19:23:54 +0000 (21:23 +0200)

correct blame for files commited with CRLF

git blame reports lines as not "Not Committed Yet" when they have
CRLF in the index, CRLF in the worktree and core.autocrlf is true.

Since commit c4805393 (autocrlf: Make it work also for un-normalized
repositories, 2010-05-12), files that have CRLF in the index are not
normalized at commit when core.autocrl is set.

Add a call to read_cache() early in fake_working_tree_commit(),
before calling convert_to_git().

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

completion: complete --cherry-mark for git logMichael J Gruber Tue, 5 Apr 2016 10:45:35 +0000 (12:45 +0200)

completion: complete --cherry-mark for git log

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

api-trace.txt: fix typoElia Pinto Tue, 5 Apr 2016 10:05:23 +0000 (10:05 +0000)

api-trace.txt: fix typo

The correct api is trace_printf_key(), not trace_print_key().

Also do not throw a random string at printf(3)-like function;
instead, feed it as a parameter that is fed to a "%s" conversion
specifier.

Signed-off-by: Elia Pinto <gitter.spiros@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Makefile: fix misdirected redirectionsJunio C Hamano Tue, 5 Apr 2016 07:02:14 +0000 (00:02 -0700)

Makefile: fix misdirected redirections

In general "echo 2>&1 $msg" to redirect a possible error message
that comes from 'echo' itself into the same standard output stream
$msg is getting written to does not make any sense; it is not like
we are expecting to see any errors out of 'echo' in these statements,
and even if it were the case, there is no reason to prevent the
error messages from being sent to the standard error stream.

These are clearly meant to send the argument given to echo to the
standard error stream as error messages. Correctly redirect by
saying "send what is written to the standard output to the standard
error", i.e. "1>&2" aka ">&2".

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

branch: fix shortening of non-remote symrefsJeff King Sun, 3 Apr 2016 04:14:26 +0000 (00:14 -0400)

branch: fix shortening of non-remote symrefs

Commit aedcb7d (branch.c: use 'ref-filter' APIs, 2015-09-23)
adjusted the symref-printing code to look like this:

if (item->symref) {
skip_prefix(item->symref, "refs/remotes/", &desc);
strbuf_addf(&out, " -> %s", desc);
}

This has three bugs in it:

1. It always skips past "refs/remotes/", instead of
skipping past the prefix associated with the branch we
are showing (so commonly we see "refs/remotes/" for the
refs/remotes/origin/HEAD symref, but the previous code
would skip "refs/heads/" when showing a symref it found
in refs/heads/.

2. If skip_prefix() does not match, it leaves "desc"
untouched, and we show whatever happened to be in it
(which is the refname from a call to skip_prefix()
earlier in the function).

3. If we do match with skip_prefix(), we stomp on the
"desc" variable, which is later passed to
add_verbose_info(). We probably want to retain the
original refname there (though it likely doesn't matter
in practice, since after all, one points to the other).

The fix to match the original code is fairly easy: record
the prefix to strip based on item->kind, and use it here.
However, since we already have a local variable named "prefix",
let's give the two prefixes verbose names so we don't
confuse them.

Signed-off-by: Jeff King <peff@peff.net>
Acked-by: Karthik Nayak <karthik.188@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

pretty: test --expand-tabsJunio C Hamano Mon, 4 Apr 2016 23:09:18 +0000 (16:09 -0700)

pretty: test --expand-tabs

The test prepares a simple commit with HT on its log message lines,
and makes sure that

- formats that should or should not expand tabs by default do or do
not expand tabs respectively,

- with explicit --expand-tabs=<N> and short-hands --expand-tabs
(equivalent to --expand-tabs=8) and --no-expand-tabs (equivalent
to --expand-tabs=0) before or after the explicit --pretty=$fmt,
the tabs are expanded (or not expanded) accordingly.

The tests use the second line of the log message for formats other
than --pretty=short, primarily because the first line of the email
format is handled specially to add the [PATCH] prefix, etc. in a
separate codepath (--pretty=short uses the first line because there
is no other line to test).

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

Windows: shorten code by re-using convert_slashes()Johannes Sixt Sat, 2 Apr 2016 19:03:14 +0000 (21:03 +0200)

Windows: shorten code by re-using convert_slashes()

Make a few more spots more readable by using the recently introduced,
Windows-specific helper.

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