Skip to content

Commit c8d521f

Browse files
peffgitster
authored andcommitted
Add delta-islands.{c,h}
Hosting providers that allow users to "fork" existing repos want those forks to share as much disk space as possible. Alternates are an existing solution to keep all the objects from all the forks into a unique central repo, but this can have some drawbacks. Especially when packing the central repo, deltas will be created between objects from different forks. This can make cloning or fetching a fork much slower and much more CPU intensive as Git might have to compute new deltas for many objects to avoid sending objects from a different fork. Because the inefficiency primarily arises when an object is deltified against another object that does not exist in the same fork, we partition objects into sets that appear in the same fork, and define "delta islands". When finding delta base, we do not allow an object outside the same island to be considered as its base. So "delta islands" is a way to store objects from different forks in the same repo and packfile without having deltas between objects from different forks. This patch implements the delta islands mechanism in "delta-islands.{c,h}", but does not yet make use of it. A few new fields are added in 'struct object_entry' in "pack-objects.h" though. The documentation will follow in a patch that actually uses delta islands in "builtin/pack-objects.c". Signed-off-by: Jeff King <[email protected]> Signed-off-by: Christian Couder <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 1d89318 commit c8d521f

File tree

4 files changed

+509
-0
lines changed

4 files changed

+509
-0
lines changed

Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -841,6 +841,7 @@ LIB_OBJS += csum-file.o
841841
LIB_OBJS += ctype.o
842842
LIB_OBJS += date.o
843843
LIB_OBJS += decorate.o
844+
LIB_OBJS += delta-islands.o
844845
LIB_OBJS += diffcore-break.o
845846
LIB_OBJS += diffcore-delta.o
846847
LIB_OBJS += diffcore-order.o

0 commit comments

Comments
 (0)