]>
Commit | Line | Data |
---|---|---|
0faf2da7 AL |
1 | #!/bin/sh |
2 | ||
3 | test_description='git log' | |
4 | ||
5 | . ./test-lib.sh | |
6 | ||
7 | test_expect_success setup ' | |
8 | ||
9 | echo one >one && | |
10 | git add one && | |
11 | test_tick && | |
12 | git commit -m initial && | |
13 | ||
14 | echo ichi >one && | |
15 | git add one && | |
16 | test_tick && | |
17 | git commit -m second && | |
18 | ||
d9305089 | 19 | git mv one ichi && |
0faf2da7 AL |
20 | test_tick && |
21 | git commit -m third && | |
22 | ||
d9305089 AL |
23 | cp ichi ein && |
24 | git add ein && | |
0faf2da7 AL |
25 | test_tick && |
26 | git commit -m fourth && | |
27 | ||
d9305089 AL |
28 | mkdir a && |
29 | echo ni >a/two && | |
30 | git add a/two && | |
31 | test_tick && | |
32 | git commit -m fifth && | |
33 | ||
34 | git rm a/two && | |
0faf2da7 | 35 | test_tick && |
d9305089 | 36 | git commit -m sixth |
0faf2da7 AL |
37 | |
38 | ' | |
39 | ||
bb93afd5 FC |
40 | printf "sixth\nfifth\nfourth\nthird\nsecond\ninitial" > expect |
41 | test_expect_success 'pretty' ' | |
42 | ||
43 | git log --pretty="format:%s" > actual && | |
44 | test_cmp expect actual | |
45 | ' | |
46 | ||
47 | printf "sixth\nfifth\nfourth\nthird\nsecond\ninitial\n" > expect | |
48 | test_expect_success 'pretty (tformat)' ' | |
49 | ||
50 | git log --pretty="tformat:%s" > actual && | |
51 | test_cmp expect actual | |
52 | ' | |
53 | ||
54 | test_expect_success 'pretty (shortcut)' ' | |
55 | ||
56 | git log --pretty="%s" > actual && | |
57 | test_cmp expect actual | |
58 | ' | |
59 | ||
60 | test_expect_success 'format' ' | |
61 | ||
62 | git log --format="%s" > actual && | |
63 | test_cmp expect actual | |
64 | ' | |
65 | ||
37bb5d74 RS |
66 | cat > expect << EOF |
67 | This is | |
68 | the sixth | |
69 | commit. | |
70 | This is | |
71 | the fifth | |
72 | commit. | |
73 | EOF | |
74 | ||
14e1a4e1 | 75 | test_expect_success 'format %w(11,1,2)' ' |
37bb5d74 | 76 | |
14e1a4e1 | 77 | git log -2 --format="%w(11,1,2)This is the %s commit." > actual && |
37bb5d74 RS |
78 | test_cmp expect actual |
79 | ' | |
80 | ||
81 | test_expect_success 'format %w(,1,2)' ' | |
82 | ||
83 | git log -2 --format="%w(,1,2)This is%nthe %s%ncommit." > actual && | |
84 | test_cmp expect actual | |
85 | ' | |
86 | ||
bb93afd5 FC |
87 | cat > expect << EOF |
88 | 804a787 sixth | |
89 | 394ef78 fifth | |
90 | 5d31159 fourth | |
91 | 2fbe8c0 third | |
92 | f7dab8e second | |
93 | 3a2fdcb initial | |
94 | EOF | |
95 | test_expect_success 'oneline' ' | |
96 | ||
97 | git log --oneline > actual && | |
98 | test_cmp expect actual | |
99 | ' | |
100 | ||
0faf2da7 AL |
101 | test_expect_success 'diff-filter=A' ' |
102 | ||
dea007fb MM |
103 | git log --pretty="format:%s" --diff-filter=A HEAD > actual && |
104 | git log --pretty="format:%s" --diff-filter A HEAD > actual-separate && | |
105 | printf "fifth\nfourth\nthird\ninitial" > expect && | |
106 | test_cmp expect actual && | |
107 | test_cmp expect actual-separate | |
0faf2da7 AL |
108 | |
109 | ' | |
110 | ||
111 | test_expect_success 'diff-filter=M' ' | |
112 | ||
113 | actual=$(git log --pretty="format:%s" --diff-filter=M HEAD) && | |
114 | expect=$(echo second) && | |
115 | test "$actual" = "$expect" || { | |
116 | echo Oops | |
117 | echo "Actual: $actual" | |
118 | false | |
119 | } | |
120 | ||
121 | ' | |
122 | ||
123 | test_expect_success 'diff-filter=D' ' | |
124 | ||
125 | actual=$(git log --pretty="format:%s" --diff-filter=D HEAD) && | |
d9305089 AL |
126 | expect=$(echo sixth ; echo third) && |
127 | test "$actual" = "$expect" || { | |
128 | echo Oops | |
129 | echo "Actual: $actual" | |
130 | false | |
131 | } | |
132 | ||
133 | ' | |
134 | ||
135 | test_expect_success 'diff-filter=R' ' | |
136 | ||
137 | actual=$(git log -M --pretty="format:%s" --diff-filter=R HEAD) && | |
138 | expect=$(echo third) && | |
139 | test "$actual" = "$expect" || { | |
140 | echo Oops | |
141 | echo "Actual: $actual" | |
142 | false | |
143 | } | |
144 | ||
145 | ' | |
146 | ||
147 | test_expect_success 'diff-filter=C' ' | |
148 | ||
149 | actual=$(git log -C -C --pretty="format:%s" --diff-filter=C HEAD) && | |
150 | expect=$(echo fourth) && | |
151 | test "$actual" = "$expect" || { | |
152 | echo Oops | |
153 | echo "Actual: $actual" | |
154 | false | |
155 | } | |
156 | ||
157 | ' | |
158 | ||
159 | test_expect_success 'git log --follow' ' | |
160 | ||
161 | actual=$(git log --follow --pretty="format:%s" ichi) && | |
162 | expect=$(echo third ; echo second ; echo initial) && | |
0faf2da7 AL |
163 | test "$actual" = "$expect" || { |
164 | echo Oops | |
165 | echo "Actual: $actual" | |
166 | false | |
167 | } | |
168 | ||
169 | ' | |
170 | ||
d5cee0f7 MG |
171 | cat > expect << EOF |
172 | 804a787 sixth | |
173 | 394ef78 fifth | |
174 | 5d31159 fourth | |
175 | EOF | |
176 | test_expect_success 'git log --no-walk <commits> sorts by commit time' ' | |
177 | git log --no-walk --oneline 5d31159 804a787 394ef78 > actual && | |
178 | test_cmp expect actual | |
179 | ' | |
180 | ||
ca92e59e MZ |
181 | test_expect_success 'git log --no-walk=sorted <commits> sorts by commit time' ' |
182 | git log --no-walk=sorted --oneline 5d31159 804a787 394ef78 > actual && | |
183 | test_cmp expect actual | |
184 | ' | |
185 | ||
d5cee0f7 MG |
186 | cat > expect << EOF |
187 | 5d31159 fourth | |
188 | 804a787 sixth | |
189 | 394ef78 fifth | |
190 | EOF | |
ca92e59e MZ |
191 | test_expect_success 'git log --no-walk=unsorted <commits> leaves list of commits as given' ' |
192 | git log --no-walk=unsorted --oneline 5d31159 804a787 394ef78 > actual && | |
193 | test_cmp expect actual | |
194 | ' | |
195 | ||
d5cee0f7 MG |
196 | test_expect_success 'git show <commits> leaves list of commits as given' ' |
197 | git show --oneline -s 5d31159 804a787 394ef78 > actual && | |
198 | test_cmp expect actual | |
199 | ' | |
200 | ||
0843acfd JK |
201 | test_expect_success 'setup case sensitivity tests' ' |
202 | echo case >one && | |
203 | test_tick && | |
a48fcd83 | 204 | git add one && |
0843acfd JK |
205 | git commit -a -m Second |
206 | ' | |
207 | ||
208 | test_expect_success 'log --grep' ' | |
209 | echo second >expect && | |
210 | git log -1 --pretty="tformat:%s" --grep=sec >actual && | |
211 | test_cmp expect actual | |
212 | ' | |
0faf2da7 | 213 | |
7d7b86f7 MM |
214 | test_expect_success 'log --grep option parsing' ' |
215 | echo second >expect && | |
216 | git log -1 --pretty="tformat:%s" --grep sec >actual && | |
217 | test_cmp expect actual && | |
218 | test_must_fail git log -1 --pretty="tformat:%s" --grep | |
219 | ' | |
220 | ||
0843acfd JK |
221 | test_expect_success 'log -i --grep' ' |
222 | echo Second >expect && | |
223 | git log -1 --pretty="tformat:%s" -i --grep=sec >actual && | |
224 | test_cmp expect actual | |
225 | ' | |
226 | ||
227 | test_expect_success 'log --grep -i' ' | |
228 | echo Second >expect && | |
229 | git log -1 --pretty="tformat:%s" --grep=sec -i >actual && | |
230 | test_cmp expect actual | |
231 | ' | |
0faf2da7 | 232 | |
34a4ae55 JH |
233 | test_expect_success 'log -F -E --grep=<ere> uses ere' ' |
234 | echo second >expect && | |
235 | git log -1 --pretty="tformat:%s" -F -E --grep=s.c.nd >actual && | |
236 | test_cmp expect actual | |
237 | ' | |
238 | ||
289e1623 TR |
239 | cat > expect <<EOF |
240 | * Second | |
241 | * sixth | |
242 | * fifth | |
243 | * fourth | |
244 | * third | |
245 | * second | |
246 | * initial | |
247 | EOF | |
248 | ||
249 | test_expect_success 'simple log --graph' ' | |
250 | git log --graph --pretty=tformat:%s >actual && | |
251 | test_cmp expect actual | |
252 | ' | |
253 | ||
254 | test_expect_success 'set up merge history' ' | |
255 | git checkout -b side HEAD~4 && | |
256 | test_commit side-1 1 1 && | |
257 | test_commit side-2 2 2 && | |
258 | git checkout master && | |
259 | git merge side | |
260 | ' | |
261 | ||
262 | cat > expect <<\EOF | |
263 | * Merge branch 'side' | |
264 | |\ | |
265 | | * side-2 | |
266 | | * side-1 | |
267 | * | Second | |
268 | * | sixth | |
269 | * | fifth | |
270 | * | fourth | |
271 | |/ | |
272 | * third | |
273 | * second | |
274 | * initial | |
275 | EOF | |
276 | ||
277 | test_expect_success 'log --graph with merge' ' | |
278 | git log --graph --date-order --pretty=tformat:%s | | |
9524cf29 | 279 | sed "s/ *\$//" >actual && |
289e1623 TR |
280 | test_cmp expect actual |
281 | ' | |
282 | ||
656197ad MK |
283 | test_expect_success 'log --raw --graph -m with merge' ' |
284 | git log --raw --graph --oneline -m master | head -n 500 >actual && | |
285 | grep "initial" actual | |
286 | ' | |
287 | ||
288 | test_expect_success 'diff-tree --graph' ' | |
289 | git diff-tree --graph master^ | head -n 500 >actual && | |
290 | grep "one" actual | |
291 | ' | |
292 | ||
289e1623 TR |
293 | cat > expect <<\EOF |
294 | * commit master | |
295 | |\ Merge: A B | |
296 | | | Author: A U Thor <author@example.com> | |
297 | | | | |
298 | | | Merge branch 'side' | |
299 | | | | |
300 | | * commit side | |
301 | | | Author: A U Thor <author@example.com> | |
302 | | | | |
303 | | | side-2 | |
304 | | | | |
305 | | * commit tags/side-1 | |
306 | | | Author: A U Thor <author@example.com> | |
307 | | | | |
308 | | | side-1 | |
309 | | | | |
310 | * | commit master~1 | |
311 | | | Author: A U Thor <author@example.com> | |
312 | | | | |
313 | | | Second | |
314 | | | | |
315 | * | commit master~2 | |
316 | | | Author: A U Thor <author@example.com> | |
317 | | | | |
318 | | | sixth | |
319 | | | | |
320 | * | commit master~3 | |
321 | | | Author: A U Thor <author@example.com> | |
322 | | | | |
323 | | | fifth | |
324 | | | | |
325 | * | commit master~4 | |
326 | |/ Author: A U Thor <author@example.com> | |
327 | | | |
328 | | fourth | |
329 | | | |
330 | * commit tags/side-1~1 | |
331 | | Author: A U Thor <author@example.com> | |
332 | | | |
333 | | third | |
334 | | | |
335 | * commit tags/side-1~2 | |
336 | | Author: A U Thor <author@example.com> | |
337 | | | |
338 | | second | |
339 | | | |
340 | * commit tags/side-1~3 | |
341 | Author: A U Thor <author@example.com> | |
342 | ||
343 | initial | |
344 | EOF | |
345 | ||
346 | test_expect_success 'log --graph with full output' ' | |
347 | git log --graph --date-order --pretty=short | | |
348 | git name-rev --name-only --stdin | | |
9524cf29 | 349 | sed "s/Merge:.*/Merge: A B/;s/ *\$//" >actual && |
289e1623 TR |
350 | test_cmp expect actual |
351 | ' | |
352 | ||
353 | test_expect_success 'set up more tangled history' ' | |
354 | git checkout -b tangle HEAD~6 && | |
355 | test_commit tangle-a tangle-a a && | |
356 | git merge master~3 && | |
357 | git merge side~1 && | |
358 | git checkout master && | |
7b1d6269 AC |
359 | git merge tangle && |
360 | git checkout -b reach && | |
361 | test_commit reach && | |
362 | git checkout master && | |
363 | git checkout -b octopus-a && | |
364 | test_commit octopus-a && | |
365 | git checkout master && | |
366 | git checkout -b octopus-b && | |
367 | test_commit octopus-b && | |
368 | git checkout master && | |
369 | test_commit seventh && | |
a48fcd83 | 370 | git merge octopus-a octopus-b && |
7b1d6269 | 371 | git merge reach |
289e1623 TR |
372 | ' |
373 | ||
374 | cat > expect <<\EOF | |
57b58db7 | 375 | * Merge tag 'reach' |
7b1d6269 AC |
376 | |\ |
377 | | \ | |
378 | | \ | |
57b58db7 | 379 | *-. \ Merge tags 'octopus-a' and 'octopus-b' |
7b1d6269 AC |
380 | |\ \ \ |
381 | * | | | seventh | |
382 | | | * | octopus-b | |
383 | | |/ / | |
384 | |/| | | |
385 | | * | octopus-a | |
386 | |/ / | |
387 | | * reach | |
388 | |/ | |
289e1623 TR |
389 | * Merge branch 'tangle' |
390 | |\ | |
391 | | * Merge branch 'side' (early part) into tangle | |
392 | | |\ | |
393 | | * \ Merge branch 'master' (early part) into tangle | |
394 | | |\ \ | |
395 | | * | | tangle-a | |
396 | * | | | Merge branch 'side' | |
397 | |\ \ \ \ | |
398 | | * | | | side-2 | |
eaf158f8 | 399 | | | |_|/ |
289e1623 TR |
400 | | |/| | |
401 | | * | | side-1 | |
402 | * | | | Second | |
403 | * | | | sixth | |
eaf158f8 | 404 | | |_|/ |
289e1623 TR |
405 | |/| | |
406 | * | | fifth | |
407 | * | | fourth | |
408 | |/ / | |
409 | * | third | |
410 | |/ | |
411 | * second | |
412 | * initial | |
413 | EOF | |
414 | ||
95110d75 | 415 | test_expect_success 'log --graph with merge' ' |
289e1623 | 416 | git log --graph --date-order --pretty=tformat:%s | |
9524cf29 | 417 | sed "s/ *\$//" >actual && |
289e1623 TR |
418 | test_cmp expect actual |
419 | ' | |
420 | ||
8a3d203b | 421 | test_expect_success 'log.decorate configuration' ' |
5a57bc6b | 422 | test_might_fail git config --unset-all log.decorate && |
8a3d203b | 423 | |
4f62c2bc JH |
424 | git log --oneline >expect.none && |
425 | git log --oneline --decorate >expect.short && | |
426 | git log --oneline --decorate=full >expect.full && | |
8a3d203b JH |
427 | |
428 | echo "[log] decorate" >>.git/config && | |
635530a2 | 429 | git log --oneline >actual && |
4f62c2bc | 430 | test_cmp expect.short actual && |
8a3d203b JH |
431 | |
432 | git config --unset-all log.decorate && | |
433 | git config log.decorate true && | |
4f62c2bc | 434 | git log --oneline >actual && |
8a3d203b | 435 | test_cmp expect.short actual && |
4f62c2bc | 436 | git log --oneline --decorate=full >actual && |
8a3d203b | 437 | test_cmp expect.full actual && |
4f62c2bc | 438 | git log --oneline --decorate=no >actual && |
8a3d203b JH |
439 | test_cmp expect.none actual && |
440 | ||
441 | git config --unset-all log.decorate && | |
442 | git config log.decorate no && | |
4f62c2bc | 443 | git log --oneline >actual && |
8a3d203b | 444 | test_cmp expect.none actual && |
4f62c2bc | 445 | git log --oneline --decorate >actual && |
8a3d203b | 446 | test_cmp expect.short actual && |
4f62c2bc | 447 | git log --oneline --decorate=full >actual && |
8a3d203b JH |
448 | test_cmp expect.full actual && |
449 | ||
b2be2f6a JK |
450 | git config --unset-all log.decorate && |
451 | git config log.decorate 1 && | |
452 | git log --oneline >actual && | |
453 | test_cmp expect.short actual && | |
454 | git log --oneline --decorate=full >actual && | |
455 | test_cmp expect.full actual && | |
456 | git log --oneline --decorate=no >actual && | |
457 | test_cmp expect.none actual && | |
458 | ||
8a3d203b JH |
459 | git config --unset-all log.decorate && |
460 | git config log.decorate short && | |
4f62c2bc | 461 | git log --oneline >actual && |
8a3d203b | 462 | test_cmp expect.short actual && |
4f62c2bc | 463 | git log --oneline --no-decorate >actual && |
8a3d203b | 464 | test_cmp expect.none actual && |
4f62c2bc | 465 | git log --oneline --decorate=full >actual && |
8a3d203b JH |
466 | test_cmp expect.full actual && |
467 | ||
468 | git config --unset-all log.decorate && | |
469 | git config log.decorate full && | |
4f62c2bc | 470 | git log --oneline >actual && |
8a3d203b | 471 | test_cmp expect.full actual && |
4f62c2bc | 472 | git log --oneline --no-decorate >actual && |
8a3d203b | 473 | test_cmp expect.none actual && |
4f62c2bc | 474 | git log --oneline --decorate >actual && |
8a3d203b JH |
475 | test_cmp expect.short actual |
476 | ||
0c47695a JS |
477 | git config --unset-all log.decorate && |
478 | git log --pretty=raw >expect.raw && | |
479 | git config log.decorate full && | |
480 | git log --pretty=raw >actual && | |
481 | test_cmp expect.raw actual | |
482 | ||
483 | ' | |
484 | ||
485 | test_expect_success 'reflog is expected format' ' | |
486 | test_might_fail git config --remove-section log && | |
487 | git log -g --abbrev-commit --pretty=oneline >expect && | |
488 | git reflog >actual && | |
489 | test_cmp expect actual | |
490 | ' | |
491 | ||
492 | test_expect_success 'whatchanged is expected format' ' | |
493 | git log --no-merges --raw >expect && | |
494 | git whatchanged >actual && | |
495 | test_cmp expect actual | |
496 | ' | |
497 | ||
498 | test_expect_success 'log.abbrevCommit configuration' ' | |
499 | test_when_finished "git config --unset log.abbrevCommit" && | |
500 | ||
501 | test_might_fail git config --unset log.abbrevCommit && | |
502 | ||
503 | git log --abbrev-commit >expect.log.abbrev && | |
504 | git log --no-abbrev-commit >expect.log.full && | |
505 | git log --pretty=raw >expect.log.raw && | |
506 | git reflog --abbrev-commit >expect.reflog.abbrev && | |
507 | git reflog --no-abbrev-commit >expect.reflog.full && | |
508 | git whatchanged --abbrev-commit >expect.whatchanged.abbrev && | |
509 | git whatchanged --no-abbrev-commit >expect.whatchanged.full && | |
510 | ||
511 | git config log.abbrevCommit true && | |
512 | ||
513 | git log >actual && | |
514 | test_cmp expect.log.abbrev actual && | |
515 | git log --no-abbrev-commit >actual && | |
516 | test_cmp expect.log.full actual && | |
517 | ||
518 | git log --pretty=raw >actual && | |
519 | test_cmp expect.log.raw actual && | |
520 | ||
521 | git reflog >actual && | |
522 | test_cmp expect.reflog.abbrev actual && | |
523 | git reflog --no-abbrev-commit >actual && | |
524 | test_cmp expect.reflog.full actual && | |
525 | ||
526 | git whatchanged >actual && | |
527 | test_cmp expect.whatchanged.abbrev actual && | |
528 | git whatchanged --no-abbrev-commit >actual && | |
529 | test_cmp expect.whatchanged.full actual | |
8a3d203b JH |
530 | ' |
531 | ||
65113121 ÆAB |
532 | test_expect_success 'show added path under "--follow -M"' ' |
533 | # This tests for a regression introduced in v1.7.2-rc0~103^2~2 | |
534 | test_create_repo regression && | |
535 | ( | |
536 | cd regression && | |
537 | test_commit needs-another-commit && | |
538 | test_commit foo.bar && | |
539 | git log -M --follow -p foo.bar.t && | |
540 | git log -M --follow --stat foo.bar.t && | |
541 | git log -M --follow --name-only foo.bar.t | |
542 | ) | |
543 | ' | |
c65233fe | 544 | |
e2c59667 LP |
545 | cat >expect <<\EOF |
546 | * commit COMMIT_OBJECT_NAME | |
547 | |\ Merge: MERGE_PARENTS | |
548 | | | Author: A U Thor <author@example.com> | |
549 | | | | |
550 | | | Merge HEADS DESCRIPTION | |
551 | | | | |
552 | | * commit COMMIT_OBJECT_NAME | |
553 | | | Author: A U Thor <author@example.com> | |
554 | | | | |
555 | | | reach | |
556 | | | --- | |
dc801e71 | 557 | | | reach.t | 1 + |
e2c59667 LP |
558 | | | 1 file changed, 1 insertion(+) |
559 | | | | |
560 | | | diff --git a/reach.t b/reach.t | |
561 | | | new file mode 100644 | |
562 | | | index 0000000..10c9591 | |
563 | | | --- /dev/null | |
564 | | | +++ b/reach.t | |
565 | | | @@ -0,0 +1 @@ | |
566 | | | +reach | |
567 | | | | |
568 | | \ | |
569 | *-. \ commit COMMIT_OBJECT_NAME | |
570 | |\ \ \ Merge: MERGE_PARENTS | |
571 | | | | | Author: A U Thor <author@example.com> | |
572 | | | | | | |
573 | | | | | Merge HEADS DESCRIPTION | |
574 | | | | | | |
575 | | | * | commit COMMIT_OBJECT_NAME | |
576 | | | |/ Author: A U Thor <author@example.com> | |
577 | | | | | |
578 | | | | octopus-b | |
579 | | | | --- | |
dc801e71 | 580 | | | | octopus-b.t | 1 + |
e2c59667 LP |
581 | | | | 1 file changed, 1 insertion(+) |
582 | | | | | |
583 | | | | diff --git a/octopus-b.t b/octopus-b.t | |
584 | | | | new file mode 100644 | |
585 | | | | index 0000000..d5fcad0 | |
586 | | | | --- /dev/null | |
587 | | | | +++ b/octopus-b.t | |
588 | | | | @@ -0,0 +1 @@ | |
589 | | | | +octopus-b | |
590 | | | | | |
591 | | * | commit COMMIT_OBJECT_NAME | |
592 | | |/ Author: A U Thor <author@example.com> | |
593 | | | | |
594 | | | octopus-a | |
595 | | | --- | |
dc801e71 | 596 | | | octopus-a.t | 1 + |
e2c59667 LP |
597 | | | 1 file changed, 1 insertion(+) |
598 | | | | |
599 | | | diff --git a/octopus-a.t b/octopus-a.t | |
600 | | | new file mode 100644 | |
601 | | | index 0000000..11ee015 | |
602 | | | --- /dev/null | |
603 | | | +++ b/octopus-a.t | |
604 | | | @@ -0,0 +1 @@ | |
605 | | | +octopus-a | |
606 | | | | |
607 | * | commit COMMIT_OBJECT_NAME | |
608 | |/ Author: A U Thor <author@example.com> | |
609 | | | |
610 | | seventh | |
611 | | --- | |
dc801e71 | 612 | | seventh.t | 1 + |
e2c59667 LP |
613 | | 1 file changed, 1 insertion(+) |
614 | | | |
615 | | diff --git a/seventh.t b/seventh.t | |
616 | | new file mode 100644 | |
617 | | index 0000000..9744ffc | |
618 | | --- /dev/null | |
619 | | +++ b/seventh.t | |
620 | | @@ -0,0 +1 @@ | |
621 | | +seventh | |
622 | | | |
623 | * commit COMMIT_OBJECT_NAME | |
624 | |\ Merge: MERGE_PARENTS | |
625 | | | Author: A U Thor <author@example.com> | |
626 | | | | |
627 | | | Merge branch 'tangle' | |
628 | | | | |
629 | | * commit COMMIT_OBJECT_NAME | |
630 | | |\ Merge: MERGE_PARENTS | |
631 | | | | Author: A U Thor <author@example.com> | |
632 | | | | | |
633 | | | | Merge branch 'side' (early part) into tangle | |
634 | | | | | |
635 | | * | commit COMMIT_OBJECT_NAME | |
636 | | |\ \ Merge: MERGE_PARENTS | |
637 | | | | | Author: A U Thor <author@example.com> | |
638 | | | | | | |
639 | | | | | Merge branch 'master' (early part) into tangle | |
640 | | | | | | |
641 | | * | | commit COMMIT_OBJECT_NAME | |
642 | | | | | Author: A U Thor <author@example.com> | |
643 | | | | | | |
644 | | | | | tangle-a | |
645 | | | | | --- | |
dc801e71 | 646 | | | | | tangle-a | 1 + |
e2c59667 LP |
647 | | | | | 1 file changed, 1 insertion(+) |
648 | | | | | | |
649 | | | | | diff --git a/tangle-a b/tangle-a | |
650 | | | | | new file mode 100644 | |
651 | | | | | index 0000000..7898192 | |
652 | | | | | --- /dev/null | |
653 | | | | | +++ b/tangle-a | |
654 | | | | | @@ -0,0 +1 @@ | |
655 | | | | | +a | |
656 | | | | | | |
657 | * | | | commit COMMIT_OBJECT_NAME | |
658 | |\ \ \ \ Merge: MERGE_PARENTS | |
659 | | | | | | Author: A U Thor <author@example.com> | |
660 | | | | | | | |
661 | | | | | | Merge branch 'side' | |
662 | | | | | | | |
663 | | * | | | commit COMMIT_OBJECT_NAME | |
664 | | | |_|/ Author: A U Thor <author@example.com> | |
665 | | |/| | | |
666 | | | | | side-2 | |
667 | | | | | --- | |
dc801e71 | 668 | | | | | 2 | 1 + |
e2c59667 LP |
669 | | | | | 1 file changed, 1 insertion(+) |
670 | | | | | | |
671 | | | | | diff --git a/2 b/2 | |
672 | | | | | new file mode 100644 | |
673 | | | | | index 0000000..0cfbf08 | |
674 | | | | | --- /dev/null | |
675 | | | | | +++ b/2 | |
676 | | | | | @@ -0,0 +1 @@ | |
677 | | | | | +2 | |
678 | | | | | | |
679 | | * | | commit COMMIT_OBJECT_NAME | |
680 | | | | | Author: A U Thor <author@example.com> | |
681 | | | | | | |
682 | | | | | side-1 | |
683 | | | | | --- | |
dc801e71 | 684 | | | | | 1 | 1 + |
e2c59667 LP |
685 | | | | | 1 file changed, 1 insertion(+) |
686 | | | | | | |
687 | | | | | diff --git a/1 b/1 | |
688 | | | | | new file mode 100644 | |
689 | | | | | index 0000000..d00491f | |
690 | | | | | --- /dev/null | |
691 | | | | | +++ b/1 | |
692 | | | | | @@ -0,0 +1 @@ | |
693 | | | | | +1 | |
694 | | | | | | |
695 | * | | | commit COMMIT_OBJECT_NAME | |
696 | | | | | Author: A U Thor <author@example.com> | |
697 | | | | | | |
698 | | | | | Second | |
699 | | | | | --- | |
dc801e71 | 700 | | | | | one | 1 + |
e2c59667 LP |
701 | | | | | 1 file changed, 1 insertion(+) |
702 | | | | | | |
703 | | | | | diff --git a/one b/one | |
704 | | | | | new file mode 100644 | |
705 | | | | | index 0000000..9a33383 | |
706 | | | | | --- /dev/null | |
707 | | | | | +++ b/one | |
708 | | | | | @@ -0,0 +1 @@ | |
709 | | | | | +case | |
710 | | | | | | |
711 | * | | | commit COMMIT_OBJECT_NAME | |
712 | | |_|/ Author: A U Thor <author@example.com> | |
713 | |/| | | |
714 | | | | sixth | |
715 | | | | --- | |
dc801e71 | 716 | | | | a/two | 1 - |
e2c59667 LP |
717 | | | | 1 file changed, 1 deletion(-) |
718 | | | | | |
719 | | | | diff --git a/a/two b/a/two | |
720 | | | | deleted file mode 100644 | |
721 | | | | index 9245af5..0000000 | |
722 | | | | --- a/a/two | |
723 | | | | +++ /dev/null | |
724 | | | | @@ -1 +0,0 @@ | |
725 | | | | -ni | |
726 | | | | | |
727 | * | | commit COMMIT_OBJECT_NAME | |
728 | | | | Author: A U Thor <author@example.com> | |
729 | | | | | |
730 | | | | fifth | |
731 | | | | --- | |
dc801e71 | 732 | | | | a/two | 1 + |
e2c59667 LP |
733 | | | | 1 file changed, 1 insertion(+) |
734 | | | | | |
735 | | | | diff --git a/a/two b/a/two | |
736 | | | | new file mode 100644 | |
737 | | | | index 0000000..9245af5 | |
738 | | | | --- /dev/null | |
739 | | | | +++ b/a/two | |
740 | | | | @@ -0,0 +1 @@ | |
741 | | | | +ni | |
742 | | | | | |
743 | * | | commit COMMIT_OBJECT_NAME | |
744 | |/ / Author: A U Thor <author@example.com> | |
745 | | | | |
746 | | | fourth | |
747 | | | --- | |
dc801e71 | 748 | | | ein | 1 + |
e2c59667 LP |
749 | | | 1 file changed, 1 insertion(+) |
750 | | | | |
751 | | | diff --git a/ein b/ein | |
752 | | | new file mode 100644 | |
753 | | | index 0000000..9d7e69f | |
754 | | | --- /dev/null | |
755 | | | +++ b/ein | |
756 | | | @@ -0,0 +1 @@ | |
757 | | | +ichi | |
758 | | | | |
759 | * | commit COMMIT_OBJECT_NAME | |
760 | |/ Author: A U Thor <author@example.com> | |
761 | | | |
762 | | third | |
763 | | --- | |
dc801e71 ZJS |
764 | | ichi | 1 + |
765 | | one | 1 - | |
e2c59667 LP |
766 | | 2 files changed, 1 insertion(+), 1 deletion(-) |
767 | | | |
768 | | diff --git a/ichi b/ichi | |
769 | | new file mode 100644 | |
770 | | index 0000000..9d7e69f | |
771 | | --- /dev/null | |
772 | | +++ b/ichi | |
773 | | @@ -0,0 +1 @@ | |
774 | | +ichi | |
775 | | diff --git a/one b/one | |
776 | | deleted file mode 100644 | |
777 | | index 9d7e69f..0000000 | |
778 | | --- a/one | |
779 | | +++ /dev/null | |
780 | | @@ -1 +0,0 @@ | |
781 | | -ichi | |
782 | | | |
783 | * commit COMMIT_OBJECT_NAME | |
784 | | Author: A U Thor <author@example.com> | |
785 | | | |
786 | | second | |
787 | | --- | |
dc801e71 | 788 | | one | 2 +- |
e2c59667 LP |
789 | | 1 file changed, 1 insertion(+), 1 deletion(-) |
790 | | | |
791 | | diff --git a/one b/one | |
792 | | index 5626abf..9d7e69f 100644 | |
793 | | --- a/one | |
794 | | +++ b/one | |
795 | | @@ -1 +1 @@ | |
796 | | -one | |
797 | | +ichi | |
798 | | | |
799 | * commit COMMIT_OBJECT_NAME | |
800 | Author: A U Thor <author@example.com> | |
801 | ||
802 | initial | |
803 | --- | |
dc801e71 | 804 | one | 1 + |
e2c59667 LP |
805 | 1 file changed, 1 insertion(+) |
806 | ||
807 | diff --git a/one b/one | |
808 | new file mode 100644 | |
809 | index 0000000..5626abf | |
810 | --- /dev/null | |
811 | +++ b/one | |
812 | @@ -0,0 +1 @@ | |
813 | +one | |
814 | EOF | |
815 | ||
816 | sanitize_output () { | |
817 | sed -e 's/ *$//' \ | |
818 | -e 's/commit [0-9a-f]*$/commit COMMIT_OBJECT_NAME/' \ | |
819 | -e 's/Merge: [ 0-9a-f]*$/Merge: MERGE_PARENTS/' \ | |
820 | -e 's/Merge tag.*/Merge HEADS DESCRIPTION/' \ | |
821 | -e 's/Merge commit.*/Merge HEADS DESCRIPTION/' \ | |
822 | -e 's/, 0 deletions(-)//' \ | |
823 | -e 's/, 0 insertions(+)//' \ | |
824 | -e 's/ 1 files changed, / 1 file changed, /' \ | |
825 | -e 's/, 1 deletions(-)/, 1 deletion(-)/' \ | |
826 | -e 's/, 1 insertions(+)/, 1 insertion(+)/' | |
827 | } | |
828 | ||
829 | test_expect_success 'log --graph with diff and stats' ' | |
830 | git log --graph --pretty=short --stat -p >actual && | |
831 | sanitize_output >actual.sanitized <actual && | |
b354f11b | 832 | test_i18ncmp expect actual.sanitized |
e2c59667 LP |
833 | ' |
834 | ||
003c84f6 JH |
835 | test_expect_success 'dotdot is a parent directory' ' |
836 | mkdir -p a/b && | |
837 | ( echo sixth && echo fifth ) >expect && | |
838 | ( cd a/b && git log --format=%s .. ) >actual && | |
839 | test_cmp expect actual | |
840 | ' | |
841 | ||
65113121 | 842 | test_done |