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
David Aguilar <davvid@gmail.com>
Date
May 28, 2012, 21:05 UTC
Message-ID
<CAJDDKr63QET=Dn4hV1Q-=xGJ3p1up5ohDsDGcuyrPC43Jvohug@mail.gmail.com>
In-Reply-To
<20120526215405.GC29463@sigill.intra.peff.net>
On Sat, May 26, 2012 at 2:54 PM, Jeff King <peff@peff.net> wrote:
Show 38 quoted lines
> On Sat, May 26, 2012 at 05:15:13PM +0700, Nguyen Thai Ngoc Duy wrote:
>
>> > So I consider it the lesser of two evils. The rule is much simpler: "old
>> > versions of git do not know about this new location". Which is
>> > unavoidable, and easier to explain than "Old versions of git do not know
>> > about this location. New versions do, but will sometimes ignore
>> > depending on whether this other file exists, which might have been
>> > created by an old version".
>>
>> We could amend Junio's version a bit:
>>
>>  - if both versions exist, warn loudly (optionally refuse to work) and
>> suggest to symlink .gitconfig to .config/git/config
>
> Yeah, that might help. At the same time, it is not necessarily an error
> condition (e.g., if I track my ~/.config directory, but want to put
> one-offs in ~/.gitconfig. On the other hand, you can set that up
> manually with include.path = ~/.some-not-tracked-file, so maybe it is
> not a use case worth worrying about).
>
>> >  1. Start reading from the XDG location in addition to the old
>> >     location. Always write to the old location.
>> >
>> >  2. Wait N time units until everybody reasonable has a version that
>> >     does (1).
>> >
>> >  3. Start writing to the XDG location by default. Keep reading from the
>> >     old version for compatibility.
>>
>> Hang on.. this "by default" is only for Linux, or for every other OS too?
>
> Sorry, I overstated a bit. It would be _safe_ to do step 3 like that
> after waiting N time units, but we could also do something much less
> drastic (like only writing to it when it exists, or when ~/.gitconfig
> does not exist, or whatever). And no, I wouldn't think following XDG on
> non-Linux machines would make much sense if no other programs on that
> platform do so (I don't know what OS X is like, but I can imagine nobody
> uses XDG paths on Windows).

I completely disagree about the OS X thing. We have shared home directories across OS X and Linux. There are many OS X apps that do respect XDG because they use Qt. Git configuration is core to the system; I think we should avoid fragmentation.

Real-word scenario: At disney animation studio (and probably pixar too) OS X is (thankfully) a 2nd-class citizen to Linux. We would very much appreciate the ability to have the OS X git behave exactly like the Linux version, even if that means a Makefile switch. IMO it should do so by default, though; there's little to gain otherwise.

I would even suggest that windows should do the same. .dotfiles are not a regular windows thing in the first place. It's the simplest and easiest-to-explain thing to do, too. Otherwise it means more platform-specific documentation. Less documentation is better documentation (especially since no one reads it ;p)

So I think having OS X git follow XDG makes a lot of sense. I don't know of any alternatives short of adding something like an OS X-specific System Preferences pane or some insane OS X `defaults` .plist-integrated thing ;-)

-- 
David
Previous: Jeff KingNext: Matthieu Moy
Message 8 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.