gitweb.git
Sixth batch for 2.5 cycleJunio C Hamano Mon, 1 Jun 2015 19:47:56 +0000 (12:47 -0700)

Sixth batch for 2.5 cycle

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

Merge branch 'sb/test-bitmap-free-at-end'Junio C Hamano Mon, 1 Jun 2015 19:45:21 +0000 (12:45 -0700)

Merge branch 'sb/test-bitmap-free-at-end'

An earlier leakfix to bitmap testing code was incomplete.

* sb/test-bitmap-free-at-end:
test_bitmap_walk: free bitmap with bitmap_free

Merge branch 'mm/rebase-i-post-rewrite-exec'Junio C Hamano Mon, 1 Jun 2015 19:45:20 +0000 (12:45 -0700)

Merge branch 'mm/rebase-i-post-rewrite-exec'

"git rebase -i" fired post-rewrite hook when it shouldn't (namely,
when it was told to stop sequencing with 'exec' insn).

* mm/rebase-i-post-rewrite-exec:
t5407: use <<- to align the expected output
rebase -i: fix post-rewrite hook with failed exec command
rebase -i: demonstrate incorrect behavior of post-rewrite

Merge branch 'fm/fetch-raw-sha1'Junio C Hamano Mon, 1 Jun 2015 19:45:19 +0000 (12:45 -0700)

Merge branch 'fm/fetch-raw-sha1'

"git upload-pack" that serves "git fetch" can be told to serve
commits that are not at the tip of any ref, as long as they are
reachable from a ref, with uploadpack.allowReachableSHA1InWant
configuration variable.

* fm/fetch-raw-sha1:
upload-pack: optionally allow fetching reachable sha1
upload-pack: prepare to extend allow-tip-sha1-in-want
config.txt: clarify allowTipSHA1InWant with camelCase

Merge branch 'sg/help-group'Junio C Hamano Mon, 1 Jun 2015 19:45:18 +0000 (12:45 -0700)

Merge branch 'sg/help-group'

Group list of commands shown by "git help" along the workflow
elements to help early learners.

* sg/help-group:
help: respect new common command grouping
command-list.txt: drop the "common" tag
generate-cmdlist: parse common group commands
command-list.txt: add the common groups block
command-list: prepare machinery for upcoming "common groups" section

Merge branch 'mm/log-format-raw-doc'Junio C Hamano Mon, 1 Jun 2015 19:45:17 +0000 (12:45 -0700)

Merge branch 'mm/log-format-raw-doc'

Clarify that "log --raw" and "log --format=raw" are unrelated
concepts.

* mm/log-format-raw-doc:
Documentation/log: clarify sha1 non-abbreviation in log --raw
Documentation/log: clarify what --raw means

Merge branch 'dt/cat-file-follow-symlinks'Junio C Hamano Mon, 1 Jun 2015 19:45:16 +0000 (12:45 -0700)

Merge branch 'dt/cat-file-follow-symlinks'

"git cat-file --batch(-check)" learned the "--follow-symlinks"
option that follows an in-tree symbolic link when asked about an
object via extended SHA-1 syntax, e.g. HEAD:RelNotes that points at
Documentation/RelNotes/2.5.0.txt. With the new option, the command
behaves as if HEAD:Documentation/RelNotes/2.5.0.txt was given as
input instead.

* dt/cat-file-follow-symlinks:
cat-file: add --follow-symlinks to --batch
sha1_name: get_sha1_with_context learns to follow symlinks
tree-walk: learn get_tree_entry_follow_symlinks

Merge branch 'rs/janitorial'Junio C Hamano Mon, 1 Jun 2015 19:45:15 +0000 (12:45 -0700)

Merge branch 'rs/janitorial'

Code clean-up.

* rs/janitorial:
dir: remove unused variable sb
clean: remove unused variable buf
use file_exists() to check if a file exists in the worktree

Merge branch 'jk/stash-options'Junio C Hamano Mon, 1 Jun 2015 19:45:14 +0000 (12:45 -0700)

Merge branch 'jk/stash-options'

Make "git stash something --help" error out, so that users can
safely say "git stash drop --help".

* jk/stash-options:
stash: recognize "--help" for subcommands
stash: complain about unknown flags

Merge branch 'da/mergetool-winmerge'Junio C Hamano Mon, 1 Jun 2015 19:45:14 +0000 (12:45 -0700)

Merge branch 'da/mergetool-winmerge'

"git mergetool" learned to drive WinMerge as a backend.

* da/mergetool-winmerge:
mergetools: add winmerge as a builtin tool
mergetool--lib: set IFS for difftool and mergetool

Merge branch 'mc/commit-doc-grammofix'Junio C Hamano Mon, 1 Jun 2015 19:45:12 +0000 (12:45 -0700)

Merge branch 'mc/commit-doc-grammofix'

Doc grammar fix.

* mc/commit-doc-grammofix:
Documentation/git-commit: grammofix

Merge branch 'jh/filter-empty-contents'Junio C Hamano Mon, 1 Jun 2015 19:45:10 +0000 (12:45 -0700)

Merge branch 'jh/filter-empty-contents'

The clean/smudge interface did not work well when filtering an
empty contents (failed and then passed the empty input through).
It can be argued that a filter that produces anything but empty for
an empty input is nonsense, but if the user wants to do strange
things, then why not?

* jh/filter-empty-contents:
sha1_file: pass empty buffer to index empty file

Merge branch 'ah/usage-strings'Junio C Hamano Mon, 1 Jun 2015 19:45:09 +0000 (12:45 -0700)

Merge branch 'ah/usage-strings'

A few usage string updates.

* ah/usage-strings:
blame, log: format usage strings similarly to those in documentation

Merge branch 'jk/http-backend-deadlock'Junio C Hamano Mon, 1 Jun 2015 19:45:09 +0000 (12:45 -0700)

Merge branch 'jk/http-backend-deadlock'

Communication between the HTTP server and http_backend process can
lead to a dead-lock when relaying a large ref negotiation request.
Diagnose the situation better, and mitigate it by reading such a
request first into core (to a reasonable limit).

* jk/http-backend-deadlock:
http-backend: spool ref negotiation requests to buffer
t5551: factor out tag creation
http-backend: fix die recursion with custom handler

Merge branch 'dt/clean-pathspec-filter-then-lstat'Junio C Hamano Mon, 1 Jun 2015 19:45:08 +0000 (12:45 -0700)

Merge branch 'dt/clean-pathspec-filter-then-lstat'

"git clean pathspec..." tried to lstat(2) and complain even for
paths outside the given pathspec.

* dt/clean-pathspec-filter-then-lstat:
clean: only lstat files in pathspec

Merge branch 'nd/untracked-cache'Junio C Hamano Wed, 27 May 2015 20:14:38 +0000 (13:14 -0700)

Merge branch 'nd/untracked-cache'

* nd/untracked-cache:
t7063: hide stderr from setup inside prereq

t7063: hide stderr from setup inside prereqJeff King Wed, 27 May 2015 09:34:58 +0000 (05:34 -0400)

t7063: hide stderr from setup inside prereq

When t7063 starts, it runs "update-index --untracked-cache"
to see if we support the untracked cache. Its output goes
straight to stderr, even if the test is not run with "-v".
Let's wrap it in a prereq that will hide the output by
default, but show it with "-v".

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

Sync with 2.4.2Junio C Hamano Tue, 26 May 2015 20:50:39 +0000 (13:50 -0700)

Sync with 2.4.2

Git 2.4.2 v2.4.2Junio C Hamano Tue, 26 May 2015 20:49:59 +0000 (13:49 -0700)

Git 2.4.2

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

Merge branch 'jk/still-interesting' into maintJunio C Hamano Tue, 26 May 2015 20:49:26 +0000 (13:49 -0700)

Merge branch 'jk/still-interesting' into maint

"git rev-list --objects $old --not --all" to see if everything that
is reachable from $old is already connected to the existing refs
was very inefficient.

* jk/still-interesting:
limit_list: avoid quadratic behavior from still_interesting

Merge branch 'jc/hash-object' into maintJunio C Hamano Tue, 26 May 2015 20:49:24 +0000 (13:49 -0700)

Merge branch 'jc/hash-object' into maint

"hash-object --literally" introduced in v2.2 was not prepared to
take a really long object type name.

* jc/hash-object:
write_sha1_file(): do not use a separate sha1[] array
t1007: add hash-object --literally tests
hash-object --literally: fix buffer overrun with extra-long object type
git-hash-object.txt: document --literally option

Merge branch 'jk/rebase-quiet-noop' into maintJunio C Hamano Tue, 26 May 2015 20:49:23 +0000 (13:49 -0700)

Merge branch 'jk/rebase-quiet-noop' into maint

"git rebase --quiet" was not quite quiet when there is nothing to
do.

* jk/rebase-quiet-noop:
rebase: silence "git checkout" for noop rebase

Merge branch 'sg/complete-decorate-full-not-long' into... Junio C Hamano Tue, 26 May 2015 20:49:22 +0000 (13:49 -0700)

Merge branch 'sg/complete-decorate-full-not-long' into maint

The completion for "log --decorate=" parameter value was incorrect.

* sg/complete-decorate-full-not-long:
completion: fix and update 'git log --decorate=' options

Merge branch 'jk/filter-branch-use-of-sed-on-incomplete... Junio C Hamano Tue, 26 May 2015 20:49:20 +0000 (13:49 -0700)

Merge branch 'jk/filter-branch-use-of-sed-on-incomplete-line' into maint

"filter-branch" corrupted commit log message that ends with an
incomplete line on platforms with some "sed" implementations that
munge such a line. Work it around by avoiding to use "sed".

* jk/filter-branch-use-of-sed-on-incomplete-line:
filter-branch: avoid passing commit message through sed

Merge branch 'jc/daemon-no-ipv6-for-2.4.1' into maintJunio C Hamano Tue, 26 May 2015 20:49:19 +0000 (13:49 -0700)

Merge branch 'jc/daemon-no-ipv6-for-2.4.1' into maint

"git daemon" fails to build from the source under NO_IPV6
configuration (regression in 2.4).

* jc/daemon-no-ipv6-for-2.4.1:
daemon: unbreak NO_IPV6 build regression

Merge branch 'jk/stash-require-clean-index' into maintJunio C Hamano Tue, 26 May 2015 20:49:19 +0000 (13:49 -0700)

Merge branch 'jk/stash-require-clean-index' into maint

"git stash pop/apply" forgot to make sure that not just the working
tree is clean but also the index is clean. The latter is important
as a stash application can conflict and the index will be used for
conflict resolution.

* jk/stash-require-clean-index:
stash: require a clean index to apply
t3903: avoid applying onto dirty index
t3903: stop hard-coding commit sha1s

Merge branch 'jk/git-no-more-argv0-path-munging' into... Junio C Hamano Tue, 26 May 2015 20:49:18 +0000 (13:49 -0700)

Merge branch 'jk/git-no-more-argv0-path-munging' into maint

We have prepended $GIT_EXEC_PATH and the path "git" is installed in
(typically "/usr/bin") to $PATH when invoking subprograms and hooks
for almost eternity, but the original use case the latter tried to
support was semi-bogus (i.e. install git to /opt/foo/git and run it
without having /opt/foo on $PATH), and more importantly it has
become less and less relevant as Git grew more mainstream (i.e. the
users would _want_ to have it on their $PATH). Stop prepending the
path in which "git" is installed to users' $PATH, as that would
interfere the command search order people depend on (e.g. they may
not like versions of programs that are unrelated to Git in /usr/bin
and want to override them by having different ones in /usr/local/bin
and have the latter directory earlier in their $PATH).

* jk/git-no-more-argv0-path-munging:
stop putting argv[0] dirname at front of PATH

Fifth batch for 2.5 cycleJunio C Hamano Tue, 26 May 2015 20:33:35 +0000 (13:33 -0700)

Fifth batch for 2.5 cycle

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

Merge branch 'nd/untracked-cache'Junio C Hamano Tue, 26 May 2015 20:24:45 +0000 (13:24 -0700)

Merge branch 'nd/untracked-cache'

Teach the index to optionally remember already seen untracked files
to speed up "git status" in a working tree with tons of cruft.

* nd/untracked-cache: (24 commits)
git-status.txt: advertisement for untracked cache
untracked cache: guard and disable on system changes
mingw32: add uname()
t7063: tests for untracked cache
update-index: test the system before enabling untracked cache
update-index: manually enable or disable untracked cache
status: enable untracked cache
untracked-cache: temporarily disable with $GIT_DISABLE_UNTRACKED_CACHE
untracked cache: mark index dirty if untracked cache is updated
untracked cache: print stats with $GIT_TRACE_UNTRACKED_STATS
untracked cache: avoid racy timestamps
read-cache.c: split racy stat test to a separate function
untracked cache: invalidate at index addition or removal
untracked cache: load from UNTR index extension
untracked cache: save to an index extension
ewah: add convenient wrapper ewah_serialize_strbuf()
untracked cache: don't open non-existent .gitignore
untracked cache: mark what dirs should be recursed/saved
untracked cache: record/validate dir mtime and reuse cached output
untracked cache: make a wrapper around {open,read,close}dir()
...

Merge branch 'rs/plug-leak-in-pack-bitmaps'Junio C Hamano Tue, 26 May 2015 20:24:44 +0000 (13:24 -0700)

Merge branch 'rs/plug-leak-in-pack-bitmaps'

The code to read pack-bitmap wanted to allocate a few hundred
pointers to a structure, but by mistake allocated and leaked memory
enough to hold that many actual structures. Correct the allocation
size and also have it on stack, as it is small enough.

* rs/plug-leak-in-pack-bitmaps:
pack-bitmaps: plug memory leak, fix allocation size for recent_bitmaps

Merge branch 'pt/pull-ff-vs-merge-ff'Junio C Hamano Tue, 26 May 2015 20:24:43 +0000 (13:24 -0700)

Merge branch 'pt/pull-ff-vs-merge-ff'

The pull.ff configuration was supposed to override the merge.ff
configuration, but it didn't.

* pt/pull-ff-vs-merge-ff:
pull: parse pull.ff as a bool or string
pull: make pull.ff=true override merge.ff

Merge branch 'pt/pull-log-n'Junio C Hamano Tue, 26 May 2015 20:24:43 +0000 (13:24 -0700)

Merge branch 'pt/pull-log-n'

"git pull --log" and "git pull --no-log" worked as expected, but
"git pull --log=20" did not.

* pt/pull-log-n:
pull: handle --log=<n>

Merge branch 'jk/rerere-forget-check-enabled'Junio C Hamano Tue, 26 May 2015 20:24:42 +0000 (13:24 -0700)

Merge branch 'jk/rerere-forget-check-enabled'

"git rerere forget" in a repository without rerere enabled gave a
cryptic error message; it should be a silent no-op instead.

* jk/rerere-forget-check-enabled:
rerere: exit silently on "forget" when rerere is disabled

Merge branch 'jk/http-backend-deadlock-2.3' into jk... Junio C Hamano Tue, 26 May 2015 03:44:42 +0000 (20:44 -0700)

Merge branch 'jk/http-backend-deadlock-2.3' into jk/http-backend-deadlock

* jk/http-backend-deadlock-2.3:
http-backend: spool ref negotiation requests to buffer
t5551: factor out tag creation
http-backend: fix die recursion with custom handler

Merge branch 'jk/http-backend-deadlock-2.2' into jk... Junio C Hamano Tue, 26 May 2015 03:44:04 +0000 (20:44 -0700)

Merge branch 'jk/http-backend-deadlock-2.2' into jk/http-backend-deadlock-2.3

* jk/http-backend-deadlock-2.2:
http-backend: spool ref negotiation requests to buffer
t5551: factor out tag creation
http-backend: fix die recursion with custom handler

http-backend: spool ref negotiation requests to bufferJeff King Wed, 20 May 2015 07:37:09 +0000 (03:37 -0400)

http-backend: spool ref negotiation requests to buffer

When http-backend spawns "upload-pack" to do ref
negotiation, it streams the http request body to
upload-pack, who then streams the http response back to the
client as it reads. In theory, git can go full-duplex; the
client can consume our response while it is still sending
the request. In practice, however, HTTP is a half-duplex
protocol. Even if our client is ready to read and write
simultaneously, we may have other HTTP infrastructure in the
way, including the webserver that spawns our CGI, or any
intermediate proxies.

In at least one documented case[1], this leads to deadlock
when trying a fetch over http. What happens is basically:

1. Apache proxies the request to the CGI, http-backend.

2. http-backend gzip-inflates the data and sends
the result to upload-pack.

3. upload-pack acts on the data and generates output over
the pipe back to Apache. Apache isn't reading because
it's busy writing (step 1).

This works fine most of the time, because the upload-pack
output ends up in a system pipe buffer, and Apache reads
it as soon as it finishes writing. But if both the request
and the response exceed the system pipe buffer size, then we
deadlock (Apache blocks writing to http-backend,
http-backend blocks writing to upload-pack, and upload-pack
blocks writing to Apache).

We need to break the deadlock by spooling either the input
or the output. In this case, it's ideal to spool the input,
because Apache does not start reading either stdout _or_
stderr until we have consumed all of the input. So until we
do so, we cannot even get an error message out to the
client.

The solution is fairly straight-forward: we read the request
body into an in-memory buffer in http-backend, freeing up
Apache, and then feed the data ourselves to upload-pack. But
there are a few important things to note:

1. We limit the in-memory buffer to prevent an obvious
denial-of-service attack. This is a new hard limit on
requests, but it's unlikely to come into play. The
default value is 10MB, which covers even the ridiculous
100,000-ref negotation in the included test (that
actually caps out just over 5MB). But it's configurable
on the off chance that you don't mind spending some
extra memory to make even ridiculous requests work.

2. We must take care only to buffer when we have to. For
pushes, the incoming packfile may be of arbitrary
size, and we should connect the input directly to
receive-pack. There's no deadlock problem here, though,
because we do not produce any output until the whole
packfile has been read.

For upload-pack's initial ref advertisement, we
similarly do not need to buffer. Even though we may
generate a lot of output, there is no request body at
all (i.e., it is a GET, not a POST).

[1] http://article.gmane.org/gmane.comp.version-control.git/269020

Test-adapted-from: Dennis Kaarsemaker <dennis@kaarsemaker.net>
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

upload-pack: optionally allow fetching reachable sha1Fredrik Medley Thu, 21 May 2015 20:23:39 +0000 (22:23 +0200)

upload-pack: optionally allow fetching reachable sha1

With uploadpack.allowReachableSHA1InWant configuration option set on the
server side, "git fetch" can make a request with a "want" line that names
an object that has not been advertised (likely to have been obtained out
of band or from a submodule pointer). Only objects reachable from the
branch tips, i.e. the union of advertised branches and branches hidden by
transfer.hideRefs, will be processed. Note that there is an associated
cost of having to walk back the history to check the reachability.

This feature can be used when obtaining the content of a certain commit,
for which the sha1 is known, without the need of cloning the whole
repository, especially if a shallow fetch is used. Useful cases are e.g.
repositories containing large files in the history, fetching only the
needed data for a submodule checkout, when sharing a sha1 without telling
which exact branch it belongs to and in Gerrit, if you think in terms of
commits instead of change numbers. (The Gerrit case has already been
solved through allowTipSHA1InWant as every Gerrit change has a ref.)

Signed-off-by: Fredrik Medley <fredrik.medley@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

upload-pack: prepare to extend allow-tip-sha1-in-wantFredrik Medley Thu, 21 May 2015 20:23:38 +0000 (22:23 +0200)

upload-pack: prepare to extend allow-tip-sha1-in-want

To allow future extensions, e.g. allowing non-tip sha1, replace the
boolean allow_tip_sha1_in_want variable with the flag-style
allow_request_with_bare_object_name variable.

Signed-off-by: Fredrik Medley <fredrik.medley@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Fourth batch for 2.5 cycleJunio C Hamano Fri, 22 May 2015 19:53:21 +0000 (12:53 -0700)

Fourth batch for 2.5 cycle

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

Merge branch 'ps/doc-packfile-vs-pack-file'Junio C Hamano Fri, 22 May 2015 19:42:00 +0000 (12:42 -0700)

Merge branch 'ps/doc-packfile-vs-pack-file'

Doc consistency updates.

* ps/doc-packfile-vs-pack-file:
doc: fix inconsistent spelling of "packfile"
pack-protocol.txt: fix insconsistent spelling of "packfile"
git-unpack-objects.txt: fix inconsistent spelling of "packfile"
git-verify-pack.txt: fix inconsistent spelling of "packfile"

Merge branch 'sb/t1020-cleanup'Junio C Hamano Fri, 22 May 2015 19:41:59 +0000 (12:41 -0700)

Merge branch 'sb/t1020-cleanup'

There was a commented-out (instead of being marked to expect
failure) test that documented a breakage that was fixed since the
test was written; turn it into a proper test.

* sb/t1020-cleanup:
subdirectory tests: code cleanup, uncomment test

Merge branch 'lm/squelch-bg-progress'Junio C Hamano Fri, 22 May 2015 19:41:58 +0000 (12:41 -0700)

Merge branch 'lm/squelch-bg-progress'

The controlling tty-based heuristics to squelch progress output did
not consider that the process may not be talking to a tty at all
(e.g. sending the progress to sideband #2). This is a finishing
touch to a topic that is already in 'master'.

* lm/squelch-bg-progress:
progress: treat "no terminal" as being in the foreground

Merge branch 'jc/ignore-epipe-in-filter'Junio C Hamano Fri, 22 May 2015 19:41:57 +0000 (12:41 -0700)

Merge branch 'jc/ignore-epipe-in-filter'

Filter scripts were run with SIGPIPE disabled on the Git side,
expecting that they may not read what Git feeds them to filter.
We however treated a filter that does not read its input fully
before exiting as an error.

This changes semantics, but arguably in a good way. If a filter
can produce its output without consuming its input using whatever
magic, we now let it do so, instead of diagnosing it as a
programming error.

* jc/ignore-epipe-in-filter:
filter_buffer_or_fd(): ignore EPIPE
copy.c: make copy_fd() report its status silently

Merge branch 'mh/clone-verbosity-fix'Junio C Hamano Fri, 22 May 2015 19:41:56 +0000 (12:41 -0700)

Merge branch 'mh/clone-verbosity-fix'

Git 2.4 broke setting verbosity and progress levels on "git clone"
with native transports.

* mh/clone-verbosity-fix:
clone: call transport_set_verbosity before anything else on the newly created transport

Merge branch 'pt/pull-tags-error-diag'Junio C Hamano Fri, 22 May 2015 19:41:56 +0000 (12:41 -0700)

Merge branch 'pt/pull-tags-error-diag'

There was a dead code that used to handle "git pull --tags" and
show special-cased error message, which was made irrelevant when
the semantics of the option changed back in Git 1.9 days.

* pt/pull-tags-error-diag:
pull: remove --tags error in no merge candidates case

Merge branch 'mh/lockfile-retry'Junio C Hamano Fri, 22 May 2015 19:41:55 +0000 (12:41 -0700)

Merge branch 'mh/lockfile-retry'

Instead of dying immediately upon failing to obtain a lock, retry
after a short while with backoff.

* mh/lockfile-retry:
lock_packed_refs(): allow retries when acquiring the packed-refs lock
lockfile: allow file locking to be retried with a timeout

Merge branch 'jk/add-e-kill-editor'Junio C Hamano Fri, 22 May 2015 19:41:55 +0000 (12:41 -0700)

Merge branch 'jk/add-e-kill-editor'

"git add -e" did not allow the user to abort the operation by
killing the editor.

* jk/add-e-kill-editor:
add: check return value of launch_editor

Merge branch 'sg/completion-config'Junio C Hamano Fri, 22 May 2015 19:41:53 +0000 (12:41 -0700)

Merge branch 'sg/completion-config'

Code clean-up for completion script (in contrib/).

* sg/completion-config:
completion: simplify query for config variables
completion: add a helper function to get config variables

Merge branch 'mh/ref-directory-file'Junio C Hamano Fri, 22 May 2015 19:41:53 +0000 (12:41 -0700)

Merge branch 'mh/ref-directory-file'

The ref API did not handle cases where 'refs/heads/xyzzy/frotz' is
removed at the same time as 'refs/heads/xyzzy' is added (or vice
versa) very well.

* mh/ref-directory-file:
reflog_expire(): integrate lock_ref_sha1_basic() errors into ours
ref_transaction_commit(): delete extra "the" from error message
ref_transaction_commit(): provide better error messages
rename_ref(): integrate lock_ref_sha1_basic() errors into ours
lock_ref_sha1_basic(): improve diagnostics for ref D/F conflicts
lock_ref_sha1_basic(): report errors via a "struct strbuf *err"
verify_refname_available(): report errors via a "struct strbuf *err"
verify_refname_available(): rename function
refs: check for D/F conflicts among refs created in a transaction
ref_transaction_commit(): use a string_list for detecting duplicates
is_refname_available(): use dirname in first loop
struct nonmatching_ref_data: store a refname instead of a ref_entry
report_refname_conflict(): inline function
entry_matches(): inline function
is_refname_available(): convert local variable "dirname" to strbuf
is_refname_available(): avoid shadowing "dir" variable
is_refname_available(): revamp the comments
t1404: new tests of ref D/F conflicts within transactions

Merge branch 'mh/write-refs-sooner-2.4'Junio C Hamano Fri, 22 May 2015 19:41:52 +0000 (12:41 -0700)

Merge branch 'mh/write-refs-sooner-2.4'

Multi-ref transaction support we merged a few releases ago
unnecessarily kept many file descriptors open, risking to fail with
resource exhaustion. This is for 2.4.x track.

* mh/write-refs-sooner-2.4:
ref_transaction_commit(): fix atomicity and avoid fd exhaustion
ref_transaction_commit(): remove the local flags variable
ref_transaction_commit(): inline call to write_ref_sha1()
rename_ref(): inline calls to write_ref_sha1() from this function
commit_ref_update(): new function, extracted from write_ref_sha1()
write_ref_to_lockfile(): new function, extracted from write_ref_sha1()
t7004: rename ULIMIT test prerequisite to ULIMIT_STACK_SIZE
update-ref: test handling large transactions properly
ref_transaction_commit(): fix atomicity and avoid fd exhaustion
ref_transaction_commit(): remove the local flags variable
ref_transaction_commit(): inline call to write_ref_sha1()
rename_ref(): inline calls to write_ref_sha1() from this function
commit_ref_update(): new function, extracted from write_ref_sha1()
write_ref_to_lockfile(): new function, extracted from write_ref_sha1()
t7004: rename ULIMIT test prerequisite to ULIMIT_STACK_SIZE
update-ref: test handling large transactions properly

Merge branch 'mg/log-decorate-HEAD'Junio C Hamano Fri, 22 May 2015 19:41:51 +0000 (12:41 -0700)

Merge branch 'mg/log-decorate-HEAD'

The "log --decorate" enhancement in Git 2.4 that shows the commit
at the tip of the current branch e.g. "HEAD -> master", did not
work with --decorate=full.

* mg/log-decorate-HEAD:
log: do not shorten decoration names too early
log: decorate HEAD with branch name under --decorate=full, too

Merge branch 'jk/asciidoc-markup-fix'Junio C Hamano Fri, 22 May 2015 19:41:50 +0000 (12:41 -0700)

Merge branch 'jk/asciidoc-markup-fix'

Various documentation mark-up fixes to make the output more
consistent in general and also make AsciiDoctor (an alternative
formatter) happier.

* jk/asciidoc-markup-fix:
doc: convert AsciiDoc {?foo} to ifdef::foo[]
doc: put example URLs and emails inside literal backticks
doc: drop backslash quoting of some curly braces
doc: convert \--option to --option
doc/add: reformat `--edit` option
doc: fix length of underlined section-title
doc: fix hanging "+"-continuation
doc: fix unquoted use of "{type}"
doc: fix misrendering due to `single quote'

Merge branch 'jk/stripspace-asciidoctor-fix'Junio C Hamano Fri, 22 May 2015 19:41:49 +0000 (12:41 -0700)

Merge branch 'jk/stripspace-asciidoctor-fix'

A literal block in the tutorial had lines with unequal lengths to
delimit it from the rest of the document, which choke GitHub's
AsciiDoc renderer.

* jk/stripspace-asciidoctor-fix:
doc: fix unmatched code fences in git-stripspace

Merge branch 'ja/tutorial-asciidoctor-fix'Junio C Hamano Fri, 22 May 2015 19:41:48 +0000 (12:41 -0700)

Merge branch 'ja/tutorial-asciidoctor-fix'

A literal block in the tutorial had lines with unequal lengths to
delimit it from the rest of the document, which choke GitHub's
AsciiDoc renderer.

* ja/tutorial-asciidoctor-fix:
doc: fix unmatched code fences

Merge branch 'sg/help-subcommands'Junio C Hamano Fri, 22 May 2015 19:41:47 +0000 (12:41 -0700)

Merge branch 'sg/help-subcommands'

A preparatory clean-up step.

* sg/help-subcommands:
command-list.txt: fix whitespace inconsistency

Merge branch 'ps/bundle-verify-arg'Junio C Hamano Fri, 22 May 2015 19:41:46 +0000 (12:41 -0700)

Merge branch 'ps/bundle-verify-arg'

"git bundle verify" did not diagnose extra parameters on the
command line.

* ps/bundle-verify-arg:
bundle: verify arguments more strictly

Merge branch 'ls/http-ssl-cipher-list'Junio C Hamano Fri, 22 May 2015 19:41:45 +0000 (12:41 -0700)

Merge branch 'ls/http-ssl-cipher-list'

Introduce http.<url>.SSLCipherList configuration variable to tweak
the list of cipher suite to be used with libcURL when talking with
https:// sites.

* ls/http-ssl-cipher-list:
http: add support for specifying an SSL cipher list

Merge branch 'dl/subtree-avoid-tricky-echo'Junio C Hamano Fri, 22 May 2015 19:41:45 +0000 (12:41 -0700)

Merge branch 'dl/subtree-avoid-tricky-echo'

"git subtree" script (in contrib/) used "echo -n" to produce
progress messages in a non-portable way.

* dl/subtree-avoid-tricky-echo:
contrib/subtree: portability fix for string printing

Merge branch 'jk/skip-http-tests-under-no-curl'Junio C Hamano Fri, 22 May 2015 19:41:44 +0000 (12:41 -0700)

Merge branch 'jk/skip-http-tests-under-no-curl'

Test clean-up.

* jk/skip-http-tests-under-no-curl:
tests: skip dav http-push tests under NO_EXPAT=NoThanks
t/lib-httpd.sh: skip tests if NO_CURL is defined

Merge branch 'dl/subtree-push-no-squash'Junio C Hamano Fri, 22 May 2015 19:41:43 +0000 (12:41 -0700)

Merge branch 'dl/subtree-push-no-squash'

"git subtree" script (in contrib/) does not have --squash option
when pushing, but the documentation and help text pretended as if
it did.

* dl/subtree-push-no-squash:
contrib/subtree: there's no push --squash

Merge branch 'sg/completion-omit-credential-helpers'Junio C Hamano Fri, 22 May 2015 19:41:42 +0000 (12:41 -0700)

Merge branch 'sg/completion-omit-credential-helpers'

The Git subcommand completion (in contrib/) listed credential
helpers among candidates, which is not something the end user would
invoke interatively.

* sg/completion-omit-credential-helpers:
completion: remove credential helpers from porcelain commands

Merge branch 'dl/branch-error-message'Junio C Hamano Fri, 22 May 2015 19:41:41 +0000 (12:41 -0700)

Merge branch 'dl/branch-error-message'

Error messages from "git branch" called remote-tracking branches as
"remote branches".

* dl/branch-error-message:
branch: do not call a "remote-tracking branch" a "remote branch"

test_bitmap_walk: free bitmap with bitmap_freeJeff King Fri, 22 May 2015 00:53:36 +0000 (20:53 -0400)

test_bitmap_walk: free bitmap with bitmap_free

Commit f86a374 (pack-bitmap.c: fix a memleak, 2015-03-30)
noticed that we leak the "result" bitmap. But we should use
"bitmap_free" rather than straight "free", as the former
remembers to free the bitmap array pointed to by the struct.

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

doc: fix inconsistent spelling of "packfile"Patrick Steinhardt Fri, 22 May 2015 06:22:04 +0000 (08:22 +0200)

doc: fix inconsistent spelling of "packfile"

Fix remaining instances where "pack-file" is used instead of
"packfile". Some places remain where we still use "pack-file",
This is the case when we explicitly refer to a file with a
".pack" extension as opposed to a data source providing a pack
data stream.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

t5407: use <<- to align the expected outputJunio C Hamano Fri, 22 May 2015 15:41:31 +0000 (08:41 -0700)

t5407: use <<- to align the expected output

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

rebase -i: fix post-rewrite hook with failed exec commandMatthieu Moy Fri, 22 May 2015 13:15:49 +0000 (13:15 +0000)

rebase -i: fix post-rewrite hook with failed exec command

Usually, when 'git rebase' stops before completing the rebase, it is to
give the user an opportunity to edit a commit (e.g. with the 'edit'
command). In such cases, 'git rebase' leaves the sha1 of the commit being
rewritten in "$state_dir"/stopped-sha, and subsequent 'git rebase
--continue' will call the post-rewrite hook with this sha1 as <old-sha1>
argument to the post-rewrite hook.

The case of 'git rebase' stopping because of a failed 'exec' command is
different: it gives the opportunity to the user to examine or fix the
failure, but does not stop saying "here's a commit to edit, use
--continue when you're done". So, there's no reason to call the
post-rewrite hook for 'exec' commands. If the user did rewrite the
commit, it would be with 'git commit --amend' which already called the
post-rewrite hook.

Fix the behavior to leave no stopped-sha file in case of failed exec
command, and teach 'git rebase --continue' to skip record_in_rewritten if
no stopped-sha file is found.

Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

rebase -i: demonstrate incorrect behavior of post-rewriteMatthieu Moy Fri, 22 May 2015 13:15:50 +0000 (13:15 +0000)

rebase -i: demonstrate incorrect behavior of post-rewrite

The 'exec' command is sending the current commit to stopped-sha, which is
supposed to contain the original commit (before rebase). As a result, if
an 'exec' command fails, the next 'git rebase --continue' will send the
current commit as <old-sha1> to the post-rewrite hook.

The test currently fails with :

--- expected.data 2015-05-21 17:55:29.000000000 +0000
+++ [...]post-rewrite.data 2015-05-21 17:55:29.000000000 +0000
@@ -1,2 +1,3 @@
2362ae8e1b1b865e6161e6f0e165ffb974abf018 488028e9fac0b598b70cbeb594258a917e3f6fab
+488028e9fac0b598b70cbeb594258a917e3f6fab 488028e9fac0b598b70cbeb594258a917e3f6fab
babc8a4c7470895886fc129f1a015c486d05a351 8edffcc4e69a4e696a1d4bab047df450caf99507

Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

config.txt: clarify allowTipSHA1InWant with camelCaseFredrik Medley Thu, 21 May 2015 20:23:37 +0000 (22:23 +0200)

config.txt: clarify allowTipSHA1InWant with camelCase

Most of the options in config.txt are camelCase. Improve the readability
for allowtipsha1inwant by changing to allowTipSHA1InWant.

Signed-off-by: Fredrik Medley <fredrik.medley@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

help: respect new common command groupingSébastien Guimmara Thu, 21 May 2015 17:39:22 +0000 (19:39 +0200)

help: respect new common command grouping

'git help' shows common commands in alphabetical order:

The most commonly used git commands are:
add Add file contents to the index
bisect Find by binary search the change that introduced a bug
branch List, create, or delete branches
checkout Checkout a branch or paths to the working tree
clone Clone a repository into a new directory
commit Record changes to the repository
[...]

without any indication of how commands relate to high-level
concepts or each other. Revise the output to explain their relationship
with the typical Git workflow:

These are common Git commands used in various situations:

start a working area (see also: git help tutorial)
clone Clone a repository into a new directory
init Create an empty Git repository or reinitialize [...]

work on the current change (see also: git help everyday)
add Add file contents to the index
reset Reset current HEAD to the specified state

examine the history and state (see also: git help revisions)
log Show commit logs
status Show the working tree status

[...]

Helped-by: Eric Sunshine <sunshine@sunshineco.com>
Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
Signed-off-by: Sébastien Guimmara <sebastien.guimmara@gmail.com>
Reviewed-by: Eric Sunshine <sunshine@sunshineco.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

command-list.txt: drop the "common" tagSébastien Guimmara Thu, 21 May 2015 17:39:21 +0000 (19:39 +0200)

command-list.txt: drop the "common" tag

command-list.sh, retired in the previous patch, was the only
consumer of the "common" tag, so drop this now-unnecessary
attribute.

before:
git-add mainporcelain common worktree

after:
git-add mainporcelain worktree

Helped-by: Eric Sunshine <sunshine@sunshineco.com>
Signed-off-by: Sébastien Guimmara <sebastien.guimmara@gmail.com>
Reviewed-by: Eric Sunshine <sunshine@sunshineco.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

generate-cmdlist: parse common group commandsEric Sunshine Thu, 21 May 2015 17:39:20 +0000 (19:39 +0200)

generate-cmdlist: parse common group commands

Parse the group block to create the array of group descriptions:

static char *common_cmd_groups[] = {
N_("starting a working area"),
N_("working on the current change"),
N_("working with others"),
N_("examining the history and state"),
N_("growing, marking and tweaking your history"),
};

then map each element of common_cmds[] to a group via its index:

static struct cmdname_help common_cmds[] = {
{"add", N_("Add file contents to the index"), 1},
{"branch", N_("List, create, or delete branches"), 4},
{"checkout", N_("Checkout a branch or paths to the ..."), 4},
{"clone", N_("Clone a repository into a new directory"), 0},
{"commit", N_("Record changes to the repository"), 4},
...
};

so that 'git help' can print those commands grouped by theme.

Only commands tagged with an attribute from the group block are emitted to
common_cmds[].

[commit message by Sébastien Guimmara <sebastien.guimmara@gmail.com>]

Signed-off-by: Eric Sunshine <sunshine@sunshineco.com>
Signed-off-by: Sébastien Guimmara <sebastien.guimmara@gmail.com>
Reviewed-by: Eric Sunshine <sunshine@sunshineco.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

command-list.txt: add the common groups blockSébastien Guimmara Thu, 21 May 2015 17:39:19 +0000 (19:39 +0200)

command-list.txt: add the common groups block

The ultimate goal is for "git help" to display common commands in
groups rather than alphabetically. As a first step, define the
groups in a new block, and then assign a group to each
common command.

Add a block at the beginning of command-list.txt:

init start a working area (see also: git help tutorial)
worktree work on the current change (see also:[...]
info examine the history and state (see also: git [...]
history grow, mark and tweak your history
remote collaborate (see also: git help workflows)

storing information about common commands group, then map each common
command to a group:

git-add mainporcelain common worktree

Helped-by: Eric Sunshine <sunshine@sunshineco.com>
Helped-by: Junio C Hamano <gitster@pobox.com>
Helped-by: Emma Jane Hogbin Westby <emma.westby@gmail.com>
Signed-off-by: Sébastien Guimmara <sebastien.guimmara@gmail.com>
Reviewed-by: Eric Sunshine <sunshine@sunshineco.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

command-list: prepare machinery for upcoming "common... Eric Sunshine Thu, 21 May 2015 17:39:18 +0000 (19:39 +0200)

command-list: prepare machinery for upcoming "common groups" section

The ultimate goal is for "git help" to classify common commands by
group. Toward this end, a subsequent patch will add a new "common
groups" section to command-list.txt preceding the actual command list.
As preparation, teach existing command-list.txt parsing machinery, which
doesn't care about grouping, to skip over this upcoming "common groups"
section.

Signed-off-by: Eric Sunshine <sunshine@sunshineco.com>
Signed-off-by: Sébastien Guimmara <sebastien.guimmara@gmail.com>
Reviewed-by: Eric Sunshine <sunshine@sunshineco.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Documentation/log: clarify sha1 non-abbreviation in... Matthieu Moy Mon, 18 May 2015 17:55:58 +0000 (19:55 +0200)

Documentation/log: clarify sha1 non-abbreviation in log --raw

Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

dir: remove unused variable sbRené Scharfe Tue, 19 May 2015 22:13:33 +0000 (00:13 +0200)

dir: remove unused variable sb

It had never been used.

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

clean: remove unused variable bufRené Scharfe Tue, 19 May 2015 22:13:26 +0000 (00:13 +0200)

clean: remove unused variable buf

It had never been used.

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

use file_exists() to check if a file exists in the... René Scharfe Tue, 19 May 2015 21:44:23 +0000 (23:44 +0200)

use file_exists() to check if a file exists in the worktree

Call file_exists() instead of open-coding it. That's shorter, simpler
and the intent becomes clearer.

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

stash: recognize "--help" for subcommandsJeff King Wed, 20 May 2015 18:17:46 +0000 (14:17 -0400)

stash: recognize "--help" for subcommands

If you run "git stash --help", you get the help for stash
(this magic is done by the git wrapper itself). But if you
run "git stash drop --help", you get an error. We
cannot show help specific to "stash drop", of course, but we
can at least give the user the normal stash manpage.

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

stash: complain about unknown flagsJeff King Wed, 20 May 2015 18:01:32 +0000 (14:01 -0400)

stash: complain about unknown flags

The option parser for git-stash stuffs unknown flags into
the $FLAGS variable, where they can be accessed by the
individual commands. However, most commands do not even look
at these extra flags, leading to unexpected results like
this:

$ git stash drop --help
Dropped refs/stash@{0} (e6cf6d80faf92bb7828f7b60c47fc61c03bd30a1)

We should notice the extra flags and bail. Rather than
annotate each command to reject a non-empty $FLAGS variable,
we can notice that "stash show" is the only command that
actually _wants_ arbitrary flags. So we switch the default
mode to reject unknown flags, and let stash_show() opt into
the feature.

Reported-by: Vincent Legoll <vincent.legoll@gmail.com>
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

cat-file: add --follow-symlinks to --batchDavid Turner Wed, 20 May 2015 17:03:40 +0000 (13:03 -0400)

cat-file: add --follow-symlinks to --batch

This wires the in-repo-symlink following code through to the cat-file
builtin. In the event of an out-of-repo link, cat-file will print
the link in a new format.

Signed-off-by: David Turner <dturner@twopensource.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

sha1_name: get_sha1_with_context learns to follow symlinksDavid Turner Wed, 20 May 2015 17:03:39 +0000 (13:03 -0400)

sha1_name: get_sha1_with_context learns to follow symlinks

Wire up get_sha1_with_context to call get_tree_entry_follow_symlinks
when GET_SHA1_FOLLOW_SYMLINKS is passed in flags. G_S_FOLLOW_SYMLINKS
is incompatible with G_S_ONLY_TO_DIE because the diagnosis
that ONLY_TO_DIE triggers does not at present consider symlinks, and
it would be a significant amount of additional code to allow it to
do so.

Signed-off-by: David Turner <dturner@twopensource.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

tree-walk: learn get_tree_entry_follow_symlinksDavid Turner Wed, 20 May 2015 17:03:38 +0000 (13:03 -0400)

tree-walk: learn get_tree_entry_follow_symlinks

Add a new function, get_tree_entry_follow_symlinks, to tree-walk.[ch].
The function is not yet used. It will be used to implement git
cat-file --batch --follow-symlinks.

The function locates an object by path, following symlinks in the
repository. If the symlinks lead outside the repository, the function
reports this to the caller.

Signed-off-by: David Turner <dturner@twopensource.com>
Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

mergetools: add winmerge as a builtin toolDavid Aguilar Wed, 20 May 2015 09:07:23 +0000 (02:07 -0700)

mergetools: add winmerge as a builtin tool

Add a winmerge scriptlet with the commands described in [1] so
that users can use winmerge without needing to perform any
additional configuration.

[1] http://thread.gmane.org/gmane.comp.version-control.git/268631

Helped-by: Philip Oakley <philipoakley@iee.org>
Helped-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Helped-by: Sebastian Schuberth <sschuberth@gmail.com>
Helped-by: SZEDER Gábor <szeder@ira.uka.de>
Signed-off-by: David Aguilar <davvid@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

mergetool--lib: set IFS for difftool and mergetoolDavid Aguilar Wed, 20 May 2015 09:07:22 +0000 (02:07 -0700)

mergetool--lib: set IFS for difftool and mergetool

git-sh-setup sets IFS but it is not used by git-difftool--helper.
Set IFS in git-mergetool--lib so that the mergetool scriptlets,
difftool, and mergetool do not need to do so.

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

t5551: factor out tag creationJeff King Wed, 20 May 2015 07:36:43 +0000 (03:36 -0400)

t5551: factor out tag creation

One of our tests in t5551 creates a large number of tags,
and jumps through some hoops to do it efficiently. Let's
factor that out into a function so we can make other similar
tests.

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

filter_buffer_or_fd(): ignore EPIPEJunio C Hamano Tue, 19 May 2015 18:08:23 +0000 (11:08 -0700)

filter_buffer_or_fd(): ignore EPIPE

We are explicitly ignoring SIGPIPE, as we fully expect that the
filter program may not read our output fully. Ignore EPIPE that
may come from writing to it as well.

A new test was stolen from Jeff's suggestion.

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

Documentation/git-commit: grammofixMichael Coleman Wed, 20 May 2015 02:41:17 +0000 (22:41 -0400)

Documentation/git-commit: grammofix

Signed-off-by: Michael Coleman <michael.karl.coleman@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

copy.c: make copy_fd() report its status silentlyJunio C Hamano Tue, 19 May 2015 17:55:16 +0000 (10:55 -0700)

copy.c: make copy_fd() report its status silently

When copy_fd() function encounters errors, it emits error messages
itself, which makes it impossible for callers to take responsibility
for reporting errors, especially when they want to ignore certain
errors.

Move the error reporting to its callers in preparation.

- copy_file() and copy_file_with_time() by indirection get their
own calls to error().

- hold_lock_file_for_append(), when told to die on error, used to
exit(128) relying on the error message from copy_fd(), but now it
does its own die() instead. Note that the callers that do not
pass LOCK_DIE_ON_ERROR need to be adjusted for this change, but
fortunately there is none ;-)

- filter_buffer_or_fd() has its own error() already, in addition to
the message from copy_fd(), so this will change the output but
arguably in a better way.

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

Third batch for 2.5 cycleJunio C Hamano Tue, 19 May 2015 20:24:08 +0000 (13:24 -0700)

Third batch for 2.5 cycle

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

Merge branch 'sb/ref-lock-lose-lock-fd'Junio C Hamano Tue, 19 May 2015 20:17:59 +0000 (13:17 -0700)

Merge branch 'sb/ref-lock-lose-lock-fd'

The refs API uses ref_lock struct which had its own "int fd", even
though the same file descriptor was in the lock struct it contains.
Clean-up the code to lose this redundant field.

* sb/ref-lock-lose-lock-fd:
refs.c: remove lock_fd from struct ref_lock

Merge branch 'kn/cat-file-literally'Junio C Hamano Tue, 19 May 2015 20:17:58 +0000 (13:17 -0700)

Merge branch 'kn/cat-file-literally'

Add the "--allow-unknown-type" option to "cat-file" to allow
inspecting loose objects of an experimental or a broken type.

* kn/cat-file-literally:
t1006: add tests for git cat-file --allow-unknown-type
cat-file: teach cat-file a '--allow-unknown-type' option
cat-file: make the options mutually exclusive
sha1_file: support reading from a loose object of unknown type

Merge branch 'nd/dwim-wildcards-as-pathspecs'Junio C Hamano Tue, 19 May 2015 20:17:57 +0000 (13:17 -0700)

Merge branch 'nd/dwim-wildcards-as-pathspecs'

A heuristic to help the "git <cmd> <revs> <pathspec>" command line
convention to catch mistyped paths is to make sure all the non-rev
parameters in the later part of the command line are names of the
files in the working tree, but that means "git grep $str -- \*.c"
must always be disambiguated with "--", because nobody sane will
create a file whose name literally is asterisk-dot-see. Loosen the
heuristic to declare that with a wildcard string the user likely
meant to give us a pathspec.

* nd/dwim-wildcards-as-pathspecs:
pathspec: avoid the need of "--" when wildcard is used

Merge branch 'jc/merge'Junio C Hamano Tue, 19 May 2015 20:17:57 +0000 (13:17 -0700)

Merge branch 'jc/merge'

"git merge FETCH_HEAD" learned that the previous "git fetch" could
be to create an Octopus merge, i.e. recording multiple branches
that are not marked as "not-for-merge"; this allows us to lose an
old style invocation "git merge <msg> HEAD $commits..." in the
implementation of "git pull" script; the old style syntax can now
be deprecated.

* jc/merge:
merge: deprecate 'git merge <message> HEAD <commit>' syntax
merge: handle FETCH_HEAD internally
merge: decide if we auto-generate the message early in collect_parents()
merge: make collect_parents() auto-generate the merge message
merge: extract prepare_merge_message() logic out
merge: narrow scope of merge_names
merge: split reduce_parents() out of collect_parents()
merge: clarify collect_parents() logic
merge: small leakfix and code simplification
merge: do not check argc to determine number of remote heads
merge: clarify "pulling into void" special case
t5520: test pulling an octopus into an unborn branch
t5520: style fixes
merge: simplify code flow
merge: test the top-level merge driver

Merge branch 'ph/rebase-i-redo'Junio C Hamano Tue, 19 May 2015 20:17:56 +0000 (13:17 -0700)

Merge branch 'ph/rebase-i-redo'

"git rebase -i" moved the "current" command from "todo" to "done" a
bit too prematurely, losing a step when a "pick" did not even start.

* ph/rebase-i-redo:
rebase -i: redo tasks that die during cherry-pick

Merge branch 'jc/test-prereq-validate'Junio C Hamano Tue, 19 May 2015 20:17:55 +0000 (13:17 -0700)

Merge branch 'jc/test-prereq-validate'

Help us to find broken test script that splits the body part of the
test by mistaken use of wrong kind of quotes.

* jc/test-prereq-validate:
test: validate prerequistes syntax

Merge branch 'bc/connect-plink'Junio C Hamano Tue, 19 May 2015 20:17:54 +0000 (13:17 -0700)

Merge branch 'bc/connect-plink'

The connection initiation code for "ssh" transport tried to absorb
differences between the stock "ssh" and Putty-supplied "plink" and
its derivatives, but the logic to tell that we are using "plink"
variants were too loose and falsely triggered when "plink" appeared
anywhere in the path (e.g. "/home/me/bin/uplink/ssh").

* bc/connect-plink:
connect: improve check for plink to reduce false positives
t5601: fix quotation error leading to skipped tests
connect: simplify SSH connection code path

Merge branch 'jk/test-chain-lint'Junio C Hamano Tue, 19 May 2015 20:17:54 +0000 (13:17 -0700)

Merge branch 'jk/test-chain-lint'

Developer support to automatically detect broken &&-chain in the
test scripts is now turned on by default.

* jk/test-chain-lint:
test-lib: turn on GIT_TEST_CHAIN_LINT by default
t7502-commit.sh: fix a broken and-chain

Merge branch 'fg/document-commit-message-stripping'Junio C Hamano Tue, 19 May 2015 20:17:53 +0000 (13:17 -0700)

Merge branch 'fg/document-commit-message-stripping'

* fg/document-commit-message-stripping:
Documentation: clarify how "git commit" cleans up the edited log message

Merge branch 'jk/stash-require-clean-index'Junio C Hamano Tue, 19 May 2015 20:17:52 +0000 (13:17 -0700)

Merge branch 'jk/stash-require-clean-index'

"git stash pop/apply" forgot to make sure that not just the working
tree is clean but also the index is clean. The latter is important
as a stash application can conflict and the index will be used for
conflict resolution.

* jk/stash-require-clean-index:
stash: require a clean index to apply
t3903: avoid applying onto dirty index
t3903: stop hard-coding commit sha1s

Merge branch 'jk/git-no-more-argv0-path-munging'Junio C Hamano Tue, 19 May 2015 20:17:52 +0000 (13:17 -0700)

Merge branch 'jk/git-no-more-argv0-path-munging'

We have prepended $GIT_EXEC_PATH and the path "git" is installed in
(typically "/usr/bin") to $PATH when invoking subprograms and hooks
for almost eternity, but the original use case the latter tried to
support was semi-bogus (i.e. install git to /opt/foo/git and run it
without having /opt/foo on $PATH), and more importantly it has
become less and less relevant as Git grew more mainstream (i.e. the
users would _want_ to have it on their $PATH). Stop prepending the
path in which "git" is installed to users' $PATH, as that would
interfere the command search order people depend on (e.g. they may
not like versions of programs that are unrelated to Git in /usr/bin
and want to override them by having different ones in /usr/local/bin
and have the latter directory earlier in their $PATH).

* jk/git-no-more-argv0-path-munging:
stop putting argv[0] dirname at front of PATH