threads / patch / 57332

patchfetch: fix negotiate-only error message

Subject: [PATCH] fetch: fix negotiate-only error message

## tl;dr

3 messages between Jan 28, 2022 and Feb 5, 2022. Diffs are folded; open one to read it.

replies: 2people: 3as markdown or json

Robert Coup· Jan 28, 2022, 14:36 UTC · lore

The error message when invoking a negotiate-only fetch without providing any tips incorrectly refers to a --negotiate-tip=* argument. Fix this to use the actual argument, --negotiation-tip=*.

Signed-off-by: Robert Coup <robert@coup.net.nz>
---
 builtin/fetch.c        | 2 +-
 t/t5702-protocol-v2.sh | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
Show changes to 2 files +2 −2

builtin/fetch.c, t/t5702-protocol-v2.sh

diff --git a/builtin/fetch.c b/builtin/fetch.c
index 5f06b21f8e..af689a72a8 100644
--- a/builtin/fetch.c
+++ b/builtin/fetch.c
@@ -2029,7 +2029,7 @@ int cmd_fetch(int argc, const char **argv, const char *prefix)
 	}
 
 	if (negotiate_only && !negotiation_tip.nr)
-		die(_("--negotiate-only needs one or more --negotiate-tip=*"));
+		die(_("--negotiate-only needs one or more --negotiation-tip=*"));
 
 	if (deepen_relative) {
 		if (deepen_relative < 0)
diff --git a/t/t5702-protocol-v2.sh b/t/t5702-protocol-v2.sh
index 710f33e2aa..59a49cede7 100755
--- a/t/t5702-protocol-v2.sh
+++ b/t/t5702-protocol-v2.sh
@@ -619,7 +619,7 @@ test_expect_success 'usage: --negotiate-only without --negotiation-tip' '
 	setup_negotiate_only "$SERVER" "$URI" &&
 
 	cat >err.expect <<-\EOF &&
-	fatal: --negotiate-only needs one or more --negotiate-tip=*
+	fatal: --negotiate-only needs one or more --negotiation-tip=*
 	EOF
 
 	test_must_fail git -c protocol.version=2 -C client fetch \
-- 
2.34.0
Jonathan Tan· Jan 28, 2022, 17:42 UTC · re: Robert Coup · lore

Re: [PATCH] fetch: fix negotiate-only error message

Robert Coup <robert@coup.net.nz> writes:
> The error message when invoking a negotiate-only fetch without providing
> any tips incorrectly refers to a --negotiate-tip=* argument. Fix this to
> use the actual argument, --negotiation-tip=*.
Ah, the argument is indeed --negotiation-tip. Thanks for the fix.
Reviewed-by: Jonathan Tan <jonathantanmy@google.com>
Jean-Noël AVILA· Feb 5, 2022, 12:29 UTC · re: Robert Coup · lore

Re: [PATCH] fetch: fix negotiate-only error message

Le vendredi 28 janvier 2022, 15:36:02 CET Robert Coup a écrit :
Show 21 quoted lines
> The error message when invoking a negotiate-only fetch without providing
> any tips incorrectly refers to a --negotiate-tip=* argument. Fix this to
> use the actual argument, --negotiation-tip=*.
> 
> Signed-off-by: Robert Coup <robert@coup.net.nz>
> ---
>  builtin/fetch.c        | 2 +-
>  t/t5702-protocol-v2.sh | 2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/builtin/fetch.c b/builtin/fetch.c
> index 5f06b21f8e..af689a72a8 100644
> --- a/builtin/fetch.c
> +++ b/builtin/fetch.c
> @@ -2029,7 +2029,7 @@ int cmd_fetch(int argc, const char **argv, const char *prefix)
>  	}
>  
>  	if (negotiate_only && !negotiation_tip.nr)
> -		die(_("--negotiate-only needs one or more --negotiate-tip=*"));
> +		die(_("--negotiate-only needs one or more --negotiation-tip=*"));
>  
Couldn't this message be changed to
die(_("the option '%s' requires '%s'"), "--negotiate-only", "--negotiate-tip")
Show 16 quoted lines
>  	if (deepen_relative) {
>  		if (deepen_relative < 0)
> diff --git a/t/t5702-protocol-v2.sh b/t/t5702-protocol-v2.sh
> index 710f33e2aa..59a49cede7 100755
> --- a/t/t5702-protocol-v2.sh
> +++ b/t/t5702-protocol-v2.sh
> @@ -619,7 +619,7 @@ test_expect_success 'usage: --negotiate-only without --negotiation-tip' '
>  	setup_negotiate_only "$SERVER" "$URI" &&
>  
>  	cat >err.expect <<-\EOF &&
> -	fatal: --negotiate-only needs one or more --negotiate-tip=*
> +	fatal: --negotiate-only needs one or more --negotiation-tip=*
>  	EOF
>  
>  	test_must_fail git -c protocol.version=2 -C client fetch \
> 

← back to recent threads