git
10 years agogit-remote-mediawiki: allow stop/start-ing the test server
Matthieu Moy [Wed, 23 Apr 2014 14:34:28 +0000 (16:34 +0200)] 
git-remote-mediawiki: allow stop/start-ing the test server

Previously, the user had to launch a complete re-install after a lighttpd
stop (e.g. a reboot).

Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
10 years agoUpdate draft release notes to 2.0
Junio C Hamano [Mon, 21 Apr 2014 18:54:29 +0000 (11:54 -0700)] 
Update draft release notes to 2.0

Signed-off-by: Junio C Hamano <gitster@pobox.com>
10 years agoMerge git://bogomips.org/git-svn
Junio C Hamano [Mon, 21 Apr 2014 17:53:09 +0000 (10:53 -0700)] 
Merge git://bogomips.org/git-svn

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

10 years agoMerge branch 'jx/i18n'
Junio C Hamano [Mon, 21 Apr 2014 17:42:52 +0000 (10:42 -0700)] 
Merge branch 'jx/i18n'

* jx/i18n:
  i18n: mention "TRANSLATORS:" marker in Documentation/CodingGuidelines
  i18n: only extract comments marked with "TRANSLATORS:"
  i18n: remove obsolete comments for translators in diffstat generation
  i18n: fix uncatchable comments for translators in date.c

10 years agoMerge branch 'km/avoid-non-function-return-in-rebase'
Junio C Hamano [Mon, 21 Apr 2014 17:42:45 +0000 (10:42 -0700)] 
Merge branch 'km/avoid-non-function-return-in-rebase'

Work around /bin/sh that does not like "return" at the top-level
of a file that is dot-sourced from inside a function definition.

* km/avoid-non-function-return-in-rebase:
  Revert "rebase: fix run_specific_rebase's use of "return" on FreeBSD"
  rebase: avoid non-function use of "return" on FreeBSD

10 years agoMerge branch 'ep/shell-command-substitution'
Junio C Hamano [Mon, 21 Apr 2014 17:42:41 +0000 (10:42 -0700)] 
Merge branch 'ep/shell-command-substitution'

* ep/shell-command-substitution:
  t9362-mw-to-git-utf8.sh: use the $( ... ) construct for command substitution
  t9360-mw-to-git-clone.sh: use the $( ... ) construct for command substitution
  git-tag.sh: use the $( ... ) construct for command substitution
  git-revert.sh: use the $( ... ) construct for command substitution
  git-resolve.sh: use the $( ... ) construct for command substitution
  git-repack.sh: use the $( ... ) construct for command substitution
  git-merge.sh: use the $( ... ) construct for command substitution
  git-ls-remote.sh: use the $( ... ) construct for command substitution
  git-fetch.sh: use the $( ... ) construct for command substitution
  git-commit.sh: use the $( ... ) construct for command substitution
  git-clone.sh: use the $( ... ) construct for command substitution
  git-checkout.sh: use the $( ... ) construct for command substitution
  install-webdoc.sh: use the $( ... ) construct for command substitution
  howto-index.sh: use the $( ... ) construct for command substitution

10 years agoGit 2.0: git svn: Set default --prefix='origin/' if --prefix is not given
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>
10 years agoGit 2.0-rc0 v2.0.0-rc0
Junio 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>
10 years agoMerge 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

10 years agoMerge 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

10 years agoMerge 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.

10 years agoMerge 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

10 years agoi18n: mention "TRANSLATORS:" marker in Documentation/CodingGuidelines
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>
10 years agot9362-mw-to-git-utf8.sh: use the $( ... ) construct for command substitution
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>
10 years agot9360-mw-to-git-clone.sh: use the $( ... ) construct for command substitution
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>
10 years agogit-tag.sh: use the $( ... ) construct for command substitution
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>
10 years agogit-revert.sh: use the $( ... ) construct for command substitution
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>
10 years agogit-resolve.sh: use the $( ... ) construct for command substitution
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>
10 years agogit-repack.sh: use the $( ... ) construct for command substitution
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>
10 years agogit-merge.sh: use the $( ... ) construct for command substitution
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>
10 years agogit-ls-remote.sh: use the $( ... ) construct for command substitution
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>
10 years agogit-fetch.sh: use the $( ... ) construct for command substitution
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>
10 years agogit-commit.sh: use the $( ... ) construct for command substitution
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>
10 years agogit-clone.sh: use the $( ... ) construct for command substitution
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>
10 years agogit-checkout.sh: use the $( ... ) construct for command substitution
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>
10 years agoinstall-webdoc.sh: use the $( ... ) construct for command substitution
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>
10 years agohowto-index.sh: use the $( ... ) construct for command substitution
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>
10 years agoi18n: 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>
10 years agoi18n: remove obsolete comments for translators in diffstat generation
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>
10 years agoi18n: fix uncatchable comments for translators in date.c
Jiang 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>
10 years agoRevert "rebase: fix run_specific_rebase's use of "return" on FreeBSD"
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>
10 years agorebase: avoid non-function use of "return" on FreeBSD
Kyle J. McKay [Fri, 11 Apr 2014 08:28:17 +0000 (01:28 -0700)] 
rebase: avoid non-function use of "return" on FreeBSD

Since a1549e1015d4bf2e 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>
10 years agoUpdate draft release notes for 2.0
Junio 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>
10 years agoMerge 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

10 years agoMerge 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

10 years agoMerge 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

10 years agoMerge 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

10 years agoconfig.c: mark die_bad_number as NORETURN
Jeff 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>
10 years agoprompt: fix missing file errors in zsh
Felipe 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>
10 years agoremote-bzr: trivial test fix
Felipe 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>
10 years agotest: fix t5560 on FreeBSD
Kyle 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>
10 years agotest: fix t7001 cp to use POSIX options
Kyle 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>
10 years agocompletion: fix completing args of aliased "push", "fetch", etc.
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>
10 years agoremote-bzr: include authors field in pushed commits
dequis [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>
10 years agoremote-bzr: add support for older versions
Felipe 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>
10 years agoremote-hg: always normalize paths
Felipe 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>
10 years agoremote-helpers: allow all tests running from any dir
Felipe 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>
10 years agoSync with 1.9.2
Junio 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

10 years agoGit 1.9.2 v1.9.2
Junio 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>
10 years agoMerge branch 'jl/nor-or-nand-and' into maint
Junio 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"

10 years agoMerge branch 'cn/fetch-prune-overlapping-destination' into maint
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

10 years agoMerge branch 'mh/update-ref-batch-create-fix' into maint
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

10 years agoMerge branch 'jk/commit-dates-parsing-fix' into maint
Junio 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

10 years agoMerge branch 'jc/fix-diff-no-index-diff-opt-parse' into maint
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()

10 years agoMerge commit 'doc/http-backend: missing accent grave in literal mark-up'
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

10 years agodoc/http-backend: missing accent grave in literal mark-up
Thomas 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>
10 years agoutf8.c: partially update to version 6.3
Torsten 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>
10 years agoUpdate draft release notes to 2.0
Junio 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>
10 years agoMerge 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

10 years agoUpdate draft release notes to 1.9.2
Junio 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>
10 years agoMerge branch 'mm/status-porcelain-format-i18n-fix' into maint
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

10 years agoMerge branch 'bp/commit-p-editor' into maint
Junio 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

10 years agoMerge 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

10 years agoMerge 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"

10 years agoMerge 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

10 years agoMerge 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

10 years agoMerge 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

10 years agoMerge 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

10 years agoMerge 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

10 years agoMerge 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

10 years agogit-p4: explicitly specify that HEAD is a revision
Vlad 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>
10 years agogit-multimail: update to version 1.0.0
Michael Haggerty [Mon, 7 Apr 2014 15:20:40 +0000 (17:20 +0200)] 
git-multimail: update to version 1.0.0

This commit contains the squashed changes from the upstream
git-multimail repository since the last code drop.  Highlights:

* Fix encoding of non-ASCII email addresses in email headers.

* Fix backwards-compatibility bugs for older Python 2.x versions.

* Fix a backwards-compatibility bug for Git 1.7.1.

* Add an option commitDiffOpts to customize logs for revisions.

* Pass "-oi" to sendmail by default to prevent premature
  termination
  on a line containing only ".".

* Stagger email "Date:" values in an attempt to help mail clients
  thread the emails in the right order.

* If a mailing list setting is missing, just skip sending the
  corresponding email (with a warning) instead of failing.

* Add a X-Git-Host header that can be used for email filtering.

* Allow the sender's fully-qualified domain name to be configured.

* Minor documentation improvements.

* Add a CHANGES file.

Contributions-by: Raphaël Hertzog <hertzog@debian.org>
Contributions-by: Eric Berberich <eric.berberich@gmail.com>
Contributions-by: Michiel Holtkamp <git@elfstone.nl>
Contributions-by: Malte Swart <mswart@devtation.de>
Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
10 years agopack-objects: do not reuse packfiles without --delta-base-offset
Jeff King [Wed, 2 Apr 2014 06:39:17 +0000 (02:39 -0400)] 
pack-objects: do not reuse packfiles without --delta-base-offset

When we are sending a packfile to a remote, we currently try
to reuse a whole chunk of packfile without bothering to look
at the individual objects. This can make things like initial
clones much lighter on the server, as we can just dump the
packfile bytes.

However, it's possible that the other side cannot read our
packfile verbatim. For example, we may have objects stored
as OFS_DELTA, but the client is an antique version of git
that only understands REF_DELTA. We negotiate this
capability over the fetch protocol. A normal pack-objects
run will convert OFS_DELTA into REF_DELTA on the fly, but
the "reuse pack" code path never even looks at the objects.

This patch disables packfile reuse if the other side is
missing any capabilities that we might have used in the
on-disk pack. Right now the only one is OFS_DELTA, but we
may need to expand in the future (e.g., if packv4 introduces
new object types).

We could be more thorough and only disable reuse in this
case when we actually have an OFS_DELTA to send, but:

  1. We almost always will have one, since we prefer
     OFS_DELTA to REF_DELTA when possible. So this case
     would almost never come up.

  2. Looking through the objects defeats the purpose of the
     optimization, which is to do as little work as possible
     to get the bytes to the remote.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
10 years agoadd `ignore_missing_links` mode to revwalk
Vicent Marti [Fri, 28 Mar 2014 10:00:43 +0000 (06:00 -0400)] 
add `ignore_missing_links` mode to revwalk

When pack-objects is computing the reachability bitmap to
serve a fetch request, it can erroneously die() if some of
the UNINTERESTING objects are not present. Upload-pack
throws away HAVE lines from the client for objects we do not
have, but we may have a tip object without all of its
ancestors (e.g., if the tip is no longer reachable and was
new enough to survive a `git prune`, but some of its
reachable objects did get pruned).

In the non-bitmap case, we do a revision walk with the HAVE
objects marked as UNINTERESTING. The revision walker
explicitly ignores errors in accessing UNINTERESTING commits
to handle this case (and we do not bother looking at
UNINTERESTING trees or blobs at all).

When we have bitmaps, however, the process is quite
different.  The bitmap index for a pack-objects run is
calculated in two separate steps:

First, we perform an extensive walk from all the HAVEs to
find the full set of objects reachable from them. This walk
is usually optimized away because we are expected to hit an
object with a bitmap during the traversal, which allows us
to terminate early.

Secondly, we perform an extensive walk from all the WANTs,
which usually also terminates early because we hit a commit
with an existing bitmap.

Once we have the resulting bitmaps from the two walks, we
AND-NOT them together to obtain the resulting set of objects
we need to pack.

When we are walking the HAVE objects, the revision walker
does not know that we are walking it only to mark the
results as uninteresting. We strip out the UNINTERESTING flag,
because those objects _are_ interesting to us during the
first walk. We want to keep going to get a complete set of
reachable objects if we can.

We need some way to tell the revision walker that it's OK to
silently truncate the HAVE walk, just like it does for the
UNINTERESTING case. This patch introduces a new
`ignore_missing_links` flag to the `rev_info` struct, which
we set only for the HAVE walk.

It also adds tests to cover UNINTERESTING objects missing
from several positions: a missing blob, a missing tree, and
a missing parent commit. The missing blob already worked (as
we do not care about its contents at all), but the other two
cases caused us to die().

Note that there are a few cases we do not need to test:

  1. We do not need to test a missing tree, with the blob
     still present. Without the tree that refers to it, we
     would not know that the blob is relevant to our walk.

  2. We do not need to test a tip commit that is missing.
     Upload-pack omits these for us (and in fact, we
     complain even in the non-bitmap case if it fails to do
     so).

Reported-by: Siddharth Agarwal <sid0@fb.com>
Signed-off-by: Vicent Marti <tanoku@gmail.com>
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
10 years agoMSVC: allow using ExtUtils::MakeMaker
Marat Radchenko [Thu, 3 Apr 2014 07:34:03 +0000 (11:34 +0400)] 
MSVC: allow using ExtUtils::MakeMaker

Drop NO_PERL_MAKEMAKER from config.mak.uname for the MSVC platform.

MakeMaker is available on Windows Perl implementations and
installs modules to correct location, unlike NO_PERL_MAKEMAKER Makefile.

Signed-off-by: Marat Radchenko <marat@slonopotamus.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
10 years agoUpdate draft release notes to 2.0
Junio C Hamano [Thu, 3 Apr 2014 20:40:59 +0000 (13:40 -0700)] 
Update draft release notes to 2.0

Signed-off-by: Junio C Hamano <gitster@pobox.com>
10 years agoMerge branch 'maint'
Junio C Hamano [Thu, 3 Apr 2014 20:40:31 +0000 (13:40 -0700)] 
Merge branch 'maint'

* maint:
  Start preparing for 1.9.1

10 years agoStart preparing for 1.9.1
Junio C Hamano [Thu, 3 Apr 2014 20:37:29 +0000 (13:37 -0700)] 
Start preparing for 1.9.1

Signed-off-by: Junio C Hamano <gitster@pobox.com>
10 years agoMerge branch 'jk/mv-submodules-fix' into maint
Junio C Hamano [Thu, 3 Apr 2014 20:39:06 +0000 (13:39 -0700)] 
Merge branch 'jk/mv-submodules-fix' into maint

* jk/mv-submodules-fix:
  mv: prevent mismatched data when ignoring errors.
  builtin/mv: fix out of bounds write

Conflicts:
t/t7001-mv.sh

10 years agoMerge branch 'mh/remove-subtree-long-pathname-fix' into maint
Junio C Hamano [Thu, 3 Apr 2014 20:39:05 +0000 (13:39 -0700)] 
Merge branch 'mh/remove-subtree-long-pathname-fix' into maint

* mh/remove-subtree-long-pathname-fix:
  entry.c: fix possible buffer overflow in remove_subtree()
  checkout_entry(): use the strbuf throughout the function

10 years agoMerge branch 'jk/lib-terminal-lazy' into maint
Junio C Hamano [Thu, 3 Apr 2014 20:39:04 +0000 (13:39 -0700)] 
Merge branch 'jk/lib-terminal-lazy' into maint

* jk/lib-terminal-lazy:
  t/lib-terminal: make TTY a lazy prerequisite

10 years agoMerge branch 'nd/index-pack-error-message' into maint
Junio C Hamano [Thu, 3 Apr 2014 20:39:04 +0000 (13:39 -0700)] 
Merge branch 'nd/index-pack-error-message' into maint

* nd/index-pack-error-message:
  index-pack: report error using the correct variable

10 years agoMerge branch 'us/printf-not-echo' into maint
Junio C Hamano [Thu, 3 Apr 2014 20:39:04 +0000 (13:39 -0700)] 
Merge branch 'us/printf-not-echo' into maint

* us/printf-not-echo:
  test-lib.sh: do not "echo" caller-supplied strings
  rebase -i: do not "echo" random user-supplied strings

10 years agoMerge branch 'rr/doc-merge-strategies' into maint
Junio C Hamano [Thu, 3 Apr 2014 20:39:03 +0000 (13:39 -0700)] 
Merge branch 'rr/doc-merge-strategies' into maint

* rr/doc-merge-strategies:
  Documentation/merge-strategies: avoid hyphenated commands

10 years agoMerge branch 'jk/shallow-update-fix' into maint
Junio C Hamano [Thu, 3 Apr 2014 20:39:03 +0000 (13:39 -0700)] 
Merge branch 'jk/shallow-update-fix' into maint

* jk/shallow-update-fix:
  shallow: verify shallow file after taking lock
  shallow: automatically clean up shallow tempfiles
  shallow: use stat_validity to check for up-to-date file

10 years agoMerge branch 'jc/stash-pop-not-popped' into maint
Junio C Hamano [Thu, 3 Apr 2014 20:39:03 +0000 (13:39 -0700)] 
Merge branch 'jc/stash-pop-not-popped' into maint

* jc/stash-pop-not-popped:
  stash pop: mention we did not drop the stash upon failing to apply

10 years agoMerge branch 'jn/wt-status' into maint
Junio C Hamano [Thu, 3 Apr 2014 20:39:02 +0000 (13:39 -0700)] 
Merge branch 'jn/wt-status' into maint

* jn/wt-status:
  wt-status: lift the artificual "at least 20 columns" floor
  wt-status: i18n of section labels
  wt-status: extract the code to compute width for labels
  wt-status: make full label string to be subject to l10n

10 years agoMerge branch 'nd/gc-aggressive'
Junio C Hamano [Thu, 3 Apr 2014 19:38:46 +0000 (12:38 -0700)] 
Merge branch 'nd/gc-aggressive'

Allow tweaking the maximum length of the delta-chain produced by
"gc --aggressive".

* nd/gc-aggressive:
  environment.c: fix constness for odb_pack_keep()
  gc --aggressive: make --depth configurable

10 years agoMerge branch 'jc/fix-diff-no-index-diff-opt-parse'
Junio C Hamano [Thu, 3 Apr 2014 19:38:42 +0000 (12:38 -0700)] 
Merge branch 'jc/fix-diff-no-index-diff-opt-parse'

"diff --no-index -Mq a b" fell into an infinite loop.

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

10 years agoMerge branch 'cb/aix'
Junio C Hamano [Thu, 3 Apr 2014 19:38:38 +0000 (12:38 -0700)] 
Merge branch 'cb/aix'

* cb/aix:
  tests: don't rely on strerror text when testing rmdir failure
  dir.c: make git_fnmatch() not inline

10 years agoMerge branch 'cn/fetch-prune-overlapping-destination'
Junio C Hamano [Thu, 3 Apr 2014 19:38:18 +0000 (12:38 -0700)] 
Merge branch 'cn/fetch-prune-overlapping-destination'

Protect refs in a hierarchy that can come from more than one remote
hierarcies from incorrect removal by "git fetch --prune".

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

10 years agoMerge branch 'nd/log-show-linear-break'
Junio C Hamano [Thu, 3 Apr 2014 19:38:11 +0000 (12:38 -0700)] 
Merge branch 'nd/log-show-linear-break'

Attempts to show where a single-strand-of-pearls break in "git log"
output.

* nd/log-show-linear-break:
  log: add --show-linear-break to help see non-linear history
  object.h: centralize object flag allocation

10 years agoMerge branch 'ep/shell-command-substitution'
Junio C Hamano [Thu, 3 Apr 2014 19:38:04 +0000 (12:38 -0700)] 
Merge branch 'ep/shell-command-substitution'

* ep/shell-command-substitution:
  git-am.sh: use the $(...) construct for command substitution
  check-builtins.sh: use the $(...) construct for command substitution

10 years agoMerge branch 'ap/remote-hg-skip-null-bookmarks'
Junio C Hamano [Wed, 2 Apr 2014 21:18:23 +0000 (14:18 -0700)] 
Merge branch 'ap/remote-hg-skip-null-bookmarks'

* ap/remote-hg-skip-null-bookmarks:
  remote-hg: do not fail on invalid bookmarks

10 years agoMerge branch 'rs/pickaxe-i'
Junio C Hamano [Wed, 2 Apr 2014 21:18:19 +0000 (14:18 -0700)] 
Merge branch 'rs/pickaxe-i'

Allow the options -i/--regexp-ignore-case, --pickaxe-regex, and -S
to be used together and work as expected to perform a pickaxe
search using case-insensitive regular expression matching.

* rs/pickaxe-i:
  pickaxe: simplify kwset loop in contains()
  pickaxe: call strlen only when necessary in diffcore_pickaxe_count()
  pickaxe: move pickaxe() after pickaxe_match()
  pickaxe: merge diffcore_pickaxe_grep() and diffcore_pickaxe_count() into diffcore_pickaxe()
  pickaxe: honor -i when used with -S and --pickaxe-regex
  t4209: use helper functions to test --author
  t4209: use helper functions to test --grep
  t4209: factor out helper function test_log_icase()
  t4209: factor out helper function test_log()
  t4209: set up expectations up front

10 years agoRevert part of 384364b (Start preparing for Git 2.0, 2014-03-07)
Junio C Hamano [Tue, 1 Apr 2014 18:55:56 +0000 (11:55 -0700)] 
Revert part of 384364b (Start preparing for Git 2.0, 2014-03-07)

As we are not shipping with the submodule change, remove the
entry for it.

10 years agoRevert "submodule: explicit local branch creation in module_clone"
Junio C Hamano [Wed, 2 Apr 2014 21:15:36 +0000 (14:15 -0700)] 
Revert "submodule: explicit local branch creation in module_clone"

This reverts commit 23d25e48f5ead73c9ce233986f90791abec9f1e8, as it is
broken for users who haven't opted into the new feature of checking
out submodule.*.branch with update mode set to checkout.

10 years agoupdate-ref: fail create operation over stdin if ref already exists
Aman Gupta [Wed, 2 Apr 2014 08:09:54 +0000 (10:09 +0200)] 
update-ref: fail create operation over stdin if ref already exists

Signed-off-by: Aman Gupta <aman@tmm1.net>
Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Acked-by: Brad King <brad.king@kitware.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
10 years agot4212: loosen far-in-future test for AIX
Jeff King [Tue, 1 Apr 2014 07:43:06 +0000 (03:43 -0400)] 
t4212: loosen far-in-future test for AIX

One of the tests in t4212 checks our behavior when we feed
gmtime a date so far in the future that it gives up and
returns NULL. Some implementations, like AIX, may actually
just provide us a bogus result instead.

It's not worth it for us to come up with heuristics that
guess whether the return value is sensible or not. On good
platforms where gmtime reports the problem to us with NULL,
we will print the epoch value. On bad platforms, we will
print garbage.  But our test should be written for the
lowest common denominator so that it passes everywhere.

Reported-by: Charles Bailey <cbailey32@bloomberg.net>
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
10 years agodate: recognize bogus FreeBSD gmtime output
Jeff King [Tue, 1 Apr 2014 21:28:42 +0000 (17:28 -0400)] 
date: recognize bogus FreeBSD gmtime output

Most gmtime implementations return a NULL value when they
encounter an error (and this behavior is specified by ANSI C
and POSIX).  FreeBSD's implementation, however, will simply
leave the "struct tm" untouched.  Let's also recognize this
and convert it to a NULL (with this patch, t4212 should pass
on FreeBSD).

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