Re: [PATCH 1/2] remote.c: silently tolerate single-level keys like remote.default

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Johannes Sixt <j6t@xxxxxxxx> writes:

> If the config file contains a section like this:
>
>     [remote]
>             default = foo
>
> (it should be '[remotes]') then commands like
>
>     git status
>     git checkout
>     git branch -v
>
> fail even though they are not obviously related to remotes. (These commands
> write "ahead, behind" information and, therefore, access the configuration
> of remotes.)
>
> Typos in configuration keys usually do not hurt because they never match
> in look-ups. But this case is different: it does match, but it does not
> have the expected format. With this patch this situation is treated more
> like a typo.

I agree with the patch text, but we should realize that this is not
"silently tolerating typos".  The existing per-remote variables such as
url, proxy, fetch, etc. are defined to be, eh, per-remote, and by
definition require three-level syntax.  There is nothing that prevents us
from actually fixing the stupid mistake that is "remotes.default = foo"
and make it "remote.default = foo".

To avoid confusion, we might want to deprecate remotes.default and make it
remotegroup.default or something like that, though.
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]