git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Possible BUG in 'git config'

From
Johannes Schindelin <johannes.schindelin@gmx.de>
Date
Feb 11, 2007, 17:37 UTC
Message-ID
<Pine.LNX.4.63.0702111829230.22628@wbgn013.biozentrum.uni-wuerzburg.de>
In-Reply-To
<e5bfff550702110921l710d62cr6c82baed1b678ab2@mail.gmail.com>
Hi,
On Sun, 11 Feb 2007, Marco Costalba wrote:
Show 24 quoted lines
> On 2/11/07, Johannes Schindelin <Johannes.Schindelin@gmx.de> wrote:
> 
> > 
> > So I am certain that you made a mistake when you need to ignore the
> > settings in $HOME/.gitconfig.
> > 
> 
> Please do the following:
> 
> $ cd <git tree repo>
> $ git repo-config --global --unset user.name
> $ git repo-config --unset user.name
> $ git gui
> 
> Then go to Edit->options, you will see empty both 'git repository' and
> 'Global (All repositories)'
> 
> Then exit 'git gui' and type:
> 
> $ git repo-config --global user.name dummy
> $ git gui
> 
> Then go to Edit->options and.... surprise! dummy has been added to
> both panes instead of only in 'Global' one.

I don't know. If you want that level of control, yes. But as has been suggested before: .git/config as well as ~/.gitconfig have been meant to be edited manually, but some people really need a special purpose UI for everything, don't they?

As I said, for this you should use "GIT_CONFIG=$GIT_DIR/config git config".

Show 7 quoted lines
> The bug is not in 'git gui' but in 'git repo-config' that when queried
> for user.name if doesn't find it in local config, silently falls back
> in global config. This is not documented and probably a bug because
> documentation of --global option says:
> 
> --global::
>       Use global ~/.gitconfig file *rather than* the repository .git/config.

Yes, this is probably a bug. But it's obvious that if git-config _without_ --global would _not_ use ~/.gitconfig, that would rather make ~/.gitconfig pointless, wouldn't it?

So yes, the description should mention that this is meant for the case of _setting_ variables, not _querying_ variables. The original poster (Sean) probaly though -- IMHO correctly -- that querying with --global makes no sense.

Ciao, Dscho

Previous: Marco CostalbaNext: Marco Costalba
Message 4 of 5 in “Possible BUG in 'git config'”
  1. Marco CostalbaFeb 11, 2007
  2. Johannes SchindelinFeb 11, 2007
  3. Marco CostalbaFeb 11, 2007
  4. Johannes SchindelinFeb 11, 2007
  5. Marco CostalbaFeb 11, 2007

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.