Thread (1 message) 1 message, 1 author, 2025-10-13

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

From: Junio C Hamano <hidden>
Date: 2025-10-13 19:54:07

Siddharth Asthana [off-list ref] 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);
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help