git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

From
Junio C Hamano <gitster@pobox.com>
Date
Apr 24, 2009, 16:19 UTC
Message-ID
<7vzle6dny7.fsf@gitster.siamese.dyndns.org>
In-Reply-To
<1240494546-25775-1-git-send-email-j6t@kdbg.org>
Johannes Sixt <j6t@kdbg.org> writes:
Show 19 quoted lines
> 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.

Previous: Jeff King
Message 6 of 6 in “remote.c: silently tolerate single-level keys like remote.default”
  1. 1/2 remote.c: silently tolerate single-level keys like remote.defaultJohannes Sixt, Apr 23, 2009
  2. 2/2 builtin-help: silently tolerate unknown keysJohannes Sixt, Apr 23, 2009
  3. Jeff KingApr 23, 2009
  4. Johannes SixtApr 23, 2009
  5. Jeff KingApr 23, 2009
  6. Junio C HamanoApr 24, 2009

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.