Re: [Outreachy PATCH v2] environment: move "core.attributesFile" into repo-setting
- From
Bello Olamide <belkid98@gmail.com>
- Date
- Jan 6, 2026, 08:08 UTC
- Message-ID
- <CAD=f0L-hv1ZYGDyHRCYu3BqgrbvutS+JVn0D3kBq-wq--qgY7A@mail.gmail.com>
- In-Reply-To
- <a881499d-e236-4f8e-a217-b6bce69e3e3c@gmail.com>
On Mon, 5 Jan 2026 at 15:23, Phillip Wood <phillip.wood123@gmail.com> wrote:
Show 26 quoted lines
> > Hi Olamide > > On 02/01/2026 16:32, Olamide Caleb Bello wrote: > > When handling multiple repositories within the same process, relying on > > global state for accessing the "core.attributesFile" configuration can > > lead to incorrect values being used. It also makes it harder to isolate > > repositories and hinders the libification of git. > > The functions `bootstrap_attr_stack()` and `git_attr_val_system()` > > retrieve "core.attributesFile" via `git_attr_global_file()` > > which reads from global state `git_attributes_file`. > > > > Move the "core.attributesFile" configuration into the > > `struct repo_settings` instead of relying on the global state. > > This changes when the config setting gets parsed which unfortunately > regresses the user experience when the setting is invalid. > > If I run 'git -c core.attributesFile=~does-not-exist rebase -i' with git > built from master it fails immediately with "fatal: failed to expand > user dir in: '~does-not-exist'". With this patch applied it prompts me > to edit the todo list and then fails when it tries to checkout the > commit we're rebasing onto. Because "git rebase" expects reset_head() to > return an error rather die if the checkout fails it is left in a strange > state where only practical course of action for the user is to run "git > rebase --abort".
Yes I tried this and I experienced the same behaviour.
Show 6 quoted lines
> > It is quite common that moving from parsing config settings eagerly by > calling repo_config() at startup to parsing them lazily via 'stuct > repo_settings' causes regressions like this. We really should find a way > to address that before moving more settings into 'struct repo_settings' >
Yes, I came across an initial discussion about `prepare_repo_settings()` and the issues about the appropriate place to call it but it seemed there was no resolution then.