Re: [RFC PATCH 10/10] pack-objects: improve partial packfile reuse
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Oct 17, 2019, 07:03 UTC
- Message-ID
- <xmqq8spj97mj.fsf@gitster-ct.c.googlers.com>
- In-Reply-To
- <20191013073851.GA7001@sigill.intra.peff.net>
Jeff King <peff@peff.net> writes:
Show 6 quoted lines
>> Hmm, I am kind of surprised that the decoding side allowed such a >> padding. > > IIRC, the "padding" is just a sequence of 0-length-plus-continuation-bit > varint bytes. And for some reason it worked for the size but not for the > delta offset value.
I think the reason is because they use different varint definition.
The encoding used in builtin/pack-objects.c::write_no_reuse_object() is for offsets, and it came much later and with an improvement over the encoding used for delta size in diff-delta.c::create_delta(). The more recent encoding does not allow padding (when I compare the decoders for these two encodings, I notice there is +1 for each 7-bit iteration; this essentially declares that a byte with "not the final byte" bit set with all other bits clear does not mean 0 but it means 1, which breaks the idea of padding to encode filler zero bits).