remove delta-against-self bit

After experimenting with code to add the ability to encode a delta
against part of the deltified file, it turns out that resulting packs
are _bigger_ than when this ability is not used.  The raw delta output
might be smaller, but it doesn't compress as well using gzip with a
negative net saving on average.

Said bit would in fact be more useful to allow for encoding the copying
of chunks larger than 64KB providing more savings with large files.
This will correspond to packs version 3.

While the current code still produces packs version 2, it is made future
proof so pack versions 2 and 3 are accepted.  Any pack version 2 are
compatible with version 3 since the redefined bit was never used before.
When enough time has passed, code to use that bit to produce version 3
packs could be added.

Signed-off-by: Nicolas Pitre <nico@cam.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
This commit is contained in:
Nicolas Pitre
2006-02-09 17:50:04 -05:00
committed by Junio C Hamano
parent 67d42212ff
commit d60fc1c864
5 changed files with 11 additions and 12 deletions

View File

@ -246,13 +246,12 @@ static void unpack_all(void)
{
int i;
struct pack_header *hdr = fill(sizeof(struct pack_header));
unsigned version = ntohl(hdr->hdr_version);
unsigned nr_objects = ntohl(hdr->hdr_entries);
if (ntohl(hdr->hdr_signature) != PACK_SIGNATURE)
die("bad pack file");
if (version != PACK_VERSION)
die("unable to handle pack file version %d", version);
if (!pack_version_ok(hdr->hdr_version))
die("unknown pack file version %d", ntohl(hdr->hdr_version));
fprintf(stderr, "Unpacking %d objects\n", nr_objects);
use(sizeof(struct pack_header));