summaryrefslogtreecommitdiff
path: root/delta-islands.h
diff options
context:
space:
mode:
authorJeff King <peff@peff.net>2018-08-16 06:13:07 (GMT)
committerJunio C Hamano <gitster@pobox.com>2018-08-16 17:51:17 (GMT)
commitc8d521faf72590fd4cd9bab3d20eb3de139f69d5 (patch)
treeae33625e83552e039305735b6ac56dbc0bd5de5b /delta-islands.h
parent1d89318c48d233d52f1db230cf622935ac3c69fa (diff)
downloadgit-c8d521faf72590fd4cd9bab3d20eb3de139f69d5.zip
git-c8d521faf72590fd4cd9bab3d20eb3de139f69d5.tar.gz
git-c8d521faf72590fd4cd9bab3d20eb3de139f69d5.tar.bz2
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 <peff@peff.net> Signed-off-by: Christian Couder <chriscool@tuxfamily.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'delta-islands.h')
-rw-r--r--delta-islands.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/delta-islands.h b/delta-islands.h
new file mode 100644
index 0000000..f972573
--- /dev/null
+++ b/delta-islands.h
@@ -0,0 +1,11 @@
+#ifndef DELTA_ISLANDS_H
+#define DELTA_ISLANDS_H
+
+int island_delta_cmp(const struct object_id *a, const struct object_id *b);
+int in_same_island(const struct object_id *, const struct object_id *);
+void resolve_tree_islands(int progress, struct packing_data *to_pack);
+void load_delta_islands(void);
+void propagate_island_marks(struct commit *commit);
+int compute_pack_layers(struct packing_data *to_pack);
+
+#endif /* DELTA_ISLANDS_H */