[PATCH 0/2] odb: generalize `reprepare()` callback
- From
Patrick Steinhardt <ps@pks.im>
- Date
- Jun 22, 2026, 08:47 UTC
- Message-ID
- <20260622-b4-pks-odb-generalize-prepare-v1-0-d2a5c5d13144@pks.im>
Hi,
this small patch series generalizes the `reprepare()` callback into a `prepare()` callback that accepts an optional flag to also discard any caches. This is required so that we can make git-grep(1) become fully generic.
The series is built on top of 8d96f09e92 (Merge branch 'js/objects-larger-than-4gb-on-windows', 2026-06-19) with ps/odb-source-packed at 1bba3c035d (odb/source-packed: drop pointer to "files" parent source, 2026-06-17) merged into it.
Thanks!
Patrick
---
Patrick Steinhardt (2):
odb/source: generalize `reprepare()` callback
odb: introduce `odb_prepare()`builtin/grep.c | 14 +++----------- midx.c | 2 +- odb.c | 18 ++++++++++++------ odb.h | 16 ++++++++++++++-- odb/source-files.c | 9 +++++---- odb/source-inmemory.c | 5 +++-- odb/source-loose.c | 8 +++++--- odb/source-packed.c | 34 ++++++++++++++++------------------ odb/source-packed.h | 9 --------- odb/source.h | 16 +++++++++------- packfile.c | 2 +- 11 files changed, 69 insertions(+), 64 deletions(-)
--- base-commit: 4a8e7a446f41435e157131162dfe901eca9250fe change-id: 20260612-b4-pks-odb-generalize-prepare-509ffc18f502