Re: [Outreachy PATCH v3 1/3] environment: stop storing `core.attributesFile` globally
On Thu, 22 Jan 2026 at 15:40, Phillip Wood <phillip.wood123@gmail.com> wrote:
>
> Hi Olamide
Show 9 quoted lines
>
> On 17/01/2026 20:59, Olamide Caleb Bello wrote:
> > The config value is parsed in git_default_core_config(), loaded eagerly
> > and stored in the global variable `git_attributes_file`.
> > Storing this value in a global variable can lead to unexpected
> > behaviours when more than one Git repository run in the same Git process.
>
> It would maybe be helpful to explain what the unexpected behavior is and
> how it is caused.
Show 16 quoted lines
>
> > diff --git a/environment.h b/environment.h
> > index 51898c99cd..aea73ff25b 100644
> > --- a/environment.h
> > +++ b/environment.h
> > @@ -84,6 +84,12 @@ extern const char * const local_repo_env[];
> >
> > struct strvec;
> >
> > +/* Config values parsed by git_default_config() */
> > +struct repo_config_values {
> > + /* core config values */
> > + char *attributes_file_path;
>
> The variable we're converting is called "attributes_file", do we really
> need to add a "_path" suffix?Show 6 quoted lines
>
> Apart from that everything here looks good
>
> Thanks
>
> Phillip