]> git.ipfire.org Git - thirdparty/git.git/blame - t/t4202-log.sh
Merge branch 'rs/preserve-merges-unused-code-removal'
[thirdparty/git.git] / t / t4202-log.sh
CommitLineData
0faf2da7
AL
1#!/bin/sh
2
3test_description='git log'
4
5. ./test-lib.sh
cf3983d1 6. "$TEST_DIRECTORY/lib-gpg.sh"
940a911f 7. "$TEST_DIRECTORY/lib-terminal.sh"
989eea95
AK
8. "$TEST_DIRECTORY/lib-log-graph.sh"
9
10test_cmp_graph () {
11 lib_test_cmp_graph --format=%s "$@"
12}
0faf2da7
AL
13
14test_expect_success setup '
15
16 echo one >one &&
17 git add one &&
18 test_tick &&
19 git commit -m initial &&
20
21 echo ichi >one &&
22 git add one &&
23 test_tick &&
24 git commit -m second &&
25
d9305089 26 git mv one ichi &&
0faf2da7
AL
27 test_tick &&
28 git commit -m third &&
29
d9305089
AL
30 cp ichi ein &&
31 git add ein &&
0faf2da7
AL
32 test_tick &&
33 git commit -m fourth &&
34
d9305089
AL
35 mkdir a &&
36 echo ni >a/two &&
37 git add a/two &&
38 test_tick &&
39 git commit -m fifth &&
40
41 git rm a/two &&
0faf2da7 42 test_tick &&
d9305089 43 git commit -m sixth
0faf2da7
AL
44
45'
46
bb93afd5
FC
47printf "sixth\nfifth\nfourth\nthird\nsecond\ninitial" > expect
48test_expect_success 'pretty' '
49
50 git log --pretty="format:%s" > actual &&
51 test_cmp expect actual
52'
53
54printf "sixth\nfifth\nfourth\nthird\nsecond\ninitial\n" > expect
55test_expect_success 'pretty (tformat)' '
56
57 git log --pretty="tformat:%s" > actual &&
58 test_cmp expect actual
59'
60
61test_expect_success 'pretty (shortcut)' '
62
63 git log --pretty="%s" > actual &&
64 test_cmp expect actual
65'
66
67test_expect_success 'format' '
68
69 git log --format="%s" > actual &&
70 test_cmp expect actual
71'
72
37bb5d74
RS
73cat > expect << EOF
74 This is
75 the sixth
76 commit.
77 This is
78 the fifth
79 commit.
80EOF
81
14e1a4e1 82test_expect_success 'format %w(11,1,2)' '
37bb5d74 83
14e1a4e1 84 git log -2 --format="%w(11,1,2)This is the %s commit." > actual &&
37bb5d74
RS
85 test_cmp expect actual
86'
87
88test_expect_success 'format %w(,1,2)' '
89
90 git log -2 --format="%w(,1,2)This is%nthe %s%ncommit." > actual &&
91 test_cmp expect actual
92'
93
bb93afd5 94cat > expect << EOF
cb78f4f0 95$(git rev-parse --short :/sixth ) sixth
96$(git rev-parse --short :/fifth ) fifth
97$(git rev-parse --short :/fourth ) fourth
98$(git rev-parse --short :/third ) third
99$(git rev-parse --short :/second ) second
100$(git rev-parse --short :/initial) initial
bb93afd5
FC
101EOF
102test_expect_success 'oneline' '
103
104 git log --oneline > actual &&
105 test_cmp expect actual
106'
107
0faf2da7
AL
108test_expect_success 'diff-filter=A' '
109
5404c116
MM
110 git log --no-renames --pretty="format:%s" --diff-filter=A HEAD > actual &&
111 git log --no-renames --pretty="format:%s" --diff-filter A HEAD > actual-separate &&
dea007fb
MM
112 printf "fifth\nfourth\nthird\ninitial" > expect &&
113 test_cmp expect actual &&
114 test_cmp expect actual-separate
0faf2da7
AL
115
116'
117
118test_expect_success 'diff-filter=M' '
119
120 actual=$(git log --pretty="format:%s" --diff-filter=M HEAD) &&
121 expect=$(echo second) &&
a167ece0 122 verbose test "$actual" = "$expect"
0faf2da7
AL
123
124'
125
126test_expect_success 'diff-filter=D' '
127
5404c116 128 actual=$(git log --no-renames --pretty="format:%s" --diff-filter=D HEAD) &&
d9305089 129 expect=$(echo sixth ; echo third) &&
a167ece0 130 verbose test "$actual" = "$expect"
d9305089
AL
131
132'
133
134test_expect_success 'diff-filter=R' '
135
136 actual=$(git log -M --pretty="format:%s" --diff-filter=R HEAD) &&
137 expect=$(echo third) &&
a167ece0 138 verbose test "$actual" = "$expect"
d9305089
AL
139
140'
141
142test_expect_success 'diff-filter=C' '
143
144 actual=$(git log -C -C --pretty="format:%s" --diff-filter=C HEAD) &&
145 expect=$(echo fourth) &&
a167ece0 146 verbose test "$actual" = "$expect"
d9305089
AL
147
148'
149
150test_expect_success 'git log --follow' '
151
152 actual=$(git log --follow --pretty="format:%s" ichi) &&
153 expect=$(echo third ; echo second ; echo initial) &&
a167ece0 154 verbose test "$actual" = "$expect"
076c9837
DT
155'
156
157test_expect_success 'git config log.follow works like --follow' '
158 test_config log.follow true &&
159 actual=$(git log --pretty="format:%s" ichi) &&
160 expect=$(echo third ; echo second ; echo initial) &&
161 verbose test "$actual" = "$expect"
162'
0faf2da7 163
076c9837
DT
164test_expect_success 'git config log.follow does not die with multiple paths' '
165 test_config log.follow true &&
166 git log --pretty="format:%s" ichi ein
167'
168
169test_expect_success 'git config log.follow does not die with no paths' '
170 test_config log.follow true &&
171 git log --
172'
173
174test_expect_success 'git config log.follow is overridden by --no-follow' '
175 test_config log.follow true &&
176 actual=$(git log --no-follow --pretty="format:%s" ichi) &&
177 expect="third" &&
178 verbose test "$actual" = "$expect"
0faf2da7
AL
179'
180
cb78f4f0 181# Note that these commits are intentionally listed out of order.
182last_three="$(git rev-parse :/fourth :/sixth :/fifth)"
d5cee0f7 183cat > expect << EOF
cb78f4f0 184$(git rev-parse --short :/sixth ) sixth
185$(git rev-parse --short :/fifth ) fifth
186$(git rev-parse --short :/fourth) fourth
d5cee0f7
MG
187EOF
188test_expect_success 'git log --no-walk <commits> sorts by commit time' '
cb78f4f0 189 git log --no-walk --oneline $last_three > actual &&
d5cee0f7
MG
190 test_cmp expect actual
191'
192
ca92e59e 193test_expect_success 'git log --no-walk=sorted <commits> sorts by commit time' '
cb78f4f0 194 git log --no-walk=sorted --oneline $last_three > actual &&
ca92e59e
MZ
195 test_cmp expect actual
196'
197
660e113c 198cat > expect << EOF
cb78f4f0 199=== $(git rev-parse --short :/sixth ) sixth
200=== $(git rev-parse --short :/fifth ) fifth
201=== $(git rev-parse --short :/fourth) fourth
660e113c
JK
202EOF
203test_expect_success 'git log --line-prefix="=== " --no-walk <commits> sorts by commit time' '
cb78f4f0 204 git log --line-prefix="=== " --no-walk --oneline $last_three > actual &&
660e113c
JK
205 test_cmp expect actual
206'
207
d5cee0f7 208cat > expect << EOF
cb78f4f0 209$(git rev-parse --short :/fourth) fourth
210$(git rev-parse --short :/sixth ) sixth
211$(git rev-parse --short :/fifth ) fifth
d5cee0f7 212EOF
ca92e59e 213test_expect_success 'git log --no-walk=unsorted <commits> leaves list of commits as given' '
cb78f4f0 214 git log --no-walk=unsorted --oneline $last_three > actual &&
ca92e59e
MZ
215 test_cmp expect actual
216'
217
d5cee0f7 218test_expect_success 'git show <commits> leaves list of commits as given' '
cb78f4f0 219 git show --oneline -s $last_three > actual &&
d5cee0f7
MG
220 test_cmp expect actual
221'
222
0843acfd
JK
223test_expect_success 'setup case sensitivity tests' '
224 echo case >one &&
225 test_tick &&
a48fcd83 226 git add one &&
0843acfd
JK
227 git commit -a -m Second
228'
229
230test_expect_success 'log --grep' '
231 echo second >expect &&
232 git log -1 --pretty="tformat:%s" --grep=sec >actual &&
22dfa8a2
CJ
233 test_cmp expect actual
234'
235
236cat > expect << EOF
237second
238initial
239EOF
240test_expect_success 'log --invert-grep --grep' '
9e3cbc59
ÆAB
241 # Fixed
242 git -c grep.patternType=fixed log --pretty="tformat:%s" --invert-grep --grep=th --grep=Sec >actual &&
243 test_cmp expect actual &&
244
245 # POSIX basic
246 git -c grep.patternType=basic log --pretty="tformat:%s" --invert-grep --grep=t[h] --grep=S[e]c >actual &&
247 test_cmp expect actual &&
248
249 # POSIX extended
250 git -c grep.patternType=basic log --pretty="tformat:%s" --invert-grep --grep=t[h] --grep=S[e]c >actual &&
251 test_cmp expect actual &&
252
253 # PCRE
254 if test_have_prereq PCRE
255 then
256 git -c grep.patternType=perl log --pretty="tformat:%s" --invert-grep --grep=t[h] --grep=S[e]c >actual &&
257 test_cmp expect actual
258 fi
22dfa8a2
CJ
259'
260
261test_expect_success 'log --invert-grep --grep -i' '
262 echo initial >expect &&
9e3cbc59
ÆAB
263
264 # Fixed
265 git -c grep.patternType=fixed log --pretty="tformat:%s" --invert-grep -i --grep=th --grep=Sec >actual &&
266 test_cmp expect actual &&
267
268 # POSIX basic
269 git -c grep.patternType=basic log --pretty="tformat:%s" --invert-grep -i --grep=t[h] --grep=S[e]c >actual &&
270 test_cmp expect actual &&
271
272 # POSIX extended
273 git -c grep.patternType=extended log --pretty="tformat:%s" --invert-grep -i --grep=t[h] --grep=S[e]c >actual &&
274 test_cmp expect actual &&
275
276 # PCRE
277 if test_have_prereq PCRE
278 then
279 git -c grep.patternType=perl log --pretty="tformat:%s" --invert-grep -i --grep=t[h] --grep=S[e]c >actual &&
280 test_cmp expect actual
281 fi
0843acfd 282'
0faf2da7 283
7d7b86f7
MM
284test_expect_success 'log --grep option parsing' '
285 echo second >expect &&
286 git log -1 --pretty="tformat:%s" --grep sec >actual &&
287 test_cmp expect actual &&
288 test_must_fail git log -1 --pretty="tformat:%s" --grep
289'
290
0843acfd
JK
291test_expect_success 'log -i --grep' '
292 echo Second >expect &&
293 git log -1 --pretty="tformat:%s" -i --grep=sec >actual &&
294 test_cmp expect actual
295'
296
297test_expect_success 'log --grep -i' '
298 echo Second >expect &&
9e3cbc59
ÆAB
299
300 # Fixed
0843acfd 301 git log -1 --pretty="tformat:%s" --grep=sec -i >actual &&
9e3cbc59
ÆAB
302 test_cmp expect actual &&
303
304 # POSIX basic
305 git -c grep.patternType=basic log -1 --pretty="tformat:%s" --grep=s[e]c -i >actual &&
306 test_cmp expect actual &&
307
308 # POSIX extended
309 git -c grep.patternType=extended log -1 --pretty="tformat:%s" --grep=s[e]c -i >actual &&
310 test_cmp expect actual &&
311
312 # PCRE
313 if test_have_prereq PCRE
314 then
315 git -c grep.patternType=perl log -1 --pretty="tformat:%s" --grep=s[e]c -i >actual &&
316 test_cmp expect actual
317 fi
0843acfd 318'
0faf2da7 319
34a4ae55
JH
320test_expect_success 'log -F -E --grep=<ere> uses ere' '
321 echo second >expect &&
9df46763
ÆAB
322 # basic would need \(s\) to do the same
323 git log -1 --pretty="tformat:%s" -F -E --grep="(s).c.nd" >actual &&
324 test_cmp expect actual
325'
326
327test_expect_success PCRE 'log -F -E --perl-regexp --grep=<pcre> uses PCRE' '
328 test_when_finished "rm -rf num_commits" &&
329 git init num_commits &&
330 (
331 cd num_commits &&
332 test_commit 1d &&
333 test_commit 2e
334 ) &&
335
336 # In PCRE \d in [\d] is like saying "0-9", and matches the 2
337 # in 2e...
338 echo 2e >expect &&
339 git -C num_commits log -1 --pretty="tformat:%s" -F -E --perl-regexp --grep="[\d]" >actual &&
340 test_cmp expect actual &&
341
342 # ...in POSIX basic and extended it is the same as [d],
343 # i.e. "d", which matches 1d, but does not match 2e.
344 echo 1d >expect &&
345 git -C num_commits log -1 --pretty="tformat:%s" -F -E --grep="[\d]" >actual &&
34a4ae55
JH
346 test_cmp expect actual
347'
348
8465541e 349test_expect_success 'log with grep.patternType configuration' '
8465541e
JH
350 git -c grep.patterntype=fixed \
351 log -1 --pretty=tformat:%s --grep=s.c.nd >actual &&
d3c6751b 352 test_must_be_empty actual
8465541e
JH
353'
354
355test_expect_success 'log with grep.patternType configuration and command line' '
356 echo second >expect &&
357 git -c grep.patterntype=fixed \
358 log -1 --pretty=tformat:%s --basic-regexp --grep=s.c.nd >actual &&
359 test_cmp expect actual
360'
361
dfe1a17d 362test_expect_success !FAIL_PREREQS 'log with various grep.patternType configurations & command-lines' '
9df46763
ÆAB
363 git init pattern-type &&
364 (
365 cd pattern-type &&
366 test_commit 1 file A &&
367
368 # The tagname is overridden here because creating a
369 # tag called "(1|2)" as test_commit would otherwise
370 # implicitly do would fail on e.g. MINGW.
371 test_commit "(1|2)" file B 2 &&
372
373 echo "(1|2)" >expect.fixed &&
374 cp expect.fixed expect.basic &&
375 cp expect.fixed expect.extended &&
376 cp expect.fixed expect.perl &&
377
378 # A strcmp-like match with fixed.
379 git -c grep.patternType=fixed log --pretty=tformat:%s \
380 --grep="(1|2)" >actual.fixed &&
381
382 # POSIX basic matches (, | and ) literally.
383 git -c grep.patternType=basic log --pretty=tformat:%s \
384 --grep="(.|.)" >actual.basic &&
385
386 # POSIX extended needs to have | escaped to match it
387 # literally, whereas under basic this is the same as
388 # (|2), i.e. it would also match "1". This test checks
389 # for extended by asserting that it is not matching
390 # what basic would match.
391 git -c grep.patternType=extended log --pretty=tformat:%s \
392 --grep="\|2" >actual.extended &&
393 if test_have_prereq PCRE
394 then
395 # Only PCRE would match [\d]\| with only
396 # "(1|2)" due to [\d]. POSIX basic would match
397 # both it and "1" since similarly to the
398 # extended match above it is the same as
399 # \([\d]\|\). POSIX extended would
400 # match neither.
401 git -c grep.patternType=perl log --pretty=tformat:%s \
402 --grep="[\d]\|" >actual.perl &&
403 test_cmp expect.perl actual.perl
404 fi &&
405 test_cmp expect.fixed actual.fixed &&
406 test_cmp expect.basic actual.basic &&
407 test_cmp expect.extended actual.extended &&
408
409 git log --pretty=tformat:%s -F \
410 --grep="(1|2)" >actual.fixed.short-arg &&
411 git log --pretty=tformat:%s -E \
412 --grep="\|2" >actual.extended.short-arg &&
7531a2dd
ÆAB
413 if test_have_prereq PCRE
414 then
415 git log --pretty=tformat:%s -P \
416 --grep="[\d]\|" >actual.perl.short-arg
417 else
418 test_must_fail git log -P \
419 --grep="[\d]\|"
420 fi &&
9df46763
ÆAB
421 test_cmp expect.fixed actual.fixed.short-arg &&
422 test_cmp expect.extended actual.extended.short-arg &&
7531a2dd
ÆAB
423 if test_have_prereq PCRE
424 then
425 test_cmp expect.perl actual.perl.short-arg
426 fi &&
9df46763
ÆAB
427
428 git log --pretty=tformat:%s --fixed-strings \
429 --grep="(1|2)" >actual.fixed.long-arg &&
430 git log --pretty=tformat:%s --basic-regexp \
431 --grep="(.|.)" >actual.basic.long-arg &&
432 git log --pretty=tformat:%s --extended-regexp \
433 --grep="\|2" >actual.extended.long-arg &&
434 if test_have_prereq PCRE
435 then
436 git log --pretty=tformat:%s --perl-regexp \
437 --grep="[\d]\|" >actual.perl.long-arg &&
438 test_cmp expect.perl actual.perl.long-arg
9001c192
ÆAB
439 else
440 test_must_fail git log --perl-regexp \
441 --grep="[\d]\|"
9df46763
ÆAB
442 fi &&
443 test_cmp expect.fixed actual.fixed.long-arg &&
444 test_cmp expect.basic actual.basic.long-arg &&
445 test_cmp expect.extended actual.extended.long-arg
446 )
447'
448
289e1623
TR
449cat > expect <<EOF
450* Second
451* sixth
452* fifth
453* fourth
454* third
455* second
456* initial
457EOF
458
459test_expect_success 'simple log --graph' '
989eea95 460 test_cmp_graph
289e1623
TR
461'
462
660e113c
JK
463cat > expect <<EOF
464123 * Second
465123 * sixth
466123 * fifth
467123 * fourth
468123 * third
469123 * second
470123 * initial
471EOF
472
473test_expect_success 'simple log --graph --line-prefix="123 "' '
989eea95 474 test_cmp_graph --line-prefix="123 "
660e113c
JK
475'
476
289e1623
TR
477test_expect_success 'set up merge history' '
478 git checkout -b side HEAD~4 &&
479 test_commit side-1 1 1 &&
480 test_commit side-2 2 2 &&
481 git checkout master &&
482 git merge side
483'
484
485cat > expect <<\EOF
21531927 486* Merge branch 'side'
289e1623
TR
487|\
488| * side-2
489| * side-1
490* | Second
491* | sixth
492* | fifth
493* | fourth
494|/
495* third
496* second
497* initial
498EOF
499
500test_expect_success 'log --graph with merge' '
989eea95 501 test_cmp_graph --date-order
289e1623
TR
502'
503
660e113c 504cat > expect <<\EOF
21531927 505| | | * Merge branch 'side'
660e113c
JK
506| | | |\
507| | | | * side-2
508| | | | * side-1
509| | | * | Second
510| | | * | sixth
511| | | * | fifth
512| | | * | fourth
513| | | |/
514| | | * third
515| | | * second
516| | | * initial
517EOF
518
519test_expect_success 'log --graph --line-prefix="| | | " with merge' '
989eea95 520 test_cmp_graph --line-prefix="| | | " --date-order
660e113c
JK
521'
522
73c727d6 523cat > expect.colors <<\EOF
21531927 524* Merge branch 'side'
73c727d6
NTND
525<BLUE>|<RESET><CYAN>\<RESET>
526<BLUE>|<RESET> * side-2
527<BLUE>|<RESET> * side-1
528* <CYAN>|<RESET> Second
529* <CYAN>|<RESET> sixth
530* <CYAN>|<RESET> fifth
531* <CYAN>|<RESET> fourth
532<CYAN>|<RESET><CYAN>/<RESET>
533* third
534* second
535* initial
536EOF
537
538test_expect_success 'log --graph with merge with log.graphColors' '
55cccf4b 539 test_config log.graphColors " blue,invalid-color, cyan, red , " &&
ffe00557 540 lib_test_cmp_colored_graph --date-order --format=%s
73c727d6
NTND
541'
542
656197ad
MK
543test_expect_success 'log --raw --graph -m with merge' '
544 git log --raw --graph --oneline -m master | head -n 500 >actual &&
545 grep "initial" actual
546'
547
548test_expect_success 'diff-tree --graph' '
549 git diff-tree --graph master^ | head -n 500 >actual &&
550 grep "one" actual
551'
552
289e1623
TR
553cat > expect <<\EOF
554* commit master
555|\ Merge: A B
556| | Author: A U Thor <author@example.com>
557| |
21531927 558| | Merge branch 'side'
289e1623 559| |
ef1e7406 560| * commit tags/side-2
289e1623
TR
561| | Author: A U Thor <author@example.com>
562| |
563| | side-2
564| |
565| * commit tags/side-1
566| | Author: A U Thor <author@example.com>
567| |
568| | side-1
569| |
570* | commit master~1
571| | Author: A U Thor <author@example.com>
572| |
573| | Second
574| |
575* | commit master~2
576| | Author: A U Thor <author@example.com>
577| |
578| | sixth
579| |
580* | commit master~3
581| | Author: A U Thor <author@example.com>
582| |
583| | fifth
584| |
585* | commit master~4
586|/ Author: A U Thor <author@example.com>
587|
588| fourth
589|
590* commit tags/side-1~1
591| Author: A U Thor <author@example.com>
592|
593| third
594|
595* commit tags/side-1~2
596| Author: A U Thor <author@example.com>
597|
598| second
599|
600* commit tags/side-1~3
601 Author: A U Thor <author@example.com>
602
603 initial
604EOF
605
606test_expect_success 'log --graph with full output' '
607 git log --graph --date-order --pretty=short |
608 git name-rev --name-only --stdin |
9524cf29 609 sed "s/Merge:.*/Merge: A B/;s/ *\$//" >actual &&
289e1623
TR
610 test_cmp expect actual
611'
612
613test_expect_success 'set up more tangled history' '
614 git checkout -b tangle HEAD~6 &&
615 test_commit tangle-a tangle-a a &&
616 git merge master~3 &&
617 git merge side~1 &&
618 git checkout master &&
7b1d6269
AC
619 git merge tangle &&
620 git checkout -b reach &&
621 test_commit reach &&
622 git checkout master &&
623 git checkout -b octopus-a &&
624 test_commit octopus-a &&
625 git checkout master &&
626 git checkout -b octopus-b &&
627 test_commit octopus-b &&
628 git checkout master &&
629 test_commit seventh &&
a48fcd83 630 git merge octopus-a octopus-b &&
7b1d6269 631 git merge reach
289e1623
TR
632'
633
634cat > expect <<\EOF
21531927 635* Merge tag 'reach'
7b1d6269
AC
636|\
637| \
638| \
21531927 639*-. \ Merge tags 'octopus-a' and 'octopus-b'
7b1d6269
AC
640|\ \ \
641* | | | seventh
642| | * | octopus-b
643| |/ /
644|/| |
645| * | octopus-a
646|/ /
647| * reach
648|/
21531927 649* Merge branch 'tangle'
289e1623
TR
650|\
651| * Merge branch 'side' (early part) into tangle
652| |\
653| * \ Merge branch 'master' (early part) into tangle
654| |\ \
655| * | | tangle-a
21531927 656* | | | Merge branch 'side'
289e1623
TR
657|\ \ \ \
658| * | | | side-2
eaf158f8 659| | |_|/
289e1623
TR
660| |/| |
661| * | | side-1
662* | | | Second
663* | | | sixth
eaf158f8 664| |_|/
289e1623
TR
665|/| |
666* | | fifth
667* | | fourth
668|/ /
479db18b 669* / third
289e1623
TR
670|/
671* second
672* initial
673EOF
674
95110d75 675test_expect_success 'log --graph with merge' '
989eea95 676 test_cmp_graph --date-order
289e1623
TR
677'
678
8a3d203b 679test_expect_success 'log.decorate configuration' '
940a911f 680 git log --oneline --no-decorate >expect.none &&
4f62c2bc
JH
681 git log --oneline --decorate >expect.short &&
682 git log --oneline --decorate=full >expect.full &&
8a3d203b
JH
683
684 echo "[log] decorate" >>.git/config &&
635530a2 685 git log --oneline >actual &&
4f62c2bc 686 test_cmp expect.short actual &&
8a3d203b 687
90e76b70 688 test_config log.decorate true &&
4f62c2bc 689 git log --oneline >actual &&
8a3d203b 690 test_cmp expect.short actual &&
4f62c2bc 691 git log --oneline --decorate=full >actual &&
8a3d203b 692 test_cmp expect.full actual &&
4f62c2bc 693 git log --oneline --decorate=no >actual &&
8a3d203b
JH
694 test_cmp expect.none actual &&
695
90e76b70 696 test_config log.decorate no &&
4f62c2bc 697 git log --oneline >actual &&
8a3d203b 698 test_cmp expect.none actual &&
4f62c2bc 699 git log --oneline --decorate >actual &&
8a3d203b 700 test_cmp expect.short actual &&
4f62c2bc 701 git log --oneline --decorate=full >actual &&
8a3d203b
JH
702 test_cmp expect.full actual &&
703
90e76b70 704 test_config log.decorate 1 &&
b2be2f6a
JK
705 git log --oneline >actual &&
706 test_cmp expect.short actual &&
707 git log --oneline --decorate=full >actual &&
708 test_cmp expect.full actual &&
709 git log --oneline --decorate=no >actual &&
710 test_cmp expect.none actual &&
711
90e76b70 712 test_config log.decorate short &&
4f62c2bc 713 git log --oneline >actual &&
8a3d203b 714 test_cmp expect.short actual &&
4f62c2bc 715 git log --oneline --no-decorate >actual &&
8a3d203b 716 test_cmp expect.none actual &&
4f62c2bc 717 git log --oneline --decorate=full >actual &&
8a3d203b
JH
718 test_cmp expect.full actual &&
719
90e76b70 720 test_config log.decorate full &&
4f62c2bc 721 git log --oneline >actual &&
8a3d203b 722 test_cmp expect.full actual &&
4f62c2bc 723 git log --oneline --no-decorate >actual &&
8a3d203b 724 test_cmp expect.none actual &&
4f62c2bc 725 git log --oneline --decorate >actual &&
8fb26872 726 test_cmp expect.short actual &&
8a3d203b 727
90e76b70 728 test_unconfig log.decorate &&
0c47695a 729 git log --pretty=raw >expect.raw &&
90e76b70 730 test_config log.decorate full &&
0c47695a
JS
731 git log --pretty=raw >actual &&
732 test_cmp expect.raw actual
733
734'
735
65516f58
RA
736test_expect_success 'decorate-refs with glob' '
737 cat >expect.decorate <<-\EOF &&
21531927
JH
738 Merge-tag-reach
739 Merge-tags-octopus-a-and-octopus-b
65516f58
RA
740 seventh
741 octopus-b (octopus-b)
742 octopus-a (octopus-a)
743 reach
744 EOF
a6be5e67 745 cat >expect.no-decorate <<-\EOF &&
21531927
JH
746 Merge-tag-reach
747 Merge-tags-octopus-a-and-octopus-b
a6be5e67
DS
748 seventh
749 octopus-b
750 octopus-a
751 reach
752 EOF
753 git log -n6 --decorate=short --pretty="tformat:%f%d" \
754 --decorate-refs="heads/octopus*" >actual &&
755 test_cmp expect.decorate actual &&
65516f58 756 git log -n6 --decorate=short --pretty="tformat:%f%d" \
a6be5e67
DS
757 --decorate-refs-exclude="heads/octopus*" \
758 --decorate-refs="heads/octopus*" >actual &&
759 test_cmp expect.no-decorate actual &&
760 git -c log.excludeDecoration="heads/octopus*" log \
761 -n6 --decorate=short --pretty="tformat:%f%d" \
65516f58
RA
762 --decorate-refs="heads/octopus*" >actual &&
763 test_cmp expect.decorate actual
764'
765
766test_expect_success 'decorate-refs without globs' '
767 cat >expect.decorate <<-\EOF &&
21531927
JH
768 Merge-tag-reach
769 Merge-tags-octopus-a-and-octopus-b
65516f58
RA
770 seventh
771 octopus-b
772 octopus-a
773 reach (tag: reach)
774 EOF
775 git log -n6 --decorate=short --pretty="tformat:%f%d" \
776 --decorate-refs="tags/reach" >actual &&
777 test_cmp expect.decorate actual
778'
779
780test_expect_success 'multiple decorate-refs' '
781 cat >expect.decorate <<-\EOF &&
21531927
JH
782 Merge-tag-reach
783 Merge-tags-octopus-a-and-octopus-b
65516f58
RA
784 seventh
785 octopus-b (octopus-b)
786 octopus-a (octopus-a)
787 reach (tag: reach)
788 EOF
789 git log -n6 --decorate=short --pretty="tformat:%f%d" \
790 --decorate-refs="heads/octopus*" \
791 --decorate-refs="tags/reach" >actual &&
792 test_cmp expect.decorate actual
793'
794
795test_expect_success 'decorate-refs-exclude with glob' '
796 cat >expect.decorate <<-\EOF &&
21531927
JH
797 Merge-tag-reach (HEAD -> master)
798 Merge-tags-octopus-a-and-octopus-b
65516f58
RA
799 seventh (tag: seventh)
800 octopus-b (tag: octopus-b)
801 octopus-a (tag: octopus-a)
802 reach (tag: reach, reach)
803 EOF
804 git log -n6 --decorate=short --pretty="tformat:%f%d" \
805 --decorate-refs-exclude="heads/octopus*" >actual &&
a6be5e67
DS
806 test_cmp expect.decorate actual &&
807 git -c log.excludeDecoration="heads/octopus*" log \
808 -n6 --decorate=short --pretty="tformat:%f%d" >actual &&
65516f58
RA
809 test_cmp expect.decorate actual
810'
811
812test_expect_success 'decorate-refs-exclude without globs' '
813 cat >expect.decorate <<-\EOF &&
21531927
JH
814 Merge-tag-reach (HEAD -> master)
815 Merge-tags-octopus-a-and-octopus-b
65516f58
RA
816 seventh (tag: seventh)
817 octopus-b (tag: octopus-b, octopus-b)
818 octopus-a (tag: octopus-a, octopus-a)
819 reach (reach)
820 EOF
821 git log -n6 --decorate=short --pretty="tformat:%f%d" \
822 --decorate-refs-exclude="tags/reach" >actual &&
a6be5e67
DS
823 test_cmp expect.decorate actual &&
824 git -c log.excludeDecoration="tags/reach" log \
825 -n6 --decorate=short --pretty="tformat:%f%d" >actual &&
65516f58
RA
826 test_cmp expect.decorate actual
827'
828
829test_expect_success 'multiple decorate-refs-exclude' '
830 cat >expect.decorate <<-\EOF &&
21531927
JH
831 Merge-tag-reach (HEAD -> master)
832 Merge-tags-octopus-a-and-octopus-b
65516f58
RA
833 seventh (tag: seventh)
834 octopus-b (tag: octopus-b)
835 octopus-a (tag: octopus-a)
836 reach (reach)
837 EOF
838 git log -n6 --decorate=short --pretty="tformat:%f%d" \
839 --decorate-refs-exclude="heads/octopus*" \
840 --decorate-refs-exclude="tags/reach" >actual &&
a6be5e67
DS
841 test_cmp expect.decorate actual &&
842 git -c log.excludeDecoration="heads/octopus*" \
843 -c log.excludeDecoration="tags/reach" log \
844 -n6 --decorate=short --pretty="tformat:%f%d" >actual &&
845 test_cmp expect.decorate actual &&
846 git -c log.excludeDecoration="heads/octopus*" log \
847 --decorate-refs-exclude="tags/reach" \
848 -n6 --decorate=short --pretty="tformat:%f%d" >actual &&
65516f58
RA
849 test_cmp expect.decorate actual
850'
851
852test_expect_success 'decorate-refs and decorate-refs-exclude' '
a6be5e67 853 cat >expect.no-decorate <<-\EOF &&
21531927
JH
854 Merge-tag-reach (master)
855 Merge-tags-octopus-a-and-octopus-b
65516f58
RA
856 seventh
857 octopus-b
858 octopus-a
859 reach (reach)
860 EOF
861 git log -n6 --decorate=short --pretty="tformat:%f%d" \
862 --decorate-refs="heads/*" \
863 --decorate-refs-exclude="heads/oc*" >actual &&
a6be5e67
DS
864 test_cmp expect.no-decorate actual
865'
866
867test_expect_success 'deocrate-refs and log.excludeDecoration' '
868 cat >expect.decorate <<-\EOF &&
21531927
JH
869 Merge-tag-reach (master)
870 Merge-tags-octopus-a-and-octopus-b
a6be5e67
DS
871 seventh
872 octopus-b (octopus-b)
873 octopus-a (octopus-a)
874 reach (reach)
875 EOF
876 git -c log.excludeDecoration="heads/oc*" log \
877 --decorate-refs="heads/*" \
878 -n6 --decorate=short --pretty="tformat:%f%d" >actual &&
65516f58
RA
879 test_cmp expect.decorate actual
880'
881
0cc7380d 882test_expect_success 'decorate-refs-exclude and simplify-by-decoration' '
b4ecbcf6 883 cat >expect.decorate <<-\EOF &&
21531927 884 Merge-tag-reach (HEAD -> master)
b4ecbcf6
RS
885 reach (tag: reach, reach)
886 seventh (tag: seventh)
21531927 887 Merge-branch-tangle
b4ecbcf6
RS
888 Merge-branch-side-early-part-into-tangle (tangle)
889 tangle-a (tag: tangle-a)
890 EOF
891 git log -n6 --decorate=short --pretty="tformat:%f%d" \
892 --decorate-refs-exclude="*octopus*" \
893 --simplify-by-decoration >actual &&
a6be5e67
DS
894 test_cmp expect.decorate actual &&
895 git -c log.excludeDecoration="*octopus*" log \
896 -n6 --decorate=short --pretty="tformat:%f%d" \
897 --simplify-by-decoration >actual &&
b4ecbcf6
RS
898 test_cmp expect.decorate actual
899'
900
c74271aa 901test_expect_success 'log.decorate config parsing' '
902 git log --oneline --decorate=full >expect.full &&
903 git log --oneline --decorate=short >expect.short &&
904
905 test_config log.decorate full &&
906 test_config log.mailmap true &&
907 git log --oneline >actual &&
908 test_cmp expect.full actual &&
909 git log --oneline --decorate=short >actual &&
910 test_cmp expect.short actual
911'
912
940a911f 913test_expect_success TTY 'log output on a TTY' '
e433749d 914 git log --color --oneline --decorate >expect.short &&
940a911f
AH
915
916 test_terminal git log --oneline >actual &&
917 test_cmp expect.short actual
918'
919
0c47695a 920test_expect_success 'reflog is expected format' '
0c47695a
JS
921 git log -g --abbrev-commit --pretty=oneline >expect &&
922 git reflog >actual &&
923 test_cmp expect actual
924'
925
926test_expect_success 'whatchanged is expected format' '
927 git log --no-merges --raw >expect &&
928 git whatchanged >actual &&
929 test_cmp expect actual
930'
931
932test_expect_success 'log.abbrevCommit configuration' '
0c47695a
JS
933 git log --abbrev-commit >expect.log.abbrev &&
934 git log --no-abbrev-commit >expect.log.full &&
935 git log --pretty=raw >expect.log.raw &&
936 git reflog --abbrev-commit >expect.reflog.abbrev &&
937 git reflog --no-abbrev-commit >expect.reflog.full &&
938 git whatchanged --abbrev-commit >expect.whatchanged.abbrev &&
939 git whatchanged --no-abbrev-commit >expect.whatchanged.full &&
940
90e76b70 941 test_config log.abbrevCommit true &&
0c47695a
JS
942
943 git log >actual &&
944 test_cmp expect.log.abbrev actual &&
945 git log --no-abbrev-commit >actual &&
946 test_cmp expect.log.full actual &&
947
948 git log --pretty=raw >actual &&
949 test_cmp expect.log.raw actual &&
950
951 git reflog >actual &&
952 test_cmp expect.reflog.abbrev actual &&
953 git reflog --no-abbrev-commit >actual &&
954 test_cmp expect.reflog.full actual &&
955
956 git whatchanged >actual &&
957 test_cmp expect.whatchanged.abbrev actual &&
958 git whatchanged --no-abbrev-commit >actual &&
959 test_cmp expect.whatchanged.full actual
8a3d203b
JH
960'
961
65113121
ÆAB
962test_expect_success 'show added path under "--follow -M"' '
963 # This tests for a regression introduced in v1.7.2-rc0~103^2~2
964 test_create_repo regression &&
965 (
966 cd regression &&
967 test_commit needs-another-commit &&
968 test_commit foo.bar &&
969 git log -M --follow -p foo.bar.t &&
970 git log -M --follow --stat foo.bar.t &&
971 git log -M --follow --name-only foo.bar.t
972 )
973'
c65233fe 974
46ec510a
CB
975test_expect_success 'git log -c --follow' '
976 test_create_repo follow-c &&
977 (
978 cd follow-c &&
979 test_commit initial file original &&
980 git rm file &&
981 test_commit rename file2 original &&
982 git reset --hard initial &&
983 test_commit modify file foo &&
984 git merge -m merge rename &&
985 git log -c --follow file2
986 )
987'
988
e2c59667
LP
989cat >expect <<\EOF
990* commit COMMIT_OBJECT_NAME
991|\ Merge: MERGE_PARENTS
992| | Author: A U Thor <author@example.com>
993| |
994| | Merge HEADS DESCRIPTION
995| |
996| * commit COMMIT_OBJECT_NAME
997| | Author: A U Thor <author@example.com>
998| |
999| | reach
1000| | ---
dc801e71 1001| | reach.t | 1 +
e2c59667
LP
1002| | 1 file changed, 1 insertion(+)
1003| |
1004| | diff --git a/reach.t b/reach.t
1005| | new file mode 100644
cb78f4f0 1006| | index BEFORE..AFTER
e2c59667
LP
1007| | --- /dev/null
1008| | +++ b/reach.t
1009| | @@ -0,0 +1 @@
1010| | +reach
1011| |
1012| \
1013*-. \ commit COMMIT_OBJECT_NAME
1014|\ \ \ Merge: MERGE_PARENTS
1015| | | | Author: A U Thor <author@example.com>
1016| | | |
1017| | | | Merge HEADS DESCRIPTION
1018| | | |
1019| | * | commit COMMIT_OBJECT_NAME
1020| | |/ Author: A U Thor <author@example.com>
1021| | |
1022| | | octopus-b
1023| | | ---
dc801e71 1024| | | octopus-b.t | 1 +
e2c59667
LP
1025| | | 1 file changed, 1 insertion(+)
1026| | |
1027| | | diff --git a/octopus-b.t b/octopus-b.t
1028| | | new file mode 100644
cb78f4f0 1029| | | index BEFORE..AFTER
e2c59667
LP
1030| | | --- /dev/null
1031| | | +++ b/octopus-b.t
1032| | | @@ -0,0 +1 @@
1033| | | +octopus-b
1034| | |
1035| * | commit COMMIT_OBJECT_NAME
1036| |/ Author: A U Thor <author@example.com>
1037| |
1038| | octopus-a
1039| | ---
dc801e71 1040| | octopus-a.t | 1 +
e2c59667
LP
1041| | 1 file changed, 1 insertion(+)
1042| |
1043| | diff --git a/octopus-a.t b/octopus-a.t
1044| | new file mode 100644
cb78f4f0 1045| | index BEFORE..AFTER
e2c59667
LP
1046| | --- /dev/null
1047| | +++ b/octopus-a.t
1048| | @@ -0,0 +1 @@
1049| | +octopus-a
1050| |
1051* | commit COMMIT_OBJECT_NAME
1052|/ Author: A U Thor <author@example.com>
1053|
1054| seventh
1055| ---
dc801e71 1056| seventh.t | 1 +
e2c59667
LP
1057| 1 file changed, 1 insertion(+)
1058|
1059| diff --git a/seventh.t b/seventh.t
1060| new file mode 100644
cb78f4f0 1061| index BEFORE..AFTER
e2c59667
LP
1062| --- /dev/null
1063| +++ b/seventh.t
1064| @@ -0,0 +1 @@
1065| +seventh
1066|
1067* commit COMMIT_OBJECT_NAME
1068|\ Merge: MERGE_PARENTS
1069| | Author: A U Thor <author@example.com>
1070| |
21531927 1071| | Merge branch 'tangle'
e2c59667
LP
1072| |
1073| * commit COMMIT_OBJECT_NAME
1074| |\ Merge: MERGE_PARENTS
1075| | | Author: A U Thor <author@example.com>
1076| | |
1077| | | Merge branch 'side' (early part) into tangle
1078| | |
1079| * | commit COMMIT_OBJECT_NAME
1080| |\ \ Merge: MERGE_PARENTS
1081| | | | Author: A U Thor <author@example.com>
1082| | | |
1083| | | | Merge branch 'master' (early part) into tangle
1084| | | |
1085| * | | commit COMMIT_OBJECT_NAME
1086| | | | Author: A U Thor <author@example.com>
1087| | | |
1088| | | | tangle-a
1089| | | | ---
dc801e71 1090| | | | tangle-a | 1 +
e2c59667
LP
1091| | | | 1 file changed, 1 insertion(+)
1092| | | |
1093| | | | diff --git a/tangle-a b/tangle-a
1094| | | | new file mode 100644
cb78f4f0 1095| | | | index BEFORE..AFTER
e2c59667
LP
1096| | | | --- /dev/null
1097| | | | +++ b/tangle-a
1098| | | | @@ -0,0 +1 @@
1099| | | | +a
1100| | | |
1101* | | | commit COMMIT_OBJECT_NAME
1102|\ \ \ \ Merge: MERGE_PARENTS
1103| | | | | Author: A U Thor <author@example.com>
1104| | | | |
21531927 1105| | | | | Merge branch 'side'
e2c59667
LP
1106| | | | |
1107| * | | | commit COMMIT_OBJECT_NAME
1108| | |_|/ Author: A U Thor <author@example.com>
1109| |/| |
1110| | | | side-2
1111| | | | ---
dc801e71 1112| | | | 2 | 1 +
e2c59667
LP
1113| | | | 1 file changed, 1 insertion(+)
1114| | | |
1115| | | | diff --git a/2 b/2
1116| | | | new file mode 100644
cb78f4f0 1117| | | | index BEFORE..AFTER
e2c59667
LP
1118| | | | --- /dev/null
1119| | | | +++ b/2
1120| | | | @@ -0,0 +1 @@
1121| | | | +2
1122| | | |
1123| * | | commit COMMIT_OBJECT_NAME
1124| | | | Author: A U Thor <author@example.com>
1125| | | |
1126| | | | side-1
1127| | | | ---
dc801e71 1128| | | | 1 | 1 +
e2c59667
LP
1129| | | | 1 file changed, 1 insertion(+)
1130| | | |
1131| | | | diff --git a/1 b/1
1132| | | | new file mode 100644
cb78f4f0 1133| | | | index BEFORE..AFTER
e2c59667
LP
1134| | | | --- /dev/null
1135| | | | +++ b/1
1136| | | | @@ -0,0 +1 @@
1137| | | | +1
1138| | | |
1139* | | | commit COMMIT_OBJECT_NAME
1140| | | | Author: A U Thor <author@example.com>
1141| | | |
1142| | | | Second
1143| | | | ---
dc801e71 1144| | | | one | 1 +
e2c59667
LP
1145| | | | 1 file changed, 1 insertion(+)
1146| | | |
1147| | | | diff --git a/one b/one
1148| | | | new file mode 100644
cb78f4f0 1149| | | | index BEFORE..AFTER
e2c59667
LP
1150| | | | --- /dev/null
1151| | | | +++ b/one
1152| | | | @@ -0,0 +1 @@
1153| | | | +case
1154| | | |
1155* | | | commit COMMIT_OBJECT_NAME
1156| |_|/ Author: A U Thor <author@example.com>
1157|/| |
1158| | | sixth
1159| | | ---
dc801e71 1160| | | a/two | 1 -
e2c59667
LP
1161| | | 1 file changed, 1 deletion(-)
1162| | |
1163| | | diff --git a/a/two b/a/two
1164| | | deleted file mode 100644
cb78f4f0 1165| | | index BEFORE..AFTER
e2c59667
LP
1166| | | --- a/a/two
1167| | | +++ /dev/null
1168| | | @@ -1 +0,0 @@
1169| | | -ni
1170| | |
1171* | | commit COMMIT_OBJECT_NAME
1172| | | Author: A U Thor <author@example.com>
1173| | |
1174| | | fifth
1175| | | ---
dc801e71 1176| | | a/two | 1 +
e2c59667
LP
1177| | | 1 file changed, 1 insertion(+)
1178| | |
1179| | | diff --git a/a/two b/a/two
1180| | | new file mode 100644
cb78f4f0 1181| | | index BEFORE..AFTER
e2c59667
LP
1182| | | --- /dev/null
1183| | | +++ b/a/two
1184| | | @@ -0,0 +1 @@
1185| | | +ni
1186| | |
1187* | | commit COMMIT_OBJECT_NAME
1188|/ / Author: A U Thor <author@example.com>
1189| |
1190| | fourth
1191| | ---
dc801e71 1192| | ein | 1 +
e2c59667
LP
1193| | 1 file changed, 1 insertion(+)
1194| |
1195| | diff --git a/ein b/ein
1196| | new file mode 100644
cb78f4f0 1197| | index BEFORE..AFTER
e2c59667
LP
1198| | --- /dev/null
1199| | +++ b/ein
1200| | @@ -0,0 +1 @@
1201| | +ichi
1202| |
1203* | commit COMMIT_OBJECT_NAME
1204|/ Author: A U Thor <author@example.com>
1205|
1206| third
1207| ---
dc801e71
ZJS
1208| ichi | 1 +
1209| one | 1 -
e2c59667
LP
1210| 2 files changed, 1 insertion(+), 1 deletion(-)
1211|
1212| diff --git a/ichi b/ichi
1213| new file mode 100644
cb78f4f0 1214| index BEFORE..AFTER
e2c59667
LP
1215| --- /dev/null
1216| +++ b/ichi
1217| @@ -0,0 +1 @@
1218| +ichi
1219| diff --git a/one b/one
1220| deleted file mode 100644
cb78f4f0 1221| index BEFORE..AFTER
e2c59667
LP
1222| --- a/one
1223| +++ /dev/null
1224| @@ -1 +0,0 @@
1225| -ichi
1226|
1227* commit COMMIT_OBJECT_NAME
1228| Author: A U Thor <author@example.com>
1229|
1230| second
1231| ---
dc801e71 1232| one | 2 +-
e2c59667
LP
1233| 1 file changed, 1 insertion(+), 1 deletion(-)
1234|
1235| diff --git a/one b/one
cb78f4f0 1236| index BEFORE..AFTER 100644
e2c59667
LP
1237| --- a/one
1238| +++ b/one
1239| @@ -1 +1 @@
1240| -one
1241| +ichi
1242|
1243* commit COMMIT_OBJECT_NAME
1244 Author: A U Thor <author@example.com>
1245
1246 initial
1247 ---
dc801e71 1248 one | 1 +
e2c59667
LP
1249 1 file changed, 1 insertion(+)
1250
1251 diff --git a/one b/one
1252 new file mode 100644
cb78f4f0 1253 index BEFORE..AFTER
e2c59667
LP
1254 --- /dev/null
1255 +++ b/one
1256 @@ -0,0 +1 @@
1257 +one
1258EOF
1259
e2c59667 1260test_expect_success 'log --graph with diff and stats' '
989eea95 1261 lib_test_cmp_short_graph --no-renames --stat -p
e2c59667
LP
1262'
1263
660e113c
JK
1264cat >expect <<\EOF
1265*** * commit COMMIT_OBJECT_NAME
1266*** |\ Merge: MERGE_PARENTS
1267*** | | Author: A U Thor <author@example.com>
1268*** | |
1269*** | | Merge HEADS DESCRIPTION
1270*** | |
1271*** | * commit COMMIT_OBJECT_NAME
1272*** | | Author: A U Thor <author@example.com>
1273*** | |
1274*** | | reach
1275*** | | ---
1276*** | | reach.t | 1 +
1277*** | | 1 file changed, 1 insertion(+)
1278*** | |
1279*** | | diff --git a/reach.t b/reach.t
1280*** | | new file mode 100644
cb78f4f0 1281*** | | index BEFORE..AFTER
660e113c
JK
1282*** | | --- /dev/null
1283*** | | +++ b/reach.t
1284*** | | @@ -0,0 +1 @@
1285*** | | +reach
1286*** | |
1287*** | \
1288*** *-. \ commit COMMIT_OBJECT_NAME
1289*** |\ \ \ Merge: MERGE_PARENTS
1290*** | | | | Author: A U Thor <author@example.com>
1291*** | | | |
1292*** | | | | Merge HEADS DESCRIPTION
1293*** | | | |
1294*** | | * | commit COMMIT_OBJECT_NAME
1295*** | | |/ Author: A U Thor <author@example.com>
1296*** | | |
1297*** | | | octopus-b
1298*** | | | ---
1299*** | | | octopus-b.t | 1 +
1300*** | | | 1 file changed, 1 insertion(+)
1301*** | | |
1302*** | | | diff --git a/octopus-b.t b/octopus-b.t
1303*** | | | new file mode 100644
cb78f4f0 1304*** | | | index BEFORE..AFTER
660e113c
JK
1305*** | | | --- /dev/null
1306*** | | | +++ b/octopus-b.t
1307*** | | | @@ -0,0 +1 @@
1308*** | | | +octopus-b
1309*** | | |
1310*** | * | commit COMMIT_OBJECT_NAME
1311*** | |/ Author: A U Thor <author@example.com>
1312*** | |
1313*** | | octopus-a
1314*** | | ---
1315*** | | octopus-a.t | 1 +
1316*** | | 1 file changed, 1 insertion(+)
1317*** | |
1318*** | | diff --git a/octopus-a.t b/octopus-a.t
1319*** | | new file mode 100644
cb78f4f0 1320*** | | index BEFORE..AFTER
660e113c
JK
1321*** | | --- /dev/null
1322*** | | +++ b/octopus-a.t
1323*** | | @@ -0,0 +1 @@
1324*** | | +octopus-a
1325*** | |
1326*** * | commit COMMIT_OBJECT_NAME
1327*** |/ Author: A U Thor <author@example.com>
1328*** |
1329*** | seventh
1330*** | ---
1331*** | seventh.t | 1 +
1332*** | 1 file changed, 1 insertion(+)
1333*** |
1334*** | diff --git a/seventh.t b/seventh.t
1335*** | new file mode 100644
cb78f4f0 1336*** | index BEFORE..AFTER
660e113c
JK
1337*** | --- /dev/null
1338*** | +++ b/seventh.t
1339*** | @@ -0,0 +1 @@
1340*** | +seventh
1341*** |
1342*** * commit COMMIT_OBJECT_NAME
1343*** |\ Merge: MERGE_PARENTS
1344*** | | Author: A U Thor <author@example.com>
1345*** | |
21531927 1346*** | | Merge branch 'tangle'
660e113c
JK
1347*** | |
1348*** | * commit COMMIT_OBJECT_NAME
1349*** | |\ Merge: MERGE_PARENTS
1350*** | | | Author: A U Thor <author@example.com>
1351*** | | |
1352*** | | | Merge branch 'side' (early part) into tangle
1353*** | | |
1354*** | * | commit COMMIT_OBJECT_NAME
1355*** | |\ \ Merge: MERGE_PARENTS
1356*** | | | | Author: A U Thor <author@example.com>
1357*** | | | |
1358*** | | | | Merge branch 'master' (early part) into tangle
1359*** | | | |
1360*** | * | | commit COMMIT_OBJECT_NAME
1361*** | | | | Author: A U Thor <author@example.com>
1362*** | | | |
1363*** | | | | tangle-a
1364*** | | | | ---
1365*** | | | | tangle-a | 1 +
1366*** | | | | 1 file changed, 1 insertion(+)
1367*** | | | |
1368*** | | | | diff --git a/tangle-a b/tangle-a
1369*** | | | | new file mode 100644
cb78f4f0 1370*** | | | | index BEFORE..AFTER
660e113c
JK
1371*** | | | | --- /dev/null
1372*** | | | | +++ b/tangle-a
1373*** | | | | @@ -0,0 +1 @@
1374*** | | | | +a
1375*** | | | |
1376*** * | | | commit COMMIT_OBJECT_NAME
1377*** |\ \ \ \ Merge: MERGE_PARENTS
1378*** | | | | | Author: A U Thor <author@example.com>
1379*** | | | | |
21531927 1380*** | | | | | Merge branch 'side'
660e113c
JK
1381*** | | | | |
1382*** | * | | | commit COMMIT_OBJECT_NAME
1383*** | | |_|/ Author: A U Thor <author@example.com>
1384*** | |/| |
1385*** | | | | side-2
1386*** | | | | ---
1387*** | | | | 2 | 1 +
1388*** | | | | 1 file changed, 1 insertion(+)
1389*** | | | |
1390*** | | | | diff --git a/2 b/2
1391*** | | | | new file mode 100644
cb78f4f0 1392*** | | | | index BEFORE..AFTER
660e113c
JK
1393*** | | | | --- /dev/null
1394*** | | | | +++ b/2
1395*** | | | | @@ -0,0 +1 @@
1396*** | | | | +2
1397*** | | | |
1398*** | * | | commit COMMIT_OBJECT_NAME
1399*** | | | | Author: A U Thor <author@example.com>
1400*** | | | |
1401*** | | | | side-1
1402*** | | | | ---
1403*** | | | | 1 | 1 +
1404*** | | | | 1 file changed, 1 insertion(+)
1405*** | | | |
1406*** | | | | diff --git a/1 b/1
1407*** | | | | new file mode 100644
cb78f4f0 1408*** | | | | index BEFORE..AFTER
660e113c
JK
1409*** | | | | --- /dev/null
1410*** | | | | +++ b/1
1411*** | | | | @@ -0,0 +1 @@
1412*** | | | | +1
1413*** | | | |
1414*** * | | | commit COMMIT_OBJECT_NAME
1415*** | | | | Author: A U Thor <author@example.com>
1416*** | | | |
1417*** | | | | Second
1418*** | | | | ---
1419*** | | | | one | 1 +
1420*** | | | | 1 file changed, 1 insertion(+)
1421*** | | | |
1422*** | | | | diff --git a/one b/one
1423*** | | | | new file mode 100644
cb78f4f0 1424*** | | | | index BEFORE..AFTER
660e113c
JK
1425*** | | | | --- /dev/null
1426*** | | | | +++ b/one
1427*** | | | | @@ -0,0 +1 @@
1428*** | | | | +case
1429*** | | | |
1430*** * | | | commit COMMIT_OBJECT_NAME
1431*** | |_|/ Author: A U Thor <author@example.com>
1432*** |/| |
1433*** | | | sixth
1434*** | | | ---
1435*** | | | a/two | 1 -
1436*** | | | 1 file changed, 1 deletion(-)
1437*** | | |
1438*** | | | diff --git a/a/two b/a/two
1439*** | | | deleted file mode 100644
cb78f4f0 1440*** | | | index BEFORE..AFTER
660e113c
JK
1441*** | | | --- a/a/two
1442*** | | | +++ /dev/null
1443*** | | | @@ -1 +0,0 @@
1444*** | | | -ni
1445*** | | |
1446*** * | | commit COMMIT_OBJECT_NAME
1447*** | | | Author: A U Thor <author@example.com>
1448*** | | |
1449*** | | | fifth
1450*** | | | ---
1451*** | | | a/two | 1 +
1452*** | | | 1 file changed, 1 insertion(+)
1453*** | | |
1454*** | | | diff --git a/a/two b/a/two
1455*** | | | new file mode 100644
cb78f4f0 1456*** | | | index BEFORE..AFTER
660e113c
JK
1457*** | | | --- /dev/null
1458*** | | | +++ b/a/two
1459*** | | | @@ -0,0 +1 @@
1460*** | | | +ni
1461*** | | |
1462*** * | | commit COMMIT_OBJECT_NAME
1463*** |/ / Author: A U Thor <author@example.com>
1464*** | |
1465*** | | fourth
1466*** | | ---
1467*** | | ein | 1 +
1468*** | | 1 file changed, 1 insertion(+)
1469*** | |
1470*** | | diff --git a/ein b/ein
1471*** | | new file mode 100644
cb78f4f0 1472*** | | index BEFORE..AFTER
660e113c
JK
1473*** | | --- /dev/null
1474*** | | +++ b/ein
1475*** | | @@ -0,0 +1 @@
1476*** | | +ichi
1477*** | |
1478*** * | commit COMMIT_OBJECT_NAME
1479*** |/ Author: A U Thor <author@example.com>
1480*** |
1481*** | third
1482*** | ---
1483*** | ichi | 1 +
1484*** | one | 1 -
1485*** | 2 files changed, 1 insertion(+), 1 deletion(-)
1486*** |
1487*** | diff --git a/ichi b/ichi
1488*** | new file mode 100644
cb78f4f0 1489*** | index BEFORE..AFTER
660e113c
JK
1490*** | --- /dev/null
1491*** | +++ b/ichi
1492*** | @@ -0,0 +1 @@
1493*** | +ichi
1494*** | diff --git a/one b/one
1495*** | deleted file mode 100644
cb78f4f0 1496*** | index BEFORE..AFTER
660e113c
JK
1497*** | --- a/one
1498*** | +++ /dev/null
1499*** | @@ -1 +0,0 @@
1500*** | -ichi
1501*** |
1502*** * commit COMMIT_OBJECT_NAME
1503*** | Author: A U Thor <author@example.com>
1504*** |
1505*** | second
1506*** | ---
1507*** | one | 2 +-
1508*** | 1 file changed, 1 insertion(+), 1 deletion(-)
1509*** |
1510*** | diff --git a/one b/one
cb78f4f0 1511*** | index BEFORE..AFTER 100644
660e113c
JK
1512*** | --- a/one
1513*** | +++ b/one
1514*** | @@ -1 +1 @@
1515*** | -one
1516*** | +ichi
1517*** |
1518*** * commit COMMIT_OBJECT_NAME
1519*** Author: A U Thor <author@example.com>
1520***
1521*** initial
1522*** ---
1523*** one | 1 +
1524*** 1 file changed, 1 insertion(+)
1525***
1526*** diff --git a/one b/one
1527*** new file mode 100644
cb78f4f0 1528*** index BEFORE..AFTER
660e113c
JK
1529*** --- /dev/null
1530*** +++ b/one
1531*** @@ -0,0 +1 @@
1532*** +one
1533EOF
1534
1535test_expect_success 'log --line-prefix="*** " --graph with diff and stats' '
989eea95 1536 lib_test_cmp_short_graph --line-prefix="*** " --no-renames --stat -p
660e113c
JK
1537'
1538
f5022b5f
JK
1539cat >expect <<-\EOF
1540* reach
1541|
1542| A reach.t
21531927
JH
1543* Merge branch 'tangle'
1544* Merge branch 'side'
f5022b5f
JK
1545|\
1546| * side-2
1547|
1548| A 2
1549* Second
1550|
1551| A one
1552* sixth
1553
1554 D a/two
1555EOF
1556
1557test_expect_success 'log --graph with --name-status' '
989eea95 1558 test_cmp_graph --name-status tangle..reach
f5022b5f
JK
1559'
1560
1561cat >expect <<-\EOF
1562* reach
1563|
1564| reach.t
21531927
JH
1565* Merge branch 'tangle'
1566* Merge branch 'side'
f5022b5f
JK
1567|\
1568| * side-2
1569|
1570| 2
1571* Second
1572|
1573| one
1574* sixth
1575
1576 a/two
1577EOF
1578
1579test_expect_success 'log --graph with --name-only' '
989eea95 1580 test_cmp_graph --name-only tangle..reach
f5022b5f
JK
1581'
1582
003c84f6
JH
1583test_expect_success 'dotdot is a parent directory' '
1584 mkdir -p a/b &&
1585 ( echo sixth && echo fifth ) >expect &&
1586 ( cd a/b && git log --format=%s .. ) >actual &&
1587 test_cmp expect actual
1588'
1589
aefc81ad 1590test_expect_success GPG 'setup signed branch' '
cf3983d1
ZK
1591 test_when_finished "git reset --hard && git checkout master" &&
1592 git checkout -b signed master &&
1593 echo foo >foo &&
1594 git add foo &&
aefc81ad
MJ
1595 git commit -S -m signed_commit
1596'
1597
67a6ea63
HJI
1598test_expect_success GPG 'setup signed branch with subkey' '
1599 test_when_finished "git reset --hard && git checkout master" &&
1600 git checkout -b signed-subkey master &&
1601 echo foo >foo &&
1602 git add foo &&
1603 git commit -SB7227189 -m signed_commit
1604'
1605
53fc9993
HS
1606test_expect_success GPGSM 'setup signed branch x509' '
1607 test_when_finished "git reset --hard && git checkout master" &&
1608 git checkout -b signed-x509 master &&
1609 echo foo >foo &&
1610 git add foo &&
1611 test_config gpg.format x509 &&
1612 test_config user.signingkey $GIT_COMMITTER_EMAIL &&
1613 git commit -S -m signed_commit
1614'
1615
67a6ea63
HJI
1616test_expect_success GPGSM 'log x509 fingerprint' '
1617 echo "F8BF62E0693D0694816377099909C779FA23FD65 | " >expect &&
1618 git log -n1 --format="%GF | %GP" signed-x509 >actual &&
1619 test_cmp expect actual
1620'
1621
1622test_expect_success GPGSM 'log OpenPGP fingerprint' '
1623 echo "D4BE22311AD3131E5EDA29A461092E85B7227189" > expect &&
1624 git log -n1 --format="%GP" signed-subkey >actual &&
1625 test_cmp expect actual
1626'
1627
aefc81ad 1628test_expect_success GPG 'log --graph --show-signature' '
cf3983d1
ZK
1629 git log --graph --show-signature -n1 signed >actual &&
1630 grep "^| gpg: Signature made" actual &&
1631 grep "^| gpg: Good signature" actual
1632'
1633
53fc9993
HS
1634test_expect_success GPGSM 'log --graph --show-signature x509' '
1635 git log --graph --show-signature -n1 signed-x509 >actual &&
1636 grep "^| gpgsm: Signature made" actual &&
1637 grep "^| gpgsm: Good signature" actual
1638'
1639
cf3983d1
ZK
1640test_expect_success GPG 'log --graph --show-signature for merged tag' '
1641 test_when_finished "git reset --hard && git checkout master" &&
1642 git checkout -b plain master &&
1643 echo aaa >bar &&
1644 git add bar &&
1645 git commit -m bar_commit &&
1646 git checkout -b tagged master &&
1647 echo bbb >baz &&
1648 git add baz &&
1649 git commit -m baz_commit &&
1650 git tag -s -m signed_tag_msg signed_tag &&
1651 git checkout plain &&
1652 git merge --no-ff -m msg signed_tag &&
1653 git log --graph --show-signature -n1 plain >actual &&
1654 grep "^|\\\ merged tag" actual &&
1655 grep "^| | gpg: Signature made" actual &&
1656 grep "^| | gpg: Good signature" actual
1657'
1658
237a2817
HD
1659test_expect_success GPG 'log --graph --show-signature for merged tag in shallow clone' '
1660 test_when_finished "git reset --hard && git checkout master" &&
1661 git checkout -b plain-shallow master &&
1662 echo aaa >bar &&
1663 git add bar &&
1664 git commit -m bar_commit &&
1665 git checkout --detach master &&
1666 echo bbb >baz &&
1667 git add baz &&
1668 git commit -m baz_commit &&
1669 git tag -s -m signed_tag_msg signed_tag_shallow &&
1670 hash=$(git rev-parse HEAD) &&
1671 git checkout plain-shallow &&
1672 git merge --no-ff -m msg signed_tag_shallow &&
1673 git clone --depth 1 --no-local . shallow &&
1674 test_when_finished "rm -rf shallow" &&
1675 git -C shallow log --graph --show-signature -n1 plain-shallow >actual &&
1676 grep "tag signed_tag_shallow names a non-parent $hash" actual
1677'
1678
f1e3df31
HJI
1679test_expect_success GPG 'log --graph --show-signature for merged tag with missing key' '
1680 test_when_finished "git reset --hard && git checkout master" &&
1681 git checkout -b plain-nokey master &&
1682 echo aaa >bar &&
1683 git add bar &&
1684 git commit -m bar_commit &&
1685 git checkout -b tagged-nokey master &&
1686 echo bbb >baz &&
1687 git add baz &&
1688 git commit -m baz_commit &&
1689 git tag -s -m signed_tag_msg signed_tag_nokey &&
1690 git checkout plain-nokey &&
1691 git merge --no-ff -m msg signed_tag_nokey &&
1692 GNUPGHOME=. git log --graph --show-signature -n1 plain-nokey >actual &&
1693 grep "^|\\\ merged tag" actual &&
1694 grep "^| | gpg: Signature made" actual &&
46022ca3 1695 grep -E "^| | gpg: Can'"'"'t check signature: (public key not found|No public key)" actual
f1e3df31
HJI
1696'
1697
1698test_expect_success GPG 'log --graph --show-signature for merged tag with bad signature' '
1699 test_when_finished "git reset --hard && git checkout master" &&
1700 git checkout -b plain-bad master &&
1701 echo aaa >bar &&
1702 git add bar &&
1703 git commit -m bar_commit &&
1704 git checkout -b tagged-bad master &&
1705 echo bbb >baz &&
1706 git add baz &&
1707 git commit -m baz_commit &&
1708 git tag -s -m signed_tag_msg signed_tag_bad &&
1709 git cat-file tag signed_tag_bad >raw &&
1710 sed -e "s/signed_tag_msg/forged/" raw >forged &&
1711 git hash-object -w -t tag forged >forged.tag &&
1712 git checkout plain-bad &&
1713 git merge --no-ff -m msg "$(cat forged.tag)" &&
1714 git log --graph --show-signature -n1 plain-bad >actual &&
1715 grep "^|\\\ merged tag" actual &&
1716 grep "^| | gpg: Signature made" actual &&
1717 grep "^| | gpg: BAD signature from" actual
1718'
1719
1720test_expect_success GPG 'log --show-signature for merged tag with GPG failure' '
1721 test_when_finished "git reset --hard && git checkout master" &&
1722 git checkout -b plain-fail master &&
1723 echo aaa >bar &&
1724 git add bar &&
1725 git commit -m bar_commit &&
1726 git checkout -b tagged-fail master &&
1727 echo bbb >baz &&
1728 git add baz &&
1729 git commit -m baz_commit &&
1730 git tag -s -m signed_tag_msg signed_tag_fail &&
1731 git checkout plain-fail &&
1732 git merge --no-ff -m msg signed_tag_fail &&
1733 TMPDIR="$(pwd)/bogus" git log --show-signature -n1 plain-fail >actual &&
1734 grep "^merged tag" actual &&
1735 grep "^No signature" actual &&
1736 ! grep "^gpg: Signature made" actual
1737'
1738
53fc9993
HS
1739test_expect_success GPGSM 'log --graph --show-signature for merged tag x509' '
1740 test_when_finished "git reset --hard && git checkout master" &&
1741 test_config gpg.format x509 &&
1742 test_config user.signingkey $GIT_COMMITTER_EMAIL &&
1743 git checkout -b plain-x509 master &&
1744 echo aaa >bar &&
1745 git add bar &&
1746 git commit -m bar_commit &&
1747 git checkout -b tagged-x509 master &&
1748 echo bbb >baz &&
1749 git add baz &&
1750 git commit -m baz_commit &&
1751 git tag -s -m signed_tag_msg signed_tag_x509 &&
1752 git checkout plain-x509 &&
1753 git merge --no-ff -m msg signed_tag_x509 &&
1754 git log --graph --show-signature -n1 plain-x509 >actual &&
1755 grep "^|\\\ merged tag" actual &&
1756 grep "^| | gpgsm: Signature made" actual &&
1757 grep "^| | gpgsm: Good signature" actual
1758'
1759
f1e3df31
HJI
1760test_expect_success GPGSM 'log --graph --show-signature for merged tag x509 missing key' '
1761 test_when_finished "git reset --hard && git checkout master" &&
1762 test_config gpg.format x509 &&
1763 test_config user.signingkey $GIT_COMMITTER_EMAIL &&
1764 git checkout -b plain-x509-nokey master &&
1765 echo aaa >bar &&
1766 git add bar &&
1767 git commit -m bar_commit &&
1768 git checkout -b tagged-x509-nokey master &&
1769 echo bbb >baz &&
1770 git add baz &&
1771 git commit -m baz_commit &&
1772 git tag -s -m signed_tag_msg signed_tag_x509_nokey &&
1773 git checkout plain-x509-nokey &&
1774 git merge --no-ff -m msg signed_tag_x509_nokey &&
1775 GNUPGHOME=. git log --graph --show-signature -n1 plain-x509-nokey >actual &&
1776 grep "^|\\\ merged tag" actual &&
1777 grep "^| | gpgsm: certificate not found" actual
1778'
1779
1780test_expect_success GPGSM 'log --graph --show-signature for merged tag x509 bad signature' '
1781 test_when_finished "git reset --hard && git checkout master" &&
1782 test_config gpg.format x509 &&
1783 test_config user.signingkey $GIT_COMMITTER_EMAIL &&
1784 git checkout -b plain-x509-bad master &&
1785 echo aaa >bar &&
1786 git add bar &&
1787 git commit -m bar_commit &&
1788 git checkout -b tagged-x509-bad master &&
1789 echo bbb >baz &&
1790 git add baz &&
1791 git commit -m baz_commit &&
1792 git tag -s -m signed_tag_msg signed_tag_x509_bad &&
1793 git cat-file tag signed_tag_x509_bad >raw &&
1794 sed -e "s/signed_tag_msg/forged/" raw >forged &&
1795 git hash-object -w -t tag forged >forged.tag &&
1796 git checkout plain-x509-bad &&
1797 git merge --no-ff -m msg "$(cat forged.tag)" &&
1798 git log --graph --show-signature -n1 plain-x509-bad >actual &&
1799 grep "^|\\\ merged tag" actual &&
1800 grep "^| | gpgsm: Signature made" actual &&
1801 grep "^| | gpgsm: invalid signature" actual
1802'
1803
1804
aa379999
MJ
1805test_expect_success GPG '--no-show-signature overrides --show-signature' '
1806 git log -1 --show-signature --no-show-signature signed >actual &&
1807 ! grep "^gpg:" actual
1808'
1809
fce04c3c
MJ
1810test_expect_success GPG 'log.showsignature=true behaves like --show-signature' '
1811 test_config log.showsignature true &&
1812 git log -1 signed >actual &&
1813 grep "gpg: Signature made" actual &&
1814 grep "gpg: Good signature" actual
1815'
1816
1817test_expect_success GPG '--no-show-signature overrides log.showsignature=true' '
1818 test_config log.showsignature true &&
1819 git log -1 --no-show-signature signed >actual &&
1820 ! grep "^gpg:" actual
1821'
1822
1823test_expect_success GPG '--show-signature overrides log.showsignature=false' '
1824 test_config log.showsignature false &&
1825 git log -1 --show-signature signed >actual &&
1826 grep "gpg: Signature made" actual &&
1827 grep "gpg: Good signature" actual
1828'
1829
695985f4
DJ
1830test_expect_success 'log --graph --no-walk is forbidden' '
1831 test_must_fail git log --graph --no-walk
1832'
1833
ce113604
JK
1834test_expect_success 'log diagnoses bogus HEAD' '
1835 git init empty &&
1836 test_must_fail git -C empty log 2>stderr &&
1837 test_i18ngrep does.not.have.any.commits stderr &&
1838 echo 1234abcd >empty/.git/refs/heads/master &&
1839 test_must_fail git -C empty log 2>stderr &&
1840 test_i18ngrep broken stderr &&
1841 echo "ref: refs/heads/invalid.lock" >empty/.git/HEAD &&
1842 test_must_fail git -C empty log 2>stderr &&
1843 test_i18ngrep broken stderr &&
1844 test_must_fail git -C empty log --default totally-bogus 2>stderr &&
1845 test_i18ngrep broken stderr
1846'
1847
5d34d1ac 1848test_expect_success 'log does not default to HEAD when rev input is given' '
5d34d1ac 1849 git log --branches=does-not-exist >actual &&
d3c6751b 1850 test_must_be_empty actual
5d34d1ac
JK
1851'
1852
728350b7
JK
1853test_expect_success 'set up --source tests' '
1854 git checkout --orphan source-a &&
1855 test_commit one &&
1856 test_commit two &&
1857 git checkout -b source-b HEAD^ &&
1858 test_commit three
1859'
1860
1861test_expect_success 'log --source paints branch names' '
cb78f4f0 1862 cat >expect <<-EOF &&
1863 $(git rev-parse --short :/three) source-b three
1864 $(git rev-parse --short :/two ) source-a two
1865 $(git rev-parse --short :/one ) source-b one
728350b7
JK
1866 EOF
1867 git log --oneline --source source-a source-b >actual &&
1868 test_cmp expect actual
1869'
1870
1871test_expect_success 'log --source paints tag names' '
1872 git tag -m tagged source-tag &&
cb78f4f0 1873 cat >expect <<-EOF &&
1874 $(git rev-parse --short :/three) source-tag three
1875 $(git rev-parse --short :/two ) source-a two
1876 $(git rev-parse --short :/one ) source-tag one
728350b7
JK
1877 EOF
1878 git log --oneline --source source-tag source-a >actual &&
1879 test_cmp expect actual
1880'
1881
ed79b2cf 1882test_expect_success 'log --source paints symmetric ranges' '
cb78f4f0 1883 cat >expect <<-EOF &&
1884 $(git rev-parse --short :/three) source-b three
1885 $(git rev-parse --short :/two ) source-a two
ed79b2cf
JK
1886 EOF
1887 git log --oneline --source source-a...source-b >actual &&
1888 test_cmp expect actual
1889'
1890
669b1d2a
MD
1891test_expect_success '--exclude-promisor-objects does not BUG-crash' '
1892 test_must_fail git log --exclude-promisor-objects source-a
1893'
1894
51b4594b
JK
1895test_expect_success 'log --end-of-options' '
1896 git update-ref refs/heads/--source HEAD &&
1897 git log --end-of-options --source >actual &&
1898 git log >expect &&
1899 test_cmp expect actual
1900'
1901
65113121 1902test_done