Skip to content

Commit 1b70dfd

Browse files
derrickstoleegitster
authored andcommitted
commit-graph: add core.commitGraph setting
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 2a2e32b commit 1b70dfd

File tree

4 files changed

+11
-0
lines changed

4 files changed

+11
-0
lines changed

Documentation/config.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -898,6 +898,10 @@ core.notesRef::
898898
This setting defaults to "refs/notes/commits", and it can be overridden by
899899
the `GIT_NOTES_REF` environment variable. See linkgit:git-notes[1].
900900

901+
core.commitGraph::
902+
Enable git commit graph feature. Allows reading from the
903+
commit-graph file.
904+
901905
core.sparseCheckout::
902906
Enable "sparse checkout" feature. See section "Sparse checkout" in
903907
linkgit:git-read-tree[1] for more information.

cache.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -801,6 +801,7 @@ extern char *git_replace_ref_base;
801801

802802
extern int fsync_object_files;
803803
extern int core_preload_index;
804+
extern int core_commit_graph;
804805
extern int core_apply_sparse_checkout;
805806
extern int precomposed_unicode;
806807
extern int protect_hfs;

config.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1226,6 +1226,11 @@ static int git_default_core_config(const char *var, const char *value)
12261226
return 0;
12271227
}
12281228

1229+
if (!strcmp(var, "core.commitgraph")) {
1230+
core_commit_graph = git_config_bool(var, value);
1231+
return 0;
1232+
}
1233+
12291234
if (!strcmp(var, "core.sparsecheckout")) {
12301235
core_apply_sparse_checkout = git_config_bool(var, value);
12311236
return 0;

environment.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ enum push_default_type push_default = PUSH_DEFAULT_UNSPECIFIED;
6262
enum object_creation_mode object_creation_mode = OBJECT_CREATION_MODE;
6363
char *notes_ref_name;
6464
int grafts_replace_parents = 1;
65+
int core_commit_graph;
6566
int core_apply_sparse_checkout;
6667
int merge_log_config = -1;
6768
int precomposed_unicode = -1; /* see probe_utf8_pathname_composition() */

0 commit comments

Comments
 (0)