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

Index Fileformat: stat(2) info necessary? What for?

From
EBErik Bernoth <erik.bernoth@gmail.com>
Date
Aug 26, 2013, 12:34 UTC
Message-ID
<CAB46HOmMtgD+CtWUS3CQhr+ux1a3JP=hF2Cerd2nmDWzX5pxcw@mail.gmail.com>
Hi,

I am still working on implementing git in Python for self education purposes. Implementing the Index in memory was no problem after I understood how its done with help of Andreas Ericsson and Junio C Hamano.

Now I want to store an Index state to the filesystem in a git-compatible file format. I looked up what the Git documentation has to say about that [1]. Now there's a lot of information (all the stat(2) stuff) that gets stored about the staged files, which I never needed for file-IO in Python or Java. In my eyes if a person would be cloning my git repository he wouldn't need it as well, because the new inode on his system will probably be different from mine and applying the access rights onto the cloning user id and group id would also make sense, because that user introduced that file to that system.

Thus I am now missing concrete experience in when this stat(2) information comes in handy or if it would be completely okay in a python-git implementation to just store the info shown with `git ls-files -s` to a file, maybe zlib.compressed like a git object. Of course I would then lose the compatibility with git repositories, which is a shame even if it would make sense. What is your opinion?

[1] https://github.com/git/git/blob/master/Documentation/technical/index-format.txt

Cheers Erik

Next: Jeff King
Message 1 of 2 in “Index Fileformat: stat(2) info necessary? What for?”
  1. Erik BernothAug 26, 2013
  2. Jeff KingAug 26, 2013

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.