3 test_description='git log --graph of skewed merges'
9 git log --graph --pretty=tformat:%s "$@" >actual.raw &&
10 sed "s/ *$//" actual.raw >actual &&
11 test_cmp expect actual
14 test_expect_success 'log --graph with merge fusing with its left and right neighbors' '
15 git checkout --orphan _p &&
18 git checkout -b _q @^ && test_commit C &&
19 git checkout -b _r @^ && test_commit D &&
20 git checkout _p && git merge --no-ff _q _r -m E &&
21 git checkout _r && test_commit F &&
22 git checkout _p && git merge --no-ff _r -m G &&
23 git checkout @^^ && git merge --no-ff _p -m H &&
42 test_expect_success 'log --graph with left-skewed merge' '
43 git checkout --orphan 0_p && test_commit 0_A &&
44 git checkout -b 0_q 0_p && test_commit 0_B &&
45 git checkout -b 0_r 0_p &&
48 git checkout -b 0_s 0_p && test_commit 0_E &&
49 git checkout -b 0_t 0_p && git merge --no-ff 0_r^ 0_s -m 0_F &&
50 git checkout 0_p && git merge --no-ff 0_s -m 0_G &&
51 git checkout @^ && git merge --no-ff 0_q 0_r 0_t 0_p -m 0_H &&
76 test_expect_success 'log --graph with nested left-skewed merge' '
77 git checkout --orphan 1_p &&
81 git checkout -b 1_q @^ && test_commit 1_D &&
82 git checkout 1_p && git merge --no-ff 1_q -m 1_E &&
83 git checkout -b 1_r @~3 && test_commit 1_F &&
84 git checkout 1_p && git merge --no-ff 1_r -m 1_G &&
85 git checkout @^^ && git merge --no-ff 1_p -m 1_H &&
104 test_expect_success 'log --graph with nested left-skewed merge following normal merge' '
105 git checkout --orphan 2_p &&
109 git checkout -b 2_q @^^ &&
112 git checkout -b 2_r @^ && test_commit 2_F &&
114 git merge --no-ff 2_r -m 2_G &&
115 git merge --no-ff 2_p^ -m 2_H &&
116 git checkout -b 2_s @^^ && git merge --no-ff 2_q -m 2_J &&
117 git checkout 2_p && git merge --no-ff 2_s -m 2_K &&
141 test_expect_success 'log --graph with nested right-skewed merge following left-skewed merge' '
142 git checkout --orphan 3_p &&
144 git checkout -b 3_q &&
147 git checkout -b 3_r @^ &&
149 git checkout 3_q && git merge --no-ff 3_r -m 3_E &&
150 git checkout 3_p && git merge --no-ff 3_q -m 3_F &&
151 git checkout 3_r && test_commit 3_G &&
152 git checkout 3_p && git merge --no-ff 3_r -m 3_H &&
153 git checkout @^^ && git merge --no-ff 3_p -m 3_J &&
174 test_expect_success 'log --graph with right-skewed merge following a left-skewed one' '
175 git checkout --orphan 4_p &&
179 git checkout -b 4_q @^^ && test_commit 4_D &&
180 git checkout -b 4_r 4_p^ && git merge --no-ff 4_q -m 4_E &&
181 git checkout -b 4_s 4_p^^ &&
182 git merge --no-ff 4_r -m 4_F &&
183 git merge --no-ff 4_p -m 4_G &&
184 git checkout @^^ && git merge --no-ff 4_s -m 4_H &&
186 check_graph --date-order <<-\EOF
206 test_expect_success 'log --graph with octopus merge with column joining its penultimate parent' '
207 git checkout --orphan 5_p &&
212 git checkout 5_q && test_commit 5_C &&
213 git checkout 5_r && test_commit 5_D &&
215 git merge --no-ff 5_q 5_r -m 5_E &&
216 git checkout 5_q && test_commit 5_F &&
217 git checkout -b 5_s 5_p^ &&
218 git merge --no-ff 5_p 5_q -m 5_G &&
220 git merge --no-ff 5_s -m 5_H &&