3 test_description
='merge simplification'
11 _x40
='[0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]'
12 _x40
="$_x40$_x40$_x40$_x40$_x40$_x40$_x40$_x40"
15 git name-rev
--tags --stdin |
sed -e "s|$_x40 (tags/\([^)]*\)) |\1 |g"
18 test_expect_success setup
'
19 echo "Hi there" >file &&
21 test_tick && git commit -m "Initial file" &&
24 git branch other-branch &&
28 test_tick && git commit -m "Modified file" &&
31 git checkout other-branch &&
35 test_tick && git commit -m "Modified the file identically" &&
38 echo "This is a stupid example" >another-file &&
39 git add another-file &&
40 test_tick && git commit -m "Add another file" &&
43 test_tick && git merge -m "merge" master &&
46 echo "Yet another" >elif &&
48 test_tick && git commit -m "Irrelevant change" &&
51 git checkout master &&
52 echo "Yet another" >elif &&
54 test_tick && git commit -m "Another irrelevant change" &&
57 test_tick && git merge -m "merge" other-branch &&
60 echo "Final change" >file &&
61 test_tick && git commit -a -m "Final change" &&
64 git symbolic-ref HEAD refs/heads/unrelated &&
66 echo "Unrelated branch" >side &&
68 test_tick && git commit -m "Side root" &&
71 git checkout master &&
72 test_tick && git merge -m "Coolest" unrelated &&
75 echo "Immaterial" >elif &&
77 test_tick && git commit -m "Last" &&
81 FMT
='tformat:%P %H | %s'
90 test_expect_success
"log $param" '
91 git log --pretty="$FMT" --parents $param |
93 sed -e "s/^.* \([^ ]*\) .*/\1/" >check <actual &&
94 test_cmp expect check || {
101 check_result
'L K J I H G F E D C B A' --full-history
102 check_result
'K I H E C B A' --full-history -- file
103 check_result
'K I H E C B A' --full-history --topo-order -- file
104 check_result
'K I H E C B A' --full-history --date-order -- file
105 check_result
'I E C B A' --simplify-merges -- file
106 check_result
'I B A' -- file
107 check_result
'I B A' --topo-order -- file