threads / discuss / 6676

Handling of 'git-config foo=bar'

Subject: Handling of 'git-config foo=bar'

## tl;dr

3 messages between Feb 4, 2007 and Feb 4, 2007.

replies: 2people: 3as markdown or json

Yann Dirson· Feb 4, 2007, 11:33 UTC · lore

Currently, running "git-config foo=bar", ie. presumably an erroneous attempt at setting "foo", indeed queries "foo=bar", so outputs nothing and reports success.

Do we want to allow "=" signs in config var names ? It would seem reasonable to refuse them, and report an error to the innocent user (OK, i'm not that innocent, but still ;)

Or does that sound a bad idea to anyone ?
Best regards,
-- 
Yann.
Junio C Hamano· Feb 4, 2007, 19:59 UTC · re: Yann Dirson · lore

Re: Handling of 'git-config foo=bar'

Yann Dirson <ydirson@altern.org> writes:
Show 9 quoted lines
> Currently, running "git-config foo=bar", ie. presumably an erroneous
> attempt at setting "foo", indeed queries "foo=bar", so outputs nothing
> and reports success.
>
> Do we want to allow "=" signs in config var names ?  It would seem
> reasonable to refuse them, and report an error to the innocent user
> (OK, i'm not that innocent, but still ;)
>
> Or does that sound a bad idea to anyone ?
Something like:
   git config remote.origin.fetch=refs/heads/master:refs/heads/origin
   git config remote.origin.fetch+=refs/heads/next:refs/heads/next
   git config remote.origin.fetch+=+refs/heads/pu:refs/heads/pu
   git config remote.origin.fetch+=refs/heads/maint:refs/heads/maint
sounds sensible.

However, my feeling is "git repo-config" is primarily for use by scripts, and we are better off educating users not to be afraid of viewing and editing .git/config file themselves.

Jakub Narebski· Feb 4, 2007, 20:20 UTC · re: Junio C Hamano · lore

Re: Handling of 'git-config foo=bar'

Junio C Hamano wrote:
Show 24 quoted lines
> Yann Dirson <ydirson@altern.org> writes:
> 
>> Currently, running "git-config foo=bar", ie. presumably an erroneous
>> attempt at setting "foo", indeed queries "foo=bar", so outputs nothing
>> and reports success.
>>
>> Do we want to allow "=" signs in config var names ?  It would seem
>> reasonable to refuse them, and report an error to the innocent user
>> (OK, i'm not that innocent, but still ;)
>>
>> Or does that sound a bad idea to anyone ?
> 
> Something like:
> 
>    git config remote.origin.fetch=refs/heads/master:refs/heads/origin
>    git config remote.origin.fetch+=refs/heads/next:refs/heads/next
>    git config remote.origin.fetch+=+refs/heads/pu:refs/heads/pu
>    git config remote.origin.fetch+=refs/heads/maint:refs/heads/maint
> 
> sounds sensible.
> 
> However, my feeling is "git repo-config" is primarily for use by
> scripts, and we are better off educating users not to be afraid
> of viewing and editing .git/config file themselves.

I think the question was not if we want new syntax for setting variables, but if we want to disallow '=' in variable (key) names. They are pretty restricted, and I cannot think offhand of variable name we would want that would need to have '=' in it...

-- 
Jakub Narebski
Warsaw, Poland
ShadeHawk on #git

← back to recent threads