From: Junio C Hamano Date: Tue, 11 Jul 2006 23:03:02 GMT Subject: Re: [PATCH 2/3] sha1_file: add the ability to parse objects in "pack file format" Message-ID: <7vejwr3ftl.fsf@assigned-by-dhcp.cox.net> In-Reply-To: Linus Torvalds writes: > So if we have a uncompressed header, we'd need to add a separate 2-byte > fingerprint to it _before_ the real header that isn't divisible by 31, and > use that as the thing to test. > > Ho humm. I'll see what I can come up with. I do not like to rely too heavily on what zlib compression's beginning of stream looks like. I think the new format can be deflated new header (fully synched) followed by deflated payload. So the sequence unpack-sha1-header followed by parse-sha1-header would notice we are dealing with new format and reinitialize the deflator at the point where the header deflator left off. Wouldn't that work?