Subject: Re: [PATCH v2 2/7] fetch: add --negotiation-restrict option

From: Junio C Hamano <[email-masked]>
Date: Wed, 15 Apr 2026 14:57:15 -0700

"Derrick Stolee via GitGitGadget" <[email-masked]> writes:

> -			warning("ignoring --negotiation-tip=%s because it does not match any refs",
> -				s);
> +			warning(_("ignoring %s=%s because it does not match any refs"),
> +				"--negotiation-restrict", s);
> -			warning("ignoring --negotiation-tip because the protocol does not support it");
> +			warning(_("ignoring %s because the protocol does not support it"),
> +				"--negotiation-restrict");

These are nice touches to make sure translators cannot possibly
botch these option names that must be given verbatim.

>  	}
>  	return transport;
>  }
> @@ -2567,6 +2568,8 @@ int cmd_fetch(int argc,
>  		OPT_IPVERSION(&family),
>  		OPT_STRING_LIST(0, "negotiation-tip", &negotiation_tip, N_("revision"),
>  				N_("report that we have only objects reachable from this object")),
> +		OPT_STRING_LIST(0, "negotiation-restrict", &negotiation_tip, N_("revision"),
> +				N_("report that we have only objects reachable from this object")),

Is OPT_ALIAS() suitable for this?

> @@ -2657,7 +2660,7 @@ int cmd_fetch(int argc,
>  	}
>  
>  	if (negotiate_only && !negotiation_tip.nr)
> -		die(_("--negotiate-only needs one or more --negotiation-tip=*"));
> +		die(_("--negotiate-only needs one or more --negotiation-restrict=*"));

OK.  Shouldn't this also do the "%s" thing?