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

[PATCH 19/51] i18n: git-pull "rebase against" / "merge with" messages

From
Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Date
Apr 3, 2011, 16:45 UTC
Message-ID
<1301849175-1697-20-git-send-email-avarab@gmail.com>
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
Previous: Ævar Arnfjörð BjarmasonNext: Martin von Zweigbergk
Message 23 of 59 in “i18n: Shell script translations”
  1. 00/51 i18n: Shell script translationsÆvar Arnfjörð Bjarmason, Apr 3, 2011
  2. 01/51 i18n: git-am add git-sh-i18nÆvar Arnfjörð Bjarmason, Apr 3, 2011
  3. 02/51 i18n: git-am one-line gettext $msg; echoÆvar Arnfjörð Bjarmason, Apr 3, 2011
  4. 03/51 i18n: git-am multi-line getttext $msg; echoÆvar Arnfjörð Bjarmason, Apr 3, 2011
  5. 04/51 i18n: git-am eval_gettext messagesÆvar Arnfjörð Bjarmason, Apr 3, 2011
  6. 05/51 i18n: git-am echo + gettext messageÆvar Arnfjörð Bjarmason, Apr 3, 2011
  7. 06/51 i18n: git-am die messagesÆvar Arnfjörð Bjarmason, Apr 3, 2011
  8. 07/51 i18n: git-am cannot_fallback messagesÆvar Arnfjörð Bjarmason, Apr 3, 2011
  9. 08/51 i18n: git-am clean_abort messagesÆvar Arnfjörð Bjarmason, Apr 3, 2011
  10. 09/51 i18n: git-am "Apply?" messageÆvar Arnfjörð Bjarmason, Apr 3, 2011
  11. 10/51 i18n: git-am core say messagesÆvar Arnfjörð Bjarmason, Apr 3, 2011
  12. Jakub NarebskiApr 3, 2011
  13. Ævar Arnfjörð BjarmasonApr 3, 2011
  14. 11/51 i18n: git-am printf(1) message to eval_gettextÆvar Arnfjörð Bjarmason, Apr 3, 2011
  15. 12/51 i18n: git-pull add git-sh-i18nÆvar Arnfjörð Bjarmason, Apr 3, 2011
  16. 13/51 i18n: git-pull die messagesÆvar Arnfjörð Bjarmason, Apr 3, 2011
  17. Ævar Arnfjörð BjarmasonApr 3, 2011
  18. 14/51 i18n: git-pull eval_gettext + die messageÆvar Arnfjörð Bjarmason, Apr 3, 2011
  19. 15/51 i18n: git-pull eval_gettext + warning messageÆvar Arnfjörð Bjarmason, Apr 3, 2011
  20. 16/51 i18n: git-pull split up "no candidate" messageÆvar Arnfjörð Bjarmason, Apr 3, 2011
  21. 17/51 i18n: git-pull "You asked to pull" messageÆvar Arnfjörð Bjarmason, Apr 3, 2011
  22. 18/51 i18n: git-pull "[...] not currently on a branch" messageÆvar Arnfjörð Bjarmason, Apr 3, 2011
  23. 19/51 i18n: git-pull "rebase against" / "merge with" messagesÆvar Arnfjörð Bjarmason, Apr 3, 2011
  24. Martin von ZweigbergkApr 3, 2011
  25. Ævar Arnfjörð BjarmasonApr 4, 2011
  26. 20/51 i18n: git-submodule add git-sh-i18nÆvar Arnfjörð Bjarmason, Apr 3, 2011
  27. 21/51 i18n: git-submodule echo + eval_gettext messagesÆvar Arnfjörð Bjarmason, Apr 3, 2011
  28. 22/51 i18n: git-submodule say + eval_gettext messagesÆvar Arnfjörð Bjarmason, Apr 3, 2011
  29. 23/51 i18n: git-submodule die + eval_gettext messagesÆvar Arnfjörð Bjarmason, Apr 3, 2011
  30. 24/51 i18n: git-submodule $update_module say + die messagesÆvar Arnfjörð Bjarmason, Apr 3, 2011
  31. 25/51 i18n: git-submodule "cached cannot be used" messageÆvar Arnfjörð Bjarmason, Apr 3, 2011
  32. 26/51 i18n: git-submodule "Submodule change[...]" messagesÆvar Arnfjörð Bjarmason, Apr 3, 2011
  33. 27/51 i18n: git-submodule $errmsg messagesÆvar Arnfjörð Bjarmason, Apr 3, 2011
  34. 28/51 i18n: git-submodule "Entering [...]" messageÆvar Arnfjörð Bjarmason, Apr 3, 2011
  35. 29/51 i18n: git-submodule "[...] path is ignored" messageÆvar Arnfjörð Bjarmason, Apr 3, 2011
  36. 30/51 i18n: git-submodule "path not initialized" messageÆvar Arnfjörð Bjarmason, Apr 3, 2011
  37. 31/51 i18n: git-submodule "blob" and "submodule" messagesÆvar Arnfjörð Bjarmason, Apr 3, 2011
  38. 32/51 i18n: git-stash add git-sh-i18nÆvar Arnfjörð Bjarmason, Apr 3, 2011
  39. 33/51 i18n: git-stash echo + gettext messageÆvar Arnfjörð Bjarmason, Apr 3, 2011
  40. 34/51 i18n: git-stash say + gettext messagesÆvar Arnfjörð Bjarmason, Apr 3, 2011
  41. 35/51 i18n: git-stash die + gettext messagesÆvar Arnfjörð Bjarmason, Apr 3, 2011
  42. 36/51 i18n: git-stash die + eval_gettext messagesÆvar Arnfjörð Bjarmason, Apr 3, 2011
  43. 37/51 i18n: git-stash die + eval_gettext $* messagesÆvar Arnfjörð Bjarmason, Apr 3, 2011
  44. 38/51 i18n: git-stash die + eval_gettext $1 messagesÆvar Arnfjörð Bjarmason, Apr 3, 2011
  45. 39/51 i18n: git-stash "unknown option" messageÆvar Arnfjörð Bjarmason, Apr 3, 2011
  46. 40/51 i18n: git-stash drop_stash say/die messagesÆvar Arnfjörð Bjarmason, Apr 3, 2011
  47. 41/51 i18n: git-bisect add git-sh-i18nÆvar Arnfjörð Bjarmason, Apr 3, 2011
  48. 42/51 i18n: git-bisect gettext + echo messageÆvar Arnfjörð Bjarmason, Apr 3, 2011
  49. 43/51 i18n: git-bisect echo + gettext messagesÆvar Arnfjörð Bjarmason, Apr 3, 2011
  50. 44/51 i18n: git-bisect echo + eval_gettext messageÆvar Arnfjörð Bjarmason, Apr 3, 2011
  51. 45/51 i18n: git-bisect die + gettext messagesÆvar Arnfjörð Bjarmason, Apr 3, 2011
  52. 46/51 i18n: git-bisect die + eval_gettext messagesÆvar Arnfjörð Bjarmason, Apr 3, 2011
  53. 47/51 i18n: git-bisect bisect_run + $@ messagesÆvar Arnfjörð Bjarmason, Apr 3, 2011
  54. 48/51 i18n: git-bisect bisect_reset + $1 messagesÆvar Arnfjörð Bjarmason, Apr 3, 2011
  55. 49/51 i18n: git-bisect bisect_replay + $1 messagesÆvar Arnfjörð Bjarmason, Apr 3, 2011
  56. 50/51 i18n: git-bisect [Y/n] messagesÆvar Arnfjörð Bjarmason, Apr 3, 2011
  57. 51/51 i18n: git-bisect bisect_next_check "You need to" messageÆvar Arnfjörð Bjarmason, Apr 3, 2011
  58. Junio C HamanoApr 3, 2011
  59. Ævar Arnfjörð BjarmasonApr 10, 2011

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.