Re: [PATCH v2 3/3] sequencer: keep auto maintenance out of the commands a sequence spawns
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Sep 4, 2026, 21:21 UTC
- Message-ID
- <xmqqwlt03e6k.fsf@gitster.g>
- In-Reply-To
- <9a6fc0427a8bc7e7abcc0518214b1dafc2efaa6a.1788537086.git.gitgitgadget@gmail.com>
"Thomas Bachem via GitGitGadget" <gitgitgadget@gmail.com> writes:
Show 5 quoted lines
> + /* > + * The GIT_CONFIG_PARAMETERS value that keeps auto maintenance out > + * of the commands we spawn, built on first use. > + */ > + struct strbuf config_parameters;
Does this have to be a "struct strbuf", not "const char *"? The latter makes it clear that it will never change its value once you built it in disable_auto_maintenance().
Show 15 quoted lines
> +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);
> +}This would then become something like
if (!opts->ctx->config_parameters) {
const char *old = getenv(CONFIG_DATA_ENVIRONMENT);
struct strbuf params = STRBUF_INIT;if (old && *old) strbuf_addstr(¶ms, old); git_config_append_parameter(¶ms, "maintenance.auto", "0"); git_config_append_parameter(¶ms, "gc.auto", "0"); opts->ctx->config_parameters = strbuf_detach(¶ms, NULL); } strbuf_pushf(..., opts->ctx->config_parameters);