How DELTA objects values work and are calculated
- From
- Farhan Khan <khanzf@gmail.com>
- Date
- Jan 5, 2019, 02:48 UTC
- Message-ID
- <CAFd4kYBX+HrLxbga=VJgC5WjyeDZEznm2UCL+HF8A1YKVo3Trw@mail.gmail.com>
Hi all,
I'm having trouble understanding how OBJ_REF_DELTA and OBJ_REF_DELTA (deltas) work in git. Where does git calculate the sha1 hash values when doing "git index-pack" in builtin/index-pack.c. I think my lack of understanding of the code is compounded the fact that I do not understand what the two object types are.
From tracing the code starting from index-pack, all non-delta object type hashes are calculated in index-pack.c:1131 (parse_pack_objects). However, when the function ends, the delta objects hash values are set to all 0's.
My questions are: A) How do Delta objects work? B) Where and how are the sha1 values calculated?
I have read Documentation/technical/pack-format.txt, but am still not clear.
Thank you! -- Farhan Khan PGP Fingerprint: B28D 2726 E2BC A97E 3854 5ABE 9A9F 00BC D525 16EE