diff options
author | Junio C Hamano <gitster@pobox.com> | 2019-02-06 22:05:24 -0800 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2019-02-06 22:05:25 -0800 |
commit | 5fda343321f36384892061b21dcbe1d477145d2c (patch) | |
tree | 3bc2ed0d898f0c4768529f5ecc9f5ec58dee9e49 /builtin | |
parent | Merge branch 'tb/test-lint-sed-options' (diff) | |
parent | pack-objects: create GIT_TEST_PACK_SPARSE (diff) | |
download | tgif-5fda343321f36384892061b21dcbe1d477145d2c.tar.xz |
Merge branch 'ds/push-sparse-tree-walk'
"git pack-objects" learned another algorithm to compute the set of
objects to send, that trades the resulting packfile off to save
traversal cost to favor small pushes.
* ds/push-sparse-tree-walk:
pack-objects: create GIT_TEST_PACK_SPARSE
pack-objects: create pack.useSparse setting
revision: implement sparse algorithm
list-objects: consume sparse tree walk
revision: add mark_tree_uninteresting_sparse
Diffstat (limited to 'builtin')
-rw-r--r-- | builtin/pack-objects.c | 10 | ||||
-rw-r--r-- | builtin/rev-list.c | 2 |
2 files changed, 10 insertions, 2 deletions
diff --git a/builtin/pack-objects.c b/builtin/pack-objects.c index ffef8dcf2f..bd67491c16 100644 --- a/builtin/pack-objects.c +++ b/builtin/pack-objects.c @@ -84,6 +84,7 @@ static unsigned long pack_size_limit; static int depth = 50; static int delta_search_threads; static int pack_to_stdout; +static int sparse; static int thin; static int num_preferred_base; static struct progress *progress_state; @@ -2703,6 +2704,10 @@ static int git_pack_config(const char *k, const char *v, void *cb) use_bitmap_index_default = git_config_bool(k, v); return 0; } + if (!strcmp(k, "pack.usesparse")) { + sparse = git_config_bool(k, v); + return 0; + } if (!strcmp(k, "pack.threads")) { delta_search_threads = git_config_int(k, v); if (delta_search_threads < 0) @@ -3130,7 +3135,7 @@ static void get_object_list(int ac, const char **av) if (prepare_revision_walk(&revs)) die(_("revision walk setup failed")); - mark_edges_uninteresting(&revs, show_edge); + mark_edges_uninteresting(&revs, show_edge, sparse); if (!fn_show_object) fn_show_object = show_object; @@ -3287,6 +3292,8 @@ int cmd_pack_objects(int argc, const char **argv, const char *prefix) { OPTION_CALLBACK, 0, "unpack-unreachable", NULL, N_("time"), N_("unpack unreachable objects newer than <time>"), PARSE_OPT_OPTARG, option_parse_unpack_unreachable }, + OPT_BOOL(0, "sparse", &sparse, + N_("use the sparse reachability algorithm")), OPT_BOOL(0, "thin", &thin, N_("create thin packs")), OPT_BOOL(0, "shallow", &shallow, @@ -3319,6 +3326,7 @@ int cmd_pack_objects(int argc, const char **argv, const char *prefix) read_replace_refs = 0; + sparse = git_env_bool("GIT_TEST_PACK_SPARSE", 0); reset_pack_idx_option(&pack_idx_opts); git_config(git_pack_config, NULL); diff --git a/builtin/rev-list.c b/builtin/rev-list.c index 14ef659c12..5b5b6dbb1c 100644 --- a/builtin/rev-list.c +++ b/builtin/rev-list.c @@ -546,7 +546,7 @@ int cmd_rev_list(int argc, const char **argv, const char *prefix) if (prepare_revision_walk(&revs)) die("revision walk setup failed"); if (revs.tree_objects) - mark_edges_uninteresting(&revs, show_edge); + mark_edges_uninteresting(&revs, show_edge, 0); if (bisect_list) { int reaches, all; |