From: Junio C Hamano <gitster@pobox.com>
To: Jeff King <peff@peff.net>
Cc: German Lashevich <german.lashevich@gmail.com>,
"git@vger.kernel.org" <git@vger.kernel.org>
Subject: Re: Bug report: GIT_CONFIG and user.email/name
Date: Wed, 14 Jul 2021 13:47:55 -0700 [thread overview]
Message-ID: <xmqqeec0vczo.fsf@gitster.g> (raw)
In-Reply-To: <YO8ordiN18sNP6tA@coredump.intra.peff.net> (Jeff King's message of "Wed, 14 Jul 2021 14:10:53 -0400")
Jeff King <peff@peff.net> writes:
> The GIT_CONFIG variable doesn't work that way. It is not a general
> mechanism used by all of Git, but rather a specific feature of the
> git-config program (and even there it is a historical wart; you should
> use "git config --file" instead).
We both have known that, but a fresh re-read of GIT_CONFIG in "git
help config" gave me a misleading impression.
ENVIRONMENT
-----------
GIT_CONFIG::
Take the configuration from the given file instead of .git/config.
Using the "--global" option forces this to ~/.gitconfig. Using the
"--system" option forces this to $(prefix)/etc/gitconfig.
is what we have above the GLOBAL and SYSTEM you quoted below. We
should say GIT_CONFIG is only for "git config" command while the
other two affects everybody, right?
Thanks.
> One of these variables is probably more helpful:
>
> $ man git | sed -n '/GLOBAL/,/^$/p'
> GIT_CONFIG_GLOBAL, GIT_CONFIG_SYSTEM
> Take the configuration from the given files instead from global or
> system-level configuration files. If GIT_CONFIG_SYSTEM is set, the
> system config file defined at build time (usually /etc/gitconfig)
> will not be read. Likewise, if GIT_CONFIG_GLOBAL is set, neither
> $HOME/.gitconfig nor $XDG_CONFIG_HOME/git/config will be read. Can
> be set to /dev/null to skip reading configuration files of the
> respective level.
>
> Note that they're new in v2.32.0.
>
> -Peff
next prev parent reply other threads:[~2021-07-14 20:47 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-07-14 17:10 Bug report: GIT_CONFIG and user.email/name German Lashevich
2021-07-14 18:10 ` Jeff King
2021-07-14 18:26 ` German Lashevich
2021-07-14 20:47 ` Junio C Hamano [this message]
2021-07-14 21:36 ` Jeff King
2021-07-14 21:37 ` [PATCH 1/3] doc/git-config: explain --file instead of referring to GIT_CONFIG Jeff King
2021-07-14 22:20 ` Taylor Blau
2021-07-14 22:23 ` Jeff King
2021-07-14 22:26 ` Taylor Blau
2021-07-20 19:34 ` Martin Ågren
2021-07-20 20:01 ` Jeff King
2021-07-20 20:03 ` Jeff King
2021-07-20 21:55 ` Junio C Hamano
2021-07-14 21:38 ` [PATCH 2/3] doc/git-config: clarify GIT_CONFIG environment variable Jeff King
2021-07-14 21:38 ` [PATCH 3/3] doc/git-config: simplify "override" advice for FILES section Jeff King
2021-07-14 22:22 ` Bug report: GIT_CONFIG and user.email/name Taylor Blau
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=xmqqeec0vczo.fsf@gitster.g \
--to=gitster@pobox.com \
--cc=german.lashevich@gmail.com \
--cc=git@vger.kernel.org \
--cc=peff@peff.net \
/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.
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 NNTP newsgroup(s).