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

Understanding last ~28 bytes of index file

From
Farhan Khan <farhan@farhan.codes>
Date
Jun 13, 2019, 06:32 UTC
Message-ID
<c7c9012143e0818d332d0a9967c1a3e6@farhan.codes>
Hi all,

I am trying to understand how the index (.git/index) file works. When looking through extensions, it loops until it reaches the last 28 bytes (SHA size + 8). This is referenced here. https://github.com/git/git/blob/master/read-cache.c#L1933 What do the last 28 bytes consist of? Where in the source are bytes written?

I am trying to understand how to reproduce the index file and am not sure how this part works.

Thank you, --- Farhan Khan PGP Fingerprint: 1312 89CE 663E 1EB2 179C 1C83 C41D 2281 F8DA C0DE

Next: Jeff King
Message 1 of 2 in “Understanding last ~28 bytes of index file”
  1. Farhan KhanJun 13, 2019
  2. Jeff KingJun 13, 2019

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.