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

Calculate packfile and idxfile checksums

From
FKFarhan Khan <khanzf@gmail.com>
Date
Jan 18, 2019, 07:24 UTC
Message-ID
<CAFd4kYAbrUcV2U1u6Fz3VgZDN_YcpLrSymeA5bvvLy1LY98aHA@mail.gmail.com>
Hi all,

I am trying to understand how git's index-pack works, particularly how it calculates the packfile checksum and idxfile checksum. I traced back the packfile checksum in the source to the value char *sha1 that is utilized in write_idx_file() in pack_file.c:45. However, I cannot determine where this value is set.

My printf() debugging has it set at pack-write.c:171 (right before the hashwrite call) but it does not seem to be utilized prior to that point. Please assist.

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

Next: Ævar Arnfjörð Bjarmason
Message 1 of 3 in “Calculate packfile and idxfile checksums”
  1. Farhan KhanJan 18, 2019
  2. Ævar Arnfjörð BjarmasonJan 18, 2019
  3. Farhan KhanJan 18, 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.