From: Junio C Hamano <gitster@pobox.com>
To: Jeff King <peff@peff.net>
Cc: Patrick Steinhardt <ps@pks.im>,
git@vger.kernel.org,
Jean-Christophe Manciot <actionmystique@gmail.com>,
Mikael Magnusson <mikachu@gmail.com>,
Taylor Blau <me@ttaylorr.com>, Derrick Stolee <stolee@gmail.com>
Subject: Re: [PATCH 2/2] run-command: honor "gc.auto" for auto-maintenance
Date: Tue, 12 May 2026 10:21:43 +0900 [thread overview]
Message-ID: <xmqqzf25pgm0.fsf@gitster.g> (raw)
In-Reply-To: <20260511201800.GC22912@coredump.intra.peff.net> (Jeff King's message of "Mon, 11 May 2026 16:18:00 -0400")
Jeff King <peff@peff.net> writes:
> 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
Very good point. I was about to send the same message ;-)
next prev parent reply other threads:[~2026-05-12 1:21 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-11 12:29 [PATCH 0/2] builtin/maintenance: fix locking and respect "gc.auto" Patrick Steinhardt
2026-05-11 12:29 ` [PATCH 1/2] builtin/maintenance: fix locking with "--detach" Patrick Steinhardt
2026-05-12 1:19 ` Junio C Hamano
2026-05-12 5:59 ` Patrick Steinhardt
2026-05-11 12:29 ` [PATCH 2/2] run-command: honor "gc.auto" for auto-maintenance Patrick Steinhardt
2026-05-11 20:18 ` Jeff King
2026-05-12 1:21 ` Junio C Hamano [this message]
2026-05-12 5:59 ` Patrick Steinhardt
2026-05-12 8:30 ` [PATCH v2 0/2] builtin/maintenance: fix locking and respect "gc.auto" Patrick Steinhardt
2026-05-12 8:30 ` [PATCH v2 1/2] builtin/maintenance: fix locking with "--detach" Patrick Steinhardt
2026-05-12 21:14 ` Taylor Blau
2026-05-13 6:23 ` Patrick Steinhardt
2026-05-12 8:30 ` [PATCH v2 2/2] run-command: honor "gc.auto" for auto-maintenance Patrick Steinhardt
2026-05-13 7:31 ` [PATCH v3 0/2] builtin/maintenance: fix locking and respect "gc.auto" Patrick Steinhardt
2026-05-13 7:31 ` [PATCH v3 1/2] builtin/maintenance: fix locking with "--detach" Patrick Steinhardt
2026-05-13 10:06 ` Junio C Hamano
2026-05-13 7:31 ` [PATCH v3 2/2] run-command: honor "gc.auto" for auto-maintenance Patrick Steinhardt
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=xmqqzf25pgm0.fsf@gitster.g \
--to=gitster@pobox.com \
--cc=actionmystique@gmail.com \
--cc=git@vger.kernel.org \
--cc=me@ttaylorr.com \
--cc=mikachu@gmail.com \
--cc=peff@peff.net \
--cc=ps@pks.im \
--cc=stolee@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox