Re: [PATCH 1/2] pack-format.txt: define "varint" format
- From
- Martin Ågren <martin.agren@gmail.com>
- Date
- Dec 29, 2020, 22:41 UTC
- Message-ID
- <CAN0heSrEPt3=-uccGk2fKu=ScbE1Bq-cpsvisBcsoXdUC2sz5Q@mail.gmail.com>
- In-Reply-To
- <xmqqft3yltxo.fsf@gitster.c.googlers.com>
On Mon, 21 Dec 2020 at 22:40, Junio C Hamano <gitster@pobox.com> wrote:
Show 6 quoted lines
> > Martin Ågren <martin.agren@gmail.com> writes: > > > We define our varint format pretty much on the fly as we describe a pack > > file entry. In preparation for referring to it in more places in this > > document, define "varint" and refer to it.
Show 12 quoted lines
> We need to be careful when using a generic "varint" to mean the > older variant as it would confuse readers of OFS_DELTA section. > > ... goes and looks ... > > The phrase "offset encoding" is used in the document to talk about > OFS_DELTA offset. It is actually what the rest of the code thinks > is the canonical varint defined in varint.[ch]). > > A way to avoid confusion would be to refrain from using "varint" as > the primary way to describe this size field; instead explain it as > the "size encoding", to match "offset encoding" used for OFS_DELTA.
Thank you very much for these comments. I will post a v2 soon, which will do exactly this: avoid "varint" in favor of "size encoding".
> It may also help if we added to the description of "offset encoding" > that it is what other parts of the system consider the canonical > "varint" encoding.
I will leave this as #leftoverbits, though. I'll "only" fix the omission reported by Ross.
Martin