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

Re: Fwd: Possible git bug in commit-graph: "invalid commit position"

From
Derrick Stolee <stolee@gmail.com>
Date
Jan 21, 2020, 00:37 UTC
Message-ID
<d4313777-ce8c-0b64-997e-17cb719c9ab8@gmail.com>
In-Reply-To
<CAFChFyi5J-mb+rshtF7U2m=MtPzEPUa+V1_qbEXC=-LdQ218yA@mail.gmail.com>
On 1/20/2020 12:32 PM, Gary Oberbrunner wrote:
Show 20 quoted lines
> I'm running git 2.24.1 on Linux/WSL, and sometimes git fails with this error:
> ```
> % git diff --cached
> fatal: invalid commit position. commit-graph is likely corrupt
> ```
> Usually that error goes away after I do a few more git operations, but
> I haven't been able to discern a pattern yet. It's not always with
> "diff", can be any git command as far as I can tell.
> Perhaps it started after I enabled the commit-graph stuff:
> ```
> [core]
>         editor = emacsclient -c -a \"\"
>         preloadindex = true
>         fscache = true
>         autocrlf = false
>         commitGraph = true
>         writeCommitGraph = true
> ```
> In fact, when I turn off `commitGraph`, the error goes away. But as I
> say, sometimes it goes away of its own accord.

Disabling the featuere will definitely remove the error. Some commands may also just not "visit" the corrupt commit.

> Googling turns up almost nothing on this error. I have no idea if I've
> done something wrong to corrupt the commit graph, or if it's a git
> bug. If there's anything I can do to help debug it, I'd be happy to --
> just let me know.

Please run "git commit-graph verify" to see if that catches the corruption. If not, then the verify feature is broken.

Then, you can delete your .git/objects/info/commit-graph file and rebuild it with "git commit-graph write". (If you have fetch.writeCommitGraph enabled, then you may need to instead delete the .git/objects/info/commit-graphs directory.) If that process does not fix the problem, then there is definitely a bug in the feature. At the moment, it may just be a flipped bit in the file.

Thanks, -Stolee

Previous: Gary OberbrunnerNext: Gary Oberbrunner
Message 2 of 6 in “Fwd: Possible git bug in commit-graph: "invalid commit position"”
  1. Gary OberbrunnerJan 20, 2020
  2. Derrick StoleeJan 21, 2020
  3. Gary OberbrunnerFeb 4, 2020
  4. Alex RiesenMay 15, 2020
  5. Michael ForneyJun 21, 2020
  6. Derrick StoleeJun 22, 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.