Skip to contentSkip to conversation

fetch-pack: parameterize message containing 'ready' keyword

PATCH In review Bagas Sanjaya 3 participants 3 messages Dec 22, 2021 – Dec 23, 2021

lore
Share & tools
lore
#0 lore raw

PATCH v4 1/1 fetch-pack: parameterize message containing 'ready' keyword

The protocol keyword 'ready' isn't meant for translation. Pass it as parameter instead of spell it in die() message (and potentially confuse translators).

---
Changes since v3 [1]:
- Comment style fix (suggested by Junio)

[1]: https://lore.kernel.org/git/[email protected]/T/#u

 fetch-pack.c | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)
fetch-pack.c +10 -2
index 34987a2c30..51385cb3c9 100644
@@ -1415,9 +1415,17 @@ static int process_ack(struct fetch_negotiator *negotiator,
 	 * otherwise.
 	 */
 	if (*received_ready && reader->status != PACKET_READ_DELIM)
-		die(_("expected packfile to be sent after 'ready'"));
+		/*
+		 * TRANSLATORS: The parameter will be 'ready', a protocol
+		 * keyword.
+		 */
+		die(_("expected packfile to be sent after '%s'"), "ready");
 	if (!*received_ready && reader->status != PACKET_READ_FLUSH)
-		die(_("expected no other sections to be sent after no 'ready'"));
+		/*
+		 * TRANSLATORS: The parameter will be 'ready', a protocol
+		 * keyword.
+		 */
+		die(_("expected no other sections to be sent after '%s'"), "ready");
 
 	return 0;
 }

base-commit: 69a9c10c95e28df457e33b3c7400b16caf2e2962

Signature · 1 line
An old man doll... just what I always wanted! - Clara
#1 lore raw
Quoted 39 lines · Bagas Sanjaya

The protocol keyword 'ready' isn't meant for translation. Pass it as parameter instead of spell it in die() message (and potentially confuse translators).

---
Changes since v3 [1]:
- Comment style fix (suggested by Junio)

[1]: https://lore.kernel.org/git/[email protected]/T/#u

 fetch-pack.c | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)
fetch-pack.c +10 -2
index 34987a2c30..51385cb3c9 100644
@@ -1415,9 +1415,17 @@ static int process_ack(struct fetch_negotiator *negotiator,
 	 * otherwise.
 	 */
 	if (*received_ready && reader->status != PACKET_READ_DELIM)
-		die(_("expected packfile to be sent after 'ready'"));
+		/*
+		 * TRANSLATORS: The parameter will be 'ready', a protocol
+		 * keyword.
+		 */
+		die(_("expected packfile to be sent after '%s'"), "ready");
 	if (!*received_ready && reader->status != PACKET_READ_FLUSH)
-		die(_("expected no other sections to be sent after no 'ready'"));
+		/*
+		 * TRANSLATORS: The parameter will be 'ready', a protocol
+		 * keyword.
+		 */
+		die(_("expected no other sections to be sent after '%s'"), "ready");
 
 	return 0;
 }
Quoted 1 line

base-commit: 69a9c10c95e28df457e33b3c7400b16caf2e2962

This version (and earlier ones, really) looks good to me. Thanks!

#2 lore raw
Quoted 22 lines · Ævar Arnfjörð Bjarmason
Quoted 22 lines
fetch-pack.c +10 -2
index 34987a2c30..51385cb3c9 100644
@@ -1415,9 +1415,17 @@ static int process_ack(struct fetch_negotiator *negotiator,
 	 * otherwise.
 	 */
 	if (*received_ready && reader->status != PACKET_READ_DELIM)
-		die(_("expected packfile to be sent after 'ready'"));
+		/*
+		 * TRANSLATORS: The parameter will be 'ready', a protocol
+		 * keyword.
+		 */
+		die(_("expected packfile to be sent after '%s'"), "ready");
 	if (!*received_ready && reader->status != PACKET_READ_FLUSH)
-		die(_("expected no other sections to be sent after no 'ready'"));
+		/*
+		 * TRANSLATORS: The parameter will be 'ready', a protocol
+		 * keyword.
+		 */
+		die(_("expected no other sections to be sent after '%s'"), "ready");
 
Quoted 6 lines
Quoted 4 lines
fetch-pack.c +0 -0
 	return 0;
 }

base-commit: 69a9c10c95e28df457e33b3c7400b16caf2e2962

This version (and earlier ones, really) looks good to me. Thanks!

Trusting your ack wasted me one integration cycle by not looking at it myself X-<.

There is "no" missing from the latter message.

Back to finishing today's (belated) integration cycle. Hopefully I can finish before dinner.

Thanks.