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

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

From
Jeff King <peff@peff.net>
Date
Jan 7, 2020, 11:48 UTC
Message-ID
<20200107114812.GE1073219@coredump.intra.peff.net>
In-Reply-To
<CAHt=fUXTHc4JPsapvHKnw5vHhp2cBOYRNfdaSDWBUnKt8fWfeA@mail.gmail.com>
On Tue, Jan 07, 2020 at 11:24:50AM +0000, Bradley Smith wrote:
Show 7 quoted lines
> The following git repository (https://github.com/brads55/git-testcase)
> causes an assertion when running:
> 
>   $ git log --oneline --graph --all
> 
>   git-log: graph.c:1228: graph_output_collapsing_line: Assertion
> `graph->mapping[i - 3] == target' failed.
Thanks for the report, and especially for providing a reproduction case!

The problem is new in the v2.25 release candidates, so we should try to deal with it before the release.

> The assertion seems to be caused by commit
> 0f0f389f12029b1c3745f8ed7aacfe6b2fc7a6cc. The graph structure of the
> above repository is as follows (as produced by v2.24.1):

Yeah, I can confirm that this introduces the problem. I admit to not following the recent graph changes too closely, so I'll add James to the cc for attention.

The assertion itself is quite old, so I wondered if it was even still relevant. Removing it does produce a reasonable-looking graph:

  *   a0a130c Merge commit '8f076d8' into HEAD
  |\  
  | | *   f0f3be5 Merge commit '1b4b8d0' into HEAD
  | | |\  
  | | | * 1b4b8d0 6
  | | * | 2c44f1b 2
  | | | | * dd068b4 Merge commit '8f076d8' into HEAD
  | |_|_|/| 
  |/| | |/  
  | | |/|   
  | |/| |   
  | * | | 8f076d8 5
  | | |/  
  | |/|   
  * | | a261135 4
  | |/  
  |/|   
  * | a267dd6 1
  |/  
  * 68f4772 0
but the colors aren't quite right. In particular, in this segment:
    | | | | * dd068b4 Merge commit '8f076d8' into HEAD
    | |_|_|/| 
    |/| | |/  

the first-parent line coming from dd068b4 is red in the slashes, but uncolored in the underscores.

So much for naive fix. :)
-Peff
Previous: Bradley SmithNext: Derrick Stolee
Message 2 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.