From: Shawn O. Pearce Date: Tue, 27 Nov 2007 06:12:10 GMT Subject: Re: If you would write git from scratch now, what would you change? Message-ID: <20071127061210.GP14735@spearce.org> In-Reply-To: <56b7f5510711262159x2e1fd4fdw8e914cb4a22376a1@mail.gmail.com> Dana How wrote: > On Nov 26, 2007 8:58 PM, Nicolas Pitre 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.