3 test_description
='merge simplification'
12 git name-rev
--tags --stdin |
sed -e "s|$_x40 (tags/\([^)]*\)) |\1 |g"
15 test_expect_success setup
'
16 echo "Hi there" >file &&
18 test_tick && git commit -m "Initial file" &&
21 git branch other-branch &&
25 test_tick && git commit -m "Modified file" &&
28 git checkout other-branch &&
32 test_tick && git commit -m "Modified the file identically" &&
35 echo "This is a stupid example" >another-file &&
36 git add another-file &&
37 test_tick && git commit -m "Add another file" &&
40 test_tick && git merge -m "merge" master &&
43 echo "Yet another" >elif &&
45 test_tick && git commit -m "Irrelevant change" &&
48 git checkout master &&
49 echo "Yet another" >elif &&
51 test_tick && git commit -m "Another irrelevant change" &&
54 test_tick && git merge -m "merge" other-branch &&
57 echo "Final change" >file &&
58 test_tick && git commit -a -m "Final change" &&
61 git symbolic-ref HEAD refs/heads/unrelated &&
63 echo "Unrelated branch" >side &&
65 test_tick && git commit -m "Side root" &&
68 git checkout master &&
69 test_tick && git merge -m "Coolest" unrelated &&
72 echo "Immaterial" >elif &&
74 test_tick && git commit -m "Last" &&
78 FMT
='tformat:%P %H | %s'
89 test_expect_
$outcome "log $param" '
90 git log --pretty="$FMT" --parents $param |
92 sed -e "s/^.* \([^ ]*\) .*/\1/" >check <actual &&
93 test_cmp expect check || {
101 check_outcome success
"$@"
104 check_result
'L K J I H G F E D C B A' --full-history
105 check_result
'K I H E C B A' --full-history -- file
106 check_result
'K I H E C B A' --full-history --topo-order -- file
107 check_result
'K I H E C B A' --full-history --date-order -- file
108 check_outcome failure
'I E C B A' --simplify-merges -- file
109 check_result
'I B A' -- file
110 check_result
'I B A' --topo-order -- file
111 check_result
'H' --first-parent -- another-file