Re: [PATCH 7/7] builtin/maintenance: fix auto-detach with non-standard tasks
- From
James Liu <james@jamesliu.io>
- Date
- Aug 15, 2024, 06:40 UTC
- Message-ID
- <D3GA39J7D5UW.KCFXXN036OD@jamesliu.io>
- In-Reply-To
- <8d6cbae951177718b49d5cfbbeca2d5b0073e266.1723533091.git.ps@pks.im>
On Tue Aug 13, 2024 at 5:18 PM AEST, Patrick Steinhardt wrote:
Show 24 quoted lines
> diff --git a/run-command.c b/run-command.c
> index 45ba544932..94f2f3079f 100644
> --- a/run-command.c
> +++ b/run-command.c
> @@ -1808,16 +1808,26 @@ void run_processes_parallel(const struct run_process_parallel_opts *opts)
>
> int prepare_auto_maintenance(int quiet, struct child_process *maint)
> {
> - int enabled;
> + int enabled, auto_detach;
>
> if (!git_config_get_bool("maintenance.auto", &enabled) &&
> !enabled)
> return 0;
>
> + /*
> + * When `maintenance.autoDetach` isn't set, then we fall back to
> + * honoring `gc.autoDetach`. This is somewhat weird, but required to
> + * retain behaviour from when we used to run git-gc(1) here.
> + */
> + if (git_config_get_bool("maintenance.autodetach", &auto_detach) &&
> + git_config_get_bool("gc.autodetach", &auto_detach))
> + auto_detach = 1;
> +Do the two `*.autodetach` values need to be camel-cased or does it not matter? I've noticed a mix of both through the codebase so I suppose it's not case-sensitive.