Re: [PATCH v5 08/11] refs/files: lazy-load configuration to fix chicken-and-egg
On Wed, Jun 24, 2026 at 04:36:28PM -0500, Justin Tobler wrote:
Show 24 quoted lines
> On 26/06/22 10:28AM, Patrick Steinhardt wrote:
> > diff --git a/refs/files-backend.c b/refs/files-backend.c
> > index 79fb6735e1..d0f379dcd6 100644
> > --- a/refs/files-backend.c
> > +++ b/refs/files-backend.c
> > @@ -84,12 +84,14 @@ struct files_ref_store {
> > unsigned int store_flags;
> >
> > char *gitcommondir;
> > - enum log_refs_config log_all_ref_updates;
> > - int prefer_symlink_refs;
> > -
> > struct ref_cache *loose;
> > -
> > struct ref_store *packed_ref_store;
> > +
> > + struct files_ref_store_write_options {
> > + enum log_refs_config log_all_ref_updates;
> > + int prefer_symlink_refs;
> > + bool initialized;
> > + } write_opts_lazy_loaded;
>
> It might be nice to leave some sort of breadcrumb comment to future
> readers to explain why we lazy load this configuration.