@@ -345,6 +345,8 @@ include::config/difftool.txt[]
include::config/fastimport.txt[]
+include::config/feature.txt[]
+
include::config/fetch.txt[]
include::config/format.txt[]
@@ -577,7 +577,8 @@ the `GIT_NOTES_REF` environment variable. See linkgit:git-notes[1].
core.commitGraph::
If true, then git will read the commit-graph file (if it exists)
- to parse the graph structure of commits. Defaults to false. See
+ to parse the graph structure of commits. Defaults to false, unless
+ `feature.manyCommits` is enabled. See
linkgit:git-commit-graph[1] for more information.
core.useReplaceRefs::
new file mode 100644
@@ -0,0 +1,15 @@
+feature.*::
+ The config settings that start with `feature.` modify the defaults of
+ a group of other config settings. These groups are created by the Git
+ developer community as recommended defaults and are subject to change.
+ In particular, new config options may be added with different defaults.
+
+feature.manyCommits::
+ Enable config options that optimize for repos with many commits. This
+ setting is recommended for repos with at least 100,000 commits. The
+ new default values are:
++
+* `core.commitGraph=true` enables reading the commit-graph file.
++
+* `gc.writeCommitGraph=true` enables writing the commit-graph file during
+garbage collection.
\ No newline at end of file
@@ -63,8 +63,8 @@ gc.writeCommitGraph::
If true, then gc will rewrite the commit-graph file when
linkgit:git-gc[1] is run. When using `git gc --auto`
the commit-graph will be updated if housekeeping is
- required. Default is false. See linkgit:git-commit-graph[1]
- for details.
+ required. Default is false, unless `feature.manyCommits`
+ is enabled. See linkgit:git-commit-graph[1] for details.
gc.logExpiry::
If the file gc.log exists, then `git gc --auto` will print
@@ -3,6 +3,8 @@
#include "config.h"
#include "repo-settings.h"
+#define UPDATE_DEFAULT(s,v) do { if (s == -1) { s = v; } } while(0)
+
void prepare_repo_settings(struct repository *r)
{
int value;
@@ -24,5 +26,10 @@ void prepare_repo_settings(struct repository *r)
if (!repo_config_get_bool(r, "pack.usesparse", &value))
r->settings.pack_use_sparse = value;
+ if (!repo_config_get_bool(r, "feature.manycommits", &value) && value) {
+ UPDATE_DEFAULT(r->settings.core_commit_graph, 1);
+ UPDATE_DEFAULT(r->settings.gc_write_commit_graph, 1);
+ }
+
r->settings_initialized = 1;
}