gitweb.git
Merge branch 'jc/cvsserver-perm-bit-fix' into maintJunio C Hamano Thu, 17 Oct 2013 22:45:57 +0000 (15:45 -0700)

Merge branch 'jc/cvsserver-perm-bit-fix' into maint

* jc/cvsserver-perm-bit-fix:
cvsserver: pick up the right mode bits

Merge branch 'js/add-i-mingw' into maintJunio C Hamano Thu, 17 Oct 2013 22:45:56 +0000 (15:45 -0700)

Merge branch 'js/add-i-mingw' into maint

* js/add-i-mingw:
add--interactive: fix external command invocation on Windows

Merge branch 'nd/git-dir-pointing-at-gitfile' into... Junio C Hamano Thu, 17 Oct 2013 22:45:55 +0000 (15:45 -0700)

Merge branch 'nd/git-dir-pointing-at-gitfile' into maint

* nd/git-dir-pointing-at-gitfile:
Make setup_git_env() resolve .git file when $GIT_DIR is not specified

Merge branch 'jk/has-sha1-file-retry-packed' into maintJunio C Hamano Thu, 17 Oct 2013 22:45:54 +0000 (15:45 -0700)

Merge branch 'jk/has-sha1-file-retry-packed' into maint

* jk/has-sha1-file-retry-packed:
has_sha1_file: re-check pack directory before giving up

Merge branch 'ap/commit-author-mailmap' into maintJunio C Hamano Thu, 17 Oct 2013 22:45:51 +0000 (15:45 -0700)

Merge branch 'ap/commit-author-mailmap' into maint

* ap/commit-author-mailmap:
commit: search author pattern against mailmap

Merge branch 'es/rebase-i-no-abbrev' into maintJunio C Hamano Thu, 17 Oct 2013 22:45:50 +0000 (15:45 -0700)

Merge branch 'es/rebase-i-no-abbrev' into maint

* es/rebase-i-no-abbrev:
rebase -i: fix short SHA-1 collision
t3404: rebase -i: demonstrate short SHA-1 collision
t3404: make tests more self-contained

Conflicts:
t/t3404-rebase-interactive.sh

Merge branch 'rt/rebase-p-no-merge-summary' into maintJunio C Hamano Thu, 17 Oct 2013 22:45:45 +0000 (15:45 -0700)

Merge branch 'rt/rebase-p-no-merge-summary' into maint

* rt/rebase-p-no-merge-summary:
rebase --preserve-merges: ignore "merge.log" config

Merge branch 'es/rebase-i-respect-core-commentchar... Junio C Hamano Thu, 17 Oct 2013 22:45:24 +0000 (15:45 -0700)

Merge branch 'es/rebase-i-respect-core-commentchar' into maint

* es/rebase-i-respect-core-commentchar:
rebase -i: fix cases ignoring core.commentchar

t4254: modernize testsSZEDER Gábor Wed, 16 Oct 2013 12:27:16 +0000 (14:27 +0200)

t4254: modernize tests

- Don't start tests with 'test $? = 0' to catch preparation done
outside the test_expect_success block.

- Move writing the bogus patch and the expected output into the
appropriate test_expect_success blocks.

- Use the test_must_fail helper instead of manually checking for
non-zero exit code.

- Use the debug-friendly test_path_is_file helper instead of 'test -f'.

- No space after '>'.

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

git-prune-packed.txt: fix reference to GIT_OBJECT_DIRECTORYSteffen Prohaska Mon, 23 Sep 2013 19:19:19 +0000 (21:19 +0200)

git-prune-packed.txt: fix reference to GIT_OBJECT_DIRECTORY

git-prune-packed operates on GIT_OBJECT_DIRECTORY, not
GIT_OBJECT_DIR.

Signed-off-by: Steffen Prohaska <prohaska@zib.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

clone --branch: refuse to clone if upstream repo is... Ralf Thielow Fri, 11 Oct 2013 16:49:02 +0000 (18:49 +0200)

clone --branch: refuse to clone if upstream repo is empty

Since 920b691 (clone: refuse to clone if --branch
points to bogus ref) we refuse to clone with option
"-b" if the specified branch does not exist in the
(non-empty) upstream. If the upstream repository is empty,
the branch doesn't exist, either. So refuse the clone too.

Reported-by: Robert Mitwicki <robert.mitwicki@opensoftware.pl>
Signed-off-by: Ralf Thielow <ralf.thielow@gmail.com>
Acked-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>

Git 1.8.4.1 v1.8.4.1Jonathan Nieder Thu, 26 Sep 2013 22:01:41 +0000 (15:01 -0700)

Git 1.8.4.1

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>

Merge branch 'mm/rebase-continue-freebsd-WB' into maintJonathan Nieder Thu, 26 Sep 2013 19:41:14 +0000 (12:41 -0700)

Merge branch 'mm/rebase-continue-freebsd-WB' into maint

* mm/rebase-continue-freebsd-WB:
rebase: fix run_specific_rebase's use of "return" on FreeBSD

Merge branch 'km/svn-1.8-serf-only' into maintJonathan Nieder Thu, 26 Sep 2013 19:34:23 +0000 (12:34 -0700)

Merge branch 'km/svn-1.8-serf-only' into maint

* km/svn-1.8-serf-only:
Git.pm: revert _temp_cache use of temp_is_locked
git-svn: allow git-svn fetching to work using serf
Git.pm: add new temp_is_locked function

Merge branch 'js/xread-in-full' into maintJonathan Nieder Thu, 26 Sep 2013 19:30:44 +0000 (12:30 -0700)

Merge branch 'js/xread-in-full' into maint

* js/xread-in-full:
stream_to_pack: xread does not guarantee to read all requested bytes

Merge branch 'bc/send-email-ssl-die-message-fix' into... Jonathan Nieder Thu, 26 Sep 2013 19:27:29 +0000 (12:27 -0700)

Merge branch 'bc/send-email-ssl-die-message-fix' into maint

* bc/send-email-ssl-die-message-fix:
send-email: don't call methods on undefined values

git-remote-mediawiki: bugfix for pages w/ >500 revisionsBenoit Person Tue, 24 Sep 2013 19:32:30 +0000 (21:32 +0200)

git-remote-mediawiki: bugfix for pages w/ >500 revisions

Mediawiki introduces a new API for queries w/ more than 500 results in
version 1.21. That change triggered an infinite loop while cloning a
mediawiki with such a page.

The latest API renamed and moved the "continuing" information in the
response, necessary to build the next query. The code failed to retrieve
that information but still detected that it was in a "continuing
query". As a result, it launched the same query over and over again.

If a "continuing" information is detected in the response (old or new),
the next query is updated accordingly. If not, we quit assuming it's not
a continuing query.

Reported-by: Benjamin Cathey
Signed-off-by: Benoit Person <benoit.person@gmail.com>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>

Start preparing for 1.8.4.1Junio C Hamano Wed, 18 Sep 2013 19:08:09 +0000 (12:08 -0700)

Start preparing for 1.8.4.1

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

Merge branch 'bc/completion-for-bash-3.0' into maintJunio C Hamano Wed, 18 Sep 2013 19:00:11 +0000 (12:00 -0700)

Merge branch 'bc/completion-for-bash-3.0' into maint

Some people still use rather old versions of bash, which cannot grok
some constructs like 'printf -v varname' the prompt and completion
code started to use recently.

* bc/completion-for-bash-3.0:
contrib/git-prompt.sh: handle missing 'printf -v' more gracefully
t9902-completion.sh: old Bash still does not support array+=('') notation
git-completion.bash: use correct Bash/Zsh array length syntax

Merge branch 'mm/no-shell-escape-in-die-message' into... Junio C Hamano Wed, 18 Sep 2013 18:59:50 +0000 (11:59 -0700)

Merge branch 'mm/no-shell-escape-in-die-message' into maint

Fixes a minor bug in "git rebase -i" (there could be others, as the
root cause is pretty generic) where the code feeds a random, data
dependeant string to 'echo' and expects it to come out literally.

* mm/no-shell-escape-in-die-message:
die_with_status: use "printf '%s\n'", not "echo"

Merge branch 'jl/some-submodule-config-are-not-boolean... Junio C Hamano Wed, 18 Sep 2013 18:59:35 +0000 (11:59 -0700)

Merge branch 'jl/some-submodule-config-are-not-boolean' into maint

* jl/some-submodule-config-are-not-boolean:
avoid segfault on submodule.*.path set to an empty "true"

Merge branch 'tr/log-full-diff-keep-true-parents' into... Junio C Hamano Wed, 18 Sep 2013 18:59:05 +0000 (11:59 -0700)

Merge branch 'tr/log-full-diff-keep-true-parents' into maint

Output from "git log --full-diff -- <pathspec>" looked strange,
because comparison was done with the previous ancestor that touched
the specified <pathspec>, causing the patches for paths outside the
pathspec to show more than the single commit has changed.

* tr/log-full-diff-keep-true-parents:
log: use true parents for diff when walking reflogs
log: use true parents for diff even when rewriting

Merge branch 'jc/transport-do-not-use-connect-twice... Junio C Hamano Wed, 18 Sep 2013 18:58:18 +0000 (11:58 -0700)

Merge branch 'jc/transport-do-not-use-connect-twice-in-fetch' into maint

The auto-tag-following code in "git fetch" tries to reuse the same
transport twice when the serving end does not cooperate and does
not give tags that point to commits that are asked for as part of
the primary transfer. Unfortunately, Git-aware transport helper
interface is not designed to be used more than once, hence this
does not work over smart-http transfer.

* jc/transport-do-not-use-connect-twice-in-fetch:
builtin/fetch.c: Fix a sparse warning
fetch: work around "transport-take-over" hack
fetch: refactor code that fetches leftover tags
fetch: refactor code that prepares a transport
fetch: rename file-scope global "transport" to "gtransport"
t5802: add test for connect helper

Merge branch 'sp/clip-read-write-to-8mb' into maintJunio C Hamano Wed, 18 Sep 2013 18:57:58 +0000 (11:57 -0700)

Merge branch 'sp/clip-read-write-to-8mb' into maint

Send a large request to read(2)/write(2) as a smaller but still
reasonably large chunks, which would improve the latency when the
operation needs to be killed and incidentally works around broken
64-bit systems that cannot take a 2GB write or read in one go.

* sp/clip-read-write-to-8mb:
Revert "compat/clipped-write.c: large write(2) fails on Mac OS X/XNU"
xread, xwrite: limit size of IO to 8MB

Merge branch 'jk/mailmap-incomplete-line' into maintJunio C Hamano Wed, 18 Sep 2013 18:57:32 +0000 (11:57 -0700)

Merge branch 'jk/mailmap-incomplete-line' into maint

* jk/mailmap-incomplete-line:
mailmap: handle mailmap blobs without trailing newlines

t7406-submodule-update: add missing &&Tay Ray Chuan Sun, 15 Sep 2013 17:38:21 +0000 (01:38 +0800)

t7406-submodule-update: add missing &&

322bb6e (2011 Aug 11) introduced a new subshell at the end of a test
case but omitted a '&&' to join the two; fix this.

Signed-off-by: Tay Ray Chuan <rctay89@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Merge branch 'maint' of git://github.com/git-l10n/git... Junio C Hamano Thu, 12 Sep 2013 04:12:02 +0000 (21:12 -0700)

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

* 'maint' of git://github.com/git-l10n/git-po:
l10n: de.po: use "das Tag" instead of "der Tag"

cvsserver: pick up the right mode bitsJunio C Hamano Tue, 10 Sep 2013 22:33:06 +0000 (15:33 -0700)

cvsserver: pick up the right mode bits

When determining the file mode from either ls-tree or diff-tree
output, we used to grab these octal mode string (typically 100644 or
100755) and then did

$git_perms .= "r" if ( $mode & 4 );
$git_perms .= "w" if ( $mode & 2 );
$git_perms .= "x" if ( $mode & 1 );

which was already wrong, as (100644 & 4) is very different from
oct("100644") & 4. An earlier refactoring 2c3af7e7 (cvsserver:
factor out git-log parsing logic, 2012-10-13) further changed it to
pick the third octal digit (10*0*644 or 10*0*755) from the left and
then do the above conversion, which does not make sense, either.

Let's use the third digit from the last of the octal mode string to
make sure we get the executable and read bits right.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
Tested-by: Michael Cronenworth <mike@cchtml.com>

send-email: don't call methods on undefined valuesBrian M. Carlson Sun, 8 Sep 2013 20:54:34 +0000 (20:54 +0000)

send-email: don't call methods on undefined values

If SSL verification is enabled in git send-email, we could attempt to call a
method on an undefined value if the verification failed, since $smtp would end
up being undef. Look up the error string in a way that will produce a helpful
error message and not cause further errors.

Signed-off-by: Brian M. Carlson <sandals@crustytoothpaste.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

rebase: fix run_specific_rebase's use of "return" on... Matthieu Moy Mon, 9 Sep 2013 08:53:15 +0000 (10:53 +0200)

rebase: fix run_specific_rebase's use of "return" on FreeBSD

Since a1549e10, git-rebase--am.sh uses the shell's "return" statement, to
mean "return from the current file inclusion", which is POSIXly correct,
but badly interpreted on FreeBSD, which returns from the current
function, hence skips the finish_rebase statement that follows the file
inclusion.

Make the use of "return" portable by using the file inclusion as the last
statement of a function.

Reported-by: Christoph Mallon <christoph.mallon@gmx.de>
Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

l10n: de.po: use "das Tag" instead of "der Tag"Ralf Thielow Sun, 8 Sep 2013 14:28:36 +0000 (16:28 +0200)

l10n: de.po: use "das Tag" instead of "der Tag"

Use "das Tag" to avoid confusion with the German word "Tag" (day).

Reported-by: Dirk Heinrichs <dirk.heinrichs@altum.de>
Signed-off-by: Ralf Thielow <ralf.thielow@gmail.com>

Merge branch 'nd/fetch-pack-shallow-fix' into maintJunio C Hamano Thu, 5 Sep 2013 21:40:58 +0000 (14:40 -0700)

Merge branch 'nd/fetch-pack-shallow-fix' into maint

The recent "short-cut clone connectivity check" topic broke a shallow
repository when a fetch operation tries to auto-follow tags.

* nd/fetch-pack-shallow-fix:
fetch-pack: do not remove .git/shallow file when --depth is not specified

Merge branch 'hv/config-from-blob' into maintJunio C Hamano Thu, 5 Sep 2013 21:40:18 +0000 (14:40 -0700)

Merge branch 'hv/config-from-blob' into maint

Compilation fix on platforms with fgetc() and friends defined as
macros.

* hv/config-from-blob:
config: do not use C function names as struct members

Merge branch 'maint-1.8.3' into maintJunio C Hamano Thu, 5 Sep 2013 21:24:59 +0000 (14:24 -0700)

Merge branch 'maint-1.8.3' into maint

* maint-1.8.3:
Documentation/git-merge.txt: fix formatting of example block

Merge branch 'maint-1.8.2' into maint-1.8.3Junio C Hamano Thu, 5 Sep 2013 21:24:52 +0000 (14:24 -0700)

Merge branch 'maint-1.8.2' into maint-1.8.3

* maint-1.8.2:
Documentation/git-merge.txt: fix formatting of example block

Documentation/git-merge.txt: fix formatting of example... Andreas Schwab Thu, 5 Sep 2013 15:12:45 +0000 (17:12 +0200)

Documentation/git-merge.txt: fix formatting of example block

You need at least four dashes in a line to have it recognized as listing
block delimiter by asciidoc.

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

add--interactive: fix external command invocation on... Johannes Sixt Wed, 4 Sep 2013 07:24:47 +0000 (09:24 +0200)

add--interactive: fix external command invocation on Windows

Back in 21e9757e (Hack git-add--interactive to make it work with
ActiveState Perl, 2007-08-01), the invocation of external commands was
changed to use qx{} on Windows. The rationale was that the command
interpreter on Windows is not a POSIX shell, but rather Windows's CMD.
That patch was wrong to include 'msys' in the check whether to use qx{}
or not: 'msys' identifies MSYS perl as shipped with Git for Windows,
which does not need the special treatment; qx{} should be used only with
ActiveState perl, which is identified by 'MSWin32'.

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

Merge git://github.com/git-l10n/git-po into maintJunio C Hamano Tue, 3 Sep 2013 20:58:03 +0000 (13:58 -0700)

Merge git://github.com/git-l10n/git-po into maint

* git://github.com/git-l10n/git-po:
l10n: fr.po: hotfix for commit 6b388fc

Merge branch 'maint-1.8.3' into maintJunio C Hamano Tue, 3 Sep 2013 20:54:32 +0000 (13:54 -0700)

Merge branch 'maint-1.8.3' into maint

* maint-1.8.3:
fix shell syntax error in template

Merge branch 'maint-1.8.2' into maint-1.8.3Junio C Hamano Tue, 3 Sep 2013 20:54:26 +0000 (13:54 -0700)

Merge branch 'maint-1.8.2' into maint-1.8.3

* maint-1.8.2:
fix shell syntax error in template

Make setup_git_env() resolve .git file when $GIT_DIR... Nguyễn Thái Ngọc Duy Sat, 31 Aug 2013 01:04:14 +0000 (08:04 +0700)

Make setup_git_env() resolve .git file when $GIT_DIR is not specified

This makes reinitializing on a .git file repository work.

This is probably the only case that setup_git_env() (via
set_git_dir()) is called on a .git file. Other cases in
setup_git_dir_gently() and enter_repo() both cover .git file case
explicitly because they need to verify the target repo is valid.

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

has_sha1_file: re-check pack directory before giving upJeff King Fri, 30 Aug 2013 19:14:13 +0000 (15:14 -0400)

has_sha1_file: re-check pack directory before giving up

When we read a sha1 file, we first look for a packed
version, then a loose version, and then re-check the pack
directory again before concluding that we cannot find it.
This lets us handle a process that is writing to the
repository simultaneously (e.g., receive-pack writing a new
pack followed by a ref update, or git-repack packing
existing loose objects into a new pack).

However, we do not do the same trick with has_sha1_file; we
only check the packed objects once, followed by loose
objects. This means that we might incorrectly report that we
do not have an object, even though we could find it if we
simply re-checked the pack directory.

By itself, this is usually not a big deal. The other process
is running simultaneously, so we may run has_sha1_file
before it writes, anyway. It is a race whether we see the
object or not. However, we may also see other things
the writing process has done (like updating refs); and in
that case, we must be able to also see the new objects.

For example, imagine we are doing a for_each_ref iteration,
and somebody simultaneously pushes. Receive-pack may write
the pack and update a ref after we have examined the
objects/pack directory, but before the iteration gets to the
updated ref. When we do finally see the updated ref,
for_each_ref will call has_sha1_file to check whether the
ref is broken. If has_sha1_file returns the wrong answer, we
erroneously will think that the ref is broken.

For a normal iteration without DO_FOR_EACH_INCLUDE_BROKEN,
this means that the caller does not see the ref at all
(neither the old nor the new value). So not only will we
fail to see the new value of the ref (which is acceptable,
since we are running simultaneously with the writer, and we
might well read the ref before the writer commits its
write), but we will not see the old value either. For
programs that act on reachability like pack-objects or
prune, this can cause data loss, as we may see the objects
referenced by the original ref value as dangling (and either
omit them from the pack, or delete them via prune).

There's no test included here, because the success case is
two processes running simultaneously forever. But you can
replicate the issue with:

# base.sh
# run this in one terminal; it creates and pushes
# repeatedly to a repository
git init parent &&
(cd parent &&

# create a base commit that will trigger us looking at
# the objects/pack directory before we hit the updated ref
echo content >file &&
git add file &&
git commit -m base &&

# set the unpack limit abnormally low, which
# lets us simulate full-size pushes using tiny ones
git config receive.unpackLimit 1
) &&
git clone parent child &&
cd child &&
n=0 &&
while true; do
echo $n >file && git add file && git commit -m $n &&
git push origin HEAD:refs/remotes/child/master &&
n=$(($n + 1))
done

# fsck.sh
# now run this simultaneously in another terminal; it
# repeatedly fscks, looking for us to consider the
# newly-pushed ref broken. We cannot use for-each-ref
# here, as it uses DO_FOR_EACH_INCLUDE_BROKEN, which
# skips the has_sha1_file check (and if it wants
# more information on the object, it will actually read
# the object, which does the proper two-step lookup)
cd parent &&
while true; do
broken=`git fsck 2>&1 | grep remotes/child`
if test -n "$broken"; then
echo $broken
exit 1
fi
done

Without this patch, the fsck loop fails within a few seconds
(and almost instantly if the test repository actually has a
large number of refs). With it, the two can run
indefinitely.

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

fix shell syntax error in templateThorsten Glaser Fri, 30 Aug 2013 10:40:30 +0000 (12:40 +0200)

fix shell syntax error in template

An if clause must not be empty; add a "colon" command.

Signed-off-by: Thorsten Glaser <t.glaser@tarent.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

l10n: fr.po: hotfix for commit 6b388fcSebastien Helleu Sun, 25 Aug 2013 09:45:13 +0000 (11:45 +0200)

l10n: fr.po: hotfix for commit 6b388fc

Fix many typos and add some new translations (1277/2080 messages
translated).

Closes git-l10n/git-po/pull/63.

Signed-off-by: Sebastien Helleu <flashcode@flashtux.org>
Signed-off-by: Jean-Noel Avila <jn.avila@free.fr>
Signed-off-by: Jiang Xin <worldhello.net@gmail.com>

builtin/fetch.c: Fix a sparse warningRamsay Jones Wed, 28 Aug 2013 18:56:17 +0000 (19:56 +0100)

builtin/fetch.c: Fix a sparse warning

Sparse issues an "'prepare_transport' was not declared. Should it
be static?" warning. In order to suppress the warning, since this
symbol only requires file scope, we simply add the static modifier
to it's declaration.

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

mailmap: handle mailmap blobs without trailing newlinesJeff King Wed, 28 Aug 2013 01:41:39 +0000 (21:41 -0400)

mailmap: handle mailmap blobs without trailing newlines

The read_mailmap_buf function reads each line of the mailmap
using strchrnul, like:

const char *end = strchrnul(buf, '\n');
unsigned long linelen = end - buf + 1;

But that's off-by-one when we actually hit the NUL byte; our
line does not have a terminator, and so is only "end - buf"
bytes long. As a result, when we subtract the linelen from
the total len, we end up with (unsigned long)-1 bytes left
in the buffer, and we start reading random junk from memory.

We could fix it with:

unsigned long linelen = end - buf + !!*end;

but let's take a step back for a moment. It's questionable
in the first place for a function that takes a buffer and
length to be using strchrnul. But it works because we only
have one caller (and are only likely to ever have this one),
which is handing us data from read_sha1_file. Which means
that it's always NUL-terminated.

Instead of tightening the assumptions to make the
buffer/length pair work for a caller that doesn't actually
exist, let's let loosen the assumptions to what the real
caller has: a modifiable, NUL-terminated string.

This makes the code simpler and shorter (because we don't
have to correlate strchrnul with the length calculation),
correct (because the code with the off-by-one just goes
away), and more efficient (we can drop the extra allocation
we needed to create NUL-terminated strings for each line,
and just terminate in place).

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

config: do not use C function names as struct membersJeff King Mon, 26 Aug 2013 21:57:18 +0000 (17:57 -0400)

config: do not use C function names as struct members

According to C99, section 7.1.4:

Any function declared in a header may be additionally
implemented as a function-like macro defined in the
header.

Therefore calling our struct member function pointer "fgetc"
may run afoul of unwanted macro expansion when we call:

char c = cf->fgetc(cf);

This turned out to be a problem on uclibc, which defines
fgetc as a macro and causes compilation failure.

The standard suggests fixing this in a few ways:

1. Using extra parentheses to inhibit the function-like
macro expansion. E.g., "(cf->fgetc)(cf)". This is
undesirable as it's ugly, and each call site needs to
remember to use it (and on systems without the macro,
forgetting will compile just fine).

2. Using #undef (because a conforming implementation must
also be providing fgetc as a function). This is
undesirable because presumably the implementation was
using the macro for a performance benefit, and we are
dropping that optimization.

Instead, we can simply use non-colliding names.

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

rebase -i: fix short SHA-1 collisionJunio C Hamano Sat, 24 Aug 2013 00:10:42 +0000 (20:10 -0400)

rebase -i: fix short SHA-1 collision

The 'todo' sheet for interactive rebase shows abbreviated SHA-1's and
then performs its operations upon those shortened values. This can lead
to an abort if the SHA-1 of a reworded or edited commit is no longer
unique within the abbreviated SHA-1 space and a subsequent SHA-1 in the
todo list has the same abbreviated value.

For example:

edit f00dfad first
pick badbeef second

If, after editing, the new SHA-1 of "first" also has prefix badbeef,
then the subsequent 'pick badbeef second' will fail since badbeef is no
longer a unique SHA-1 abbreviation:

error: short SHA1 badbeef is ambiguous.
fatal: Needed a single revision
Invalid commit name: badbeef

Fix this problem by expanding the SHA-1's in the todo list before
performing the operations.

[es: also collapse & expand SHA-1's for --edit-todo; respect
core.commentchar in transform_todo_ids(); compose commit message]

Signed-off-by: Eric Sunshine <sunshine@sunshineco.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

t3404: rebase -i: demonstrate short SHA-1 collisionEric Sunshine Sat, 24 Aug 2013 00:10:41 +0000 (20:10 -0400)

t3404: rebase -i: demonstrate short SHA-1 collision

The 'todo' sheet for interactive rebase shows abbreviated SHA-1's and
then performs its operations upon those shortened values. This can lead
to an abort if the SHA-1 of a reworded or edited commit is no longer
unique within the abbreviated SHA-1 space and a subsequent SHA-1 in the
todo list has the same abbreviated value.

For example:

edit f00dfad first
pick badbeef second

If, after editing, the new SHA-1 of "first" also has prefix badbeef,
then the subsequent 'pick badbeef second' will fail since badbeef is no
longer a unique SHA-1 abbreviation:

error: short SHA1 badbeef is ambiguous.
fatal: Needed a single revision
Invalid commit name: badbeef

Demonstrate this problem with a couple of specially crafted commits
which initially have distinct abbreviated SHA-1's, but for which the
abbreviated SHA-1's collide after a simple rewording of the first
commit's message.

Signed-off-by: Eric Sunshine <sunshine@sunshineco.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

t3404: make tests more self-containedEric Sunshine Sat, 24 Aug 2013 00:10:40 +0000 (20:10 -0400)

t3404: make tests more self-contained

As its very first action, t3404 installs (via set_fake_editor) a
specialized $EDITOR which simplifies automated 'rebase -i' testing. Many
tests rely upon this setting, thus tests which need a different editor
must take extra care upon completion to restore $EDITOR in order to
avoid breaking following tests. This places extra burden upon such tests
and requires that they undesirably have extra knowledge about
surrounding tests. Ease this burden by having each test install the
$EDITOR it requires, rather than relying upon a global setting.

Signed-off-by: Eric Sunshine <sunshine@sunshineco.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

fetch-pack: do not remove .git/shallow file when -... Nguyễn Thái Ngọc Duy Mon, 26 Aug 2013 02:17:26 +0000 (09:17 +0700)

fetch-pack: do not remove .git/shallow file when --depth is not specified

fetch_pack() can remove .git/shallow file when a shallow repository
becomes a full one again. This behavior is triggered incorrectly when
tags are also fetched because fetch_pack() will be called twice. At
the first fetch_pack() call:

- shallow_lock is set up
- alternate_shallow_file points to shallow_lock.filename, which is
"shallow.lock"
- commit_lock_file is called, which sets shallow_lock.filename to "".
alternate_shallow_file also becomes "" because it points to the
same memory.

At the second call, setup_alternate_shallow() is not called and
alternate_shallow_file remains "". It's mistaken as unshallow case and
.git/shallow is removed. The end result is a broken repository.

Fix this by always initializing alternate_shallow_file when
fetch_pack() is called. As an extra measure, check if args->depth > 0
before commit/rollback shallow file.

Reported-by: Kacper Kornet <kornet@camk.edu.pl>
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

commit: search author pattern against mailmapAntoine Pelisse Fri, 23 Aug 2013 13:48:31 +0000 (15:48 +0200)

commit: search author pattern against mailmap

"git commit --author=$name" sets the author to one whose name
matches the given string from existing commits, when $name is not in
the "Name <e-mail>" format. However, it does not honor the mailmap
to use the canonical name for the author found this way.

Fix it by telling the logic to find a matching existing author to
honor the mailmap, and use the name and email after applying the
mailmap.

Signed-off-by: Antoine Pelisse <apelisse@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Git 1.8.4 v1.8.4Junio C Hamano Fri, 23 Aug 2013 18:49:46 +0000 (11:49 -0700)

Git 1.8.4

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

contrib/git-prompt.sh: handle missing 'printf -v' more... Brandon Casey Thu, 22 Aug 2013 01:39:03 +0000 (18:39 -0700)

contrib/git-prompt.sh: handle missing 'printf -v' more gracefully

Old Bash (3.0) which is distributed with RHEL 4.X and other ancient
platforms that are still in wide use, do not have a printf that
supports -v. Neither does Zsh (which is already handled in the code).

As suggested by Junio, let's test whether printf supports the -v
option and store the result. Then later, we can use it to
determine whether 'printf -v' can be used, or whether printf
must be called in a subshell.

Signed-off-by: Brandon Casey <drafnel@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

t9902-completion.sh: old Bash still does not support... Brandon Casey Wed, 21 Aug 2013 20:49:32 +0000 (13:49 -0700)

t9902-completion.sh: old Bash still does not support array+=('') notation

Old Bash (3.0) which is distributed with RHEL 4.X and other ancient
platforms that are still in wide use, does not understand the
array+=() notation. Let's use an explicit assignment to the new array
element which works everywhere, like:

array[${#array[@]}+1]=''

The right-hand side '' is not strictly necessary, but in this case
I think it is more clear.

Signed-off-by: Brandon Casey <drafnel@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

git-completion.bash: use correct Bash/Zsh array length... Brandon Casey Wed, 21 Aug 2013 20:49:31 +0000 (13:49 -0700)

git-completion.bash: use correct Bash/Zsh array length syntax

The syntax for retrieving the number of elements in an array is:

${#name[@]}

Signed-off-by: Brandon Casey <drafnel@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

rebase --preserve-merges: ignore "merge.log" configRalf Thielow Wed, 21 Aug 2013 18:48:57 +0000 (20:48 +0200)

rebase --preserve-merges: ignore "merge.log" config

When "merge.log" config is set, "rebase --preserve-merges" will add
the log lines to the message of the rebased merge commit. A rebase
should not modify a commit message automatically.

Teach "git-rebase" to ignore that configuration by passing
"--no-log" to the git-merge call.

Signed-off-by: Ralf Thielow <ralf.thielow@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Typofix draft release notes to 1.8.4Junio C Hamano Wed, 21 Aug 2013 22:30:04 +0000 (15:30 -0700)

Typofix draft release notes to 1.8.4

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

stream_to_pack: xread does not guarantee to read all... Johannes Sixt Tue, 20 Aug 2013 09:15:26 +0000 (11:15 +0200)

stream_to_pack: xread does not guarantee to read all requested bytes

The deflate loop in bulk-checkin::stream_to_pack expects to get all bytes
from a file that it requests to read in a single function call. But it
used xread(), which does not give that guarantee. Replace it by
read_in_full().

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

Revert "compat/clipped-write.c: large write(2) fails... Steffen Prohaska Tue, 20 Aug 2013 06:43:55 +0000 (08:43 +0200)

Revert "compat/clipped-write.c: large write(2) fails on Mac OS X/XNU"

This reverts commit 6c642a878688adf46b226903858b53e2d31ac5c3.

The previous commit introduced a size limit on IO chunks on all
platforms. The compat clipped_write() is not needed anymore.

Signed-off-by: Steffen Prohaska <prohaska@zib.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

xread, xwrite: limit size of IO to 8MBSteffen Prohaska Tue, 20 Aug 2013 06:43:54 +0000 (08:43 +0200)

xread, xwrite: limit size of IO to 8MB

Checking out 2GB or more through an external filter (see test) fails
on Mac OS X 10.8.4 (12E55) for a 64-bit executable with:

error: read from external filter cat failed
error: cannot feed the input to external filter cat
error: cat died of signal 13
error: external filter cat failed 141
error: external filter cat failed

The reason is that read() immediately returns with EINVAL when asked
to read more than 2GB. According to POSIX [1], if the value of
nbyte passed to read() is greater than SSIZE_MAX, the result is
implementation-defined. The write function has the same restriction
[2]. Since OS X still supports running 32-bit executables, the
32-bit limit (SSIZE_MAX = INT_MAX = 2GB - 1) seems to be also
imposed on 64-bit executables under certain conditions. For write,
the problem has been addressed earlier [6c642a].

Address the problem for read() and write() differently, by limiting
size of IO chunks unconditionally on all platforms in xread() and
xwrite(). Large chunks only cause problems, like causing latencies
when killing the process, even if OS X was not buggy. Doing IO in
reasonably sized smaller chunks should have no negative impact on
performance.

The compat wrapper clipped_write() introduced earlier [6c642a] is
not needed anymore. It will be reverted in a separate commit. The
new test catches read and write problems.

Note that 'git add' exits with 0 even if it prints filtering errors
to stderr. The test, therefore, checks stderr. 'git add' should
probably be changed (sometime in another commit) to exit with
nonzero if filtering fails. The test could then be changed to use
test_must_fail.

Thanks to the following people for suggestions and testing:

Johannes Sixt <j6t@kdbg.org>
John Keeping <john@keeping.me.uk>
Jonathan Nieder <jrnieder@gmail.com>
Kyle J. McKay <mackyle@gmail.com>
Linus Torvalds <torvalds@linux-foundation.org>
Torsten Bögershausen <tboegi@web.de>

[1] http://pubs.opengroup.org/onlinepubs/009695399/functions/read.html
[2] http://pubs.opengroup.org/onlinepubs/009695399/functions/write.html

[6c642a] commit 6c642a878688adf46b226903858b53e2d31ac5c3
compate/clipped-write.c: large write(2) fails on Mac OS X/XNU

Signed-off-by: Steffen Prohaska <prohaska@zib.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

avoid segfault on submodule.*.path set to an empty... Jharrod LaFon Mon, 19 Aug 2013 16:26:56 +0000 (09:26 -0700)

avoid segfault on submodule.*.path set to an empty "true"

Git fails due to a segmentation fault if a submodule path is empty.
Here is an example .gitmodules that will cause a segmentation fault:

[submodule "foo-module"]
path
url = http://host/repo.git
$ git status
Segmentation fault (core dumped)

This is because the parsing of "submodule.*.path" is not prepared to
see a value-less "true" and assumes that the value is always
non-NULL (parsing of "ignore" has the same problem).

Fix it by checking the NULL-ness of value and complain with
config_error_nonbool().

Signed-off-by: Jharrod LaFon <jlafon@eyesopen.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Git 1.8.4-rc4 v1.8.4-rc4Junio C Hamano Mon, 19 Aug 2013 17:34:14 +0000 (10:34 -0700)

Git 1.8.4-rc4

As we had to revert two topics at the last minute, let's have
another (hopefully short) round of rc to make sure the final release
will be sound.

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

rebase -i: fix cases ignoring core.commentcharEric Sunshine Fri, 16 Aug 2013 21:44:07 +0000 (17:44 -0400)

rebase -i: fix cases ignoring core.commentchar

180bad3d (rebase -i: respect core.commentchar, 2013-02-11) updated
"rebase -i" to honor core.commentchar but missed one instance of
hard-coded '#' comment character in skip_unnecessary_picks().

Signed-off-by: Eric Sunshine <sunshine@sunshineco.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Revert "Add new @ shortcut for HEAD"Junio C Hamano Wed, 14 Aug 2013 17:57:24 +0000 (10:57 -0700)

Revert "Add new @ shortcut for HEAD"

This reverts commit cdfd94837b27c220f70f032b596ea993d195488f, as it
does not just apply to "@" (and forms with modifiers like @{u}
applied to it), but also affects e.g. "refs/heads/@/foo", which it
shouldn't.

The basic idea of giving a short-hand might be good, and the topic
can be retried later, but let's revert to avoid affecting existing
use cases for now for the upcoming release.

Revert "git stash: avoid data loss when "git stash... Junio C Hamano Wed, 14 Aug 2013 16:53:43 +0000 (09:53 -0700)

Revert "git stash: avoid data loss when "git stash save" kills a directory"

This reverts commit a73653130edd6a8977106d45a8092c09040f9132, as it
has been reported that "ls-files --killed" is too time-consuming in
a deep directory with too many untracked crufts (e.g. $HOME/.git
tracking only a few files).

We'd need to revisit it later but "ls-files --killed" needs to be
optimized before it happens.

Git 1.8.4-rc3 v1.8.4-rc3Junio C Hamano Tue, 13 Aug 2013 18:10:18 +0000 (11:10 -0700)

Git 1.8.4-rc3

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

Merge git://github.com/git-l10n/git-poJunio C Hamano Tue, 13 Aug 2013 17:50:01 +0000 (10:50 -0700)

Merge git://github.com/git-l10n/git-po

* git://github.com/git-l10n/git-po:
l10n: Add reference for french translation team
l10n: fr.po: 821/2112 messages translated

Merge branch 'sb/mailmap-updates'Junio C Hamano Tue, 13 Aug 2013 17:49:33 +0000 (10:49 -0700)

Merge branch 'sb/mailmap-updates'

* sb/mailmap-updates:
.mailmap: Combine more (name, email) to individual persons
.mailmap: update long-lost friends with multiple defunct addresses

.mailmap: Combine more (name, email) to individual... Stefan Beller Mon, 12 Aug 2013 08:12:09 +0000 (10:12 +0200)

.mailmap: Combine more (name, email) to individual persons

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

.mailmap: update long-lost friends with multiple defunc... Junio C Hamano Mon, 12 Aug 2013 07:58:11 +0000 (00:58 -0700)

.mailmap: update long-lost friends with multiple defunct addresses

A handful of past contributors are recorded with multiple e-mail
addresses, all of which are undeliverable. With a lot of help from
Jonathan, we located all of them except for one person, and a pair
of addresses we suspect belong to a single person but we are not
certain.

Update the found ones with their currently preferred address, and
use the last known address to consolidate contributions by the lost
one.

Helped-by: Stefan Beller <stefanbeller@googlemail.com>
Helped-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

git-remote-mediawiki: ignore generated git-mwMatthieu Moy Tue, 13 Aug 2013 13:32:19 +0000 (15:32 +0200)

git-remote-mediawiki: ignore generated git-mw

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

l10n: Add reference for french translation teamJean-Noel Avila Fri, 9 Aug 2013 22:30:55 +0000 (00:30 +0200)

l10n: Add reference for french translation team

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

l10n: fr.po: 821/2112 messages translatedJean-Noel Avila Mon, 1 Jul 2013 20:19:04 +0000 (22:19 +0200)

l10n: fr.po: 821/2112 messages translated

Trying to focus on most useful phrases.

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

Merge branch 'maint'Junio C Hamano Fri, 9 Aug 2013 22:49:55 +0000 (15:49 -0700)

Merge branch 'maint'

* maint:
parse-options: fix clang opterror() -Wunused-value warning

Merge branch 'master' of git://github.com/git-l10n... Junio C Hamano Fri, 9 Aug 2013 21:31:28 +0000 (14:31 -0700)

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

* 'master' of git://github.com/git-l10n/git-po:
l10n: de.po: translate 5 messages
l10n: de.po: translate 99 new messages
l10n: de.po: switch from pure German to German+English
l10n: de.po: Fix a typo
l10n: Update Swedish translation (2135t0f0u)
l10n: zh_CN.po: translate 5 messages (2135t0f0u)
l10n: vi.po(2135t): v1.8.4 round 2
l10n: git.pot: v1.8.4 round 2 (5 new, 3 removed)

Merge branch 'jk/submodule-subdirectory-ok'Junio C Hamano Fri, 9 Aug 2013 21:30:41 +0000 (14:30 -0700)

Merge branch 'jk/submodule-subdirectory-ok'

* jk/submodule-subdirectory-ok:
t/t7407: fix two typos in submodule tests

Merge branch 'sb/mailmap-updates'Junio C Hamano Fri, 9 Aug 2013 21:30:13 +0000 (14:30 -0700)

Merge branch 'sb/mailmap-updates'

* sb/mailmap-updates:
.mailmap: fixup entries

.mailmap: fixup entriesStefan Beller Fri, 9 Aug 2013 18:18:24 +0000 (20:18 +0200)

.mailmap: fixup entries

This patch adds no new names, but fixes the mistakes I made in the previous
commits. (94b410bba8, f4f49e225, c07a6bc57, 2013-07-12, .mailmap: Map
email addresses to names).

These mistakes are double white spaces between name and surname,
different capitalization in email address, or just the email address set
as name.

Also I forgot to include James Knight to the mailmap file.

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

t/t7407: fix two typos in submodule testsPhil Hord Fri, 9 Aug 2013 20:12:54 +0000 (16:12 -0400)

t/t7407: fix two typos in submodule tests

In t/t7407-submodule-foreach.sh there is a typo in one of the
path names given for a test step. The correct path is
nested1/nested2/.git, but nested1/nested1/nested2/.git is
given instead. The typo is hidden because this line also
accidentally omits the && chain operator. The omitted chain
also means the return values of all the previous commands in
this test are also being ignored.

Fix the path and add the chain operator so the entire test
sequence can be properly validated.

Signed-off-by: Phil Hord <hordp@cisco.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

parse-options: fix clang opterror() -Wunused-value... Eric Sunshine Fri, 9 Aug 2013 09:06:17 +0000 (05:06 -0400)

parse-options: fix clang opterror() -Wunused-value warning

a469a1019352b8ef (silence some -Wuninitialized false positives;
2012-12-15) triggered "unused value" warnings when the return value of
opterror() and several other error-related functions was not used.
5ded807f7c0be10e (fix clang -Wunused-value warnings for error functions;
2013-01-16) applied a fix by adding #if !defined(__clang__) in cache.h
and git-compat-util.h, but misspelled it as #if !defined(clang) in
parse-options.h. Fix this.

This mistake went unnoticed because existing callers of opterror()
utilize its return value. 1158826394e162c5 (parse-options: add
OPT_CMDMODE(); 2013-07-30), however, adds a new invocation of opterror()
which ignores the return value, thus triggering the "unused value"
warning.

Signed-off-by: Eric Sunshine <sunshine@sunshineco.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

l10n: de.po: translate 5 messagesRalf Thielow Tue, 6 Aug 2013 17:54:29 +0000 (19:54 +0200)

l10n: de.po: translate 5 messages

Translate 5 new messages came from git.pot update in b8ecf23
(l10n: git.pot: v1.8.4 round 2 (5 new, 3 removed)).

Signed-off-by: Ralf Thielow <ralf.thielow@gmail.com>

l10n: de.po: translate 99 new messagesRalf Thielow Fri, 26 Jul 2013 15:48:46 +0000 (17:48 +0200)

l10n: de.po: translate 99 new messages

Translate 99 new messages came from git.pot update in
28b3cff (l10n: git.pot: v1.8.4 round 1 (99 new, 46 removed)).

Signed-off-by: Ralf Thielow <ralf.thielow@gmail.com>
Acked-by: Thomas Rast <trast@inf.ethz.ch>

Git 1.8.4-rc2 v1.8.4-rc2Junio C Hamano Thu, 8 Aug 2013 20:58:34 +0000 (13:58 -0700)

Git 1.8.4-rc2

This is with mostly minor documentation and test updates, nothing
spectacular except for removal of funky lstat(2) emulation on Cygwin.

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

l10n: de.po: switch from pure German to German+EnglishRalf Thielow Wed, 29 May 2013 16:03:39 +0000 (18:03 +0200)

l10n: de.po: switch from pure German to German+English

This switches the translation from pure German to German+English.

Signed-off-by: Ralf Thielow <ralf.thielow@gmail.com>
Acked-by: Thomas Rast <trast@inf.ethz.ch>

l10n: de.po: Fix a typoWieland Hoffmann Wed, 5 Jun 2013 20:59:44 +0000 (22:59 +0200)

l10n: de.po: Fix a typo

Signed-off-by: Wieland Hoffmann <themineo@gmail.com>

fetch: work around "transport-take-over" hackJunio C Hamano Wed, 7 Aug 2013 22:47:18 +0000 (15:47 -0700)

fetch: work around "transport-take-over" hack

A Git-aware "connect" transport allows the "transport_take_over" to
redirect generic transport requests like fetch(), push_refs() and
get_refs_list() to the native Git transport handling methods. The
take-over process replaces transport->data with a fake data that
these method implementations understand.

While this hack works OK for a single request, it breaks when the
transport needs to make more than one requests. transport->data
that used to hold necessary information for the specific helper to
work correctly is destroyed during the take-over process.

One codepath that this matters is "git fetch" in auto-follow mode;
when it does not get all the tags that ought to point at the history
it got (which can be determined by looking at the peeled tags in the
initial advertisement) from the primary transfer, it internally
makes a second request to complete the fetch. Because "take-over"
hack has already destroyed the data necessary to talk to the
transport helper by the time this happens, the second request cannot
make a request to the helper to make another connection to fetch
these additional tags.

Mark such a transport as "cannot_reuse", and use a separate
transport to perform the backfill fetch in order to work around
this breakage.

Note that this problem does not manifest itself when running t5802,
because our upload-pack gives you all the necessary auto-followed
tags during the primary transfer. You would need to step through
"git fetch" in a debugger, stop immediately after the primary
transfer finishes and writes these auto-followed tags, remove the
tag references and repack/prune the repository to convince the
"find-non-local-tags" procedure that the primary transfer failed to
give us all the necessary tags, and then let it continue, in order
to trigger the bug in the secondary transfer this patch fixes.

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

fetch: refactor code that fetches leftover tagsJunio C Hamano Wed, 7 Aug 2013 22:14:45 +0000 (15:14 -0700)

fetch: refactor code that fetches leftover tags

Usually the upload-pack process running on the other side will give
us all the reachable tags we need during the primary object transfer
in do_fetch(). If that does not happen (e.g. the other side may be
running a third-party implementation of upload-pack), we will run
another fetch to pick up leftover tags that we know point at the
commits reachable from our updated tips.

Separate out the code to run this second fetch into a helper
function.

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

fetch: refactor code that prepares a transportJunio C Hamano Wed, 7 Aug 2013 21:43:20 +0000 (14:43 -0700)

fetch: refactor code that prepares a transport

Make a helper function prepare_transport() that returns a transport
to talk to a given remote.

The set_option() helper that used to always affect the file-scope
global "gtransport" now takes a transport as its parameter.

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

fetch: rename file-scope global "transport" to "gtransport"Junio C Hamano Wed, 7 Aug 2013 22:38:45 +0000 (15:38 -0700)

fetch: rename file-scope global "transport" to "gtransport"

Although many functions in this file take a "struct transport" as a
parameter, "fetch_one()" assigns to the global singleton instance
which is a file-scope static, in order to allow a parameterless
signal handler unlock_pack() to access it.

Rename the variable to gtransport to make sure these uses stand out.

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

t5802: add test for connect helperJunio C Hamano Wed, 7 Aug 2013 15:18:10 +0000 (08:18 -0700)

t5802: add test for connect helper

This is an attempt to reproduce a problem reported for a third-party
custom "connect" remote helper. The conjecture is that sometimes
"git fetch" wants to make two connections (one for the primary
transfer with 'follow-tags' option set, and then after noticing that
some tags are not packed because the primary transfer did not have
to send any commit that is pointed by them, another to explicitly
ask for the missing tags), and their "connect" helper is not called
in the second request, breaking the "fetch" as a whole.

Unfortunately this test script does not trigger the alleged failure
and happily passes when talking to upload-pack from git-core (see
patch 5/5 for details).

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

die_with_status: use "printf '%s\n'", not "echo"Matthieu Moy Wed, 7 Aug 2013 09:26:05 +0000 (11:26 +0200)

die_with_status: use "printf '%s\n'", not "echo"

Some implementations of 'echo' (e.g. dash's built-in) interpret
backslash sequences in their arguments.

This triggered at least one bug: the error message of "rebase -i" was
turning \t in commit messages into actual tabulations. There may be
others.

Using "printf '%s\n'" instead avoids this bad behavior, and is the form
used by the "say" function.

Noticed-by: David Kastrup <dak@gnu.org>
Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

l10n: Update Swedish translation (2135t0f0u)Peter Krefting Tue, 6 Aug 2013 11:41:48 +0000 (12:41 +0100)

l10n: Update Swedish translation (2135t0f0u)

Fix some incorrect translations in existing messages while at it.

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

l10n: zh_CN.po: translate 5 messages (2135t0f0u)Jiang Xin Tue, 6 Aug 2013 06:49:18 +0000 (14:49 +0800)

l10n: zh_CN.po: translate 5 messages (2135t0f0u)

Translate 5 new messages came from git.pot update in b8ecf23
(l10n: git.pot: v1.8.4 round 2 (5 new, 3 removed)).

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

l10n: vi.po(2135t): v1.8.4 round 2Tran Ngoc Quan Tue, 6 Aug 2013 07:34:48 +0000 (14:34 +0700)

l10n: vi.po(2135t): v1.8.4 round 2

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

l10n: git.pot: v1.8.4 round 2 (5 new, 3 removed)Jiang Xin Tue, 6 Aug 2013 06:13:23 +0000 (14:13 +0800)

l10n: git.pot: v1.8.4 round 2 (5 new, 3 removed)

Generate po/git.pot from v1.8.4-rc1-21-gfb56570 for git v1.8.4
l10n round 2.

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

Sync with maint to grab trivial doc fixesJunio C Hamano Mon, 5 Aug 2013 20:00:20 +0000 (13:00 -0700)

Sync with maint to grab trivial doc fixes

* maint:
fix typo in documentation of git-svn
Documentation/rev-list-options: add missing word in --*-parents
log doc: the argument to --encoding is not optional

Merge branch 'es/blame-L-breakage'Junio C Hamano Mon, 5 Aug 2013 17:44:39 +0000 (10:44 -0700)

Merge branch 'es/blame-L-breakage'

* es/blame-L-breakage:
t8001, t8002: fix "blame -L :literal" test on NetBSD

t8001, t8002: fix "blame -L :literal" test on NetBSDRené Scharfe Mon, 5 Aug 2013 15:21:17 +0000 (17:21 +0200)

t8001, t8002: fix "blame -L :literal" test on NetBSD

Sub-test 42 of t8001 and t8002 ("blame -L :literal") fails on NetBSD
with the following verbose output:

git annotate -L:main hello.c
Author F (expected 4, attributed 3) bad
Author G (expected 1, attributed 1) good

This is not caused by different behaviour of git blame or annotate on
that platform, but by different test input, in turn caused by a sed
command that forgets to add a newline on NetBSD. Here's the diff of the
commit that adds "goodbye" to hello.c, for Linux:

@@ -1,4 +1,5 @@
int main(int argc, const char *argv[])
{
puts("hello");
+ puts("goodbye");
}

We see that it adds an extra TAB, but that's not a problem. Here's the
same on NetBSD:

@@ -1,4 +1,4 @@
int main(int argc, const char *argv[])
{
puts("hello");
-}
+ puts("goodbye");}

It also adds an extra TAB, but it is missing the newline character
after the semicolon.

The following patch gets rid of the extra TAB at the beginning, but
more importantly adds the missing newline at the end in a (hopefully)
portable way, mentioned in http://sed.sourceforge.net/sedfaq4.html.
The diff becomes this, on both Linux and NetBSD:

@@ -1,4 +1,5 @@
int main(int argc, const char *argv[])
{
puts("hello");
+ puts("goodbye");
}

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

Merge git://github.com/git-l10n/git-poJunio C Hamano Mon, 5 Aug 2013 17:38:23 +0000 (10:38 -0700)

Merge git://github.com/git-l10n/git-po

* git://github.com/git-l10n/git-po:
l10n: zh_CN.po: translate 99 messages (2133t0f0u)
l10n: vi.po (2133t)
l10n: git.pot: v1.8.4 round 1 (99 new, 46 removed)