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

[PATCH/RFC 8/8] gettextize: git-pull "rebase against" / "merge with" messages

From
Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Date
Sep 13, 2010, 19:35 UTC
Message-ID
<1284406558-23684-9-git-send-email-avarab@gmail.com>
In-Reply-To
<1284406558-23684-1-git-send-email-avarab@gmail.com>

Gettextize the two messages that used "rebase against" and "merge with". Split them into two depending on whether we are rebasing or not.

This results in some duplication, but makes it much easier for translators to translate these messages.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
---
 git-pull.sh |   84 ++++++++++++++++++++++++++++++++++++----------------------
 1 files changed, 52 insertions(+), 32 deletions(-)
diff --git a/git-pull.sh b/git-pull.sh
index ec37d1c..2576e06 100755
--- a/git-pull.sh
+++ b/git-pull.sh
@@ -132,15 +132,6 @@ error_on_no_merge_candidates () {
 		esac
 	done
 
-	if test true = "$rebase"
-	then
-		op_type=rebase
-		op_prep=against
-	else
-		op_type=merge
-		op_prep=with
-	fi
-
 	curr_branch=${curr_branch#refs/heads/}
 	upstream=$(git config "branch.$curr_branch.merge")
 	remote=$(git config "branch.$curr_branch.remote")
@@ -169,30 +160,59 @@ Please specify which remote branch you want to use on the command
 line and try again (e.g. 'git pull <repository> <refspec>').
 See git-pull(1) for details."; echo
 	elif [ -z "$upstream" ]; then
-		echo "You asked me to pull without telling me which branch you"
-		echo "want to $op_type $op_prep, and 'branch.${curr_branch}.merge' in"
-		echo "your configuration file does not tell me, either. Please"
-		echo "specify which branch you want to use on the command line and"
-		echo "try again (e.g. 'git pull <repository> <refspec>')."
-		echo "See git-pull(1) for details."
-		echo
-		echo "If you often $op_type $op_prep the same branch, you may want to"
-		echo "use something like the following in your configuration file:"
-		echo
-		echo "    [branch \"${curr_branch}\"]"
-		echo "    remote = <nickname>"
-		echo "    merge = <remote-ref>"
-		test rebase = "$op_type" &&
-			echo "    rebase = true"
-		echo
-		echo "    [remote \"<nickname>\"]"
-		echo "    url = <url>"
-		echo "    fetch = <refspec>"
-		echo
-		echo "See git-config(1) for details."
+		if test true = "$rebase"
+		then
+			eval_gettext "You asked me to pull without telling me which branch you
+want to rebase against, and 'branch.\${curr_branch}.merge' in
+your configuration file does not tell me, either. Please
+specify which branch you want to use on the command line and
+try again (e.g. 'git pull <repository> <refspec>').
+See git-pull(1) for details.
+
+If you often rebase against the same branch, you may want to
+use something like the following in your configuration file:
+
+    [branch \"\${curr_branch}\"]
+    remote = <nickname>
+    merge = <remote-ref>
+    rebase = true
+
+    [remote \"<nickname>\"]
+    url = <url>
+    fetch = <refspec>
+
+See git-config(1) for details."; echo
+		else
+			eval_gettext "You asked me to pull without telling me which branch you
+want to merge with, and 'branch.\${curr_branch}.merge' in
+your configuration file does not tell me, either. Please
+specify which branch you want to use on the command line and
+try again (e.g. 'git pull <repository> <refspec>').
+See git-pull(1) for details.
+
+If you often merge with the same branch, you may want to
+use something like the following in your configuration file:
+
+    [branch \"\${curr_branch}\"]
+    remote = <nickname>
+    merge = <remote-ref>
+
+    [remote \"<nickname>\"]
+    url = <url>
+    fetch = <refspec>
+
+See git-config(1) for details."; echo
+		fi
 	else
-		echo "Your configuration specifies to $op_type $op_prep the ref '${upstream#refs/heads/}'"
-		echo "from the remote, but no such ref was fetched."
+		upstream_branch="${upstream#refs/heads/}"
+		if test true = "$rebase"
+		then
+			eval_gettext "Your configuration specifies to rebase against the ref '\$upstream_branch'
+from the remote, but no such ref was fetched."; echo
+		else
+			eval_gettext "Your configuration specifies to merge with the ref '\$upstream_branch'
+from the remote, but no such ref was fetched."; echo
+		fi
 	fi
 	exit 1
 }
-- 
1.7.3.rc1.110.g6776a.dirty
Previous: Ævar Arnfjörð Bjarmason
Message 10 of 10 in “gettextize: git-pull”
  1. 0/8 gettextize: git-pullÆvar Arnfjörð Bjarmason, Sep 13, 2010
  2. 1/8 gettextize: git-pull add git-sh-i18nÆvar Arnfjörð Bjarmason, Sep 13, 2010
  3. 2/8 gettextize: git-pull die messagesÆvar Arnfjörð Bjarmason, Sep 13, 2010
  4. 3/8 gettextize: git-pull eval_gettext + die messageÆvar Arnfjörð Bjarmason, Sep 13, 2010
  5. Ævar Arnfjörð BjarmasonSep 13, 2010
  6. 4/8 gettextize: git-pull eval_gettext + warning messageÆvar Arnfjörð Bjarmason, Sep 13, 2010
  7. 5/8 gettextize: git-pull split up "no candidate" messageÆvar Arnfjörð Bjarmason, Sep 13, 2010
  8. 6/8 gettextize: git-pull "You asked to pull" messageÆvar Arnfjörð Bjarmason, Sep 13, 2010
  9. 7/8 gettextize: git-pull "[...] not currently on a branch" messageÆvar Arnfjörð Bjarmason, Sep 13, 2010
  10. 8/8 gettextize: git-pull "rebase against" / "merge with" messagesÆvar Arnfjörð Bjarmason, Sep 13, 2010

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.