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

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.local

If 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
Previous: Matthew Hughes
Message 6 of 6 in “maintenance: add config option for config-file”
  1. 0/1 maintenance: add config option for config-fileMatthew Hughes, Dec 18, 2025
  2. 1/1 maintenance: add config option for config-fileMatthew Hughes, Dec 18, 2025
  3. Patrick SteinhardtDec 19, 2025
  4. Junio C HamanoDec 19, 2025
  5. Matthew HughesDec 22, 2025
  6. D. Ben KnobleDec 22, 2025

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.