Re: [RFC PATCH 1/1] maintenance: add config option for config-file
- From
D. Ben Knoble <ben.knoble@gmail.com>
- Date
- Dec 22, 2025, 21:51 UTC
- Message-ID
- <CALnO6CD7Q1-vBKkeB81G04=MT5kSH4-Hm72cSP4hBuU+fDDR6g@mail.gmail.com>
- In-Reply-To
- <fmj4be365s6jczb6p2ccb6a6vh64bltgfl5neshu6g7hrabzeb@twzrzmprhotf>
On Mon, Dec 22, 2025 at 3:55 AM Matthew Hughes <matthewhughes934@gmail.com> wrote:
Show 22 quoted lines
> > > I am not sure if singling out "maintenance" is the right approach to > > solve that issue. If we had a mechanism to have two per-user > > configuration file, where one is read-only (as far as Git is > > concerned) which is covered/overlayed with a separate read-write > > file, not just "maintenance register/unregister" but all other > > things that writes into "git config" would use that overlayed file > > without touching the base configuration that is read-only. Wouldn't > > that be closer to what you want? > > Indeed a read-only config as you described would be a more general solution, > and a better one than focusing on single commands like this change does. I'm > now curious if a similar idea has been discussed in the past? I'll go have a > look in the history of this mailing list. > > That leads me to think my proposed change is too narrow in scope, and risks > dividing functionality: where some commands are taught to consider the separate > types of configuration, while others are not. > > For background: I singled out "maintenance" only because it's the first git > command that I can remember seeing that was writing to my global config > (outside of "config" itself).
FWIW, I also include my gitconfig in version control, and the way I manage this is with
[include]
path = ~/.gitconfig.localIf I run "git maintenance register", I then move the added configuration lines to ~/.gitconfig.local. It's a bit of a hassle, but not much (I don't frequently add new repos to the set).
-- D. Ben Knoble