From 65d655b52df3d4db0b4980f60106ed9785d025f8 Mon Sep 17 00:00:00 2001 From: Derrick Stolee Date: Thu, 17 Sep 2020 18:11:49 +0000 Subject: maintenance: create maintenance..enabled config Currently, a normal run of "git maintenance run" will only run the 'gc' task, as it is the only one enabled. This is mostly for backwards- compatible reasons since "git maintenance run --auto" commands replaced previous "git gc --auto" commands after some Git processes. Users could manually run specific maintenance tasks by calling "git maintenance run --task=" directly. Allow users to customize which steps are run automatically using config. The 'maintenance..enabled' option then can turn on these other tasks (or turn off the 'gc' task). Signed-off-by: Derrick Stolee Signed-off-by: Junio C Hamano --- Documentation/config/maintenance.txt | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 Documentation/config/maintenance.txt (limited to 'Documentation/config') diff --git a/Documentation/config/maintenance.txt b/Documentation/config/maintenance.txt new file mode 100644 index 0000000000..4402b8b49f --- /dev/null +++ b/Documentation/config/maintenance.txt @@ -0,0 +1,6 @@ +maintenance..enabled:: + This boolean config option controls whether the maintenance task + with name `` is run when no `--task` option is specified to + `git maintenance run`. These config values are ignored if a + `--task` option exists. By default, only `maintenance.gc.enabled` + is true. -- cgit v1.2.3 From 4ddc79b2dac18189e7ff18e99a6fabdd161f866c Mon Sep 17 00:00:00 2001 From: Derrick Stolee Date: Thu, 17 Sep 2020 18:11:51 +0000 Subject: maintenance: add auto condition for commit-graph task Instead of writing a new commit-graph in every 'git maintenance run --auto' process (when maintenance.commit-graph.enalbed is configured to be true), only write when there are "enough" commits not in a commit-graph file. This count is controlled by the maintenance.commit-graph.auto config option. To compute the count, use a depth-first search starting at each ref, and leaving markers using the SEEN flag. If this count reaches the limit, then terminate early and start the task. Otherwise, this operation will peel every ref and parse the commit it points to. If these are all in the commit-graph, then this is typically a very fast operation. Users with many refs might feel a slow-down, and hence could consider updating their limit to be very small. A negative value will force the step to run every time. Signed-off-by: Derrick Stolee Signed-off-by: Junio C Hamano --- Documentation/config/maintenance.txt | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'Documentation/config') diff --git a/Documentation/config/maintenance.txt b/Documentation/config/maintenance.txt index 4402b8b49f..7cc6700d57 100644 --- a/Documentation/config/maintenance.txt +++ b/Documentation/config/maintenance.txt @@ -4,3 +4,13 @@ maintenance..enabled:: `git maintenance run`. These config values are ignored if a `--task` option exists. By default, only `maintenance.gc.enabled` is true. + +maintenance.commit-graph.auto:: + This integer config option controls how often the `commit-graph` task + should be run as part of `git maintenance run --auto`. If zero, then + the `commit-graph` task will not run with the `--auto` option. A + negative value will force the task to run every time. Otherwise, a + positive value implies the command should run when the number of + reachable commits that are not in the commit-graph file is at least + the value of `maintenance.commit-graph.auto`. The default value is + 100. -- cgit v1.2.3