#763712 git: $GIT_CONFIG should either apply to all commands, or none at all

Package:
git
Source:
git
Description:
fast, scalable, distributed revision control system
Submitter:
Frédéric Brière
Date:
2014-10-02 17:57:12 UTC
Severity:
normal
#763712#5
Date:
2014-10-02 00:10:34 UTC
From:
To:
This kind of stuff caused me a lot of hair-pulling:

  $ git config core.abbrev
  32
  git log --pretty=oneline --abbrev-commit
  89be foo

Here's the source of the discrepancy:

  $ grep abbrev $GIT_CONFIG .git/config
  git.conf:	abbrev=32
  .git/config:	abbrev=4

Since dc87183, $GIT_CONFIG is ignored by any other Git command, but it
*still* applies to git-config.  This basically means that values
obtained via git-config are not necessarily those which are actually in
effect.

The really frustrating part (for me, at least) is that for any tool
(gitweb in my case) which uses git-config, values from $GIT_CONFIG will
take effect for that tool, but not for any subsequent Git command.

git-config(1) doesn't make this clear either; it mentions $GIT_CONFIG as
"the configuration", without saying explicitly that this environment
variable only applies to git-config.


I'll leave it to you to determine whether this is a real concern, or
merely a documentation issue.  (But if you ask me, the current behavior
is plain evil.  <g>)