From: Justin Tobler Date: Wed, 04 Mar 2026 21:49:01 GMT Subject: Re: [PATCH 15/17] odb/source: make `read_alternates()` function pluggable Message-ID: In-Reply-To: <20260223-b4-pks-odb-source-pluggable-v1-15-253bac1db598@pks.im> On 26/02/23 05:18PM, Patrick Steinhardt wrote: > Introduce a new callback function in `struct odb_source` to make the > function pluggable. > > Signed-off-by: Patrick Steinhardt > --- [snip] > diff --git a/odb/source.h b/odb/source.h > index ddce43eb20..14f5d56f68 100644 > --- a/odb/source.h > +++ b/odb/source.h > @@ -55,6 +55,7 @@ struct object_id; > struct object_info; > struct odb_read_stream; > struct odb_write_stream; > +struct strvec; > > /* > * A callback function that can be used to iterate through objects. If given, > @@ -229,6 +230,20 @@ struct odb_source { > int (*write_object_stream)(struct odb_source *source, > struct odb_write_stream *stream, size_t len, > struct object_id *oid); > + > + /* > + * This callback is expected to read the list of alternate object > + * database sources connected to it and write them into the `strvec`. > + * > + * The format is expected to follow the "objectStorage" extension > + * format with `(backend://)?payload` syntax. If the payload contains > + * paths, these paths must be resolved to absolute paths. This seems sensible, but also sounds like a change that might be worth explaining in the commit message. Does this mean we should expect an alternates file containing list prefixed with "files://" to start working? If so, this doesn't appear to be implemented yet. -Justin