[PATCH 00/13] Carve out loose object source
- From
Patrick Steinhardt <ps@pks.im>
- Date
- Oct 24, 2025, 09:55 UTC
- Message-ID
- <20251024-b4-pks-odb-loose-backend-v1-0-1a4202273c38@pks.im>
Hi,
this patch series carves out loose object sources. The idea is to store all data that relates to loose objects in a single structure, similar to our `struct packfile_store`.
The series is structured as follows:
- Patches 1 to 4 perform some cleanups in the vicinity of object
databases. - Patches 5 to 8 create a new `struct odb_loose_source` and move all
state that is specific to loose objects into it. - Patches 9 to 13 then adjust functions to work on top of that new
structure.The motivation here is to make handling of loose objects completely self-contained as a step towards pluggable object databases.
Thanks!
Patrick
---
Patrick Steinhardt (13):
odb: fix subtle logic to check whether an alternate is usable
odb: introduce `odb_source_new()`
odb: adjust naming to free object sources
object-file: move `fetch_if_missing`
object-file: introduce `struct odb_loose_source`
object-file: move loose object cache into loose source
object-file: hide internals when we need to reprepare loose sources
object-file: move loose object map into loose source
object-file: read objects via the loose object source
object-file: rename `has_loose_object()`
object-file: refactor freshening of objects
object-file: rename `write_object_file()`
object-file: refactor writing objects via a streambuiltin/pack-objects.c | 4 +- builtin/unpack-objects.c | 7 +- loose.c | 19 ++--- object-file.c | 175 +++++++++++++++++++++-------------------------- object-file.h | 98 ++++++++++++++------------ object-name.c | 2 +- odb.c | 104 +++++++++++++++++++--------- odb.h | 41 +++++++---- packfile.c | 16 +++++ packfile.h | 3 + repository.c | 14 ++-- streaming.c | 11 ++- 12 files changed, 287 insertions(+), 207 deletions(-)
--- base-commit: c54a18ef67e59cdbcd77d6294916d42c98c62d1d change-id: 20251017-b4-pks-odb-loose-backend-b1e003c41107