commit-graph: add core.commitGraph setting
authorDerrick Stolee <dstolee@microsoft.com>
Tue, 10 Apr 2018 12:56:03 +0000 (08:56 -0400)
committerJunio C Hamano <gitster@pobox.com>
Wed, 11 Apr 2018 01:43:01 +0000 (10:43 +0900)
The commit graph feature is controlled by the new core.commitGraph config
setting. This defaults to 0, so the feature is opt-in.

The intention of core.commitGraph is that a user can always stop checking
for or parsing commit graph files if core.commitGraph=0.

Signed-off-by: Derrick Stolee <dstolee@microsoft.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Documentation/config.txt
cache.h
config.c
environment.c
index f57e9cf10ca485ae0147ee1d01639c94ce97fb56..11f027194e6d3fa9959a2db3d6f1b66e1acc19c0 100644 (file)
@@ -898,6 +898,10 @@ core.notesRef::
 This setting defaults to "refs/notes/commits", and it can be overridden by
 the `GIT_NOTES_REF` environment variable.  See linkgit:git-notes[1].
 
+core.commitGraph::
+       Enable git commit graph feature. Allows reading from the
+       commit-graph file.
+
 core.sparseCheckout::
        Enable "sparse checkout" feature. See section "Sparse checkout" in
        linkgit:git-read-tree[1] for more information.
diff --git a/cache.h b/cache.h
index 21fbcc2414953d00929185aeb97f3a6ae9a3f73a..3a18a02ef9a2ce9ddcb939d3c9b108987180c000 100644 (file)
--- a/cache.h
+++ b/cache.h
@@ -801,6 +801,7 @@ extern char *git_replace_ref_base;
 
 extern int fsync_object_files;
 extern int core_preload_index;
+extern int core_commit_graph;
 extern int core_apply_sparse_checkout;
 extern int precomposed_unicode;
 extern int protect_hfs;
index b0c20e6cb8ab1f5dc3cd3b4573b7e9d6dbf8cd2b..25ee4a676c61d092adc871c68187263626ec3a14 100644 (file)
--- a/config.c
+++ b/config.c
@@ -1226,6 +1226,11 @@ static int git_default_core_config(const char *var, const char *value)
                return 0;
        }
 
+       if (!strcmp(var, "core.commitgraph")) {
+               core_commit_graph = git_config_bool(var, value);
+               return 0;
+       }
+
        if (!strcmp(var, "core.sparsecheckout")) {
                core_apply_sparse_checkout = git_config_bool(var, value);
                return 0;
index de8431e01e7f4a2168e35df2dfa5695d3c810210..0e96be30ca08dc8b1af6ba03a6c000705a035344 100644 (file)
@@ -62,6 +62,7 @@ enum push_default_type push_default = PUSH_DEFAULT_UNSPECIFIED;
 enum object_creation_mode object_creation_mode = OBJECT_CREATION_MODE;
 char *notes_ref_name;
 int grafts_replace_parents = 1;
+int core_commit_graph;
 int core_apply_sparse_checkout;
 int merge_log_config = -1;
 int precomposed_unicode = -1; /* see probe_utf8_pathname_composition() */