From: Patrick Steinhardt <ps@pks.im>
To: Junio C Hamano <gitster@pobox.com>
Cc: Jeff King <peff@peff.net>,
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 07:59:12 +0200 [thread overview]
Message-ID: <agLBsD3y6x2ehO7G@pks.im> (raw)
In-Reply-To: <xmqqzf25pgm0.fsf@gitster.g>
On Tue, May 12, 2026 at 10:21:43AM +0900, Junio C Hamano wrote:
> 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 ;-)
Ugh, true indeed. Will fix, thanks!
Patrick
next prev parent reply other threads:[~2026-05-12 5:59 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
2026-05-12 5:59 ` Patrick Steinhardt [this message]
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=agLBsD3y6x2ehO7G@pks.im \
--to=ps@pks.im \
--cc=actionmystique@gmail.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=me@ttaylorr.com \
--cc=mikachu@gmail.com \
--cc=peff@peff.net \
--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