git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Assertion in git log graphing [regression in v2.25]

From
Derrick Stolee <stolee@gmail.com>
Date
Jan 7, 2020, 12:42 UTC
Message-ID
<fe1cd838-d390-96ab-d3b4-72df5aa61947@gmail.com>
In-Reply-To
<d694a5b5-9c88-0a34-b9fd-050e5e02c312@gmail.com>
On 1/7/2020 7:22 AM, Derrick Stolee wrote:
> I'm also going to take a look this morning, starting by creating a test.

Here is a a patch that reproduces the test failure. It hits the assert, so it definitely fails.

NOTE: The test may not actually pass after this bug is fixed, as
the output expectation may not match exactly. Thus, the test will
likely still fail after fixing the bug, but for a different reason.
I could use the output from v2.24.1, but the point of these changes
in graph.c was to have a compressed output in exactly these cases
of multiple edges moving to the left. In particular, the edges out
of 6_F will likely need updating.

If I manage to do the "right" fix, then I'll update this test accordingly.

-Stolee
-->8--
From: Derrick Stolee <dstolee@microsoft.com>
Date: Tue, 7 Jan 2020 07:35:56 -0500
Subject: [PATCH] graph: add failing test that hits assert()

A failure was reported in "git log --graph --all" with the new graph-rendering logic. Create a test case that matches the topology of that example and uses an explicit ref ordering instead of the "--all" option. The test fails with the following error:

	graph.c:1228: graph_output_collapsing_line: Assertion
		      `graph->mapping[i - 3] == target' failed.
Reported-by: Bradley Smith <brad@brad-smith.co.uk>
Signed-off-by: Derrick Stolee <dstolee@microsoft.com>
---
 t/t4215-log-skewed-merges.sh | 43 ++++++++++++++++++++++++++++++++++++
 1 file changed, 43 insertions(+)
diff --git a/t/t4215-log-skewed-merges.sh b/t/t4215-log-skewed-merges.sh
index 18709a723e..bab8a7ed56 100755
--- a/t/t4215-log-skewed-merges.sh
+++ b/t/t4215-log-skewed-merges.sh
@@ -240,4 +240,47 @@ test_expect_success 'log --graph with octopus merge with column joining its penu
 	EOF
 '
 
+test_expect_failure 'log --graph with multiple tips' '
+	git checkout --orphan 6_1 &&
+	test_commit 6_A &&
+	git branch 6_2 &&
+	git branch 6_4 &&
+	test_commit 6_B &&
+	git branch 6_3 &&
+	test_commit 6_C &&
+	git checkout 6_2 && test_commit 6_D &&
+	git checkout 6_3 && test_commit 6_E &&
+	git checkout -b 6_5 6_1 &&
+	git merge --no-ff 6_2 -m 6_F &&
+	git checkout 6_4 && test_commit 6_G &&
+	git checkout 6_3 &&
+	git merge --no-ff 6_4 -m 6_H &&
+	git checkout 6_1 &&
+	git merge --no-ff 6_2 -m 6_I &&
+
+	check_graph 6_1 6_3 6_5 <<-\EOF
+	* 6_I
+	|\
+	| | * 6_H
+	| | |\
+	| | | * 6_G
+	| | * | 6_E
+	| | | | *   6_F
+	| | | | |\
+	| |_|_|/ /
+	|/| | | /
+	| | |_|/
+	| |/| |
+	| * | | 6_D
+	| | |/
+	| |/|
+	* | | 6_C
+	| |/
+	|/|
+	* | 6_B
+	|/
+	* 6_A
+	EOF
+'
+
 test_done
-- 
2.24.1.vfs.1.1.12.gccc87aa318
Previous: Derrick StoleeNext: Eric Sunshine
Message 4 of 12 in “Assertion in git log graphing”
  1. Bradley SmithJan 7, 2020
  2. Jeff KingJan 7, 2020
  3. Derrick StoleeJan 7, 2020
  4. Derrick StoleeJan 7, 2020
  5. Eric SunshineJan 7, 2020
  6. Derrick StoleeJan 7, 2020
  7. Eric SunshineJan 7, 2020
  8. Derrick StoleeJan 7, 2020
  9. Jeff KingJan 7, 2020
  10. Derrick StoleeJan 7, 2020
  11. Derrick StoleeJan 7, 2020
  12. Derrick StoleeJan 7, 2020

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.