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

Understanding pack format

From
FKFarhan Khan <khanzf@gmail.com>
Date
Nov 2, 2018, 05:23 UTC
Message-ID
<CAFd4kYBDWMvVgDmNTzwOK9Q7n_Fb0NrvNAFgHtKvkLkRFWqUKw@mail.gmail.com>
Hi all,

I am trying to understand the pack file format and have been reading the documentation, specifically https://git-scm.com/docs/pack-format (which is in git's own git repository as "Documentation/technical/pack-format.txt"). I see that the file starts with the "PACK" signature, followed by the 4 byte version and 4 byte number of objects. After this, the documentation speaks about Undeltified and Deltified representations. I understand conceptually what each is, but do not know specifically how git parses it out.

Can someone please explain this to me? Is there any sample code of how to interpret each entry? Where is this in the git code? That might serve as a good guide.

I see a few references to "PACK_SIGNATURE", but not certain which actually reads the data.

Thanks! -- Farhan Khan PGP Fingerprint: B28D 2726 E2BC A97E 3854 5ABE 9A9F 00BC D525 16EE

Next: Junio C Hamano
Message 1 of 7 in “Understanding pack format”
  1. Farhan KhanNov 2, 2018
  2. Junio C HamanoNov 2, 2018
  3. Duy NguyenNov 2, 2018
  4. Farhan KhanNov 6, 2018
  5. Jeff KingNov 6, 2018
  6. Duy NguyenNov 6, 2018
  7. Duy NguyenNov 2, 2018

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.