Re: [PATCH v5 09/15] packfile: split up responsibilities of `reprepare_packed_git()`
- From
Patrick Steinhardt <ps@pks.im>
- Date
- Sep 23, 2025, 09:34 UTC
- Message-ID
- <aNJpvS1jk4ww0JXk@pks.im>
- In-Reply-To
- <p6f3xtitrepajnaho4eqwoh7o2qweim6adr3x726dbwg63kmny@cx5n43myawue>
On Wed, Sep 17, 2025 at 05:32:43PM -0500, Justin Tobler wrote:
Show 38 quoted lines
> On 25/09/15 10:54AM, Patrick Steinhardt wrote:
> > diff --git a/odb.h b/odb.h
> > index 1c998a2478..ef34132c58 100644
> > --- a/odb.h
> > +++ b/odb.h
> > @@ -163,6 +163,12 @@ struct object_database {
> > struct object_database *odb_new(struct repository *repo);
> > void odb_clear(struct object_database *o);
> >
> > +/*
> > + * Clear caches, reload alternates and then reload object sources so that new
> > + * objects may become accessible.
> > + */
> > +void odb_reprepare(struct object_database *o);
>
> nit: IMO, something like `odb_reload()` sounds a bit better, but it's
> not a big deal either way.
>
> [snip]
> > diff --git a/packfile.h b/packfile.h
> > index bf66211986..a85ff607fe 100644
> > --- a/packfile.h
> > +++ b/packfile.h
> > @@ -112,6 +112,14 @@ void packfile_store_free(struct packfile_store *store);
> > */
> > void packfile_store_close(struct packfile_store *store);
> >
> > +/*
> > + * Clear the packfile caches and try to look up any new packfiles that have
> > + * appeared since last preparing the packfiles store.
> > + *
> > + * This function must be called under the `odb_read_lock()`.
> > + */
> > +void packfile_store_reprepare(struct packfile_store *store);
>
> nit: I also think `packfile_store_reload()` sounds a bit nicer here.
>
> Overall this patch looks good. :)Seen in a void I'd agree, but "preparing" and "repreparing" have been terms that we already used for quite a long time in this context. So I'd rather continue using them for now.
Patrick