Re: [PATCH v2 05/10] odb: provide infrastructure for pluggable fsck checks
- From
Patrick Steinhardt <ps@pks.im>
- Date
- Sep 11, 2026, 12:23 UTC
- Message-ID
- <aqPyqg0no7k-VHty@pks.im>
- In-Reply-To
- <87a4ponipw.fsf@emacs.iotcl.com>
On Fri, Sep 11, 2026 at 01:14:03PM +0200, Toon Claes wrote:
Show 22 quoted lines
> Patrick Steinhardt <ps@pks.im> writes:
> > diff --git a/odb.c b/odb.c
> > index 1fe20808eb..766043b685 100644
> > --- a/odb.c
> > +++ b/odb.c
> > @@ -1177,3 +1177,12 @@ void odb_reprepare(struct object_database *o)
> > {
> > odb_prepare(o, ODB_PREPARE_FLUSH_CACHES);
> > }
> > +
> > +int odb_fsck(struct object_database *odb, struct odb_fsck_options *options)
> > +{
> > + int ret = 0;
> > + for (struct odb_source *source = odb->sources; source; source = source->next)
> > + if ((options->flags & ODB_FSCK_FULL) || source->local)
> > + ret |= odb_source_fsck(source, options);
>
> Shouldn't it be the responsibility of the source to determine whether it
> should be included due to the `--full` flag? In the future there might
> be other types of sources which have possibly a different meaning for
> "local". So would it make sense to have them check for ODB_FSCK_FULL
> themselves.That's actually a sensible idea, doubly so because we're going to move handling of alternates into the source itself. So at that point, we would be forced to move it into the "files" backend anyway. Will adapt.
Patrick