Subject: Re: [PATCH v3 10/10] xdiff: treat xdfile_t.rchg like an enum

From: Junio C Hamano <[email-masked]>
Date: Sat, 20 Sep 2025 17:00:11 -0700

"Ezekiel Newren via GitGitGadget" <[email-masked]> writes:

> diff --git a/xdiff/xdiff.h b/xdiff/xdiff.h
> index 2cecde5afe..7092879829 100644
> --- a/xdiff/xdiff.h
> +++ b/xdiff/xdiff.h
> @@ -27,6 +27,10 @@
>  extern "C" {
>  #endif /* #ifdef __cplusplus */
>  
> +#define NO 0
> +#define YES 1
> +#define MAYBE 2

<xdiff/xdiff.h> is included surprisingly widely.

I am not comfortable with the idea of exposing a set of overly
genericly named macros like these, especially when they are *meant*
only to be used with xdfile_t.rchg, to those *.c files.  So far,
when they include <xdiff-interface.h> (or <ll-merge.h>), they have
been rest assured that their namespaces won't be contaminated and
they would not risk stepping on others' toes as long as they stay
away from inventing their own xdsomething or s_xsomething (neither
of which is quite similar to how we name our symbols and types).

But these are names that they may legitimately want to use for their
own use.