{"thread":{"id":"25096","subject":"[PATCH/RFC 6/8] gettextize: git-pull \"You asked to pull\" message","startedAt":"2010-09-13T19:35:50Z","lastAt":"2010-09-13T21:57:45Z","messageCount":10,"participants":["Ævar Arnfjörð Bjarmason"],"isPatch":true,"patchVersion":1,"patchTotal":8},"messages":[{"id":"150625","messageId":"1284406558-23684-1-git-send-email-avarab@gmail.com","threadId":"25096","inReplyTo":null,"subject":"[PATCH/RFC 0/8] gettextize: git-pull","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2010-09-13T19:35:50Z","receivedAt":"2010-09-13T19:35:50Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"This is an RFC on a series that makes git-pull.sh translatable. With\nthis git-bisect/rebase/stash/submodule are the only mainporcelain\ncommands that aren't translatable.\n\nI'll be folding this into the next version of the ab/i18n series I'll\nbe sending to Junio. No need to apply it to the current one.\n\nÆvar Arnfjörð Bjarmason (8):\n  gettextize: git-pull add git-sh-i18n\n  gettextize: git-pull die messages\n  gettextize: git-pull eval_gettext + die message\n  gettextize: git-pull eval_gettext + warning message\n  gettextize: git-pull split up \"no candidate\" message\n  gettextize: git-pull \"You asked to pull\" message\n  gettextize: git-pull \"[...] not currently on a branch\" message\n  gettextize: git-pull \"rebase against\" / \"merge with\" messages\n\n git-pull.sh |  149 ++++++++++++++++++++++++++++++++++------------------------\n 1 files changed, 87 insertions(+), 62 deletions(-)\n\n-- \n1.7.3.rc1.110.g6776a.dirty\n"},{"id":"150623","messageId":"1284406558-23684-2-git-send-email-avarab@gmail.com","threadId":"25096","inReplyTo":"1284406558-23684-1-git-send-email-avarab@gmail.com","subject":"[PATCH/RFC 1/8] gettextize: git-pull add git-sh-i18n","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2010-09-13T19:35:51Z","receivedAt":"2010-09-13T19:35:51Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n git-pull.sh |    1 +\n 1 files changed, 1 insertions(+), 0 deletions(-)\n\ndiff --git a/git-pull.sh b/git-pull.sh\nindex 8eb74d4..544b73f 100755\n--- a/git-pull.sh\n+++ b/git-pull.sh\n@@ -9,6 +9,7 @@ LONG_USAGE='Fetch one or more remote refs and merge it/them into the current HEA\n SUBDIRECTORY_OK=Yes\n OPTIONS_SPEC=\n . git-sh-setup\n+. git-sh-i18n\n set_reflog_action \"pull $*\"\n require_work_tree\n cd_to_toplevel\n-- \n1.7.3.rc1.110.g6776a.dirty\n"},{"id":"150621","messageId":"1284406558-23684-3-git-send-email-avarab@gmail.com","threadId":"25096","inReplyTo":"1284406558-23684-1-git-send-email-avarab@gmail.com","subject":"[PATCH/RFC 2/8] gettextize: git-pull die messages","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2010-09-13T19:35:52Z","receivedAt":"2010-09-13T19:35:52Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n git-pull.sh |   20 ++++++++++----------\n 1 files changed, 10 insertions(+), 10 deletions(-)\n\ndiff --git a/git-pull.sh b/git-pull.sh\nindex 544b73f..324ac95 100755\n--- a/git-pull.sh\n+++ b/git-pull.sh\n@@ -18,20 +18,20 @@ cd_to_toplevel\n die_conflict () {\n     git diff-index --cached --name-status -r --ignore-submodules HEAD --\n     if [ $(git config --bool --get advice.resolveConflict || echo true) = \"true\" ]; then\n-\tdie \"Pull is not possible because you have unmerged files.\n+\tdie \"$(gettext \"Pull is not possible because you have unmerged files.\n Please, fix them up in the work tree, and then use 'git add/rm <file>'\n-as appropriate to mark resolution, or use 'git commit -a'.\"\n+as appropriate to mark resolution, or use 'git commit -a'.\")\"\n     else\n-\tdie \"Pull is not possible because you have unmerged files.\"\n+\tdie \"$(gettext \"Pull is not possible because you have unmerged files.\")\"\n     fi\n }\n \n die_merge () {\n     if [ $(git config --bool --get advice.resolveConflict || echo true) = \"true\" ]; then\n-\tdie \"You have not concluded your merge (MERGE_HEAD exists).\n-Please, commit your changes before you can merge.\"\n+\tdie \"$(gettext \"You have not concluded your merge (MERGE_HEAD exists).\n+Please, commit your changes before you can merge.\")\"\n     else\n-\tdie \"You have not concluded your merge (MERGE_HEAD exists).\"\n+\tdie \"$(gettext \"You have not concluded your merge (MERGE_HEAD exists).\")\"\n     fi\n }\n \n@@ -199,13 +199,13 @@ test true = \"$rebase\" && {\n \t\t# On an unborn branch\n \t\tif test -f \"$GIT_DIR/index\"\n \t\tthen\n-\t\t\tdie \"updating an unborn branch with changes added to the index\"\n+\t\t\tdie \"$(gettext \"updating an unborn branch with changes added to the index\")\"\n \t\tfi\n \telse\n \t\tgit update-index --ignore-submodules --refresh &&\n \t\tgit diff-files --ignore-submodules --quiet &&\n \t\tgit diff-index --ignore-submodules --cached --quiet HEAD -- ||\n-\t\tdie \"refusing to pull with rebase: your working tree is not up-to-date\"\n+\t\tdie \"$(gettext \"refusing to pull with rebase: your working tree is not up-to-date\")\"\n \tfi\n \toldremoteref= &&\n \t. git-parse-remote &&\n@@ -258,11 +258,11 @@ case \"$merge_head\" in\n ?*' '?*)\n \tif test -z \"$orig_head\"\n \tthen\n-\t\tdie \"Cannot merge multiple branches into empty head\"\n+\t\tdie \"$(gettext \"Cannot merge multiple branches into empty head\")\"\n \tfi\n \tif test true = \"$rebase\"\n \tthen\n-\t\tdie \"Cannot rebase onto multiple branches\"\n+\t\tdie \"$(gettext \"Cannot rebase onto multiple branches\")\"\n \tfi\n \t;;\n esac\n-- \n1.7.3.rc1.110.g6776a.dirty\n"},{"id":"150624","messageId":"1284406558-23684-4-git-send-email-avarab@gmail.com","threadId":"25096","inReplyTo":"1284406558-23684-1-git-send-email-avarab@gmail.com","subject":"[PATCH/RFC 3/8] gettextize: git-pull eval_gettext + die message","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2010-09-13T19:35:53Z","receivedAt":"2010-09-13T19:35:53Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n git-pull.sh |    8 ++++----\n 1 files changed, 4 insertions(+), 4 deletions(-)\n\ndiff --git a/git-pull.sh b/git-pull.sh\nindex 324ac95..99837dd 100755\n--- a/git-pull.sh\n+++ b/git-pull.sh\n@@ -238,12 +238,12 @@ then\n \techo >&2 \"Warning: commit $orig_head.\"\n \tgit update-index -q --refresh\n \tgit read-tree -u -m \"$orig_head\" \"$curr_head\" ||\n-\t\tdie 'Cannot fast-forward your working tree.\n+\t\tdie \"$(eval_gettext \"Cannot fast-forward your working tree.\n After making sure that you saved anything precious from\n-$ git diff '$orig_head'\n+\\$ git diff \\$orig_head\n output, run\n-$ git reset --hard\n-to recover.'\n+\\$ git reset --hard\n+to recover.\")\"\n \n fi\n \n-- \n1.7.3.rc1.110.g6776a.dirty\n"},{"id":"150619","messageId":"1284406558-23684-5-git-send-email-avarab@gmail.com","threadId":"25096","inReplyTo":"1284406558-23684-1-git-send-email-avarab@gmail.com","subject":"[PATCH/RFC 4/8] gettextize: git-pull eval_gettext + warning message","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2010-09-13T19:35:54Z","receivedAt":"2010-09-13T19:35:54Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n git-pull.sh |    6 +++---\n 1 files changed, 3 insertions(+), 3 deletions(-)\n\ndiff --git a/git-pull.sh b/git-pull.sh\nindex 99837dd..f42d3e3 100755\n--- a/git-pull.sh\n+++ b/git-pull.sh\n@@ -233,9 +233,9 @@ then\n \t# $orig_head commit, but we are merging into $curr_head.\n \t# First update the working tree to match $curr_head.\n \n-\techo >&2 \"Warning: fetch updated the current branch head.\"\n-\techo >&2 \"Warning: fast-forwarding your working tree from\"\n-\techo >&2 \"Warning: commit $orig_head.\"\n+\techo >&2 \"$(eval_gettext \"Warning: fetch updated the current branch head.\n+Warning: fast-forwarding your working tree from\n+Warning: commit \\$orig_head.\")\"\n \tgit update-index -q --refresh\n \tgit read-tree -u -m \"$orig_head\" \"$curr_head\" ||\n \t\tdie \"$(eval_gettext \"Cannot fast-forward your working tree.\n-- \n1.7.3.rc1.110.g6776a.dirty\n"},{"id":"150620","messageId":"1284406558-23684-6-git-send-email-avarab@gmail.com","threadId":"25096","inReplyTo":"1284406558-23684-1-git-send-email-avarab@gmail.com","subject":"[PATCH/RFC 5/8] gettextize: git-pull split up \"no candidate\" message","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2010-09-13T19:35:55Z","receivedAt":"2010-09-13T19:35:55Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n git-pull.sh |   11 ++++++-----\n 1 files changed, 6 insertions(+), 5 deletions(-)\n\ndiff --git a/git-pull.sh b/git-pull.sh\nindex f42d3e3..bbb2a0a 100755\n--- a/git-pull.sh\n+++ b/git-pull.sh\n@@ -147,13 +147,14 @@ error_on_no_merge_candidates () {\n \n \tif [ $# -gt 1 ]; then\n \t\tif [ \"$rebase\" = true ]; then\n-\t\t\tprintf \"There is no candidate for rebasing against \"\n+\t\t\tgettext \"There is no candidate for rebasing against among the refs that you just fetched.\n+Generally this means that you provided a wildcard refspec which had no\n+matches on the remote end.\"; echo\n \t\telse\n-\t\t\tprintf \"There are no candidates for merging \"\n+\t\t\tgettext \"There are no candidates for merging against among the refs that you just fetched.\n+Generally this means that you provided a wildcard refspec which had no\n+matches on the remote end.\"; echo\n \t\tfi\n-\t\techo \"among the refs that you just fetched.\"\n-\t\techo \"Generally this means that you provided a wildcard refspec which had no\"\n-\t\techo \"matches on the remote end.\"\n \telif [ $# -gt 0 ] && [ \"$1\" != \"$remote\" ]; then\n \t\techo \"You asked to pull from the remote '$1', but did not specify\"\n \t\techo \"a branch. Because this is not the default configured remote\"\n-- \n1.7.3.rc1.110.g6776a.dirty\n"},{"id":"150617","messageId":"1284406558-23684-7-git-send-email-avarab@gmail.com","threadId":"25096","inReplyTo":"1284406558-23684-1-git-send-email-avarab@gmail.com","subject":"[PATCH/RFC 6/8] gettextize: git-pull \"You asked to pull\" message","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2010-09-13T19:35:56Z","receivedAt":"2010-09-13T19:35:56Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"Gettextize the \"You asked to pull\" error message. This message\ninterpolated $1 which won't work with eval_gettext for obvious\nreasons, so I needed to provide an alias for it.\n\nThis also made the message easier to translate, and I added a\nTRANSLATORS comment to make it even easier.\n\nSigned-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n git-pull.sh |    9 ++++++---\n 1 files changed, 6 insertions(+), 3 deletions(-)\n\ndiff --git a/git-pull.sh b/git-pull.sh\nindex bbb2a0a..6ab09b6 100755\n--- a/git-pull.sh\n+++ b/git-pull.sh\n@@ -156,9 +156,12 @@ Generally this means that you provided a wildcard refspec which had no\n matches on the remote end.\"; echo\n \t\tfi\n \telif [ $# -gt 0 ] && [ \"$1\" != \"$remote\" ]; then\n-\t\techo \"You asked to pull from the remote '$1', but did not specify\"\n-\t\techo \"a branch. Because this is not the default configured remote\"\n-\t\techo \"for your current branch, you must specify a branch on the command line.\"\n+\t\trequested_remote=$1\n+\t\t# TRANSLATORS: $requested_remote will be a remote name, like\n+\t\t# \"origin\" or \"avar\"\n+\t\teval_gettext \"You asked to pull from the remote '\\$requested_remote', but did not specify\n+a branch. Because this is not the default configured remote\n+for your current branch, you must specify a branch on the command line.\"; echo\n \telif [ -z \"$curr_branch\" ]; then\n \t\techo \"You are not currently on a branch, so I cannot use any\"\n \t\techo \"'branch.<branchname>.merge' in your configuration file.\"\n-- \n1.7.3.rc1.110.g6776a.dirty\n"},{"id":"150618","messageId":"1284406558-23684-8-git-send-email-avarab@gmail.com","threadId":"25096","inReplyTo":"1284406558-23684-1-git-send-email-avarab@gmail.com","subject":"[PATCH/RFC 7/8] gettextize: git-pull \"[...] not currently on a branch\" message","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2010-09-13T19:35:57Z","receivedAt":"2010-09-13T19:35:57Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n git-pull.sh |   10 +++++-----\n 1 files changed, 5 insertions(+), 5 deletions(-)\n\ndiff --git a/git-pull.sh b/git-pull.sh\nindex 6ab09b6..ec37d1c 100755\n--- a/git-pull.sh\n+++ b/git-pull.sh\n@@ -163,11 +163,11 @@ matches on the remote end.\"; echo\n a branch. Because this is not the default configured remote\n for your current branch, you must specify a branch on the command line.\"; echo\n \telif [ -z \"$curr_branch\" ]; then\n-\t\techo \"You are not currently on a branch, so I cannot use any\"\n-\t\techo \"'branch.<branchname>.merge' in your configuration file.\"\n-\t\techo \"Please specify which remote branch you want to use on the command\"\n-\t\techo \"line and try again (e.g. 'git pull <repository> <refspec>').\"\n-\t\techo \"See git-pull(1) for details.\"\n+\t\tgettext \"You are not currently on a branch, so I cannot use any\n+'branch.<branchname>.merge' in your configuration file.\n+Please specify which remote branch you want to use on the command\n+line and try again (e.g. 'git pull <repository> <refspec>').\n+See git-pull(1) for details.\"; echo\n \telif [ -z \"$upstream\" ]; then\n \t\techo \"You asked me to pull without telling me which branch you\"\n \t\techo \"want to $op_type $op_prep, and 'branch.${curr_branch}.merge' in\"\n-- \n1.7.3.rc1.110.g6776a.dirty\n"},{"id":"150622","messageId":"1284406558-23684-9-git-send-email-avarab@gmail.com","threadId":"25096","inReplyTo":"1284406558-23684-1-git-send-email-avarab@gmail.com","subject":"[PATCH/RFC 8/8] gettextize: git-pull \"rebase against\" / \"merge with\" messages","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2010-09-13T19:35:58Z","receivedAt":"2010-09-13T19:35:58Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"Gettextize the two messages that used \"rebase against\" and \"merge\nwith\". Split them into two depending on whether we are rebasing or not.\n\nThis results in some duplication, but makes it much easier for\ntranslators to translate these messages.\n\nSigned-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n git-pull.sh |   84 ++++++++++++++++++++++++++++++++++++----------------------\n 1 files changed, 52 insertions(+), 32 deletions(-)\n\ndiff --git a/git-pull.sh b/git-pull.sh\nindex ec37d1c..2576e06 100755\n--- a/git-pull.sh\n+++ b/git-pull.sh\n@@ -132,15 +132,6 @@ error_on_no_merge_candidates () {\n \t\tesac\n \tdone\n \n-\tif test true = \"$rebase\"\n-\tthen\n-\t\top_type=rebase\n-\t\top_prep=against\n-\telse\n-\t\top_type=merge\n-\t\top_prep=with\n-\tfi\n-\n \tcurr_branch=${curr_branch#refs/heads/}\n \tupstream=$(git config \"branch.$curr_branch.merge\")\n \tremote=$(git config \"branch.$curr_branch.remote\")\n@@ -169,30 +160,59 @@ Please specify which remote branch you want to use on the command\n line and try again (e.g. 'git pull <repository> <refspec>').\n See git-pull(1) for details.\"; echo\n \telif [ -z \"$upstream\" ]; then\n-\t\techo \"You asked me to pull without telling me which branch you\"\n-\t\techo \"want to $op_type $op_prep, and 'branch.${curr_branch}.merge' in\"\n-\t\techo \"your configuration file does not tell me, either. Please\"\n-\t\techo \"specify which branch you want to use on the command line and\"\n-\t\techo \"try again (e.g. 'git pull <repository> <refspec>').\"\n-\t\techo \"See git-pull(1) for details.\"\n-\t\techo\n-\t\techo \"If you often $op_type $op_prep the same branch, you may want to\"\n-\t\techo \"use something like the following in your configuration file:\"\n-\t\techo\n-\t\techo \"    [branch \\\"${curr_branch}\\\"]\"\n-\t\techo \"    remote = <nickname>\"\n-\t\techo \"    merge = <remote-ref>\"\n-\t\ttest rebase = \"$op_type\" &&\n-\t\t\techo \"    rebase = true\"\n-\t\techo\n-\t\techo \"    [remote \\\"<nickname>\\\"]\"\n-\t\techo \"    url = <url>\"\n-\t\techo \"    fetch = <refspec>\"\n-\t\techo\n-\t\techo \"See git-config(1) for details.\"\n+\t\tif test true = \"$rebase\"\n+\t\tthen\n+\t\t\teval_gettext \"You asked me to pull without telling me which branch you\n+want to rebase against, and 'branch.\\${curr_branch}.merge' in\n+your configuration file does not tell me, either. Please\n+specify which branch you want to use on the command line and\n+try again (e.g. 'git pull <repository> <refspec>').\n+See git-pull(1) for details.\n+\n+If you often rebase against the same branch, you may want to\n+use something like the following in your configuration file:\n+\n+    [branch \\\"\\${curr_branch}\\\"]\n+    remote = <nickname>\n+    merge = <remote-ref>\n+    rebase = true\n+\n+    [remote \\\"<nickname>\\\"]\n+    url = <url>\n+    fetch = <refspec>\n+\n+See git-config(1) for details.\"; echo\n+\t\telse\n+\t\t\teval_gettext \"You asked me to pull without telling me which branch you\n+want to merge with, and 'branch.\\${curr_branch}.merge' in\n+your configuration file does not tell me, either. Please\n+specify which branch you want to use on the command line and\n+try again (e.g. 'git pull <repository> <refspec>').\n+See git-pull(1) for details.\n+\n+If you often merge with the same branch, you may want to\n+use something like the following in your configuration file:\n+\n+    [branch \\\"\\${curr_branch}\\\"]\n+    remote = <nickname>\n+    merge = <remote-ref>\n+\n+    [remote \\\"<nickname>\\\"]\n+    url = <url>\n+    fetch = <refspec>\n+\n+See git-config(1) for details.\"; echo\n+\t\tfi\n \telse\n-\t\techo \"Your configuration specifies to $op_type $op_prep the ref '${upstream#refs/heads/}'\"\n-\t\techo \"from the remote, but no such ref was fetched.\"\n+\t\tupstream_branch=\"${upstream#refs/heads/}\"\n+\t\tif test true = \"$rebase\"\n+\t\tthen\n+\t\t\teval_gettext \"Your configuration specifies to rebase against the ref '\\$upstream_branch'\n+from the remote, but no such ref was fetched.\"; echo\n+\t\telse\n+\t\t\teval_gettext \"Your configuration specifies to merge with the ref '\\$upstream_branch'\n+from the remote, but no such ref was fetched.\"; echo\n+\t\tfi\n \tfi\n \texit 1\n }\n-- \n1.7.3.rc1.110.g6776a.dirty\n"},{"id":"150632","messageId":"AANLkTikn8wB+DhoDJfKOiiNOVSAh0wd49ogpP_WDQ_DA@mail.gmail.com","threadId":"25096","inReplyTo":"1284406558-23684-4-git-send-email-avarab@gmail.com","subject":"Re: [PATCH/RFC 3/8] gettextize: git-pull eval_gettext + die message","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2010-09-13T21:57:45Z","receivedAt":"2010-09-13T21:57:45Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"On Mon, Sep 13, 2010 at 19:35, Ævar Arnfjörð Bjarmason <avarab@gmail.com> wrote:\n\n> -$ git diff '$orig_head'\n> +\\$ git diff \\$orig_head\n>  output, run\n> -$ git reset --hard\n> -to recover.'\n> +\\$ git reset --hard\n> +to recover.\")\"\n\n\"make pot\" rightly whines about this:\n\n    git-pull.sh:265: warning: Although being used in a format string\n    position, the msgid is not a valid Shell format string. Reason:\n    The string refers to a shell variable whose value may be different\n    inside shell functions.\n\nJust using \"$\" instead of \"\\$\" for \"$ git ....\" works,\ni.e. eval_gettext \"foo $ bar\" instead of eval_gettext \"foo \\$ bar\".\n\nIs that portable? Is \" $ \" always the same as ' $ ' in POSIX shells?\n"}]}