gitweb.git
Merge branch 'for-junio' of git://bogomips.org/git-svnJunio C Hamano Fri, 31 Oct 2014 18:50:20 +0000 (11:50 -0700)

Merge branch 'for-junio' of git://bogomips.org/git-svn

* 'for-junio' of git://bogomips.org/git-svn:
git-svn: use SVN::Ra::get_dir2 when possible
git-svn: add space after "W:" prefix in warning
git-svn: (cleanup) remove editor param passing
git-svn: prepare SVN::Ra config pieces once
Git.pm: add specified name to tempfile template
git-svn: disable _rev_list memoization
git-svn: save a little memory as fetch progresses
git-svn: remove unnecessary DESTROY override
git-svn: reload RA every log-window-size
git-svn.txt: advertise pushurl with dcommit
git-svn: remove mergeinfo rev caching
git-svn: cache only mergeinfo revisions
git-svn: reduce check_cherry_pick cache overhead
git-svn: only look at the root path for svn:mergeinfo
git-svn: only look at the new parts of svn:mergeinfo

Merge branch 'jc/push-cert'Junio C Hamano Fri, 31 Oct 2014 18:49:53 +0000 (11:49 -0700)

Merge branch 'jc/push-cert'

* jc/push-cert:
receive-pack: avoid minor leak in case start_async() fails

Merge branch 'rs/child-process-init'Junio C Hamano Fri, 31 Oct 2014 18:49:48 +0000 (11:49 -0700)

Merge branch 'rs/child-process-init'

* rs/child-process-init:
api-run-command: add missing list item marker

Merge branch 'rs/grep-color-words'Junio C Hamano Fri, 31 Oct 2014 18:49:37 +0000 (11:49 -0700)

Merge branch 'rs/grep-color-words'

Allow painting or not painting (partial) matches in context lines
when showing "grep -C<num>" output in color.

* rs/grep-color-words:
grep: add color.grep.matchcontext and color.grep.matchselected

git-svn: use SVN::Ra::get_dir2 when possibleEric Wong Fri, 31 Oct 2014 10:34:03 +0000 (10:34 +0000)

git-svn: use SVN::Ra::get_dir2 when possible

This avoids the following failure with normal "get_dir" on newer
versions of SVN (tested with SVN 1.8.8-1ubuntu3.1):

Incorrect parameters given: Could not convert '%ld' into a number

get_dir2 also has the potential to be more efficient by requesting
less data.

ref: <1414636504.45506.YahooMailBasic@web172304.mail.ir2.yahoo.com>
ref: <1414722617.89476.YahooMailBasic@web172305.mail.ir2.yahoo.com>

Signed-off-by: Eric Wong <normalperson@yhbt.net>
Cc: Hin-Tak Leung <htl10@users.sourceforge.net>

Merge git://ozlabs.org/~paulus/gitkJunio C Hamano Thu, 30 Oct 2014 17:07:33 +0000 (10:07 -0700)

Merge git://ozlabs.org/~paulus/gitk

* git://ozlabs.org/~paulus/gitk:
gitk: Remove boilerplate for configuration variables
gitk: Show detached HEAD if --all is specified
gitk: Do not depend on Cygwin's "kill" command on Windows

git-svn: add space after "W:" prefix in warningEric Wong Thu, 30 Oct 2014 08:31:28 +0000 (08:31 +0000)

git-svn: add space after "W:" prefix in warning

And minor reformatting while we're in the area.

Signed-off-by: Eric Wong <normalperson@yhbt.net>

git-svn: (cleanup) remove editor param passingEric Wong Wed, 29 Oct 2014 20:10:29 +0000 (20:10 +0000)

git-svn: (cleanup) remove editor param passing

Neither find_extra_svk_parents or find_extra_svn_parents ever
used the `$ed' parameter.

Signed-off-by: Eric Wong <normalperson@yhbt.net>

gitk: Remove boilerplate for configuration variablesMax Kirillov Sun, 14 Sep 2014 20:35:57 +0000 (23:35 +0300)

gitk: Remove boilerplate for configuration variables

Signed-off-by: Max Kirillov <max@max630.net>
Signed-off-by: Paul Mackerras <paulus@samba.org>

gitk: Show detached HEAD if --all is specifiedMax Kirillov Tue, 9 Sep 2014 07:29:16 +0000 (10:29 +0300)

gitk: Show detached HEAD if --all is specified

If HEAD is detached, 'gitk --all' does not show it. This is inconvenient
for frontend program, and for example git log does show the detached HEAD.

gitk uses git rev-parse to find a list of branches to show.
Apparently, the command does not include detached HEAD to output if
--all argument is specified. This has been discussed in [1] and stated
as expected behavior. So rev-parse's parameters should be tuned in gitk.

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

Signed-off-by: Max Kirillov <max@max630.net>
Signed-off-by: Paul Mackerras <paulus@samba.org>

gitk: Do not depend on Cygwin's "kill" command on WindowsSebastian Schuberth Thu, 23 Oct 2014 19:30:54 +0000 (21:30 +0200)

gitk: Do not depend on Cygwin's "kill" command on Windows

Windows does not necessarily mean Cygwin, it could also be MSYS. The
latter ships with a version of "kill" that does not understand "-f".
In msysgit this was addressed by shipping Cygwin's version of kill.

Properly fix this by using the stock Windows "taskkill" command instead,
which is available since Windows XP Professional.

Signed-off-by: Sebastian Schuberth <sschuberth@gmail.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>

git-svn: prepare SVN::Ra config pieces onceEric Wong Wed, 29 Oct 2014 19:55:02 +0000 (19:55 +0000)

git-svn: prepare SVN::Ra config pieces once

Memoizing these initialization functions saves some memory for
long fetches which require scanning many unwanted revisions
before any wanted revisions happen.

Signed-off-by: Eric Wong <normalperson@yhbt.net>

Git.pm: add specified name to tempfile templateEric Wong Wed, 29 Oct 2014 19:31:55 +0000 (19:31 +0000)

Git.pm: add specified name to tempfile template

This should help me track down errors in git-svn more easily:

write .git/Git_XXXXXX: Bad file descriptor
at /usr/lib/perl5/SVN/Ra.pm line 623

Signed-off-by: Eric Wong <normalperson@yhbt.net>

Sync with Git 2.1.3Junio C Hamano Wed, 29 Oct 2014 17:49:54 +0000 (10:49 -0700)

Sync with Git 2.1.3

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

Git 2.1.3 v2.1.3Junio C Hamano Wed, 29 Oct 2014 17:48:38 +0000 (10:48 -0700)

Git 2.1.3

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

Merge branch 'jk/pack-objects-no-bitmap-when-splitting... Junio C Hamano Wed, 29 Oct 2014 17:35:17 +0000 (10:35 -0700)

Merge branch 'jk/pack-objects-no-bitmap-when-splitting' into maint

* jk/pack-objects-no-bitmap-when-splitting:
pack-objects: turn off bitmaps when we split packs

Merge branch 'da/mergetool-meld' into maintJunio C Hamano Wed, 29 Oct 2014 17:35:16 +0000 (10:35 -0700)

Merge branch 'da/mergetool-meld' into maint

* da/mergetool-meld:
mergetools/meld: make usage of `--output` configurable and more robust

Merge branch 'rm/gitweb-start-form' into maintJunio C Hamano Wed, 29 Oct 2014 17:35:16 +0000 (10:35 -0700)

Merge branch 'rm/gitweb-start-form' into maint

* rm/gitweb-start-form:
gitweb: use start_form, not startform that was removed in CGI.pm 4.04

Merge branch 'bc/asciidoc-pretty-formats-fix' into... Junio C Hamano Wed, 29 Oct 2014 17:35:10 +0000 (10:35 -0700)

Merge branch 'bc/asciidoc-pretty-formats-fix' into maint

* bc/asciidoc-pretty-formats-fix:
Documentation: fix misrender of pretty-formats in Asciidoctor

Merge branch 'rs/daemon-fixes' into maintJunio C Hamano Wed, 29 Oct 2014 17:35:09 +0000 (10:35 -0700)

Merge branch 'rs/daemon-fixes' into maint

* rs/daemon-fixes:
daemon: remove write-only variable maxfd
daemon: fix error message after bind()
daemon: handle gethostbyname() error

Update draft release notes to 2.2Junio C Hamano Wed, 29 Oct 2014 17:18:31 +0000 (10:18 -0700)

Update draft release notes to 2.2

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

Merge branch 'da/difftool'Junio C Hamano Wed, 29 Oct 2014 17:09:35 +0000 (10:09 -0700)

Merge branch 'da/difftool'

Allow diff tool backend to stop early by exiting with a non-zero
status.

* da/difftool:
difftool: add support for --trust-exit-code
difftool--helper: exit when reading a prompt answer fails

Merge branch 'rb/pack-window-memory-config-doc'Junio C Hamano Wed, 29 Oct 2014 17:09:31 +0000 (10:09 -0700)

Merge branch 'rb/pack-window-memory-config-doc'

* rb/pack-window-memory-config-doc:
config.txt: pack.windowmemory limit applies per-thread

Merge branch 'mg/lib-gpg-ro-safety'Junio C Hamano Wed, 29 Oct 2014 17:08:15 +0000 (10:08 -0700)

Merge branch 'mg/lib-gpg-ro-safety'

In a tarball extract whose files are all read-only, running GPG
tests would have failed due to unwritable files.

* mg/lib-gpg-ro-safety:
t/lib-gpg: make gpghome files writable

Merge branch 'dm/port2zos'Junio C Hamano Wed, 29 Oct 2014 17:08:06 +0000 (10:08 -0700)

Merge branch 'dm/port2zos'

z/OS port

* dm/port2zos:
compat/bswap.h: detect endianness from XL C compiler macros
Makefile: reorder linker flags in the git executable rule
git-compat-util.h: support variadic macros with the XL C compiler

Merge branch 'oc/mergetools-beyondcompare'Junio C Hamano Wed, 29 Oct 2014 17:08:03 +0000 (10:08 -0700)

Merge branch 'oc/mergetools-beyondcompare'

* oc/mergetools-beyondcompare:
mergetool: rename bc3 to bc

Merge branch 'jk/prune-mtime'Junio C Hamano Wed, 29 Oct 2014 17:07:56 +0000 (10:07 -0700)

Merge branch 'jk/prune-mtime'

Tighten the logic to decide that an unreachable cruft is
sufficiently old by covering corner cases such as an ancient object
becoming reachable and then going unreachable again, in which case
its retention period should be prolonged.

* jk/prune-mtime: (28 commits)
drop add_object_array_with_mode
revision: remove definition of unused 'add_object' function
pack-objects: double-check options before discarding objects
repack: pack objects mentioned by the index
pack-objects: use argv_array
reachable: use revision machinery's --indexed-objects code
rev-list: add --indexed-objects option
rev-list: document --reflog option
t5516: test pushing a tag of an otherwise unreferenced blob
traverse_commit_list: support pending blobs/trees with paths
make add_object_array_with_context interface more sane
write_sha1_file: freshen existing objects
pack-objects: match prune logic for discarding objects
pack-objects: refactor unpack-unreachable expiration check
prune: keep objects reachable from recent objects
sha1_file: add for_each iterators for loose and packed objects
count-objects: use for_each_loose_file_in_objdir
count-objects: do not use xsize_t when counting object size
prune-packed: use for_each_loose_file_in_objdir
reachable: mark index blobs as SEEN
...

Merge branch 'bc/asciidoctor'Junio C Hamano Wed, 29 Oct 2014 17:07:39 +0000 (10:07 -0700)

Merge branch 'bc/asciidoctor'

Add machinery to alternatively use AsciiDoctor to format our
documentation.

* bc/asciidoctor:
Documentation: remove Asciidoctor linkgit macro
Documentation: refactor common operations into variables
Documentation: implement linkgit macro for Asciidoctor
Documentation: move some AsciiDoc parameters into variables

api-run-command: add missing list item markerRené Scharfe Tue, 28 Oct 2014 22:09:53 +0000 (23:09 +0100)

api-run-command: add missing list item marker

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

receive-pack: avoid minor leak in case start_async... René Scharfe Tue, 28 Oct 2014 20:27:54 +0000 (21:27 +0100)

receive-pack: avoid minor leak in case start_async() fails

If the asynchronous start of copy_to_sideband() fails, then any
env_array entries added to struct child_process proc by
prepare_push_cert_sha1() are leaked. Call the latter function only
after start_async() succeeded so that the allocated entries are
cleaned up automatically by start_command() or finish_command().

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

difftool: add support for --trust-exit-codeDavid Aguilar Mon, 27 Oct 2014 01:15:42 +0000 (18:15 -0700)

difftool: add support for --trust-exit-code

Teach difftool to exit when a diff tool returns a non-zero exit
code when either --trust-exit-code is specified or
difftool.trustExitCode is true.

Forward exit codes from invoked diff tools to the caller when
--trust-exit-code is used.

Suggested-by: Adri Farr <14farresa@gmail.com>
Helped-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: David Aguilar <davvid@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

grep: add color.grep.matchcontext and color.grep.matchs... René Scharfe Mon, 27 Oct 2014 18:23:05 +0000 (19:23 +0100)

grep: add color.grep.matchcontext and color.grep.matchselected

The config option color.grep.match can be used to specify the highlighting
color for matching strings. Add the options matchContext and matchSelected
to allow different colors to be specified for matching strings in the
context vs. in selected lines. This is similar to the ms and mc specifiers
in GNU grep's environment variable GREP_COLORS.

Tests are from Zoltan Klinger's earlier attempt to solve the same
issue in a different way.

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

config.txt: pack.windowmemory limit applies per-threadRobert de Bath Fri, 24 Oct 2014 07:43:27 +0000 (08:43 +0100)

config.txt: pack.windowmemory limit applies per-thread

It took me a long time to notice the rider on the pack.threads
configuration option that it would multiple the memory consumption
by the number of CPUs in the machine. Clarify that the limit
applies per-thread.

Signed-off-by: Robert de Bath <rdebath@tvisiontech.co.uk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

t/lib-gpg: make gpghome files writableMichael J Gruber Fri, 24 Oct 2014 15:23:32 +0000 (17:23 +0200)

t/lib-gpg: make gpghome files writable

t/lib-gpg.sh copies the test environment's gpg home to the trash
directory and makes sure the directoty is writable.

Make sure the copied files are writable, too.

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

Documentation: remove Asciidoctor linkgit macrobrian m. carlson Mon, 27 Oct 2014 00:13:43 +0000 (00:13 +0000)

Documentation: remove Asciidoctor linkgit macro

Asciidoctor provides an extension implementing a backend-independent
macro for dealing with manpage links just like the linkgit macro. As
this is more likely to be up-to-date with future changes in Asciidoctor,
prefer using it over reimplementing in Git.

This reverts commit 773ee47c2b9c691d9758b2bea6cac10e3f0c4e12.

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

Documentation: refactor common operations into variablesbrian m. carlson Mon, 27 Oct 2014 00:13:42 +0000 (00:13 +0000)

Documentation: refactor common operations into variables

The Makefile performs several very similar tasks to convert AsciiDoc
files into either HTML or DocBook. Move these items into variables to
reduce the duplication.

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

compat/bswap.h: detect endianness from XL C compiler... David Michael Sun, 26 Oct 2014 17:34:26 +0000 (13:34 -0400)

compat/bswap.h: detect endianness from XL C compiler macros

There is no /usr/include/endian.h equivalent on z/OS, but the
compiler will define macros to indicate endianness on host and
target hardware. This adds a test for these macros as a last
resort for determining byte order.

Signed-off-by: David Michael <fedora.dm0@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Makefile: reorder linker flags in the git executable... David Michael Sun, 26 Oct 2014 17:33:53 +0000 (13:33 -0400)

Makefile: reorder linker flags in the git executable rule

The XL C compiler can fail due to mixing library path and object
file arguments, for example when linking git while building with
"gmake LDFLAGS=-L$prefix/lib".

Move the ALL_LDFLAGS variable expansion in the git executable rule
to be consistent with all the other linking rules, namely to have
LDFLAGS such as -L$where before the object files *.o being linked
together.

Signed-off-by: David Michael <fedora.dm0@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

git-compat-util.h: support variadic macros with the... David Michael Sun, 26 Oct 2014 17:33:12 +0000 (13:33 -0400)

git-compat-util.h: support variadic macros with the XL C compiler

When the XL C compiler is run with an appropriate language level or
suboption, it defines a feature test macro to indicate support for
variadic macros by defining __C99_MACRO_WITH_VA_ARGS C preprocessor
macro.

This was tested on z/OS, but it should also work on AIX according
to IBM documentation.

Signed-off-by: David Michael <fedora.dm0@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

difftool--helper: exit when reading a prompt answer... Johannes Sixt Sun, 26 Oct 2014 08:09:20 +0000 (09:09 +0100)

difftool--helper: exit when reading a prompt answer fails

An attempt to quit difftool by hitting Ctrl-D (EOF) at its prompt does
not quit it, but is treated as if 'yes' was answered to the prompt and
all following prompts, which is contrary to the user's intent. Fix the
error check.

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

git-svn: disable _rev_list memoizationEric Wong Mon, 27 Oct 2014 01:39:39 +0000 (01:39 +0000)

git-svn: disable _rev_list memoization

This memoization appears unneeded as the check_cherry_pick2 cache is
in front of it does enough.

With this change applied, importing from local svn+ssh and http copies
of the R repo[1] takes only 2:00 (2 hours) on my system and the git-svn
process never uses more than 60MB RSS on my x86-64 GNU/Linux system[2].
This 60M measurement is only for the git-svn Perl process itself and
does not include memory used by git subprocesses accessing large packs
(subprocess memory usage _is_ measured by my time(1) tool).

Before this change, an import took longer (2:20) on svn+ssh:// but
git-svn used around 240MB during the imports. Worse yet, git-svn
ballooned to over 400M when writing out the cache to the filesystem.

I also tried removing memoization for `has_no_changes', too, but a
local copy of the R repository(*) was not close to finishing within
10 hours on my system.

[1] http://svn.r-project.org/R
[2] file:// repos causes libsvn to use more memory internally

Signed-off-by: Eric Wong <normalperson@yhbt.net>
Cc: Hin-Tak Leung <htl10@users.sourceforge.net>

git-svn: save a little memory as fetch progressesEric Wong Sat, 25 Oct 2014 07:56:12 +0000 (07:56 +0000)

git-svn: save a little memory as fetch progresses

There is no reason to keep entries in the %revs hash after we're
done processing a revision, so allow entries become freed as
processing continues.

Signed-off-by: Eric Wong <normalperson@yhbt.net>

git-svn: remove unnecessary DESTROY overrideEric Wong Sat, 25 Oct 2014 07:56:11 +0000 (07:56 +0000)

git-svn: remove unnecessary DESTROY override

This override was probably never necessary, but most likely a no-op
as it does not appear to do anything in SVN::Ra itself.

Signed-off-by: Eric Wong <normalperson@yhbt.net>

git-svn: reload RA every log-window-sizeEric Wong Fri, 24 Oct 2014 22:53:52 +0000 (22:53 +0000)

git-svn: reload RA every log-window-size

Despite attempting to use local memory pools everywhere we can,
(including our call to SVN::Ra::do_update and all subsequent reporter
calls), there does not appear to be a way to force the Git::SVN::Fetcher
callbacks to use a pool other than the per-SVN::Ra pool.
Git::SVN::Fetcher ends up using the main RA pool which grows
monotonically in size for the lifetime of the RA object.

Thus the only way to free that memory appears to be to destroy and
recreate the RA connection for at every --log-window-size interval.

This reduces memory usage over the course of fetching 10K revisions
using a test repository created with the script at the end of this
commit message.

As reported by time(1) on my x86-64 system:

before: 54024k
after: 28680k

Unfortunately, there remains some yet-to-be-tracked-down slow memory
growth which would be evident as the `nr' parameter increases in
the repository generation script:
-----------------------------8<------------------------------
set -e
tmp=$(mktemp -d svntestrepo-XXXXXXXX)
svnadmin create "$tmp"
repo=file://"$(cd $tmp && pwd)"
svn co "$repo" "$tmp/wd"
cd "$tmp/wd"
if ! test -f a
then
> a
svn add a
svn commit -m 'A'
fi

nr=10000
while test $nr -gt 0
do
echo $nr > a
svn commit -q -m A
nr=$((nr - 1))
done
echo "repository created in $repo"
-----------------------------8<------------------------------

Signed-off-by: Eric Wong <normalperson@yhbt.net>

git-svn.txt: advertise pushurl with dcommitSveinung Kvilhaugsvik Thu, 9 Oct 2014 22:49:59 +0000 (00:49 +0200)

git-svn.txt: advertise pushurl with dcommit

Advertise that the svn-remote.<name>.pushurl config key allows specifying
the commit URL for the entire SVN repository in the documentation of the
git svn dcommit command.

Signed-off-by: Sveinung Kvilhaugsvik <sveinung84@users.sourceforge.net>
Signed-off-by: Eric Wong <normalperson@yhbt.net>

git-svn: remove mergeinfo rev cachingEric Wong Tue, 21 Oct 2014 06:23:22 +0000 (06:23 +0000)

git-svn: remove mergeinfo rev caching

This should further reduce memory usage from the new mergeinfo
speedups without hurting performance too much, assuming
reasonable latency to the SVN server.

Cc: Hin-Tak Leung <htl10@users.sourceforge.net>
Suggested-by: Jakob Stoklund Olesen <stoklund@2pi.dk>
Signed-off-by: Eric Wong <normalperson@yhbt.net>

git-svn: cache only mergeinfo revisionsEric Wong Mon, 20 Oct 2014 01:02:53 +0000 (01:02 +0000)

git-svn: cache only mergeinfo revisions

This should reduce excessive memory usage from the new mergeinfo
caches without hurting performance too much, assuming reasonable
latency to the SVN server.

Cc: Hin-Tak Leung <htl10@users.sourceforge.net>
Suggested-by: Jakob Stoklund Olesen <stoklund@2pi.dk>
Signed-off-by: Eric Wong <normalperson@yhbt.net>

git-svn: reduce check_cherry_pick cache overheadEric Wong Sun, 19 Oct 2014 04:08:31 +0000 (04:08 +0000)

git-svn: reduce check_cherry_pick cache overhead

We do not need to store entire lists of commits, only the
number of incomplete and the first commit for reference.
This reduces the amount of data we need to store in memory
and on disk stores.

Signed-off-by: Eric Wong <normalperson@yhbt.net>

git-svn: only look at the root path for svn:mergeinfoJakob Stoklund Olesen Thu, 17 Apr 2014 06:54:06 +0000 (23:54 -0700)

git-svn: only look at the root path for svn:mergeinfo

Subversion can put mergeinfo on any sub-directory to track cherry-picks.
Since cherry-picks are not represented explicitly in git, git-svn should
just ignore it.

Signed-off-by: Jakob Stoklund Olesen <stoklund@2pi.dk>
Signed-off-by: Eric Wong <normalperson@yhbt.net>

git-svn: only look at the new parts of svn:mergeinfoJakob Stoklund Olesen Thu, 17 Apr 2014 06:54:05 +0000 (23:54 -0700)

git-svn: only look at the new parts of svn:mergeinfo

In a Subversion repository where many feature branches are merged into a
trunk, the svn:mergeinfo property can grow very large. This severely
slows down git-svn's make_log_entry() because it is checking all
mergeinfo entries every time the property changes.

In most cases, the additions to svn:mergeinfo since the last commit are
pretty small, and there is nothing to gain by checking merges that were
already checked for the last commit in the branch.

Add a mergeinfo_changes() function which computes the set of interesting
changes to svn:mergeinfo since the last commit. Filter out merged
branches whose ranges haven't changed, and remove a common prefix of
ranges from other merged branches.

This speeds up "git svn fetch" by several orders of magnitude on a large
repository where thousands of feature branches have been merged.

Signed-off-by: Jakob Stoklund Olesen <stoklund@2pi.dk>
Signed-off-by: Eric Wong <normalperson@yhbt.net>

Update draft release notes to 2.2Junio C Hamano Fri, 24 Oct 2014 22:02:17 +0000 (15:02 -0700)

Update draft release notes to 2.2

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

Merge branch 'jc/push-cert'Junio C Hamano Fri, 24 Oct 2014 22:01:32 +0000 (15:01 -0700)

Merge branch 'jc/push-cert'

* jc/push-cert:
push: heed user.signingkey for signed pushes

Merge branch 'sb/plug-transport-leak'Junio C Hamano Fri, 24 Oct 2014 22:00:09 +0000 (15:00 -0700)

Merge branch 'sb/plug-transport-leak'

Code clean-up.

* sb/plug-transport-leak:
.mailmap: add Stefan Bellers corporate mail address
transport: free leaking head in transport_print_push_status()

Merge branch 'nd/dir-prep-exclude-cleanup'Junio C Hamano Fri, 24 Oct 2014 22:00:05 +0000 (15:00 -0700)

Merge branch 'nd/dir-prep-exclude-cleanup'

Code clean-up.

* nd/dir-prep-exclude-cleanup:
dir.c: remove the second declaration of "stk" in prep_exclude()

Merge branch 'eb/no-pthreads'Junio C Hamano Fri, 24 Oct 2014 21:59:10 +0000 (14:59 -0700)

Merge branch 'eb/no-pthreads'

Allow us build with NO_PTHREADS=NoThanks compilation option.

* eb/no-pthreads:
Handle atexit list internaly for unthreaded builds
pack-objects: set number of threads before checking and warning
index-pack: fix compilation with NO_PTHREADS

Merge branch 'wk/t1304-wo-USER'Junio C Hamano Fri, 24 Oct 2014 21:59:02 +0000 (14:59 -0700)

Merge branch 'wk/t1304-wo-USER'

* wk/t1304-wo-USER:
t1304: Set LOGNAME even if USER is unset or null

Merge branch 'tb/core-filemode-doc'Junio C Hamano Fri, 24 Oct 2014 21:57:57 +0000 (14:57 -0700)

Merge branch 'tb/core-filemode-doc'

Doc update.

* tb/core-filemode-doc:
core.filemode may need manual action

Merge branch 'rs/run-command-env-array'Junio C Hamano Fri, 24 Oct 2014 21:57:53 +0000 (14:57 -0700)

Merge branch 'rs/run-command-env-array'

Add managed "env" array to child_process to clarify the lifetime
rules.

* rs/run-command-env-array:
use env_array member of struct child_process
run-command: add env_array, an optional argv_array for env

Merge branch 'po/doc-status-markup'Junio C Hamano Fri, 24 Oct 2014 21:57:51 +0000 (14:57 -0700)

Merge branch 'po/doc-status-markup'

Update documentation mark-up.

* po/doc-status-markup:
doc: fix 'git status --help' character quoting

Merge branch 'jk/pack-objects-no-bitmap-when-splitting'Junio C Hamano Fri, 24 Oct 2014 21:56:10 +0000 (14:56 -0700)

Merge branch 'jk/pack-objects-no-bitmap-when-splitting'

Splitting pack-objects output into multiple packs is incompatible
with the use of reachability bitmap.

* jk/pack-objects-no-bitmap-when-splitting:
pack-objects: turn off bitmaps when we split packs

push: heed user.signingkey for signed pushesMichael J Gruber Wed, 22 Oct 2014 14:57:49 +0000 (16:57 +0200)

push: heed user.signingkey for signed pushes

push --signed promises to take user.signingkey as the signing key but
fails to read the config.

Make it do so.

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

Update draft release notes to 2.2Junio C Hamano Tue, 21 Oct 2014 20:35:44 +0000 (13:35 -0700)

Update draft release notes to 2.2

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

Merge branch 'js/completion-hide-not-a-repo'Junio C Hamano Tue, 21 Oct 2014 20:28:50 +0000 (13:28 -0700)

Merge branch 'js/completion-hide-not-a-repo'

Some internal error messages leaked out of the bash completion when
typing "git cmd <TAB>" and the machinery tried to complete
refnames.

* js/completion-hide-not-a-repo:
completion: silence "fatal: Not a git repository" error

Merge branch 'da/mergetool-meld'Junio C Hamano Tue, 21 Oct 2014 20:28:47 +0000 (13:28 -0700)

Merge branch 'da/mergetool-meld'

Newer versions of 'meld' breaks the auto-detection we use to see if
they are new enough to support the `--output` option.

* da/mergetool-meld:
mergetools/meld: make usage of `--output` configurable and more robust

Merge branch 'da/mergetool-temporary-directory'Junio C Hamano Tue, 21 Oct 2014 20:28:42 +0000 (13:28 -0700)

Merge branch 'da/mergetool-temporary-directory'

Allow a temporary directory specified to be used while running "git
mergetool" backend.

* da/mergetool-temporary-directory:
t7610-mergetool: add test cases for mergetool.writeToTemp
mergetool: add an option for writing to a temporary directory

Merge branch 'da/mergetool-tool-help'Junio C Hamano Tue, 21 Oct 2014 20:28:37 +0000 (13:28 -0700)

Merge branch 'da/mergetool-tool-help'

Allow "git mergetool --help" to run outside a Git repository.

* da/mergetool-tool-help:
difftool: don't assume that default sh is sane
mergetool: don't require a work tree for --tool-help
git-sh-setup: move GIT_DIR initialization into a function
mergetool: use more conservative temporary filenames
test-lib-functions: adjust style to match CodingGuidelines
t7610-mergetool: prefer test_config over git config

Merge branch 'da/mergetool-temporary-filename'Junio C Hamano Tue, 21 Oct 2014 20:28:19 +0000 (13:28 -0700)

Merge branch 'da/mergetool-temporary-filename'

Tweak the names of the three throw-away files "git mergetool" comes
up with to feed the merge tool backend, so that a file with a
single dot in its name in the original (e.g. "hello.c") will have
only one dot in these variants (e.g. "hello_BASE_4321.c").

* da/mergetool-temporary-filename:
mergetool: use more conservative temporary filenames

Merge branch 'da/mergetool-tests'Junio C Hamano Tue, 21 Oct 2014 20:28:14 +0000 (13:28 -0700)

Merge branch 'da/mergetool-tests'

The clean-up of this test script was long overdue and is a very
welcome change.

* da/mergetool-tests:
test-lib-functions: adjust style to match CodingGuidelines
t7610-mergetool: use test_config to isolate tests
t7610-mergetool: add missing && and remove commented-out code
t7610-mergetool: use tabs instead of a mix of tabs and spaces

Merge branch 'rs/ref-transaction'Junio C Hamano Tue, 21 Oct 2014 20:28:10 +0000 (13:28 -0700)

Merge branch 'rs/ref-transaction'

The API to update refs have been restructured to allow introducing
a true transactional updates later. We would even allow storing
refs in backends other than the traditional filesystem-based one.

* rs/ref-transaction: (25 commits)
ref_transaction_commit: bail out on failure to remove a ref
lockfile: remove unable_to_lock_error
refs.c: do not permit err == NULL
remote rm/prune: print a message when writing packed-refs fails
for-each-ref: skip and warn about broken ref names
refs.c: allow listing and deleting badly named refs
test: put tests for handling of bad ref names in one place
packed-ref cache: forbid dot-components in refnames
branch -d: simplify by using RESOLVE_REF_READING
branch -d: avoid repeated symref resolution
reflog test: test interaction with detached HEAD
refs.c: change resolve_ref_unsafe reading argument to be a flags field
refs.c: make write_ref_sha1 static
fetch.c: change s_update_ref to use a ref transaction
refs.c: ref_transaction_commit: distinguish name conflicts from other errors
refs.c: pass a list of names to skip to is_refname_available
refs.c: call lock_ref_sha1_basic directly from commit
refs.c: refuse to lock badly named refs in lock_ref_sha1_basic
rename_ref: don't ask read_ref_full where the ref came from
refs.c: pass the ref log message to _create/delete/update instead of _commit
...

mergetool: rename bc3 to bcJunio C Hamano Mon, 20 Oct 2014 22:49:36 +0000 (15:49 -0700)

mergetool: rename bc3 to bc

Beyond Compare version 4 works the same way as version 3, so rename
the existing "bc3" adaptor to just "bc", while keeping "bc3" as a
backward compatible wrapper.

Noticed-by: Olivier Croquette <ocroquette@free.fr>
Helped-by: David Aguilar <davvid@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

dir.c: remove the second declaration of "stk" in prep_e... Nguyễn Thái Ngọc Duy Tue, 21 Oct 2014 11:38:06 +0000 (18:38 +0700)

dir.c: remove the second declaration of "stk" in prep_exclude()

This "stk" shadows the first declaration at the top. There's currently
no bad effect. But let's avoid it.

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

.mailmap: add Stefan Bellers corporate mail addressStefan Beller Tue, 21 Oct 2014 01:50:45 +0000 (18:50 -0700)

.mailmap: add Stefan Bellers corporate mail address

Note that despite the private address being first and primary,
Google owns the copyright on this patch as any other patch I'll be
sending signed off by the sbeller@google.com address.

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

transport: free leaking head in transport_print_push_st... Stefan Beller Tue, 21 Oct 2014 01:50:44 +0000 (18:50 -0700)

transport: free leaking head in transport_print_push_status()

Found by scan.coverity.com (ID: 1248110)

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

Update draft release notes to 2.2Junio C Hamano Mon, 20 Oct 2014 20:07:32 +0000 (13:07 -0700)

Update draft release notes to 2.2

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

Merge branch 'cc/interpret-trailers'Junio C Hamano Mon, 20 Oct 2014 19:25:30 +0000 (12:25 -0700)

Merge branch 'cc/interpret-trailers'

A new filter to programatically edit the tail end of the commit log
messages.

* cc/interpret-trailers:
Documentation: add documentation for 'git interpret-trailers'
trailer: add tests for commands in config file
trailer: execute command from 'trailer.<name>.command'
trailer: add tests for "git interpret-trailers"
trailer: add interpret-trailers command
trailer: put all the processing together and print
trailer: parse trailers from file or stdin
trailer: process command line trailer arguments
trailer: read and process config information
trailer: process trailers from input message and arguments
trailer: add data structures and basic functions

Merge branch 'rm/gitweb-start-form'Junio C Hamano Mon, 20 Oct 2014 19:25:27 +0000 (12:25 -0700)

Merge branch 'rm/gitweb-start-form'

* rm/gitweb-start-form:
gitweb: use start_form, not startform that was removed in CGI.pm 4.04

Merge branch 'ss/contrib-subtree-contacts'Junio C Hamano Mon, 20 Oct 2014 19:25:15 +0000 (12:25 -0700)

Merge branch 'ss/contrib-subtree-contacts'

* ss/contrib-subtree-contacts:
contacts: add a Makefile to generate docs and install
subtree: add an install-html target

Merge branch 'jn/parse-config-slot'Junio C Hamano Mon, 20 Oct 2014 19:23:48 +0000 (12:23 -0700)

Merge branch 'jn/parse-config-slot'

Code cleanup.

* jn/parse-config-slot:
color_parse: do not mention variable name in error message
pass config slots as pointers instead of offsets

Merge branch 'rs/receive-pack-argv-leak-fix'Junio C Hamano Mon, 20 Oct 2014 19:23:45 +0000 (12:23 -0700)

Merge branch 'rs/receive-pack-argv-leak-fix'

* rs/receive-pack-argv-leak-fix:
receive-pack: plug minor memory leak in unpack()

Merge branch 'ta/config-set'Junio C Hamano Mon, 20 Oct 2014 19:23:42 +0000 (12:23 -0700)

Merge branch 'ta/config-set'

* ta/config-set:
t1308: fix broken here document in test script

Merge branch 'jk/test-shell-trace'Junio C Hamano Mon, 20 Oct 2014 19:23:40 +0000 (12:23 -0700)

Merge branch 'jk/test-shell-trace'

Test scripts were taught to notice "-x" option to show shell trace,
as if the tests were run under "sh -x".

* jk/test-shell-trace:
test-lib.sh: support -x option for shell-tracing
t5304: use helper to report failure of "test foo = bar"
t5304: use test_path_is_* instead of "test -f"

Merge branch 'bc/asciidoc'Junio C Hamano Mon, 20 Oct 2014 19:23:29 +0000 (12:23 -0700)

Merge branch 'bc/asciidoc'

Formatting nitpicks to help a (pickier) reimplementation of
AsciiDoc to grok our documentation.

* bc/asciidoc:
Documentation: fix mismatched delimiters in git-imap-send
Documentation: adjust document title underlining

Revert "archive: honor tar.umask even for pax headers"Junio C Hamano Mon, 20 Oct 2014 19:04:46 +0000 (12:04 -0700)

Revert "archive: honor tar.umask even for pax headers"

This reverts commit 10f343ea814f5c18a0913997904ee11cd9b7da24, whose
output is no longer bit-for-bit equivalent from the older versions
of Git, which the infrastructure to (pretend to) upload tarballs
kernel.org uses depends on.

core.filemode may need manual actionTorsten Bögershausen Fri, 17 Oct 2014 21:40:23 +0000 (23:40 +0200)

core.filemode may need manual action

core.filemode is set automatically when a repo is created.
But when a repo is exported via CIFS or cygwin is mixed with Git for Windows
or Eclipse core.filemode may better be set manually to false.
Update and improve the documentation

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

doc: fix 'git status --help' character quotingPhilip Oakley Sun, 19 Oct 2014 14:17:15 +0000 (15:17 +0100)

doc: fix 'git status --help' character quoting

Correct backtick quoting for some of the modification states to give
consistent web rendering.

Signed-off-by: Philip Oakley <philipoakley@iee.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

t1304: Set LOGNAME even if USER is unset or nullW. Trevor King Fri, 17 Oct 2014 21:39:00 +0000 (14:39 -0700)

t1304: Set LOGNAME even if USER is unset or null

Avoid:

# ./t1304-default-acl.sh
ok 1 - checking for a working acl setup
ok 2 - Setup test repo
not ok 3 - Objects creation does not break ACLs with restrictive umask
#
# # SHA1 for empty blob
# check_perms_and_acl .git/objects/e6/9de29bb2d1d6434b8b29ae775ad8c2e48c5391
#
not ok 4 - git gc does not break ACLs with restrictive umask
#
# git gc &&
# check_perms_and_acl .git/objects/pack/*.pack
#
# failed 2 among 4 test(s)
1..4

on systems where USER isn't set. It's usually set by the login
process, but it isn't set when launching some Docker images. For
example:

$ docker run --rm debian env
HOME=/
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
HOSTNAME=b2dfdfe797ed

'id -u -n' has been in POSIX from Issue 2 through 2013 [1], so I don't
expect compatibility issues.

[1]: http://pubs.opengroup.org/onlinepubs/9699919799/utilities/id.html

Signed-off-by: W. Trevor King <wking@tremily.us>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Handle atexit list internaly for unthreaded buildsEtienne Buira Sat, 18 Oct 2014 12:31:15 +0000 (14:31 +0200)

Handle atexit list internaly for unthreaded builds

Wrap atexit()s calls on unthreaded builds to handle callback list
internally.

This is needed because on unthreaded builds, asyncs inherits parent's
atexit() list, that gets run as soon as the async exit()s (and again at
the end of async's parent process). That led to remove temporary files
too early.

Also remove a by-atexit-callback guard against this kind of issue in
clone.c, as this patch makes it redundant.

Fixes test 5537 (temporary shallow file vanished before unpack-objects
could open it)

BTW remove an unused variable in shallow.c.

Helped-by: Duy Nguyen <pclouds@gmail.com>
Helped-by: Andreas Schwab <schwab@linux-m68k.org>
Helped-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Etienne Buira <etienne.buira@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

drop add_object_array_with_modeJeff King Sun, 19 Oct 2014 02:03:19 +0000 (22:03 -0400)

drop add_object_array_with_mode

This is a thin compatibility wrapper around
add_pending_object_with_path. But the only caller is
add_object_array, which is itself just a thin compatibility
wrapper. There are no external callers, so we can just
remove this middle wrapper.

Noticed-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

revision: remove definition of unused 'add_object'... Ramsay Jones Sat, 18 Oct 2014 21:36:12 +0000 (22:36 +0100)

revision: remove definition of unused 'add_object' function

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

use env_array member of struct child_processRené Scharfe Sun, 19 Oct 2014 11:14:20 +0000 (13:14 +0200)

use env_array member of struct child_process

Convert users of struct child_process to using the managed env_array for
specifying environment variables instead of supplying an array on the
stack or bringing their own argv_array. This shortens and simplifies
the code and ensures automatically that the allocated memory is freed
after use.

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

run-command: add env_array, an optional argv_array... René Scharfe Sun, 19 Oct 2014 11:13:55 +0000 (13:13 +0200)

run-command: add env_array, an optional argv_array for env

Similar to args, add a struct argv_array member to struct child_process
that simplifies specifying the environment for children. It is freed
automatically by finish_command() or if start_command() encounters an
error.

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

pack-objects: turn off bitmaps when we split packsJeff King Fri, 17 Oct 2014 01:11:43 +0000 (21:11 -0400)

pack-objects: turn off bitmaps when we split packs

If a pack.packSizeLimit is set, we may split the pack data
across multiple packfiles. This means we cannot generate
.bitmap files, as they require that all of the reachable
objects are in the same pack. We check that condition when
we are generating the list of objects to pack (and disable
bitmaps if we are not packing everything), but we forgot to
update it when we notice that we needed to split (which
doesn't happen until the actual write phase).

The resulting bitmaps are quite bogus (they mention entries
that do not exist in the pack!) and can cause a fetch or
push to send insufficient objects.

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

pack-objects: double-check options before discarding... Jeff King Fri, 17 Oct 2014 00:44:54 +0000 (20:44 -0400)

pack-objects: double-check options before discarding objects

When we are given an expiration time like
--unpack-unreachable=2.weeks.ago, we avoid writing out old,
unreachable loose objects entirely, under the assumption
that running "prune" would simply delete them immediately
anyway. However, this is only valid if we computed the same
set of reachable objects as prune would.

In practice, this is the case, because only git-repack uses
the --unpack-unreachable option with an expiration, and it
always feeds as many objects into the pack as possible. But
we can double-check at runtime just to be sure.

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

repack: pack objects mentioned by the indexJeff King Fri, 17 Oct 2014 00:44:49 +0000 (20:44 -0400)

repack: pack objects mentioned by the index

When we pack all objects, we use only the objects reachable
from references and reflogs. This misses any objects which
are reachable from the index, but not yet referenced.

By itself this isn't a big deal; the objects can remain
loose until they are actually used in a commit. However, it
does create a problem when we drop packed but unreachable
objects. We try to optimize out the writing of objects that
we will immediately prune, which means we must follow the
same rules as prune in determining what is reachable. And
prune uses the index for this purpose.

This is rather uncommon in practice, as objects in the index
would not usually have been packed in the first place. But
it could happen in a sequence like:

1. You make a commit on a branch that references blob X.

2. You repack, moving X into the pack.

3. You delete the branch (and its reflog), so that X is
unreferenced.

4. You "git add" blob X so that it is now referenced only
by the index.

5. You repack again with git-gc. The pack-objects we
invoke will see that X is neither referenced nor
recent and not bother loosening it.

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

pack-objects: use argv_arrayJeff King Fri, 17 Oct 2014 00:44:35 +0000 (20:44 -0400)

pack-objects: use argv_array

This saves us from having to bump the rp_av count when we
add new traversal options.

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

reachable: use revision machinery's --indexed-objects... Jeff King Fri, 17 Oct 2014 00:44:30 +0000 (20:44 -0400)

reachable: use revision machinery's --indexed-objects code

This does the same thing as our custom code, so let's not
repeat ourselves.

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

rev-list: add --indexed-objects optionJeff King Fri, 17 Oct 2014 00:44:23 +0000 (20:44 -0400)

rev-list: add --indexed-objects option

There is currently no easy way to ask the revision traversal
machinery to include objects reachable from the index (e.g.,
blobs and trees that have not yet been committed). This
patch adds an option to do so.

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

rev-list: document --reflog optionJeff King Wed, 15 Oct 2014 22:43:28 +0000 (18:43 -0400)

rev-list: document --reflog option

This is mostly used internally, but it does not hurt to
explain it.

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

t5516: test pushing a tag of an otherwise unreferenced... Jeff King Fri, 17 Oct 2014 00:03:41 +0000 (20:03 -0400)

t5516: test pushing a tag of an otherwise unreferenced blob

It's not unreasonable to have a tag that points to a blob
that is not part of the normal history. We do this in
git.git to distribute gpg keys. However, we never explicitly
checked in our test suite that this actually works (i.e.,
that pack-objects actually sends the blob because of the tag
mentioning it).

It does in fact work fine, but a recent patch under
discussion broke this, and the test suite didn't notice.
Let's make the test suite more complete.

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

traverse_commit_list: support pending blobs/trees with... Jeff King Wed, 15 Oct 2014 22:43:19 +0000 (18:43 -0400)

traverse_commit_list: support pending blobs/trees with paths

When we call traverse_commit_list, we may have trees and
blobs in the pending array. As we process these, we pass the
"name" field from the pending entry as the path of the
object within the tree (which then becomes the root path if
we recurse into subtrees).

When we set up the traversal in prepare_revision_walk,
though, the "name" field of any pending trees and blobs is
likely to be the ref at which we found the object. We would
not want to make this part of the path (e.g., doing so would
make "git rev-list --objects v2.6.11-tree" in linux.git show
paths like "v2.6.11-tree/Makefile", which is nonsensical).
Therefore prepare_revision_walk sets the name field of each
pending tree and blobs to the empty string.

However, this leaves no room for a caller who does know the
correct path of a pending object to propagate that
information to the revision walker. We can fix this by
making two related changes:

1. Use the "path" field as the path instead of the "name"
field in traverse_commit_list. If the path is not set,
default to "" (which is what we always ended up with in
the current code, because of prepare_revision_walk).

2. In prepare_revision_walk, make a complete copy of the
entry. This makes the path field available to the
walker (if there is one), solving our problem.
Leaving the name field intact is now OK, as we do not
use it as a path due to point (1) above (and we can use
it to make more meaningful error messages if we want).
We also make the original "mode" field available to the
walker, though it does not actually use it.

Note that we still re-add the pending objects and free the
old ones (so we may strdup the path and name only to free
the old ones). This could be made more efficient by simply
copying the object_array entries that we are keeping.
However, that would require more restructuring of the code,
and is not done here.

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