Merge branch 'cc/delta-islands'
Lift code from GitHub to restrict delta computation so that an
object that exists in one fork is not made into a delta against
another object that does not appear in the same forked repository.
* cc/delta-islands:
pack-objects: move 'layer' into 'struct packing_data'
pack-objects: move tree_depth into 'struct packing_data'
t5320: tests for delta islands
repack: add delta-islands support
pack-objects: add delta-islands support
pack-objects: refactor code into compute_layer_order()
Add delta-islands.{c,h}
This commit is contained in:
@ -15,6 +15,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[] = {
|
||||
@ -43,6 +44,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);
|
||||
}
|
||||
|
||||
@ -303,6 +308,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,
|
||||
@ -363,6 +370,8 @@ int cmd_repack(int argc, const char **argv, const char *prefix)
|
||||
argv_array_push(&cmd.args, "--exclude-promisor-objects");
|
||||
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);
|
||||
|
||||
Reference in New Issue
Block a user