Code

git.git
12 years agoMerge branch 'mh/check-ref-format-print-normalize' into maint
Junio C Hamano [Fri, 23 Sep 2011 21:20:51 +0000 (14:20 -0700)]
Merge branch 'mh/check-ref-format-print-normalize' into maint

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

12 years agoMerge branch 'mg/branch-set-upstream-previous' into maint
Junio C Hamano [Fri, 23 Sep 2011 21:16:22 +0000 (14:16 -0700)]
Merge branch 'mg/branch-set-upstream-previous' into maint

* mg/branch-set-upstream-previous:
  branch.c: use the parsed branch name

12 years agoMerge branch 'gb/maint-am-patch-format-error-message' into maint
Junio C Hamano [Fri, 23 Sep 2011 21:11:18 +0000 (14:11 -0700)]
Merge branch 'gb/maint-am-patch-format-error-message' into maint

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

12 years agodiff: teach --stat/--numstat to honor -U$num
Junio C Hamano [Thu, 22 Sep 2011 17:54:47 +0000 (10:54 -0700)]
diff: teach --stat/--numstat to honor -U$num

"git diff -p" piped to external diffstat and "git diff --stat" may see
different patch text (both are valid and describe the same change
correctly) when counting the number of added and deleted lines, arriving
at different results to confuse the users, as --stat/--numstat codepath
always uses the hardcoded -U0 as the context length.

Make --stat/--numstat codepath to honor the context length the same way
as the textual patch codepath does to avoid this problem.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agopatch-id.c: use strbuf instead of a fixed buffer
Michael Schubert [Wed, 21 Sep 2011 12:42:22 +0000 (14:42 +0200)]
patch-id.c: use strbuf instead of a fixed buffer

get_one_patchid() uses a rather dumb heuristic to determine if the
passed buffer is part of the next commit. Whenever the first 40 bytes
are a valid hexadecimal sha1 representation, get_one_patchid() returns
next_sha1.

Once the current line is longer than the fixed buffer, this will break
(provided the additional bytes make a valid hexadecimal sha1). As a result
patch-id returns incorrect results. Instead, use strbuf and read one line
at a time.

Helped-by: Jeff King <peff@peff.net>
Signed-off-by: Michael Schubert <mschub@elegosoft.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agogit-read-tree.txt: correct sparse-checkout and skip-worktree description
Michael J Gruber [Wed, 21 Sep 2011 07:48:38 +0000 (09:48 +0200)]
git-read-tree.txt: correct sparse-checkout and skip-worktree description

The description of .git/info/sparse-checkout and
skip-worktree is exactly the opposite of what is true, which is:

If a file matches a pattern in sparse-checkout, then (it is to be
checked out and therefore) skip-worktree is unset for that file;
otherwise, it is set (so that it is not checked out).

Currently, the opposite is documented, and (consistently) read-tree's
behavior with respect to bit flips is descibed incorrectly.

Fix it.

In hindsight, it would have been much better to have a "sparse-ignore"
or "sparse-skip" file so that an empty file would mean a full checkout,
and the file logic would be analogous to that of .gitignore, excludes
and skip-worktree.

Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agogit-read-tree.txt: language and typography fixes
Michael J Gruber [Wed, 21 Sep 2011 07:48:37 +0000 (09:48 +0200)]
git-read-tree.txt: language and typography fixes

Fix a few missing articles and such, and mark-up 'commands' and `files`
appropriately.

Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agounpack-trees: print "Aborting" to stderr
Michael J Gruber [Wed, 21 Sep 2011 07:48:36 +0000 (09:48 +0200)]
unpack-trees: print "Aborting" to stderr

display_error_msgs() prints all the errors to stderr already (if any),
followed by "Aborting" (if any) to stdout. Make the latter go to stderr
instead.

Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agoRemove 'working copy' from the documentation and C code
Carlos Martín Nieto [Tue, 20 Sep 2011 20:25:57 +0000 (22:25 +0200)]
Remove 'working copy' from the documentation and C code

The git term is 'working tree', so replace the most public references
to 'working copy'.

Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agot9159-*.sh: skip for mergeinfo test for svn <= 1.4
Ramsay Jones [Sat, 10 Sep 2011 17:40:10 +0000 (18:40 +0100)]
t9159-*.sh: skip for mergeinfo test for svn <= 1.4

t9159 relies on the command-line syntax of svn >= 1.5.  Given the
declining install base of older svn versions, it is not worth our time to
support older svn syntax.

Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
Acked-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agoDocumentation/git-update-index: refer to 'ls-files'
Stefan Naewe [Wed, 21 Sep 2011 06:21:50 +0000 (08:21 +0200)]
Documentation/git-update-index: refer to 'ls-files'

'ls-files' refers to 'update-index' to show how the 'assume unchanged'
bit can be seen. This makes the connection 'bi-directional'.

Signed-off-by: Stefan Naewe <stefan.naewe@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agobisect: fix exiting when checkout failed in bisect_start()
Christian Couder [Wed, 21 Sep 2011 05:17:24 +0000 (07:17 +0200)]
bisect: fix exiting when checkout failed in bisect_start()

Commit 4796e823 ("bisect: introduce --no-checkout support into porcelain." Aug 4 2011)
made checking out the branch where we started depends on the "checkout" mode. But
unfortunately it lost the "|| exit" part after the checkout command.

As it makes no sense to continue if the checkout failed and as people have already
complained that the error message given when we just exit in this case is not clear, see:

http://thread.gmane.org/gmane.comp.version-control.git/180733/

this patch adds a "|| die <hopefully clear message>" part after the checkout command.

Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Acked-by: Jon Seymour <jon.seymour@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agoMerge branch 'maint'
Junio C Hamano [Tue, 20 Sep 2011 03:46:48 +0000 (20:46 -0700)]
Merge branch 'maint'

* maint:
  git-mergetool: check return value from read

12 years agogit-mergetool: check return value from read
Jay Soffian [Mon, 19 Sep 2011 23:40:52 +0000 (19:40 -0400)]
git-mergetool: check return value from read

Mostly fixed already by 6b44577 (mergetool: check return value
from read, 2011-07-01). Catch two uses it missed.

Signed-off-by: Jay Soffian <jaysoffian@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agoMerge branch 'ph/format-patch-no-color'
Junio C Hamano [Mon, 19 Sep 2011 20:15:41 +0000 (13:15 -0700)]
Merge branch 'ph/format-patch-no-color'

* ph/format-patch-no-color:
  t4014: clean up format.thread config after each test

12 years agot4014: clean up format.thread config after each test
Jeff King [Mon, 19 Sep 2011 19:15:45 +0000 (15:15 -0400)]
t4014: clean up format.thread config after each test

The threading tests turn on format.thread, but never clean
up after themselves, meaning that later tests will also have
format.thread set.

This is more annoying than most leftover config, too,
because not only does it impact the results of other tests,
but it does so non-deterministically. Threading requires the
generation of message-ids, which incorporate the current
time, meaning a slow-running test script may generate
different results from run to run.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agoTeach progress eye-candy to fetch_refs_from_bundle()
Junio C Hamano [Sun, 18 Sep 2011 23:52:32 +0000 (16:52 -0700)]
Teach progress eye-candy to fetch_refs_from_bundle()

With the usual "git" transport, a large-ish transfer with "git fetch" and
"git pull" give progress eye-candy to avoid boring users.  However, not
when they are reading from a bundle. I.e.

    $ git pull ../git-bundle.bndl master

This teaches bundle.c:unbundle() to give "-v" option to index-pack and
tell it to give progress bar when transport decides it is necessary.

The operation in the other direction, "git bundle create", could also
learn to honor --quiet but that is a separate issue.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agoGit 1.7.7-rc2 v1.7.7-rc2
Junio C Hamano [Sun, 18 Sep 2011 22:41:34 +0000 (15:41 -0700)]
Git 1.7.7-rc2

Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agoAccept tags in HEAD or MERGE_HEAD
Nguyễn Thái Ngọc Duy [Sat, 17 Sep 2011 11:57:45 +0000 (21:57 +1000)]
Accept tags in HEAD or MERGE_HEAD

HEAD and MERGE_HEAD (among other branch tips) should never hold a
tag. That can only be caused by broken tools and is cumbersome to fix
by an end user with:

  $ git update-ref HEAD $(git rev-parse HEAD^{commit})

which may look like a magic to a new person.

Be easy, warn users (so broken tools can be fixed if they bother to
report) and move on.

Be robust, if the given SHA-1 cannot be resolved to a commit object,
die (therefore return value is always valid).

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agomerge: remove global variable head[]
Nguyễn Thái Ngọc Duy [Sat, 17 Sep 2011 11:57:44 +0000 (21:57 +1000)]
merge: remove global variable head[]

Also kill head_invalid in favor of "head_commit == NULL".

Local variable "head" in cmd_merge() is renamed to "head_sha1" to make
sure I don't miss any access because this variable should not be used
after head_commit is set (use head_commit->object.sha1 instead).

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agomerge: use return value of resolve_ref() to determine if HEAD is invalid
Nguyễn Thái Ngọc Duy [Sat, 17 Sep 2011 11:57:43 +0000 (21:57 +1000)]
merge: use return value of resolve_ref() to determine if HEAD is invalid

resolve_ref() only updates "head" when it returns non NULL value (it
may update "head" even when returning NULL, but not in all cases).

Because "head" is not initialized before the call, is_null_sha1() is
not enough. Check also resolve_ref() return value.

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agoMerge branch 'ci/forbid-unwanted-current-branch-update'
Junio C Hamano [Sat, 17 Sep 2011 04:48:10 +0000 (21:48 -0700)]
Merge branch 'ci/forbid-unwanted-current-branch-update'

* ci/forbid-unwanted-current-branch-update:
  branch --set-upstream: regression fix

12 years agobranch --set-upstream: regression fix
Junio C Hamano [Fri, 16 Sep 2011 23:28:38 +0000 (16:28 -0700)]
branch --set-upstream: regression fix

The "git branch" command, while not in listing mode, calls create_branch()
even when the target branch already exists, and it does so even when it is
not interested in updating the value of the branch (i.e. the name of the
commit object that sits at the tip of the existing branch). This happens
when the command is run with "--set-upstream" option.

The earlier safety-measure to prevent "git branch -f $branch $commit" from
updating the currently checked out branch did not take it into account,
and we no longer can update the tracking information of the current branch.

Minimally fix this regression by telling the validation code if it is
called to really update the value of a potentially existing branch, or if
the caller merely is interested in updating auxiliary aspects of a branch.

Reported-and-Tested-by: Jay Soffian
Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agoDisambiguate duplicate t9160* tests
Frédéric Heitzmann [Fri, 16 Sep 2011 19:55:03 +0000 (21:55 +0200)]
Disambiguate duplicate t9160* tests

1e5814f created t9160-git-svn-mergeinfo-push.sh on 11/9/7
40a1530 created t9160-git-svn-preserve-empty-dirs.sh on 11/7/20
The former test script is renumbered to t9161.

Signed-off-by: Frédéric Heitzmann <frederic.heitzmann@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agogitweb: Strip non-printable characters from syntax highlighter output
Jakub Narebski [Fri, 16 Sep 2011 12:41:57 +0000 (14:41 +0200)]
gitweb: Strip non-printable characters from syntax highlighter output

The current code, as is, passes control characters, such as form-feed
(^L) to highlight which then passes it through to the browser.  User
agents (web browsers) that support 'application/xhtml+xml' usually
require that web pages declared as XHTML and with this mimetype are
well-formed XML.  Unescaped control characters cannot appear within a
contents of a valid XML document.

This will cause the browser to display one of the following warnings:

* Safari v5.1 (6534.50) & Google Chrome v13.0.782.112:

   This page contains the following errors:

   error on line 657 at column 38: PCDATA invalid Char value 12
   Below is a rendering of the page up to the first error.

* Mozilla Firefox 3.6.19 & Mozilla Firefox 5.0:

   XML Parsing Error: not well-formed
   Location:
   http://path/to/git/repo/blah/blah

Both errors were generated by gitweb.perl v1.7.3.4 w/ highlight 2.7
using arch/ia64/kernel/unwind.c from the Linux kernel.

When syntax highlighter is not used, control characters are replaced
by esc_html(), but with syntax highlighter they were passed through to
browser (to_utf8() doesn't remove control characters).

Introduce sanitize() subroutine which strips forbidden characters, but
does not perform HTML escaping, and use it in git_blob() to sanitize
syntax highlighter output for XHTML.

Note that excluding "\t" (U+0009), "\n" (U+000A) and "\r" (U+000D) is
not strictly necessary, atleast for currently the only callsite: "\t"
tabs are replaced by spaces by untabify(), "\n" is stripped from each
line before processing it, and replacing "\r" could be considered
improvement.

Originally-by: Christopher M. Fuhrman <cfuhrman@panix.com>
Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agoDocumentation/gitnamespaces.txt: cater to older asciidoc
Junio C Hamano [Fri, 16 Sep 2011 00:09:41 +0000 (17:09 -0700)]
Documentation/gitnamespaces.txt: cater to older asciidoc

Older asciidoc (e.g. 8.2.5 on Centos 5.5) is unhappy if a manpage does not
have a SYNOPSIS section. Show a sample (and a possibly bogus) command line
of running two commands that pay attention to this environment variable
with a customized value.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
Reviewed-by: Jamey Sharp <jamey@minilop.net>
12 years agofilter-branch: use require_clean_work_tree
Jeff King [Thu, 1 Sep 2011 21:53:07 +0000 (17:53 -0400)]
filter-branch: use require_clean_work_tree

Filter-branch already requires that we have a clean work
tree before starting. However, it failed to refresh the
index before checking, which means it could be wrong in the
case of stat-dirtiness.

Instead of simply adding a call to refresh the index, let's
switch to using the require_clean_work_tree function
provided by git-sh-setup. It does exactly what we want, and
with fewer lines of code and more specific output messages.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agot6019: avoid refname collision on case-insensitive systems
Thomas Rast [Thu, 15 Sep 2011 08:34:31 +0000 (10:34 +0200)]
t6019: avoid refname collision on case-insensitive systems

The criss-cross tests kept failing for me because of collisions of 'a'
with 'A' etc.  Prefix the lowercase refnames with an extra letter to
disambiguate.

Signed-off-by: Thomas Rast <trast@student.ethz.ch>
Acked-by: Brad King <brad.king@kitware.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agoMerge branch 'ph/format-patch-no-color'
Junio C Hamano [Thu, 15 Sep 2011 04:43:57 +0000 (21:43 -0700)]
Merge branch 'ph/format-patch-no-color'

* ph/format-patch-no-color:
  format-patch: ignore ui.color

12 years agorun_hook: use argv_array API
Jeff King [Tue, 13 Sep 2011 21:58:25 +0000 (17:58 -0400)]
run_hook: use argv_array API

This was a pretty straightforward use, so it really doesn't
save that many lines. Still, perhaps it's a little bit more
readable.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agocheckout: use argv_array API
Jeff King [Tue, 13 Sep 2011 21:58:19 +0000 (17:58 -0400)]
checkout: use argv_array API

We were using a similar ad-hoc rev_list_args structure, but
this saves some code.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agobisect: use argv_array API
Jeff King [Tue, 13 Sep 2011 21:58:14 +0000 (17:58 -0400)]
bisect: use argv_array API

Now that the argv_array API exists, we can save some lines
of code.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agoquote: provide sq_dequote_to_argv_array
Jeff King [Tue, 13 Sep 2011 21:58:08 +0000 (17:58 -0400)]
quote: provide sq_dequote_to_argv_array

This is similar to sq_dequote_to_argv, but more convenient
if you have an argv_array. It's tempting to just feed the
components of the argv_array to sq_dequote_to_argv instead,
but:

  1. It wouldn't maintain the NULL-termination invariant
     of argv_array.

  2. It doesn't match the memory ownership policy of
     argv_array (in which each component is free-able, not a
     pointer into a separate buffer).

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 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>
12 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>
12 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>
12 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>
12 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>
12 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>
12 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>
12 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>
12 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>
12 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>
12 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>
12 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

12 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>
12 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

12 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

12 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>
12 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'

12 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

12 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

12 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

12 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

12 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

12 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

12 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

12 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

12 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>
12 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>
12 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>
12 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>
12 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>
12 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>
12 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>
12 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>
12 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>
12 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>
12 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>
12 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>
12 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()

12 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

12 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

12 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>
12 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>
12 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>
12 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>
12 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.

12 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

12 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

12 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

12 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

12 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

12 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

12 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

12 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

12 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

12 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

12 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>"

12 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

12 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

12 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()

12 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

12 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
  ...

12 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>
12 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>
12 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>
12 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>
12 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>
12 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>