git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Jeff King <peff@peff.net>
To: Jacob Keller <jacob.keller@gmail.com>
Cc: "brian m. carlson" <sandals@crustytoothpaste.net>,
	Junio C Hamano <gitster@pobox.com>,
	Jonathan Nieder <jrnieder@gmail.com>,
	Yaroslav Halchenko <yoh@onerussian.com>,
	"git@vger.kernel.org" <git@vger.kernel.org>,
	kyle@kyleam.com
Subject: Re: Q: rational for $XDG_CONFIG_HOME/git/config to be "non global" or just a bug?
Date: Mon, 18 Dec 2017 01:40:42 -0500	[thread overview]
Message-ID: <20171218064042.GA25733@sigill.intra.peff.net> (raw)
In-Reply-To: <CA+P7+xpFyD0zuOz7XSCc6cV1T1zu6j-gZD=EMQs-t2WPxi1EMA@mail.gmail.com>

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

  reply	other threads:[~2017-12-18  6:40 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-11 21:11 Q: rational for $XDG_CONFIG_HOME/git/config to be "non global" or just a bug? Yaroslav Halchenko
2017-12-11 22:56 ` Jonathan Nieder
2017-12-12  0:48   ` Yaroslav Halchenko
2017-12-12  1:05   ` Junio C Hamano
2017-12-12  9:36     ` Jacob Keller
2017-12-12 19:36       ` Junio C Hamano
2017-12-13  5:35         ` Jacob Keller
2017-12-12 14:13     ` Yaroslav Halchenko
2017-12-13  5:35       ` Jacob Keller
2017-12-16 22:01     ` brian m. carlson
2017-12-18  4:03       ` Jacob Keller
2017-12-18  6:40         ` Jeff King [this message]
2017-12-18 14:21           ` Yaroslav Halchenko
2017-12-18 16:55             ` Junio C Hamano
2017-12-18 19:56           ` Jacob Keller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20171218064042.GA25733@sigill.intra.peff.net \
    --to=peff@peff.net \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=jacob.keller@gmail.com \
    --cc=jrnieder@gmail.com \
    --cc=kyle@kyleam.com \
    --cc=sandals@crustytoothpaste.net \
    --cc=yoh@onerussian.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).