3 test_description='log --grep/--author/--regexp-ignore-case/-S/-G'
30 test_expect_success "log $kind${rest:+ $rest} ($match)" "
31 git log $rest $opt --format=%H >actual &&
32 test_cmp $expect actual
36 # test -i and --regexp-ignore-case and expect both to behave the same way
38 test_log $@ --regexp-ignore-case
42 test_expect_success setup '
48 git commit -m initial &&
49 git rev-parse --verify HEAD >expect_initial &&
54 git commit --author="Another Person <another@example.com>" -m second &&
55 git rev-parse --verify HEAD >expect_second
58 test_log expect_initial --grep initial
59 test_log expect_nomatch --grep InItial
60 test_log_icase expect_initial --grep InItial
61 test_log_icase expect_nomatch --grep initail
63 test_log expect_second --author Person
64 test_log expect_nomatch --author person
65 test_log_icase expect_second --author person
66 test_log_icase expect_nomatch --author spreon
68 test_log expect_nomatch -G picked
69 test_log expect_second -G Picked
70 test_log_icase expect_nomatch -G pickle
71 test_log_icase expect_second -G picked
73 test_expect_success 'log -G --textconv (missing textconv tool)' '
74 echo "* diff=test" >.gitattributes &&
75 test_must_fail git -c diff.test.textconv=missing log -Gfoo &&
79 test_expect_success 'log -G --no-textconv (missing textconv tool)' '
80 echo "* diff=test" >.gitattributes &&
81 git -c diff.test.textconv=missing log -Gfoo --no-textconv >actual &&
82 test_cmp expect_nomatch actual &&
86 test_log expect_nomatch -S picked
87 test_log expect_second -S Picked
88 test_log_icase expect_second -S picked
89 test_log_icase expect_nomatch -S pickle
91 test_log expect_nomatch -S p.cked --pickaxe-regex
92 test_log expect_second -S P.cked --pickaxe-regex
93 test_log_icase expect_second -S p.cked --pickaxe-regex
94 test_log_icase expect_nomatch -S p.ckle --pickaxe-regex
96 test_expect_success 'log -S --textconv (missing textconv tool)' '
97 echo "* diff=test" >.gitattributes &&
98 test_must_fail git -c diff.test.textconv=missing log -Sfoo &&
102 test_expect_success 'log -S --no-textconv (missing textconv tool)' '
103 echo "* diff=test" >.gitattributes &&
104 git -c diff.test.textconv=missing log -Sfoo --no-textconv >actual &&
105 test_cmp expect_nomatch actual &&
109 test_expect_success 'setup log -[GS] binary & --text' '
110 git checkout --orphan GS-binary-and-text &&
111 git read-tree --empty &&
112 printf "a\na\0a\n" >data.bin &&
114 git commit -m "create binary file" data.bin &&
115 printf "a\na\0a\n" >>data.bin &&
116 git commit -m "modify binary file" data.bin &&
118 git commit -m "delete binary file" data.bin &&
122 test_expect_success 'log -G ignores binary files' '
124 test_must_be_empty log
127 test_expect_success 'log -G looks into binary files with -a' '
128 git log -a -Ga >log &&
129 test_cmp log full-log
132 test_expect_success 'log -G looks into binary files with textconv filter' '
133 test_when_finished "rm .gitattributes" &&
134 echo "* diff=bin" >.gitattributes &&
135 git -c diff.bin.textconv=cat log -Ga >log &&
136 test_cmp log full-log
139 test_expect_success 'log -S looks into binary files' '
141 test_cmp log full-log