Re: [PATCH v2 3/3] sequencer: keep auto maintenance out of the commands a sequence spawns
From: Patrick Steinhardt <hidden>
Date: 2026-09-07 08:14:22
On Fri, Sep 04, 2026 at 03:51:26PM +0000, Thomas Bachem via GitGitGadget wrote:
quoted hunk ↗ jump to hunk
diff --git a/sequencer.c b/sequencer.c index 67e1c38762..5df07750a7 100644 --- a/sequencer.c +++ b/sequencer.c@@ -1107,6 +1114,27 @@ static int run_command_silent_on_success(struct child_process *cmd) return rc; } +/* + * A sequence runs auto maintenance once it is done, not from every command + * it spawns along the way: their background "rerere gc" or repack would + * race the sequencer for locks and files it still holds. + */ +static void disable_auto_maintenance(struct replay_opts *opts, + struct child_process *cmd) +{ + struct strbuf *params = &opts->ctx->config_parameters; + + if (!params->len) { + const char *old = getenv(CONFIG_DATA_ENVIRONMENT); + + if (old && *old) + strbuf_addstr(params, old); + git_config_append_parameter(params, "maintenance.auto", "false"); + git_config_append_parameter(params, "gc.auto", "0"); + } + strvec_pushf(&cmd->env, "%s=%s", CONFIG_DATA_ENVIRONMENT, params->buf); +} +
Why do you set both "maintenance.auto" and "gc.auto"? Setting only the former should be sufficient, as maintenance uses git-maintenance(1) exclusively nowadays. Sure, it may trigger git-gc(1) internally. But it won't ever do so if auto-maintenance is completely disabled. Patrick