git
13 years agoMerge branch 'jc/run-receive-hook-cleanup'
Junio C Hamano [Wed, 5 Oct 2011 19:36:22 +0000 (12:36 -0700)] 
Merge branch 'jc/run-receive-hook-cleanup'

* jc/run-receive-hook-cleanup:
  refactor run_receive_hook()

13 years agoMerge branch 'hl/iso8601-more-zone-formats'
Junio C Hamano [Wed, 5 Oct 2011 19:36:22 +0000 (12:36 -0700)] 
Merge branch 'hl/iso8601-more-zone-formats'

* hl/iso8601-more-zone-formats:
  date.c: Support iso8601 timezone formats

13 years agoMerge branch 'rj/quietly-create-dep-dir'
Junio C Hamano [Wed, 5 Oct 2011 19:36:21 +0000 (12:36 -0700)] 
Merge branch 'rj/quietly-create-dep-dir'

* rj/quietly-create-dep-dir:
  Makefile: Make dependency directory creation less noisy

13 years agoMerge branch 'jc/receive-verify'
Junio C Hamano [Wed, 5 Oct 2011 19:36:21 +0000 (12:36 -0700)] 
Merge branch 'jc/receive-verify'

* jc/receive-verify:
  receive-pack: check connectivity before concluding "git push"
  check_everything_connected(): libify
  check_everything_connected(): refactor to use an iterator
  fetch: verify we have everything we need before updating our ref

Conflicts:
builtin/fetch.c

13 years agoMerge branch 'jc/fetch-verify'
Junio C Hamano [Wed, 5 Oct 2011 19:36:20 +0000 (12:36 -0700)] 
Merge branch 'jc/fetch-verify'

* jc/fetch-verify:
  fetch: verify we have everything we need before updating our ref
  rev-list --verify-object
  list-objects: pass callback data to show_objects()

13 years agoMerge branch 'jc/fetch-pack-fsck-objects'
Junio C Hamano [Wed, 5 Oct 2011 19:36:20 +0000 (12:36 -0700)] 
Merge branch 'jc/fetch-pack-fsck-objects'

* jc/fetch-pack-fsck-objects:
  test: fetch/receive with fsckobjects
  transfer.fsckobjects: unify fetch/receive.fsckobjects
  fetch.fsckobjects: verify downloaded objects

Conflicts:
Documentation/config.txt
builtin/fetch-pack.c

13 years agoMerge branch 'jc/traverse-commit-list'
Junio C Hamano [Wed, 5 Oct 2011 19:36:19 +0000 (12:36 -0700)] 
Merge branch 'jc/traverse-commit-list'

* jc/traverse-commit-list:
  revision.c: update show_object_with_name() without using malloc()
  revision.c: add show_object_with_name() helper function
  rev-list: fix finish_object() call

13 years agoMerge branch 'rr/revert-cherry-pick-continue'
Junio C Hamano [Wed, 5 Oct 2011 19:36:19 +0000 (12:36 -0700)] 
Merge branch 'rr/revert-cherry-pick-continue'

* rr/revert-cherry-pick-continue:
  builtin/revert.c: make commit_list_append() static
  revert: Propagate errors upwards from do_pick_commit
  revert: Introduce --continue to continue the operation
  revert: Don't implicitly stomp pending sequencer operation
  revert: Remove sequencer state when no commits are pending
  reset: Make reset remove the sequencer state
  revert: Introduce --reset to remove sequencer state
  revert: Make pick_commits functionally act on a commit list
  revert: Save command-line options for continuing operation
  revert: Save data for continuing after conflict resolution
  revert: Don't create invalid replay_opts in parse_args
  revert: Separate cmdline parsing from functional code
  revert: Introduce struct to keep command-line options
  revert: Eliminate global "commit" variable
  revert: Rename no_replay to record_origin
  revert: Don't check lone argument in get_encoding
  revert: Simplify and inline add_message_to_msg
  config: Introduce functions to write non-standard file
  advice: Introduce error_resolve_conflict

13 years agoMerge branch 'da/make-auto-header-dependencies'
Junio C Hamano [Wed, 5 Oct 2011 19:36:18 +0000 (12:36 -0700)] 
Merge branch 'da/make-auto-header-dependencies'

* da/make-auto-header-dependencies:
  Makefile: Improve compiler header dependency check

13 years agoMerge branch 'gb/am-hg-patch'
Junio C Hamano [Wed, 5 Oct 2011 19:36:17 +0000 (12:36 -0700)] 
Merge branch 'gb/am-hg-patch'

* gb/am-hg-patch:
  am: preliminary support for hg patches

13 years agoMerge branch 'bc/unstash-clean-crufts'
Junio C Hamano [Wed, 5 Oct 2011 19:36:17 +0000 (12:36 -0700)] 
Merge branch 'bc/unstash-clean-crufts'

* bc/unstash-clean-crufts:
  git-stash: remove untracked/ignored directories when stashed
  t/t3905: add missing '&&' linkage
  git-stash.sh: fix typo in error message
  t/t3905: use the name 'actual' for test output, swap arguments to test_cmp

13 years agoMerge branch 'fk/make-auto-header-dependencies'
Junio C Hamano [Wed, 5 Oct 2011 19:36:16 +0000 (12:36 -0700)] 
Merge branch 'fk/make-auto-header-dependencies'

* fk/make-auto-header-dependencies:
  Makefile: Use computed header dependencies if the compiler supports it

13 years agoMerge branch 'ms/patch-id-with-overlong-line'
Junio C Hamano [Wed, 5 Oct 2011 19:35:55 +0000 (12:35 -0700)] 
Merge branch 'ms/patch-id-with-overlong-line'

* ms/patch-id-with-overlong-line:
  patch-id.c: use strbuf instead of a fixed buffer

13 years agoMerge branch 'jc/maint-bundle-too-quiet'
Junio C Hamano [Wed, 5 Oct 2011 19:35:55 +0000 (12:35 -0700)] 
Merge branch 'jc/maint-bundle-too-quiet'

* jc/maint-bundle-too-quiet:
  Teach progress eye-candy to fetch_refs_from_bundle()

13 years agoMerge branch 'jk/filter-branch-require-clean-work-tree'
Junio C Hamano [Wed, 5 Oct 2011 19:35:55 +0000 (12:35 -0700)] 
Merge branch 'jk/filter-branch-require-clean-work-tree'

* jk/filter-branch-require-clean-work-tree:
  filter-branch: use require_clean_work_tree

13 years agoMerge branch 'jc/want-commit'
Junio C Hamano [Wed, 5 Oct 2011 19:35:55 +0000 (12:35 -0700)] 
Merge branch 'jc/want-commit'

* jc/want-commit:
  Allow git merge ":/<pattern>"

13 years agoMerge branch 'jc/maint-fsck-fwrite-size-check'
Junio C Hamano [Wed, 5 Oct 2011 19:35:54 +0000 (12:35 -0700)] 
Merge branch 'jc/maint-fsck-fwrite-size-check'

* jc/maint-fsck-fwrite-size-check:
  fsck: do not abort upon finding an empty blob

13 years agoMerge branch 'bk/ancestry-path'
Junio C Hamano [Wed, 5 Oct 2011 19:35:54 +0000 (12:35 -0700)] 
Merge branch 'bk/ancestry-path'

* bk/ancestry-path:
  t6019: avoid refname collision on case-insensitive systems
  revision: do not include sibling history in --ancestry-path output
  revision: keep track of the end-user input from the command line
  rev-list: Demonstrate breakage with --ancestry-path --all

13 years agoMerge branch 'jk/maint-fetch-submodule-check-fix'
Junio C Hamano [Wed, 5 Oct 2011 19:35:54 +0000 (12:35 -0700)] 
Merge branch 'jk/maint-fetch-submodule-check-fix'

* jk/maint-fetch-submodule-check-fix:
  fetch: avoid quadratic loop checking for updated submodules

13 years agoMerge branch 'tr/mergetool-valgrind'
Junio C Hamano [Wed, 5 Oct 2011 19:35:53 +0000 (12:35 -0700)] 
Merge branch 'tr/mergetool-valgrind'

* tr/mergetool-valgrind:
  Symlink mergetools scriptlets into valgrind wrappers

13 years agoMerge branch 'nm/grep-object-sha1-lock'
Junio C Hamano [Wed, 5 Oct 2011 19:35:53 +0000 (12:35 -0700)] 
Merge branch 'nm/grep-object-sha1-lock'

* nm/grep-object-sha1-lock:
  grep: Fix race condition in delta_base_cache

Conflicts:
builtin/grep.c

13 years agoMerge branch 'jc/diff-index-unpack'
Junio C Hamano [Wed, 5 Oct 2011 19:35:53 +0000 (12:35 -0700)] 
Merge branch 'jc/diff-index-unpack'

* jc/diff-index-unpack:
  diff-index: pass pathspec down to unpack-trees machinery
  unpack-trees: allow pruning with pathspec
  traverse_trees(): allow pruning with pathspec

13 years agoMerge branch 'mm/rebase-i-exec-edit'
Junio C Hamano [Wed, 5 Oct 2011 19:35:52 +0000 (12:35 -0700)] 
Merge branch 'mm/rebase-i-exec-edit'

* mm/rebase-i-exec-edit:
  rebase -i: notice and warn if "exec $cmd" modifies the index or the working tree
  rebase -i: clean error message for --continue after failed exec

13 years agoGit 1.7.7 v1.7.7
Junio C Hamano [Fri, 30 Sep 2011 21:20:57 +0000 (14:20 -0700)] 
Git 1.7.7

Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agotemplates/hooks--*: remove sample hooks without any functionality
Gerrit Pape [Tue, 27 Sep 2011 11:56:53 +0000 (11:56 +0000)] 
templates/hooks--*: remove sample hooks without any functionality

Remove the sample post-commit and post-receive hooks.  The sample
post-commit doesn't contain any sample functionality and the comments do
not provide more information than already found in the documentation.
The sample post-receive hooks doesn't provide any sample functionality
either and refers in the comments to a contrib hook that might be
installed in different locations on different systems, which isn't that
helpful.

Signed-off-by: Gerrit Pape <pape@smarden.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agocontrib/hooks: adapt comment about Debian install location for contrib hooks
Gerrit Pape [Mon, 26 Sep 2011 12:58:35 +0000 (12:58 +0000)] 
contrib/hooks: adapt comment about Debian install location for contrib hooks

Placing the contrib hooks into /usr/share/doc/ wasn't a good idea in the
first place.  According to the Debian policy they should be located in
/usr/share/git-core/, so let's put them there.

Thanks to Bill Allombert for reporting this through
 http://bugs.debian.org/640949

Signed-off-by: Gerrit Pape <pape@smarden.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agoMerge branch 'jc/namespace-doc-with-old-asciidoc'
Junio C Hamano [Mon, 26 Sep 2011 17:50:08 +0000 (10:50 -0700)] 
Merge branch 'jc/namespace-doc-with-old-asciidoc'

* jc/namespace-doc-with-old-asciidoc:
  Documentation/gitnamespaces.txt: cater to older asciidoc

13 years agoGit 1.7.7-rc3 v1.7.7-rc3
Junio C Hamano [Fri, 23 Sep 2011 22:35:57 +0000 (15:35 -0700)] 
Git 1.7.7-rc3

Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agoMerge 1.7.6.4 in
Junio C Hamano [Fri, 23 Sep 2011 22:31:08 +0000 (15:31 -0700)] 
Merge 1.7.6.4 in

Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agomerge-recursive: Do not look at working tree during a virtual ancestor merge
Junio C Hamano [Fri, 23 Sep 2011 22:21:01 +0000 (15:21 -0700)] 
merge-recursive: Do not look at working tree during a virtual ancestor merge

Fix another instance of a recursive merge incorrectly paying attention to
the working tree file during a virtual ancestor merge, that resulted in
spurious and useless "addinfo_cache failed" error message.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agoGit 1.7.6.4 v1.7.6.4
Junio C Hamano [Fri, 23 Sep 2011 21:38:39 +0000 (14:38 -0700)] 
Git 1.7.6.4

Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agoMerge branch 'cb/maint-ls-files-error-report' into maint
Junio C Hamano [Fri, 23 Sep 2011 21:30:49 +0000 (14:30 -0700)] 
Merge branch 'cb/maint-ls-files-error-report' into maint

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

13 years agodescribe: Refresh the index when run with --dirty
Allan Caffee [Mon, 1 Aug 2011 01:52:41 +0000 (21:52 -0400)] 
describe: Refresh the index when run with --dirty

When running git describe --dirty the index should be refreshed.  Previously
the cached index would cause describe to think that the index was dirty when,
in reality, it was just stale.

The issue was exposed by python setuptools which hardlinks files into another
directory when building a distribution.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agoMerge branch 'jc/maint-clone-alternates' into maint
Junio C Hamano [Fri, 23 Sep 2011 21:27:33 +0000 (14:27 -0700)] 
Merge branch 'jc/maint-clone-alternates' into maint

* jc/maint-clone-alternates:
  clone: clone from a repository with relative alternates
  clone: allow more than one --reference

13 years agoMerge branch 'nd/maint-clone-gitdir' into maint
Junio C Hamano [Fri, 23 Sep 2011 21:21:39 +0000 (14:21 -0700)] 
Merge branch 'nd/maint-clone-gitdir' into maint

* nd/maint-clone-gitdir:
  clone: allow to clone from .git file
  read_gitfile_gently(): rename misnamed function to read_gitfile()

13 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

13 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

13 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

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

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

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

13 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>
13 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>
13 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>
13 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>
13 years agoAllow git merge ":/<pattern>"
Junio C Hamano [Wed, 7 Sep 2011 18:16:03 +0000 (11:16 -0700)] 
Allow git merge ":/<pattern>"

It probably is not such a good idea to use ":/<pattern>" to specify which
commit to merge, as ":/<pattern>" can often hit unexpected commits, but
somebody tried it and got a nonsense error message:

fatal: ':/Foo bar' does not point to a commit

So here is a for-the-sake-of-consistency update that is fairly useless
that allows users to carefully try not shooting in the foot.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 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>
13 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

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