Re: [PATCH v5 12/13] xdiff: use enum macros NONE(0), SOME(1), TOO_MANY(2) in xprepare.c
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Sep 24, 2025, 17:29 UTC
- Message-ID
- <xmqqtt0rlpxz.fsf@gitster.g>
- In-Reply-To
- <1c3461c3-09bb-404d-a4dc-a895baba68f2@gmail.com>
Phillip Wood <phillip.wood123@gmail.com> writes:
> Our coding guidelines say not to use "!!x" (I assume we're supposed to > do "x != 0" instead) but in practice it's pretty common to see it in > our codebase. I'd maybe try a (bool) cast and see what people say.
Offtopic. I am perfectly fine to remove the "avoid !!x, as it is too clever and confusing to others" entry from the guidelines. As we have many of them and it is a fairly well understood idiom in C, I would imagine that it have become less confusing already since the entry was written.
> Thanks for cleaning up the xdiff code, it is much appreciated
Hear, hear.