summaryrefslogtreecommitdiff
path: root/repo-settings.c
diff options
context:
space:
mode:
authorDerrick Stolee <dstolee@microsoft.com>2019-09-02 19:22:02 -0700
committerJunio C Hamano <gitster@pobox.com>2019-09-03 12:06:14 -0700
commit50f26bd035816c2bb79582b834d59b49292502a9 (patch)
tree48d8a75a581c0acb513b5351f472d0a6aa97fe93 /repo-settings.c
parentaaf633c2ad10b47af7623c130ddfe7231658c7e4 (diff)
downloadgit-50f26bd035816c2bb79582b834d59b49292502a9.tar.gz
fetch: add fetch.writeCommitGraph config setting
The commit-graph feature is now on by default, and is being written during 'git gc' by default. Typically, Git only writes a commit-graph when a 'git gc --auto' command passes the gc.auto setting to actualy do work. This means that a commit-graph will typically fall behind the commits that are being used every day. To stay updated with the latest commits, add a step to 'git fetch' to write a commit-graph after fetching new objects. The fetch.writeCommitGraph config setting enables writing a split commit-graph, so on average the cost of writing this file is very small. Occasionally, the commit-graph chain will collapse to a single level, and this could be slow for very large repos. For additional use, adjust the default to be true when feature.experimental is enabled. Signed-off-by: Derrick Stolee <dstolee@microsoft.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'repo-settings.c')
-rw-r--r--repo-settings.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/repo-settings.c b/repo-settings.c
index 3779b85c17..05546db98e 100644
--- a/repo-settings.c
+++ b/repo-settings.c
@@ -49,10 +49,14 @@ void prepare_repo_settings(struct repository *r)
UPDATE_DEFAULT_BOOL(r->settings.index_version, 4);
UPDATE_DEFAULT_BOOL(r->settings.core_untracked_cache, UNTRACKED_CACHE_WRITE);
}
+ if (!repo_config_get_bool(r, "fetch.writecommitgraph", &value))
+ r->settings.fetch_write_commit_graph = value;
if (!repo_config_get_bool(r, "feature.experimental", &value) && value) {
UPDATE_DEFAULT_BOOL(r->settings.pack_use_sparse, 1);
UPDATE_DEFAULT_BOOL(r->settings.fetch_negotiation_algorithm, FETCH_NEGOTIATION_SKIPPING);
+ UPDATE_DEFAULT_BOOL(r->settings.fetch_write_commit_graph, 1);
}
+ UPDATE_DEFAULT_BOOL(r->settings.fetch_write_commit_graph, 0);
/* Hack for test programs like test-dump-untracked-cache */
if (ignore_untracked_cache_config)