From: Patrick Steinhardt Date: Thu, 04 Jun 2026 11:25:27 GMT Subject: [PATCH 00/16] odb: make packed object source a proper `struct odb_source` Message-ID: <20260604-pks-odb-source-packed-v1-0-2e7ab31b4b5c@pks.im> Hi, this patch series converts the "packed" source into a proper `struct odb_source`. It's thus the equivalent to [1], which did the same thing for the "loose" source. This series here is unfortunately a bit bigger, mostly because I'm also renaming `struct packfile_store` to `struct odb_source_packed`. Back when I introduced the packfile store I didn't yet have the full vision of how the final layout will look like, so I didn't have the foresight yet to call it `struct odb_source_packed`. But now that the layout has materialized I think it's sensible to adjust its naming to match all the other sources that we have. Also: I don't have anything else in the pipeline anymore that moves around large pieces of our code in the vicinity of the object database. So after this series got merged, subsequent changes should be of a more incremental nature. This series is built on top of 9ac3f193c0 (The 11th batch, 2026-06-02) with ps/odb-source-loose at ef4778bcba (odb/source-loose: drop pointer to the "files" source, 2026-06-01) merged into it. Note that there's a trivial conflict with 8570d9ba31 (Merge branch 'wy/docs-typofixes' into seen, 2026-06-04) that can be solved like this: diff --cc packfile.h index ed49ab7f21,5729a37018..0000000000 --- a/packfile.h +++ b/packfile.h diff --git a/odb/source-packed.h b/odb/source-packed.h index ef5a10b224..1d312f7dea 100644 --- a/odb/source-packed.h +++ b/odb/source-packed.h @@ -61,7 +61,7 @@ struct odb_source_packed { * that packs that contain a lot of accessed objects will be located * towards the front. * - * This is usually desireable, but there are exceptions. One exception + * This is usually desirable, but there are exceptions. One exception * is when the looking up multiple objects in a loop for each packfile. * In that case, we may easily end up with an infinite loop as the * packfiles get reordered to the front repeatedly. Thanks! Patrick [1]: <20260521-b4-pks-odb-source-loose-v1-0-6553b399be2d@pks.im> --- Patrick Steinhardt (16): packfile: rename `struct packfile_store` to `odb_source_packed` packfile: move packed source into "odb/" subsystem odb/source-packed: store pointer to "files" instead of generic source odb/source-packed: start converting to a proper `struct odb_source` odb/source-packed: wire up `close()` callback odb/source-packed: wire up `reprepare()` callback packfile: use higher-level interface to implement `has_object_pack()` odb/source-packed: wire up `read_object_info()` callback odb/source-packed: wire up `read_object_stream()` callback odb/source-packed: wire up `for_each_object()` callback odb/source-packed: wire up `count_objects()` callback odb/source-packed: wire up `find_abbrev_len()` callback odb/source-packed: wire up `freshen_object()` callback odb/source-packed: stub out remaining functions midx: refactor interfaces to work on "packed" source odb/source-packed: drop pointer to "files" parent source Makefile | 1 + builtin/cat-file.c | 4 +- builtin/grep.c | 2 +- builtin/multi-pack-index.c | 29 +- builtin/pack-objects.c | 7 +- builtin/repack.c | 8 +- commit-graph.c | 4 +- meson.build | 1 + midx-write.c | 34 +- midx.c | 118 +++---- midx.h | 30 +- odb/source-files.c | 20 +- odb/source-files.h | 4 +- odb/source-packed.c | 764 +++++++++++++++++++++++++++++++++++++++++++++ odb/source-packed.h | 102 ++++++ odb/source.h | 3 + pack-bitmap.c | 8 +- pack-revindex.c | 6 +- packfile.c | 701 +---------------------------------------- packfile.h | 166 +--------- repack-geometry.c | 3 +- repack-midx.c | 9 +- repack.c | 6 +- t/helper/test-read-midx.c | 7 +- 24 files changed, 1054 insertions(+), 983 deletions(-) --- base-commit: 06d49cec508464ced5d42541890ce5d749542a61 change-id: 20260602-pks-odb-source-packed-3826c352f059