Subject: Re: If you would write git from scratch now, what would you change?

From: "Shawn O. Pearce" <[email-masked]>
Date: Tue, 27 Nov 2007 01:12:10 -0500

Dana How <[email-masked]> wrote:
> On Nov 26, 2007 8:58 PM, Nicolas Pitre <[email-masked]> wrote:
> >
> > It is a bit cumbersome indeed, but I'm afraid we're really stuck with it
> > since every object SHA1 depends on that format.
> 
> Yes,  now I remember: this was the same argument you used to
> convince me that losing the "new" (deprecated) loose format was OK.
> 
> However,  if we changed
> WRITE(DEFLATE(SHA1("$type $size\0$data")))
> (where SHA1(x) = x but has the side-effect of updating the SHA-1)
> to
> WRITE($pack_style_object_header)
> SHA1("$type $size\0")
> WRITE(DEFLATE(SHA1($data)))
> then the SHA-1 result is the same but we get the pack-style header,
> and blobs can be sucked straight into packs when not deltified.
> The SHA-1 result is still usable at the end to rename the temporary
> loose object file
> (and put it in the correct xx subdirectory).

Hah.  That's exactly what the "new" (deprecated) format was, and what
its code for creating such objects looked like in sha1_file.c. :-)
 
-- 
Shawn.