From: Patrick Steinhardt Date: Thu, 15 Jan 2026 11:04:29 GMT Subject: [PATCH 00/14] odb: introduce `odb_for_each_object()` Message-ID: <20260115-pks-odb-for-each-object-v1-0-5418a91d5d99@pks.im> Hi, this patch series introduces a generic `odb_for_each_object()` function to iterate through objects and adapts callers to use it. The intent is to make iteration through objects independent of the actual storage backend. The series is structured as follows: - Commits 1 to 2 do some cleanups for the for-each-object flags. - Commits 3 to 7 introduce the infrastructure for `odb_for_each_object()`. - Commits 8 to 13 convert a couple of callers to use the new interfaces. - Commit 14 drops now-unused functions. The patch series is built on top of 8745eae506 (The 17th batch, 2026-01-11) with the following two series merged into it: - ps/read-object-info-improvements at b7f649ca93 (Merge remote-tracking branch 'junio/ps/read-object-info-improvements' into HEAD, 2026-01-15). - ps/packfile-store-in-odb-source at 1ff0e42d33 (Merge remote-tracking branch 'junio/ps/packfile-store-in-odb-source' into HEAD, 2026-01-15). Thanks! Patrick --- Patrick Steinhardt (14): odb: rename `FOR_EACH_OBJECT_*` flags odb: fix flags parameter to be unsigned object-file: extract function to read object info from path object-file: introduce function to iterate through objects packfile: extract function to iterate through objects of a store packfile: introduce function to iterate through objects odb: introduce `odb_for_each_object()` builtin/fsck: refactor to use `odb_for_each_object()` treewide: enumerate promisor objects via `odb_for_each_object()` treewide: drop uses of `for_each_{loose,packed}_object()` odb: introduce mtime fields for object info requests builtin/pack-objects: use `packfile_store_for_each_object()` reachable: convert to use `odb_for_each_object()` odb: drop unused `for_each_{loose,packed}_object()` functions builtin/cat-file.c | 30 +++++++-- builtin/fsck.c | 57 ++++------------ builtin/pack-objects.c | 47 +++++++------- commit-graph.c | 46 +++++++++---- object-file.c | 120 ++++++++++++++++++++++------------ object-file.h | 21 +++--- odb.c | 29 +++++++++ odb.h | 43 ++++++++++-- packfile.c | 173 +++++++++++++++++++++++++++++++++---------------- packfile.h | 18 ++++- reachable.c | 129 +++++++++++------------------------- repack-promisor.c | 8 +-- revision.c | 10 ++- 13 files changed, 420 insertions(+), 311 deletions(-) --- base-commit: 1ff0e42d332523a11cc3d61b8d8463db5f9f14e8 change-id: 20260115-pks-odb-for-each-object-60b78cde09fd