Re: [Outreachy PATCH v5 2/3] environment: stop using core.sparseCheckout globally
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Jan 29, 2026, 18:12 UTC
- Message-ID
- <xmqqqzr8b85c.fsf@gitster.g>
- In-Reply-To
- <5e56e1cc4172cfff9e917a068184e102aa70bf1d.1769256839.git.belkid98@gmail.com>
Olamide Caleb Bello <belkid98@gmail.com> writes:
Show 14 quoted lines
> 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 <phillip.wood123@gmail.com> > Mentored-by: Christian Couder <christian.couder@gmail.com> > Mentored-by: Usman Akinyemi <usmanakinyemi202@gmail.com> > Signed-off-by: Olamide Caleb Bello <belkid98@gmail.com> > ---
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.