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
PWPhillip Wood <phillip.wood123@gmail.com>
Date
Jan 7, 2026, 10:17 UTC
Message-ID
<34175f3d-0814-47c6-9945-7c19f2c60ca4@gmail.com>
In-Reply-To
<xmqq1pk3lmu3.fsf@gitster.g>
On 05/01/2026 22:24, Junio C Hamano wrote:
Show 9 quoted lines
> Phillip Wood <phillip.wood123@gmail.com> writes:
> 
>> 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'".
> 
> Hmph, if you call any behaviour change a "regression", this may
> certainly count as one, but I do not necessarily think the above is
> a good behaviour.

One can argue that it depends on the command, but a as far as "git rebase" is concerned this change in behavior is a regression. It is not just rebase that is affected, for example "git merge" in a partial clone now downloads all the blobs it wants before erroring out which isn't terrible but it is hard to argue that's an improvement. I suspect "git cherry-pick" and "git revert" are also negatively impacted by this change.

Show 6 quoted lines
> Think about a use case where attributes are not used at all, e.g.,
> "git -c core.attributesFile=~does-not-matter cat-file -t HEAD";
> would it make sense to barf when your configuration file has an
> invalid definition for what you are *not* using?  So if the change
> makes it stop barfing, it can even be argued that this is an
> improvement.

For some commands, but the fact that other commands now die when they're not expecting to and so end up in a strange state is a regression. Given how widespread the use of attributes is it would be hard to audit all the affected code paths and adjust them to the new behavior.

Show 9 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'
> 
> Very true.  If we know the set of things we parse early and have a
> way to say "this command only X, Y, and Z matters (but not W)", then
> the above cat-file example can omit the attributesFile from the "we
> care" set.

That would be nice, but it would be painful to implement for commands like cat-file which sometimes need to read core.attributesFile and sometimes don't depending on which options they're passed as we typically read the config before parsing the command line options. We'd also need to be careful to update the list when adding new features which depended on config variables that were not previously used by that command.

Show 6 quoted lines
> I think overusing repo_settings is a disease.  Moving a singleton
> global to per repository (by adding to struct repository) is one
> thing and it is very welcome.  But changing the way configuration
> variables are parsed (e.g., what used to be parsed by only those who
> care about is now parsed by everybody, or vice versa) needs to be
> handled carefully.
Indeed
Thanks
Phillip
Previous: Junio C HamanoNext: Bello Olamide
Message 20 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.