git
13 years agorefactor argv_array into generic code
Jeff King [Tue, 13 Sep 2011 21:57:57 +0000 (17:57 -0400)] 
refactor argv_array into generic code

The submodule code recently grew generic code to build a
dynamic argv array. Many other parts of the code can reuse
this, too, so let's make it generically available.

There are two enhancements not found in the original code:

  1. We now handle the NULL-termination invariant properly,
     even when no strings have been pushed (before, you
     could have an empty, NULL argv). This was not a problem
     for the submodule code, which always pushed at least
     one argument, but was not sufficiently safe for
     generic code.

  2. There is a formatted variant of the "push" function.
     This is a convenience function which was not needed by
     the submodule code, but will make it easier to port
     other users to the new code.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agoquote.h: fix bogus comment
Jeff King [Tue, 13 Sep 2011 21:57:47 +0000 (17:57 -0400)] 
quote.h: fix bogus comment

Commit 758e915 made sq_quote_next static, removing it from
quote.h. However, it forgot to update the related comment,
making it appear as a confusing description of sq_quote_to_argv.

Let's remove the crufty bits, and elaborate more on sq_quote_to_argv.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agoadd sha1_array API docs
Jeff King [Tue, 13 Sep 2011 21:57:34 +0000 (17:57 -0400)] 
add sha1_array API docs

This API was introduced in 902bb36, but never documented.
Let's be nice to future users of the code.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agot3200: clean up checks for file existence
Jeff King [Tue, 13 Sep 2011 16:13:58 +0000 (12:13 -0400)] 
t3200: clean up checks for file existence

This patch uses test_path_is_file and test_path_is_missing
instead of "test -f / ! test -f" checks. The former are more
verbose in case of failure and more precise (e.g., is_missing
will check that the entry is actually missing, not just not
a regular file).

As a bonus, this also fixes a few buggy tests that used
"test foo" instead of "test -f foo", and consequently always
reported success.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agoDocumentation: basic configuration of notes.rewriteRef
Thomas Rast [Tue, 13 Sep 2011 07:32:42 +0000 (09:32 +0200)] 
Documentation: basic configuration of notes.rewriteRef

Users had problems finding a working setting for notes.rewriteRef.
Document how to enable rewriting for notes/commits, which should be a
safe setting.

Signed-off-by: Thomas Rast <trast@student.ethz.ch>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agogit-svn: teach git-svn to populate svn:mergeinfo
Bryan Jacobs [Wed, 7 Sep 2011 17:36:05 +0000 (13:36 -0400)] 
git-svn: teach git-svn to populate svn:mergeinfo

Allow git-svn to populate the svn:mergeinfo property automatically in
a narrow range of circumstances. Specifically, when dcommitting a
revision with multiple parents, all but (potentially) the first of
which have been committed to SVN in the same repository as the target
of the dcommit.

In this case, the merge info is the union of that given by each of the
parents, plus all changes introduced to the first parent by the other
parents.

In all other cases where a revision to be committed has multiple
parents, cause "git svn dcommit" to raise an error rather than
completing the commit and potentially losing history information in
the upstream SVN repository.

This behavior is disabled by default, and can be enabled by setting
the svn.pushmergeinfo config option.

[ew: minor style changes and manpage merge fix]

Acked-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Bryan Jacobs <bjacobs@woti.com>
13 years agosend-email: add option -h
Clemens Buchacher [Sat, 3 Sep 2011 17:06:13 +0000 (19:06 +0200)] 
send-email: add option -h

Most other git commands print a synopsis when passed -h. Make
send-email do the same.

Signed-off-by: Clemens Buchacher <drizzd@aon.at>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agodate.c: Support iso8601 timezone formats
Haitao Li [Fri, 9 Sep 2011 10:10:33 +0000 (18:10 +0800)] 
date.c: Support iso8601 timezone formats

Timezone designators in the following formats are all valid according to
ISO8601:2004, section 4.3.2:

    [+-]hh, [+-]hhmm, [+-]hh:mm

but we have ignored the ones with colon so far.

Signed-off-by: Haitao Li <lihaitao@gmail.com>
Helped-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agorefactor run_receive_hook()
Junio C Hamano [Thu, 8 Sep 2011 19:17:09 +0000 (12:17 -0700)] 
refactor run_receive_hook()

Running a hook has to make complex set-up to establish web of
communication between child process and multiplexer, which is common
regardless of what kind of data is fed to the hook. Refactor the parts
that is specific to the data fed to the particular set of hooks from the
part that runs the hook, so that the code can be reused to drive hooks
that take different kind of data.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agorename pathspec_prefix() to common_prefix() and move to dir.[ch]
Clemens Buchacher [Sun, 4 Sep 2011 10:42:01 +0000 (12:42 +0200)] 
rename pathspec_prefix() to common_prefix() and move to dir.[ch]

Also make common_prefix_len() static as this refactoring makes dir.c
itself the only caller of this helper function.

Signed-off-by: Clemens Buchacher <drizzd@aon.at>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agofetch: avoid quadratic loop checking for updated submodules
Jeff King [Mon, 12 Sep 2011 19:56:52 +0000 (15:56 -0400)] 
fetch: avoid quadratic loop checking for updated submodules

Recent versions of git can be slow to fetch repositories with a
large number of refs (or when they already have a large
number of refs). For example, GitHub makes pull-requests
available as refs, which can lead to a large number of
available refs. This slowness goes away when submodule
recursion is turned off:

  $ git ls-remote git://github.com/rails/rails.git | wc -l
  3034

  [this takes ~10 seconds of CPU time to complete]
  git fetch --recurse-submodules=no \
    git://github.com/rails/rails.git "refs/*:refs/*"

  [this still isn't done after 10 _minutes_ of pegging the CPU]
  git fetch \
    git://github.com/rails/rails.git "refs/*:refs/*"

You can produce a quicker and simpler test case like this:

  doit() {
    head=`git rev-parse HEAD`
    for i in `seq 1 $1`; do
      echo $head refs/heads/ref$i
    done >.git/packed-refs
    echo "==> $1"
    rm -rf dest
    git init -q --bare dest &&
      (cd dest && time git.compile fetch -q .. refs/*:refs/*)
  }

  rm -rf repo
  git init -q repo && cd repo &&
  >file && git add file && git commit -q -m one

  doit 100
  doit 200
  doit 400
  doit 800
  doit 1600
  doit 3200

Which yields timings like:

  # refs  seconds of CPU
     100            0.06
     200            0.24
     400            0.95
     800            3.39
    1600           13.66
    3200           54.09

Notice that although the number of refs doubles in each
trial, the CPU time spent quadruples.

The problem is that the submodule recursion code works
something like:

  - for each ref we fetch
    - for each commit in git rev-list $new_sha1 --not --all
      - add modified submodules to list
  - fetch any newly referenced submodules

But that means if we fetch N refs, we start N revision
walks. Worse, because we use "--all", the number of refs we
must process that constitute "--all" keeps growing, too. And
you end up doing O(N^2) ref resolutions.

Instead, this patch structures the code like this:

  - for each sha1 we already have
    - add $old_sha1 to list $old
  - for each ref we fetch
    - add $new_sha1 to list $new
  - for each commit in git rev-list $new --not $old
    - add modified submodules to list
  - fetch any newly referenced submodules

This yields timings like:

  # refs  seconds of CPU
  100               0.00
  200               0.04
  400               0.04
  800               0.10
  1600              0.21
  3200              0.39

Note that the amount of effort doubles as the number of refs
doubles. Similarly, the fetch of rails.git takes about as
much time as it does with --recurse-submodules=no.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agoformat-patch: ignore ui.color
Pang Yan Han [Mon, 12 Sep 2011 17:46:41 +0000 (01:46 +0800)] 
format-patch: ignore ui.color

commit c9bfb953 (want_color: automatically fallback to color.ui,
2011-08-17) introduced a regression where format-patch produces colorized
patches when color.ui is set to "always".

In f3aafa4 (Disable color detection during format-patch, 2006-07-09),
git_format_config was taught to intercept diff.color to avoid passing it
down to git_log_config and later, git_diff_ui_config.

Teach git_format_config to intercept color.ui in the same way.

Helped-by: Jeff King <peff@peff.net>
Signed-off-by: Pang Yan Han <pangyanhan@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agoGit 1.7.7-rc1 v1.7.7-rc1
Junio C Hamano [Mon, 12 Sep 2011 17:44:32 +0000 (10:44 -0700)] 
Git 1.7.7-rc1

Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agoSync with 1.7.6.3
Junio C Hamano [Mon, 12 Sep 2011 17:43:17 +0000 (10:43 -0700)] 
Sync with 1.7.6.3

Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agoMerge branch 'jn/remote-helpers-doc'
Junio C Hamano [Mon, 12 Sep 2011 17:38:11 +0000 (10:38 -0700)] 
Merge branch 'jn/remote-helpers-doc'

* jn/remote-helpers-doc:
  (short) documentation for the testgit remote helper
  Documentation/git-remote-helpers: explain how import works with multiple refs
  Documentation/remote-helpers: explain capabilities first

13 years agoGit 1.7.6.3 v1.7.6.3
Junio C Hamano [Mon, 12 Sep 2011 17:33:03 +0000 (10:33 -0700)] 
Git 1.7.6.3

Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agoMerge branch 'jl/maint-fetch-submodule-check-fix' into maint
Junio C Hamano [Mon, 12 Sep 2011 17:19:57 +0000 (10:19 -0700)] 
Merge branch 'jl/maint-fetch-submodule-check-fix' into maint

* jl/maint-fetch-submodule-check-fix:
  fetch: skip on-demand checking when no submodules are configured

13 years agoMerge branch 'maint'
Junio C Hamano [Mon, 12 Sep 2011 05:35:11 +0000 (22:35 -0700)] 
Merge branch 'maint'

* maint:
  Prepare for 1.7.6.3 maintenance release
  SubmittingPathces: remove Cogito reference

Conflicts:
RelNotes

13 years agoPrepare for 1.7.6.3 maintenance release
Junio C Hamano [Mon, 12 Sep 2011 05:08:56 +0000 (22:08 -0700)] 
Prepare for 1.7.6.3 maintenance release

Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agoMerge branch 'ms/reflog-show-is-default' into maint
Junio C Hamano [Mon, 12 Sep 2011 05:33:24 +0000 (22:33 -0700)] 
Merge branch 'ms/reflog-show-is-default' into maint

* ms/reflog-show-is-default:
  reflog: actually default to subcommand 'show'

13 years agoMerge branch 'jk/reset-reflog-message-fix' into maint
Junio C Hamano [Mon, 12 Sep 2011 05:33:20 +0000 (22:33 -0700)] 
Merge branch 'jk/reset-reflog-message-fix' into maint

* jk/reset-reflog-message-fix:
  reset: give better reflog messages

13 years agoMerge branch 'vi/make-test-vector-less-specific' into maint
Junio C Hamano [Mon, 12 Sep 2011 05:33:16 +0000 (22:33 -0700)] 
Merge branch 'vi/make-test-vector-less-specific' into maint

* vi/make-test-vector-less-specific:
  tests: cleanup binary test vector files

13 years agoMerge branch 'jk/tag-contains-ab' (early part) into maint
Junio C Hamano [Mon, 12 Sep 2011 04:54:32 +0000 (21:54 -0700)] 
Merge branch 'jk/tag-contains-ab' (early part) into maint

* 'jk/tag-contains-ab' (early part):
  tag: speed up --contains calculation

13 years agoMerge branch 'dz/connect-error-report' into maint
Junio C Hamano [Mon, 12 Sep 2011 04:53:47 +0000 (21:53 -0700)] 
Merge branch 'dz/connect-error-report' into maint

* dz/connect-error-report:
  Do not log unless all connect() attempts fail

13 years agoMerge branch 'jc/maint-mergetool-read-fix' into maint
Junio C Hamano [Mon, 12 Sep 2011 04:53:39 +0000 (21:53 -0700)] 
Merge branch 'jc/maint-mergetool-read-fix' into maint

* jc/maint-mergetool-read-fix:
  mergetool: check return value from read

13 years agoMerge branch 'jk/maint-config-param' into maint
Junio C Hamano [Mon, 12 Sep 2011 04:53:13 +0000 (21:53 -0700)] 
Merge branch 'jk/maint-config-param' into maint

* jk/maint-config-param:
  config: use strbuf_split_str instead of a temporary strbuf
  strbuf: allow strbuf_split to work on non-strbufs
  config: avoid segfault when parsing command-line config
  config: die on error in command-line config
  fix "git -c" parsing of values with equals signs
  strbuf_split: add a max parameter

13 years agoMerge branch 'jn/doc-dashdash' into maint
Junio C Hamano [Mon, 12 Sep 2011 04:52:18 +0000 (21:52 -0700)] 
Merge branch 'jn/doc-dashdash' into maint

* jn/doc-dashdash:
  Documentation/i18n: quote double-dash for AsciiDoc
  Documentation: quote double-dash for AsciiDoc

Conflicts:
Documentation/git-mergetool--lib.txt

13 years agoMerge branch 'jk/maint-1.7.2-status-ignored' into maint
Junio C Hamano [Mon, 12 Sep 2011 04:51:10 +0000 (21:51 -0700)] 
Merge branch 'jk/maint-1.7.2-status-ignored' into maint

* jk/maint-1.7.2-status-ignored:
  git status --ignored: tests and docs
  status: fix bug with missing --ignore files

Conflicts:
Documentation/git-status.txt
t/t7508-status.sh

13 years agoremote: only update remote-tracking branch if updating refspec
Martin von Zweigbergk [Sat, 10 Sep 2011 19:39:23 +0000 (15:39 -0400)] 
remote: only update remote-tracking branch if updating refspec

'git remote rename' will only update the remote's fetch refspec if it
looks like a default one. If the remote has no default fetch refspec,
as in

[remote "origin"]
    url = git://git.kernel.org/pub/scm/git/git.git
    fetch = +refs/heads/*:refs/remotes/upstream/*

we would not update the fetch refspec and even if there is a ref
called "refs/remotes/origin/master", we should not rename it, since it
was not created by fetching from the remote.

Suggested-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Martin von Zweigbergk <martin.von.zweigbergk@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agoremote rename: warn when refspec was not updated
Martin von Zweigbergk [Sat, 3 Sep 2011 15:26:59 +0000 (11:26 -0400)] 
remote rename: warn when refspec was not updated

When renaming a remote, we also try to update the fetch refspec
accordingly, but only if it has the default format. For others, such
as refs/heads/master:refs/heads/origin, we are conservative and leave
it untouched. Let's give the user a warning about refspecs that are
not updated, so he can manually update the config if necessary.

Suggested-by: Jeff King <peff@peff.net>
Signed-off-by: Martin von Zweigbergk <martin.von.zweigbergk@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agoremote: "rename o foo" should not rename ref "origin/bar"
Martin von Zweigbergk [Fri, 2 Sep 2011 00:50:34 +0000 (20:50 -0400)] 
remote: "rename o foo" should not rename ref "origin/bar"

When renaming a remote called 'o' using 'git remote rename o foo', git
should also rename any remote-tracking branches for the remote. This
does happen, but any remote-tracking branches starting with
'refs/remotes/o', such as 'refs/remotes/origin/bar', will also be
renamed (to 'refs/remotes/foorigin/bar' in this case).

Fix it by simply matching one more character, up to the slash
following the remote name.

Signed-off-by: Martin von Zweigbergk <martin.von.zweigbergk@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agoremote: write correct fetch spec when renaming remote 'remote'
Martin von Zweigbergk [Fri, 2 Sep 2011 00:50:33 +0000 (20:50 -0400)] 
remote: write correct fetch spec when renaming remote 'remote'

When renaming a remote whose name is contained in a configured fetch
refspec for that remote, we currently replace the first occurrence of
the remote name in the refspec. This is correct in most cases, but
breaks if the remote name occurs in the fetch refspec before the
expected place. For example, we currently change

[remote "remote"]
url = git://git.kernel.org/pub/scm/git/git.git
fetch = +refs/heads/*:refs/remotes/remote/*

into

[remote "origin"]
url = git://git.kernel.org/pub/scm/git/git.git
fetch = +refs/heads/*:refs/origins/remote/*

Reduce the risk of changing incorrect sections of the refspec by
matching the entire ":refs/remotes/<name>/" instead of just "<name>".

Signed-off-by: Martin von Zweigbergk <martin.von.zweigbergk@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agoSubmittingPathces: remove Cogito reference
Sverre Rabbelier [Sun, 11 Sep 2011 12:38:10 +0000 (14:38 +0200)] 
SubmittingPathces: remove Cogito reference

Removing Cogito leaves just git and StGit, which is a rather
incomplete list of git diff tools available. Sidestep the problem
of deciding what tools to mention by not mentioning any.

Signed-off-by: Sverre Rabbelier <srabbelier@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agofsck: do not abort upon finding an empty blob
Junio C Hamano [Mon, 12 Sep 2011 01:03:38 +0000 (18:03 -0700)] 
fsck: do not abort upon finding an empty blob

Asking fwrite() to write one item of size bytes results in fwrite()
reporting "I wrote zero item", when size is zero. Instead, we could
ask it to write "size" items of 1 byte and expect it to report that
"I wrote size items" when it succeeds, with any value of size,
including zero.

Noticed and reported by BJ Hargrave.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agobuiltin/revert.c: make commit_list_append() static
Junio C Hamano [Sun, 11 Sep 2011 22:29:21 +0000 (15:29 -0700)] 
builtin/revert.c: make commit_list_append() static

There is nobody outside that calls into this helper function.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agoobstack.c: Fix some sparse warnings
Ramsay Jones [Sun, 11 Sep 2011 19:26:53 +0000 (20:26 +0100)] 
obstack.c: Fix some sparse warnings

In particular, sparse issues the following warnings:

    compat/obstack.c:176:17: warning: Using plain integer as NULL pointer
    compat/obstack.c:224:17: warning: Using plain integer as NULL pointer
    compat/obstack.c:324:16: warning: Using plain integer as NULL pointer
    compat/obstack.c:329:16: warning: Using plain integer as NULL pointer
    compat/obstack.c:347:16: warning: Using plain integer as NULL pointer
    compat/obstack.c:362:19: warning: Using plain integer as NULL pointer
    compat/obstack.c:379:29: warning: Using plain integer as NULL pointer
    compat/obstack.c:399:1: error: symbol 'print_and_abort' redeclared with \
        different type (originally declared at compat/obstack.c:95) \
        - different modifiers

Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agosparse: Fix an "Using plain integer as NULL pointer" warning
Ramsay Jones [Sun, 11 Sep 2011 19:25:48 +0000 (20:25 +0100)] 
sparse: Fix an "Using plain integer as NULL pointer" warning

Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agoMakefile: Make dependency directory creation less noisy
Ramsay Jones [Sun, 11 Sep 2011 19:40:18 +0000 (20:40 +0100)] 
Makefile: Make dependency directory creation less noisy

Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agoreceive-pack: check connectivity before concluding "git push"
Junio C Hamano [Fri, 2 Sep 2011 23:52:08 +0000 (16:52 -0700)] 
receive-pack: check connectivity before concluding "git push"

Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agocheck_everything_connected(): libify
Junio C Hamano [Fri, 2 Sep 2011 23:33:22 +0000 (16:33 -0700)] 
check_everything_connected(): libify

Extract the helper function and the type definition of the iterator
function it uses out of builtin/fetch.c into a separate source and a
header file.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agocheck_everything_connected(): refactor to use an iterator
Junio C Hamano [Fri, 2 Sep 2011 23:22:47 +0000 (16:22 -0700)] 
check_everything_connected(): refactor to use an iterator

We will be using the same "rev-list --verify-objects" logic to add a
sanity check to the receiving end of "git push" in the same way, but the
list of commits that are checked come from a structure with a different
shape over there.

Update the function to take an iterator to make it easier to reuse it in
different contexts.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agofetch: verify we have everything we need before updating our ref
Junio C Hamano [Thu, 1 Sep 2011 22:43:35 +0000 (15:43 -0700)] 
fetch: verify we have everything we need before updating our ref

The "git fetch" command works in two phases. The remote side tells us what
objects are at the tip of the refs we are fetching from, and transfers the
objects missing from our side. After storing the objects in our repository,
we update our remote tracking branches to point at the updated tips of the
refs.

A broken or malicious remote side could send a perfectly well-formed pack
data during the object transfer phase, but there is no guarantee that the
given data actually fill the gap between the objects we originally had and
the refs we are updating to.

Although this kind of breakage can be caught by running fsck after a
fetch, it is much cheaper to verify that everything that is reachable from
the tips of the refs we fetched are indeed fully connected to the tips of
our current set of refs before we update them.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agofetch: skip on-demand checking when no submodules are configured
Jens Lehmann [Fri, 9 Sep 2011 18:22:03 +0000 (20:22 +0200)] 
fetch: skip on-demand checking when no submodules are configured

It makes no sense to do the - possibly very expensive - call to "rev-list
<new-ref-sha1> --not --all" in check_for_new_submodule_commits() when
there aren't any submodules configured.

Leave check_for_new_submodule_commits() early when no name <-> path
mappings for submodules are found in the configuration. To make that work
reading the configuration had to be moved further up in cmd_fetch(), as
doing that after the actual fetch of the superproject was too late.

Reported-by: Martin Fick <mfick@codeaurora.org>
Signed-off-by: Jens Lehmann <Jens.Lehmann@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agobranch: -v does not automatically imply --list
Michael J Gruber [Thu, 8 Sep 2011 21:09:50 +0000 (14:09 -0700)] 
branch: -v does not automatically imply --list

"branch -v" without other options or parameters still works in the list
mode, but that is not because there is "-v" but because there is no
parameter nor option.

Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agofor-each-ref: add split message parts to %(contents:*).
Michał Górny [Wed, 7 Sep 2011 17:46:08 +0000 (13:46 -0400)] 
for-each-ref: add split message parts to %(contents:*).

The %(body) placeholder returns the whole body of a tag or
commit, including the signature. However, callers may want
to get just the body without signature, or just the
signature.

Rather than change the meaning of %(body), which might break
some scripts, this patch introduces a new set of
placeholders which break down the %(contents) placeholder
into its constituent parts.

[jk: initial patch by mg, rebased on top of my refactoring
and with tests by me]

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agofor-each-ref: handle multiline subjects like --pretty
Jeff King [Wed, 7 Sep 2011 17:44:56 +0000 (13:44 -0400)] 
for-each-ref: handle multiline subjects like --pretty

Generally the format of a git tag or commit message is:

  subject

  body body body
  body body body

However, we occasionally see multiline subjects like:

  subject
  with multiple
  lines

  body body body
  body body body

The rest of git treats these multiline subjects as something
to be concatenated and shown as a single line (e.g., "git
log --pretty=format:%s" will do so since f53bd74). For
consistency, for-each-ref should do the same with its
"%(subject)".

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agofor-each-ref: refactor subject and body placeholder parsing
Jeff King [Wed, 7 Sep 2011 17:44:07 +0000 (13:44 -0400)] 
for-each-ref: refactor subject and body placeholder parsing

The find_subpos function was a little hard to use, as well
as to read. It would sometimes write into the subject and
body pointers, and sometimes not. The body pointer sometimes
could be compared to subject, and sometimes not. When
actually duplicating the subject, the caller was forced to
figure out again how long the subject is (which is not too
big a deal when the subject is a single line, but hard to
extend).

The refactoring makes the function more straightforward, both
to read and to use. We will always put something into the
subject and body pointers, and we return explicit lengths
for them, too.

This lays the groundwork both for more complex subject
parsing (e.g., multiline), as well as splitting the body
into subparts (like the text versus the signature).

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agot6300: add more body-parsing tests
Jeff King [Wed, 7 Sep 2011 17:43:28 +0000 (13:43 -0400)] 
t6300: add more body-parsing tests

The current tests don't actually check parsing commit and
tag messages that have both a subject and a body (they just
have single-line messages).

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agot7004: factor out gpg setup
Jeff King [Wed, 7 Sep 2011 17:42:39 +0000 (13:42 -0400)] 
t7004: factor out gpg setup

Other test scripts may want to look at or verify signed
tags, and the setup is non-trivial. Let's factor this out
into lib-gpg.sh for other tests to use.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agoRelNotes/1.7.7: minor fixes
Michael J Gruber [Wed, 7 Sep 2011 11:54:11 +0000 (13:54 +0200)] 
RelNotes/1.7.7: minor fixes

Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agosha1_file: normalize alt_odb path before comparing and storing
Hui Wang [Wed, 7 Sep 2011 10:37:47 +0000 (18:37 +0800)] 
sha1_file: normalize alt_odb path before comparing and storing

When it needs to compare and add an alt object path to the
alt_odb_list, we normalize this path first since comparing normalized
path is easy to get correct result.

Use strbuf to replace some string operations, since it is cleaner and
safer.

Helped-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Hui Wang <Hui.Wang@windriver.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agoMinor update to how-to maintain git
Junio C Hamano [Wed, 7 Sep 2011 18:18:18 +0000 (11:18 -0700)] 
Minor update to how-to maintain git

A few more parts of this document is stale that needs updating
to reflect the reality, but I do not regularly rebase topics that
are only in "pu" anymore, which may be noteworthy for a commit.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agohttp: avoid empty error messages for some curl errors
Jonathan Nieder [Mon, 5 Sep 2011 22:22:02 +0000 (17:22 -0500)] 
http: avoid empty error messages for some curl errors

When asked to fetch over SSL without a valid
/etc/ssl/certs/ca-certificates.crt file, "git fetch" writes

error:  while accessing https://github.com/torvalds/linux.git/info/refs

which is a little disconcerting.  Better to fall back to
curl_easy_strerror(result) when the error string is empty, like the
curl utility does:

error: Problem with the SSL CA cert (path? access rights?) while
accessing https://github.com/torvalds/linux.git/info/refs

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agohttp: remove extra newline in error message
Jonathan Nieder [Mon, 5 Sep 2011 22:29:34 +0000 (17:29 -0500)] 
http: remove extra newline in error message

There is no need for a blank line between the detailed error message
and the later "fatal: HTTP request failed" notice.  Keep the newline
written by error() itself and eliminate the extra one.

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agoconsolidate pathspec_prefix and common_prefix
Junio C Hamano [Tue, 6 Sep 2011 19:32:30 +0000 (12:32 -0700)] 
consolidate pathspec_prefix and common_prefix

The implementation from pathspec_prefix (slightly modified) replaces the
current common_prefix, because it also respects glob characters.

Based on a patch by Clemens Buchacher.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agoremove prefix argument from pathspec_prefix
Clemens Buchacher [Sun, 4 Sep 2011 10:41:59 +0000 (12:41 +0200)] 
remove prefix argument from pathspec_prefix

Passing a prefix to a function that is supposed to find the prefix is
strange. And it's really only used if the pathspec is NULL. Make the
callers handle this case instead.

As we are always returning a fresh copy of a string (or NULL), change the
type of the returned value to non-const "char *".

Signed-off-by: Clemens Buchacher <drizzd@aon.at>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agoUpdate draft release notes to 1.7.7
Junio C Hamano [Tue, 6 Sep 2011 18:48:21 +0000 (11:48 -0700)] 
Update draft release notes to 1.7.7

Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agoMerge branch 'rc/histogram-diff'
Junio C Hamano [Tue, 6 Sep 2011 18:42:58 +0000 (11:42 -0700)] 
Merge branch 'rc/histogram-diff'

* rc/histogram-diff:
  xdiff/xprepare: initialise xdlclassifier_t cf in xdl_prepare_env()

13 years agoMerge branch 'cb/maint-ls-files-error-report'
Junio C Hamano [Tue, 6 Sep 2011 18:42:55 +0000 (11:42 -0700)] 
Merge branch 'cb/maint-ls-files-error-report'

* cb/maint-ls-files-error-report:
  t3005: do not assume a particular order of stdout and stderr of git-ls-files

13 years agoMerge branch 'mh/check-ref-format-print-normalize'
Junio C Hamano [Tue, 6 Sep 2011 18:42:52 +0000 (11:42 -0700)] 
Merge branch 'mh/check-ref-format-print-normalize'

* mh/check-ref-format-print-normalize:
  Forbid DEL characters in reference names
  check-ref-format --print: Normalize refnames that start with slashes

13 years agoSync with 1.7.6.2
Junio C Hamano [Tue, 6 Sep 2011 18:42:12 +0000 (11:42 -0700)] 
Sync with 1.7.6.2

Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agoGit 1.7.6.2 v1.7.6.2
Junio C Hamano [Tue, 6 Sep 2011 18:41:02 +0000 (11:41 -0700)] 
Git 1.7.6.2

Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agoRevert "Merge branch 'cb/maint-quiet-push' into maint"
Junio C Hamano [Tue, 6 Sep 2011 18:06:32 +0000 (11:06 -0700)] 
Revert "Merge branch 'cb/maint-quiet-push' into maint"

This reverts commit ffa69e61d3c5730bd4b65a465efc130b0ef3c7df, reversing
changes made to 4a13c4d14841343d7caad6ed41a152fee550261d.

Adding a new command line option to receive-pack and feed it from
send-pack is not an acceptable way to add features, as there is no
guarantee that your updated send-pack will be talking to updated
receive-pack. New features need to be added via the capability mechanism
negotiated over the protocol.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agotest: fetch/receive with fsckobjects
Junio C Hamano [Mon, 5 Sep 2011 01:19:36 +0000 (18:19 -0700)] 
test: fetch/receive with fsckobjects

Add tests for the new fetch.fsckobjects, and also tests for
receive.fsckobjects we have had for quite some time.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agotransfer.fsckobjects: unify fetch/receive.fsckobjects
Junio C Hamano [Sun, 4 Sep 2011 19:37:45 +0000 (12:37 -0700)] 
transfer.fsckobjects: unify fetch/receive.fsckobjects

This single variable can be used to set instead of setting fsckobjects
variable for fetch & receive independently.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agofetch.fsckobjects: verify downloaded objects
Junio C Hamano [Sun, 4 Sep 2011 19:26:14 +0000 (12:26 -0700)] 
fetch.fsckobjects: verify downloaded objects

This corresponds to receive.fsckobjects configuration variable added (a
lot) earlier in 20dc001 (receive-pack: allow using --strict mode for
unpacking objects, 2008-02-25).

Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agoUpdate draft release notes to 1.7.7
Junio C Hamano [Fri, 2 Sep 2011 20:26:02 +0000 (13:26 -0700)] 
Update draft release notes to 1.7.7

Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agoMerge branch 'js/i18n-scripts-2'
Junio C Hamano [Fri, 2 Sep 2011 20:18:42 +0000 (13:18 -0700)] 
Merge branch 'js/i18n-scripts-2'

* js/i18n-scripts-2:
  bisect: take advantage of gettextln, eval_gettextln.

13 years agoMerge branch 'tr/maint-t3903-misquoted-command'
Junio C Hamano [Fri, 2 Sep 2011 20:18:39 +0000 (13:18 -0700)] 
Merge branch 'tr/maint-t3903-misquoted-command'

* tr/maint-t3903-misquoted-command:
  t3903: fix misquoted rev-parse invocation

13 years agoMerge branch 'bc/bisect-test-use-shell-path'
Junio C Hamano [Fri, 2 Sep 2011 20:18:37 +0000 (13:18 -0700)] 
Merge branch 'bc/bisect-test-use-shell-path'

* bc/bisect-test-use-shell-path:
  t6030: use $SHELL_PATH to invoke user's preferred shell instead of bare sh

13 years agoMerge branch 'va/p4-branch-import-test-update'
Junio C Hamano [Fri, 2 Sep 2011 20:18:33 +0000 (13:18 -0700)] 
Merge branch 'va/p4-branch-import-test-update'

* va/p4-branch-import-test-update:
  git-p4: simple branch tests edits

13 years agoMerge branch 'tr/maint-strbuf-grow-nul-termination'
Junio C Hamano [Fri, 2 Sep 2011 20:18:29 +0000 (13:18 -0700)] 
Merge branch 'tr/maint-strbuf-grow-nul-termination'

* tr/maint-strbuf-grow-nul-termination:
  strbuf_grow(): maintain nul-termination even for new buffer

13 years agoMerge branch 'tr/maint-ident-to-git-memmove'
Junio C Hamano [Fri, 2 Sep 2011 20:18:25 +0000 (13:18 -0700)] 
Merge branch 'tr/maint-ident-to-git-memmove'

* tr/maint-ident-to-git-memmove:
  Use memmove in ident_to_git

13 years agoMerge branch 'tr/maint-format-patch-empty-output'
Junio C Hamano [Fri, 2 Sep 2011 20:18:22 +0000 (13:18 -0700)] 
Merge branch 'tr/maint-format-patch-empty-output'

* tr/maint-format-patch-empty-output:
  Document negated forms of format-patch --to --cc --add-headers
  t4014: "no-add-headers" is actually called "no-add-header"
  t4014: invoke format-patch with --stdout where intended
  t4014: check for empty files from git format-patch --stdout

13 years agoMerge branch 'gb/maint-am-stgit-author-to-from-fix'
Junio C Hamano [Fri, 2 Sep 2011 20:18:11 +0000 (13:18 -0700)] 
Merge branch 'gb/maint-am-stgit-author-to-from-fix'

* gb/maint-am-stgit-author-to-from-fix:
  am: fix stgit patch mangling

13 years agoMerge branch 'gb/maint-am-patch-format-error-message'
Junio C Hamano [Fri, 2 Sep 2011 20:18:07 +0000 (13:18 -0700)] 
Merge branch 'gb/maint-am-patch-format-error-message'

* gb/maint-am-patch-format-error-message:
  am: format is in $patch_format, not parse_patch

Conflicts:
git-am.sh

13 years agoMerge branch 'ms/daemon-timeout-is-in-seconds'
Junio C Hamano [Fri, 2 Sep 2011 20:17:58 +0000 (13:17 -0700)] 
Merge branch 'ms/daemon-timeout-is-in-seconds'

* ms/daemon-timeout-is-in-seconds:
  git-daemon.txt: specify --timeout in seconds

13 years agoMerge branch 'bg/t5540-osx-grep'
Junio C Hamano [Fri, 2 Sep 2011 20:17:50 +0000 (13:17 -0700)] 
Merge branch 'bg/t5540-osx-grep'

* bg/t5540-osx-grep:
  t5540-http-test: shorten grep pattern

13 years agoMerge branch 'jc/clean-exclude-doc'
Junio C Hamano [Fri, 2 Sep 2011 20:17:46 +0000 (13:17 -0700)] 
Merge branch 'jc/clean-exclude-doc'

* jc/clean-exclude-doc:
  Documentation: clarify "git clean -e <pattern>"

13 years agoMerge branch 'mg/maint-notes-C-doc'
Junio C Hamano [Fri, 2 Sep 2011 20:17:40 +0000 (13:17 -0700)] 
Merge branch 'mg/maint-notes-C-doc'

* mg/maint-notes-C-doc:
  git-notes.txt: clarify -C vs. copy and -F

13 years agoMerge branch 'fg/submodule-ff-check-before-push'
Junio C Hamano [Fri, 2 Sep 2011 20:07:58 +0000 (13:07 -0700)] 
Merge branch 'fg/submodule-ff-check-before-push'

* fg/submodule-ff-check-before-push:
  push: Don't push a repository with unpushed submodules

13 years agoMerge branch 'rc/diff-cleanup-records'
Junio C Hamano [Fri, 2 Sep 2011 19:07:11 +0000 (12:07 -0700)] 
Merge branch 'rc/diff-cleanup-records'

* rc/diff-cleanup-records:
  xdiff/xprepare: improve O(n*m) performance in xdl_cleanup_records()

13 years agoMerge branch 'fk/use-kwset-pickaxe-grep-f'
Junio C Hamano [Fri, 2 Sep 2011 17:00:38 +0000 (10:00 -0700)] 
Merge branch 'fk/use-kwset-pickaxe-grep-f'

* fk/use-kwset-pickaxe-grep-f:
  obstack: Fix portability issues
  Use kwset in grep
  Use kwset in pickaxe
  Adapt the kwset code to Git
  Add string search routines from GNU grep
  Add obstack.[ch] from EGLIBC 2.10

13 years agoMerge branch 'en/merge-recursive-2'
Junio C Hamano [Fri, 2 Sep 2011 17:00:18 +0000 (10:00 -0700)] 
Merge branch 'en/merge-recursive-2'

* en/merge-recursive-2: (57 commits)
  merge-recursive: Don't re-sort a list whose order we depend upon
  merge-recursive: Fix virtual merge base for rename/rename(1to2)/add-dest
  t6036: criss-cross + rename/rename(1to2)/add-dest + simple modify
  merge-recursive: Avoid unnecessary file rewrites
  t6022: Additional tests checking for unnecessary updates of files
  merge-recursive: Fix spurious 'refusing to lose untracked file...' messages
  t6022: Add testcase for spurious "refusing to lose untracked" messages
  t3030: fix accidental success in symlink rename
  merge-recursive: Fix working copy handling for rename/rename/add/add
  merge-recursive: add handling for rename/rename/add-dest/add-dest
  merge-recursive: Have conflict_rename_delete reuse modify/delete code
  merge-recursive: Make modify/delete handling code reusable
  merge-recursive: Consider modifications in rename/rename(2to1) conflicts
  merge-recursive: Create function for merging with branchname:file markers
  merge-recursive: Record more data needed for merging with dual renames
  merge-recursive: Defer rename/rename(2to1) handling until process_entry
  merge-recursive: Small cleanups for conflict_rename_rename_1to2
  merge-recursive: Fix rename/rename(1to2) resolution for virtual merge base
  merge-recursive: Introduce a merge_file convenience function
  merge-recursive: Fix modify/delete resolution in the recursive case
  ...

13 years agogit-remote-mediawiki: allow push to set MediaWiki metadata
Matthieu Moy [Thu, 1 Sep 2011 16:54:56 +0000 (18:54 +0200)] 
git-remote-mediawiki: allow push to set MediaWiki metadata

Push can not set the commit note "mediawiki_revision:" and update the
remote reference. This avoids having to "git pull --rebase" after each
push, and is probably more natural. Make it the default, but let it be
configurable with mediawiki.dumbPush or remote.<remotename>.dumbPush.

Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agoAdd a remote helper to interact with mediawiki (fetch & push)
Jeremie Nikaes [Thu, 1 Sep 2011 16:54:55 +0000 (18:54 +0200)] 
Add a remote helper to interact with mediawiki (fetch & push)

Implement a gate between git and mediawiki, allowing git users to push
and pull objects from mediawiki just as one would do with a classic git
repository thanks to remote-helpers.

The following packages need to be installed (available on common
repositories):

  libmediawiki-api-perl
  libdatetime-format-iso8601-perl

Use remote helpers in order to be as transparent as possible to the git
user.

Download Mediawiki revisions through the Mediawiki API and then
fast-import into git.

Mediawiki revision number and git commits are linked thanks to notes
bound to commits.

The import part is done on a refs/mediawiki/<remote> branch before
coming to refs/remote/origin/master (Huge thanks to Jonathan Nieder
for his help)

We use UTF-8 everywhere: use encoding 'utf8'; does most of the job, but
we also read the output of Git commands in UTF-8 with the small helper
run_git, and write to the console (STDERR) in UTF-8. This allows a
seamless use of non-ascii characters in page titles, but hasn't been
tested on non-UTF-8 systems. In particular, UTF-8 encoding for filenames
could raise problems if different file systems handle UTF-8 filenames
differently. A uri_escape of mediawiki filenames could be imaginable, and
is still to be discussed further.

Partial cloning is supported using one of:

git clone -c remote.origin.pages='A_Page  Another_Page' mediawiki::http://wikiurl

git clone -c remote.origin.categories='Some_Category' mediawiki::http://wikiurl

git clone -c remote.origin.shallow='True' mediawiki::http://wikiurl

Thanks to notes metadata, it is possible to compare remote and local last
mediawiki revision to warn non-fast forward pushes and "everything
up-to-date" case.

When allowed, push looks for each commit between remotes/origin/master
and HEAD, catches every blob related to these commit and push them in
chronological order. To do so, it uses git rev-list --children HEAD and
travels the tree from remotes/origin/master to HEAD through children. In
other words:

* Shortest path from remotes/origin/master to HEAD
* For each commit encountered, push blobs related to this commit

Signed-off-by: Jérémie Nikaes <jeremie.nikaes@ensimag.imag.fr>
Signed-off-by: Arnaud Lacurie <arnaud.lacurie@ensimag.imag.fr>
Signed-off-by: Claire Fousse <claire.fousse@ensimag.imag.fr>
Signed-off-by: David Amouyal <david.amouyal@ensimag.imag.fr>
Signed-off-by: Matthieu Moy <matthieu.moy@grenoble-inp.fr>
Signed-off-by: Sylvain Boulmé <sylvain.boulme@imag.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years ago(short) documentation for the testgit remote helper
Matthieu Moy [Thu, 1 Sep 2011 16:49:38 +0000 (18:49 +0200)] 
(short) documentation for the testgit remote helper

While it's not a command meant to be used by actual users (hence, not
mentionned in git(1)), this command is a very precious help for
remote-helpers authors.

The best place for such technical doc is the source code, but users may
not find it without a link in a manpage.

Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Acked-by: Sverre Rabbelier <srabbelier@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agoDocumentation/git-remote-helpers: explain how import works with multiple refs
Matthieu Moy [Thu, 1 Sep 2011 16:49:37 +0000 (18:49 +0200)] 
Documentation/git-remote-helpers: explain how import works with multiple refs

This is important for two reasons:

* when two "import" lines follow each other, only one "done" command
  should be issued in the fast-import stream, not one per "import".

* The blank line terminating an import command should not be confused
  with the one terminating the sequence of commands.

While we're there, illustrate the corresponding explanation for push
batches with an example.

Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Acked-by: Sverre Rabbelier <srabbelier@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agofetch: verify we have everything we need before updating our ref
Junio C Hamano [Thu, 1 Sep 2011 22:43:35 +0000 (15:43 -0700)] 
fetch: verify we have everything we need before updating our ref

The "git fetch" command works in two phases. The remote side tells us what
objects are at the tip of the refs we are fetching from, and transfers the
objects missing from our side. After storing the objects in our repository,
we update our remote tracking branches to point at the updated tips of the
refs.

A broken or malicious remote side could send a perfectly well-formed pack
data during the object transfer phase, but there is no guarantee that the
given data actually fill the gap between the objects we originally had and
the refs we are updating to.

Although this kind of breakage can be caught by running fsck after a
fetch, it is much cheaper to verify that everything that is reachable from
the tips of the refs we fetched are indeed fully connected to the tips of
our current set of refs before we update them.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agorev-list --verify-object
Junio C Hamano [Thu, 1 Sep 2011 22:43:34 +0000 (15:43 -0700)] 
rev-list --verify-object

Often we want to verify everything reachable from a given set of commits
are present in our repository and connected without a gap to the tips of
our refs. We used to do this for this purpose:

    $ rev-list --objects $commits_to_be_tested --not --all

Even though this is good enough for catching missing commits and trees,
we show the object name but do not verify their existence, let alone their
well-formedness, for the blob objects at the leaf level.

Add a new "--verify-object" option so that we can catch missing and broken
blobs as well.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agolist-objects: pass callback data to show_objects()
Junio C Hamano [Thu, 1 Sep 2011 22:43:33 +0000 (15:43 -0700)] 
list-objects: pass callback data to show_objects()

The traverse_commit_list() API takes two callback functions, one to show
commit objects, and the other to show other kinds of objects. Even though
the former has a callback data parameter, so that the callback does not
have to rely on global state, the latter does not.

Give the show_objects() callback the same callback data parameter.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agogit-svn: Teach dcommit --mergeinfo to handle multiple lines
Bryan Jacobs [Wed, 31 Aug 2011 16:48:39 +0000 (12:48 -0400)] 
git-svn: Teach dcommit --mergeinfo to handle multiple lines

"svn dcommit --mergeinfo" replaces the svn:mergeinfo property in an
upstream SVN repository with the given text. The svn:mergeinfo
property may contain commits originating on multiple branches,
separated by newlines.

Cause space characters in the mergeinfo to be replaced by newlines,
allowing a user to create history representing multiple branches being
merged into one.

Update the corresponding documentation and add a test for the new
functionality.

Signed-off-by: Bryan Jacobs <bjacobs@woti.com>
Acked-by: Sam Vilain <sam@vilain.net>
Acked-by: Eric Wong <normalperson@yhbt.net>
13 years agogit-svn: fix fetch with moved path when using rewriteRoot
Eric Wong [Mon, 29 Aug 2011 00:45:44 +0000 (00:45 +0000)] 
git-svn: fix fetch with moved path when using rewriteRoot

The matching step in commit 3235b7053c45a734c1cdf9b117bda68b7ced29c9
did not properly account for users of the "rewriteRoot"
configuration parameter.

ref: <CANWsHyfHtr0EaJtNsDK9UTcmb_AbLg-1jUA-0uWJ-nEeNosb7w@mail.gmail.com>

Suggested-by: H Krishnan <hetchkay@gmail.com>
Signed-off-by: Eric Wong <normalperson@yhbt.net>
13 years agogit-svn: New flag to emulate empty directories
Ray Chen [Wed, 20 Jul 2011 22:37:26 +0000 (18:37 -0400)] 
git-svn: New flag to emulate empty directories

Adds a --preserve-empty-dirs flag to the clone operation that will detect
empty directories in the remote Subversion repository and create placeholder
files in the corresponding local Git directories.  This allows "empty"
directories to exist in the history of a Git repository.

Also adds the --placeholder-file flag to control the name of any placeholder
files created.  Default value is ".gitignore".

Signed-off-by: Ray Chen <rchen@cs.umd.edu>
Acked-by: Eric Wong <normalperson@yhbt.net>
13 years agoxdiff/xprepare: initialise xdlclassifier_t cf in xdl_prepare_env()
Tay Ray Chuan [Wed, 31 Aug 2011 04:48:46 +0000 (12:48 +0800)] 
xdiff/xprepare: initialise xdlclassifier_t cf in xdl_prepare_env()

Ensure that the xdl_free_classifier() call on xdlclassifier_t cf is safe
even if xdl_init_classifier() isn't called. This may occur in the case
where diff is run with --histogram and a call to, say, xdl_prepare_ctx()
fails.

Signed-off-by: Tay Ray Chuan <rctay89@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agot6030: use $SHELL_PATH to invoke user's preferred shell instead of bare sh
Brandon Casey [Mon, 29 Aug 2011 20:09:25 +0000 (13:09 -0700)] 
t6030: use $SHELL_PATH to invoke user's preferred shell instead of bare sh

Some platforms (IRIX, Solaris) provide an ancient /bin/sh which chokes on
modern shell syntax like $().  SHELL_PATH is provided to allow the user to
specify a working sh, let's use it here.

Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agobisect: take advantage of gettextln, eval_gettextln.
Jon Seymour [Tue, 30 Aug 2011 23:09:47 +0000 (09:09 +1000)] 
bisect: take advantage of gettextln, eval_gettextln.

Signed-off-by: Jon Seymour <jon.seymour@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agoMerge branch 'maint'
Junio C Hamano [Tue, 30 Aug 2011 19:35:51 +0000 (12:35 -0700)] 
Merge branch 'maint'

* maint:
  Documentation: clarify effects of -- <path> arguments

13 years agoSymlink mergetools scriptlets into valgrind wrappers
Thomas Rast [Tue, 30 Aug 2011 00:47:36 +0000 (02:47 +0200)] 
Symlink mergetools scriptlets into valgrind wrappers

Since bc7a96a (mergetool--lib: Refactor tools into separate files,
2011-08-18) the mergetools and difftools related tests fail under
--valgrind because the mergetools/* scriptlets are not in the exec
path.

For now, symlink the mergetools subdir into the t/valgrind/bin
directory as a whole, since it does not contain anything of interest
to the valgrind wrappers.

Signed-off-by: Thomas Rast <trast@student.ethz.ch>
Acked-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agogrep: Fix race condition in delta_base_cache
Nicolas Morey-Chaisemartin [Tue, 30 Aug 2011 13:45:38 +0000 (15:45 +0200)] 
grep: Fix race condition in delta_base_cache

When running large git grep (ie: git grep regexp $(git rev-list --all)), glibc error sometimes occur:
*** glibc detected *** git: double free or corruption (!prev): 0x00000000010abdf0 ***

According to gdb the problem originate from release_delta_cash (sha1_file.c:1703)
free(ent->data);

>From my analysis it seems that git grep threads do acquire lock before calling read_sha1_file but not before calling
read_object_with_reference who ends up calling read_sha1_file too.

Adding the lock around read_object_with_reference seems to fix the issue for me.
I've ran git grep about a dozen time and seen no more error while
it usually happened half the time before.

Signed-off-by: Nicolas Morey-Chaisemartin <nicolas@morey-chaisemartin.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>