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

Re: Subject: Something like cat-file for the index?

From
EWEnno Weichert <enno.weichert@gmail.com>
Date
Jan 10, 2014, 14:27 UTC
Message-ID
<CABtFQN4q9un81W3G-o7tbG3-LUSEf2YdP0e9zP84JGYu6qwOfw@mail.gmail.com>
In-Reply-To
<871u0g2dtn.fsf@gmail.com>
Thank you :)
On 1/10/14, Thomas Gummerer <t.gummerer@gmail.com> wrote:
Show 39 quoted lines
>
> Hi,
>
> Enno Weichert <enno.weichert@gmail.com> writes:
>> Hi,
>>
>> I'd like to have a more technical look into the index file and what/how
>> it
>> stores data; call it educational spelunking.
>>
>> I know the index-format.txt but I'd really like to save me the work to
>> implement a pretty-printed output based on it.
>> I know ls-files but that's obviously not the whole thing.
>>
>> So: is there something like cat-file, that basically gives me a readable
>> version of the information (version number and all...) in the index
>> already
>> implemented or did nobody care until now?
>
> You can use `git ls-files --debug` and `git ls-files --stage` to get all
> the information about the files in the index.  The meaning of the flags
> is the only thing that's not shown by the command, and I don't think
> there is a tool yet to examine them.
>
> The undocumented --resolve-undo flag to git ls-files shows you the
> resolve undo data that is stored in the index.
>
> If you build git yourself, the `test-dump-cache-tree` helper can be used
> to show all information about the cache-tree that is stored in the
> index.
>
> The you can get the version of the index either by using
> `test-index-version` when you build git yourself, or by using `file
> .git/index`, which in addition will give you the number of entries that
> are in the index.
>
> --
> Thomas
>
Previous: Thomas Gummerer
Message 3 of 3 in “Subject: Something like cat-file for the index?”
  1. Enno WeichertJan 10, 2014
  2. Thomas GummererJan 10, 2014
  3. Enno WeichertJan 10, 2014

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.