# Handling of 'git-config foo=bar'

3 messages from 2007-02-04 to 2007-02-04. Participants: Yann Dirson, Junio C Hamano, Jakub Narebski.
Thread: https://gitlist.dev/t/6676

## Yann Dirson, 2007-02-04 11:33

Subject: Handling of 'git-config foo=bar'
Message-ID: <20070204113350.GN5362@nan92-1-81-57-214-146.fbx.proxad.net>
URL: https://gitlist.dev/e/20070204113350.GN5362%40nan92-1-81-57-214-146.fbx.proxad.net

```
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, 2007-02-04 19:59

Subject: Re: Handling of 'git-config foo=bar'
Message-ID: <7vsldlr8wg.fsf@assigned-by-dhcp.cox.net>
URL: https://gitlist.dev/e/7vsldlr8wg.fsf%40assigned-by-dhcp.cox.net
In-Reply-To: <20070204113350.GN5362@nan92-1-81-57-214-146.fbx.proxad.net>

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

```

## Jakub Narebski, 2007-02-04 20:20

Subject: Re: Handling of 'git-config foo=bar'
Message-ID: <eq5f34$ir9$1@sea.gmane.org>
URL: https://gitlist.dev/e/eq5f34%24ir9%241%40sea.gmane.org
In-Reply-To: <7vsldlr8wg.fsf@assigned-by-dhcp.cox.net>

```
Junio C Hamano wrote:

> 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

```
