{"thread":{"id":"6768","subject":"Possible BUG in 'git config'","startedAt":"2007-02-11T14:13:27Z","lastAt":"2007-02-11T17:47:53Z","messageCount":5,"participants":["Marco Costalba","Johannes Schindelin"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"34162","messageId":"e5bfff550702110613q315e1f7es4ca1a88b92e4c3e9@mail.gmail.com","threadId":"6768","inReplyTo":null,"subject":"Possible BUG in 'git config'","fromName":"Marco Costalba","fromEmail":"mcostalba@gmail.com","sentAt":"2007-02-11T14:13:27Z","receivedAt":"2007-02-11T14:13:27Z","isPatch":false,"sender":{"key":"mcostalba@gmail.com","avatar":null},"body":"bash-3.1$ cat ./.git/config\n[i18n]\n        commitencoding = UTF-8\n\nbash-3.1$ git repo-config --global user.name\nmarco\n\nbash-3.1$ git repo-config user.name\nmarco\n\nI would expect git repo-config user.name returns an empty string,\nbecause user.name is defined _only_ in global config file ~/.gitconfig\n\n>From git-config documentation:\n\n--global::\n\tUse global ~/.gitconfig file rather than the repository .git/config.\n\n\n\nHow it is possible to know if a variable is stored in local config file?\n\nThanks\nMarco\n"},{"id":"34170","messageId":"Pine.LNX.4.63.0702111720260.22628@wbgn013.biozentrum.uni-wuerzburg.de","threadId":"6768","inReplyTo":"e5bfff550702110613q315e1f7es4ca1a88b92e4c3e9@mail.gmail.com","subject":"Re: Possible BUG in 'git config'","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2007-02-11T16:24:53Z","receivedAt":"2007-02-11T16:24:53Z","isPatch":false,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Sun, 11 Feb 2007, Marco Costalba wrote:\n\n> I would expect git repo-config user.name returns an empty string, \n> because user.name is defined _only_ in global config file ~/.gitconfig\n\nThe whole point of ~/.gitconfig is to store variables to be seen in _all_ \nrepositories.\n\n> How it is possible to know if a variable is stored in local config file?\n\nIf you _have_ to, you can use\n\n\t$ GIT_CONFIG=.git/config git config -l\n\nbut I _strongly_ suggest you rethink your workflow if you need that.\n\n$HOME/.gitconfig _really_ is only meant to make it unnecessary to set a \nvariable in _all_ your repositories, and you can even override (although \nnot unset) the variables locally.\n\nSo I am certain that you made a mistake when you need to ignore the \nsettings in $HOME/.gitconfig.\n\nHth,\nDscho\n"},{"id":"34178","messageId":"e5bfff550702110921l710d62cr6c82baed1b678ab2@mail.gmail.com","threadId":"6768","inReplyTo":"Pine.LNX.4.63.0702111720260.22628@wbgn013.biozentrum.uni-wuerzburg.de","subject":"Re: Possible BUG in 'git config'","fromName":"Marco Costalba","fromEmail":"mcostalba@gmail.com","sentAt":"2007-02-11T17:21:08Z","receivedAt":"2007-02-11T17:21:08Z","isPatch":false,"sender":{"key":"mcostalba@gmail.com","avatar":null},"body":"On 2/11/07, Johannes Schindelin <Johannes.Schindelin@gmx.de> wrote:\n\n>\n> So I am certain that you made a mistake when you need to ignore the\n> settings in $HOME/.gitconfig.\n>\n\nPlease do the following:\n\n$ cd <git tree repo>\n$ git repo-config --global --unset user.name\n$ git repo-config --unset user.name\n$ git gui\n\nThen go to Edit->options, you will see empty both 'git repository' and\n'Global (All repositories)'\n\nThen exit 'git gui' and type:\n\n$ git repo-config --global user.name dummy\n$ git gui\n\nThen go to Edit->options and.... surprise! dummy has been added to\nboth panes instead of only in 'Global' one.\n\nThe bug is not in 'git gui' but in 'git repo-config' that when queried\nfor user.name if doesn't find it in local config, silently falls back\nin global config. This is not documented and probably a bug because\ndocumentation of --global option says:\n\n--global::\n       Use global ~/.gitconfig file *rather than* the repository .git/config.\n\n\nThanks\nMarco\n"},{"id":"34179","messageId":"Pine.LNX.4.63.0702111829230.22628@wbgn013.biozentrum.uni-wuerzburg.de","threadId":"6768","inReplyTo":"e5bfff550702110921l710d62cr6c82baed1b678ab2@mail.gmail.com","subject":"Re: Possible BUG in 'git config'","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2007-02-11T17:37:21Z","receivedAt":"2007-02-11T17:37:21Z","isPatch":false,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Sun, 11 Feb 2007, Marco Costalba wrote:\n\n> On 2/11/07, Johannes Schindelin <Johannes.Schindelin@gmx.de> wrote:\n> \n> > \n> > So I am certain that you made a mistake when you need to ignore the\n> > settings in $HOME/.gitconfig.\n> > \n> \n> Please do the following:\n> \n> $ cd <git tree repo>\n> $ git repo-config --global --unset user.name\n> $ git repo-config --unset user.name\n> $ git gui\n> \n> Then go to Edit->options, you will see empty both 'git repository' and\n> 'Global (All repositories)'\n> \n> Then exit 'git gui' and type:\n> \n> $ git repo-config --global user.name dummy\n> $ git gui\n> \n> Then go to Edit->options and.... surprise! dummy has been added to\n> both panes instead of only in 'Global' one.\n\nI don't know. If you want that level of control, yes. But as has been \nsuggested before: .git/config as well as ~/.gitconfig have been meant to \nbe edited manually, but some people really need a special purpose UI for \neverything, don't they?\n\nAs I said, for this you should use \"GIT_CONFIG=$GIT_DIR/config git \nconfig\".\n\n> The bug is not in 'git gui' but in 'git repo-config' that when queried\n> for user.name if doesn't find it in local config, silently falls back\n> in global config. This is not documented and probably a bug because\n> documentation of --global option says:\n> \n> --global::\n>       Use global ~/.gitconfig file *rather than* the repository .git/config.\n\nYes, this is probably a bug. But it's obvious that if git-config _without_ \n--global would _not_ use ~/.gitconfig, that would rather make ~/.gitconfig \npointless, wouldn't it?\n\nSo yes, the description should mention that this is meant for the case of \n_setting_ variables, not _querying_ variables. The original poster (Sean) \nprobaly though -- IMHO correctly -- that querying with --global makes no \nsense.\n\nCiao,\nDscho\n"},{"id":"34181","messageId":"e5bfff550702110947s77e8f264k951ae1c158fcee98@mail.gmail.com","threadId":"6768","inReplyTo":"Pine.LNX.4.63.0702111829230.22628@wbgn013.biozentrum.uni-wuerzburg.de","subject":"Re: Possible BUG in 'git config'","fromName":"Marco Costalba","fromEmail":"mcostalba@gmail.com","sentAt":"2007-02-11T17:47:53Z","receivedAt":"2007-02-11T17:47:53Z","isPatch":false,"sender":{"key":"mcostalba@gmail.com","avatar":null},"body":"On 2/11/07, Johannes Schindelin <Johannes.Schindelin@gmx.de> wrote:\n>\n> Yes, this is probably a bug. But it's obvious that if git-config _without_\n> --global would _not_ use ~/.gitconfig, that would rather make ~/.gitconfig\n> pointless, wouldn't it?\n>\n\nYes.\n\n> So yes, the description should mention that this is meant for the case of\n> _setting_ variables, not _querying_ variables. The original poster (Sean)\n> probaly though -- IMHO correctly -- that querying with --global makes no\n> sense.\n>\n\nYes. It makes non sense but it' allowed. So probably, at least for\nconsistency, could exists a query without silent fallback. Something\nlike\n\ngit repo-config --local user.name\n\n\nMarco\n"}]}