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

detecting cycles in Git's commit graph

From
Michael Hendricks <michael@ndrix.org>
Date
Apr 30, 2009, 19:18 UTC
Message-ID
<20090430191857.GA55192@ginosko.grantstreet.com>

Are there any tools for detecting cycles in the commit graph which have been caused by grafts? I thought 'git fsck' might do it, but it doesn't seem to.

While importing some historic code into a new Git repository, my import scripts accidentally created a cycle in the commit graph by using grafts. Essentially, I had commits like:

    A -- B -- C

I accidentally created a graft marking commit C as commit B's second parent. There were 15,000 grafts so it took me a while to track down the one causing the cycle. The initial symptom was that 'git log --graph B' produced no output.

I wasn't able to find any existing tools to locate these kinds of faulty grafts.

Thanks for any pointers.
-- 
Michael
Next: Shawn O. Pearce
Message 1 of 3 in “detecting cycles in Git's commit graph”
  1. Michael HendricksApr 30, 2009
  2. Shawn O. PearceApr 30, 2009
  3. Stephen R. van den BergMay 3, 2009

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.