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

Re: [RFC/PATCH] define the way new representation types are encoded in the pack

From
Shawn Pearce <spearce@spearce.org>
Date
Oct 28, 2011, 23:07 UTC
Message-ID
<CAJo=hJsEzkFV9k8N+GAwWddmEZH8pQeJZrg_MXD72stbAW0ceQ@mail.gmail.com>
In-Reply-To
<alpine.LFD.2.02.1110290031540.30467@xanadu.home>
On Fri, Oct 28, 2011 at 15:48, Nicolas Pitre <nico@fluxnic.net> wrote:
Show 11 quoted lines
> On Fri, 28 Oct 2011, Shawn Pearce wrote:
>> - The immediate next byte encodes the extended type. This type is
>> stored using the OFS_DELTA offset varint encoding, and thus may be
>> larger than 256 if we ever need it to be.
>
> I'd say it is just a byte.  No encoding needed.  Let's not be silly
> about it.  If we really have more than 255 object types one day (and I
> really hope this will never happen) then the value 0 in that byte could
> indicate yet another extended object type encoding.  But I truly hope
> we'll have pack v9 or v10 by then and that we'll have obsoleted the
> current 3-bit encoding completely at that point anyway.

Yes. I probably wouldn't code the parser to use a varint here. I would say the extended types stored in this byte must be >= 8, and must be <= 127. Any values out of this range are unsupported and should be rejected. We can later reserve the right to set the high bit and switch to the OFS_DELTA varint encoding if we need that many more types, and we explicitly define codes 0-7 as illegal if detected here in the extended byte field.

Previous: Nicolas PitreNext: Nicolas Pitre
Message 11 of 12 in “define the way new representation types are encoded in the pack”
  1. define the way new representation types are encoded in the packJunio C Hamano, Oct 28, 2011
  2. Junio C HamanoOct 28, 2011
  3. Nguyen Thai Ngoc DuyOct 30, 2011
  4. Junio C HamanoOct 30, 2011
  5. Junio C HamanoOct 30, 2011
  6. Nguyen Thai Ngoc DuyOct 30, 2011
  7. Jakub NarebskiOct 28, 2011
  8. Junio C HamanoOct 28, 2011
  9. Shawn PearceOct 28, 2011
  10. Nicolas PitreOct 28, 2011
  11. Shawn PearceOct 28, 2011
  12. Nicolas PitreOct 28, 2011

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.