Subject: Re: [Outreachy PATCH v5 2/3] environment: stop using core.sparseCheckout globally

From: Junio C Hamano <[email-masked]>
Date: Thu, 29 Jan 2026 10:12:15 -0800

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

> The config value `core.sparseCheckout` is parsed in
> `git_default_core_config()` and stored globally in
> `core_apply_sparse_checkout`. This could cause it to be overwritten
> by another repository when different Git repositories run in the same
> process.
>
> Move the parsed value into `struct repo_config_values` in the_repository
> to retain current behaviours and move towards libifying Git.
>
> Suggested-by: Phillip Wood <[email-masked]>
> Mentored-by: Christian Couder <[email-masked]>
> Mentored-by: Usman Akinyemi <[email-masked]>
> Signed-off-by: Olamide Caleb Bello <[email-masked]>
> ---

A lot of changes, almost all of which are mechanical

    s/core_apply_sparse_checkout/the_repository->config_values.apply_sparse_checkout/ 

changes, which is very straight-forward.

The same comment applies.  Do we want programs to require calling
repo_config_values_init(), or should we rely on program load-time
initialization, like all these globals that are moved to the
repo_config_values struct used to do?

I do not have a good answer to this question, but so far, these two
global variables that were both zero initialized for being in BSS do
not *need* initialization byh an explicit runtime assignment that
repo_config_values_init() allows us to do.