Subject: Re: [PATCH 05/13] object-file: introduce `struct odb_loose_source`

From: Patrick Steinhardt <[email-masked]>
Date: Fri, 31 Oct 2025 07:11:04 +0100

On Thu, Oct 30, 2025 at 12:32:21PM +0100, Patrick Steinhardt wrote:
> On Thu, Oct 30, 2025 at 03:47:58AM -0700, Karthik Nayak wrote:
> > Patrick Steinhardt <[email-masked]> writes:
> > 
> > > Currently, all state that relates to loose objects is held directly by
> > > the `struct odb_source`. Introduce a new `struct odb_loose_source` to
> > > hold the state instead so that it is entirely self-contained.
> > >
> > 
> > I wonder if the naming should instead be `struct obd_source_loose` that
> > way other backends (if added) would be something like:
> > 
> >     struct obd_source_loose
> >     struct obd_source_postgres
> >     struct obd_source_mongo
> > 
> > This is easier to read and also for autocompletion it leads nicely into
> > the 'obd_source_...' namespace.
> 
> Hm, I see your point. I think that "loose source" flows a bit more
> natural, but I agree that the above is more accessible in code.
> 
> Before I change this: does anybody else have an opinion here?

I think for now I'll stick to the current naming. This is due to two
reasons:

  - As said, I think this flows more naturally in language. When talking
    about this you'll say "I'm using the files source" or "I'm using the
    whatever source".

  - It somewhat matches the naming we have in the reference backends,
    where we have `struct reftable_backend` and `struct files_backend`.

That being said I don't feel very strong about this. So I'll post v2
with the current naming, but if either you or somebody else feels
strongly that this should be adjusted I'm happy to adapt.

Thanks!

Patrick