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

Re: [PATCH] sideband: skip unrecognized allowControlCharacters keywords

From
Junio C Hamano <gitster@pobox.com>
Date
Oct 16, 2026, 16:59 UTC
Message-ID
<xmqq8q3xh98n.fsf@gitster.g>
In-Reply-To
<20261016142515.T1gr4%taahol@utu.fi>
Tuomas Ahola <taahol@utu.fi> writes:
Show 15 quoted lines
> "Thomas Bachem via GitGitGadget" <gitgitgadget@gmail.com> wrote:
>
>> +			warning(_("unrecognized value for '%s': '%.*s'"),
>> +				var, (int)(end - value), value);
>> +			value = end + !!*end;
>> +		}
>
> Reading CodingGuidelines, it seems that `!!` is a construct we would
> like to avoid:
>
>  - Some clever tricks, like using the !! operator with arithmetic
>    constructs, can be extremely confusing to others.  Avoid them,
>    unless there is a compelling reason to use them.
>
> --Tuomas

But here it is compelling. You want to normalize random byte into 0 or 1, depending on "is it 0 or non-zero?" criteria, and it certainly is easier to read than (*end ? 1 : 0).

Quite honestly, I do not think !! qualifies as "clever trick that is confusing" anymore. Perhaps putting the rule there is misguided.

Thanks.
Previous: Thomas BachemNext: Tuomas Ahola
Message 4 of 6 in “sideband: skip unrecognized allowControlCharacters keywords”
  1. sideband: skip unrecognized allowControlCharacters keywordsThomas Bachem via GitGitGadget, Oct 16, 2026
  2. Tuomas AholaOct 16, 2026
  3. Thomas BachemOct 16, 2026
  4. Junio C HamanoOct 16, 2026
  5. Tuomas AholaOct 16, 2026
  6. Junio C HamanoNov 7, 2026

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.