{"thread":{"id":"26374","subject":"[PATCH] t6004: add pathspec globbing test for log family","startedAt":"2011-01-31T20:09:53Z","lastAt":"2011-01-31T20:09:53Z","messageCount":1,"participants":["Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"160107","messageId":"7vei7s6dim.fsf@alter.siamese.dyndns.org","threadId":"26374","inReplyTo":null,"subject":"[PATCH] t6004: add pathspec globbing test for log family","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2011-01-31T20:09:53Z","receivedAt":"2011-01-31T20:09:53Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Earlier e10cb0f (tree_entry_interesting(): support wildcard matching,\n2010-12-15) and b3d4b34 (tree_entry_interesting(): optimize wildcard\nmatching when base is matched, 2010-12-15) added tests for globbing\nsupport for diff-tree plumbing.  This is a follow-up to update the test\nfor revision traversal and path pruning machinery for the same topic.\n\nSigned-off-by: Junio C Hamano <gitster@pobox.com>\n---\n t/t6004-rev-list-path-optim.sh |   69 +++++++++++++++++++++++++++++++++-------\n 1 files changed, 57 insertions(+), 12 deletions(-)\n\ndiff --git a/t/t6004-rev-list-path-optim.sh b/t/t6004-rev-list-path-optim.sh\nindex 5dabf1c..3e8c42e 100755\n--- a/t/t6004-rev-list-path-optim.sh\n+++ b/t/t6004-rev-list-path-optim.sh\n@@ -1,51 +1,96 @@\n #!/bin/sh\n \n-test_description='git rev-list trivial path optimization test'\n+test_description='git rev-list trivial path optimization test\n+\n+   d/z1\n+   b0                             b1\n+   o------------------------*----o master\n+  /                        /\n+ o---------o----o----o----o side\n+ a0        c0   c1   a1   c2\n+ d/f0      d/f1\n+ d/z0\n+\n+'\n \n . ./test-lib.sh\n \n test_expect_success setup '\n-echo Hello > a &&\n-git add a &&\n-git commit -m \"Initial commit\" a &&\n-initial=$(git rev-parse --verify HEAD)\n+\techo Hello >a &&\n+\tmkdir d &&\n+\techo World >d/f &&\n+\techo World >d/z &&\n+\tgit add a d &&\n+\ttest_tick &&\n+\tgit commit -m \"Initial commit\" &&\n+\tgit rev-parse --verify HEAD &&\n+\tgit tag initial\n '\n \n test_expect_success path-optimization '\n-    commit=$(echo \"Unchanged tree\" | git commit-tree \"HEAD^{tree}\" -p HEAD) &&\n-    test $(git rev-list $commit | wc -l) = 2 &&\n-    test $(git rev-list $commit -- . | wc -l) = 1\n+\ttest_tick &&\n+\tcommit=$(echo \"Unchanged tree\" | git commit-tree \"HEAD^{tree}\" -p HEAD) &&\n+\ttest $(git rev-list $commit | wc -l) = 2 &&\n+\ttest $(git rev-list $commit -- . | wc -l) = 1\n '\n \n test_expect_success 'further setup' '\n \tgit checkout -b side &&\n \techo Irrelevant >c &&\n-\tgit add c &&\n+\techo Irrelevant >d/f &&\n+\tgit add c d/f &&\n+\ttest_tick &&\n \tgit commit -m \"Side makes an irrelevant commit\" &&\n+\tgit tag side_c0 &&\n \techo \"More Irrelevancy\" >c &&\n \tgit add c &&\n+\ttest_tick &&\n \tgit commit -m \"Side makes another irrelevant commit\" &&\n \techo Bye >a &&\n \tgit add a &&\n+\ttest_tick &&\n \tgit commit -m \"Side touches a\" &&\n-\tside=$(git rev-parse --verify HEAD) &&\n+\tgit tag side_a1 &&\n \techo \"Yet more Irrelevancy\" >c &&\n \tgit add c &&\n+\ttest_tick &&\n \tgit commit -m \"Side makes yet another irrelevant commit\" &&\n \tgit checkout master &&\n \techo Another >b &&\n-\tgit add b &&\n+\techo Munged >d/z &&\n+\tgit add b d/z &&\n+\ttest_tick &&\n \tgit commit -m \"Master touches b\" &&\n+\tgit tag master_b0 &&\n \tgit merge side &&\n \techo Touched >b &&\n \tgit add b &&\n+\ttest_tick &&\n \tgit commit -m \"Master touches b again\"\n '\n \n test_expect_success 'path optimization 2' '\n-\t( echo \"$side\"; echo \"$initial\" ) >expected &&\n+\tgit rev-parse side_a1 initial >expected &&\n \tgit rev-list HEAD -- a >actual &&\n \ttest_cmp expected actual\n '\n \n+test_expect_success 'pathspec with leading path' '\n+\tgit rev-parse master^ master_b0 side_c0 initial >expected &&\n+\tgit rev-list HEAD -- d >actual &&\n+\ttest_cmp expected actual\n+'\n+\n+test_expect_success 'pathspec with glob (1)' '\n+\tgit rev-parse master^ master_b0 side_c0 initial >expected &&\n+\tgit rev-list HEAD -- \"d/*\" >actual &&\n+\ttest_cmp expected actual\n+'\n+\n+test_expect_success 'pathspec with glob (2)' '\n+\tgit rev-parse side_c0 initial >expected &&\n+\tgit rev-list HEAD -- \"d/[a-m]*\" >actual &&\n+\ttest_cmp expected actual\n+'\n+\n test_done\n-- \n1.7.4.261.g705f2\n"}]}