From: Junio C Hamano Date: Fri, 16 Oct 2026 16:59:36 GMT Subject: Re: [PATCH] sideband: skip unrecognized allowControlCharacters keywords Message-ID: In-Reply-To: <20261016142515.T1gr4%taahol@utu.fi> Tuomas Ahola writes: > "Thomas Bachem via GitGitGadget" 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.