3 test_description
='log --grep/--author/--regexp-ignore-case/-S/-G'
6 test_expect_success setup
'
10 git commit -m initial &&
14 git commit -a --author="Another Person <another@example.com>" -m second
17 test_expect_success
'log --grep' '
18 git log --grep=initial --format=%H >actual &&
19 git rev-parse --verify HEAD^ >expect &&
20 test_cmp expect actual
23 test_expect_success
'log --grep --regexp-ignore-case' '
24 git log --regexp-ignore-case --grep=InItial --format=%H >actual &&
25 git rev-parse --verify HEAD^ >expect &&
26 test_cmp expect actual
29 test_expect_success
'log --grep -i' '
30 git log -i --grep=InItial --format=%H >actual &&
31 git rev-parse --verify HEAD^ >expect &&
32 test_cmp expect actual
35 test_expect_success
'log --author --regexp-ignore-case' '
36 git log --regexp-ignore-case --author=person --format=%H >actual &&
37 git rev-parse --verify HEAD >expect &&
38 test_cmp expect actual
41 test_expect_success
'log --author -i' '
42 git log -i --author=person --format=%H >actual &&
43 git rev-parse --verify HEAD >expect &&
44 test_cmp expect actual
47 test_expect_success
'log -G (nomatch)' '
48 git log -Gpicked --format=%H >actual &&
50 test_cmp expect actual
53 test_expect_success
'log -G (match)' '
54 git log -GPicked --format=%H >actual &&
55 git rev-parse --verify HEAD >expect &&
56 test_cmp expect actual
59 test_expect_success
'log -G --regexp-ignore-case (nomatch)' '
60 git log --regexp-ignore-case -Gpickle --format=%H >actual &&
62 test_cmp expect actual
65 test_expect_success
'log -G -i (nomatch)' '
66 git log -i -Gpickle --format=%H >actual &&
68 test_cmp expect actual
71 test_expect_success
'log -G --regexp-ignore-case (match)' '
72 git log --regexp-ignore-case -Gpicked --format=%H >actual &&
73 git rev-parse --verify HEAD >expect &&
74 test_cmp expect actual
77 test_expect_success
'log -G -i (match)' '
78 git log -i -Gpicked --format=%H >actual &&
79 git rev-parse --verify HEAD >expect &&
80 test_cmp expect actual
83 test_expect_success
'log -G --textconv (missing textconv tool)' '
84 echo "* diff=test" >.gitattributes &&
85 test_must_fail git -c diff.test.textconv=missing log -Gfoo &&
89 test_expect_success
'log -G --no-textconv (missing textconv tool)' '
90 echo "* diff=test" >.gitattributes &&
91 git -c diff.test.textconv=missing log -Gfoo --no-textconv >actual &&
93 test_cmp expect actual &&
97 test_expect_success
'log -S (nomatch)' '
98 git log -Spicked --format=%H >actual &&
100 test_cmp expect actual
103 test_expect_success
'log -S (match)' '
104 git log -SPicked --format=%H >actual &&
105 git rev-parse --verify HEAD >expect &&
106 test_cmp expect actual
109 test_expect_success
'log -S --regexp-ignore-case (match)' '
110 git log --regexp-ignore-case -Spicked --format=%H >actual &&
111 git rev-parse --verify HEAD >expect &&
112 test_cmp expect actual
115 test_expect_success
'log -S -i (match)' '
116 git log -i -Spicked --format=%H >actual &&
117 git rev-parse --verify HEAD >expect &&
118 test_cmp expect actual
121 test_expect_success
'log -S --regexp-ignore-case (nomatch)' '
122 git log --regexp-ignore-case -Spickle --format=%H >actual &&
124 test_cmp expect actual
127 test_expect_success
'log -S -i (nomatch)' '
128 git log -i -Spickle --format=%H >actual &&
130 test_cmp expect actual
133 test_expect_success
'log -S --textconv (missing textconv tool)' '
134 echo "* diff=test" >.gitattributes &&
135 test_must_fail git -c diff.test.textconv=missing log -Sfoo &&
139 test_expect_success
'log -S --no-textconv (missing textconv tool)' '
140 echo "* diff=test" >.gitattributes &&
141 git -c diff.test.textconv=missing log -Sfoo --no-textconv >actual &&
143 test_cmp expect actual &&