gitweb.git
run_external_diff: drop fflush(NULL)Jeff King Sat, 19 Apr 2014 19:19:30 +0000 (15:19 -0400)

run_external_diff: drop fflush(NULL)

This fflush was added in d5535ec (Use run_command() to spawn
external diff programs instead of fork/exec., 2007-10-19),
because flushing buffers before forking is a good habit.

But later, 7d0b18a (Add output flushing before fork(),
2008-08-04) added it to the generic run-command interface,
meaning that our flush here is redundant.

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

run_external_diff: clean up error handlingJeff King Sat, 19 Apr 2014 19:19:19 +0000 (15:19 -0400)

run_external_diff: clean up error handling

When the external diff reports an error, we try to clean up
and die. However, we can make this process a bit simpler:

1. We do not need to bother freeing memory, since we are
about to exit. Nor do we need to clean up our
tempfiles, since the atexit() handler will do it for
us. So we can die as soon as we see the error.

3. We can just call die() rather than fprintf/exit. This
does technically change our exit code, but the exit
code of "1" is not meaningful here. In fact, it is
probably wrong, since "1" from diff usually means
"completed successfully, but there were differences".

And while we're there, we can mark the error message for
translation, and drop the full stop at the end to make it
more like our other messages.

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

run_external_diff: use an argv_array for the environmentJeff King Sat, 19 Apr 2014 19:17:25 +0000 (15:17 -0400)

run_external_diff: use an argv_array for the environment

We currently use static buffers and a static array for
formatting the environment passed to the external diff.
There's nothing wrong in the code, but it is much easier to
verify that it is correct if we use a dynamic argv_array.

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

run_external_diff: use an argv_array for the command... Jeff King Sat, 19 Apr 2014 19:17:06 +0000 (15:17 -0400)

run_external_diff: use an argv_array for the command line

We currently generate the command-line for the external
command using a fixed-length array of size 10. But if there
is a rename, we actually need 11 elements (10 items, plus a
NULL), and end up writing a random NULL onto the stack.

Rather than bump the limit, let's just use an argv_array, which
makes this sort of error impossible.

Noticed-by: Max L <infthi.inbox@gmail.com>
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

l10n: vi.po (2228t): Update and minor fixTran Ngoc Quan Sun, 20 Apr 2014 08:22:26 +0000 (15:22 +0700)

l10n: vi.po (2228t): Update and minor fix

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

Git 2.0: git svn: Set default --prefix='origin/' if... Johan Herland Fri, 11 Oct 2013 12:57:07 +0000 (14:57 +0200)

Git 2.0: git svn: Set default --prefix='origin/' if --prefix is not given

git-svn by default puts its Subversion-tracking refs directly in
refs/remotes/*. This runs counter to Git's convention of using
refs/remotes/$remote/* for storing remote-tracking branches.

Furthermore, combining git-svn with regular git remotes run the risk of
clobbering refs under refs/remotes (e.g. if you have a git remote
called "tags" with a "v1" branch, it will overlap with the git-svn's
tracking branch for the "v1" tag from Subversion.

Even though the git-svn refs stored in refs/remotes/* are not "proper"
remote-tracking branches (since they are not covered by a proper git
remote's refspec), they clearly represent a similar concept, and would
benefit from following the same convention.

For example, if git-svn tracks Subversion branch "foo" at
refs/remotes/foo, and you create a local branch refs/heads/foo to add
some commits to be pushed back to Subversion (using "git svn dcommit),
then it is clearly unhelpful of Git to throw

warning: refname 'foo' is ambiguous.

every time you checkout, rebase, or otherwise interact with the branch.

The existing workaround for this is to supply the --prefix=quux/ to
git svn init/clone, so that git-svn's tracking branches end up in
refs/remotes/quux/* instead of refs/remotes/*. However, encouraging
users to specify --prefix to work around a design flaw in git-svn is
suboptimal, and not a long term solution to the problem. Instead,
git-svn should default to use a non-empty prefix that saves
unsuspecting users from the inconveniences described above.

This patch will only affect newly created git-svn setups, as the
--prefix option only applies to git svn init (and git svn clone).
Existing git-svn setups will continue with their existing (lack of)
prefix. Also, if anyone somehow prefers git-svn's old layout, they
can recreate that by explicitly passing an empty prefix (--prefix "")
on the git svn init/clone command line.

The patch changes the default value for --prefix from "" to "origin/",
updates the git-svn manual page, and fixes the fallout in the git-svn
testcases.

(Note that this patch might be easier to review using the --word-diff
and --word-diff-regex=. diff options.)

[ew: squashed description of <= 1.9 behavior into manpage]

Suggested-by: Thomas Ferris Nicolaisen <tfnico@gmail.com>
Signed-off-by: Johan Herland <johan@herland.net>
Signed-off-by: Eric Wong <normalperson@yhbt.net>

l10n: git.pot: v2.0.0 round 1 (45 new, 28 removed)Jiang Xin Sat, 19 Apr 2014 04:53:28 +0000 (12:53 +0800)

l10n: git.pot: v2.0.0 round 1 (45 new, 28 removed)

Generate po/git.pot from v2.0.0-rc0 for git v2.0.0 l10n round 1.

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

Git 2.0-rc0 v2.0.0-rc0Junio C Hamano Fri, 18 Apr 2014 18:21:43 +0000 (11:21 -0700)

Git 2.0-rc0

An early-preview for the upcoming Git 2.0.

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

Merge branch 'jk/config-die-bad-number-noreturn'Junio C Hamano Fri, 18 Apr 2014 18:17:44 +0000 (11:17 -0700)

Merge branch 'jk/config-die-bad-number-noreturn'

Squelch a false compiler warning from older gcc.

* jk/config-die-bad-number-noreturn:
config.c: mark die_bad_number as NORETURN

Merge branch 'fc/remote-helper-fixes'Junio C Hamano Fri, 18 Apr 2014 18:17:40 +0000 (11:17 -0700)

Merge branch 'fc/remote-helper-fixes'

* fc/remote-helper-fixes:
remote-bzr: trivial test fix
remote-bzr: include authors field in pushed commits
remote-bzr: add support for older versions
remote-hg: always normalize paths
remote-helpers: allow all tests running from any dir

Merge branch 'fc/complete-aliased-push'Junio C Hamano Fri, 18 Apr 2014 18:17:36 +0000 (11:17 -0700)

Merge branch 'fc/complete-aliased-push'

* fc/complete-aliased-push:
completion: fix completing args of aliased "push", "fetch", etc.

Merge branch 'fc/prompt-zsh-read-from-file'Junio C Hamano Fri, 18 Apr 2014 18:17:22 +0000 (11:17 -0700)

Merge branch 'fc/prompt-zsh-read-from-file'

* fc/prompt-zsh-read-from-file:
prompt: fix missing file errors in zsh

i18n: mention "TRANSLATORS:" marker in Documentation... Junio C Hamano Fri, 18 Apr 2014 17:48:08 +0000 (10:48 -0700)

i18n: mention "TRANSLATORS:" marker in Documentation/CodingGuidelines

These comments have to have "TRANSLATORS: " at the very beginning
and have to deviate from the usual multi-line comment formatting
convention.

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

commit.c: check for lock error and return earlyRonnie Sahlberg Wed, 16 Apr 2014 18:56:53 +0000 (11:56 -0700)

commit.c: check for lock error and return early

Move the check for the lock failure to happen immediately after
lock_any_ref_for_update(). Previously the lock and the
check-if-lock-failed was separated by a handful of string
manipulation statements.

Moving the check to occur immediately after the failed lock makes
the code slightly easier to read and makes it follow the pattern of

try-to-take-a-lock();
if (check-if-lock-failed) {
error();
}

Signed-off-by: Ronnie Sahlberg <sahlberg@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

sequencer.c: check for lock failure and bail early... Ronnie Sahlberg Wed, 16 Apr 2014 18:56:52 +0000 (11:56 -0700)

sequencer.c: check for lock failure and bail early in fast_forward_to

Change fast_forward_to() to check if locking the ref failed, print a
nice error message and bail out early.

The old code did not check if ref_lock was NULL and relied on the
fact that the write_ref_sha1() would safely detect this condition
and set the return variable ret to indicate an error.

While that is safe, it makes the code harder to read for two reasons:

* Inconsistency. Almost all other places we do check the lock for
NULL explicitly, so the naive reader is confused "why don't we
check here?"

* And relying on write_ref_sha1() to detect and return an error for
when a previous lock_any_ref_for_update() failed feels obfuscated.

This change should not change any functionality or logic aside from
adding an extra error message when this condition is triggered
(write_ref_sha1() returns an error silently for this condition).

Signed-off-by: Ronnie Sahlberg <sahlberg@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

t9362-mw-to-git-utf8.sh: use the $( ... ) construct... Elia Pinto Wed, 16 Apr 2014 17:29:58 +0000 (10:29 -0700)

t9362-mw-to-git-utf8.sh: use the $( ... ) construct for command substitution

The Git CodingGuidelines prefer the $(...) construct for command
substitution instead of using the backquotes `...`.

The backquoted form is the traditional method for command
substitution, and is supported by POSIX. However, all but the
simplest uses become complicated quickly. In particular, embedded
command substitutions and/or the use of double quotes require
careful escaping with the backslash character.

The patch was generated by:

for _f in $(find . -name "*.sh")
do
sed -i 's@`\(.*\)`@$(\1)@g' ${_f}
done

and then carefully proof-read.

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

t9360-mw-to-git-clone.sh: use the $( ... ) construct... Elia Pinto Wed, 16 Apr 2014 17:29:57 +0000 (10:29 -0700)

t9360-mw-to-git-clone.sh: use the $( ... ) construct for command substitution

The Git CodingGuidelines prefer the $(...) construct for command
substitution instead of using the backquotes `...`.

The backquoted form is the traditional method for command
substitution, and is supported by POSIX. However, all but the
simplest uses become complicated quickly. In particular, embedded
command substitutions and/or the use of double quotes require
careful escaping with the backslash character.

The patch was generated by:

for _f in $(find . -name "*.sh")
do
sed -i 's@`\(.*\)`@$(\1)@g' ${_f}
done

and then carefully proof-read.

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

git-tag.sh: use the $( ... ) construct for command... Elia Pinto Wed, 16 Apr 2014 17:29:56 +0000 (10:29 -0700)

git-tag.sh: use the $( ... ) construct for command substitution

The Git CodingGuidelines prefer the $(...) construct for command
substitution instead of using the backquotes `...`.

The backquoted form is the traditional method for command
substitution, and is supported by POSIX. However, all but the
simplest uses become complicated quickly. In particular, embedded
command substitutions and/or the use of double quotes require
careful escaping with the backslash character.

The patch was generated by:

for _f in $(find . -name "*.sh")
do
sed -i 's@`\(.*\)`@$(\1)@g' ${_f}
done

and then carefully proof-read.

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

git-revert.sh: use the $( ... ) construct for command... Elia Pinto Wed, 16 Apr 2014 17:29:55 +0000 (10:29 -0700)

git-revert.sh: use the $( ... ) construct for command substitution

The Git CodingGuidelines prefer the $(...) construct for command
substitution instead of using the backquotes `...`.

The backquoted form is the traditional method for command
substitution, and is supported by POSIX. However, all but the
simplest uses become complicated quickly. In particular, embedded
command substitutions and/or the use of double quotes require
careful escaping with the backslash character.

The patch was generated by:

for _f in $(find . -name "*.sh")
do
sed -i 's@`\(.*\)`@$(\1)@g' ${_f}
done

and then carefully proof-read.

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

git-resolve.sh: use the $( ... ) construct for command... Elia Pinto Wed, 16 Apr 2014 17:29:54 +0000 (10:29 -0700)

git-resolve.sh: use the $( ... ) construct for command substitution

The Git CodingGuidelines prefer the $(...) construct for command
substitution instead of using the backquotes `...`.

The backquoted form is the traditional method for command
substitution, and is supported by POSIX. However, all but the
simplest uses become complicated quickly. In particular, embedded
command substitutions and/or the use of double quotes require
careful escaping with the backslash character.

The patch was generated by:

for _f in $(find . -name "*.sh")
do
sed -i 's@`\(.*\)`@$(\1)@g' ${_f}
done

and then carefully proof-read.

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

git-repack.sh: use the $( ... ) construct for command... Elia Pinto Wed, 16 Apr 2014 17:29:53 +0000 (10:29 -0700)

git-repack.sh: use the $( ... ) construct for command substitution

The Git CodingGuidelines prefer the $(...) construct for command
substitution instead of using the backquotes `...`.

The backquoted form is the traditional method for command
substitution, and is supported by POSIX. However, all but the
simplest uses become complicated quickly. In particular, embedded
command substitutions and/or the use of double quotes require
careful escaping with the backslash character.

The patch was generated by:

for _f in $(find . -name "*.sh")
do
sed -i 's@`\(.*\)`@$(\1)@g' ${_f}
done

and then carefully proof-read.

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

git-merge.sh: use the $( ... ) construct for command... Elia Pinto Wed, 16 Apr 2014 17:29:52 +0000 (10:29 -0700)

git-merge.sh: use the $( ... ) construct for command substitution

The Git CodingGuidelines prefer the $(...) construct for command
substitution instead of using the backquotes `...`.

The backquoted form is the traditional method for command
substitution, and is supported by POSIX. However, all but the
simplest uses become complicated quickly. In particular, embedded
command substitutions and/or the use of double quotes require
careful escaping with the backslash character.

The patch was generated by:

for _f in $(find . -name "*.sh")
do
sed -i 's@`\(.*\)`@$(\1)@g' ${_f}
done

and then carefully proof-read.

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

git-ls-remote.sh: use the $( ... ) construct for comman... Elia Pinto Wed, 16 Apr 2014 17:29:51 +0000 (10:29 -0700)

git-ls-remote.sh: use the $( ... ) construct for command substitution

The Git CodingGuidelines prefer the $(...) construct for command
substitution instead of using the backquotes `...`.

The backquoted form is the traditional method for command
substitution, and is supported by POSIX. However, all but the
simplest uses become complicated quickly. In particular, embedded
command substitutions and/or the use of double quotes require
careful escaping with the backslash character.

The patch was generated by:

for _f in $(find . -name "*.sh")
do
sed -i 's@`\(.*\)`@$(\1)@g' ${_f}
done

and then carefully proof-read.

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

git-fetch.sh: use the $( ... ) construct for command... Elia Pinto Wed, 16 Apr 2014 17:29:50 +0000 (10:29 -0700)

git-fetch.sh: use the $( ... ) construct for command substitution

The Git CodingGuidelines prefer the $(...) construct for command
substitution instead of using the backquotes `...`.

The backquoted form is the traditional method for command
substitution, and is supported by POSIX. However, all but the
simplest uses become complicated quickly. In particular, embedded
command substitutions and/or the use of double quotes require
careful escaping with the backslash character.

The patch was generated by:

for _f in $(find . -name "*.sh")
do
sed -i 's@`\(.*\)`@$(\1)@g' ${_f}
done

and then carefully proof-read.

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

git-commit.sh: use the $( ... ) construct for command... Elia Pinto Wed, 16 Apr 2014 17:29:49 +0000 (10:29 -0700)

git-commit.sh: use the $( ... ) construct for command substitution

The Git CodingGuidelines prefer the $(...) construct for command
substitution instead of using the backquotes `...`.

The backquoted form is the traditional method for command
substitution, and is supported by POSIX. However, all but the
simplest uses become complicated quickly. In particular, embedded
command substitutions and/or the use of double quotes require
careful escaping with the backslash character.

The patch was generated by:

for _f in $(find . -name "*.sh")
do
sed -i 's@`\(.*\)`@$(\1)@g' ${_f}
done

and then carefully proof-read.

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

git-clone.sh: use the $( ... ) construct for command... Elia Pinto Wed, 16 Apr 2014 17:29:48 +0000 (10:29 -0700)

git-clone.sh: use the $( ... ) construct for command substitution

The Git CodingGuidelines prefer the $(...) construct for command
substitution instead of using the backquotes `...`.

The backquoted form is the traditional method for command
substitution, and is supported by POSIX. However, all but the
simplest uses become complicated quickly. In particular, embedded
command substitutions and/or the use of double quotes require
careful escaping with the backslash character.

The patch was generated by:

for _f in $(find . -name "*.sh")
do
sed -i 's@`\(.*\)`@$(\1)@g' ${_f}
done

and then carefully proof-read.

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

git-checkout.sh: use the $( ... ) construct for command... Elia Pinto Wed, 16 Apr 2014 17:29:47 +0000 (10:29 -0700)

git-checkout.sh: use the $( ... ) construct for command substitution

The Git CodingGuidelines prefer the $(...) construct for command
substitution instead of using the backquotes `...`.

The backquoted form is the traditional method for command
substitution, and is supported by POSIX. However, all but the
simplest uses become complicated quickly. In particular, embedded
command substitutions and/or the use of double quotes require
careful escaping with the backslash character.

The patch was generated by:

for _f in $(find . -name "*.sh")
do
sed -i 's@`\(.*\)`@$(\1)@g' ${_f}
done

and then carefully proof-read.

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

install-webdoc.sh: use the $( ... ) construct for comma... Elia Pinto Wed, 16 Apr 2014 17:29:46 +0000 (10:29 -0700)

install-webdoc.sh: use the $( ... ) construct for command substitution

The Git CodingGuidelines prefer the $(...) construct for command
substitution instead of using the backquotes `...`.

The backquoted form is the traditional method for command
substitution, and is supported by POSIX. However, all but the
simplest uses become complicated quickly. In particular, embedded
command substitutions and/or the use of double quotes require
careful escaping with the backslash character.

The patch was generated by:

for _f in $(find . -name "*.sh")
do
sed -i 's@`\(.*\)`@$(\1)@g' ${_f}
done

and then carefully proof-read.

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

howto-index.sh: use the $( ... ) construct for command... Elia Pinto Wed, 16 Apr 2014 17:29:45 +0000 (10:29 -0700)

howto-index.sh: use the $( ... ) construct for command substitution

The Git CodingGuidelines prefer the $(...) construct for command
substitution instead of using the backquotes `...`.

The backquoted form is the traditional method for command
substitution, and is supported by POSIX. However, all but the
simplest uses become complicated quickly. In particular, embedded
command substitutions and/or the use of double quotes require
careful escaping with the backslash character.

The patch was generated by:

for _f in $(find . -name "*.sh")
do
sed -i 's@`\(.*\)`@$(\1)@g' ${_f}
done

and then carefully proof-read.

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

i18n: only extract comments marked with "TRANSLATORS:"Jiang Xin Thu, 17 Apr 2014 05:37:18 +0000 (13:37 +0800)

i18n: only extract comments marked with "TRANSLATORS:"

When extract l10n messages, we use "--add-comments" option to keep
comments right above the l10n messages for references. But sometimes
irrelevant comments are also extracted. For example in the following
code block, the comment in line 2 will be extracted as comment for the
l10n message in line 3, but obviously it's wrong.

{ OPTION_CALLBACK, 0, "ignore-removal", &addremove_explicit,
NULL /* takes no arguments */,
N_("ignore paths removed in the working tree (same as
--no-all)"),
PARSE_OPT_NOARG, ignore_removal_cb },

Since almost all comments for l10n translators are marked with the same
prefix (tag): "TRANSLATORS:", it's safe to only extract comments with
this special tag. I.E. it's better to call xgettext as:

xgettext --add-comments=TRANSLATORS: ...

Also tweaks the multi-line comment in "init-db.c", to make it start with
the proper tag, not "* TRANSLATORS:" (which has a star before the tag).

Signed-off-by: Jiang Xin <worldhello.net@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

i18n: remove obsolete comments for translators in diffs... Jiang Xin Thu, 17 Apr 2014 05:37:19 +0000 (13:37 +0800)

i18n: remove obsolete comments for translators in diffstat generation

Since we do not translate diffstat any more, remove the obsolete comments.

Signed-off-by: Jiang Xin <worldhello.net@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

i18n: fix uncatchable comments for translators in date.cJiang Xin Thu, 17 Apr 2014 05:37:17 +0000 (13:37 +0800)

i18n: fix uncatchable comments for translators in date.c

Comment for l10n translators can not be extracted by xgettext if it
is not right above the l10n tag. Moving the comment right before
the l10n tag will fix this issue.

Reported-by: Brian Gesiak <modocache@gmail.com>
Signed-off-by: Jiang Xin <worldhello.net@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

SVN.pm::parse_svn_date: allow timestamps with a single... RomanBelinsky Tue, 11 Feb 2014 16:23:02 +0000 (18:23 +0200)

SVN.pm::parse_svn_date: allow timestamps with a single-digit hour

Some broken subversion server gives timestamps with only one digit
in the hour part, like this:

2014-01-07T5:01:02.048176Z

Loosen the regexp that expected to see two-digit hour, minute and
second parts to accept a single-digit hour (but not minute or
second).

Signed-off-by: Stepan Kasal <kasal@ucw.cz>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Revert "rebase: fix run_specific_rebase's use of "retur... Kyle J. McKay Fri, 11 Apr 2014 08:28:18 +0000 (01:28 -0700)

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

This reverts commit 99855ddf4bd319cd06a0524e755ab1c1b7d39f3b.

The workaround 99855ddf introduced to deal with problematic
"return" statements in scripts run by "dot" commands located
inside functions only handles one part of the problem. The
issue has now been addressed by not using "return" statements
in this way in the git-rebase--*.sh scripts.

This workaround is therefore no longer necessary, so clean
up the code by reverting it.

Signed-off-by: Kyle J. McKay <mackyle@gmail.com>
Acked-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

rebase: avoid non-function use of "return" on FreeBSDKyle J. McKay Fri, 11 Apr 2014 08:28:17 +0000 (01:28 -0700)

rebase: avoid non-function use of "return" on FreeBSD

Since a1549e10, 15d4bf2e and 01a1e646 (first appearing in v1.8.4)
the git-rebase--*.sh scripts have used a "return" to stop execution
of the dot-sourced file and return to the "dot" command that
dot-sourced it. The /bin/sh utility on FreeBSD however behaves
poorly under some circumstances when such a "return" is executed.

In particular, if the "dot" command is contained within a function,
then when a "return" is executed by the script it runs (that is not
itself inside a function), control will return from the function
that contains the "dot" command skipping any statements that might
follow the dot command inside that function. Commit 99855ddf (first
appearing in v1.8.4.1) addresses this by making the "dot" command
the last line in the function.

Unfortunately the FreeBSD /bin/sh may also execute some statements
in the script run by the "dot" command that appear after the
troublesome "return". The fix in 99855ddf does not address this
problem.

For example, if you have script1.sh with these contents:

run_script2() {
. "$(dirname -- "$0")/script2.sh"
_e=$?
echo only this line should show
[ $_e -eq 5 ] || echo expected status 5 got $_e
return 3
}
run_script2
e=$?
[ $e -eq 3 ] || { echo expected status 3 got $e; exit 1; }

And script2.sh with these contents:

if [ 5 -gt 3 ]; then
return 5
fi
case bad in *)
echo always shows
esac
echo should not get here
! :

When running script1.sh (e.g. '/bin/sh script1.sh' or './script1.sh'
after making it executable), the expected output from a POSIX shell
is simply the single line:

only this line should show

However, when run using FreeBSD's /bin/sh, the following output
appears instead:

should not get here
expected status 3 got 1

Not only did the lines following the "dot" command in the run_script2
function in script1.sh get skipped, but additional lines in script2.sh
following the "return" got executed -- but not all of them (e.g. the
"echo always shows" line did not run).

These issues can be avoided by not using a top-level "return" in
script2.sh. If script2.sh is changed to this:

main() {
if [ 5 -gt 3 ]; then
return 5
fi
case bad in *)
echo always shows
esac
echo should not get here
! :
}
main

Then it behaves the same when using FreeBSD's /bin/sh as when using
other more POSIX compliant /bin/sh implementations.

We fix the git-rebase--*.sh scripts in a similar fashion by moving
the top-level code that contains "return" statements into its own
function and then calling that as the last line in the script.

Signed-off-by: Kyle J. McKay <mackyle@gmail.com>
Acked-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Update draft release notes for 2.0Junio C Hamano Wed, 16 Apr 2014 20:43:26 +0000 (13:43 -0700)

Update draft release notes for 2.0

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

Merge branch 'mh/multimail'Junio C Hamano Wed, 16 Apr 2014 20:39:00 +0000 (13:39 -0700)

Merge branch 'mh/multimail'

* mh/multimail:
git-multimail: update to version 1.0.0

Merge branch 'tb/unicode-6.3-zero-width'Junio C Hamano Wed, 16 Apr 2014 20:38:57 +0000 (13:38 -0700)

Merge branch 'tb/unicode-6.3-zero-width'

Teach our display-column-counting logic about decomposed umlauts
and friends.

* tb/unicode-6.3-zero-width:
utf8.c: partially update to version 6.3

Merge branch 'km/avoid-cp-a'Junio C Hamano Wed, 16 Apr 2014 20:38:55 +0000 (13:38 -0700)

Merge branch 'km/avoid-cp-a'

Portability fix.

* km/avoid-cp-a:
test: fix t7001 cp to use POSIX options

Merge branch 'km/avoid-bs-in-shell-glob'Junio C Hamano Wed, 16 Apr 2014 20:38:52 +0000 (13:38 -0700)

Merge branch 'km/avoid-bs-in-shell-glob'

Portability fix.

* km/avoid-bs-in-shell-glob:
test: fix t5560 on FreeBSD

send-email: recognize absolute path on WindowsErik Faye-Lund Wed, 16 Apr 2014 08:08:18 +0000 (10:08 +0200)

send-email: recognize absolute path on Windows

On Windows, absolute paths might start with a DOS drive prefix,
which these two checks failed to recognize.

Unfortunately, we cannot simply use the file_name_is_absolute
helper in File::Spec::Functions, because Git for Windows has an
MSYS-based Perl, where this helper doesn't grok DOS
drive-prefixes.

So let's manually check for these in that case, and fall back to
the File::Spec-helper on other platforms (e.g Win32 with native
Perl)

Signed-off-by: Erik Faye-Lund <kusmabite@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

config.c: mark die_bad_number as NORETURNJeff King Wed, 16 Apr 2014 16:51:47 +0000 (12:51 -0400)

config.c: mark die_bad_number as NORETURN

This can help avoid -Wuninitialized false positives in
git_config_int and git_config_ulong, as the compiler now
knows that we do not return "ret" if we hit the error
codepath.

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

index-pack: work around thread-unsafe pread()Nguyễn Thái Ngọc Duy Tue, 25 Mar 2014 13:41:41 +0000 (20:41 +0700)

index-pack: work around thread-unsafe pread()

Multi-threaing of index-pack was disabled with c0f8654
(index-pack: Disable threading on cygwin - 2012-06-26), because
pread() implementations for Cygwin and MSYS were not thread
safe. Recent Cygwin does offer usable pread() and we enabled
multi-threading with 103d530f (Cygwin 1.7 has thread-safe pread,
2013-07-19).

Work around this problem on platforms with a thread-unsafe
pread() emulation by opening one file handle per thread; it
would prevent parallel pread() on different file handles from
stepping on each other.

Also remove NO_THREAD_SAFE_PREAD that was introduced in c0f8654
because it's no longer used anywhere.

This workaround is unconditional, even for platforms with
thread-safe pread() because the overhead is small (a couple file
handles more) and not worth fragmenting the code.

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

Makefile: allow static linking against libcurlDave Borowitz Tue, 15 Apr 2014 10:40:31 +0000 (03:40 -0700)

Makefile: allow static linking against libcurl

This requires more flags than can be guessed with the old-style
CURLDIR and related options, so is only supported when curl-config is
present.

Signed-off-by: Dave Borowitz <dborowitz@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Makefile: use curl-config to determine curl flagsDave Borowitz Tue, 15 Apr 2014 10:40:30 +0000 (03:40 -0700)

Makefile: use curl-config to determine curl flags

curl-config should always be installed alongside a curl distribution,
and its purpose is to provide flags for building against libcurl, so
use it instead of guessing flags and dependent libraries.

Allow overriding CURL_CONFIG to a custom path to curl-config, to
compile against a curl installation other than the first in PATH.

Depending on the set of features curl is compiled with, there may be
more libraries required than the previous two options of -lssl and
-lidn. For example, with a vanilla build of libcurl-7.36.0 on Mac OS X
10.9:

$ ~/d/curl-out-7.36.0/lib/curl-config --libs
-L/Users/dborowitz/d/curl-out-7.36.0/lib -lcurl -lgssapi_krb5 -lresolv -lldap -lz

Use this only when CURLDIR is not explicitly specified, to continue
supporting older builds.

Signed-off-by: Dave Borowitz <dborowitz@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

transport-helper: fix sync issue on crashesFelipe Contreras Sat, 12 Apr 2014 20:33:32 +0000 (15:33 -0500)

transport-helper: fix sync issue on crashes

When a remote helper crashes while pushing we should revert back to the
state before the push, however, it's possible that `git fast-export`
already finished its job, and therefore has exported the marks already.

This creates a synchronization problem because from that moment on
`git fast-{import,export}` will have marks that the remote helper is not
aware of and all further commands fail (if those marks are referenced).

The fix is to tell `git fast-export` to export to a temporary file, and
only after the remote helper has finishes successfully, move to the
final destination.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

transport-helper: trivial cleanupFelipe Contreras Sat, 12 Apr 2014 20:33:31 +0000 (15:33 -0500)

transport-helper: trivial cleanup

It's simpler to store the file names directly, and form the fast-export
arguments only when needed, and re-use the same strbuf with a format.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

transport-helper: propagate recvline() error pushingFelipe Contreras Sat, 12 Apr 2014 20:33:30 +0000 (15:33 -0500)

transport-helper: propagate recvline() error pushing

It's cleaner, and will allow us to do something sensible on errors
later.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

remote-helpers: make recvline return an errorFelipe Contreras Sat, 12 Apr 2014 20:33:29 +0000 (15:33 -0500)

remote-helpers: make recvline return an error

Instead of exiting directly, make it the duty of the caller to do so.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

transport-helper: remove barely used xchgline()Felipe Contreras Sat, 12 Apr 2014 20:33:28 +0000 (15:33 -0500)

transport-helper: remove barely used xchgline()

It's only used once, we can just call the two functions inside directly.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

prompt: fix missing file errors in zshFelipe Contreras Fri, 11 Apr 2014 23:32:25 +0000 (18:32 -0500)

prompt: fix missing file errors in zsh

zsh seems to have a bug while redirecting the stderr of the 'read'
command:

% read foo 2>/dev/null <foo
zsh: no such file or directory: foo

Which causes errors to be displayed when certain files are missing.
Let's add a convenience function to manually check if the file is
readable before calling "read".

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

remote-bzr: trivial test fixFelipe Contreras Fri, 11 Apr 2014 23:24:05 +0000 (18:24 -0500)

remote-bzr: trivial test fix

So that the committer is reset properly.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

test: fix t5560 on FreeBSDKyle J. McKay Fri, 11 Apr 2014 08:28:19 +0000 (01:28 -0700)

test: fix t5560 on FreeBSD

Since fd0a8c2e (first appearing in v1.7.0), the
t/t5560-http-backend-noserver.sh test has used a backslash escape
inside a ${} expansion in order to specify a literal '?' character.

Unfortunately the FreeBSD /bin/sh does not interpret this correctly.

In a POSIX compliant shell, the following:

x='one?two?three'
echo "${x#*\?}"

Would be expected to produce this:

two?three

When using the FreeBSD /bin/sh instead you get this:

one?two?three

In fact the FreeBSD /bin/sh treats the backslash as a literal
character to match so that this:

y='one\two\three'
echo "${y#*\?}"

Produces this unexpected value:

wo\three

In this case the backslash is not only treated literally, it also
fails to defeat the special meaning of the '?' character.

Instead, we can use the [...] construct to defeat the special meaning
of the '?' character and match it exactly in a way that works for the
FreeBSD /bin/sh as well as other POSIX /bin/sh implementations.

Changing the example like so:

x='one?two?three'
echo "${x#*[?]}"

Produces the expected output using the FreeBSD /bin/sh.

Therefore, change the use of \? to [?] in order to be compatible with
the FreeBSD /bin/sh which allows t/t5560-http-backend-noserver.sh to
pass on FreeBSD again.

Signed-off-by: Kyle J. McKay <mackyle@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

test: fix t7001 cp to use POSIX optionsKyle J. McKay Fri, 11 Apr 2014 08:24:02 +0000 (01:24 -0700)

test: fix t7001 cp to use POSIX options

Since 11502468 and 04c1ee57 (both first appearing in v1.8.5), the
t7001-mv test has used "cp -a" to perform a copy in several of the
tests.

However, the "-a" option is not required for a POSIX cp utility and
some platforms' cp utilities do not support it.

The POSIX equivalent of -a is -R -P -p.

Change "cp -a" to "cp -R -P -p" so that the t7001-mv test works
on systems with a cp utility that only implements the POSIX
required set of options and not the "-a" option.

Signed-off-by: Kyle J. McKay <mackyle@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

read-cache.c: verify index file before we opportunistic... Yiannis Marangos Thu, 10 Apr 2014 18:31:21 +0000 (21:31 +0300)

read-cache.c: verify index file before we opportunistically update it

Before we proceed to opportunistically update the index (often done
by an otherwise read-only operation like "git status" and "git diff"
that internally refreshes the index), we must verify that the
current index file is the same as the one that we read earlier
before we took the lock on it, in order to avoid a possible race.

In the example below git-status does "opportunistic update" and
git-rebase updates the index, but the race can happen in general.

1. process A calls git-rebase (or does anything that uses the index)

2. process A applies 1st commit

3. process B calls git-status (or does anything that updates the index)

4. process B reads index

5. process A applies 2nd commit

6. process B takes the lock, then overwrites process A's changes.

7. process A applies 3rd commit

As an end result the 3rd commit will have a revert of the 2nd commit.
When process B takes the lock, it needs to make sure that the index
hasn't changed since step 4.

Signed-off-by: Yiannis Marangos <yiannis.marangos@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

wrapper.c: add xpread() similar to xread()Yiannis Marangos Thu, 10 Apr 2014 18:54:12 +0000 (21:54 +0300)

wrapper.c: add xpread() similar to xread()

It is a common mistake to call read(2)/pread(2) and forget to
anticipate that they may return error with EAGAIN/EINTR when the
system call is interrupted.

We have xread() helper to relieve callers of read(2) from having to
worry about it; add xpread() helper to do the same for pread(2).

Update the caller in the builtin/index-pack.c and the mmap emulation
in compat/.

Signed-off-by: Yiannis Marangos <yiannis.marangos@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

completion: fix completing args of aliased "push",... Felipe Contreras Wed, 9 Apr 2014 18:50:04 +0000 (13:50 -0500)

completion: fix completing args of aliased "push", "fetch", etc.

Some commands need the first word to determine the actual action that is
being executed, however, the command is wrong when we use an alias, for
example 'alias.p=push', if we try to complete 'git p origin ', the
result would be wrong because __git_complete_remote_or_refspec() doesn't
know where it came from.

So let's override words[1], so the alias 'p' is override by the actual
command, 'push'.

Reported-by: Aymeric Beaumet <aymeric.beaumet@gmail.com>
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

remote-bzr: include authors field in pushed commitsdequis Wed, 9 Apr 2014 18:50:03 +0000 (13:50 -0500)

remote-bzr: include authors field in pushed commits

Tests-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

remote-bzr: add support for older versionsFelipe Contreras Wed, 9 Apr 2014 18:50:02 +0000 (13:50 -0500)

remote-bzr: add support for older versions

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

remote-hg: always normalize pathsFelipe Contreras Wed, 9 Apr 2014 18:50:01 +0000 (13:50 -0500)

remote-hg: always normalize paths

Apparently Mercurial can have paths such as 'foo//bar', so normalize all
paths.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

remote-helpers: allow all tests running from any dirFelipe Contreras Wed, 9 Apr 2014 18:50:00 +0000 (13:50 -0500)

remote-helpers: allow all tests running from any dir

Commit d3243d7 (test-bzr.sh, test-hg.sh: allow running from any dir)
allowed the tests to run from any directory, however, it didn't update
all the tests.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Sync with 1.9.2Junio C Hamano Wed, 9 Apr 2014 19:06:14 +0000 (12:06 -0700)

Sync with 1.9.2

* maint:
Git 1.9.2
doc/http-backend: missing accent grave in literal mark-up

Git 1.9.2 v1.9.2Junio C Hamano Wed, 9 Apr 2014 19:04:34 +0000 (12:04 -0700)

Git 1.9.2

The second maintenance release for Git 1.9; contains all the fixes
that are scheduled to appear in Git 2.0.

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

Merge branch 'jl/nor-or-nand-and' into maintJunio C Hamano Wed, 9 Apr 2014 19:03:26 +0000 (12:03 -0700)

Merge branch 'jl/nor-or-nand-and' into maint

* jl/nor-or-nand-and:
code and test: fix misuses of "nor"
comments: fix misuses of "nor"
contrib: fix misuses of "nor"
Documentation: fix misuses of "nor"

Merge branch 'cn/fetch-prune-overlapping-destination... Junio C Hamano Wed, 9 Apr 2014 19:02:41 +0000 (12:02 -0700)

Merge branch 'cn/fetch-prune-overlapping-destination' into maint

* cn/fetch-prune-overlapping-destination:
fetch: handle overlaping refspecs on --prune
fetch: add a failing test for prunning with overlapping refspecs

Merge branch 'mh/update-ref-batch-create-fix' into... Junio C Hamano Wed, 9 Apr 2014 19:01:28 +0000 (12:01 -0700)

Merge branch 'mh/update-ref-batch-create-fix' into maint

* mh/update-ref-batch-create-fix:
update-ref: fail create operation over stdin if ref already exists

Merge branch 'jk/commit-dates-parsing-fix' into maintJunio C Hamano Wed, 9 Apr 2014 18:59:38 +0000 (11:59 -0700)

Merge branch 'jk/commit-dates-parsing-fix' into maint

* jk/commit-dates-parsing-fix:
t4212: loosen far-in-future test for AIX
date: recognize bogus FreeBSD gmtime output

Merge branch 'jc/fix-diff-no-index-diff-opt-parse'... Junio C Hamano Wed, 9 Apr 2014 18:59:16 +0000 (11:59 -0700)

Merge branch 'jc/fix-diff-no-index-diff-opt-parse' into maint

* jc/fix-diff-no-index-diff-opt-parse:
diff-no-index: correctly diagnose error return from diff_opt_parse()

Merge commit 'doc/http-backend: missing accent grave... Junio C Hamano Wed, 9 Apr 2014 18:45:04 +0000 (11:45 -0700)

Merge commit 'doc/http-backend: missing accent grave in literal mark-up'

* commit '5df05146d5cb94628a3dfc53063c802ee1152cec':
doc/http-backend: missing accent grave in literal mark-up

doc/http-backend: missing accent grave in literal mark-upThomas Ackermann Wed, 9 Apr 2014 18:17:38 +0000 (20:17 +0200)

doc/http-backend: missing accent grave in literal mark-up

Signed-off-by: Thomas Ackermann <th.acker@arcor.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

utf8.c: partially update to version 6.3Torsten Bögershausen Mon, 7 Apr 2014 19:39:41 +0000 (21:39 +0200)

utf8.c: partially update to version 6.3

Unicode 6.3 defines more code points as combining or accents. For
example, the character "ö" could be expressed as an "o" followed by
U+0308 COMBINING DIARESIS (aka umlaut, double-dot-above). We should
consider that such a sequence of two codepoints occupies one display
column for the alignment purposes, and for that, git_wcwidth()
should return 0 for them. Affected codepoints are:

U+0358..U+035C
U+0487
U+05A2, U+05BA, U+05C5, U+05C7
U+0604, U+0616..U+061A, U+0659..U+065F

Earlier unicode standards had defined these as "reserved".

Only the range 0..U+07FF has been checked to see which codepoints
need to be marked as 0-width while preparing for this commit; more
updates may be needed.

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

mingw: activate allocaKirill Smelkov Wed, 9 Apr 2014 12:48:27 +0000 (16:48 +0400)

mingw: activate alloca

Both MSVC and MINGW have alloca(3) definitions in malloc.h, so by moving
win32-compat alloca.h from compat/vcbuild/include/ to compat/win32/ ,
which is included by both MSVC and MINGW CFLAGS, we can make alloca()
work on both those Windows environments.

In MINGW, malloc.h has explicit check for GNUC and if it is so, defines
alloca to __builtin_alloca, so it looks like we don't need to add any
code to here-shipped alloca.h to get optimum performance.

Compile-tested on Windows in MSysGit.

Signed-off-by: Kirill Smelkov <kirr@mns.spb.ru>
Acked-by: Erik Faye-Lund <kusmabite@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Update draft release notes to 2.0Junio C Hamano Tue, 8 Apr 2014 19:11:17 +0000 (12:11 -0700)

Update draft release notes to 2.0

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

Merge branch 'maint'Junio C Hamano Tue, 8 Apr 2014 19:08:59 +0000 (12:08 -0700)

Merge branch 'maint'

* maint:
Update draft release notes to 1.9.2

Update draft release notes to 1.9.2Junio C Hamano Tue, 8 Apr 2014 19:08:34 +0000 (12:08 -0700)

Update draft release notes to 1.9.2

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

Merge branch 'mm/status-porcelain-format-i18n-fix'... Junio C Hamano Tue, 8 Apr 2014 19:07:06 +0000 (12:07 -0700)

Merge branch 'mm/status-porcelain-format-i18n-fix' into maint

* mm/status-porcelain-format-i18n-fix:
status: disable translation when --porcelain is used

Merge branch 'bp/commit-p-editor' into maintJunio C Hamano Tue, 8 Apr 2014 19:07:06 +0000 (12:07 -0700)

Merge branch 'bp/commit-p-editor' into maint

* bp/commit-p-editor:
run-command: mark run_hook_with_custom_index as deprecated
merge hook tests: fix and update tests
merge: fix GIT_EDITOR override for commit hook
commit: fix patch hunk editing with "commit -p -m"
test patch hunk editing with "commit -p -m"
merge hook tests: use 'test_must_fail' instead of '!'
merge hook tests: fix missing '&&' in test

Merge branch 'jk/pack-bitmap'Junio C Hamano Tue, 8 Apr 2014 19:00:32 +0000 (12:00 -0700)

Merge branch 'jk/pack-bitmap'

* jk/pack-bitmap:
pack-objects: do not reuse packfiles without --delta-base-offset
add `ignore_missing_links` mode to revwalk

Merge branch 'jl/nor-or-nand-and'Junio C Hamano Tue, 8 Apr 2014 19:00:27 +0000 (12:00 -0700)

Merge branch 'jl/nor-or-nand-and'

Eradicate mistaken use of "nor" (that is, essentially "nor" used
not in "neither A nor B" ;-)) from in-code comments, command output
strings, and documentations.

* jl/nor-or-nand-and:
code and test: fix misuses of "nor"
comments: fix misuses of "nor"
contrib: fix misuses of "nor"
Documentation: fix misuses of "nor"

Merge branch 'mh/update-ref-batch-create-fix'Junio C Hamano Tue, 8 Apr 2014 19:00:22 +0000 (12:00 -0700)

Merge branch 'mh/update-ref-batch-create-fix'

* mh/update-ref-batch-create-fix:
update-ref: fail create operation over stdin if ref already exists

Merge branch 'mr/opt-set-ptr'Junio C Hamano Tue, 8 Apr 2014 19:00:16 +0000 (12:00 -0700)

Merge branch 'mr/opt-set-ptr'

OPT_SET_PTR() implementation was broken on IL32P64 platforms;
it turns out that the macro is not used by any real user.

* mr/opt-set-ptr:
parse-options: remove unused OPT_SET_PTR
parse-options: add cast to correct pointer type to OPT_SET_PTR
MSVC: fix t0040-parse-options crash

Merge branch 'ib/rev-parse-parseopt-argh'Junio C Hamano Tue, 8 Apr 2014 19:00:08 +0000 (12:00 -0700)

Merge branch 'ib/rev-parse-parseopt-argh'

Finishing touch to a new topic scheduled for 2.0.

* ib/rev-parse-parseopt-argh:
rev-parse: fix typo in example on manpage

Merge branch 'mr/msvc-link-with-invalidcontinue'Junio C Hamano Tue, 8 Apr 2014 18:59:46 +0000 (11:59 -0700)

Merge branch 'mr/msvc-link-with-invalidcontinue'

* mr/msvc-link-with-invalidcontinue:
MSVC: link in invalidcontinue.obj for better POSIX compatibility

Merge branch 'jc/rev-parse-argh-dashed-multi-words'Junio C Hamano Tue, 8 Apr 2014 18:59:27 +0000 (11:59 -0700)

Merge branch 'jc/rev-parse-argh-dashed-multi-words'

Make sure that the help text given to describe the "<param>" part
of the "git cmd --option=<param>" does not contain SP or _,
e.g. "--gpg-sign=<key-id>" option for "git commit" is not spelled
as "--gpg-sign=<key id>".

* jc/rev-parse-argh-dashed-multi-words:
parse-options: make sure argh string does not have SP or _
update-index: teach --cacheinfo a new syntax "mode,sha1,path"
parse-options: multi-word argh should use dash to separate words

Merge branch 'jk/commit-dates-parsing-fix'Junio C Hamano Tue, 8 Apr 2014 18:59:05 +0000 (11:59 -0700)

Merge branch 'jk/commit-dates-parsing-fix'

Finishing touches for portability.

* jk/commit-dates-parsing-fix:
t4212: loosen far-in-future test for AIX
date: recognize bogus FreeBSD gmtime output

git-p4: explicitly specify that HEAD is a revisionVlad Dogaru Mon, 7 Apr 2014 13:19:11 +0000 (16:19 +0300)

git-p4: explicitly specify that HEAD is a revision

'git p4 rebase' fails with the following message if there is a file
named HEAD in the current directory:

fatal: ambiguous argument 'HEAD': both revision and filename
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'

Take the suggestion above and explicitly state that HEAD should be
treated as a revision.

Signed-off-by: Vlad Dogaru <vdogaru@ixiacom.com>
Acked-by: Pete Wyckoff <pw@padd.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

combine-diff: speed it up, by using multiparent diff... Kirill Smelkov Mon, 24 Feb 2014 16:21:51 +0000 (20:21 +0400)

combine-diff: speed it up, by using multiparent diff tree-walker directly

As was recently shown in "combine-diff: optimize
combine_diff_path sets intersection", combine-diff runs very slowly. In
that commit we optimized paths sets intersection, but that accounted
only for ~ 25% of the slowness, and as my tracing showed, for linux.git
v3.10..v3.11, for merges a lot of time is spent computing
diff(commit,commit^2) just to only then intersect that huge diff to
almost small set of files from diff(commit,commit^1).

In previous commit, we described the problem in more details, and
reworked the diff tree-walker to be general one - i.e. to work in
multiple parent case too. Now is the time to take advantage of it for
finding paths for combine diff.

The implementation is straightforward - if we know, we can get generated
diff paths directly, and at present that means no diff filtering or
rename/copy detection was requested(*), we can call multiparent tree-walker
directly and get ready paths.

(*) because e.g. at present, all diffcore transformations work on
diff_filepair queues, but in the future, that limitation can be
lifted, if filters would operate directly on combine_diff_paths.

Timings for `git log --raw --no-abbrev --no-renames` without `-c` ("git log")
and with `-c` ("git log -c") and with `-c --merges` ("git log -c --merges")
before and after the patch are as follows:

linux.git v3.10..v3.11

log log -c log -c --merges

before 1.9s 16.4s 15.2s
after 1.9s 2.4s 1.1s

The result stayed the same.

Signed-off-by: Kirill Smelkov <kirr@mns.spb.ru>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

tree-diff: rework diff_tree() to generate diffs for... Kirill Smelkov Sun, 6 Apr 2014 21:46:26 +0000 (01:46 +0400)

tree-diff: rework diff_tree() to generate diffs for multiparent cases as well

Previously diff_tree(), which is now named ll_diff_tree_sha1(), was
generating diff_filepair(s) for two trees t1 and t2, and that was
usually used for a commit as t1=HEAD~, and t2=HEAD - i.e. to see changes
a commit introduces.

In Git, however, we have fundamentally built flexibility in that a
commit can have many parents - 1 for a plain commit, 2 for a simple merge,
but also more than 2 for merging several heads at once.

For merges there is a so called combine-diff, which shows diff, a merge
introduces by itself, omitting changes done by any parent. That works
through first finding paths, that are different to all parents, and then
showing generalized diff, with separate columns for +/- for each parent.
The code lives in combine-diff.c .

There is an impedance mismatch, however, in that a commit could
generally have any number of parents, and that while diffing trees, we
divide cases for 2-tree diffs and more-than-2-tree diffs. I mean there
is no special casing for multiple parents commits in e.g.
revision-walker .

That impedance mismatch *hurts* *performance* *badly* for generating
combined diffs - in "combine-diff: optimize combine_diff_path
sets intersection" I've already removed some slowness from it, but from
the timings provided there, it could be seen, that combined diffs still
cost more than an order of magnitude more cpu time, compared to diff for
usual commits, and that would only be an optimistic estimate, if we take
into account that for e.g. linux.git there is only one merge for several
dozens of plain commits.

That slowness comes from the fact that currently, while generating
combined diff, a lot of time is spent computing diff(commit,commit^2)
just to only then intersect that huge diff to almost small set of files
from diff(commit,commit^1).

That's because at present, to compute combine-diff, for first finding
paths, that "every parent touches", we use the following combine-diff
property/definition:

D(A,P1...Pn) = D(A,P1) ^ ... ^ D(A,Pn) (w.r.t. paths)

where

D(A,P1...Pn) is combined diff between commit A, and parents Pi

and

D(A,Pi) is usual two-tree diff Pi..A

So if any of that D(A,Pi) is huge, tracting 1 n-parent combine-diff as n
1-parent diffs and intersecting results will be slow.

And usually, for linux.git and other topic-based workflows, that
D(A,P2) is huge, because, if merge-base of A and P2, is several dozens
of merges (from A, via first parent) below, that D(A,P2) will be diffing
sum of merges from several subsystems to 1 subsystem.

The solution is to avoid computing n 1-parent diffs, and to find
changed-to-all-parents paths via scanning A's and all Pi's trees
simultaneously, at each step comparing their entries, and based on that
comparison, populate paths result, and deduce we could *skip*
*recursing* into subdirectories, if at least for 1 parent, sha1 of that
dir tree is the same as in A. That would save us from doing significant
amount of needless work.

Such approach is very similar to what diff_tree() does, only there we
deal with scanning only 2 trees simultaneously, and for n+1 tree, the
logic is a bit more complex:

D(T,P1...Pn) calculation scheme
-------------------------------

D(T,P1...Pn) = D(T,P1) ^ ... ^ D(T,Pn) (regarding resulting paths set)

D(T,Pj) - diff between T..Pj
D(T,P1...Pn) - combined diff from T to parents P1,...,Pn

We start from all trees, which are sorted, and compare their entries in
lock-step:

T P1 Pn
- - -
|t| |p1| |pn|
|-| |--| ... |--| imin = argmin(p1...pn)
| | | | | |
|-| |--| |--|
|.| |. | |. |
. . .
. . .

at any time there could be 3 cases:

1) t < p[imin];
2) t > p[imin];
3) t = p[imin].

Schematic deduction of what every case means, and what to do, follows:

1) t < p[imin] -> ∀j t ∉ Pj -> "+t" ∈ D(T,Pj) -> D += "+t"; t↓

2) t > p[imin]

2.1) ∃j: pj > p[imin] -> "-p[imin]" ∉ D(T,Pj) -> D += ø; ∀ pi=p[imin] pi↓
2.2) ∀i pi = p[imin] -> pi ∉ T -> "-pi" ∈ D(T,Pi) -> D += "-p[imin]"; ∀i pi↓

3) t = p[imin]

3.1) ∃j: pj > p[imin] -> "+t" ∈ D(T,Pj) -> only pi=p[imin] remains to investigate
3.2) pi = p[imin] -> investigate δ(t,pi)
|
|
v

3.1+3.2) looking at δ(t,pi) ∀i: pi=p[imin] - if all != ø ->

⎧δ(t,pi) - if pi=p[imin]
-> D += ⎨
⎩"+t" - if pi>p[imin]

in any case t↓ ∀ pi=p[imin] pi↓

~

For comparison, here is how diff_tree() works:

D(A,B) calculation scheme
-------------------------

A B
- -
|a| |b| a < b -> a ∉ B -> D(A,B) += +a a↓
|-| |-| a > b -> b ∉ A -> D(A,B) += -b b↓
| | | | a = b -> investigate δ(a,b) a↓ b↓
|-| |-|
|.| |.|
. .
. .

~~~~~~~~

This patch generalizes diff tree-walker to work with arbitrary number of
parents as described above - i.e. now there is a resulting tree t, and
some parents trees tp[i] i=[0..nparent). The generalization builds on
the fact that usual diff

D(A,B)

is by definition the same as combined diff

D(A,[B]),

so if we could rework the code for common case and make it be not slower
for nparent=1 case, usual diff(t1,t2) generation will not be slower, and
multiparent diff tree-walker would greatly benefit generating
combine-diff.

What we do is as follows:

1) diff tree-walker ll_diff_tree_sha1() is internally reworked to be
a paths generator (new name diff_tree_paths()), with each generated path
being `struct combine_diff_path` with info for path, new sha1,mode and for
every parent which sha1,mode it was in it.

2) From that info, we can still generate usual diff queue with
struct diff_filepairs, via "exporting" generated
combine_diff_path, if we know we run for nparent=1 case.
(see emit_diff() which is now named emit_diff_first_parent_only())

3) In order for diff_can_quit_early(), which checks

DIFF_OPT_TST(opt, HAS_CHANGES))

to work, that exporting have to be happening not in bulk, but
incrementally, one diff path at a time.

For such consumers, there is a new callback in diff_options
introduced:

->pathchange(opt, struct combine_diff_path *)

which, if set to !NULL, is called for every generated path.

(see new compat ll_diff_tree_sha1() wrapper around new paths
generator for setup)

4) The paths generation itself, is reworked from previous
ll_diff_tree_sha1() code according to "D(A,P1...Pn) calculation
scheme" provided above:

On the start we allocate [nparent] arrays in place what was
earlier just for one parent tree.

then we just generalize loops, and comparison according to the
algorithm.

Some notes(*):

1) alloca(), for small arrays, is used for "runs not slower for
nparent=1 case than before" goal - if we change it to xmalloc()/free()
the timings get ~1% worse. For alloca() we use just-introduced
xalloca/xalloca_free compatibility wrappers, so it should not be a
portability problem.

2) For every parent tree, we need to keep a tag, whether entry from that
parent equals to entry from minimal parent. For performance reasons I'm
keeping that tag in entry's mode field in unused bit - see S_IFXMIN_NEQ.
Not doing so, we'd need to alloca another [nparent] array, which hurts
performance.

3) For emitted paths, memory could be reused, if we know the path was
processed via callback and will not be needed later. We use efficient
hand-made realloc-style path_appendnew(), that saves us from ~1-1.5%
of potential additional slowdown.

4) goto(s) are used in several places, as the code executes a little bit
faster with lowered register pressure.

Also

- we should now check for FIND_COPIES_HARDER not only when two entries
names are the same, and their hashes are equal, but also for a case,
when a path was removed from some of all parents having it.

The reason is, if we don't, that path won't be emitted at all (see
"a > xi" case), and we'll just skip it, and FIND_COPIES_HARDER wants
all paths - with diff or without - to be emitted, to be later analyzed
for being copies sources.

The new check is only necessary for nparent >1, as for nparent=1 case
xmin_eqtotal always =1 =nparent, and a path is always added to diff as
removal.

~~~~~~~~

Timings for

# without -c, i.e. testing only nparent=1 case
`git log --raw --no-abbrev --no-renames`

before and after the patch are as follows:

navy.git linux.git v3.10..v3.11

before 0.611s 1.889s
after 0.619s 1.907s
slowdown 1.3% 0.9%

This timings show we did no harm to usual diff(tree1,tree2) generation.
From the table we can see that we actually did ~1% slowdown, but I think
I've "earned" that 1% in the previous patch ("tree-diff: reuse base
str(buf) memory on sub-tree recursion", HEAD~~) so for nparent=1 case,
net timings stays approximately the same.

The output also stayed the same.

(*) If we revert 1)-4) to more usual techniques, for nparent=1 case,
we'll get ~2-2.5% of additional slowdown, which I've tried to avoid, as
"do no harm for nparent=1 case" rule.

For linux.git, combined diff will run an order of magnitude faster and
appropriate timings will be provided in the next commit, as we'll be
taking advantage of the new diff tree-walker for combined-diff
generation there.

P.S. and combined diff is not some exotic/for-play-only stuff - for
example for a program I write to represent Git archives as readonly
filesystem, there is initial scan with

`git log --reverse --raw --no-abbrev --no-renames -c`

to extract log of what was created/changed when, as a result building a
map

{} sha1 -> in which commit (and date) a content was added

that `-c` means also show combined diff for merges, and without them, if
a merge is non-trivial (merges changes from two parents with both having
separate changes to a file), or an evil one, the map will not be full,
i.e. some valid sha1 would be absent from it.

That case was my initial motivation for combined diffs speedup.

Signed-off-by: Kirill Smelkov <kirr@mns.spb.ru>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

ref_transaction_commit(): work with transaction->update... Michael Haggerty Mon, 7 Apr 2014 13:48:18 +0000 (15:48 +0200)

ref_transaction_commit(): work with transaction->updates in place

Now that we free the transaction when we are done, there is no need to
make a copy of transaction->updates before working with it.

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

struct ref_update: add a type fieldMichael Haggerty Mon, 7 Apr 2014 13:48:17 +0000 (15:48 +0200)

struct ref_update: add a type field

It used to be that ref_transaction_commit() allocated a temporary
array to hold the types of references while it is working. Instead,
add a type field to ref_update that ref_transaction_commit() can use
as its scratch space.

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

struct ref_update: add a lock fieldMichael Haggerty Mon, 7 Apr 2014 13:48:16 +0000 (15:48 +0200)

struct ref_update: add a lock field

Now that we manage ref_update objects internally, we can use them to
hold some of the scratch space we need when actually carrying out the
updates. Store the (struct ref_lock *) there.

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

ref_transaction_commit(): simplify code using temporary... Michael Haggerty Mon, 7 Apr 2014 13:48:15 +0000 (15:48 +0200)

ref_transaction_commit(): simplify code using temporary variables

Use temporary variables in the for-loop blocks to simplify expressions
in the rest of the loop.

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

struct ref_update: store refname as a FLEX_ARRAYMichael Haggerty Mon, 7 Apr 2014 13:48:14 +0000 (15:48 +0200)

struct ref_update: store refname as a FLEX_ARRAY

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

struct ref_update: rename field "ref_name" to "refname"Michael Haggerty Mon, 7 Apr 2014 13:48:13 +0000 (15:48 +0200)

struct ref_update: rename field "ref_name" to "refname"

This is consistent with the usual nomenclature.

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

refs: remove API function update_refs()Michael Haggerty Mon, 7 Apr 2014 13:48:12 +0000 (15:48 +0200)

refs: remove API function update_refs()

It has been superseded by reference transactions. This also means
that struct ref_update can become private.

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

update-ref --stdin: reimplement using reference transac... Michael Haggerty Mon, 7 Apr 2014 13:48:11 +0000 (15:48 +0200)

update-ref --stdin: reimplement using reference transactions

This change is mostly clerical: the parse_cmd_*() functions need to
use local variables rather than a struct ref_update to collect the
arguments needed for each update, and then call ref_transaction_*() to
queue the change rather than building up the list of changes at the
caller side.

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

refs: add a concept of a reference transactionMichael Haggerty Mon, 7 Apr 2014 13:48:10 +0000 (15:48 +0200)

refs: add a concept of a reference transaction

Build out the API for dealing with a bunch of reference checks and
changes within a transaction. Define an opaque ref_transaction type
that is managed entirely within refs.c. Introduce functions for
beginning a transaction, adding updates to a transaction, and
committing/rolling back a transaction.

This API will soon replace update_refs().

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

update-ref --stdin: harmonize error messagesMichael Haggerty Mon, 7 Apr 2014 13:48:09 +0000 (15:48 +0200)

update-ref --stdin: harmonize error messages

Make (most of) the error messages for invalid input have the same
format [1]:

$COMMAND [SP $REFNAME]: $MESSAGE

Update the tests accordingly.

[1] A few error messages are left with their old form, because
$COMMAND and $REFNAME aren't passed all the way down the call
stack. Maybe those sites should be changed some day, too.

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

update-ref --stdin: improve the error message for unexp... Michael Haggerty Mon, 7 Apr 2014 13:48:08 +0000 (15:48 +0200)

update-ref --stdin: improve the error message for unexpected EOF

Distinguish this error from the error that an argument is missing for
another reason. Update the tests accordingly.

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

t1400: test one mistake at a timeMichael Haggerty Mon, 7 Apr 2014 13:48:07 +0000 (15:48 +0200)

t1400: test one mistake at a time

This case wants to test passing a bad refname to the "update" command.
But it also passes too few arguments to "update", which muddles the
situation: which error should be diagnosed? So split this test into
two:

* One that passes too few arguments to update

* One that passes all three arguments to "update", but with a bad
refname.

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