Subject: Re: [PATCH v2 4/9] builtin/maintenance: make the geometric factor configurable

From: Taylor Blau <[email-masked]>
Date: Thu, 23 Oct 2025 15:33:47 -0400

On Tue, Oct 21, 2025 at 04:13:26PM +0200, Patrick Steinhardt wrote:
> The geometric repacking task uses a factor of two for its geometric
> sequence, meaning that each next pack must contain at least twice as
> many objects as the next-smaller one. In some cases it may be helpful to
> configure this factor though to reduce the number of packfile merges
> even further, e.g. in very big repositories. But while git-repack(1)
> itself supports doing this, the maintenance task does not give us a way
> to tune it.
>
> Introduce a new "maintenance.geometric-repack.splitFactor" configuration
> to plug this gap.

Interesting, this wasn't exactly what I had in my mind when reading the
last round, but I think this is worth doing on its own. My apologies for
being ambiguous in my earlier message :-s.

I was suggesting that we have a repack.geometricFactor configuration
variable that defaulted to two, could be overridden by --geometric=<n>,
such that we could start doing "git repack --geometric" without having
to write "=2" every time.

I think that that is probably still a useful thing to do in and of
itself, but this change doesn't preclude our ability to do that, since
it just overwrites what we pass in to 'git repack' when calling it from
within the maintenance context.

> Signed-off-by: Patrick Steinhardt <[email-masked]>
> ---
>  Documentation/config/maintenance.adoc |  5 +++++
>  builtin/gc.c                          |  9 ++++++++-
>  t/t7900-maintenance.sh                | 32 ++++++++++++++++++++++++++++++++
>  3 files changed, 45 insertions(+), 1 deletion(-)
>
> diff --git a/Documentation/config/maintenance.adoc b/Documentation/config/maintenance.adoc
> index 26dc5de423f..45fdafc2c63 100644
> --- a/Documentation/config/maintenance.adoc
> +++ b/Documentation/config/maintenance.adoc
> @@ -86,6 +86,11 @@ maintenance.geometric-repack.auto::
>  	objects that would be written into a new packfile. The default value is
>  	100.
>
> +maintenance.geometric-repack.splitFactor::
> +	This integer config option controls the factor used for the geometric
> +	sequence. See the `--geometric=` option in linkgit:git-repack[1] for
> +	more details. Defaults to `2`.
> +

Looks good.

Thanks,
Taylor