Re: [PATCH v3 10/10] xdiff: treat xdfile_t.rchg like an enum
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Sep 21, 2025, 00:00 UTC
- Message-ID
- <xmqqms6owu7o.fsf@gitster.g>
- In-Reply-To
- <1e404c3290bd4ba8b4973a597b976c301138cf73.1758294992.git.gitgitgadget@gmail.com>
"Ezekiel Newren via GitGitGadget" <gitgitgadget@gmail.com> writes:
Show 11 quoted lines
> 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.