Skip to contentSkip to conversation

fetch: fix negotiate-only error message

PATCH In review Robert Coup 3 participants 3 messages Jan 28, 2022 – Feb 5, 2022

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 fetch: fix negotiate-only error message

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=*.

---
 builtin/fetch.c        | 2 +-
 t/t5702-protocol-v2.sh | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
builtin/fetch.c +1 -1
index 5f06b21f8e..af689a72a8 100644
@@ -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)
t/t5702-protocol-v2.sh +1 -1
index 710f33e2aa..59a49cede7 100755
@@ -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 \
Signature · 1 line
2.34.0
Reviewed-by on v1 1/1
#1 lore raw
Quoted 3 lines · Robert Coup

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.

#2 lore raw
In reply to Robert Coup
Quoted 15 lines · Le vendredi 28 janvier 2022, 15:36:02 CET Robert Coup a écrit :

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=*.

---
 builtin/fetch.c        | 2 +-
 t/t5702-protocol-v2.sh | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
builtin/fetch.c +0 -0
index 5f06b21f8e..af689a72a8 100644

builtin/fetch.c int cmd_fetch(int argc, const char **argv, const char *prefix) · line 2033

Quoted 6 lines
builtin/fetch.c +1 -1
@@ -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")

Quoted 16 lines
builtin/fetch.c +0 -0
 	if (deepen_relative) {
 		if (deepen_relative < 0)
t/t5702-protocol-v2.sh +1 -1
index 710f33e2aa..59a49cede7 100755
@@ -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 \