From: Junio C Hamano Date: Fri, 24 Apr 2009 16:19:12 GMT Subject: Re: [PATCH 1/2] remote.c: silently tolerate single-level keys like remote.default Message-ID: <7vzle6dny7.fsf@gitster.siamese.dyndns.org> In-Reply-To: <1240494546-25775-1-git-send-email-j6t@kdbg.org> Johannes Sixt 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.