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

Re: [PATCHv2] git-config: Parse config files leniently

From
Michael J Gruber <git@drmicha.warpmail.net>
Date
Sep 3, 2009, 07:41 UTC
Message-ID
<4A9F733D.5050205@drmicha.warpmail.net>
In-Reply-To
<7vab1cfr6s.fsf@alter.siamese.dyndns.org>
Junio C Hamano venit, vidit, dixit 03.09.2009 09:00:
Show 25 quoted lines
> Michael J Gruber <git@drmicha.warpmail.net> writes:
> 
>> Currently, git config dies as soon as there is a parsing error. This is
>> especially unfortunate in case a user tries to correct config mistakes
>> using git config -e.
>>
>> Instead, issue a warning only and treat the rest of the line as a
>> comment (ignore it). This benefits not only git config -e users but
>> also everyone else.
> 
> This changes the behaviour enough to break t3200-branch.sh, test #52.
> 
> The test stuffs an invalid (but not syntactically incorrect) value used by
> "git branch" in the configuration and tries to make sure that "git branch"
> diagnoses the breakage, but it does not fail anymore with your patch.
> 
> There are probably other breakages as well (e.g. t5304-prune.sh, test #5)
> but if you trace "git branch" under the debugger in the trash directory
> left after running t3200 with -i, it should be pretty obvious that your
> patch is utterly bogus.  get_value() can return negative result after
> diagnosing a semantic problem with the value, and that is different from a
> syntax error that you would try to recover and continue, pretending you
> can ignore the remainder of the line as if it is a comment.
> 
> Why was I CC'ed, if the patch wasn't even self tested?
Because
- not CC'ing you would have meant culling you from the existing CC,
- we've discussed v1 of this patch before,
- I asked in this patch (v2) whether to go for an alternative.

Since "git config -e" for broken config is not my itch at all, but the reporter's, I'll stop my efforts after this response.

Michael
Previous: Junio C HamanoNext: Junio C Hamano
Message 11 of 14 in “git config -> "fatal: bad config file"”
  1. David ReitterAug 14, 2009
  2. Michael J GruberAug 14, 2009
  3. David ReitterAug 14, 2009
  4. Jakub NarebskiAug 14, 2009
  5. git-config: Parse config files lenientlyMichael J Gruber, Aug 14, 2009
  6. Junio C HamanoAug 14, 2009
  7. Michael J GruberAug 17, 2009
  8. Junio C HamanoAug 17, 2009
  9. [PATCHv2] git-config: Parse config files lenientlyMichael J Gruber, Sep 2, 2009
  10. Junio C HamanoSep 3, 2009
  11. Michael J GruberSep 3, 2009
  12. Junio C HamanoSep 3, 2009
  13. Michael J GruberSep 4, 2009
  14. Junio C HamanoSep 4, 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.