]> git.ipfire.org Git - thirdparty/git.git/commit
builtin/maintenance: introduce "geometric-repack" task
authorPatrick Steinhardt <ps@pks.im>
Fri, 24 Oct 2025 06:57:16 +0000 (08:57 +0200)
committerJunio C Hamano <gitster@pobox.com>
Fri, 24 Oct 2025 20:42:43 +0000 (13:42 -0700)
commit9bc151850c1c593f4baf8d6d2a1d14bb4875844a
tree702f25cf8d1501e1f5a61f5f140a324a473e79e8
parent60c0af8e20b7c347003c40ca342a074239ea8453
builtin/maintenance: introduce "geometric-repack" task

Introduce a new "geometric-repack" task. This task uses our geometric
repack infrastructure as provided by git-repack(1) itself, which is a
strategy that especially hosting providers tend to use to amortize the
costs of repacking objects.

There is one issue though with geometric repacks, namely that they
unconditionally pack all loose objects, regardless of whether or not
they are reachable. This is done because it means that we can completely
skip the reachability step, which significantly speeds up the operation.
But it has the big downside that we are unable to expire objects over
time.

To address this issue we thus use a split strategy in this new task:
whenever a geometric repack would merge together all packs, we instead
do an all-into-one repack. By default, these all-into-one repacks have
cruft packs enabled, so unreachable objects would now be written into
their own pack. Consequently, they won't be soaked up during geometric
repacking anymore and can be expired with the next full repack, assuming
that their expiry date has surpassed.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Acked-by: Taylor Blau <me@ttaylorr.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Documentation/config/maintenance.adoc
builtin/gc.c
t/t7900-maintenance.sh