gitweb.git
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>

git-svn: fix regex to remove "tail" from svn tagsDavid D. Kilzer Sun, 15 Aug 2010 13:15:54 +0000 (06:15 -0700)

git-svn: fix regex to remove "tail" from svn tags

Fix a regular expression used to remove the revision from the
end of an svn tag or branch name. The regex did not account for
any "tail" (dashes) that may have been added to the end of the
tag name (which first appeared in v1.4.1-rc2~11). If not fixed,
tags with names like "tags/mytag@5--@2" may be created.

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

t9010 (svn-fe): avoid symlinks in testJonathan Nieder Sat, 14 Aug 2010 00:06:15 +0000 (19:06 -0500)

t9010 (svn-fe): avoid symlinks in test

The svn-fe test fails on Windows in the “svn export” step because of
the lack of symlink support. With a less ambitious dump, it passes.

Acked-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

t9010 (svn-fe): use Unix-style path in URIJonathan Nieder Sat, 14 Aug 2010 00:04:50 +0000 (19:04 -0500)

t9010 (svn-fe): use Unix-style path in URI

Ever since v1.6.3-rc0~101^2~14 (Tests on Windows: $(pwd) must return
Windows-style paths, 2009-03-13), there is a subtle difference between
$(pwd) and $PWD in tests: the former returns Windows-style paths as
might be output by git and the latter Unix-style paths which msys
programs tend to prefer.

In file:// URIs, Unix-style paths are needed. Before: “svn export”
declares it cannot find

file://c:/apps/git/git/t/trash directory/simple-svco

After: “svn export” successfully finds

file:///c/apps/git/git/...

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

vcs-svn: Avoid %z in format stringJonathan Nieder Sat, 14 Aug 2010 00:03:17 +0000 (19:03 -0500)

vcs-svn: Avoid %z in format string

In the spirit of v1.6.4-rc0~124 (MinGW: Fix compiler warning in
merge-recursive, 2009-05-23), use a 32-bit integer instead; the
dump file parser does not support any better, anyway.

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

vcs-svn: Rename dirent pool to build on WindowsJonathan Nieder Sat, 14 Aug 2010 00:01:34 +0000 (19:01 -0500)

vcs-svn: Rename dirent pool to build on Windows

dirent is #define’d to mingw_dirent in compat/mingw.h, with the
result that

obj_pool_gen(dirent, struct repo_dirent, 4096)

creates functions with names like mingw_dirent_alloc and
references to dirent_alloc go unresolved. Rename the functions
to dent_* to avoid this problem.

Reported-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

compat: add strtok_r()Jonathan Nieder Fri, 13 Aug 2010 23:59:40 +0000 (18:59 -0500)

compat: add strtok_r()

Windows does not have strtok_r (and while it does have an identical
strtok_s, but it is not obvious how to use it). Grab an
implementation from glibc.

The svn-fe tool uses strtok_r to parse paths.

Acked-by: Johannes Sixt <j6t@kdbg.org>
Helped-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

treap: style fixJonathan Nieder Thu, 12 Aug 2010 22:02:57 +0000 (17:02 -0500)

treap: style fix

Missing spaces in while (0) and trpn_pointer(a, b).

Remove parentheses around return value.

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

vcs-svn: remove build artifacts on "make clean"Jonathan Nieder Thu, 12 Aug 2010 21:30:47 +0000 (16:30 -0500)

vcs-svn: remove build artifacts on "make clean"

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

svn-fe manual: Clarify warning about deltas in dump... Jonathan Nieder Mon, 9 Aug 2010 22:58:36 +0000 (17:58 -0500)

svn-fe manual: Clarify warning about deltas in dump files

Those in the know would notice that dump file format version 2
means "svnadmin dump --no-deltas", but for the rest of us, an
explicit reminder is useful.

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

Update svn-fe manualJonathan Nieder Mon, 9 Aug 2010 22:55:43 +0000 (17:55 -0500)

Update svn-fe manual

The svn-fe example does not litter the working directory with
.bin files any more (hoorah!).

The permissive error handling implies a known bug. We should
be flagging iffy input and, even if we continue, reporting it
on exit.

Cc: David Barr <david.barr@cordelta.com>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

SVN dump parserDavid Barr Mon, 9 Aug 2010 22:55:00 +0000 (17:55 -0500)

SVN dump parser

svndump parses data that is in SVN dumpfile format produced by
`svnadmin dump` with the help of line_buffer and uses repo_tree and
fast_export to emit a git fast-import stream.

Based roughly on com.hydrografix.svndump 0.92 from the SvnToCCase
project at <http://svn2cc.sarovar.org/>, by Stefan Hegny and
others.

[rr: allow input from files other than stdin]
[jn: with test, more error reporting]

Signed-off-by: David Barr <david.barr@cordelta.com>
Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Infrastructure to write revisions in fast-export formatDavid Barr Mon, 9 Aug 2010 22:48:10 +0000 (17:48 -0500)

Infrastructure to write revisions in fast-export format

repo_tree maintains the exporter's state and provides a facility to to
call fast_export, which writes objects to stdout suitable for
consumption by fast-import.

The exported functions roughly correspond to Subversion FS operations.

. repo_add, repo_modify, repo_copy, repo_replace, and repo_delete
update the current commit, based roughly on the corresponding
Subversion FS operation.

. repo_commit calls out to fast_export to write the current commit to
the fast-import stream in stdout.

. repo_diff is used by the fast_export module to write the changes
for a commit.

. repo_reset erases the exporter's state, so valgrind can be happy.

[rr: squelched compiler warnings]
[jn: removed support for maintaining state on-disk, though we may
want to add it back later]

Signed-off-by: David Barr <david.barr@cordelta.com>
Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Add stream helper libraryDavid Barr Mon, 9 Aug 2010 22:39:43 +0000 (17:39 -0500)

Add stream helper library

This library provides thread-unsafe fgets()- and fread()-like
functions where the caller does not have to supply a buffer. It
maintains a couple of static buffers and provides an API to use
them.

[rr: allow input from files other than stdin]
[jn: with tests, documentation, and error handling improvements]

Signed-off-by: David Barr <david.barr@cordelta.com>
Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Add string-specific memory poolDavid Barr Mon, 9 Aug 2010 22:34:42 +0000 (17:34 -0500)

Add string-specific memory pool

Intern strings so they can be compared by address and stored without
wasting space.

This library uses the macros in the obj_pool.h and trp.h to create a
memory pool for strings and expose an API for handling them.

[rr: added API docs]
[jn: with some API simplifications, new documentation and tests]

Signed-off-by: David Barr <david.barr@cordelta.com>
Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Add treap implementationJason Evans Mon, 9 Aug 2010 22:17:34 +0000 (17:17 -0500)

Add treap implementation

Provide macros to generate a type-specific treap implementation and
various functions to operate on it. It uses obj_pool.h to store memory
nodes in a treap. Previously committed nodes are never removed from
the pool; after any *_commit operation, it is assumed (correctly, in
the case of svn-fast-export) that someone else must care about them.

Treaps provide a memory-efficient binary search tree structure.
Insertion/deletion/search are about as about as fast in the average
case as red-black trees and the chances of worst-case behavior are
vanishingly small, thanks to (pseudo-)randomness. The bad worst-case
behavior is a small price to pay, given that treaps are much simpler
to implement.

>From http://www.canonware.com/download/trp/trp_hash/trp.h

[db: Altered to reference nodes by offset from a common base pointer]
[db: Bob Jenkins' hashing implementation dropped for Knuth's]
[db: Methods unnecessary for search and insert dropped]
[rr: Squelched compiler warnings]
[db: Added support for immutable treap nodes]
[jn: Reintroduced treap_nsearch(); with tests]

Signed-off-by: David Barr <david.barr@cordelta.com>
Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Add memory pool libraryDavid Barr Mon, 9 Aug 2010 22:11:11 +0000 (17:11 -0500)

Add memory pool library

Add a memory pool library implemented using C macros. The
obj_pool_gen() macro creates a type-specific memory pool.

The memory pool library is distinguished from the existing specialized
allocators in alloc.c by using a contiguous block for all allocations.
This means that on one hand, long-lived pointers have to be written as
offsets, since the base address changes as the pool grows, but on the
other hand, the entire pool can be easily written to the file system.
This could allow the memory pool to persist between runs of an
application.

For the svn importer, such a facility is useful because each svn
revision can copy trees and files from any previous revision. The
relevant information for all revisions has to persist somehow to
support incremental runs.

[rr: minor cleanups]
[jn: added tests; removed file system backing for now]

Signed-off-by: David Barr <david.barr@cordelta.com>
Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Introduce vcs-svn libJonathan Nieder Mon, 9 Aug 2010 22:04:29 +0000 (17:04 -0500)

Introduce vcs-svn lib

Teach the build system to build a separate library for the
upcoming subversion interop support.

The resulting vcs-svn/lib.a does not contain any code, nor is
it built during a normal build. This is just scaffolding for
later changes.

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Ramkumar Ramachandra <artagnon@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>

fetch: allow command line --tags to override configDaniel Johnson Wed, 11 Aug 2010 22:57:20 +0000 (18:57 -0400)

fetch: allow command line --tags to override config

Originally, if remote.<name>.tagopt was set, the --tags and option would
have no effect when given to git fetch. So if
tagopt="--no-tags"

git fetch --tags

would not actually fetch tags.

This patch changes this behavior to only follow what is written in the
config if there is no option passed by the command line.

Signed-off-by: Daniel Johnson <ComputerDruid@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

git-rebase--interactive.sh: use printf instead of echo... Brandon Casey Fri, 13 Aug 2010 20:47:35 +0000 (15:47 -0500)

git-rebase--interactive.sh: use printf instead of echo to print commit message

Replace the echo statements that operate on $rest with printf's to restore
what was lost from 938791cd. This avoids any mangling that XSI-conformant
echo's may introduce.

Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

git-rebase--interactive.sh: rework skip_unnecessary_picksBrandon Casey Fri, 13 Aug 2010 20:47:34 +0000 (15:47 -0500)

git-rebase--interactive.sh: rework skip_unnecessary_picks

Commit cd035b1c introduced the exec command to interactive rebase. In
doing so, it modified the way that skip_unnecessary_picks iterates through
the list of rebase commands so that it avoided collapsing multiple spaces
into a single space. This is necessary for example if the argument to the
exec command contains a path with multiple spaces in it.

The way it did this was by reading each line of rebase commands into a
single variable, and then breaking the individual components out using
echo, sed, and cut. It used the individual broken-out components for
decision making, and was still able to write the original line to the
output file from the variable it had saved it in. But, since we only
really need to look at anything other than the first element of the line
when a 'pick' command is encountered, and even that is only necessary when
we are still searching for "unnecessary" picks, and since newer rebase
commands like 'exec' may not even require a sha1 field, let's make our read
statement parse its input into a "command" variable, and a "rest" variable,
and then only break out the sha1 from $rest, and call git-rev-parse, when
absolutely necessary.

I think this future proofs this subroutine, avoids calling git-rev-parse
unnecessarily, and possibly with bogus arguments, and still accomplishes
the goal of not mangling the $rest of the rebase command.

Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

diff --follow: do call diffcore_std() as necessaryJunio C Hamano Fri, 13 Aug 2010 19:17:45 +0000 (12:17 -0700)

diff --follow: do call diffcore_std() as necessary

Usually, diff frontends populate the output queue with filepairs without
any rename information and call diffcore_std() to sort the renames out.
When --follow is in effect, however, diff-tree family of frontend has a
hack that looks like this:

diff-tree frontend
-> diff_tree_sha1()
. populate diff_queued_diff
. if --follow is in effect and there is only one change that
creates the target path, then
-> try_to_follow_renames()
-> diff_tree_sha1() with no pathspec but with -C
-> diffcore_std() to find renames
. if rename is found, tweak diff_queued_diff and put a
single filepair that records the found rename there
-> diffcore_std()
. tweak elements on diff_queued_diff by
- rename detection
- path ordering
- pickaxe filtering

We need to skip parts of the second call to diffcore_std() that is related
to rename detection, and do so only when try_to_follow_renames() did find
a rename. Earlier 1da6175 (Make diffcore_std only can run once before a
diff_flush, 2010-05-06) tried to deal with this issue incorrectly; it
unconditionally disabled any second call to diffcore_std().

This hopefully fixes the breakage.

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

diff --follow: do not waste cycles while recursingJunio C Hamano Fri, 13 Aug 2010 17:36:01 +0000 (10:36 -0700)

diff --follow: do not waste cycles while recursing

The "--follow" logic is called from diff_tree_sha1() function, but the
input trees to diff_tree_sha1() are not necessarily the top-level trees
(compare_tree_entry() calls it while it recursively descends into
subtrees). When a newly created path lives in somewhere deep in the
source hierarchy, e.g. "platform/", but the rename source is in a totally
different place in the destination hierarchy, e.g. "lang-api/src/com/...",
running "try_to_find_renames()" while base is set to "platform/" is a
wasted call.

We only need to run the rename following at the very top level.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
Acked-by: Linus Torvalds <torvalds@linux-foundation.org>

perl/Makefile: Unset INSTALL_BASE when making perl.makÆvar Arnfjörð Bjarmason Tue, 3 Aug 2010 10:30:11 +0000 (10:30 +0000)

perl/Makefile: Unset INSTALL_BASE when making perl.mak

PREFIX and INSTALL_BASE are mutually exclusive. If both are supplied
by INSTALL_BASE being set in PERL_MM_OPT ExtUtils::MakeMaker will
produce an error:

$ echo $PERL_MM_OPT
INSTALL_BASE=/home/avar/perl5
$ make -C perl PERL_PATH='/usr/bin/perl' prefix='/home/avar' perl.mak
make: Entering directory `/home/avar/g/git/perl'
/usr/bin/perl Makefile.PL PREFIX='/home/avar'
Only one of PREFIX or INSTALL_BASE can be given. Not both.
make: *** [perl.mak] Error 255
make: Leaving directory `/home/avar/g/git/perl'

Change the perl Makefile to work around this by explicitly unsetting
INSTALL_BASE.

INSTALL_BASE is set in PERL_MM_OPT by e.g. the popular local::lib
package, from its documentation:

eval $(perl -I$HOME/perl5/lib/perl5 -Mlocal::lib 2>/dev/null)

Many other environments might also have set PERL_MM_OPT before
building Git. This change enables us to build in these environments.

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

Mark tests that use symlinks as needing SYMLINKS prereq... Elijah Newren Fri, 13 Aug 2010 02:09:12 +0000 (20:09 -0600)

Mark tests that use symlinks as needing SYMLINKS prerequisite

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

pull --rebase: Avoid spurious conflicts and reapplying... Elijah Newren Fri, 13 Aug 2010 01:50:50 +0000 (19:50 -0600)

pull --rebase: Avoid spurious conflicts and reapplying unnecessary patches

Prior to c85c792 (pull --rebase: be cleverer with rebased upstream
branches, 2008-01-26), pull --rebase would run

git rebase $merge_head

which resulted in a call to

git format-patch ... --ignore-if-in-upstream $merge_head..$cur_branch

This resulted in patches from $merge_head..$cur_branch being applied, as
long as they did not already exist in $cur_branch..$merge_head.

Unfortunately, when upstream is rebased, $merge_head..$cur_branch also
refers to "old" commits that have already been rebased upstream, meaning
that many patches that were already fixed upstream would be reapplied.
This could result in many spurious conflicts, as well as reintroduce
patches that were intentionally dropped upstream.

So the algorithm was changed in c85c792 (pull --rebase: be cleverer with
rebased upstream branches, 2008-01-26) and d44e712 (pull: support rebased
upstream + fetch + pull --rebase, 2009-07-19). Defining $old_remote_ref to
be the most recent entry in the reflog for @{upstream} that is an ancestor
of $cur_branch, pull --rebase was changed to run

git rebase --onto $merge_head $old_remote_ref

which results in a call to

git format-patch ... --ignore-if-in-upstream $old_remote_ref..$cur_branch

The whole point of this change was to reduce the number of commits being
reapplied, by avoiding commits that upstream already has or had.

In the rebased upstream case, this change achieved that purpose. It is
worth noting, though, that since $old_remote_ref is always an ancestor of
$cur_branch (by its definition), format-patch will not know what upstream
is and thus will not be able to determine if any patches are already
upstream; they will all be reapplied.

In the non-rebased upstream case, this new form is usually the same as the
original code but in some cases $old_remote_ref can be an ancestor of

$(git merge-base $merge_head $cur_branch)

meaning that instead of avoiding reapplying commits that upstream already
has, it actually includes more such commits. Combined with the fact that
format-patch can no longer detect commits that are already upstream (since
it is no longer told what upstream is), results in lots of confusion for
users (e.g. "git is giving me lots of conflicts in stuff I didn't even
change since my last push.")

Cases where additional commits could be reapplied include forking from a
commit other than the tracking branch, or amending/rebasing after pushing.
Cases where the inability to detect upstreamed commits cause problems
include independent discovery of a fix and having your patches get
upstreamed by some alternative route (e.g. pulling your changes to a third
machine, pushing from there, and then going back to your original machine
and trying to pull --rebase).

Fix the non-rebased upstream case by ignoring $old_remote_ref whenever it
is contained in $(git merge-base $merge_head $cur_branch). This should
have no affect on the rebased upstream case.

Acked-by: Santi Béjar <santi@agolina.net>
Signed-off-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

t5520-pull: Add testcases showing spurious conflicts... Elijah Newren Fri, 13 Aug 2010 01:50:49 +0000 (19:50 -0600)

t5520-pull: Add testcases showing spurious conflicts from git pull --rebase

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

Merge branch 'jc/sha1-name-find-fix'Junio C Hamano Fri, 13 Aug 2010 01:32:49 +0000 (18:32 -0700)

Merge branch 'jc/sha1-name-find-fix'

* jc/sha1-name-find-fix:
sha1_name.c: fix parsing of ":/token" syntax

Conflicts:
sha1_name.c

Merge branch 'jn/doc-pull'Junio C Hamano Fri, 13 Aug 2010 01:32:37 +0000 (18:32 -0700)

Merge branch 'jn/doc-pull'

* jn/doc-pull:
Documentation: flesh out “git pull” description

Merge branch 'jn/maint-gitweb-dynconf'Junio C Hamano Fri, 13 Aug 2010 01:32:31 +0000 (18:32 -0700)

Merge branch 'jn/maint-gitweb-dynconf'

* jn/maint-gitweb-dynconf:
gitweb: allow configurations that change with each request

Merge branch 'bc/use-more-hardlinks-in-install'Junio C Hamano Fri, 13 Aug 2010 01:32:20 +0000 (18:32 -0700)

Merge branch 'bc/use-more-hardlinks-in-install'

* bc/use-more-hardlinks-in-install:
Makefile: make hard/symbolic links for non-builtins too
Makefile: link builtins residing in bin directory to main git binary too

Merge branch 'tr/rfc-reset-doc'Junio C Hamano Fri, 13 Aug 2010 01:31:43 +0000 (18:31 -0700)

Merge branch 'tr/rfc-reset-doc'

* tr/rfc-reset-doc:
Documentation/reset: move "undo permanently" example behind "make topic"
Documentation/reset: reorder examples to match description
Documentation/reset: promote 'examples' one section up
Documentation/reset: separate options by mode
Documentation/git-reset: reorder modes for soft-mixed-hard progression