git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: "Ævar Arnfjörð Bjarmason" <avarab@gmail.com>
To: git@vger.kernel.org
Cc: "Junio C Hamano" <gitster@pobox.com>,
	"Ævar Arnfjörð Bjarmason" <avarab@gmail.com>
Subject: [PATCH 19/51] i18n: git-pull "rebase against" / "merge with" messages
Date: Sun,  3 Apr 2011 16:45:43 +0000	[thread overview]
Message-ID: <1301849175-1697-20-git-send-email-avarab@gmail.com> (raw)
In-Reply-To: <1301849175-1697-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 14d9eb5..ea87ac7 100755
--- a/git-pull.sh
+++ b/git-pull.sh
@@ -140,15 +140,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")
@@ -177,30 +168,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.4.1

  parent reply	other threads:[~2011-04-03 16:47 UTC|newest]

Thread overview: 59+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-03 16:45 [PATCH 00/51] i18n: Shell script translations Ævar Arnfjörð Bjarmason
2011-04-03 16:45 ` [PATCH 01/51] i18n: git-am add git-sh-i18n Ævar Arnfjörð Bjarmason
2011-04-03 16:45 ` [PATCH 02/51] i18n: git-am one-line gettext $msg; echo Ævar Arnfjörð Bjarmason
2011-04-03 16:45 ` [PATCH 03/51] i18n: git-am multi-line getttext " Ævar Arnfjörð Bjarmason
2011-04-03 16:45 ` [PATCH 04/51] i18n: git-am eval_gettext messages Ævar Arnfjörð Bjarmason
2011-04-03 16:45 ` [PATCH 05/51] i18n: git-am echo + gettext message Ævar Arnfjörð Bjarmason
2011-04-03 16:45 ` [PATCH 06/51] i18n: git-am die messages Ævar Arnfjörð Bjarmason
2011-04-03 16:45 ` [PATCH 07/51] i18n: git-am cannot_fallback messages Ævar Arnfjörð Bjarmason
2011-04-03 16:45 ` [PATCH 08/51] i18n: git-am clean_abort messages Ævar Arnfjörð Bjarmason
2011-04-03 16:45 ` [PATCH 09/51] i18n: git-am "Apply?" message Ævar Arnfjörð Bjarmason
2011-04-03 16:45 ` [PATCH 10/51] i18n: git-am core say messages Ævar Arnfjörð Bjarmason
2011-04-03 17:33   ` Jakub Narebski
2011-04-03 17:35     ` Ævar Arnfjörð Bjarmason
2011-04-03 16:45 ` [PATCH 11/51] i18n: git-am printf(1) message to eval_gettext Ævar Arnfjörð Bjarmason
2011-04-03 16:45 ` [PATCH 12/51] i18n: git-pull add git-sh-i18n Ævar Arnfjörð Bjarmason
2011-04-03 16:45 ` [PATCH 13/51] i18n: git-pull die messages Ævar Arnfjörð Bjarmason
2011-04-03 18:14   ` Ævar Arnfjörð Bjarmason
2011-04-03 16:45 ` [PATCH 14/51] i18n: git-pull eval_gettext + die message Ævar Arnfjörð Bjarmason
2011-04-03 16:45 ` [PATCH 15/51] i18n: git-pull eval_gettext + warning message Ævar Arnfjörð Bjarmason
2011-04-03 16:45 ` [PATCH 16/51] i18n: git-pull split up "no candidate" message Ævar Arnfjörð Bjarmason
2011-04-03 16:45 ` [PATCH 17/51] i18n: git-pull "You asked to pull" message Ævar Arnfjörð Bjarmason
2011-04-03 16:45 ` [PATCH 18/51] i18n: git-pull "[...] not currently on a branch" message Ævar Arnfjörð Bjarmason
2011-04-03 16:45 ` Ævar Arnfjörð Bjarmason [this message]
2011-04-03 17:33   ` [PATCH 19/51] i18n: git-pull "rebase against" / "merge with" messages Martin von Zweigbergk
2011-04-04  7:39     ` Ævar Arnfjörð Bjarmason
2011-04-03 16:45 ` [PATCH 20/51] i18n: git-submodule add git-sh-i18n Ævar Arnfjörð Bjarmason
2011-04-03 16:45 ` [PATCH 21/51] i18n: git-submodule echo + eval_gettext messages Ævar Arnfjörð Bjarmason
2011-04-03 16:45 ` [PATCH 22/51] i18n: git-submodule say " Ævar Arnfjörð Bjarmason
2011-04-03 16:45 ` [PATCH 23/51] i18n: git-submodule die " Ævar Arnfjörð Bjarmason
2011-04-03 16:45 ` [PATCH 24/51] i18n: git-submodule $update_module say + die messages Ævar Arnfjörð Bjarmason
2011-04-03 16:45 ` [PATCH 25/51] i18n: git-submodule "cached cannot be used" message Ævar Arnfjörð Bjarmason
2011-04-03 16:45 ` [PATCH 26/51] i18n: git-submodule "Submodule change[...]" messages Ævar Arnfjörð Bjarmason
2011-04-03 16:45 ` [PATCH 27/51] i18n: git-submodule $errmsg messages Ævar Arnfjörð Bjarmason
2011-04-03 16:45 ` [PATCH 28/51] i18n: git-submodule "Entering [...]" message Ævar Arnfjörð Bjarmason
2011-04-03 16:45 ` [PATCH 29/51] i18n: git-submodule "[...] path is ignored" message Ævar Arnfjörð Bjarmason
2011-04-03 16:45 ` [PATCH 30/51] i18n: git-submodule "path not initialized" message Ævar Arnfjörð Bjarmason
2011-04-03 16:45 ` [PATCH 31/51] i18n: git-submodule "blob" and "submodule" messages Ævar Arnfjörð Bjarmason
2011-04-03 16:45 ` [PATCH 32/51] i18n: git-stash add git-sh-i18n Ævar Arnfjörð Bjarmason
2011-04-03 16:45 ` [PATCH 33/51] i18n: git-stash echo + gettext message Ævar Arnfjörð Bjarmason
2011-04-03 16:45 ` [PATCH 34/51] i18n: git-stash say + gettext messages Ævar Arnfjörð Bjarmason
2011-04-03 16:45 ` [PATCH 35/51] i18n: git-stash die " Ævar Arnfjörð Bjarmason
2011-04-03 16:46 ` [PATCH 36/51] i18n: git-stash die + eval_gettext messages Ævar Arnfjörð Bjarmason
2011-04-03 16:46 ` [PATCH 37/51] i18n: git-stash die + eval_gettext $* messages Ævar Arnfjörð Bjarmason
2011-04-03 16:46 ` [PATCH 38/51] i18n: git-stash die + eval_gettext $1 messages Ævar Arnfjörð Bjarmason
2011-04-03 16:46 ` [PATCH 39/51] i18n: git-stash "unknown option" message Ævar Arnfjörð Bjarmason
2011-04-03 16:46 ` [PATCH 40/51] i18n: git-stash drop_stash say/die messages Ævar Arnfjörð Bjarmason
2011-04-03 16:46 ` [PATCH 41/51] i18n: git-bisect add git-sh-i18n Ævar Arnfjörð Bjarmason
2011-04-03 16:46 ` [PATCH 42/51] i18n: git-bisect gettext + echo message Ævar Arnfjörð Bjarmason
2011-04-03 16:46 ` [PATCH 43/51] i18n: git-bisect echo + gettext messages Ævar Arnfjörð Bjarmason
2011-04-03 16:46 ` [PATCH 44/51] i18n: git-bisect echo + eval_gettext message Ævar Arnfjörð Bjarmason
2011-04-03 16:46 ` [PATCH 45/51] i18n: git-bisect die + gettext messages Ævar Arnfjörð Bjarmason
2011-04-03 16:46 ` [PATCH 46/51] i18n: git-bisect die + eval_gettext messages Ævar Arnfjörð Bjarmason
2011-04-03 16:46 ` [PATCH 47/51] i18n: git-bisect bisect_run + $@ messages Ævar Arnfjörð Bjarmason
2011-04-03 16:46 ` [PATCH 48/51] i18n: git-bisect bisect_reset + $1 messages Ævar Arnfjörð Bjarmason
2011-04-03 16:46 ` [PATCH 49/51] i18n: git-bisect bisect_replay " Ævar Arnfjörð Bjarmason
2011-04-03 16:46 ` [PATCH 50/51] i18n: git-bisect [Y/n] messages Ævar Arnfjörð Bjarmason
2011-04-03 16:46 ` [PATCH 51/51] i18n: git-bisect bisect_next_check "You need to" message Ævar Arnfjörð Bjarmason
2011-04-03 19:05 ` [PATCH 00/51] i18n: Shell script translations Junio C Hamano
2011-04-10 13:04   ` Ævar Arnfjörð Bjarmason

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

  List information: http://vger.kernel.org/majordomo-info.html

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

  git send-email \
    --in-reply-to=1301849175-1697-20-git-send-email-avarab@gmail.com \
    --to=avarab@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    /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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).