]> git.ipfire.org Git - thirdparty/git.git/commit
refs: add a generic 'optimize' API
authorMeet Soni <meetsoni3017@gmail.com>
Fri, 19 Sep 2025 08:26:39 +0000 (13:56 +0530)
committerJunio C Hamano <gitster@pobox.com>
Fri, 19 Sep 2025 17:02:55 +0000 (10:02 -0700)
commit8dfe077fb68eb952464ce59deaa4dfdd52891457
tree9d14c9fcf9ef8548f0ba0a682405d5918b3230ba
parentf814da676ae46aac5be0a98b99373a76dee6cedb
refs: add a generic 'optimize' API

The existing `pack-refs` API is conceptually tied to the 'files'
backend, but its behavior is generic (e.g., it triggers compaction for
reftable). This naming is confusing.

Introduce a new generic refs_optimize() API that dispatches to a
backend-specific implementation via a new 'optimize' vtable method.

This lays the architectural groundwork for different reference backends
(like 'files' and 'reftable') to provide their own storage optimization
logic, which will be called from a single, generic entry point.

Mentored-by: Patrick Steinhardt <ps@pks.im>
Mentored-by: shejialuo <shejialuo@gmail.com>
Signed-off-by: Meet Soni <meetsoni3017@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
refs.c
refs.h
refs/refs-internal.h