Subject: [Outreachy PATCH RFC 0/3] store git_default_config() parsed values in new config struct

From: Olamide Caleb Bello <[email-masked]>
Date: Mon, 12 Jan 2026 13:59:22 +0100

Hi Git Community,
Over the course of my ongoing internship, which focused on moving global
variables in environment.h into local scope, I have attempted to move some
variables into the struct repo-settings.
However there have been some design concerns as regards the use of
`prepare_repo_settings()` with respect to when and where to call the
function, and also the change in behaviours when the variable is lazily
loaded as discussed in [1] and [2].

After different deliberations, Phillip Wood proposed creating a new config
struct [3], adding it to the repository struct and passing the repo struct to
`git_default_config()` to store the parsed config values per repo.
This would mean we would not need to remove code from
`git_default_config()`, and hence the current behaviours will be retained.

I have experimented with this approach for some values and I would
appreciate feedbacks about this approach before we can move forward
and use it for more variables related to `git_default_config()`.

For now, the parsed value is stored in `the_repository` in
`git_default_*_config()` and further efforts to pass the repository
parameter to `git_default_config()` as the callback parameter will
be looked into later on.

1. https://lore.kernel.org/git/[email-masked]/
2. https://lore.kernel.org/git/[email-masked]/
3. https://lore.kernel.org/git/[email-masked]/

Olamide Caleb Bello (3):
  environment: stop storing `core.attributesFile` globally
  environment: stop using core.sparseCheckout globally
  environment: move "branch.autoSetupMerge" into `struct config_values`

 attr.c                      |  8 +++++---
 builtin/backfill.c          |  3 +--
 builtin/branch.c            |  2 +-
 builtin/checkout.c          |  2 +-
 builtin/clone.c             |  2 +-
 builtin/mv.c                |  2 +-
 builtin/push.c              |  2 +-
 builtin/sparse-checkout.c   | 22 +++++++++++-----------
 builtin/submodule--helper.c |  2 +-
 builtin/worktree.c          |  2 +-
 config.c                    | 10 ++++++++++
 config.h                    | 13 +++++++++++++
 dir.c                       |  2 +-
 environment.c               | 20 ++++++++++----------
 environment.h               |  2 --
 repository.c                |  7 +++++++
 repository.h                |  4 ++++
 sparse-index.c              |  4 ++--
 unpack-trees.c              |  2 +-
 wt-status.c                 |  3 ++-
 20 files changed, 74 insertions(+), 40 deletions(-)

-- 
2.34.1