git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* man page for "git config" re: GIT_CONFIG and "-f" seems weird/wrong
@ 2017-10-14  9:55 Robert P. J. Day
  0 siblings, 0 replies; only message in thread
From: Robert P. J. Day @ 2017-10-14  9:55 UTC (permalink / raw)
  To: Git Mailing list


  (apologies to those whose email systems barfed on my domain being
badly configured WRT MX record, i have been assured by my admin it's
been fixed.)

  reading "man git-config", first, it seems awkward that the "-f"
option is explained in terms of GIT_CONFIG even when that variable
hasn't been introduced yet:

  -f config-file, --file config-file
     Use the given config file instead of the one specified by GIT_CONFIG.

the way that's worded makes it seem like GIT_CONFIG *must* have a
value somewhere that is being overridden. perhaps a more general
explanation would be something like, "Explicitly use this, and *only*
this config file, regardless of other possible config settings."

  it might also be worth mentioning that, once you specify this
option, also using any of --local, --global or --system will result in
an error:

  $ git config -l -f ~/gitc --global
  error: only one config file at a time.
  ... snip ...

  related to this, under "ENVIRONMENT", the explanation for GIT_CONFIG
seems somewhat draconian:

  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.

the word "forces" seems a bit heavy-handed, and the explanation is
misleading, anyway ... if you've already set GIT_CONFIG, then using
any other option of --local, --global or --system produces the same
error as before:

  $ git config -l --system
  error: only one config file at a time.
  $

in other words, if GIT_CONFIG is already set, using --global or
--system doesn't "force" anything, it's simply an error, no?

rday

-- 

========================================================================
Robert P. J. Day                                 Ottawa, Ontario, CANADA
                        http://crashcourse.ca

Twitter:                                       http://twitter.com/rpjday
LinkedIn:                               http://ca.linkedin.com/in/rpjday
========================================================================

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2017-10-14  9:55 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-10-14  9:55 man page for "git config" re: GIT_CONFIG and "-f" seems weird/wrong Robert P. J. Day

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).