aboutsummaryrefslogtreecommitdiff
path: root/t
Commit message (Collapse)AuthorAge
...
| * | | | | | | t/README: Typo: paralell -> parallelÆvar Arnfjörð Bjarmason2010-07-05
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | | | | | t/README: The trash is in 't/trash directory.$name'Ævar Arnfjörð Bjarmason2010-07-05
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There's a unique trash directory for each test, not a single directory as the previous documentation suggested. Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | | | | | t/t9700/test.pl: don't access private object members, use public access methodsBrandon Casey2010-06-29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This test is accessing private object members of the Test::More and Test::Builder objects. Older versions of Test::More did not implement these variables using a hash. My system complains as follows: Can't coerce array into hash at <snip>/t/t9700/test.pl line 13. BEGIN failed--compilation aborted at <snip>/t/t9700/test.pl line 15. There are public access methods available for retrieving and setting these variables, so let's use them instead. Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil> Acked-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | | | | | t9700: Use Test::More->builder, not $Test::Builder::TestÆvar Arnfjörð Bjarmason2010-06-27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | $Test::Builder::Test was only made into an `our' variable in 0.94 released in September 2009, older distros are more likely to have 0.92 or earlier. Use the singleton Test::More->builder constructor instead. The exit() call was also unportable to <0.94. Just output a meaningful exit code if the ->is_passing method exists. The t9700-perl-git.sh test only cares about stderr output, so this doesn't affect test results when using older Test::More modules. Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | | | | | tests: Say "pass" rather than "ok" on empty lines for TAPÆvar Arnfjörð Bjarmason2010-06-25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Lines that begin with "ok" confuse the TAP harness because it can't distinguish them from a test counter. Work around the issue by saying "pass" instead, which isn't a reserved TAP word. Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | | | | | tests: Skip tests in a way that makes sense under TAPÆvar Arnfjörð Bjarmason2010-06-25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | SKIP messages are now part of the TAP plan. A TAP harness now knows why a particular test was skipped and can report that information. The non-TAP harness built into Git's test-lib did nothing special with these messages, and is unaffected by these changes. Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | | | | | test-lib: output a newline before "ok" under a TAP harnessÆvar Arnfjörð Bjarmason2010-06-25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Some tests in the testsuite will emit a line that doesn't end with a newline, right before we're about to output "ok" or "not ok". This breaks the TAP output with "Tests out of sequence" errors since a TAP harness can't understand this: ok 1 - A test [some output here]ok 2 - Another test ok 3 - Yet another test Work around it by emitting an empty line before we're about to say "ok" or "not ok", but only if we're running under --verbose and HARNESS_ACTIVE=1 is set, which'll only be the case when running under a harnesses like prove(1). I think it's better to do this than fix each tests by adding `&& echo' everywhere. More tests might be added that break TAP in the future, and a human isn't going to look at the extra whitespace, since HARNESS_ACTIVE=1 always means a harness is reading it. The tests that had issues were: t1007, t3410, t3413, t3409, t3414, t3415, t3416, t3412, t3404, t5407, t7402, t7003, t9001 With this workaround the entire test suite runs without errors under: prove -j 10 ./t[0-9]*.sh :: --verbose Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | | | | | test-lib: Make the test_external_* functions TAP-awareÆvar Arnfjörð Bjarmason2010-06-25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Before TAP we just ran the Perl test and assumed that it failed if nothing was printed on STDERR. Continue doing that, but introduce a `test_external_has_tap' variable which tests can set to indicate that they're outputting TAP. If it's set we won't output a test plan, but trust the external test to do so. That way we can make external tests work with a TAP harness, but still maintain compatibility with test-lib's own way of tracking tests through the test-results directory. Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | | | | | test-lib: Adjust output to be valid TAP formatÆvar Arnfjörð Bjarmason2010-06-25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | TAP, the Test Anything Protocol, is a simple text-based interface between testing modules in a test harness. test-lib.sh's output was already very close to being valid TAP. This change brings it all the way there. Before: $ ./t0005-signals.sh * ok 1: sigchain works * passed all 1 test(s) And after: $ ./t0005-signals.sh ok 1 - sigchain works # passed all 1 test(s) 1..1 The advantage of using TAP is that any program that reads the format (a "test harness") can run the tests. The most popular of these is the prove(1) utility that comes with Perl. It can run tests in parallel, display colored output, format the output to console, file, HTML etc., and much more. An example: $ prove ./t0005-signals.sh ./t0005-signals.sh .. ok All tests successful. Files=1, Tests=1, 0 wallclock secs ( 0.03 usr 0.00 sys + 0.01 cusr 0.02 csys = 0.06 CPU) Result: PASS prove(1) gives you human readable output without being too verbose. Running the test suite in parallel with `make test -j15` produces a flood of text. Running them with `prove -j 15 ./t[0-9]*.sh` makes it easy to follow what's going on. All this patch does is re-arrange the output a bit so that it conforms with the TAP spec, everything that the test suite did before continues to work. That includes aggregating results in t/test-results/, the --verbose, --debug and other options for tests, and the test color output. TAP harnesses ignore everything that they don't know about, so running the tests with --verbose works: $ prove ./t0005-signals.sh :: --verbose --debug ./t0005-signals.sh .. Terminated ./t0005-signals.sh .. ok All tests successful. Files=1, Tests=1, 0 wallclock secs ( 0.02 usr 0.01 sys + 0.01 cusr 0.01 csys = 0.05 CPU) Result: PASS Just supply the -v option to prove itself to get all the verbose output that it suppresses: $ prove -v ./t0005-signals.sh :: --verbose --debug ./t0005-signals.sh .. Initialized empty Git repository in /home/avar/g/git/t/trash directory.t0005-signals/.git/ expecting success: test-sigchain >actual case "$?" in 143) true ;; # POSIX w/ SIGTERM=15 3) true ;; # Windows *) false ;; esac && test_cmp expect actual Terminated ok 1 - sigchain works # passed all 1 test(s) 1..1 ok All tests successful. Files=1, Tests=1, 0 wallclock secs ( 0.02 usr 0.00 sys + 0.01 cusr 0.01 csys = 0.04 CPU) Result: PASS As a further example, consider this test script that uses a lot of test-lib.sh features by Jakub Narebski: #!/bin/sh test_description='this is a sample test. This test is here to see various test outputs.' . ./test-lib.sh say 'diagnostic message' test_expect_success 'true test' 'true' test_expect_success 'false test' 'false' test_expect_failure 'true test (todo)' 'true' test_expect_failure 'false test (todo)' 'false' test_debug 'echo "debug message"' test_done The output of that was previously: * diagnostic message # yellow * ok 1: true test * FAIL 2: false test # bold red false * FIXED 3: true test (todo) * still broken 4: false test (todo) # bold green * fixed 1 known breakage(s) # green * still have 1 known breakage(s) # bold red * failed 1 among remaining 3 test(s) # bold red But is now: diagnostic message # yellow ok 1 - true test not ok - 2 false test # bold red # false ok 3 - true test (todo) # TODO known breakage not ok 4 - false test (todo) # TODO known breakage # bold green # fixed 1 known breakage(s) # green # still have 1 known breakage(s) # bold red # failed 1 among remaining 3 test(s) # bold red 1..4 All the coloring is preserved when the test is run manually. Under prove(1) the test performs as expected, even with --debug and --verbose options: $ prove ./example.sh :: --debug --verbose ./example.sh .. Dubious, test returned 1 (wstat 256, 0x100) Failed 1/4 subtests (1 TODO test unexpectedly succeeded) Test Summary Report ------------------- ./example.sh (Wstat: 256 Tests: 4 Failed: 1) Failed test: 2 TODO passed: 3 Non-zero exit status: 1 Files=1, Tests=4, 0 wallclock secs ( 0.02 usr 0.00 sys + 0.00 cusr 0.01 csys = 0.03 CPU) Result: FAIL The TAP harness itself doesn't get confused by the color output, they aren't used by test-lib.sh stdout isn't open to a terminal (test -t 1). Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | | | | | Merge branch 'maint'Junio C Hamano2010-07-07
|\ \ \ \ \ \ \ \ | | |/ / / / / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * maint: backmerge a few more fixes to 1.7.1.X series rev-parse: fix --parse-opt --keep-dashdash --stop-at-non-option fix git branch -m in presence of cross devices Conflicts: RelNotes builtin/rev-parse.c
| * | | | | | | Merge branch 'maint-1.6.4' into maintJunio C Hamano2010-07-07
| |\ \ \ \ \ \ \ | | | |/ / / / / | | |/| | | | | | | | | | | | | | | | | | | | | * maint-1.6.4: rev-parse: fix --parse-opt --keep-dashdash --stop-at-non-option
| | * | | | | | rev-parse: fix --parse-opt --keep-dashdash --stop-at-non-optionUwe Kleine-König2010-07-07
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The ?: operator has a lower priority than |, so the implicit associativity made the 6th argument of parse_options be PARSE_OPT_KEEP_DASHDASH if keep_dashdash was true discarding PARSE_OPT_STOP_AT_NON_OPTION and PARSE_OPT_SHELL_EVAL. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | | | | | Merge branch 'tr/receive-pack-aliased-update-fix' into maintJunio C Hamano2010-07-07
| |\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * tr/receive-pack-aliased-update-fix: check_aliased_update: strcpy() instead of strcat() to copy receive-pack: detect aliased updates which can occur with symrefs receive-pack: switch global variable 'commands' to a parameter Conflicts: t/t5516-fetch-push.sh
* | | | | | | | | t/t0006: specify timezone as EST5 not EST to comply with POSIXBrandon Casey2010-07-07
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | POSIX requires that both the timezone "standard" and "offset" be specified in the TZ environment variable. This causes a problem on IRIX which does not understand the timezone 'EST'. Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | | | | | | Merge branch 'maint'Junio C Hamano2010-07-06
|\ \ \ \ \ \ \ \ \ | |/ / / / / / / / | | | | | | / / / | |_|_|_|_|/ / / |/| | | | | | | | | | | | | | | * maint: add missing && to submodule-merge testcase test-date: fix sscanf type conversion
| * | | | | | | add missing && to submodule-merge testcaseHeiko Voigt2010-07-06
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: Heiko Voigt <hvoigt@hvoigt.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | | | | | parse_date: fix signedness in timezone calculationJeff King2010-07-05
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When no timezone is specified, we deduce the offset by subtracting the result of mktime from our calculated timestamp. However, our timestamp is stored as an unsigned integer, meaning we perform the subtraction as unsigned. For a negative offset, this means we wrap to a very high number, and our numeric timezone is in the millions of hours. You can see this bug by doing: $ TZ=EST \ GIT_AUTHOR_DATE='2010-06-01 10:00' \ git commit -a -m foo $ git cat-file -p HEAD | grep author author Jeff King <peff@peff.net> 1275404416 +119304128 Instead, we should perform this subtraction as a time_t, the same type that mktime returns. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | | | | | Merge branch 'maint'Junio C Hamano2010-07-05
|\ \ \ \ \ \ \ \ | |/ / / / / / / | | | | | / / / | |_|_|_|/ / / |/| | | | | | | | | | | | | | | | | | | | * maint: t0006: test timezone parsing rerere.txt: Document forget subcommand Documentation/git-gc.txt: add reference to githooks
| * | | | | | t0006: test timezone parsingJeff King2010-07-05
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, test-date simply ignored the parsed timezone and told show_date() to use UTC. Instead, let's print out what we actually parsed. While we're at it, let's make it easy for tests to work in a specific timezone. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | | | | Merge branch 'ar/decorate-color'Junio C Hamano2010-06-30
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * ar/decorate-color: Add test for correct coloring of git log --decoration Allow customizable commit decorations colors log --decorate: Colorize commit decorations log-tree.c: Use struct name_decoration's type for classifying decoration commit.h: add 'type' to struct name_decoration
| * | | | | | | Add test for correct coloring of git log --decorationNazri Ramliy2010-06-30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: Nazri Ramliy <ayiehere@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | | | | | Merge branch 'cc/cherry-pick-stdin'Junio C Hamano2010-06-30
|\ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * cc/cherry-pick-stdin: revert: do not rebuild argv on heap revert: accept arbitrary rev-list options t3508 (cherry-pick): futureproof against unmerged files
| * | | | | | | | revert: do not rebuild argv on heapJonathan Nieder2010-06-29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Set options in struct rev_info directly so we can reuse the arguments collected from parse_options without modification. This is just a cleanup; no noticeable change is intended. Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | | | | | | Merge commit 'v1.7.2-rc0~6^2' into cc/cherry-pick-stdinJunio C Hamano2010-06-29
| |\ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit 'v1.7.2-rc0~6^2': DWIM 'git show -5' to 'git show --do-walk -5' Documentation/SubmittingPatches: Fix typo in GMail section Documentation/config: describe status.submodulesummary This commit fixes one test in t3508 by making "cherry-pick -<num>" walk the history. A test update from Elijah Newren is squashed as an evil merge.
| * | | | | | | | | revert: accept arbitrary rev-list optionsChristian Couder2010-06-25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This can be useful to do something like: git rev-list --reverse master -- README | git cherry-pick -n --stdin without using xargs. Signed-off-by: Christian Couder <chriscool@tuxfamily.org> Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | | | | | | | t3508 (cherry-pick): futureproof against unmerged filesJonathan Nieder2010-06-14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Each of the tests in t3508 begins by navigating to a sane state: git checkout master && git reset --hard $commit If a previous test left unmerged files around, they are untouched and the checkout fails, causing later tests to fail, too. This is not a problem in practice because no test except the final one produces unmerged files. But as a futureproofing measure, it is still best to avoid the problem with 'checkout -f'. In particular, this is needed for new tests to be added to the end of the script. Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | | | | | | | Merge branch 'jl/status-ignore-submodules'Junio C Hamano2010-06-30
|\ \ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * jl/status-ignore-submodules: Add the option "--ignore-submodules" to "git status" git submodule: ignore dirty submodules for summary and status Conflicts: builtin/commit.c t/t7508-status.sh wt-status.c wt-status.h
| * | | | | | | | | | Add the option "--ignore-submodules" to "git status"Jens Lehmann2010-06-25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In some use cases it is not desirable that "git status" considers submodules that only contain untracked content as dirty. This may happen e.g. when the submodule is not under the developers control and not all build generated files have been added to .gitignore by the upstream developers. Using the "untracked" parameter for the "--ignore-submodules" option disables checking for untracked content and lets git diff report them as changed only when they have new commits or modified content. Sometimes it is not wanted to have submodules show up as changed when they just contain changes to their work tree (this was the behavior before 1.7.0). An example for that are scripts which just want to check for submodule commits while ignoring any changes to the work tree. Also users having large submodules known not to change might want to use this option, as the - sometimes substantial - time it takes to scan the submodule work tree(s) is saved when using the "dirty" parameter. And if you want to ignore any changes to submodules, you can now do that by using this option without parameters or with "all" (when the config option status.submodulesummary is set, using "all" will also suppress the output of the submodule summary). A new function handle_ignore_submodules_arg() is introduced to parse this option new to "git status" in a single location, as "git diff" already knew it. Signed-off-by: Jens Lehmann <Jens.Lehmann@web.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | | | | | | | | Merge branch 'jn/grep-open'Junio C Hamano2010-06-30
|\ \ \ \ \ \ \ \ \ \ \ | | |_|_|_|_|_|_|_|/ / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * jn/grep-open: t/t7811-grep-open.sh: remove broken/redundant creation of fake "less" script t/t7811-grep-open.sh: ensure fake "less" is made executable t/lib-pager.sh: remove unnecessary '^' from 'expr' regular expression grep -O: allow optional argument specifying the pager (or editor) grep: Add the option '--open-files-in-pager' Unify code paths of threaded greps grep: refactor grep_objects loop into its own function Conflicts: t/t7006-pager.sh
| * | | | | | | | | | t/t7811-grep-open.sh: remove broken/redundant creation of fake "less" scriptBrandon Casey2010-06-21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The fake "less" script was already created in a previous test titled 'setup: fake "less"', so it is redundant. Additionally, it is broken since the redirection of 'cat' is to a file named 'less', but the chmod operates on the file named by the $less variable which may not contain the value 'less'. So, just remove this code, and rely on the creation of the fake "less" script performed earlier within the test script. Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | | | | | | | | t/t7811-grep-open.sh: ensure fake "less" is made executableBrandon Casey2010-06-21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The fake "less" script was not being made executable. This can cause the tests that follow to fail. This failure is not apparent on platforms which have DEFAULT_PAGER set to the string "less", since lib-pager.sh will have set the $less variable to "less" and the SIMPLEPAGER prerequisite will have been set, and so the "less" script will have already been created properly and made executable in test 2 'git grep -O'. On platforms which set DEFAULT_PAGER to something like "more", no such script will have been previously created, and tests 7 and 8 will fail. So, add a call to chmod to make the fake "less" script executable. Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | | | | | | | | t/lib-pager.sh: remove unnecessary '^' from 'expr' regular expressionBrandon Casey2010-06-21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Regular expressions matched by 'expr' have an implicit '^' at the beginning of them and so are anchored to the beginning of the string. Using the '^' character to mean "match at the beginning", is redundant and could produce the wrong result if 'expr' implementations interpret the '^' as a literal '^'. Additionally, GNU expr 5.97 complains like this: expr: warning: unportable BRE: `^[a-z][a-z]*$': using `^' as the first character of the basic regular expression is not portable; it is being ignored Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | | | | | | | | grep -O: allow optional argument specifying the pager (or editor)Johannes Schindelin2010-06-13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Suppose you want to edit all files that contain a specific search term. Of course, you can do something totally trivial such as git grep -z -e <term> | xargs -0r vi +/<term> but maybe you are happy that the same will be achieved by git grep -Ovi <term> now. [jn: rebased and added tests] Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Acked-by: Paolo Bonzini <bonzini@gnu.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | | | | | | | | grep: Add the option '--open-files-in-pager'Johannes Schindelin2010-06-13
| | |_|/ / / / / / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This adds an option to open the matching files in the pager, and if the pager happens to be "less" (or "vi") and there is only one grep pattern, it also jumps to the first match right away. The short option was chose as '-O' to avoid clashes with GNU grep's options (as suggested by Junio). So, 'git grep -O abc' is a short form for 'less +/abc $(grep -l abc)' except that it works also with spaces in file names, and it does not start the pager if there was no matching file. [jn: rebased and added tests; with error handling fix from Junio squashed in] Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | | | | | | | Merge branch 'tr/rev-list-count'Junio C Hamano2010-06-30
|\ \ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * tr/rev-list-count: bash completion: Support "divergence from upstream" messages in __git_ps1 rev-list: introduce --count option Conflicts: contrib/completion/git-completion.bash
| * | | | | | | | | | rev-list: introduce --count optionThomas Rast2010-06-12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add a --count option that, instead of actually listing the commits, merely counts them. This is mostly geared towards script use, and to this end it acts specially when used with --left-right: it outputs the left and right counts separately. Previously, scripts would have to run a shell loop or small inline script over to achieve the same. (Without --left-right, a simple |wc -l does the job.) Signed-off-by: Thomas Rast <trast@student.ethz.ch> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | | | | | | | | Merge branch 'mg/rev-parse-tests'Junio C Hamano2010-06-30
|\ \ \ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * mg/rev-parse-tests: t6018: make sure all tested symbolic names are different revs t6018: add tests for rev-list's --branches and --tags
| * | | | | | | | | | | t6018: make sure all tested symbolic names are different revsMichael J Gruber2010-06-27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | | | | | | | | | t6018: add tests for rev-list's --branches and --tagsMichael J Gruber2010-06-27
| | |_|_|_|_|_|_|_|/ / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | so that we know when they break. Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | | | | | | | | Merge branch 'jl/maint-diff-ignore-submodules'Junio C Hamano2010-06-30
|\ \ \ \ \ \ \ \ \ \ \ | | |_|_|/ / / / / / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * jl/maint-diff-ignore-submodules: t4027,4041: Use test -s to test for an empty file Add optional parameters to the diff option "--ignore-submodules" git diff: rename test that had a conflicting name
| * | | | | | | | | | t4027,4041: Use test -s to test for an empty fileBrian Gernhardt2010-06-25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The tests used a mixture of 'echo -n' (which is non-portable) and either test_cmp or diff to check if a file is empty. The much easier and portable method to check for an empty file is '! test -s' While we're in t4027, there was an excess test_done. Remove it. Signed-off-by: Brian Gernhardt <brian@gernhardtsoftware.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | | | | | | | | Add optional parameters to the diff option "--ignore-submodules"Jens Lehmann2010-06-11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In some use cases it is not desirable that the diff family considers submodules that only contain untracked content as dirty. This may happen e.g. when the submodule is not under the developers control and not all build generated files have been added to .gitignore by the upstream developers. Using the "untracked" parameter for the "--ignore-submodules" option disables checking for untracked content and lets git diff report them as changed only when they have new commits or modified content. Sometimes it is not wanted to have submodules show up as changed when they just contain changes to their work tree. An example for that are scripts which just want to check for submodule commits while ignoring any changes to the work tree. Also users having large submodules known not to change might want to use this option, as the - sometimes substantial - time it takes to scan the submodule work tree(s) is saved. Signed-off-by: Jens Lehmann <Jens.Lehmann@web.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | | | | | | | | git diff: rename test that had a conflicting nameJens Lehmann2010-06-11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In 86140d5 the new test t4041-diff-submodule.sh was introduced although t4027-diff-submodule.sh already existed. Rename the newer test to t4041-diff-submodule-option.sh to fix that. Signed-off-by: Jens Lehmann <Jens.Lehmann@web.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | | | | | | | | Sync with 1.7.1.1Junio C Hamano2010-06-29
|\ \ \ \ \ \ \ \ \ \ \ | | |_|_|_|_|_|/ / / / | |/| | | | | | | | | | | | | | | | | | | | Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | | | | | | | | t/t9001: use egrep when regular expressions are involvedBrandon Casey2010-06-29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Supplying backslashed, extended regular expressions to grep is not portable. Use egrep instead. Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | | | | | | | | Merge branch 'maint'Junio C Hamano2010-06-28
|\ \ \ \ \ \ \ \ \ \ \ | |/ / / / / / / / / / | | | | | | | | | | / | |_|_|_|_|_|_|_|_|/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | * maint: Update draft release notes to 1.7.1.1 notes: Initialise variable to appease gcc notes: check number of parameters to "git notes copy"
| * | | | | | | | | Merge branch 'tr/send-email-8bit' into maintJunio C Hamano2010-06-28
| |\ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * tr/send-email-8bit: send-email: ask about and declare 8bit mails
| * \ \ \ \ \ \ \ \ \ Merge branch 'js/maint-am-rebase-invalid-author' into maintJunio C Hamano2010-06-28
| |\ \ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * js/maint-am-rebase-invalid-author: am: use get_author_ident_from_commit instead of mailinfo when rebasing
| * | | | | | | | | | | notes: check number of parameters to "git notes copy"Jeff King2010-06-28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Otherwise we may segfault with too few parameters. Signed-off-by: Jeff King <peff@peff.net> Tested-by: Bert Wesarg <Bert.Wesarg@googlemail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | | | | | | | | | Merge branch 'cp/textconv-cat-file'Junio C Hamano2010-06-27
|\ \ \ \ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * cp/textconv-cat-file: git-cat-file.txt: Document --textconv t/t8007: test textconv support for cat-file textconv: support for cat_file sha1_name: add get_sha1_with_context()