How DELTA objects values work and are calculated
- Date: Fri, 4 Jan 2019 21:48:03 -0500
- From: Farhan Khan <khanzf@xxxxxxxxx>
- Subject: How DELTA objects values work and are calculated
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.
PGP Fingerprint: B28D 2726 E2BC A97E 3854 5ABE 9A9F 00BC D525 16EE