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

Re: [PATCH v3] config: improve error message for boolean config

From
Junio C Hamano <gitster@pobox.com>
Date
Feb 12, 2021, 19:52 UTC
Message-ID
<xmqqtuqhukrb.fsf@gitster.c.googlers.com>
In-Reply-To
<YCZarBDX2E3U0OXU@coredump.intra.peff.net>
Jeff King <peff@peff.net> writes:
Show 31 quoted lines
> Thanks, all the changes here look good to me except for one curiosity:
>
>> diff --git a/config.c b/config.c
>> index b922b4f28572..f90b633dba21 100644
>> --- a/config.c
>> +++ b/config.c
>> @@ -1180,6 +1180,20 @@ static void die_bad_number(const char *name, const char *value)
>>  	}
>>  }
>>  
>> +NORETURN
>> +static void die_bad_bool(const char *name, const char *value)
>> +{
>> +	if (!strcmp(name, "GIT_TEST_GETTEXT_POISON"))
>> +		/*
>> +		 * We explicitly *don't* use _() here since it would
>> +		 * cause an infinite loop with _() needing to call
>> +		 * use_gettext_poison().
>> +		 */
>> +		die("bad boolean config value '%s' for '%s'", value, name);
>> +	else
>> +		die(_("bad boolean config value '%s' for '%s'"), value, name);
>> +}
>
> ...if this is rebased on the current master that does not have
> GIT_TEST_GETTEXT_POISON anymore, then I think this whole function can be
> simplified down to the final line.
>
> Since it looks like Junio applied this on top of v2.30.1, which still
> has GETTEXT_POISON, we need it here. But we should remember to remove it
> with the rest of the GETTEXT_POISON once it's all merged together.

Thanks for being extra careful. I sort-of considered that this was a bugfix and that was why it is made mergeable down to the maint track, but I do not mind making this one of the "incentives" to upgrade for our users ;-)

I actually suspect that without any of us worrying about it, Ævar will take care of the cleaning up when the dust settles.

Thanks.
Previous: Jeff King
Message 13 of 13 in “config: improve error message for boolean config”
  1. 0/2 config: improve error message for boolean configAndrew Klotz via GitGitGadget, Sep 18, 2020
  2. 1/2 config: improve error message for boolean configAndrew Klotz via GitGitGadget, Sep 18, 2020
  3. Jeff KingSep 18, 2020
  4. Phillip WoodSep 18, 2020
  5. Junio C HamanoSep 18, 2020
  6. 2/2 formatting for error messagesAndrew Klotz via GitGitGadget, Sep 18, 2020
  7. Junio C HamanoSep 18, 2020
  8. config: improve error message for boolean configAndrew Klotz via GitGitGadget, Feb 9, 2021
  9. Jeff KingFeb 9, 2021
  10. Junio C HamanoFeb 9, 2021
  11. config: improve error message for boolean configAndrew Klotz via GitGitGadget, Feb 11, 2021
  12. Jeff KingFeb 12, 2021
  13. Junio C HamanoFeb 12, 2021

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.