repack: add delta-islands support
Implement simple support for --delta-islands option and repack.useDeltaIslands config variable in git repack. This allows users to setup delta islands in their config and get the benefit of less disk usage while cloning and fetching is still quite fast and not much more CPU intensive. 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>
This commit is contained in:
parent
28b8a73080
commit
16d75fa48d
@ -3145,6 +3145,10 @@ repack.packKeptObjects::
|
||||
index is being written (either via `--write-bitmap-index` or
|
||||
`repack.writeBitmaps`).
|
||||
|
||||
repack.useDeltaIslands::
|
||||
If set to true, makes `git repack` act as if `--delta-islands`
|
||||
was passed. Defaults to `false`.
|
||||
|
||||
repack.writeBitmaps::
|
||||
When true, git will write a bitmap index when packing all
|
||||
objects to disk (e.g., when `git repack -a` is run). This
|
||||
|
@ -155,6 +155,11 @@ depth is 4095.
|
||||
being removed. In addition, any unreachable loose objects will
|
||||
be packed (and their loose counterparts removed).
|
||||
|
||||
-i::
|
||||
--delta-islands::
|
||||
Pass the `--delta-islands` option to `git-pack-objects`, see
|
||||
linkgit:git-pack-objects[1].
|
||||
|
||||
Configuration
|
||||
-------------
|
||||
|
||||
|
@ -12,6 +12,7 @@
|
||||
static int delta_base_offset = 1;
|
||||
static int pack_kept_objects = -1;
|
||||
static int write_bitmaps;
|
||||
static int use_delta_islands;
|
||||
static char *packdir, *packtmp;
|
||||
|
||||
static const char *const git_repack_usage[] = {
|
||||
@ -40,6 +41,10 @@ static int repack_config(const char *var, const char *value, void *cb)
|
||||
write_bitmaps = git_config_bool(var, value);
|
||||
return 0;
|
||||
}
|
||||
if (!strcmp(var, "repack.usedeltaislands")) {
|
||||
use_delta_islands = git_config_bool(var, value);
|
||||
return 0;
|
||||
}
|
||||
return git_default_config(var, value, cb);
|
||||
}
|
||||
|
||||
@ -194,6 +199,8 @@ int cmd_repack(int argc, const char **argv, const char *prefix)
|
||||
N_("pass --local to git-pack-objects")),
|
||||
OPT_BOOL('b', "write-bitmap-index", &write_bitmaps,
|
||||
N_("write bitmap index")),
|
||||
OPT_BOOL('i', "delta-islands", &use_delta_islands,
|
||||
N_("pass --delta-islands to git-pack-objects")),
|
||||
OPT_STRING(0, "unpack-unreachable", &unpack_unreachable, N_("approxidate"),
|
||||
N_("with -A, do not loosen objects older than this")),
|
||||
OPT_BOOL('k', "keep-unreachable", &keep_unreachable,
|
||||
@ -267,6 +274,8 @@ int cmd_repack(int argc, const char **argv, const char *prefix)
|
||||
argv_array_pushf(&cmd.args, "--no-reuse-object");
|
||||
if (write_bitmaps)
|
||||
argv_array_push(&cmd.args, "--write-bitmap-index");
|
||||
if (use_delta_islands)
|
||||
argv_array_push(&cmd.args, "--delta-islands");
|
||||
|
||||
if (pack_everything & ALL_INTO_ONE) {
|
||||
get_non_kept_pack_filenames(&existing_packs, &keep_pack_list);
|
||||
|
Loading…
Reference in New Issue
Block a user