]> git.ipfire.org Git - thirdparty/git.git/commit
docs/git-pack-refs: document heuristic used for packing loose refs
authorPatrick Steinhardt <ps@pks.im>
Tue, 8 Jul 2025 11:23:56 +0000 (13:23 +0200)
committerJunio C Hamano <gitster@pobox.com>
Tue, 8 Jul 2025 20:44:31 +0000 (13:44 -0700)
commitad7780b38fae2fb915404a59b0c904da8ed154a6
treec57e8921e0806d5d3878a6570931f224c5e1f01c
parenta52a24e03c8c711f1d5e252fba78f9276908129b
docs/git-pack-refs: document heuristic used for packing loose refs

The `git pack-refs --auto` flag asks the ref backend to decide for
itself whether or not references need to be repacked. This is done to
ensure that we don't repack in cases where the backend is already in a
good-enough state, which is typically the case for the "reftable"
backend that performs auto-compaction on writes.

As such, we initially only had heuristics in place for the "reftable"
backend. The "files" backend didn't have any heuristics, so we'd repack
loose references every time `git pack-refs --auto` was executed. This
caused excessive repacking with that backend though, which is why we
eventually implemented a heuristic via c3459ae9ef2 (refs/files: use
heuristic to decide whether to repack with `--auto`, 2024-09-04).

The documentation for the `--auto` flag hasn't been updated accordingly
and still claims that we don't have any metrics for the "files" backend.
Update it to reflect the new reality.

Reported-by: Karthik Nayak <karthik.188@gmail.com>
Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Documentation/git-pack-refs.txt