@matheusbsbs / matheus-bagliano / commits / 8588932e20
Fork 0

graph: add test to demonstrate horizontal line bug

A previous test in t4215-log-skewed-merges.sh was added to demonstrate exactly the topology of a reported failure in "git log --graph". While investigating the fix, we realized that multiple edges that could collapse with horizontal lines were not doing so. Specifically, examine this section of the graph: | | | | | | * | |_|_|_|_|/|\ |/| | | | |/ / | | | | |/| / | | | |/| |/ | | |/| |/| | |/| |/| | | | |/| | | | | * | | | Document this behavior with a test. This behavior is new, as the behavior in v2.24.1 has the following output: | | | | | | *-. | | | | | | |\ \ | |_|_|_|_|/ / / |/| | | | | / / | | |_|_|_|/ / | |/| | | | / | | | |_|_|/ | | |/| | | | | * | | | The behavior changed logically in 479db18b ("graph: smooth appearance of collapsing edges on commit lines", 2019-10-15), but was actually broken due to an assert() bug in 458152cc ("graph: example of graph output that can be simplified", 2019-10-15). A future change could modify this behavior to do the following instead: | | | | | | * | |_|_|_|_|/|\ |/| | | | |/ / | | |_|_|/| / | |/| | | |/ | | | |_|/| | | |/| | | | | * | | | Signed-off-by: Derrick Stolee <dstolee@microsoft.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Derrick Stolee committed Jan 8, 2020 at 04:27 UTC 8588932e206a790f7c7582368f7b09daa36576e3
1 file changed +62
t/t4215-log-skewed-merges.sh
+62
@@ -311,4 +311,66 @@ test_expect_success 'log --graph with multiple tips and colors' '
311 test_cmp expect.colors actual.colors
312 '
313
314 +test_expect_failure 'log --graph with multiple tips' '
315 + git checkout --orphan 7_1 &&
316 + test_commit 7_A &&
317 + test_commit 7_B &&
318 + test_commit 7_C &&
319 + git checkout -b 7_2 7_1~2 &&
320 + test_commit 7_D &&
321 + test_commit 7_E &&
322 + git checkout -b 7_3 7_1~1 &&
323 + test_commit 7_F &&
324 + test_commit 7_G &&
325 + git checkout -b 7_4 7_2~1 &&
326 + test_commit 7_H &&
327 + git checkout -b 7_5 7_1~2 &&
328 + test_commit 7_I &&
329 + git checkout -b 7_6 7_3~1 &&
330 + test_commit 7_J &&
331 + git checkout -b M_1 7_1 &&
332 + git merge --no-ff 7_2 -m 7_M1 &&
333 + git checkout -b M_3 7_3 &&
334 + git merge --no-ff 7_4 -m 7_M2 &&
335 + git checkout -b M_5 7_5 &&
336 + git merge --no-ff 7_6 -m 7_M3 &&
337 + git checkout -b M_7 7_1 &&
338 + git merge --no-ff 7_2 7_3 -m 7_M4 &&
339 +
340 + check_graph M_1 M_3 M_5 M_7 <<-\EOF
341 + * 7_M1
342 + |\
343 + | | * 7_M2
344 + | | |\
345 + | | | * 7_H
346 + | | | | * 7_M3
347 + | | | | |\
348 + | | | | | * 7_J
349 + | | | | * | 7_I
350 + | | | | | | * 7_M4
351 + | |_|_|_|_|/|\
352 + |/| | | | |/ /
353 + | | |_|_|/| /
354 + | |/| | | |/
355 + | | | |_|/|
356 + | | |/| | |
357 + | | * | | | 7_G
358 + | | | |_|/
359 + | | |/| |
360 + | | * | | 7_F
361 + | * | | | 7_E
362 + | | |/ /
363 + | |/| |
364 + | * | | 7_D
365 + | | |/
366 + | |/|
367 + * | | 7_C
368 + | |/
369 + |/|
370 + * | 7_B
371 + |/
372 + * 7_A
373 + EOF
374 +'
375 +
376 test_done