Subject: Re: [PATCH v3 1/3] replay: use die_for_incompatible_opt2() for option validation

From: Junio C Hamano <[email-masked]>
Date: Mon, 13 Oct 2025 12:54:03 -0700

Siddharth Asthana <[email-masked]> writes:

> -	if (advance_name_opt && contained)
> -		die(_("options '%s' and '%s' cannot be used together"),
> -		    "--advance", "--contained");
> +	die_for_incompatible_opt2(!!advance_name_opt, "--advance",
> +				  contained, "--contained");

OK.  die_for_incompatible_optN() takes "int" for values of
individual options, so "turn this into Boolean" operator "!!" is
used for advance_name_opt that is a character pointer, but contained
is already an integer, so you do not use it there.

Makes sense.  Even though the resulting code may look slightly
strange, there is nothing wrong here.

>  	advance_name = xstrdup_or_null(advance_name_opt);
>  
>  	repo_init_revisions(repo, &revs, prefix);