Subject: Re: [PATCH 09/11] read-cache: require flags for `write_locked_index()`

From: Junio C Hamano <[email-masked]>
Date: Mon, 02 Oct 2017 12:49:11 +0900

Martin Ågren <[email-masked]> writes:

> ... Instead, require that one of the
> flags is set. Adjust documentation and the assert we already have for
> checking that we don't have too many flags. Add a macro `HAS_SINGLE_BIT`
> (inspired by `HAS_MULTI_BITS`) to simplify this check and similar checks
> in the future.

I do not have a strong opinion against this approach, but if
something can take only one of two values, wouldn't it make more
sense to express it as a single boolean, I wonder.  Then there is no
need to invent a cute HAS_SINGLE_BIT() macro, either.

"commit and leave it open" cannot be expressed with such a scheme,
but with the HAS_SINGLE_BIT() scheme it can't anyway, so...