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.
>
> --TuomasBut 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.