Re: Q: rational for $XDG_CONFIG_HOME/git/config to be "non global" or just a bug?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, Dec 17, 2017 at 08:03:41PM -0800, Jacob Keller wrote:

> I do find it a bit weird that --global writes to one of either file,
> and doesn't read from both. I'd rather have --global "only" be
> .gitconfig, and instead add a new option for handling XDG file, and
> then have it such that it reads them in system -> xdg ->
> home/.gitconfig -> local, which allows for local .gitconfig to
> override XDG config, but logically treat them just like we do any
> other files.

I find it weird, too, but I'm not sure that's the right direction. It
means that users have to start caring about using "--xdg" instead of
"--global" if that's what they want to write to. The original idea was
that the transition to xdg should be fairly seamless, and that --global
would be an abstraction over both.

To complete that abstraction it seems like reading via "--global" should
read from both (in the same precedence order that normal config lookup
uses). If you only use one, there wouldn't be any change in behavior.
And if you use both, then the behavior makes sense as a subset of the
normal config lookup. I.e., it could even be explained as:

  If you give no "source", normal config lookup is similar to checking
  "--system", then "--global", then "--local".

The only person who might be affected is somebody who carries both files
_and_ really wanted "--global" to read from one specific file (though I
have no idea from which without looking at the source, and from reading
this thread it seems I am not the only one who would be confused). So
I'd be OK calling that an unintended and unsupported behavior, and the
right thing all along should have been to use "--file=" if you really
want to avoid "--global" automagic.

-Peff



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux