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

Re: Zero padded file modes...

From
A Large Angry SCM <gitzilla@gmail.com>
Date
Sep 5, 2013, 16:25 UTC
Message-ID
<5228B079.9000601@gmail.com>
In-Reply-To
<20130905153646.GA12372@sigill.intra.peff.net>

On 09/05/2013 11:36 AM, Jeff King wrote: [...]

Show 28 quoted lines
>
> I haven't looked carefully at the pack v4 patches yet, but I suspect
> that yes, it's still a problem. The premise of pack v4 is that we can do
> better by not storing the raw git object bytes, but rather storing
> specialized representations of the various components. For example, by
> using an integer to store the mode rather than the ascii representation.
> But that representation does not represent the "oops, I have a 0-padded
> mode" quirk. And we have to be able to recover the original object, byte
> for byte, from the v4 representation (to verify sha1, or to generate a
> loose object or v2 pack).
>
> There are basically two solutions:
>
>    1. Add a single-bit flag for "I am 0-padded in the real data". We
>       could probably even squeeze it into the same integer.
>
>    2. Have a "classic" section of the pack that stores the raw object
>       bytes. For objects which do not match our expectations, store them
>       raw instead of in v4 format. They will not get the benefit of v4
>       optimizations, but if they are the minority of objects, that will
>       only end up with a slight slow-down.
>
> As I said, I have not looked carefully at the v4 patches, so maybe they
> handle this case already. But of the two solutions, I prefer (2). Doing
> (1) can solve _this_ problem, but it complicates the format, and does
> nothing for any future compatibility issues. Whereas (2) is easy to
> implement, since it is basically just pack v2 (and implementations would
> need a pack v2 reader anyway).
3. Keep those objects in v2 packs instead of the v4 pack. Transfers 
would have to be v3 or multi-pack transfers would need to be supported.
4. Don't use v4 packs with projects that have "crufty" objects. Projects 
with such objects may choose to pay the "cost" to "upgrade" to v4 
compatibility.

There's nothing that requires the next pack format to support all of the broken stuff that's happened over the years.

Previous: Nicolas PitreNext: Nicolas Pitre
Message 6 of 10 in “Zero padded file modes...”
  1. John SzakmeisterSep 5, 2013
  2. Jeff KingSep 5, 2013
  3. Duy NguyenSep 5, 2013
  4. Jeff KingSep 5, 2013
  5. Nicolas PitreSep 5, 2013
  6. A Large Angry SCMSep 5, 2013
  7. Nicolas PitreSep 5, 2013
  8. Jeff KingSep 5, 2013
  9. John SzakmeisterSep 5, 2013
  10. Jeff KingSep 5, 2013

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.