git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH 1/2] i18n: ambiguous refname message is not translated

From
Sandy Carter <sandy.carter@savoirfairelinux.com>
Date
Sep 5, 2014, 18:57 UTC
Message-ID
<1409943445-12283-2-git-send-email-sandy.carter@savoirfairelinux.com>
In-Reply-To
<1409943445-12283-1-git-send-email-sandy.carter@savoirfairelinux.com>

Allow warning message about ambuiguous refname to be exported to .pot files when checking out a refname which is the name of a tag and of a branch for example.

Signed-off-by: Sandy Carter <sandy.carter@savoirfairelinux.com>
---
 sha1_name.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/sha1_name.c b/sha1_name.c
index 63ee66f..6571287 100644
--- a/sha1_name.c
+++ b/sha1_name.c
@@ -434,7 +434,7 @@ static int interpret_nth_prior_checkout(const char *name, int namelen, struct st
 
 static int get_sha1_basic(const char *str, int len, unsigned char *sha1)
 {
-	static const char *warn_msg = "refname '%.*s' is ambiguous.";
+	static const char *warn_msg = N_("refname '%.*s' is ambiguous.");
 	static const char *object_name_msg = N_(
 	"Git normally never creates a ref that ends with 40 hex characters\n"
 	"because it will be ignored when you just specify 40-hex. These refs\n"
@@ -454,7 +454,7 @@ static int get_sha1_basic(const char *str, int len, unsigned char *sha1)
 		if (warn_ambiguous_refs && warn_on_object_refname_ambiguity) {
 			refs_found = dwim_ref(str, len, tmp_sha1, &real_ref);
 			if (refs_found > 0) {
-				warning(warn_msg, len, str);
+				warning(_(warn_msg), len, str);
 				if (advice_object_name_warning)
 					fprintf(stderr, "%s\n", _(object_name_msg));
 			}
@@ -514,7 +514,7 @@ static int get_sha1_basic(const char *str, int len, unsigned char *sha1)
 	if (warn_ambiguous_refs &&
 	    (refs_found > 1 ||
 	     !get_short_sha1(str, len, tmp_sha1, GET_SHA1_QUIETLY)))
-		warning(warn_msg, len, str);
+		warning(_(warn_msg), len, str);
 
 	if (reflog_len) {
 		int nth, i;
-- 
2.1.0
Previous: Sandy CarterNext: Sandy Carter
Message 2 of 4 in “Translations for ambiguous refname warning”
  1. 0/2 Translations for ambiguous refname warningSandy Carter, Sep 5, 2014
  2. 1/2 i18n: ambiguous refname message is not translatedSandy Carter, Sep 5, 2014
  3. 2/2 i18n translate builtin warning, error, usage, fatal messagesSandy Carter, Sep 5, 2014
  4. Junio C HamanoSep 5, 2014

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.