path: root/index-pack.c
diff options
authorNicolas Pitre <>2006-02-09 22:50:04 (GMT)
committerJunio C Hamano <>2006-02-10 05:06:38 (GMT)
commitd60fc1c8649f80c006b9f493c542461e81608d4b (patch)
treed481762cf3c8954e9bc635c61127b77342ae79d0 /index-pack.c
parent67d42212ff104aaafa97b943cb369b8444f61581 (diff)
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 <> Signed-off-by: Junio C Hamano <>
Diffstat (limited to 'index-pack.c')
1 files changed, 3 insertions, 3 deletions
diff --git a/index-pack.c b/index-pack.c
index 541d7bc..babe34b 100644
--- a/index-pack.c
+++ b/index-pack.c
@@ -68,9 +68,9 @@ static void parse_pack_header(void)
hdr = (void *)pack_base;
if (hdr->hdr_signature != htonl(PACK_SIGNATURE))
die("packfile '%s' signature mismatch", pack_name);
- if (hdr->hdr_version != htonl(PACK_VERSION))
- die("packfile '%s' version %d different from ours %d",
- pack_name, ntohl(hdr->hdr_version), PACK_VERSION);
+ if (!pack_version_ok(hdr->hdr_version))
+ die("packfile '%s' version %d unsupported",
+ pack_name, ntohl(hdr->hdr_version));
nr_objects = ntohl(hdr->hdr_entries);