path: root/builtin-unpack-objects.c
diff options
authorNicolas Pitre <>2006-09-21 04:06:49 (GMT)
committerJunio C Hamano <>2006-09-27 07:11:59 (GMT)
commiteb32d236df0c16b936b04f0c5402addb61cdb311 (patch)
tree005ee01d7e4813930c25854277d704d2f11bccb3 /builtin-unpack-objects.c
parent4a0641b7cf833644b286b56bb57d66b5538e4418 (diff)
introduce delta objects with offset to base
This adds a new object, namely OBJ_OFS_DELTA, renames OBJ_DELTA to OBJ_REF_DELTA to better make the distinction between those two delta objects, and adds support for the handling of those new delta objects in sha1_file.c only. The OBJ_OFS_DELTA contains a relative offset from the delta object's position in a pack instead of the 20-byte SHA1 reference to identify the base object. Since the base is likely to be not so far away, the relative offset is more likely to have a smaller encoding on average than an absolute offset. And for those delta objects the base must always be stored first because there is no way to know the distance of later objects when streaming a pack. Hence this relative offset is always meant to be negative. The offset encoding is slightly denser than the one used for object size -- credits to <> (whoever this is) for bringing it to my attention. This allows for pack size reduction between 3.2% (Linux-2.6) to over 5% (linux-historic). Runtime pack access should be faster too since delta replay does skip a search in the pack index for each delta in a chain. Signed-off-by: Nicolas Pitre <> Signed-off-by: Junio C Hamano <>
Diffstat (limited to 'builtin-unpack-objects.c')
1 files changed, 1 insertions, 1 deletions
diff --git a/builtin-unpack-objects.c b/builtin-unpack-objects.c
index 4f96bca..c6c6368 100644
--- a/builtin-unpack-objects.c
+++ b/builtin-unpack-objects.c
@@ -241,7 +241,7 @@ static void unpack_one(unsigned nr, unsigned total)
case OBJ_TAG:
unpack_non_delta_entry(type, size);
- case OBJ_DELTA: