git
12 years agoUpdate draft release notes to 1.7.10.2
Junio C Hamano [Thu, 10 May 2012 17:45:42 +0000 (10:45 -0700)] 
Update draft release notes to 1.7.10.2

Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agoMerge branch 'mm/include-userpath' into maint
Junio C Hamano [Thu, 10 May 2012 17:33:05 +0000 (10:33 -0700)] 
Merge branch 'mm/include-userpath' into maint

By Jeff King
* mm/include-userpath:
  config: expand tildes in include.path variable

12 years agoMerge branch 'cc/fix-missing-va-end-in-revert' into maint
Junio C Hamano [Thu, 10 May 2012 17:32:43 +0000 (10:32 -0700)] 
Merge branch 'cc/fix-missing-va-end-in-revert' into maint

By Christian Couder
* cc/fix-missing-va-end-in-revert:
  revert: add missing va_end

12 years agoMerge branch 'bw/test-fix-grep-gnuism' into maint
Junio C Hamano [Thu, 10 May 2012 17:32:15 +0000 (10:32 -0700)] 
Merge branch 'bw/test-fix-grep-gnuism' into maint

* bw/test-fix-grep-gnuism:
  t9400: fix gnuism in grep

12 years agoMerge branch 'jk/http-backend-keep-committer-ident-env' into maint
Junio C Hamano [Thu, 10 May 2012 17:29:50 +0000 (10:29 -0700)] 
Merge branch 'jk/http-backend-keep-committer-ident-env' into maint

By Jeff King
* jk/http-backend-keep-committer-ident-env:
  http-backend: respect existing GIT_COMMITTER_* variables

Conflicts:
t/t5541-http-push.sh

12 years agoMerge branch 'nl/rebase-i-cheat-sheet' into maint
Junio C Hamano [Thu, 10 May 2012 17:29:14 +0000 (10:29 -0700)] 
Merge branch 'nl/rebase-i-cheat-sheet' into maint

* nl/rebase-i-cheat-sheet:
  rebase -i: remind that the lines are top-to-bottom

12 years agoMerge branch 'bw/submodule-sed-solaris' into maint
Junio C Hamano [Thu, 10 May 2012 17:27:58 +0000 (10:27 -0700)] 
Merge branch 'bw/submodule-sed-solaris' into maint

By Ben Walton
* bw/submodule-sed-solaris:
  Avoid bug in Solaris xpg4/sed as used in submodule

12 years agoMerge branch 'jk/maint-push-progress' into maint
Junio C Hamano [Thu, 10 May 2012 17:08:54 +0000 (10:08 -0700)] 
Merge branch 'jk/maint-push-progress' into maint

"git push" over smart-http lost progress output a few releases ago.

By Jeff King
* jk/maint-push-progress:
  t5541: test more combinations of --progress
  teach send-pack about --[no-]progress
  send-pack: show progress when isatty(2)

12 years agoMerge branch 'jc/rerere-train' into maint
Junio C Hamano [Thu, 10 May 2012 17:08:24 +0000 (10:08 -0700)] 
Merge branch 'jc/rerere-train' into maint

A contrib script "rerere-train" did not work out of the box unless user
futzed with her $PATH.

* jc/rerere-train:
  contrib/rerere-train: use installed git-sh-setup

12 years agoMerge branch 'lp/diffstat-with-graph' into maint
Junio C Hamano [Thu, 10 May 2012 17:06:52 +0000 (10:06 -0700)] 
Merge branch 'lp/diffstat-with-graph' into maint

"log --graph" was not very friendly with "--stat" option and its output
had line breaks at wrong places.

By Lucian Poston (5) and Zbigniew Jędrzejewski-Szmek (3)
* lp/diffstat-with-graph:
  t4052: work around shells unable to set COLUMNS to 1
  test-lib: skip test with COLUMNS=1 under mksh
  Prevent graph_width of stat width from falling below min
  t4052: Test diff-stat output with minimum columns
  t4052: Adjust --graph --stat output for prefixes
  Adjust stat width calculations to take --graph output into account
  Add output_prefix_length to diff_options
  t4052: test --stat output with --graph

12 years agoStart preparing for 1.7.10.2
Junio C Hamano [Mon, 7 May 2012 20:24:13 +0000 (13:24 -0700)] 
Start preparing for 1.7.10.2

Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agoMerge branch 'jk/maint-gitweb-test-use-sane-perl' into maint
Junio C Hamano [Mon, 7 May 2012 20:17:31 +0000 (13:17 -0700)] 
Merge branch 'jk/maint-gitweb-test-use-sane-perl' into maint

When using a Perl script on a system where "perl" found on user's $PATH
could be ancient or otherwise broken, we allow builders to specify the
path to a good copy of Perl with $PERL_PATH.  The gitweb test forgot to
use that Perl when running its test.

By Jeff King (1) and Zbigniew Jędrzejewski-Szmek (1)
* jk/maint-gitweb-test-use-sane-perl:
  Consistently use perl from /usr/bin/ for scripts
  t/gitweb-lib: use $PERL_PATH to run gitweb

12 years agoMerge branch 'js/daemon-test-race-fix' into maint
Junio C Hamano [Mon, 7 May 2012 20:17:17 +0000 (13:17 -0700)] 
Merge branch 'js/daemon-test-race-fix' into maint

The test scaffolding for git-daemon was flaky.

By Johannes Sixt
* js/daemon-test-race-fix:
  t5570: fix forwarding of git-daemon messages via cat

12 years agoMerge branch 'jk/maint-config-bogus-section' into maint
Junio C Hamano [Mon, 7 May 2012 20:14:08 +0000 (13:14 -0700)] 
Merge branch 'jk/maint-config-bogus-section' into maint

"git config --rename-section" to rename an existing section into a bogus
one did not check the new name.

By Jeff King
* jk/maint-config-bogus-section:
  config: reject bogus section names for --rename-section

12 years agoMerge branch 'pw/t5800-import-race-fix' into maint
Junio C Hamano [Mon, 7 May 2012 20:13:55 +0000 (13:13 -0700)] 
Merge branch 'pw/t5800-import-race-fix' into maint

The test scaffolding for fast-import was flaky.

By Pete Wyckoff
* pw/t5800-import-race-fix:
  git-remote-testgit: fix race when spawning fast-import

12 years agoMerge branch 'rt/cherry-revert-conflict-summary' into maint
Junio C Hamano [Mon, 7 May 2012 20:13:43 +0000 (13:13 -0700)] 
Merge branch 'rt/cherry-revert-conflict-summary' into maint

In the older days, the header "Conflicts:" in "cherry-pick" and "merge"
was separated by a blank line from the list of paths that follow for
readability, but when "merge" was rewritten in C, we lost it by
mistake. Remove the newline from "cherry-pick" to make them match again.

By Ralf Thielow
* rt/cherry-revert-conflict-summary:
  sequencer: remove additional blank line

12 years agoMerge branch 'cb/maint-report-mount-point-correctly-in-setup' into maint
Junio C Hamano [Mon, 7 May 2012 20:13:03 +0000 (13:13 -0700)] 
Merge branch 'cb/maint-report-mount-point-correctly-in-setup' into maint

The filesystem boundary was not correctly reported when .git directory
discovery stopped at a mount point.

By Clemens Buchacher
* cb/maint-report-mount-point-correctly-in-setup:
  properly keep track of current working directory

12 years agogit p4 doc: fix formatting
Pete Wyckoff [Sun, 6 May 2012 15:58:38 +0000 (11:58 -0400)] 
git p4 doc: fix formatting

Attach example sections to previous level of indenting.

Fix a trailing ::

Signed-off-by: Pete Wyckoff <pw@padd.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agoMerge branch 'jc/merge-reduce-parents-early' into maint
Junio C Hamano [Thu, 3 May 2012 22:36:15 +0000 (15:36 -0700)] 
Merge branch 'jc/merge-reduce-parents-early' into maint

Octopus merge strategy did not reduce heads that are recorded in the final
commit correctly.

By Junio C Hamano (4) and Michał Kiedrowicz (1)
* jc/merge-reduce-parents-early:
  fmt-merge-msg: discard needless merge parents
  builtin/merge.c: reduce parents early
  builtin/merge.c: collect other parents early
  builtin/merge.c: remove "remoteheads" global variable
  merge tests: octopus with redundant parents

12 years agoMerge branch 'cb/cherry-pick-rev-path-confusion' into maint
Junio C Hamano [Thu, 3 May 2012 22:35:19 +0000 (15:35 -0700)] 
Merge branch 'cb/cherry-pick-rev-path-confusion' into maint

The command line parser choked "git cherry-pick $name" when $name can be
both revision name and a pathname, even though $name can never be a path
in the context of the command.

By Clemens Buchacher
* cb/cherry-pick-rev-path-confusion:
  cherry-pick: do not expect file arguments

12 years agoMerge branch 'cb/http-multi-curl-auth' into maint
Junio C Hamano [Thu, 3 May 2012 22:34:51 +0000 (15:34 -0700)] 
Merge branch 'cb/http-multi-curl-auth' into maint

HTTP transport that requires authentication did not work correctly when
multiple connections are used simultaneously.

By Jeff King (3) and Clemens Buchacher (1)
* cb/http-multi-curl-auth:
  http: use newer curl options for setting credentials
  http: clean up leak in init_curl_http_auth
  fix http auth with multiple curl handles
  http auth fails with multiple curl handles

12 years agoMerge branch 'mb/fetch-call-a-non-branch-a-ref' into maint
Junio C Hamano [Thu, 3 May 2012 22:29:25 +0000 (15:29 -0700)] 
Merge branch 'mb/fetch-call-a-non-branch-a-ref' into maint

The report from "git fetch" said "new branch" even for a non branch ref.

By Marc Branchaud
* mb/fetch-call-a-non-branch-a-ref:
  fetch: describe new refs based on where it came from
  fetch: Give remote_ref to update_local_ref() as well

12 years agoMerge branch 'rl/maint-stash-i18n-save-error' into maint
Junio C Hamano [Thu, 3 May 2012 22:24:22 +0000 (15:24 -0700)] 
Merge branch 'rl/maint-stash-i18n-save-error' into maint

i18n marking for an error message for "git stash --notavalidoption"
was incorrect.

By Ross Lagerwall
* rl/maint-stash-i18n-save-error:
  stash: use eval_gettextln correctly

12 years agoMerge branch 'jm/maint-strncpy-diff-no-index' into maint
Junio C Hamano [Thu, 3 May 2012 22:23:17 +0000 (15:23 -0700)] 
Merge branch 'jm/maint-strncpy-diff-no-index' into maint

"diff --no-index" codepath had a few places that used fixed-size
buffer and truncated paths that are too long.

By Jim Meyering (1) and Junio C Hamano (1)
* jm/maint-strncpy-diff-no-index:
  diff --no-index: use strbuf for temporary pathnames
  diff: avoid stack-buffer-read-overrun for very long name

12 years agoGit 1.7.10.1 v1.7.10.1
Junio C Hamano [Wed, 2 May 2012 04:18:44 +0000 (21:18 -0700)] 
Git 1.7.10.1

Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agoMerge branch 'pw/fast-import-dataref-parsing' into maint
Junio C Hamano [Wed, 2 May 2012 04:12:46 +0000 (21:12 -0700)] 
Merge branch 'pw/fast-import-dataref-parsing' into maint

The parser in "fast-import" did not diagnose ":9" style references that is
not followed by required SP/LF as an error.

By Pete Wyckoff
* pw/fast-import-dataref-parsing:
  fast-import: tighten parsing of datarefs

12 years agoMerge branch 'it/fetch-pack-many-refs' into maint
Junio C Hamano [Wed, 2 May 2012 04:12:36 +0000 (21:12 -0700)] 
Merge branch 'it/fetch-pack-many-refs' into maint

When "git fetch" encounters repositories with too many references, the
command line of "fetch-pack" that is run by a helper e.g. remote-curl, may
fail to hold all of them. Now such an internal invocation can feed the
references through the standard input of "fetch-pack".

By Ivan Todoroski
* it/fetch-pack-many-refs:
  remote-curl: main test case for the OS command line overflow
  fetch-pack: test cases for the new --stdin option
  remote-curl: send the refs to fetch-pack on stdin
  fetch-pack: new --stdin option to read refs from stdin

Conflicts:
t/t5500-fetch-pack.sh

12 years agoMerge branch 'jl/maint-submodule-recurse-fetch' into maint
Junio C Hamano [Wed, 2 May 2012 04:12:25 +0000 (21:12 -0700)] 
Merge branch 'jl/maint-submodule-recurse-fetch' into maint

"git fetch" that recurses into submodules on demand did not check if it
needs to go into submodules when non branches (most notably, tags) are
fetched.

By Jens Lehmann
* jl/maint-submodule-recurse-fetch:
  submodules: recursive fetch also checks new tags for submodule commits

12 years agoMerge branch 'jc/maint-blame-minimal' into maint
Junio C Hamano [Wed, 2 May 2012 04:11:49 +0000 (21:11 -0700)] 
Merge branch 'jc/maint-blame-minimal' into maint

"git blame" started missing quite a few changes from the origin since we
stopped using the diff minimalization by default in v1.7.2 era.

Teach "--minimal" option to "git blame" to work around this regression.

* jc/maint-blame-minimal:
  blame: accept --need-minimal

12 years agoMerge branch 'lp/maint-diff-three-dash-with-graph' into maint
Junio C Hamano [Wed, 2 May 2012 04:11:40 +0000 (21:11 -0700)] 
Merge branch 'lp/maint-diff-three-dash-with-graph' into maint

"log -p --graph" used with "--stat" had a few formatting error.

By Lucian Poston
* lp/maint-diff-three-dash-with-graph:
  t4202: add test for "log --graph --stat -p" separator lines
  log --graph: fix break in graph lines
  log --graph --stat: three-dash separator should come after graph lines

12 years agoMerge branch 'jk/rebase-i-submodule-conflict-only' into maint
Junio C Hamano [Wed, 2 May 2012 04:11:26 +0000 (21:11 -0700)] 
Merge branch 'jk/rebase-i-submodule-conflict-only' into maint

Giving "--continue" to a conflicted "rebase -i" session skipped a
commit that only results in changes to submodules.

By John Keeping
* jk/rebase-i-submodule-conflict-only:
  rebase -i continue: don't skip commits that only change submodules

12 years agoMerge branch 'maint' of https://github.com/git-l10n/git-po
Junio C Hamano [Wed, 2 May 2012 04:09:46 +0000 (21:09 -0700)] 
Merge branch 'maint' of https://github.com/git-l10n/git-po

By Byrial Jensen (2) and others
via Jiang Xin (1) and Ralf Thielow (1)
* 'maint' of https://github.com/git-l10n/git-po:
  l10n: Initial German translation
  l10n: Update Simplified Chinese translation
  l10n: Update git.pot (2 new messages)
  l10n: Add the German translation team and initialize de.po
  l10n: Add Danish team (da) to list of teams
  l10n: New da.po file with 0 translations
  l10n: Updated pt_PT language

12 years agoConsistently use perl from /usr/bin/ for scripts
Zbigniew Jędrzejewski-Szmek [Tue, 1 May 2012 20:18:18 +0000 (22:18 +0200)] 
Consistently use perl from /usr/bin/ for scripts

While the majority of scripts use '#!/usr/bin/perl', some use
'#!/usr/bin/env perl'. In the end there is no difference, because the
Makefile rewrites "#!.*perl" with "#!$PERL_PATH" in scripted
Porcelains before installing. Nevertheless, the second form can be
misleading, because it suggests that perl found first in $PATH will be
used.

Suggested-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agot/gitweb-lib: use $PERL_PATH to run gitweb
Jeff King [Tue, 1 May 2012 17:55:00 +0000 (13:55 -0400)] 
t/gitweb-lib: use $PERL_PATH to run gitweb

The current code runs "perl gitweb.cgi" to test gitweb. This
will use whatever version of perl happens to be first in the
PATH. We are better off using the specific perl that the
user specified via PERL_PATH, which matches what gets put on
the #!-line of the built gitweb.cgi.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agot5541: test more combinations of --progress
Jeff King [Tue, 1 May 2012 08:43:08 +0000 (04:43 -0400)] 
t5541: test more combinations of --progress

Previously, we tested only that "push --quiet --no-progress"
was silent. However, there are many other combinations that
were not tested:

  1. no options at all (but stderr as a tty)
  2. --no-progress by itself
  3. --quiet by itself
  4. --progress (when stderr not a tty)

These are tested elsewhere for general "push", but it is
important to test them separately for http. It follows a
very different code path than git://, and options must be
relayed across a remote helper to a separate send-pack
process (and in fact cases (1), (2), and (4) have all been
broken just for http at some point in the past).

We can drop the "--quiet --no-progress" test, as it is not
really interesting (it is already handled by testing them
separately in (2) and (3) above).

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agoteach send-pack about --[no-]progress
Jeff King [Tue, 1 May 2012 08:42:24 +0000 (04:42 -0400)] 
teach send-pack about --[no-]progress

The send_pack function gets a "progress" flag saying "yes,
definitely show progress" or "no, definitely do not show
progress". This gets set properly by transport_push when
send_pack is called directly.

However, when the send-pack command is executed separately
(as it is for the remote-curl helper), there is no way to
tell it "definitely do this". As a result, we do not
properly respect "git push --no-progress" for smart-http
remotes; you will still get progress if stderr is a tty.

This patch teaches send-pack --progress and --no-progress,
and teaches remote-curl to pass the appropriate option to
override send-pack's isatty check. This fixes the
--no-progress case above, and as a bonus, also makes "git
push --progress" work when stderr is not a tty.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agosend-pack: show progress when isatty(2)
Jeff King [Tue, 1 May 2012 08:41:42 +0000 (04:41 -0400)] 
send-pack: show progress when isatty(2)

The send_pack_args struct has two verbosity flags: "quiet"
and "progress". Originally, if "quiet" was set, we would
tell pack-objects explicitly to be quiet, and if "progress"
was set, we would tell it to show progress. Otherwise, we
told it neither, and it relied on isatty(2) to make the
decision itself.

However, commit 01fdc21 changed the meaning of these
variables. Now both "quiet" and "!progress" instruct us to
tell pack-objects to be quiet (and a non-zero "progress"
means the same as before). This works well for transports
which call send_pack directly, as the transport code copies
transport->progress into send_pack_args->progress, and they
both have the same meaning.

However, the code path of calling "git send-pack" was left
behind. It always sets "progress" to 0, and thus always
tells pack-objects to be quiet.  We can work around this by
checking isatty(2) ourselves in the cmd_send_pack code path,
restoring the original behavior of the send-pack command.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agol10n: Initial German translation
Ralf Thielow [Mon, 30 Apr 2012 15:55:16 +0000 (17:55 +0200)] 
l10n: Initial German translation

Helped-by: Thomas Kuchs
Signed-off-by: Ralf Thielow <ralf.thielow@googlemail.com>
12 years agocontrib/rerere-train: use installed git-sh-setup
Junio C Hamano [Mon, 30 Apr 2012 19:46:30 +0000 (12:46 -0700)] 
contrib/rerere-train: use installed git-sh-setup

Instead of sourcing git-sh-setup from random place that is on the $PATH,
explicitly source $(git --exec-path)/git-sh-setup.  As I do not personally
have any libexec/git-core directory on my $PATH like many other people, the
script will fail without this update.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agoconfig: expand tildes in include.path variable
Jeff King [Wed, 25 Apr 2012 12:00:36 +0000 (08:00 -0400)] 
config: expand tildes in include.path variable

You can already use relative paths in include.path, which
means that including "foo" from your global "~/.gitconfig"
will look in your home directory. However, you might want to
do something clever like putting "~/.gitconfig-foo" in a
specific repository's config file.

Signed-off-by: Jeff King <peff@peff.net>
Acked-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agol10n: Update Simplified Chinese translation
Jiang Xin [Sat, 28 Apr 2012 14:42:41 +0000 (22:42 +0800)] 
l10n: Update Simplified Chinese translation

Translate 2 new messages come from git maint branch.

Signed-off-by: Jiang Xin <worldhello.net@gmail.com>
12 years agol10n: Update git.pot (2 new messages)
Jiang Xin [Sat, 28 Apr 2012 12:35:24 +0000 (20:35 +0800)] 
l10n: Update git.pot (2 new messages)

Changes of po/git.pot from v1.7.10 to v1.7.10-55-g868d6

 * 2 new l10n messages at lines: 1583, 2730

Signed-off-by: Jiang Xin <worldhello.net@gmail.com>
12 years agoMerge maint branch for tracking l10n updates of git stable version
Jiang Xin [Sat, 28 Apr 2012 12:30:50 +0000 (20:30 +0800)] 
Merge maint branch for tracking l10n updates of git stable version

Use master branch to track l10n updates for git next release, while
use maint branch to track l10n updates for git stable version.

12 years agol10n: Add the German translation team and initialize de.po
Ralf Thielow [Thu, 26 Apr 2012 06:59:41 +0000 (08:59 +0200)] 
l10n: Add the German translation team and initialize de.po

Signed-off-by: Ralf Thielow <ralf.thielow@googlemail.com>
Signed-off-by: Jiang Xin <worldhello.net@gmail.com>
12 years agot4052: work around shells unable to set COLUMNS to 1
Zbigniew Jędrzejewski-Szmek [Fri, 27 Apr 2012 09:25:25 +0000 (11:25 +0200)] 
t4052: work around shells unable to set COLUMNS to 1

Signed-off-by: Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agoMerge branch 'zj/mksh-columns-breakage' into lp/diffstat-with-graph
Junio C Hamano [Fri, 27 Apr 2012 16:28:00 +0000 (09:28 -0700)] 
Merge branch 'zj/mksh-columns-breakage' into lp/diffstat-with-graph

By Zbigniew Jędrzejewski-Szmek
* zj/mksh-columns-breakage:
  test-lib: skip test with COLUMNS=1 under mksh

12 years agotest-lib: skip test with COLUMNS=1 under mksh
Zbigniew Jędrzejewski-Szmek [Fri, 27 Apr 2012 09:25:25 +0000 (11:25 +0200)] 
test-lib: skip test with COLUMNS=1 under mksh

mksh does not allow $COLUMNS to be set below 12.  mksh(1) says that
$COLUMNS is "always set, defaults to 80, unless the value as reported
by stty(1) is non-zero and sane enough". This applies also to setting
it directly for one command:

    $ COLUMNS=10 python -c 'import os; print os.environ["COLUMNS"]'
    98

Add a test prerequisite by checking if we can set COLUMNS=1, to allow
us to skip tests that needs it.

Signed-off-by: Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agot5570: fix forwarding of git-daemon messages via cat
Johannes Sixt [Thu, 26 Apr 2012 21:00:39 +0000 (23:00 +0200)] 
t5570: fix forwarding of git-daemon messages via cat

The shell function that starts git-daemon wants to read the first line of
the daemon's stderr to ensure that it started correctly. Subsequent daemon
errors should be redirected to fd 4 (which is the terminal in verbose mode
or /dev/null in quiet mode). To that end the shell script used 'read' to
get the first line of output, and then 'cat &' to forward everything else
in a background process.

The problem is, that 'cat >&4 &' does not produce any output because the
shell redirects a background process's stdin to /dev/null. To have this
command invocation do anything useful, we have to redirect its stdin
explicitly (which overrides the /dev/null redirection).

The shell function connects the daemon's stderr to its consumers via a
FIFO. We cannot just do this:

   read line <git_daemon_output
   cat <git_daemon_output >&4 &

because after the first redirection the pipe is closed and the daemon
could receive SIGPIPE if it writes at the wrong moment. Therefore, we open
the readable end of the FIFO only once on fd 7 in the shell and dup from
there to the stdin of the two consumers.

Signed-off-by: Johannes Sixt <j6t@kdbg.org>
Acked-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agoStart preparing for 1.7.10.1
Junio C Hamano [Thu, 26 Apr 2012 17:40:08 +0000 (10:40 -0700)] 
Start preparing for 1.7.10.1

Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agoMerge branch 'jk/run-command-eacces' into maint
Junio C Hamano [Thu, 26 Apr 2012 17:51:40 +0000 (10:51 -0700)] 
Merge branch 'jk/run-command-eacces' into maint

When PATH contains an unreadable directory, alias expansion code did
not kick in, and failed with an error that said "git-subcmd" was not
found.

By Jeff King (1) and Ramsay Jones (1)
* jk/run-command-eacces:
  run-command: treat inaccessible directories as ENOENT
  compat/mingw.[ch]: Change return type of exec functions to int

12 years agoMerge branch 'jc/push-upstream-sanity' into maint
Junio C Hamano [Thu, 26 Apr 2012 17:51:18 +0000 (10:51 -0700)] 
Merge branch 'jc/push-upstream-sanity' into maint

The 'push to upstream' implementation was broken in some corner
cases. "git push $there" without refspec, when the current branch is
set to push to a remote different from $there, used to push to $there
using the upstream information to a remote unreleated to $there.

* jc/push-upstream-sanity:
  push: error out when the "upstream" semantics does not make sense

12 years agoMerge branch 'jc/maint-clean-nested-worktree-in-subdir' into maint
Junio C Hamano [Thu, 26 Apr 2012 17:35:42 +0000 (10:35 -0700)] 
Merge branch 'jc/maint-clean-nested-worktree-in-subdir' into maint

"git clean -d -f" (not "-d -f -f") is supposed to protect nested
working trees of independent git repositories that exist in the
current project working tree from getting removed, but the protection
applied only to such working trees that are at the top-level of the
current project by mistake.

* jc/maint-clean-nested-worktree-in-subdir:
  clean: preserve nested git worktree in subdirectories

12 years agoMerge branch 'jk/diff-no-rename-empty' into maint
Junio C Hamano [Thu, 26 Apr 2012 17:35:33 +0000 (10:35 -0700)] 
Merge branch 'jk/diff-no-rename-empty' into maint

Rename detection logic used to match two empty files as renames during
merge-recursive, leading unnatural mismerges.

By Jeff King
* jk/diff-no-rename-empty:
  merge-recursive: don't detect renames of empty files
  teach diffcore-rename to optionally ignore empty content
  make is_empty_blob_sha1 available everywhere
  drop casts from users EMPTY_TREE_SHA1_BIN

12 years agoMerge branch 'rs/combine-diff-zero-context-at-the-beginning' into maint
Junio C Hamano [Thu, 26 Apr 2012 17:35:25 +0000 (10:35 -0700)] 
Merge branch 'rs/combine-diff-zero-context-at-the-beginning' into maint

An age-old corner case bug in combine diff (only triggered with -U0
and the hunk at the beginning of the file needs to be shown) has been
fixed.

By René Scharfe
* rs/combine-diff-zero-context-at-the-beginning:
  combine-diff: fix loop index underflow

12 years agoMerge branch 'jc/commit-unedited-template' into maint
Junio C Hamano [Thu, 26 Apr 2012 17:35:15 +0000 (10:35 -0700)] 
Merge branch 'jc/commit-unedited-template' into maint

When "git commit --template F" errors out because the user did not
touch the message, it claimed that it aborts due to "empty message",
which was utterly wrong.

By Junio C Hamano (4) and Adam Monsen (1)
* jc/commit-unedited-template:
  Documentation/git-commit: rephrase the "initial-ness" of templates
  git-commit.txt: clarify -t requires editing message
  commit: rephrase the error when user did not touch templated log message
  commit: do not trigger bogus "has templated message edited" check
  t7501: test the right kind of breakage

12 years agoMerge branch 'jk/add-p-skip-conflicts' into maint
Junio C Hamano [Thu, 26 Apr 2012 17:35:07 +0000 (10:35 -0700)] 
Merge branch 'jk/add-p-skip-conflicts' into maint

"git add -p" is not designed to deal with unmerged paths but did
not exclude them and tried to apply funny patches only to fail.

By Jeff King
* jk/add-p-skip-conflicts:
  add--interactive: ignore unmerged entries in patch mode

12 years agoMerge branch 'jc/commit-hook-authorship' into maint
Junio C Hamano [Thu, 26 Apr 2012 17:34:53 +0000 (10:34 -0700)] 
Merge branch 'jc/commit-hook-authorship' into maint

"git commit --author=$name" did not tell the name that was being
recorded in the resulting commit to hooks, even though it does do so
when the end user overrode the authorship via the "GIT_AUTHOR_NAME"
environment variable.

* jc/commit-hook-authorship:
  commit: pass author/committer info to hooks
  t7503: does pre-commit-hook learn authorship?
  ident.c: add split_ident_line() to parse formatted ident line

12 years agoMerge branch 'tr/maint-word-diff-regex-sticky' into maint
Junio C Hamano [Thu, 26 Apr 2012 17:34:43 +0000 (10:34 -0700)] 
Merge branch 'tr/maint-word-diff-regex-sticky' into maint

The regexp configured with diff.wordregex was incorrectly reused
across files.

By Thomas Rast (2) and Johannes Sixt (1)
* tr/maint-word-diff-regex-sticky:
  diff: tweak a _copy_ of diff_options with word-diff
  diff: refactor the word-diff setup from builtin_diff_cmd
  t4034: diff.*.wordregex should not be "sticky" in --word-diff

12 years agoMerge branch 'jh/notes-merge-in-git-dir-worktree' into maint
Junio C Hamano [Thu, 26 Apr 2012 17:32:55 +0000 (10:32 -0700)] 
Merge branch 'jh/notes-merge-in-git-dir-worktree' into maint

Running "notes merge --commit" failed to perform correctly when run
from any directory inside $GIT_DIR/.  When "notes merge" stops with
conflicts, $GIT_DIR/NOTES_MERGE_WORKTREE is the place a user edits
to resolve it.

By Johan Herland (3) and Junio C Hamano (1)
* jh/notes-merge-in-git-dir-worktree:
  notes-merge: Don't remove .git/NOTES_MERGE_WORKTREE; it may be the user's cwd
  notes-merge: use opendir/readdir instead of using read_directory()
  t3310: illustrate failure to "notes merge --commit" inside $GIT_DIR/
  remove_dir_recursively(): Add flag for skipping removal of toplevel dir

12 years agoSync with 1.7.9.7
Junio C Hamano [Thu, 26 Apr 2012 17:31:43 +0000 (10:31 -0700)] 
Sync with 1.7.9.7

12 years agoGit 1.7.9.7 v1.7.9.7
Junio C Hamano [Thu, 26 Apr 2012 17:23:15 +0000 (10:23 -0700)] 
Git 1.7.9.7

Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agoSync with 1.7.8.6
Junio C Hamano [Thu, 26 Apr 2012 17:22:20 +0000 (10:22 -0700)] 
Sync with 1.7.8.6

12 years agoGit 1.7.8.6 v1.7.8.6
Junio C Hamano [Thu, 26 Apr 2012 16:59:22 +0000 (09:59 -0700)] 
Git 1.7.8.6

Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agoSync with 1.7.7.7
Junio C Hamano [Thu, 26 Apr 2012 16:52:33 +0000 (09:52 -0700)] 
Sync with 1.7.7.7

12 years agoGit 1.7.7.7 v1.7.7.7
Junio C Hamano [Thu, 26 Apr 2012 16:41:52 +0000 (09:41 -0700)] 
Git 1.7.7.7

Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agodiff --no-index: use strbuf for temporary pathnames
Junio C Hamano [Wed, 25 Apr 2012 19:37:38 +0000 (12:37 -0700)] 
diff --no-index: use strbuf for temporary pathnames

Instead of using limited-length buffers and risking of pathname
truncation, we should be taking advantage of strbuf API nowadays.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agobundle: remove stray single-quote from error message
Jonathan Nieder [Thu, 26 Apr 2012 05:53:59 +0000 (00:53 -0500)] 
bundle: remove stray single-quote from error message

After running rev-list --boundary to retrieve the list of boundary
commits, "git bundle create" runs its own revision walk.  If in this
stage git encounters an unfamiliar option, it writes a message with an
unbalanced quotation mark:

error: unrecognized argument: --foo'

Drop the stray quote to match the "unrecognized argument: %s" message
used elsewhere and save translators some work.

This is mostly a futureproofing measure: for now, the "rev-list
--boundary" command catches most strange arguments on its own and the
above message is not seen unless you try something esoteric like "git
bundle create test.bundle --header HEAD".

Reported-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agoconfig: reject bogus section names for --rename-section
Jeff King [Thu, 26 Apr 2012 01:47:14 +0000 (21:47 -0400)] 
config: reject bogus section names for --rename-section

You can feed junk to "git config --rename-section", which
will result in a config file that git will not even parse
(so you cannot fix it with git-config). We already have
syntactic sanity checks when setting a variable; let's do
the same for section names.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agogit-remote-testgit: fix race when spawning fast-import
Pete Wyckoff [Sun, 22 Apr 2012 20:30:58 +0000 (16:30 -0400)] 
git-remote-testgit: fix race when spawning fast-import

Test "pushing to local repo" in t5800-remote-helpers can hang
due to a race condition in git-remote-testgit.  Fix it by
setting stdin to unbuffered.

On the writer side, "git push" invokes push_refs_with_export(),
which sends to stdout the command "export\n" and immediately
starts up "git fast-export".  The latter writes its output stream
to the same stdout.

On the reader side, remote helper "git-remote-testgit" reads from
stdin to get its next command.  It uses getc() to read characters
from libc up until \n.  Libc has buffered a potentially much
larger chunk of stdin.  When it sees the "export\n" command, it
forks "git fast-import" to read the stream.

If fast-export finishes before git fast-import starts, the
fast-export output can end up in libc's buffer in
git-remote-testgit, rather than in git fast-import.  The latter
hangs indefinitely on a now-empty stdin.

Signed-off-by: Pete Wyckoff <pw@padd.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agorevert: add missing va_end
Christian Couder [Sat, 21 Apr 2012 21:15:19 +0000 (23:15 +0200)] 
revert: add missing va_end

Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agosequencer: remove additional blank line
Ralf Thielow [Wed, 18 Apr 2012 21:07:25 +0000 (23:07 +0200)] 
sequencer: remove additional blank line

Remove an additional blank line between the
headline and the list of conflicted files after
doing a recursive merge.

Signed-off-by: Ralf Thielow <ralf.thielow@googlemail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agot9400: fix gnuism in grep
Junio C Hamano [Thu, 19 Apr 2012 20:05:26 +0000 (13:05 -0700)] 
t9400: fix gnuism in grep

Using "\+" in "grep" and expecting that it means one or more
is a GNUism.  Spell it in a dumb and portable way.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agofmt-merge-msg: discard needless merge parents
Junio C Hamano [Thu, 19 Apr 2012 02:49:08 +0000 (19:49 -0700)] 
fmt-merge-msg: discard needless merge parents

This is used by "git pull" to construct a merge message from list of
remote refs.  When pulling redundant set of refs, however, it did not
filter them even though the merge itself discards them as unnecessary.

Teach the command to do the same for consistency.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agoPrevent graph_width of stat width from falling below min
Lucian Poston [Wed, 18 Apr 2012 21:12:18 +0000 (14:12 -0700)] 
Prevent graph_width of stat width from falling below min

Update tests in t4052 fixed by this change.

Signed-off-by: Lucian Poston <lucian.poston@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agot4052: Test diff-stat output with minimum columns
Lucian Poston [Wed, 18 Apr 2012 21:09:33 +0000 (14:09 -0700)] 
t4052: Test diff-stat output with minimum columns

When COLUMNS or --stat-width restricts the diff-stat width to near the
minimum, 26 columns, the graph_width value becomes negative. Consequently, the
graph part of diff-stat is not resized properly.

Signed-off-by: Lucian Poston <lucian.poston@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agobuiltin/merge.c: reduce parents early
Junio C Hamano [Tue, 17 Apr 2012 19:22:26 +0000 (12:22 -0700)] 
builtin/merge.c: reduce parents early

Instead of waiting until we record the parents of resulting merge, reduce
redundant parents (including our HEAD) immediately after reading them.

The change to t7602 illustrates the essence of the effect of this change.
The octopus merge strategy used to be fed with redundant commits only to
discard them as "up-to-date", but we no longer feed such redundant commits
to it and the affected test degenerates to a regular two-head merge.

And obviously the known-to-be-broken test in t6028 is now fixed.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agobuiltin/merge.c: collect other parents early
Junio C Hamano [Tue, 17 Apr 2012 18:31:10 +0000 (11:31 -0700)] 
builtin/merge.c: collect other parents early

Move the code around to populate remoteheads list early in the process
before any decision regarding twohead vs octopus and fast-forwardness is
made.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agobuiltin/merge.c: remove "remoteheads" global variable
Junio C Hamano [Mon, 16 Apr 2012 23:15:13 +0000 (16:15 -0700)] 
builtin/merge.c: remove "remoteheads" global variable

Instead pass it around starting from the toplevel cmd_merge()
as an explicit parameter.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agomerge tests: octopus with redundant parents
Michał Kiedrowicz [Mon, 13 Feb 2012 11:48:56 +0000 (12:48 +0100)] 
merge tests: octopus with redundant parents

This happens when git merge is run to merge multiple commits that are
descendants of current HEAD (or are HEAD).  We've hit this while updating
master to origin/master but accidentaly we called (while being on master):

$ git merge master origin/master

Here is a minimal testcase:

$ git init a && cd a
$ echo a >a && git add a
$ git commit -minitial
$ echo b >a && git add a
$ git commit -msecond
$ git checkout master^

$ git merge master master
Fast-forwarding to: master
Already up-to-date with master
Merge made by the 'octopus' strategy.
 a |    2 +-
  1 files changed, 1 insertions(+), 1 deletions(-)

$ git cat-file commit HEAD
tree eebfed94e75e7760540d1485c740902590a00332
parent bd679e85202280b263e20a57639a142fa14c2c64
author Michał Kiedrowicz <michal.kiedrowicz@gmail.com> 1329132996 +0100
committer Michał Kiedrowicz <michal.kiedrowicz@gmail.com> 1329132996 +0100

Merge branches 'master' and 'master' into HEAD

Signed-off-by: Michał Kiedrowicz <michal.kiedrowicz@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agofetch: describe new refs based on where it came from
Marc Branchaud [Mon, 16 Apr 2012 22:08:50 +0000 (18:08 -0400)] 
fetch: describe new refs based on where it came from

update_local_ref() used to say "[new branch]" when we stored a new ref
outside refs/tags/ hierarchy, but the message is more about what we
fetched, so use the refname at the origin to make that decision.

Also, only call a new ref a "branch" if it's under refs/heads/.

Signed-off-by: Marc Branchaud <marcnarc@xiplink.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agofetch: Give remote_ref to update_local_ref() as well
Marc Branchaud [Mon, 16 Apr 2012 22:08:49 +0000 (18:08 -0400)] 
fetch: Give remote_ref to update_local_ref() as well

This way, the function can look at the remote side to adjust the
informational message it gives.

Signed-off-by: Marc Branchaud <marcnarc@xiplink.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agot4052: Adjust --graph --stat output for prefixes
Lucian Poston [Mon, 16 Apr 2012 10:44:52 +0000 (03:44 -0700)] 
t4052: Adjust --graph --stat output for prefixes

Adjust tests to verify that the commit history graph tree is taken into
consideration when the diff stat output width is calculated.

Signed-off-by: Lucian Poston <lucian.poston@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agoAdjust stat width calculations to take --graph output into account
Lucian Poston [Mon, 16 Apr 2012 10:44:51 +0000 (03:44 -0700)] 
Adjust stat width calculations to take --graph output into account

The recent change to compute the width of diff --stat did not take into
consideration the output from --graph. The consequence is that when both
options are used, e.g. in 'log --stat --graph', the lines are too long.

Adjust stat width calculations to take --graph output into account.

Signed-off-by: Lucian Poston <lucian.poston@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agoAdd output_prefix_length to diff_options
Lucian Poston [Mon, 16 Apr 2012 10:44:50 +0000 (03:44 -0700)] 
Add output_prefix_length to diff_options

Add output_prefix_length to diff_options. Initialize the value to 0 and only
set it when graph.c:diff_output_prefix_callback() is called.

Signed-off-by: Lucian Poston <lucian.poston@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agot4052: test --stat output with --graph
Zbigniew Jędrzejewski-Szmek [Mon, 16 Apr 2012 10:44:49 +0000 (03:44 -0700)] 
t4052: test --stat output with --graph

Add tests which show that the width of the --prefix added by --graph
is not taken into consideration when the diff stat output width is
calculated.

Signed-off-by: Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Signed-off-by: Lucian Poston <lucian.poston@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agodiff: avoid stack-buffer-read-overrun for very long name
Jim Meyering [Mon, 16 Apr 2012 15:20:02 +0000 (17:20 +0200)] 
diff: avoid stack-buffer-read-overrun for very long name

Due to the use of strncpy without explicit NUL termination,
we could end up passing names n1 or n2 that are not NUL-terminated
to queue_diff, which requires NUL-terminated strings.
Ensure that each is NUL terminated.

Signed-off-by: Jim Meyering <meyering@redhat.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agocherry-pick: do not expect file arguments
Clemens Buchacher [Sat, 14 Apr 2012 19:04:48 +0000 (21:04 +0200)] 
cherry-pick: do not expect file arguments

If a commit-ish passed to cherry-pick or revert happens to have a file
of the same name, git complains that the argument is ambiguous and
advises to use '--'. To make things worse, the '--' argument is removed
by parse_options, und so passing '--' has no effect.

Instead, always interpret cherry-pick/revert arguments as revisions.

Signed-off-by: Clemens Buchacher <drizzd@aon.at>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agoproperly keep track of current working directory
Clemens Buchacher [Thu, 12 Apr 2012 23:11:36 +0000 (01:11 +0200)] 
properly keep track of current working directory

Various failure modes in the repository detection code path currently
quote the wrong directory in their error message. The working directory
is changed iteratively to the parent directory until a git repository is
found. If the working directory cannot be changed to the parent
directory for some reason, the detection gives up and prints an error
message. The error message should report the current working directory.

Instead of continually updating the 'cwd' variable, which is actually
used to remember the original working directory, the 'offset' variable
is used to keep track of the current working directory. At the point
where the affected error handling code is called, 'offset' already
points to the end of the parent of the working directory, rather than
the current working directory.

Fix this by explicitly using a variable 'offset_parent' and update
'offset' concurrently with the call to chdir.

In a similar fashion, the function get_device_or_die() would print the
original working directory in case of a failure, rather than the current
working directory. Fix this as well by making use of the 'offset'
variable.

Lastly, replace the phrase 'mount parent' with 'mount point'. The former
appears to be a typo.

Signed-off-by: Clemens Buchacher <drizzd@aon.at>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agostash: use eval_gettextln correctly
Ross Lagerwall [Sat, 14 Apr 2012 12:37:29 +0000 (14:37 +0200)] 
stash: use eval_gettextln correctly

Otherwise, passing an invalid option, git stash -v, gave:

git-stash: line 204: $'error: unknown option for \'stash save\':
$option\n       To provide a message, use git stash save -- \'$option\'':
command not found

Signed-off-by: Ross Lagerwall <rosslagerwall@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agosubmodules: recursive fetch also checks new tags for submodule commits
Jens Lehmann [Fri, 13 Apr 2012 16:25:16 +0000 (18:25 +0200)] 
submodules: recursive fetch also checks new tags for submodule commits

Since 88a21979c (fetch/pull: recurse into submodules when necessary) all
fetched commits are examined if they contain submodule changes (unless
configuration or command line options inhibit that). If a newly recorded
submodule commit is not present in the submodule, a fetch is run inside
it to download that commit.

Checking new refs was done in an else branch where it wasn't executed for
tags. This normally isn't a problem because tags are only fetched with
the branches they live on, then checking the new commits in the fetched
branches for submodule commits will also process all tags. But when a
specific tag is fetched (or the refspec contains refs/tags/) commits only
reachable by tags won't be searched for submodule commits, which is a bug.

Fix that by moving the code outside the if/else construct to handle new
tags just like any other ref. The performance impact of adding tags that
most of the time lie on a branch which is checked anyway for new submodule
commit should be minimal, as since 6859de4 (fetch: avoid quadratic loop
checking for updated submodules) all ref-tips are collected first and then
fed to a single rev-list.

Spotted-by: Jeff King <peff@peff.net>
Signed-off-by: Jens Lehmann <Jens.Lehmann@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agohttp: use newer curl options for setting credentials
Jeff King [Fri, 13 Apr 2012 06:19:25 +0000 (02:19 -0400)] 
http: use newer curl options for setting credentials

We give the username and password to curl by sticking them
in a buffer of the form "user:pass" and handing the result
to CURLOPT_USERPWD. Since curl 7.19.1, there is a split
mechanism, where you can specify each element individually.

This has the advantage that a username can contain a ":"
character. It also is less code for us, since we can hand
our strings over to curl directly. And since curl 7.17.0 and
higher promise to copy the strings for us, we we don't even
have to worry about memory ownership issues.

Unfortunately, we have to keep the ugly code for old curl
around, but as it is now nicely #if'd out, we can easily get
rid of it when we decide that 7.19.1 is "old enough".

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agohttp: clean up leak in init_curl_http_auth
Jeff King [Fri, 13 Apr 2012 06:18:35 +0000 (02:18 -0400)] 
http: clean up leak in init_curl_http_auth

When we have a credential to give to curl, we must copy it
into a "user:pass" buffer and then hand the buffer to curl.
Old versions of curl did not copy the buffer, and we were
expected to keep it valid. Newer versions of curl will copy
the buffer.

Our solution was to use a strbuf and detach it, giving
ownership of the resulting buffer to curl. However, this
meant that we were leaking the buffer on newer versions of
curl, since curl was just copying it and throwing away the
string we passed. Furthermore, when we replaced a
credential (e.g., because our original one was rejected), we
were also leaking on both old and new versions of curl.

This got even worse in the last patch, which started
replacing the credential (and thus leaking) on every http
request.

Instead, let's use a static buffer to make the ownership
more clear and less leaky.  We already keep a static "struct
credential", so we are only handling a single credential at
a time, anyway.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agol10n: Add Danish team (da) to list of teams
Byrial Jensen [Wed, 11 Apr 2012 00:11:12 +0000 (02:11 +0200)] 
l10n: Add Danish team (da) to list of teams

12 years agol10n: New da.po file with 0 translations
Byrial Jensen [Tue, 10 Apr 2012 16:50:59 +0000 (18:50 +0200)] 
l10n: New da.po file with 0 translations

12 years agoblame: accept --need-minimal
Junio C Hamano [Wed, 11 Apr 2012 20:08:08 +0000 (13:08 -0700)] 
blame: accept --need-minimal

Between v1.7.1 and v1.7.2, 582aa00bdffb switched the default "diff"
invocation not to use XDF_NEED_MINIMAL, but this breaks "git blame"
rather badly.

Allow the command line option to ask for an extra careful matching.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agol10n: Updated pt_PT language
Marco Sousa [Tue, 10 Apr 2012 22:04:30 +0000 (00:04 +0200)] 
l10n: Updated pt_PT language

12 years agoremote-curl: main test case for the OS command line overflow
Ivan Todoroski [Mon, 2 Apr 2012 15:17:03 +0000 (17:17 +0200)] 
remote-curl: main test case for the OS command line overflow

This is main test case for the original problem that triggered this
patch series. We create a repo with 50k tags and then test whether
git-clone over the smart HTTP protocol succeeds.

Note that we construct the repo in a slightly different way than the
original script used to reproduce the problem. This is because the
original script just created 50k tags all pointing to the same commit,
so if there was a bug where remote-curl.c was not passing all the refs
to fetch-pack we wouldn't know. The clone would succeed even if only one
tag was passed, because all the other tags were pointing at the same SHA
and would be considered present.

Instead we create a repo with 50k independent (dangling) commits and
then tag each of those commits with a unique tag. This way if one of the
tags is not given to fetch-pack, later stages of the clone would
complain about it.

This allows us to test both that the command line overflow was fixed, as
well as that it was fixed in a way that doesn't leave out any of the
refs.

Signed-off-by: Ivan Todoroski <grnch@gmx.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agofetch-pack: test cases for the new --stdin option
Ivan Todoroski [Mon, 2 Apr 2012 15:16:24 +0000 (17:16 +0200)] 
fetch-pack: test cases for the new --stdin option

These test cases focus only on testing the parsing of refs on stdin,
without bothering with the rest of the fetch-pack machinery. We pass in
the refs using different combinations of command line and stdin and then
we watch fetch-pack's stdout to see whether it prints all the refs we
specified (but we ignore their order).

Signed-off-by: Ivan Todoroski <grnch@gmx.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agoremote-curl: send the refs to fetch-pack on stdin
Ivan Todoroski [Mon, 2 Apr 2012 15:14:44 +0000 (17:14 +0200)] 
remote-curl: send the refs to fetch-pack on stdin

Now that we can throw an arbitrary number of refs at fetch-pack using
its --stdin option, we use it in the remote-curl helper to bypass the
OS command line length limit.

Signed-off-by: Ivan Todoroski <grnch@gmx.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agofast-import: tighten parsing of datarefs
Pete Wyckoff [Sat, 7 Apr 2012 22:59:20 +0000 (18:59 -0400)] 
fast-import: tighten parsing of datarefs

The syntax for the use of mark references in fast-import
demands either a SP (space) or LF (end-of-line) after
a mark reference.  Fast-import does not complain when garbage
appears after a mark reference in some cases.

Factor out parsing of mark references and complain if
errant characters are found.  Also be a little more careful
when parsing "inline" and SHA1s, complaining if extra
characters appear or if the form of the dataref is unrecognized.

Buggy input can cause fast-import to produce the wrong output,
silently, without error.  This makes it difficult to track
down buggy generators of fast-import streams.  An example is
seen in the last line of this commit command:

    commit refs/heads/S2
    committer Name <name@example.com> 1112912893 -0400
    data <<COMMIT
    commit message
    COMMIT
    from :1M 100644 :103 hello.c

It is missing a newline and should be:

    [...]
    from :1
    M 100644 :103 hello.c

What fast-import does is to produce a commit with the same
contents for hello.c as in refs/heads/S2^.  What the buggy
program was expecting was the contents of blob :103.  While
the resulting commit graph looked correct, the contents in
some commits were wrong.

Signed-off-by: Pete Wyckoff <pw@padd.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>