]> git.99rst.org Git - git.git/commit
builtin/gc: move geometric repacking into `odb_optimize()`
authorPatrick Steinhardt <redacted>
Mon, 13 Jul 2026 05:52:11 +0000 (07:52 +0200)
committerJunio C Hamano <redacted>
Mon, 13 Jul 2026 15:13:16 +0000 (08:13 -0700)
commit7d663dd83ba2ae459178c98f96c0761d044698b4
tree90cea08a9d792cbab0df7deb4df654a443f24adc
parentcc78c5029e62e6e1283c7d05bf60d845922aac9b
builtin/gc: move geometric repacking into `odb_optimize()`

We have two major object database optimization strategies:

  - The legacy strategy used by git-gc(1), which absorbs loose objects
    into packfiles, and eventually merges all packfiles once we have too
    many of them.

  - The more recent "geometric" strategy used by git-maintenance(1),
    which merges packfiles using a geometric sequence.

These two strategies are still using completely separate code paths. In
a subsequent commit we'll want to make both strategies pluggable though.

Prepare for this change by merging the "geometric" strategy into
`odb_optimize()`. This also allows us to reuse some of the logic we have
in that function.

Note that this change requires us to adapt tests because we're now using
"-q" instead of "--quiet". Naturally though, these invocations are of
course equivalent to one another.

Signed-off-by: Patrick Steinhardt <redacted>
Signed-off-by: Junio C Hamano <redacted>
builtin/gc.c
t/t7900-maintenance.sh
git clone https://git.99rst.org/PROJECT