Subject: Re: [PATCH 2/2] run-command: honor "gc.auto" for auto-maintenance

From: Jeff King <[email-masked]>
Date: Mon, 11 May 2026 16:18:00 -0400

On Mon, May 11, 2026 at 02:29:56PM +0200, Patrick Steinhardt wrote:

> @@ -1946,8 +1946,10 @@ int prepare_auto_maintenance(struct repository *r, int quiet,
>  {
>  	int enabled, auto_detach;
>  
> -	if (!repo_config_get_bool(r, "maintenance.auto", &enabled) &&
> -	    !enabled)
> +	if (repo_config_get_bool(r, "maintenance.auto", &enabled) &&
> +	    repo_config_get_bool(r, "gc.auto", &enabled))
> +		enabled = 1;
> +	if (!enabled)
>  		return 0;

gc.auto isn't a bool; it's the count of loose objects after which to run
maintenance. So "0" works in both contexts, but will we complain if
gc.auto is set to 100? I think maybe not, because we fall back to
git_parse_int(), but it feels kind of fragile.

The gc code uses repo_config_get_int() here.

-Peff