All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Ævar Arnfjörð Bjarmason" <avarab@gmail.com>
To: git@vger.kernel.org
Cc: "Jan Krüger" <jk@jk.gs>, "Ævar Arnfjörð Bjarmason" <avarab@gmail.com>
Subject: [PATCH/RFC 8/8] gettextize: git-pull "rebase against" / "merge with" messages
Date: Mon, 13 Sep 2010 19:35:58 +0000	[thread overview]
Message-ID: <1284406558-23684-9-git-send-email-avarab@gmail.com> (raw)
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

      parent reply	other threads:[~2010-09-13 19:36 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-09-13 19:35 [PATCH/RFC 0/8] gettextize: git-pull Ævar Arnfjörð Bjarmason
2010-09-13 19:35 ` [PATCH/RFC 1/8] gettextize: git-pull add git-sh-i18n Ævar Arnfjörð Bjarmason
2010-09-13 19:35 ` [PATCH/RFC 2/8] gettextize: git-pull die messages Ævar Arnfjörð Bjarmason
2010-09-13 19:35 ` [PATCH/RFC 3/8] gettextize: git-pull eval_gettext + die message Ævar Arnfjörð Bjarmason
2010-09-13 21:57   ` Ævar Arnfjörð Bjarmason
2010-09-13 19:35 ` [PATCH/RFC 4/8] gettextize: git-pull eval_gettext + warning message Ævar Arnfjörð Bjarmason
2010-09-13 19:35 ` [PATCH/RFC 5/8] gettextize: git-pull split up "no candidate" message Ævar Arnfjörð Bjarmason
2010-09-13 19:35 ` [PATCH/RFC 6/8] gettextize: git-pull "You asked to pull" message Ævar Arnfjörð Bjarmason
2010-09-13 19:35 ` [PATCH/RFC 7/8] gettextize: git-pull "[...] not currently on a branch" message Ævar Arnfjörð Bjarmason
2010-09-13 19:35 ` Ævar Arnfjörð Bjarmason [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1284406558-23684-9-git-send-email-avarab@gmail.com \
    --to=avarab@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=jk@jk.gs \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.