Re: [PATCH 07/17] odb/source: make `reprepare()` function pluggable
- From
Justin Tobler <jltobler@gmail.com>
- Date
- Mar 4, 2026, 21:08 UTC
- Message-ID
- <aaiei2ZN37i0Xkf8@denethor>
- In-Reply-To
- <20260223-b4-pks-odb-source-pluggable-v1-7-253bac1db598@pks.im>
On 26/02/23 05:17PM, Patrick Steinhardt wrote:
Show 5 quoted lines
> Introduce a new callback function in `struct odb_source` to make the > function pluggable. > > Signed-off-by: Patrick Steinhardt <ps@pks.im> > ---
[snip]
Show 15 quoted lines
> diff --git a/odb/source.h b/odb/source.h
> index f84da59ef0..2f8132f9e1 100644
> --- a/odb/source.h
> +++ b/odb/source.h
> @@ -58,6 +58,13 @@ struct odb_source {
> * all associated resources. The function will never be called with a NULL pointer.
> */
> void (*free)(struct odb_source *source);
> +
> + /*
> + * This callback is expected to clear underlying caches of the object
> + * database source. The function is called when the repository has for
> + * example just been repacked so that new objects will become visible.
> + */
> + void (*reprepare)(struct odb_source *source);Naive question: does repreparing a source still make sense outside of the "files" ODB source? I almost sounds like it should be an internal detail of the source when reading objects.
-Justin