gitweb.git
merge script: refuse to merge during mergeJonathan Nieder Tue, 17 Aug 2010 07:03:58 +0000 (02:03 -0500)

merge script: refuse to merge during merge

Check MERGE_HEAD and bail out if it exists. Based on v1.6.3.3~3^2
(refuse to merge during a merge, 2009-06-01). Without this change,
the scripted merge does not pass t3030.

Cc: Clemens Buchacher <drizzd@aon.at>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

merge script: tweak unmerged files message to match... Jonathan Nieder Tue, 17 Aug 2010 07:03:36 +0000 (02:03 -0500)

merge script: tweak unmerged files message to match builtin

Before:

You are in the middle of a conflicted merge.

After:

Merge is not possible because you have unmerged files.

I prefer the old message, but the new one is more consistent with
other commands and tests expect it. In particular, without this
change the scripted merge does not pass t3030.

Based on v1.7.0-rc0~66^2 (Be more user-friendly when refusing to do
something because of conflict., 2010-01-12).

Cc: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

merge script: --squash, --ff from unborn branch are... Jonathan Nieder Tue, 17 Aug 2010 07:03:07 +0000 (02:03 -0500)

merge script: --squash, --ff from unborn branch are errors

Port v1.6.1-rc1~319 (provide more errors for the "merge into empty
head" case, 2008-08-21) to the example merge script.

Noticed by comparison with builtin merge.

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

fmt-merge-msg -m to override merge titleJonathan Nieder Tue, 17 Aug 2010 23:00:34 +0000 (18:00 -0500)

fmt-merge-msg -m to override merge title

Since v1.7.1.1~23^2 (merge: --log appends shortlog to message if
specified, 2010-05-11), the fmt-merge-msg backend supports custom text
to override the merge title "Merge <foo> into <bar>".

Expose this functionality for scripted callers. Example:

git fmt-merge-msg --log -m \
"$(printf '%s\n' \
"Merge branch 'api-cleanup' into feature" \
'' \
'This is to use a few functions refactored for this purpose.'
)" <.git/FETCH_HEAD

Cc: Tay Ray Chuan <rctay89@gmail.com>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

merge-base --independent to print reduced parent list... Jonathan Nieder Tue, 17 Aug 2010 07:01:54 +0000 (02:01 -0500)

merge-base --independent to print reduced parent list in a merge

While show-branch --independent does not support more than MAX_REVS
revs, git internally supports more with a different algorithm.
Expose that functionality as "git merge-base --independent".

This should help scripts to catch up with builtin merge in supporting
dodecapus.

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

merge-base --octopus to mimic show-branch --merge-baseJonathan Nieder Tue, 17 Aug 2010 07:01:15 +0000 (02:01 -0500)

merge-base --octopus to mimic show-branch --merge-base

While show-branch --merge-base does not support more than MAX_REVS
revs, git supports more with a different algorithm
(v1.6.0-rc0~51^2~13, Introduce get_octopus_merge_bases() in commit.c,
2008-06-27). Expose that functionality.

This should help scripts to catch up with builtin merge in supporting
dodecapus.

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Documentation: add a SEE ALSO section for merge-baseJonathan Nieder Tue, 17 Aug 2010 06:59:55 +0000 (01:59 -0500)

Documentation: add a SEE ALSO section for merge-base

For example, a person reading the merge-base man page might wonder
about the fastest way to check if one commit is an ancestor of
another (which would require rev-list).

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

t6200 (fmt-merge-msg): style nitpicksJonathan Nieder Tue, 17 Aug 2010 06:57:40 +0000 (01:57 -0500)

t6200 (fmt-merge-msg): style nitpicks

Guard setup with test_expect_success. Use test_might_fail
instead of ignoring the exit code from git config --unset.
Point out setup commands that are shared by multiple tests,
to make it easy to write GIT_SKIP_TESTS specifications that
work.

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

t6010 (merge-base): modernize styleJonathan Nieder Tue, 17 Aug 2010 06:57:12 +0000 (01:57 -0500)

t6010 (merge-base): modernize style

Guard setup with test_expect_success, put the opening quote
starting each test on the same line as the test_expect_* invocation,
and combine related actions into single tests.

While at it:

- use test_cmp instead of expr or test $foo = $bar, for more helpful
output with -v when tests fail;

- use test_commit for brevity.

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

t7600 (merge): test merge from branch yet to be bornJonathan Nieder Tue, 17 Aug 2010 06:56:46 +0000 (01:56 -0500)

t7600 (merge): test merge from branch yet to be born

Some people like to "git fetch origin && merge origin/master" from
the unborn branch provided when first initializing a repository.

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

t7600 (merge): check reflog entryJonathan Nieder Tue, 17 Aug 2010 06:56:13 +0000 (01:56 -0500)

t7600 (merge): check reflog entry

The details of the reflog message are not important, but
including something sane in the reflog is.

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

t7600 (merge): do not launch gitk for --debugJonathan Nieder Tue, 17 Aug 2010 06:54:59 +0000 (01:54 -0500)

t7600 (merge): do not launch gitk for --debug

Probably as a development aid, this test script runs gitk --all
to allow the driver to inspect history between tests when run
with --debug. As a result, running all tests with --debug
requires closing a long series of gitk displays, one at a time.

Use git log --graph --oneline instead. This way, the history is
available for viewing with "git show" but the test script finishes
without interaction.

Longer term, it would be nice to have an option to run a
user-specified command between tests. This patch does not do
that.

Cc: Lars Hjemli <hjemli@gmail.com>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

t7600 (merge): modernize styleJonathan Nieder Tue, 17 Aug 2010 06:53:56 +0000 (01:53 -0500)

t7600 (merge): modernize style

Guard setup commands with test_expect_success, so they are easier
to visually skip over and get to the good part. While at it:

- use "printf '%s\n' a b ..." instead of "cat <<EOF" for test
vectors with short lines;

- use test_cmp instead of test foo = bar where possible, for
better output with -v on failure;

- do not go to extraordinary lengths to print a relevant message
when test commands fail. There is a patch in flight that could be
used to restore the nice error messages in a cleaner way.

Cc: Lars Hjemli <hjemli@gmail.com>
Cc: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

merge: do not mistake (ancestor of) tag for branchJonathan Nieder Tue, 17 Aug 2010 06:52:48 +0000 (01:52 -0500)

merge: do not mistake (ancestor of) tag for branch

If no branch 'foo' exists but a tag 'foo' does, then
git merge foo^ results in

Merge branch 'foo' (early part)

as a commit message, because the relevant code path checks that
refs/heads/foo is a valid refname for writing rather than for
reading.

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

submodule sync: Update "submodule.<name>.url"David Aguilar Wed, 18 Aug 2010 15:58:33 +0000 (08:58 -0700)

submodule sync: Update "submodule.<name>.url"

When "git submodule sync" synchronizes the repository URLs
it only updates submodules' .git/config. However, the old
URLs still exist in the super-project's .git/config.

Update the super-project's configuration so that commands
such as "git submodule update" use the URLs from .gitmodules.

Signed-off-by: David Aguilar <davvid@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

tests: fix syntax error in "Use advise() for hints... Ævar Arnfjörð Bjarmason Wed, 18 Aug 2010 14:36:44 +0000 (14:36 +0000)

tests: fix syntax error in "Use advise() for hints" test

Change the test introduced in the "Use advise() for hints" patch by
Jonathan Nieder not to use '' for quotes inside '' delimited code. It
ended up introducing a file called <paths> to the main git repository.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Merge branch 'jc/maint-follow-rename-fix'Junio C Hamano Wed, 18 Aug 2010 19:47:18 +0000 (12:47 -0700)

Merge branch 'jc/maint-follow-rename-fix'

* jc/maint-follow-rename-fix:
log: test for regression introduced in v1.7.2-rc0~103^2~2
diff --follow: do call diffcore_std() as necessary
diff --follow: do not waste cycles while recursing

Merge branch 'tf/string-list-init'Junio C Hamano Wed, 18 Aug 2010 19:47:04 +0000 (12:47 -0700)

Merge branch 'tf/string-list-init'

* tf/string-list-init:
string_list: Add STRING_LIST_INIT macro and make use of it.

Merge branch 'cc/find-commit-subject'Junio C Hamano Wed, 18 Aug 2010 19:46:55 +0000 (12:46 -0700)

Merge branch 'cc/find-commit-subject'

* cc/find-commit-subject:
blame: use find_commit_subject() instead of custom code
merge-recursive: use find_commit_subject() instead of custom code
bisect: use find_commit_subject() instead of custom code
revert: rename variables related to subject in get_message()
revert: refactor code to find commit subject in find_commit_subject()
revert: fix off by one read when searching the end of a commit subject

cvs tests: do not touch test CVS repositories shipped... Junio C Hamano Mon, 16 Aug 2010 16:25:01 +0000 (09:25 -0700)

cvs tests: do not touch test CVS repositories shipped with source

Some tests in t96xx series (cvsimport) want to write into the control area
(CVSROOT) of their test CVS repositories, but this does not work well when
the source area is made read-only (test trash directories are moved via
--root=else/where option).

Copy the supplied test CVS repository to a scratch place at the beginning
of these tests.

Signed-off-by: Junio C Hamano <gitster@pobox.com>

t/t9602-cvsimport-branches-tags.sh: Add a PERL prerequisiteÆvar Arnfjörð Bjarmason Fri, 13 Aug 2010 20:40:13 +0000 (20:40 +0000)

t/t9602-cvsimport-branches-tags.sh: Add a PERL prerequisite

Change this test to declare a PERL prerequisite. These tests use the
-p switch, so they implicitly depend on Perl code, but nothing was
declaring this.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

t/t9601-cvsimport-vendor-branch.sh: Add a PERL prerequisiteÆvar Arnfjörð Bjarmason Fri, 13 Aug 2010 20:40:12 +0000 (20:40 +0000)

t/t9601-cvsimport-vendor-branch.sh: Add a PERL prerequisite

Change this test to declare a PERL prerequisite. These tests use the
-p switch, so they implicitly depend on Perl code, but nothing was
declaring this.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

t/t7105-reset-patch.sh: Add a PERL prerequisiteÆvar Arnfjörð Bjarmason Fri, 13 Aug 2010 20:40:11 +0000 (20:40 +0000)

t/t7105-reset-patch.sh: Add a PERL prerequisite

Change this test to declare a PERL prerequisite. These tests use the
-p switch, so they implicitly depend on Perl code, but nothing was
declaring this.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

t/t9001-send-email.sh: convert setup code to testsÆvar Arnfjörð Bjarmason Fri, 13 Aug 2010 20:40:10 +0000 (20:40 +0000)

t/t9001-send-email.sh: convert setup code to tests

Change the setup code in t/t9001-send-email.sh to use
test_expect_success. This way it isn't needlessly run in environments
where the test prerequisites aren't met.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

t/t9001-send-email.sh: change from skip_all=* to prereq... Ævar Arnfjörð Bjarmason Fri, 13 Aug 2010 20:40:09 +0000 (20:40 +0000)

t/t9001-send-email.sh: change from skip_all=* to prereq skip

Change this test to skip test with test prerequisites, and to do setup
work in tests. This improves the skipped statistics on platforms where
the test isn't run.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

t/t9001-send-email.sh: Remove needless PROG=* assignmentÆvar Arnfjörð Bjarmason Fri, 13 Aug 2010 20:40:08 +0000 (20:40 +0000)

t/t9001-send-email.sh: Remove needless PROG=* assignment

Remove the PROG=* assignment from t9001-send-email.sh. It's been there
since v1.4.0-rc1~30 when the test was originally added, but only tests
that source annotate-tests.sh need it, it was seemingly introduced to
this test via copy/paste coding.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

t/t9600-cvsimport.sh: change from skip_all=* to prereq... Ævar Arnfjörð Bjarmason Fri, 13 Aug 2010 20:40:07 +0000 (20:40 +0000)

t/t9600-cvsimport.sh: change from skip_all=* to prereq skip

Change this test to skip test with test prerequisites, and to do setup
work in tests. This improves the skipped statistics on platforms where
the test isn't run.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

lib-patch-mode tests: change from skip_all=* to prereq... Ævar Arnfjörð Bjarmason Fri, 13 Aug 2010 20:40:06 +0000 (20:40 +0000)

lib-patch-mode tests: change from skip_all=* to prereq skip

Change this test to skip test with test prerequisites, and to do setup
work in tests. This improves the skipped statistics on platforms where
the test isn't run.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

t/t3701-add-interactive.sh: change from skip_all=*... Ævar Arnfjörð Bjarmason Fri, 13 Aug 2010 20:40:05 +0000 (20:40 +0000)

t/t3701-add-interactive.sh: change from skip_all=* to prereq skip

Change this test to skip test with test prerequisites, and to do setup
work in tests. This improves the skipped statistics on platforms where
the test isn't run.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

tests: Move FILEMODE prerequisite to lib-prereq-FILEMODE.shÆvar Arnfjörð Bjarmason Fri, 13 Aug 2010 20:40:04 +0000 (20:40 +0000)

tests: Move FILEMODE prerequisite to lib-prereq-FILEMODE.sh

Change the five tests that were all checking "git config --bool
core.filemode" to use a new FILEMODE prerequisite in
lib-prereq-FILEMODE.sh.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

t/Makefile: Create test-results dir for smoke targetÆvar Arnfjörð Bjarmason Sat, 14 Aug 2010 11:37:05 +0000 (11:37 +0000)

t/Makefile: Create test-results dir for smoke target

Change the smoke target to create a test-results directory. This was
done implicitly by the test-lib before my "test-lib: Don't write
test-results when HARNESS_ACTIVE" patch, but after that smoking from
the pu branch hasn't worked.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

git-notes: Run partial expensive test everywhereÆvar Arnfjörð Bjarmason Tue, 10 Aug 2010 23:37:48 +0000 (23:37 +0000)

git-notes: Run partial expensive test everywhere

The git-notes expensive timing test is only expensive because it
either did 10,100,1k and 10k iterations or nothing.

Change it to do 10 by default, with an option to run the expensive
version with the old GIT_NOTES_TIMING_TESTS=ZomgYesPlease variable.

Since nobody was ostensibly running this test under TAP the code had
bitrotted so that it emitted invalid TAP. This change fixes that.

The old version would also mysteriously fail on systems without
/usr/bin/time, there's now a check for that using the multiple test
prerequisite facility.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

t/t3300-funny-names: change from skip_all=* to prereq... Ævar Arnfjörð Bjarmason Wed, 11 Aug 2010 19:04:10 +0000 (19:04 +0000)

t/t3300-funny-names: change from skip_all=* to prereq skip

Change this test to skip test with test prerequisites, and to do setup
work in tests. This improves the skipped statistics on platforms where
the test isn't run.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

t/t3902-quoted: change from skip_all=* to prereq skipÆvar Arnfjörð Bjarmason Wed, 11 Aug 2010 19:04:09 +0000 (19:04 +0000)

t/t3902-quoted: change from skip_all=* to prereq skip

Change this test to skip test with test prerequisites, and to do setup
work in tests. This improves the skipped statistics on platforms where
the test isn't run.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

t/t4016-diff-quote: change from skip_all=* to prereq... Ævar Arnfjörð Bjarmason Wed, 11 Aug 2010 19:04:08 +0000 (19:04 +0000)

t/t4016-diff-quote: change from skip_all=* to prereq skip

Change this test to skip test with test prerequisites, and to do setup
work in tests. This improves the skipped statistics on platforms where
the test isn't run.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

t/t5503-tagfollow: change from skip_all=* to prereq... Ævar Arnfjörð Bjarmason Wed, 11 Aug 2010 19:04:07 +0000 (19:04 +0000)

t/t5503-tagfollow: change from skip_all=* to prereq skip

Change this test to skip test with test prerequisites, and to do setup
work in tests. This improves the skipped statistics on platforms where
the test isn't run.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

t/t7005-editor: change from skip_all=* to prereq skipÆvar Arnfjörð Bjarmason Wed, 11 Aug 2010 19:04:06 +0000 (19:04 +0000)

t/t7005-editor: change from skip_all=* to prereq skip

Change this test to skip test with test prerequisites, and to do setup
work in tests. This improves the skipped statistics on platforms where
the test isn't run.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

t/t5705-clone-2gb: change from skip_all=* to prereq... Ævar Arnfjörð Bjarmason Wed, 11 Aug 2010 19:04:05 +0000 (19:04 +0000)

t/t5705-clone-2gb: change from skip_all=* to prereq skip

Change this test to skip test with test prerequisites, and to do setup
work in tests. This improves the skipped statistics on platforms where
the test isn't run.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

t/t1304-default-acl: change from skip_all=* to prereq... Ævar Arnfjörð Bjarmason Wed, 11 Aug 2010 19:04:04 +0000 (19:04 +0000)

t/t1304-default-acl: change from skip_all=* to prereq skip

Change this test to skip test with test prerequisites, and to do setup
work in tests. This improves the skipped statistics on platforms where
the test isn't run.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

t/README: Update "Skipping tests" to align with best... Ævar Arnfjörð Bjarmason Wed, 28 Jul 2010 10:34:59 +0000 (10:34 +0000)

t/README: Update "Skipping tests" to align with best practices

The example I initially added to "Skipping tests" wasn't very
good. We'd rather skip tests using the three-arg prereq form to the
test_* functions, not bail out with a skip message.

Change the documentation to reflect that, but retain the bailout
example under a disclaimer which explains that it's probably not a
good idea to use it.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

t/t7800-difftool.sh: Skip with prereq on no PERLÆvar Arnfjörð Bjarmason Wed, 28 Jul 2010 10:34:58 +0000 (10:34 +0000)

t/t7800-difftool.sh: Skip with prereq on no PERL

Change t/t7800-difftool.sh to to skip with the the three-arg prereq
form of test_expect_success instead of bailing out.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

t/t5800-remote-helpers.sh: Skip with prereq on python... Ævar Arnfjörð Bjarmason Wed, 28 Jul 2010 10:34:57 +0000 (10:34 +0000)

t/t5800-remote-helpers.sh: Skip with prereq on python <2.4

Change the t/t5800-remote-helpers.sh test to skip with the the
three-arg prereq form of test_expect_success instead of bailing out.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

t/t4004-diff-rename-symlink.sh: use three-arg <prereq>Ævar Arnfjörð Bjarmason Wed, 28 Jul 2010 10:34:56 +0000 (10:34 +0000)

t/t4004-diff-rename-symlink.sh: use three-arg <prereq>

Change the tests that skipped due to unavailable SYMLINKS support to
use the three-arg prereq form of test_expect_success.

This is like the "tests: implicitly skip SYMLINKS tests using
<prereq>" change, but I needed to create an additional test for some
setup code. It's in a separate change as suggested by Jonathan Nieder
for ease of reviewing.

Date: Tue, 27 Jul 2010 16:17:37 -0500
From: Jonathan Nieder <jrnieder@gmail.com>
Message-ID: <20100727211737.GA11768@burratino>
In-Reply-To: <1280265254-19642-2-git-send-email-avarab@gmail.com>
Subject: Re: [PATCH 1/4] tests: implicitly skip SYMLINKS tests using <prereq>

Ævar Arnfjörð Bjarmason wrote:

> +++ b/t/t4004-diff-rename-symlink.sh
> @@ -40,8 +34,9 @@ test_expect_success \
> # rezrov and nitfol are rename/copy of frotz and bozbar should be
> # a new creation.
>
> -GIT_DIFF_OPTS=--unified=0 git diff-index -M -p $tree >current
> -cat >expected <<\EOF
> +test_expect_success SYMLINKS 'setup diff output' "
> + GIT_DIFF_OPTS=--unified=0 git diff-index -M -p $tree >current
> + cat >expected <<\EOF
> diff --git a/bozbar b/bozbar
> new file mode 120000
> --- /dev/null

Probably belongs in a separate patch. More importantly, it is missing
&&-chaining (not a regression, but it is best to set a good example).

Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

tests: implicitly skip SYMLINKS tests using <prereq>Ævar Arnfjörð Bjarmason Wed, 28 Jul 2010 10:34:55 +0000 (10:34 +0000)

tests: implicitly skip SYMLINKS tests using <prereq>

Change the tests that skipped due to unavailable SYMLINKS support to
use the three-arg prereq form of test_expect_success.

Now we get an indication of how many tests that need symlinks are
being skipped on platforms that don't support them.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Makefile: make gcov invocation configurableThomas Rast Mon, 26 Jul 2010 07:43:41 +0000 (09:43 +0200)

Makefile: make gcov invocation configurable

If you customize CC to use a different version of gcc, most likely you
also need to use a different version of gcov. Make it configurable.

Signed-off-by: Thomas Rast <trast@student.ethz.ch>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

t/README: Add a note about the dangers of coverage... Ævar Arnfjörð Bjarmason Sun, 25 Jul 2010 19:52:45 +0000 (19:52 +0000)

t/README: Add a note about the dangers of coverage chasing

Having no coverage at all is almost always a bad sign, but trying to
attain 100% coverage everywhere is usually a waste of time. Add a
paragraph to explain this to future test writers.

Inspired-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

t/README: A new section about test coverageÆvar Arnfjörð Bjarmason Sun, 25 Jul 2010 19:52:44 +0000 (19:52 +0000)

t/README: A new section about test coverage

Document how test writers can generate coverage reports, to ensure
that their tests are really testing the code they think they're
testing.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Makefile: Add cover_db_html targetÆvar Arnfjörð Bjarmason Sun, 25 Jul 2010 19:52:43 +0000 (19:52 +0000)

Makefile: Add cover_db_html target

Add a target to generate a detailed HTML report for the entire Git
codebase using Devel::Cover's cover(1) tool. Output it in
cover_db_html instead of the default cover_db, so that it isn't mixed
up with our raw report files.

The target depends on the coverage-report-cover-db target, it may be
run redundantly if it was previously run. But the HTML output won't be
affected by running gcov2perl twice, so I didn't try to avoid that
small redundancy.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Makefile: Add cover_db targetÆvar Arnfjörð Bjarmason Sun, 25 Jul 2010 19:52:42 +0000 (19:52 +0000)

Makefile: Add cover_db target

Add a target to convert the *.gcov files to a Devel::Cover
database. That database can subsequently be formatted by the cover(1)
tool which is included with Devel::Cover.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Makefile: Split out the untested functions targetÆvar Arnfjörð Bjarmason Sun, 25 Jul 2010 19:52:41 +0000 (19:52 +0000)

Makefile: Split out the untested functions target

Change the coverage-report target so that it doesn't generate the
coverage-untested-functions file by default. I'm adding more targets
for doing various things with the gcov files, and they shouldn't all
run by default.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Makefile: Include subdirectories in "make cover" reportsÆvar Arnfjörð Bjarmason Sun, 25 Jul 2010 19:52:40 +0000 (19:52 +0000)

Makefile: Include subdirectories in "make cover" reports

We generate profiling files in all the $(OBJECTS) dirs. Aggregate
results from there, and add them to the corresponding clean target.

Also expand the gcov arguments. Generate reports for things like "x()
|| y()" using --all-blocks, and add --preserve-paths since we're
profiling in subdirectories now.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

gitignore: Ignore files generated by "make coverage"Ævar Arnfjörð Bjarmason Sun, 25 Jul 2010 19:52:39 +0000 (19:52 +0000)

gitignore: Ignore files generated by "make coverage"

The "make coverage" support added by Thomas Rast in 901c369af5 didn't
contain a corresponding patch to patch .gitignore.

Change gitignore to ignore the *.gcda, *.gcno and *.gcov files
generated by GCC and our coverage invocations.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

t/README: Add SMOKE_{COMMENT,TAGS}= to smoke_report... Ævar Arnfjörð Bjarmason Sun, 8 Aug 2010 14:49:27 +0000 (14:49 +0000)

t/README: Add SMOKE_{COMMENT,TAGS}= to smoke_report target

The smoke server supports a free form text field with comments about a
report, and a comma delimited list of tags. Change the smoke_report
target to expose this functionality. Now smokers can send more data
that explains and categorizes the reports they're submitting.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

t/Makefile: Can't include GIT-BUILD-OPTIONS, it's a .shÆvar Arnfjörð Bjarmason Sun, 8 Aug 2010 14:49:26 +0000 (14:49 +0000)

t/Makefile: Can't include GIT-BUILD-OPTIONS, it's a .sh

Change the smoke testing portion of t/Makefile not to include
GIT-BUILD-OPTIONS. It's a shellscript, not a Makefile snippet, so it
had the nasty side-effect of sneaking e.g. SHELL_PATH = '/bin/sh'
(with quotes) everywhere.

Just add our own PERL_PATH variable as a workaround. The t/Makefile
already has e.g. an equivalent SHELL_PATH and TAR option which
duplicate the definitions in GIT-BUILD-OPTIONS.

Reported-by: Thomas Rast <trast@student.ethz.ch>
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

t/README: Document the Smoke testingÆvar Arnfjörð Bjarmason Sun, 8 Aug 2010 14:49:25 +0000 (14:49 +0000)

t/README: Document the Smoke testing

Git now has a smoke testing service at http://smoke.git.nix.is that
anyone can send reports to. Change the t/README file to mention this.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

tests: Infrastructure for Git smoke testingÆvar Arnfjörð Bjarmason Sun, 8 Aug 2010 14:49:24 +0000 (14:49 +0000)

tests: Infrastructure for Git smoke testing

Add the capability to send smoke reports from the Git test suite.

Currently we only notice bugs in the test suite when it's run
manually. Bugs in Git that only occur on obscure platforms or setups
that the core developers aren't using can thus go unnoticed.

This series aims to change that. With it, anyone that's interested in
avoiding bitrot in Git can volunteer to run a smoke tester. A smoke
tester periodically compiles the latest version of Git, runs the test
suite, and submits a report to a central server indicating how the
test run went.

A smoke tester might run something like this in cron:

#!/bin/sh
cd ~/g/git
git fetch
for branch in maint master next pu; do
git checkout origin/$i &&
make clean all &&
cd t &&
make smoke_report
done

The smoker might want to compile git with non-default flags, include
bisecting functionality or run the tests under valgrind. Doing that is
outside the scope of this patch, this just adds a report submission
mechanism. But including a canonical smoke runner is something we'll
want to include eventually.

What this does now is add smoke and smoke_report targets to t/Makefile
(this example only uses a few tests for demonstration):

$ make clean smoke
rm -f -r 'trash directory'.* test-results
rm -f t????/cvsroot/CVSROOT/?*
rm -f -r valgrind/bin
rm -f .prove
perl ./harness --git-version="1.7.2.1.173.gc9b40" \
--no-verbose \
--archive="test-results/git-smoke.tar.gz" \
t0000-basic.sh t0001-init.sh t0002-gitfile.sh t0003-attributes.sh t0004-unwritable.sh t0005-signals.sh t0006-date.sh
t0000-basic.sh ....... ok
t0001-init.sh ........ ok
t0002-gitfile.sh ..... ok
t0003-attributes.sh .. ok
t0004-unwritable.sh .. ok
t0005-signals.sh ..... ok
t0006-date.sh ........ ok
All tests successful.

Test Summary Report
-------------------
t0000-basic.sh (Wstat: 0 Tests: 46 Failed: 0)
TODO passed: 5
Files=7, Tests=134, 3 wallclock secs ( 0.06 usr 0.05 sys + 0.23 cusr 1.33 csys = 1.67 CPU)
Result: PASS

TAP Archive created at /home/avar/g/git/t/test-results/git-smoke.tar.gz

The smoke target uses TAP::Harness::Archive to aggregate the test
results into a tarball. The tarball contains two things, the output of
every test file that was run, and a metadata file:

Tarball contents:

$ tar xzvf git-smoke.tar.gz
t0004-unwritable.sh
t0001-init.sh
t0002-gitfile.sh
t0005-signals.sh
t0000-basic.sh
t0003-attributes.sh
t0006-date.sh
meta.yml

A test report:

$ cat t0005-signals.sh
ok 1 - sigchain works
# passed all 1 test(s)
1..1

A metadata file:

---
extra_properties:
file_attributes:
-
description: t0000-basic.sh
end_time: 1280437324.61398
start_time: 1280437324.22186
-
description: t0001-init.sh
end_time: 1280437325.12346
start_time: 1280437324.62393
-
description: t0002-gitfile.sh
end_time: 1280437325.29428
start_time: 1280437325.13646
-
description: t0003-attributes.sh
end_time: 1280437325.59678
start_time: 1280437325.30565
-
description: t0004-unwritable.sh
end_time: 1280437325.77376
start_time: 1280437325.61003
-
description: t0005-signals.sh
end_time: 1280437325.85426
start_time: 1280437325.78727
-
description: t0006-date.sh
end_time: 1280437326.2362
start_time: 1280437325.86768
file_order:
- t0000-basic.sh
- t0001-init.sh
- t0002-gitfile.sh
- t0003-attributes.sh
- t0004-unwritable.sh
- t0005-signals.sh
- t0006-date.sh
start_time: 1280437324
stop_time: 1280437326

The "extra_properties" hash is where we'll stick Git-specific info,
like whether Git was compiled with gettext or the fallback regex
engine, and what branch we're compiling. Currently no metadata like
this is included.

The entire tarball is then submitted to a central smokebox at
smoke.git.nix.is. This is done with curl(1) via the "smoke_report"
target:

$ make smoke_report
curl \
-H "Expect: " \
-F project=Git \
-F architecture=x86_64 \
-F platform=Linux \
-F revision="1.7.2.1.173.gc9b40" \
-F report_file=@test-results/git-smoke.tar.gz \
http://smoke.git.nix.is/app/projects/process_add_report/1 \
| grep -v ^Redirecting
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 117k 100 63 100 117k 3 6430 0:00:21 0:00:18 0:00:03 0
Reported #8 added.

Reports are then made available on the smokebox via a web interface:

http://smoke.git.nix.is/app/projects/smoke_reports/1

The smoke reports are also mirrored to a Git repository hosted on
GitHub:

http://github.com/gitsmoke/smoke-reports

The Smolder SQLite database that contains metadata about the reports
is also made available:

http://github.com/gitsmoke/smoke-database

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

test-lib: Multi-prereq support only checked the last... Ævar Arnfjörð Bjarmason Wed, 11 Aug 2010 12:04:38 +0000 (12:04 +0000)

test-lib: Multi-prereq support only checked the last prereq

The support for multiple test prerequisites added by me in "test-lib:
Add support for multiple test prerequisites" was broken.

The for iterated over each prerequisite and returned true/false within
a case statement, but since it missed a return statement only the last
prerequisite in the list of prerequisites was ever considered, the
rest were ignored.

Fix that by changing the test_have_prereq code to something less
clever that keeps a count of the total prereqs and the ones we have
and compares the count at the end.

This comes with the added advantage that it's easy to list the missing
prerequisites in the test output, implement that while I'm at it.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

tests: A SANITY test prereq for testing if we're rootÆvar Arnfjörð Bjarmason Fri, 6 Aug 2010 22:09:09 +0000 (22:09 +0000)

tests: A SANITY test prereq for testing if we're root

Some tests depend on not being able to write to files after chmod
-w. This doesn't work when running the tests as root.

Change test-lib.sh to test if this works, and if so it sets a new
SANITY test prerequisite. The tests that use this previously failed
when run under root.

There was already a test for this in t3600-rm.sh, added by Junio C
Hamano in 2283645 in 2006. That check now uses the new SANITY
prerequisite.

Some of this was resurrected from the "Tests in Cygwin" thread in May
2009:

http://thread.gmane.org/gmane.comp.version-control.git/116729/focus=118385

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

t/README: Document the predefined test prerequisitesÆvar Arnfjörð Bjarmason Fri, 6 Aug 2010 21:19:25 +0000 (21:19 +0000)

t/README: Document the predefined test prerequisites

The README for the test library suggested that you grep the
test-lib.sh for test_set_prereq to see what the preset prerequisites
were.

Remove that bit, and write a section explaining all the preset
prerequisites. Most of the text was lifted from from Junio C Hamano
and Johannes Sixt, See the "Tests in Cygwin" thread in May 2009 for
the originals:

http://thread.gmane.org/gmane.comp.version-control.git/116729/focus=118385
http://thread.gmane.org/gmane.comp.version-control.git/116729/focus=118434

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

test-lib: Print missing prerequisites in test outputÆvar Arnfjörð Bjarmason Fri, 6 Aug 2010 21:19:24 +0000 (21:19 +0000)

test-lib: Print missing prerequisites in test output

Change the test output to print needed prerequisites as part of the
TAP. This makes it easy to see at a glance why a test was
skipped. Before:

ok 7 # skip <message>
ok 9 # skip <message>

After:

ok 7 # skip <message> (prereqs: DONTHAVEIT)
ok 9 # skip <message> (prereqs: HAVEIT,DONTHAVEIT)

This'll also be useful for smoke testing output, where the developer
reading the output may not be familiar with the system where tests are
being skipped.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

test-lib: Add support for multiple test prerequisitesÆvar Arnfjörð Bjarmason Fri, 6 Aug 2010 21:19:23 +0000 (21:19 +0000)

test-lib: Add support for multiple test prerequisites

Change the test_have_prereq function in test-lib.sh to support a
comma-separated list of prerequisites. This is useful for tests that
need e.g. both POSIXPERM and SANITY.

The implementation was stolen from Junio C Hamano and Johannes Sixt,
the tests and documentation were not. See the "Tests in Cygwin" thread
in May 2009 for the originals:

http://thread.gmane.org/gmane.comp.version-control.git/116729/focus=118385
http://thread.gmane.org/gmane.comp.version-control.git/116729/focus=118434

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

test-lib: Don't write test-results when HARNESS_ACTIVEÆvar Arnfjörð Bjarmason Wed, 11 Aug 2010 19:37:31 +0000 (19:37 +0000)

test-lib: Don't write test-results when HARNESS_ACTIVE

TAP harnesses don't need to read test-results/*, since they keep track
of the number of passing/failing tests internally. Skip the generation
of these files when HARNESS_ACTIVE is set.

It's now possible to run the Git test suite without writing anything
to the t/ directory at all if you use a TAP harness and the --root
switch:

cd t
sudo mount -t tmpfs none /tmp/memory -o size=300m
prove -j9 ./t[0-9]*.sh :: --root=/tmp/memory

The I/O that the ~500 test-results/* files contributed was very
minimal, but I thought this was worth mentioning.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Merge branch 'jn/maint-plug-leak'Junio C Hamano Wed, 18 Aug 2010 19:37:09 +0000 (12:37 -0700)

Merge branch 'jn/maint-plug-leak'

* jn/maint-plug-leak:
write-tree: Avoid leak when index refers to an invalid object
read-tree: stop leaking tree objects
core: Stop leaking ondisk_cache_entrys

Merge branch 'jl/submodule-ignore-diff'Junio C Hamano Wed, 18 Aug 2010 19:36:25 +0000 (12:36 -0700)

Merge branch 'jl/submodule-ignore-diff'

* jl/submodule-ignore-diff:
Add tests for the diff.ignoreSubmodules config option
Add the 'diff.ignoreSubmodules' config setting
Submodules: Use "ignore" settings from .gitmodules too for diff and status
Submodules: Add the new "ignore" config option for diff and status

Conflicts:
diff.c

Merge branch 'ml/rebase-x-strategy'Junio C Hamano Wed, 18 Aug 2010 19:29:47 +0000 (12:29 -0700)

Merge branch 'ml/rebase-x-strategy'

* ml/rebase-x-strategy:
rebase: support -X to pass through strategy options

Merge branch 'jn/fix-abbrev'Junio C Hamano Wed, 18 Aug 2010 19:28:58 +0000 (12:28 -0700)

Merge branch 'jn/fix-abbrev'

* jn/fix-abbrev:
examples/commit: use --abbrev for commit summary
checkout, commit: remove confusing assignments to rev.abbrev
archive: abbreviate substituted commit ids again

Merge branch 'vs/doc-spell'Junio C Hamano Wed, 18 Aug 2010 19:28:24 +0000 (12:28 -0700)

Merge branch 'vs/doc-spell'

* vs/doc-spell:
Documentation: spelling fixes

Merge branch 'jh/use-test-must-fail'Junio C Hamano Wed, 18 Aug 2010 19:17:17 +0000 (12:17 -0700)

Merge branch 'jh/use-test-must-fail'

* jh/use-test-must-fail:
Convert "! git" to "test_must_fail git"

Merge branch 'jh/clean-exclude'Junio C Hamano Wed, 18 Aug 2010 19:17:02 +0000 (12:17 -0700)

Merge branch 'jh/clean-exclude'

* jh/clean-exclude:
Add test for git clean -e.
Add -e/--exclude to git-clean.

Merge branch 'kf/post-receive-sample-hook'Junio C Hamano Wed, 18 Aug 2010 19:16:50 +0000 (12:16 -0700)

Merge branch 'kf/post-receive-sample-hook'

* kf/post-receive-sample-hook:
post-receive-email: optional message line count limit

Merge branch 'ab/report-corrupt-object-with-type'Junio C Hamano Wed, 18 Aug 2010 19:16:41 +0000 (12:16 -0700)

Merge branch 'ab/report-corrupt-object-with-type'

* ab/report-corrupt-object-with-type:
sha1_file: Show the the type and path to corrupt objects

Merge branch 'jn/rebase-rename-am'Junio C Hamano Wed, 18 Aug 2010 19:16:31 +0000 (12:16 -0700)

Merge branch 'jn/rebase-rename-am'

* jn/rebase-rename-am:
rebase: protect against diff.renames configuration
t3400 (rebase): whitespace cleanup
Teach "apply --index-info" to handle rename patches
t4150 (am): futureproof against failing tests
t4150 (am): style fix

Merge branch 'jn/fast-import-subtree'Junio C Hamano Wed, 18 Aug 2010 19:14:41 +0000 (12:14 -0700)

Merge branch 'jn/fast-import-subtree'

* jn/fast-import-subtree:
Teach fast-import to import subtrees named by tree id

Merge branch 'ar/string-list-foreach'Junio C Hamano Wed, 18 Aug 2010 19:14:38 +0000 (12:14 -0700)

Merge branch 'ar/string-list-foreach'

* ar/string-list-foreach:
Convert the users of for_each_string_list to for_each_string_list_item macro
Add a for_each_string_list_item macro

Merge branch 'jh/graph-next-line'Junio C Hamano Wed, 18 Aug 2010 19:14:32 +0000 (12:14 -0700)

Merge branch 'jh/graph-next-line'

* jh/graph-next-line:
Enable custom schemes for column colors in the graph API
Make graph_next_line() available in the graph.h API

Merge branch 'tr/xsize-bits'Junio C Hamano Wed, 18 Aug 2010 19:14:23 +0000 (12:14 -0700)

Merge branch 'tr/xsize-bits'

* tr/xsize-bits:
xsize_t: check whether we lose bits

merge-recursive: Fix multiple file rename across D... Elijah Newren Tue, 17 Aug 2010 23:53:19 +0000 (17:53 -0600)

merge-recursive: Fix multiple file rename across D/F conflict

In 5a2580d (merge_recursive: Fix renames across paths below D/F conflicts
2010-07-09), detection was added for renames across paths involved in a
directory<->file conflict. However, the change accidentally involved
reusing an outer loop index ('i') in an inner loop, changing its values
and causing a slightly different type of breakage for cases where there are
multiple renames across the D/F conflict. Fix by creating a new temporary
variable 'i'.

Signed-off-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

t6031: Add a testcase covering multiple renames across... Elijah Newren Tue, 17 Aug 2010 23:53:18 +0000 (17:53 -0600)

t6031: Add a testcase covering multiple renames across a D/F conflict

Signed-off-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

merge-recursive: Fix typoElijah Newren Tue, 17 Aug 2010 23:52:27 +0000 (17:52 -0600)

merge-recursive: Fix typo

Signed-off-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Merge branch 'tc/checkout-B'Junio C Hamano Wed, 18 Aug 2010 18:42:47 +0000 (11:42 -0700)

Merge branch 'tc/checkout-B'

* tc/checkout-B:
builtin/checkout: handle -B from detached HEAD correctly
builtin/checkout: learn -B
builtin/checkout: reword hint for -b
add tests for checkout -b

mergetool: Skip autoresolved pathsDavid Aguilar Tue, 17 Aug 2010 09:22:46 +0000 (02:22 -0700)

mergetool: Skip autoresolved paths

When mergetool is run without path limiters it loops
over each entry in 'git ls-files -u'. This includes
autoresolved paths.

Teach mergetool to only merge files listed in 'rerere status'
when rerere is enabled.

There are some subtle but harmless changes in behavior.
We now call cd_to_toplevel when no paths are given.
We do this because 'rerere status' paths are always relative
to the root. This is beneficial for the non-rerere use as
well in that mergetool now runs against all unmerged files
regardless of the current directory.

This also slightly tweaks the output when run without paths
to be more readable.

The old output:

Merging the files: foo
bar
baz

The new output:

Merging:
foo
bar
baz

Signed-off-by: David Aguilar <davvid@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

hash binary sha1 into patch idClemens Buchacher Sun, 15 Aug 2010 07:20:43 +0000 (09:20 +0200)

hash binary sha1 into patch id

Since commit 2f82f760 (Take binary diffs into
account for "git rebase"), binary files are
included in patch ID computation. Binary files are
diffed using the text diff algorithm, however,
which has a huge impact on performance. The
following tests performance for a 50000 line file
marked as binary in .gitattributes.

$ git format-patch --stdout --ignore-if-in-upstream master

real 0m0.367s
user 0m0.354s
sys 0m0.010s

Instead of diffing the binary files, hash the pre-
and post-image sha1, which is just as unique. As a
result, performance is much improved.

$ git format-patch --stdout --ignore-if-in-upstream master

real 0m0.016s
user 0m0.015s
sys 0m0.001s

Signed-off-by: Clemens Buchacher <drizzd@aon.at>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Userdiff patterns for C#Petr Onderka Mon, 16 Aug 2010 17:01:02 +0000 (17:01 +0000)

Userdiff patterns for C#

Add userdiff patterns for C#. This code is an improved version of
code by Adam Petaccia from 21 June 2009 mail to the list.

Signed-off-by: Petr Onderka <gsvick@gmail.com>
Acked-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

t7006 (pager): add missing TTY prerequisitesJonathan Nieder Mon, 16 Aug 2010 08:08:34 +0000 (03:08 -0500)

t7006 (pager): add missing TTY prerequisites

The "git bundle unbundle" and "git config" pagination tests are not
supposed to run when stdout is not a terminal and IO::Pty not available
to make one on the fly.

Reported-by: Thomas Rast <trast@student.ethz.ch>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

merge: let custom strategies intervene in trivial mergesJonathan Nieder Mon, 16 Aug 2010 01:11:06 +0000 (20:11 -0500)

merge: let custom strategies intervene in trivial merges

As v1.6.1-rc1~294^2 (2008-08-23) explains, custom merge strategies
do not even kick in when the merge is truly trivial. But they
should, since otherwise a custom “--strategy=theirs” is not useful.

Perhaps custom strategies should not allow fast-forward either. This
patch does not make that change, since it is less important (because
it is always possible to explicitly use --no-ff).

Reported-by: Yaroslav Halchenko <debian@onerussian.com>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

t7606 (merge-theirs): modernize styleJonathan Nieder Mon, 16 Aug 2010 01:08:46 +0000 (20:08 -0500)

t7606 (merge-theirs): modernize style

Guard setup commands with test_expect_success, so they are easier
to visually skip over and get to the good part. While at it:

- use test_commit for brevity and reproducible object names;

- use test_cmp instead of using the test builtin to compare the
result of command substitution, for better output with -v on
failure.

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

merge-file: run setup_git_directory_gently() soonerNguyễn Thái Ngọc Duy Fri, 6 Aug 2010 03:27:43 +0000 (22:27 -0500)

merge-file: run setup_git_directory_gently() sooner

Part of a campaign to make repository-local configuration
available early (simplifying the startup sequence for
built-in commands).

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

var: run setup_git_directory_gently() soonerNguyễn Thái Ngọc Duy Fri, 6 Aug 2010 03:21:40 +0000 (22:21 -0500)

var: run setup_git_directory_gently() sooner

Part of a campaign to make repository-local configuration
available early (simplifying the startup sequence for
built-in commands).

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

ls-remote: run setup_git_directory_gently() soonerNguyễn Thái Ngọc Duy Fri, 6 Aug 2010 03:20:08 +0000 (22:20 -0500)

ls-remote: run setup_git_directory_gently() sooner

ls-remote already runs a repository search unconditionally to learn
about remote nicknames and "[url] insteadof" shortcuts. Run that
search a little sooner, and now one can try

[pager]
ls-remote

to automatically paginate ls-remote output, or use repository-local

[core]
pager = whatever

with "git --paginate ls-remote <url>".

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

index-pack: run setup_git_directory_gently() soonerNguyễn Thái Ngọc Duy Fri, 6 Aug 2010 03:18:53 +0000 (22:18 -0500)

index-pack: run setup_git_directory_gently() sooner

index-pack already runs a repository search unconditionally; running
such a search earlier is not risky and ensures GIT_DIR will be set
correctly if the configuration needs to be accessed from
run_builtin().

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Merge branch 'jn/maint-setup-fix' (early part) into... Junio C Hamano Mon, 16 Aug 2010 02:58:40 +0000 (19:58 -0700)

Merge branch 'jn/maint-setup-fix' (early part) into jn/paginate-fix

* 'jn/maint-setup-fix' (early part):
Revert "rehabilitate 'git index-pack' inside the object store"
setup: do not forget working dir from subdir of gitdir
t4111 (apply): refresh index before applying patches to it
setup: split off get_device_or_die helper
setup: split off a function to handle hitting ceiling in repo search
setup: split off code to handle stumbling upon a repository
setup: split off a function to checks working dir for .git file
setup: split off $GIT_DIR-set case from setup_git_directory_gently
tests: try git apply from subdir of toplevel
t1501 (rev-parse): clarify

config: run setup_git_directory_gently() soonerNguyễn Thái Ngọc Duy Fri, 6 Aug 2010 03:15:09 +0000 (22:15 -0500)

config: run setup_git_directory_gently() sooner

For the pager choice (and the choice to paginate) to reflect the
current repository configuration, the repository needs to be
located first.

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

bundle: run setup_git_directory_gently() soonerNguyễn Thái Ngọc Duy Fri, 6 Aug 2010 03:12:46 +0000 (22:12 -0500)

bundle: run setup_git_directory_gently() sooner

Without this change, “git -p bundle” does not always
respect the repository-local “[core] pager” setting.

It is hard to notice because subcommands other than
“git bundle unbundle” do not produce much output.

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

apply: run setup_git_directory_gently() soonerNguyễn Thái Ngọc Duy Mon, 16 Aug 2010 00:36:12 +0000 (10:36 +1000)

apply: run setup_git_directory_gently() sooner

As v1.7.2~16^2 (2010-07-14) explains, without this change,
“git --paginate apply” can ignore the repository-local
“[core] pager” configuration.

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

log: test for regression introduced in v1.7.2-rc0~103^2~2Ævar Arnfjörð Bjarmason Sun, 15 Aug 2010 10:16:25 +0000 (10:16 +0000)

log: test for regression introduced in v1.7.2-rc0~103^2~2

Add a regression test for the git log -M --follow $diff_option bug
introduced in v1.7.2-rc0~103^2~2, $diff_option being diff related
options like -p, --stat, --name-only etc.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

cherry-pick/revert: Use advise() for hintsJonathan Nieder Wed, 11 Aug 2010 08:37:51 +0000 (03:37 -0500)

cherry-pick/revert: Use advise() for hints

When cherry-pick fails after picking a large series of commits, it can
be hard to pick out the error message and advice. Prefix the advice
with “hint: ” to help.

Before:

error: could not apply 7ab78c9... foo
After resolving the conflicts,
mark the corrected paths with 'git add <paths>' or 'git rm <paths>'
and commit the result with:

git commit -c 7ab78c9a7898b87127365478431289cb98f8d98f

After:

error: could not apply 7ab78c9... foo
hint: after resolving the conflicts, mark the corrected paths
hint: with 'git add <paths>' or 'git rm <paths>'
hint: and commit the result with 'git commit -c 7ab78c9'

Noticed-by: Thomas Rast <trast@student.ethz.ch>
Encouraged-by: Sverre Rabbelier <srabbelier@gmail.com>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

cherry-pick/revert: Use error() for failure messageJonathan Nieder Wed, 11 Aug 2010 08:37:24 +0000 (03:37 -0500)

cherry-pick/revert: Use error() for failure message

When cherry-pick fails after picking a large series of commits, it can
be hard to pick out the error message and advice. Clarify the error
and prefix it with “error: ” to help.

Before:

Automatic cherry-pick failed. [...advice...]

After:

error: could not apply 7ab78c9... Do something neat.
[...advice...]

Noticed-by: Thomas Rast <trast@student.ethz.ch>
Encouraged-by: Sverre Rabbelier <srabbelier@gmail.com>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Introduce advise() to print hintsJonathan Nieder Wed, 11 Aug 2010 08:36:41 +0000 (03:36 -0500)

Introduce advise() to print hints

Like error(), warn(), and die(), advise() prints a short message
with a formulaic prefix to stderr.

It is local to revert.c for now because I am not sure this is
the right API (we may want to take an array of advice lines or a
boolean argument for easy suppression of unwanted advice).

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Eliminate “Finished cherry-pick/revert” messageJonathan Nieder Wed, 11 Aug 2010 08:36:07 +0000 (03:36 -0500)

Eliminate “Finished cherry-pick/revert” message

When cherry-pick was written (v0.99.6~63, 2005-08-27), “git commit”
was quiet, and the output from cherry-pick provided useful information
about the progress of a rebase.

Now next to the output from “git commit”, the cherry-pick notification
is so much noise (except for the name of the picked commit).

$ git cherry-pick ..topic
Finished cherry-pick of 499088b.
[detached HEAD 17e1ff2] Move glob module to libdpkg
Author: Guillem Jover <guillem@debian.org>
8 files changed, 12 insertions(+), 9 deletions(-)
rename {src => lib/dpkg}/glob.c (98%)
rename {src => lib/dpkg}/glob.h (93%)
Finished cherry-pick of ae947e1.
[detached HEAD 058caa3] libdpkg: Add missing symbols to Versions script
Author: Guillem Jover <guillem@debian.org>
1 files changed, 2 insertions(+), 0 deletions(-)
$

The noise is especially troublesome when sifting through the output of
a rebase or multiple cherry-pick that eventually failed.

With the commit subject, it is already not hard to figure out where
the commit came from. So drop the “Finished” message.

Cc: Christian Couder <chriscool@tuxfamily.org>
Cc: Thomas Rast <trast@student.ethz.ch>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

git-svn: fix fetch with deleted tagDavid D. Kilzer Sun, 15 Aug 2010 13:15:55 +0000 (06:15 -0700)

git-svn: fix fetch with deleted tag

Currently git-svn assumes that two tags created from the same
revision will have the same repo url, so it uses a ref to the
tag without checking that its url matches the current url.

This causes issues when fetching an svn repo where a tag was
created, deleted, and then recreated under the following
circumstances:

- Both tags were copied from the same revision.
- Both tags had the same name.
- Both tags had different repository paths.
- [Optional] Both tags have a file with the same name but
different content.

When all four conditions are met, a checksum mismatch error
occurs because the content of two files with the same path
differs (see t/t9155--git-svn-fetch-deleted-tag.sh):

Checksum mismatch: ChangeLog 065854....
expected: ce771b....
got: 9563fd....

When only the first three conditions are met, no error occurs
but the tag in git matches the first (deleted) tag instead of
the last (most recent) tag (see
t/t9156-git-svn-fetch-deleted-tag-2.sh).

The fix is to verify that the repo url for the ref matches the
current url. If the urls do not match, then a "tail" is grown
on the tag name by appending a dash and rechecking the new ref's
repo url until either a matching repo url is found or a new tag
is created.

Signed-off-by: David D. Kilzer <ddkilzer@kilzer.net>
Acked-by: Eric Wong <normalperson@yhbt.net>