Subject: Re: [PATCH] Signed-off-by: aum2357 <[email-masked]>

From: Collin Funk <[email-masked]>
Date: Fri, 13 Mar 2026 07:41:46 -0700

aum2357 <[email-masked]> writes:

> diff: use conventional comparison order
>
> Replace `0 <= addremove_explicit` with `addremove_explicit >= 0`
> to follow the common coding style where variables appear on the
> left side of comparisons.
> ---
>  builtin/add.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/builtin/add.c b/builtin/add.c
> index 0ee21692c2..ad0d6047af 100644
> --- a/builtin/add.c
> +++ b/builtin/add.c
> @@ -432,7 +432,7 @@ int cmd_add(int argc,
>  	argc--;
>  	argv++;
>  
> -	if (0 <= addremove_explicit)
> +	if ( addremove_explicit >= 0 )
>  		addremove = addremove_explicit;
>  	else if (take_worktree_changes && ADDREMOVE_DEFAULT)
>  		addremove = 0; /* "-u" was given but not "-A" */

See a previous thread on this topic [1].

We have a dead link in the Coreutils README-hacking that is likely to
that thread. We also generally prefer the previous ordering there.

Collin

[1] https://public-inbox.org/git/[email-masked]/