git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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.

Previous: Phillip Wood
Message 21 of 21 in “environment: move "core.attributesFile" into repo-setting”
  1. environment: move "core.attributesFile" into repo-settingOlamide Caleb Bello, Dec 18, 2025
  2. Bello OlamideDec 18, 2025
  3. Bello OlamideJan 2, 2026
  4. Karthik NayakJan 2, 2026
  5. Karthik NayakJan 2, 2026
  6. Bello OlamideJan 2, 2026
  7. environment: move "core.attributesFile" into repo-settingOlamide Caleb Bello, Jan 2, 2026
  8. Karthik NayakJan 5, 2026
  9. Bello OlamideJan 5, 2026
  10. Phillip WoodJan 5, 2026
  11. Phillip WoodJan 5, 2026
  12. Junio C HamanoJan 5, 2026
  13. Bello OlamideJan 6, 2026
  14. Bello OlamideJan 6, 2026
  15. Phillip WoodJan 7, 2026
  16. Phillip WoodJan 7, 2026
  17. Bello OlamideJan 7, 2026
  18. Bello OlamideJan 6, 2026
  19. Junio C HamanoJan 5, 2026
  20. Phillip WoodJan 7, 2026
  21. Bello OlamideJan 6, 2026

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.