Subject: Re: Analyzing a corrupted index file

From: Junio C Hamano <[email-masked]>
Date: Mon, 08 Jan 2024 11:51:27 -0800

Nathan Manceaux-Panot <[email-masked]> writes:

> 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?

"git ls-files" with its various options is probably the closest, but
even the command is not meant for "debugging the bits".  It is more
about showing lower-level details of a working index file to help
diagnose the mismatch between end-user expectation and the reality
(e.g. the user says the conflicts were all resolved, an expert asks
to run "ls-files -u" and together they discover that there are paths
that are still unmerged).