git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Analyzing a corrupted index file
@ 2024-01-07 15:22 Nathan Manceaux-Panot
  2024-01-08 19:51 ` Junio C Hamano
  0 siblings, 1 reply; 4+ messages in thread
From: Nathan Manceaux-Panot @ 2024-01-07 15:22 UTC (permalink / raw)
  To: git

Hello all,

I have a corrupted git index file, and am trying to read it by hand, to understand what's wrong with it. Are there any tools that'll let me parse the on-disk, binary version of the index file, to unpack it into a human-readable data structure?
I found the spec for the index binary format, but reading it in that way is beyond my abilities.

For context, I'm writing a git tool, and my code is causing the index file to be screwed up in some unknown way. When it's in that state, git (v2.43) becomes inconsistent with itself:
- In the workdir, the file contains A
- According to `git show :file`, the file in the index contains B
- But `git diff` reports no changes!
The inconsistency goes away with a simple `git reset`, but can then be easily reproduced by re-executing my tool.

Thank you,
Nathan


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2024-01-09 17:16 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-01-07 15:22 Analyzing a corrupted index file Nathan Manceaux-Panot
2024-01-08 19:51 ` Junio C Hamano
2024-01-09 14:42   ` Nathan Manceaux-Panot
2024-01-09 17:16     ` Junio C Hamano

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).