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

Re: [PATCH 1/2] Add possibility to store configuration in ~/.config/git/config file

From
Matthieu Moy <matthieu.moy@grenoble-inp.fr>
Date
May 26, 2012, 09:05 UTC
Message-ID
<vpqtxz3mhx8.fsf@bauges.imag.fr>
In-Reply-To
<7vd35sq7fx.fsf@alter.siamese.dyndns.org>
Junio C Hamano <gitster@pobox.com> writes:
> If you read from .gitconfig and also from the new location, but update
> only the new location,

That's not exactly the proposal. First, I agree that the first questions to be answered is what happens on reading. About writing, I don't feel very strongly about it, but I think it's reasonable to write to the new location if the old location doesn't exist, and the new one does. This way, ~/.gitconfig haters will create their ~/.config/git/config, and won't be bothered with the former.

Obviously, trying too hard to write to the new location would harm old versions users, so for example, it would be unreasonable to write to the new location unconditionally.

> people who use two versions of git will be in a very confusing
> situation. Randomly, some of their updates are always in effect,

Only if they created manually the new file. People unaware of the change won't be affected at all.

Since most people don't read the docs, most people will be unaffected ;-).

>  - If ~/.gitconfig exists, do not do anything new.  Just exercise the
>    original code.  For these users, ~/.config/ does _not_ exist as far as
>    Git is concerned.

As Jeff already pointed out, this would be very confusing for a user having the new file, since running once "git config --global" with an old version would shadow the whole configuration by creating an almost empty ~/.gitconfig file.

We clearly want to read both. I'm not sure which should take precedence when the same variable is defined in both.

-- 
Matthieu Moy
http://www-verimag.imag.fr/~moy/
Previous: David AguilarNext: jaseem abid
Message 9 of 12 in “Add possibility to store configuration in ~/.config/git/config file”
  1. 1/2 Add possibility to store configuration in ~/.config/git/config fileNGUYEN Huynh Khoi Nguyen, May 25, 2012
  2. 2/2 Test File Name: t1306-second-config-file.shNGUYEN Huynh Khoi Nguyen, May 25, 2012
  3. Jeff KingMay 25, 2012
  4. Junio C HamanoMay 25, 2012
  5. Jeff KingMay 25, 2012
  6. Nguyen Thai Ngoc DuyMay 26, 2012
  7. Jeff KingMay 26, 2012
  8. David AguilarMay 28, 2012
  9. Matthieu MoyMay 26, 2012
  10. jaseem abidMay 25, 2012
  11. Matthieu MoyMay 26, 2012
  12. Jeff KingMay 26, 2012

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.