Re: [Outreachy PATCH v2 1/3] environment: stop storing `core.attributesFile` globally
- From
Bello Olamide <belkid98@gmail.com>
- Date
- Jan 14, 2026, 06:59 UTC
- Message-ID
- <CAD=f0L8B9npe_VZpWo6i9V4gn1hq6P0cfYbOvRsxFXQBTS4ckA@mail.gmail.com>
- In-Reply-To
- <xmqqzf6hiab2.fsf@gitster.g>
On Tue, 13 Jan 2026 at 20:26, Junio C Hamano <gitster@pobox.com> wrote:
Show 12 quoted lines
> > Olamide Caleb Bello <belkid98@gmail.com> 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?
Hello Junio, From my understanding of the code in `git_default_config()`, some config are just one for a user such as the ones in `git_default_ident_config()`, `git_default_mailmap_config()`. However a majority of them are repository specific such as the ones in `git_default_core_config()`, `git_default_branch_config()`, `git_default_push_config()`. These are the ones that the movement to struct repo_config_values targets.