3 # There's more than one "correct" way to represent the history graphically.
4 # These tests depend on the current behavior of the graphing code. If the
5 # graphing code is ever changed to draw the output differently, these tests
6 # cases will need to be updated to know about the new layout.
8 test_description
='--graph and simplified history'
11 .
"$TEST_DIRECTORY"/lib-log-graph.sh
15 lib_test_cmp_graph
--format=%s
"$@"
18 test_expect_success
'set up rev-list --graph test' '
19 # 3 commits on branch A
20 test_commit A1 foo.txt &&
21 test_commit A2 bar.txt &&
22 test_commit A3 bar.txt &&
23 git branch -m master A &&
25 # 2 commits on branch B, started from A1
26 git checkout -b B A1 &&
27 test_commit B1 foo.txt &&
28 test_commit B2 abc.txt &&
30 # 2 commits on branch C, started from A2
31 git checkout -b C A2 &&
32 test_commit C1 xyz.txt &&
33 test_commit C2 xyz.txt &&
35 # Octopus merge B and C into branch A
37 git merge B C -m A4 &&
40 test_commit A5 bar.txt &&
42 # More commits on C, then merge C into A
44 test_commit C3 foo.txt &&
45 test_commit C4 bar.txt &&
47 git merge -s ours C -m A6 &&
50 test_commit A7 bar.txt
53 test_expect_success
'--graph --all' '
54 check_graph --all <<-\EOF
78 # Make sure the graph_is_interesting() code still realizes
79 # that undecorated merges are interesting, even with --simplify-by-decoration
80 test_expect_success
'--graph --simplify-by-decoration' '
82 check_graph --all --simplify-by-decoration <<-\EOF
106 test_expect_success
'setup: get rid of decorations on B' '
112 # Graph with branch B simplified away
113 test_expect_success
'--graph --simplify-by-decoration prune branch B' '
114 check_graph --simplify-by-decoration --all <<-\EOF
132 test_expect_success
'--graph --full-history -- bar.txt' '
133 check_graph --full-history --all -- bar.txt <<-\EOF
147 test_expect_success
'--graph --full-history --simplify-merges -- bar.txt' '
148 check_graph --full-history --simplify-merges --all -- bar.txt <<-\EOF
160 test_expect_success
'--graph -- bar.txt' '
161 check_graph --all -- bar.txt <<-\EOF
171 test_expect_success
'--graph --sparse -- bar.txt' '
172 check_graph --sparse --all -- bar.txt <<-\EOF
188 test_expect_success
'--graph ^C4' '
189 check_graph --all ^C4 <<-\EOF
201 test_expect_success
'--graph ^C3' '
202 check_graph --all ^C3 <<-\EOF
216 # I don't think the ordering of the boundary commits is really
217 # that important, but this test depends on it. If the ordering ever changes
218 # in the code, we'll need to update this test.
219 test_expect_success
'--graph --boundary ^C3' '
220 check_graph --boundary --all ^C3 <<-\EOF