Subject: Re: [Outreachy PATCH v2 1/3] environment: stop storing `core.attributesFile` globally

From: Junio C Hamano <[email-masked]>
Date: Tue, 13 Jan 2026 11:26:09 -0800

Olamide Caleb Bello <[email-masked]> writes:

> The config value parsed in git_default_core_config() is 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.

There are quite a many global singleton variables that are accessed
by git_default_core_config(), and this patch addresses only one of
them.  Are most of these variables per repository, or are there some
variables that are inherently just one for a user or for a system?

>  extern int warn_on_object_refname_ambiguity;
>  extern char *apply_default_whitespace;
>  extern char *apply_default_ignorewhitespace;
> -extern char *git_attributes_file;
>  extern int zlib_compression_level;
>  extern int pack_compression_level;
>  extern unsigned long pack_size_limit_cfg;