Re: [PATCH 02/12] rerere: convert flags into an enum
- From
- Mark C. Chu-Carroll <markchucarroll@fastmail.com>
- Date
- Oct 27, 2026, 14:47 UTC
- Message-ID
- <c23c4593fa3add2b40613febb2911cfb@fastmail.com>
- In-Reply-To
- <20261027-pks-rerere-subcommands-v1-2-d836c36ce0c5@pks.im>
On Tue, 27 Oct 2026 11:46:45 +0100, Patrick Steinhardt <ps@pks.im> wrote:
Show 12 quoted lines
> Our modern coding guidelines say that flags should typically be passed
> around as enums so that it becomes trivial to see what kind of flags are
> expected. Adapt the rerere flags accordingly.
>
> <snip>
> +enum rerere_flags {
> + RERERE_AUTOUPDATE = (1 << 0),
> + RERERE_NOAUTOUPDATE = (1 << 1),
> + RERERE_READONLY = (1 << 2),
> + /* If MERGE_RR.lock is taken, return -1 as if rerere were disabled */
> + RERERE_NOWAIT = (1 << 3),
> +};If we're moving to using enum flags, then wouldn't it be better to explicitly add a "RERE_MERGE_LOCK_TOKEN" to the enum for that case, rather than have this value only documented by a comment?
-Mark