summaryrefslogtreecommitdiff
path: root/t
AgeCommit message (Collapse)AuthorFilesLines
2010-08-18t/t9600-cvsimport.sh: change from skip_all=* to prereq skipLibravatar Ævar Arnfjörð Bjarmason1-21/+18
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>
2010-08-18lib-patch-mode tests: change from skip_all=* to prereq skipLibravatar Ævar Arnfjörð Bjarmason4-28/+23
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>
2010-08-18t/t3701-add-interactive.sh: change from skip_all=* to prereq skipLibravatar Ævar Arnfjörð Bjarmason1-34/+70
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>
2010-08-18tests: Move FILEMODE prerequisite to lib-prereq-FILEMODE.shLibravatar Ævar Arnfjörð Bjarmason6-31/+16
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>
2010-08-18t/Makefile: Create test-results dir for smoke targetLibravatar Ævar Arnfjörð Bjarmason1-1/+1
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>
2010-08-18git-notes: Run partial expensive test everywhereLibravatar Ævar Arnfjörð Bjarmason1-12/+20
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>
2010-08-18t/t3300-funny-names: change from skip_all=* to prereq skipLibravatar Ævar Arnfjörð Bjarmason1-22/+60
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>
2010-08-18t/t3902-quoted: change from skip_all=* to prereq skipLibravatar Ævar Arnfjörð Bjarmason1-17/+21
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>
2010-08-18t/t4016-diff-quote: change from skip_all=* to prereq skipLibravatar Ævar Arnfjörð Bjarmason1-7/+15
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>
2010-08-18t/t5503-tagfollow: change from skip_all=* to prereq skipLibravatar Ævar Arnfjörð Bjarmason1-9/+24
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>
2010-08-18t/t7005-editor: change from skip_all=* to prereq skipLibravatar Ævar Arnfjörð Bjarmason1-5/+5
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>
2010-08-18t/t5705-clone-2gb: change from skip_all=* to prereq skipLibravatar Ævar Arnfjörð Bjarmason1-7/+9
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>
2010-08-18t/t1304-default-acl: change from skip_all=* to prereq skipLibravatar Ævar Arnfjörð Bjarmason1-6/+8
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>
2010-08-18t/README: Update "Skipping tests" to align with best practicesLibravatar Ævar Arnfjörð Bjarmason1-3/+18
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>
2010-08-18t/t7800-difftool.sh: Skip with prereq on no PERLLibravatar Ævar Arnfjörð Bjarmason1-27/+22
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>
2010-08-18t/t5800-remote-helpers.sh: Skip with prereq on python <2.4Libravatar Ævar Arnfjörð Bjarmason1-13/+11
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>
2010-08-18t/t4004-diff-rename-symlink.sh: use three-arg <prereq>Libravatar Ævar Arnfjörð Bjarmason1-11/+7
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>
2010-08-18tests: implicitly skip SYMLINKS tests using <prereq>Libravatar Ævar Arnfjörð Bjarmason8-90/+42
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>
2010-08-18t/README: Add a note about the dangers of coverage chasingLibravatar Ævar Arnfjörð Bjarmason1-0/+9
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>
2010-08-18t/README: A new section about test coverageLibravatar Ævar Arnfjörð Bjarmason1-0/+42
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>
2010-08-18t/README: Add SMOKE_{COMMENT,TAGS}= to smoke_report targetLibravatar Ævar Arnfjörð Bjarmason2-0/+13
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>
2010-08-18t/Makefile: Can't include GIT-BUILD-OPTIONS, it's a .shLibravatar Ævar Arnfjörð Bjarmason1-1/+1
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>
2010-08-18t/README: Document the Smoke testingLibravatar Ævar Arnfjörð Bjarmason1-0/+66
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>
2010-08-18tests: Infrastructure for Git smoke testingLibravatar Ævar Arnfjörð Bjarmason2-1/+55
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>
2010-08-18test-lib: Multi-prereq support only checked the last prereqLibravatar Ævar Arnfjörð Bjarmason2-4/+23
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>
2010-08-18tests: A SANITY test prereq for testing if we're rootLibravatar Ævar Arnfjörð Bjarmason9-32/+24
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>
2010-08-18t/README: Document the predefined test prerequisitesLibravatar Ævar Arnfjörð Bjarmason1-5/+40
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>
2010-08-18test-lib: Print missing prerequisites in test outputLibravatar Ævar Arnfjörð Bjarmason1-1/+1
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>
2010-08-18test-lib: Add support for multiple test prerequisitesLibravatar Ævar Arnfjörð Bjarmason3-6/+37
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>
2010-08-18test-lib: Don't write test-results when HARNESS_ACTIVELibravatar Ævar Arnfjörð Bjarmason1-10/+13
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>
2010-08-12Merge branch 'maint'Libravatar Junio C Hamano2-1/+7
* maint: push: mention "git pull" in error message for non-fast forwards Standardize do { ... } while (0) style t/t7003: replace \t with literal tab in sed expression index-pack: Don't follow replace refs.
2010-08-12t/t7003: replace \t with literal tab in sed expressionLibravatar Brandon Casey1-1/+1
The sed utilities on IRIX and Solaris do not interpret the sequence '\t' to mean a tab character; they read a literal character 't'. So, use a literal tab instead. Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-08-12index-pack: Don't follow replace refs.Libravatar Nelson Elhage1-0/+6
Without this, attempting to index a pack containing objects that have been replaced results in a fatal error that looks like: fatal: SHA1 COLLISION FOUND WITH <replaced-object> ! Signed-off-by: Nelson Elhage <nelhage@ksplice.com> Acked-by: Christian Couder <chriscool@tuxfamily.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-08-11Merge branch 'maint'Libravatar Junio C Hamano3-3/+120
* maint: post-receive-email: remove spurious commas in email subject fast-import: export correctly marks larger than 2^20-1 t/lib-git-svn.sh: use $PERL_PATH for perl, not perl from $PATH diff: strip extra "/" when stripping prefix
2010-08-11fast-import: export correctly marks larger than 2^20-1Libravatar Raja R Harinath1-0/+57
dump_marks_helper() has a bug when dumping marks larger than 2^20-1, i.e., when the sparse array has more than two levels. The bug was that the 'base' counter was being shifted by 20 bits at level 3, and then again by 10 bits at level 2, rather than a total shift of 20 bits in this argument to the recursive call: (base + k) << m->shift There are two ways to fix this correctly, the elegant: (base + k) << 10 and the one I chose due to edit distance: base + (k << m->shift) Signed-off-by: Raja R Harinath <harinath@hurrynot.org> Acked-by: Shawn O. Pearce <spearce@spearce.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-08-11t/lib-git-svn.sh: use $PERL_PATH for perl, not perl from $PATHLibravatar Ævar Arnfjörð Bjarmason1-3/+2
Change the git-svn tests to use $PERL_PATH, not the "perl" in $PATH. Using perl in $PATH was added by Sam Vilain in v1.6.6-rc0~95^2~3, Philippe Bruhat introduced $PERL_PATH to the test suite in v1.6.6-rc0~9^2, but the lib-git-svn.sh tests weren't updated to use the new convention. This resulted in the git-svn tests always being skipped on my system. My /usr/bin/perl has access to SVN::Core and SVN::Repos, but the perl in my $PATH does not. Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-08-11diff: strip extra "/" when stripping prefixLibravatar Jakub Narebski1-0/+61
There are two ways a user might want to use "diff --relative": 1. For a file in a directory, like "subdir/file", the user can use "--relative=subdir/" to strip the directory. 2. To strip part of a filename, like "foo-10", they can use "--relative=foo-". We currently handle both of those situations. However, if the user passes "--relative=subdir" (without the trailing slash), we produce inconsistent results. For the unified diff format, we collapse the double-slash of "a//file" correctly into "a/file". But for other formats (raw, stat, name-status), we end up with "/file". We can do what the user means here and strip the extra "/" (and only a slash). We are not hurting any existing users of (2) above with this behavior change because the existing output for this case was nonsensical. Patch by Jakub, tests and commit message by Jeff King. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-08-09Merge branch 'maint'Libravatar Junio C Hamano2-1/+19
* maint: gitweb: clarify search results page when no matching commit found Documentation: add a FILES section for show-ref Makefile: add missing dependency on http.h Makefile: add missing dependencies on url.h Documentation/git-log: Clarify --full-diff git-rebase: fix typo when parsing --force-rebase imap-send: Fix sprintf usage prune: allow --dry-run for -n and --verbose for -v notes: allow --dry-run for -n and --verbose for -v Document -B<n>[/<m>], -M<n> and -C<n> variants of -B, -M and -C Documentation: cite git-am from git-apply t7003: fix subdirectory-filter test Allow "check-ref-format --branch" from subdirectory check-ref-format: handle subcommands in separate functions pretty-options.txt: match --format's documentation with implementation.
2010-08-09t7003: fix subdirectory-filter testLibravatar Thomas Rast1-1/+2
The test would not fail if the filtering failed to do anything, since in test -z "$(git diff HEAD directorymoved:newsubdir)"' 'directorymoved:newsubdir' is not valid, so git-diff fails without printing anything on stdout. But then the exit status of git-diff is lost, whereas test -z "" succeeds. Use 'git diff --exit-code' instead, which does the right thing and has the added bonus of showing the differences if there are any. Signed-off-by: Thomas Rast <trast@student.ethz.ch> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-08-06Allow "check-ref-format --branch" from subdirectoryLibravatar Jonathan Nieder1-0/+17
check-ref-format --branch requires access to the repository to resolve refs like @{-1}. Noticed by Nguyễn Thái Ngọc Duy. Cc: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-08-03Merge branch 'gp/pack-refs-remove-empty-dirs'Libravatar Junio C Hamano1-0/+6
* gp/pack-refs-remove-empty-dirs: pack-refs: remove newly empty directories
2010-08-02Merge git://git.bogomips.org/git-svnLibravatar Junio C Hamano1-0/+11
* git://git.bogomips.org/git-svn: git svn: fix dcommit to work with touched files git svn: add an option to recode pathnames
2010-08-02upload-pack: Improve error message when bad ref requestedLibravatar Elijah Newren1-0/+9
When printing an error message saying a ref was requested that we do not have, only print that ref, rather than the ref and everything sent to us on the same packet line (e.g. protocol support specifications). Signed-off-by: Elijah Newren <newren@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-08-02git svn: fix dcommit to work with touched filesLibravatar David D. Kilzer1-0/+11
The dcommit command fails if an otherwise unmodified file has been touched in the working directory: Cannot dcommit with a dirty index. Commit your changes first, or stash them with `git stash'. This happens because "git diff-index" reports a difference between the index and the filesystem: :100644 100644 d00491...... 000000...... M file The fix is to run "git update-index --refresh" before "git diff-index" as is done in git-rebase and git-rebase--interactive before "git diff-files". This changes dcommit to display a list of modified files before exiting. Also add a similar test case for "git svn rebase". [ew: rearranged commit message subject] Signed-off-by: David D. Kilzer <ddkilzer@kilzer.net> Acked-by: Eric Wong <normalperson@yhbt.net>
2010-08-02Merge branch 'maint'Libravatar Junio C Hamano2-4/+46
* maint: test-lib: Remove 3 year old no-op --no-python option test-lib: Ignore --quiet under a TAP harness Documentation/rev-parse: quoting is required with --parseopt Documentation: reporting bugs Fix git rebase --continue to work with touched files Document ls-files -t as semi-obsolete.
2010-08-02Merge branch 'ab/tap' into maintLibravatar Junio C Hamano1-4/+3
* ab/tap: test-lib: Remove 3 year old no-op --no-python option test-lib: Ignore --quiet under a TAP harness
2010-08-02test-lib: Remove 3 year old no-op --no-python optionLibravatar Ævar Arnfjörð Bjarmason1-3/+0
The --no-python option was added to test-lib.sh by Johannes Schindelin in early 2006 in abb7c7b3. It was later turned into a no-op by Junio C Hamano in 7cdbff14 the same year. Over three years is long enough before removing this old wart which was retained for backwards compatibility. Our tests have been using NO_PYTHON and "test_have_prereq PYTHON" for a long time now. Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-08-02test-lib: Ignore --quiet under a TAP harnessLibravatar Ævar Arnfjörð Bjarmason1-1/+3
Running the tests with --quiet under a TAP harness will always fail, since a TAP harness always needs actual test output to go along with the plan that's being emitted. Change the test-lib.sh to ignore the --quiet option under HARNESS_ACTIVE to work around this. Then users that have --quiet in their GIT_TEST_OPTS can run tests under prove(1) without everything breaking. Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-07-28Fix git rebase --continue to work with touched filesLibravatar David D. Kilzer1-0/+43
When performing a non-interactive rebase, sometimes "git rebase --continue" will fail if an unmodified file is touched in the working directory: You must edit all merge conflicts and then mark them as resolved using git add This is caused by "git diff-files" reporting a difference between the index and the filesystem: :100644 100644 d00491...... 000000...... M file The fix is to run "git update-index --refresh" before "git diff-files" as is done in git-rebase--interactive. Signed-off-by: David D. Kilzer <ddkilzer@kilzer.net> Acked-by: Johannes Schindelin <Johannes.Schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-07-27Sync with 1.7.2.1Libravatar Junio C Hamano1-1/+23
Signed-off-by: Junio C Hamano <gitster@pobox.com>