{"thread":{"id":"31095","subject":"[PATCH v5 0/7] i18n for git-am, git-rebase and git-merge","startedAt":"2012-07-25T08:34:05Z","lastAt":"2012-07-26T12:21:01Z","messageCount":11,"participants":["Jiang Xin","Jonathan Nieder","Nguyen Thai Ngoc Duy"],"isPatch":true,"patchVersion":5,"patchTotal":7},"messages":[{"id":"195725","messageId":"cover.1343205009.git.worldhello.net@gmail.com","threadId":"31095","inReplyTo":null,"subject":"[PATCH v5 0/7] i18n for git-am, git-rebase and git-merge","fromName":"Jiang Xin","fromEmail":"worldhello.net@gmail.com","sentAt":"2012-07-25T08:34:05Z","receivedAt":"2012-07-25T08:34:05Z","isPatch":true,"sender":{"key":"worldhello.net@gmail.com","avatar":"https://avatars.githubusercontent.com/u/183860?v=4"},"body":"Marked messages for translation in git-am, git-rebase, and git-merge.\nAlso fixed suffered tests when turning GETTEXT_POISON switch on.\n\nJiang Xin (7):\n  i18n: New keywords for xgettext extraction from sh\n  i18n: rebase: mark messages for translation\n  i18n: Rewrite gettext messages start with dash\n  Remove obsolete LONG_USAGE which breaks xgettext\n  i18n: am: mark more strings for translation\n  Remove dead code which contains bad gettext block\n  i18n: merge-recursive: mark strings for translation\n\n Makefile                             |   3 +-\n git-am.sh                            |  20 ++---\n git-rebase.sh                        |  89 ++++++++-------------\n git-submodule.sh                     |   2 +-\n merge-recursive.c                    | 148 +++++++++++++++++++----------------\n t/t0201-gettext-fallbacks.sh         |   8 +-\n t/t3400-rebase.sh                    |   8 +-\n t/t3404-rebase-interactive.sh        |   2 +-\n t/t3406-rebase-message.sh            |   9 ++-\n t/t6022-merge-rename.sh              |  16 ++--\n t/t6042-merge-rename-corner-cases.sh |   2 +-\n 11 files changed, 150 insertions(+), 157 deletions(-)\n\n-- \n1.7.12.rc0.16.gf4916ac\n"},{"id":"195726","messageId":"b4afad7f9c0b8ae32c04f8aa55a21c72b4ae5013.1343205009.git.worldhello.net@gmail.com","threadId":"31095","inReplyTo":"cover.1343205009.git.worldhello.net@gmail.com","subject":"[PATCH v5 1/7] i18n: New keywords for xgettext extraction from sh","fromName":"Jiang Xin","fromEmail":"worldhello.net@gmail.com","sentAt":"2012-07-25T08:34:06Z","receivedAt":"2012-07-25T08:34:06Z","isPatch":true,"sender":{"key":"worldhello.net@gmail.com","avatar":"https://avatars.githubusercontent.com/u/183860?v=4"},"body":"Since we have additional shell wrappers (gettextln and eval_gettextln)\nfor gettext, we need to take into account these wrappers when running\n'make pot' to extract messages from shell scripts.\n\nSigned-off-by: Jiang Xin <worldhello.net@gmail.com>\nReviewed-by: Stefano Lattarini <stefano.lattarini@gmail.com>\nReviewed-by: Jonathan Nieder <jrnieder@gmail.com>\n---\n Makefile | 3 ++-\n 1 file changed, 2 insertions(+), 1 deletion(-)\n\ndiff --git a/Makefile b/Makefile\nindex b0b34..d3cd9 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -2387,7 +2387,8 @@ XGETTEXT_FLAGS = \\\n \t--from-code=UTF-8\n XGETTEXT_FLAGS_C = $(XGETTEXT_FLAGS) --language=C \\\n \t--keyword=_ --keyword=N_ --keyword=\"Q_:1,2\"\n-XGETTEXT_FLAGS_SH = $(XGETTEXT_FLAGS) --language=Shell\n+XGETTEXT_FLAGS_SH = $(XGETTEXT_FLAGS) --language=Shell \\\n+\t--keyword=gettextln --keyword=eval_gettextln\n XGETTEXT_FLAGS_PERL = $(XGETTEXT_FLAGS) --keyword=__ --language=Perl\n LOCALIZED_C := $(C_OBJ:o=c) $(LIB_H) $(GENERATED_H)\n LOCALIZED_SH := $(SCRIPT_SH)\n-- \n1.7.12.rc0.16.gf4916ac\n"},{"id":"195728","messageId":"a8429a6fed3eb0d83d92f798ebf8241a0eeb49c1.1343205009.git.worldhello.net@gmail.com","threadId":"31095","inReplyTo":"b4afad7f9c0b8ae32c04f8aa55a21c72b4ae5013.1343205009.git.worldhello.net@gmail.com","subject":"[PATCH v5 2/7] i18n: rebase: mark messages for translation","fromName":"Jiang Xin","fromEmail":"worldhello.net@gmail.com","sentAt":"2012-07-25T08:34:07Z","receivedAt":"2012-07-25T08:34:07Z","isPatch":true,"sender":{"key":"worldhello.net@gmail.com","avatar":"https://avatars.githubusercontent.com/u/183860?v=4"},"body":"Mark messages in git-rebase.sh for translation.  While doing this\nJonathan noticed that the comma usage and sentence structure of the\nresolvemsg was not quite right, so correct that and its cousins in\ngit-am.sh and t/t0201-gettext-fallbacks.sh at the same time.\n\nSome tests would start to fail with GETTEXT_POISON turned on after\nthis update.  Use test_i18ncmp and test_i18ngrep where appropriate\nto mark strings that should only be checked in the C locale output\nto avoid such issues.\n\nSigned-off-by: Jiang Xin <worldhello.net@gmail.com>\nReviewed-by: Stefano Lattarini <stefano.lattarini@gmail.com>\nAcked-by: Jonathan Nieder <jrnieder@gmail.com>\n---\n git-am.sh                    |  6 ++---\n git-rebase.sh                | 64 +++++++++++++++++++++++---------------------\n t/t0201-gettext-fallbacks.sh |  8 +++---\n t/t3400-rebase.sh            |  8 +++---\n t/t3406-rebase-message.sh    |  9 ++++++-\n 5 files changed, 53 insertions(+), 42 deletions(-)\n\ndiff --git a/git-am.sh b/git-am.sh\nindex c02e6..8961a 100755\n--- a/git-am.sh\n+++ b/git-am.sh\n@@ -102,9 +102,9 @@ stop_here_user_resolve () {\n \t    printf '%s\\n' \"$resolvemsg\"\n \t    stop_here $1\n     fi\n-    eval_gettextln \"When you have resolved this problem run \\\"\\$cmdline --resolved\\\".\n-If you would prefer to skip this patch, instead run \\\"\\$cmdline --skip\\\".\n-To restore the original branch and stop patching run \\\"\\$cmdline --abort\\\".\"\n+    eval_gettextln \"When you have resolved this problem, run \\\"\\$cmdline --resolved\\\".\n+If you prefer to skip this patch, run \\\"\\$cmdline --skip\\\" instead.\n+To restore the original branch and stop patching, run \\\"\\$cmdline --abort\\\".\"\n \n     stop_here $1\n }\ndiff --git a/git-rebase.sh b/git-rebase.sh\nindex 1cd06..8710d 100755\n--- a/git-rebase.sh\n+++ b/git-rebase.sh\n@@ -65,6 +65,7 @@ abort!             abort and check out the original branch\n skip!              skip current patch and continue\n \"\n . git-sh-setup\n+. git-sh-i18n\n set_reflog_action rebase\n require_work_tree_exists\n cd_to_toplevel\n@@ -73,9 +74,9 @@ LF='\n '\n ok_to_skip_pre_rebase=\n resolvemsg=\"\n-When you have resolved this problem run \\\"git rebase --continue\\\".\n-If you would prefer to skip this patch, instead run \\\"git rebase --skip\\\".\n-To check out the original branch and stop rebasing run \\\"git rebase --abort\\\".\n+$(gettext 'When you have resolved this problem, run \"git rebase --continue\".\n+If you prefer to skip this patch, run \"git rebase --skip\" instead.\n+To check out the original branch and stop rebasing, run \"git rebase --abort\".')\n \"\n unset onto\n cmd=\n@@ -161,7 +162,7 @@ move_to_original_branch () {\n \t\tgit symbolic-ref \\\n \t\t\t-m \"rebase finished: returning to $head_name\" \\\n \t\t\tHEAD $head_name ||\n-\t\tdie \"Could not move back to $head_name\"\n+\t\tdie \"$(gettext \"Could not move back to $head_name\")\"\n \t\t;;\n \tesac\n }\n@@ -180,12 +181,12 @@ run_pre_rebase_hook () {\n \t   test -x \"$GIT_DIR/hooks/pre-rebase\"\n \tthen\n \t\t\"$GIT_DIR/hooks/pre-rebase\" ${1+\"$@\"} ||\n-\t\tdie \"The pre-rebase hook refused to rebase.\"\n+\t\tdie \"$(gettext \"The pre-rebase hook refused to rebase.\")\"\n \tfi\n }\n \n test -f \"$apply_dir\"/applying &&\n-\tdie 'It looks like git-am is in progress. Cannot rebase.'\n+\tdie \"$(gettext \"It looks like git-am is in progress. Cannot rebase.\")\"\n \n if test -d \"$apply_dir\"\n then\n@@ -316,12 +317,12 @@ test $# -gt 2 && usage\n if test -n \"$cmd\" &&\n    test \"$interactive_rebase\" != explicit\n then\n-\tdie \"--exec option must be used with --interactive option\"\n+\tdie \"$(gettext -- \"--exec option must be used with --interactive option\")\"\n fi\n \n if test -n \"$action\"\n then\n-\ttest -z \"$in_progress\" && die \"No rebase in progress?\"\n+\ttest -z \"$in_progress\" && die \"$(gettext \"No rebase in progress?\")\"\n \t# Only interactive rebase uses detailed reflog messages\n \tif test \"$type\" = interactive && test \"$GIT_REFLOG_ACTION\" = rebase\n \tthen\n@@ -334,11 +335,11 @@ case \"$action\" in\n continue)\n \t# Sanity check\n \tgit rev-parse --verify HEAD >/dev/null ||\n-\t\tdie \"Cannot read HEAD\"\n+\t\tdie \"$(gettext \"Cannot read HEAD\")\"\n \tgit update-index --ignore-submodules --refresh &&\n \tgit diff-files --quiet --ignore-submodules || {\n-\t\techo \"You must edit all merge conflicts and then\"\n-\t\techo \"mark them as resolved using git add\"\n+\t\techo \"$(gettext \"You must edit all merge conflicts and then\n+mark them as resolved using git add\")\"\n \t\texit 1\n \t}\n \tread_basic_state\n@@ -355,7 +356,7 @@ abort)\n \tcase \"$head_name\" in\n \trefs/*)\n \t\tgit symbolic-ref -m \"rebase: aborting\" HEAD $head_name ||\n-\t\tdie \"Could not move back to $head_name\"\n+\t\tdie \"$(eval_gettext \"Could not move back to \\$head_name\")\"\n \t\t;;\n \tesac\n \toutput git reset --hard $orig_head\n@@ -367,15 +368,18 @@ esac\n # Make sure no rebase is in progress\n if test -n \"$in_progress\"\n then\n-\tdie '\n-It seems that there is already a '\"${state_dir##*/}\"' directory, and\n-I wonder if you are in the middle of another rebase.  If that is the\n+\tstate_dir_base=${state_dir##*/}\n+\tcmd_live_rebase=\"git rebase (--continue | --abort | --skip)\"\n+\tcmd_clear_stale_rebase=\"rm -fr \\\"$state_dir\\\"\"\n+\tdie \"\n+$(eval_gettext 'It seems that there is already a $state_dir_base directory, and\n+I wonder if you ware in the middle of another rebase.  If that is the\n case, please try\n-\tgit rebase (--continue | --abort | --skip)\n+\t$cmd_live_rebase\n If that is not the case, please\n-\trm -fr '\"$state_dir\"'\n+\t$cmd_clear_stale_rebase\n and run me again.  I am stopping in case you still have something\n-valuable there.'\n+valuable there.')\"\n fi\n \n if test -n \"$rebase_root\" && test -z \"$onto\"\n@@ -413,7 +417,7 @@ then\n \t\t;;\n \tesac\n \tupstream=`git rev-parse --verify \"${upstream_name}^0\"` ||\n-\tdie \"invalid upstream $upstream_name\"\n+\tdie \"$(eval_gettext \"invalid upstream \\$upstream_name\")\"\n \tupstream_arg=\"$upstream_name\"\n else\n \tif test -z \"$onto\"\n@@ -437,19 +441,19 @@ case \"$onto_name\" in\n \tthen\n \t\tcase \"$onto\" in\n \t\t?*\"$LF\"?*)\n-\t\t\tdie \"$onto_name: there are more than one merge bases\"\n+\t\t\tdie \"$(eval_gettext \"\\$onto_name: there are more than one merge bases\")\"\n \t\t\t;;\n \t\t'')\n-\t\t\tdie \"$onto_name: there is no merge base\"\n+\t\t\tdie \"$(eval_gettext \"\\$onto_name: there is no merge base\")\"\n \t\t\t;;\n \t\tesac\n \telse\n-\t\tdie \"$onto_name: there is no merge base\"\n+\t\tdie \"$(eval_gettext \"\\$onto_name: there is no merge base\")\"\n \tfi\n \t;;\n *)\n \tonto=$(git rev-parse --verify \"${onto_name}^0\") ||\n-\tdie \"Does not point to a valid commit: $onto_name\"\n+\tdie \"$(eval_gettext \"Does not point to a valid commit: \\$onto_name\")\"\n \t;;\n esac\n \n@@ -472,7 +476,7 @@ case \"$#\" in\n \tthen\n \t\thead_name=\"detached HEAD\"\n \telse\n-\t\tdie \"fatal: no such branch: $1\"\n+\t\tdie \"$(eval_gettext \"fatal: no such branch: \\$branch_name\")\"\n \tfi\n \t;;\n 0)\n@@ -492,7 +496,7 @@ case \"$#\" in\n \t;;\n esac\n \n-require_clean_work_tree \"rebase\" \"Please commit or stash them.\"\n+require_clean_work_tree \"rebase\" \"$(gettext \"Please commit or stash them.\")\"\n \n # Now we are rebasing commits $upstream..$orig_head (or with --root,\n # everything leading up to $orig_head) on top of $onto\n@@ -510,10 +514,10 @@ then\n \tthen\n \t\t# Lazily switch to the target branch if needed...\n \t\ttest -z \"$switch_to\" || git checkout \"$switch_to\" --\n-\t\tsay \"Current branch $branch_name is up to date.\"\n+\t\tsay \"$(eval_gettext \"Current branch \\$branch_name is up to date.\")\"\n \t\texit 0\n \telse\n-\t\tsay \"Current branch $branch_name is up to date, rebase forced.\"\n+\t\tsay \"$(eval_gettext \"Current branch \\$branch_name is up to date, rebase forced.\")\"\n \tfi\n fi\n \n@@ -524,7 +528,7 @@ if test -n \"$diffstat\"\n then\n \tif test -n \"$verbose\"\n \tthen\n-\t\techo \"Changes from $mb to $onto:\"\n+\t\techo \"$(eval_gettext \"Changes from \\$mb to \\$onto:\")\"\n \tfi\n \t# We want color (if set), but no pager\n \tGIT_PAGER='' git diff --stat --summary \"$mb\" \"$onto\"\n@@ -533,7 +537,7 @@ fi\n test \"$type\" = interactive && run_specific_rebase\n \n # Detach HEAD and reset the tree\n-say \"First, rewinding head to replay your work on top of it...\"\n+say \"$(gettext \"First, rewinding head to replay your work on top of it...\")\"\n git checkout -q \"$onto^0\" || die \"could not detach HEAD\"\n git update-ref ORIG_HEAD $orig_head\n \n@@ -541,7 +545,7 @@ git update-ref ORIG_HEAD $orig_head\n # we just fast-forwarded.\n if test \"$mb\" = \"$orig_head\"\n then\n-\tsay \"Fast-forwarded $branch_name to $onto_name.\"\n+\tsay \"$(eval_gettext \"Fast-forwarded \\$branch_name to \\$onto_name.\")\"\n \tmove_to_original_branch\n \texit 0\n fi\ndiff --git a/t/t0201-gettext-fallbacks.sh b/t/t0201-gettext-fallbacks.sh\nindex 52b1c..5d80a 100755\n--- a/t/t0201-gettext-fallbacks.sh\n+++ b/t/t0201-gettext-fallbacks.sh\n@@ -51,16 +51,16 @@ test_expect_success 'eval_gettext: our eval_gettext() fallback can interpolate v\n test_expect_success 'eval_gettext: our eval_gettext() fallback can interpolate variables with spaces' '\n     cmdline=\"git am\" &&\n     export cmdline;\n-    printf \"When you have resolved this problem run git am --resolved.\" >expect &&\n-    eval_gettext \"When you have resolved this problem run \\$cmdline --resolved.\" >actual\n+    printf \"When you have resolved this problem, run git am --resolved.\" >expect &&\n+    eval_gettext \"When you have resolved this problem, run \\$cmdline --resolved.\" >actual\n     test_i18ncmp expect actual\n '\n \n test_expect_success 'eval_gettext: our eval_gettext() fallback can interpolate variables with spaces and quotes' '\n     cmdline=\"git am\" &&\n     export cmdline;\n-    printf \"When you have resolved this problem run \\\"git am --resolved\\\".\" >expect &&\n-    eval_gettext \"When you have resolved this problem run \\\"\\$cmdline --resolved\\\".\" >actual\n+    printf \"When you have resolved this problem, run \\\"git am --resolved\\\".\" >expect &&\n+    eval_gettext \"When you have resolved this problem, run \\\"\\$cmdline --resolved\\\".\" >actual\n     test_i18ncmp expect actual\n '\n \ndiff --git a/t/t3400-rebase.sh b/t/t3400-rebase.sh\nindex 7788a..1de0e 100755\n--- a/t/t3400-rebase.sh\n+++ b/t/t3400-rebase.sh\n@@ -68,24 +68,24 @@ test_expect_success 'rebase against master' '\n \n test_expect_success 'rebase against master twice' '\n \tgit rebase master >out &&\n-\tgrep \"Current branch my-topic-branch is up to date\" out\n+\ttest_i18ngrep \"Current branch my-topic-branch is up to date\" out\n '\n \n test_expect_success 'rebase against master twice with --force' '\n \tgit rebase --force-rebase master >out &&\n-\tgrep \"Current branch my-topic-branch is up to date, rebase forced\" out\n+\ttest_i18ngrep \"Current branch my-topic-branch is up to date, rebase forced\" out\n '\n \n test_expect_success 'rebase against master twice from another branch' '\n \tgit checkout my-topic-branch^ &&\n \tgit rebase master my-topic-branch >out &&\n-\tgrep \"Current branch my-topic-branch is up to date\" out\n+\ttest_i18ngrep \"Current branch my-topic-branch is up to date\" out\n '\n \n test_expect_success 'rebase fast-forward to master' '\n \tgit checkout my-topic-branch^ &&\n \tgit rebase my-topic-branch >out &&\n-\tgrep \"Fast-forwarded HEAD to my-topic-branch\" out\n+\ttest_i18ngrep \"Fast-forwarded HEAD to my-topic-branch\" out\n '\n \n test_expect_success 'the rebase operation should not have destroyed author information' '\ndiff --git a/t/t3406-rebase-message.sh b/t/t3406-rebase-message.sh\nindex 68983..e6a9a 100755\n--- a/t/t3406-rebase-message.sh\n+++ b/t/t3406-rebase-message.sh\n@@ -62,9 +62,16 @@ test_expect_success 'rebase -n overrides config rebase.stat config' '\n         ! grep \"^ fileX |  *1 +$\" diffstat.txt\n '\n \n+# Output to stderr:\n+#\n+#     \"Does not point to a valid commit: invalid-ref\"\n+#\n+# NEEDSWORK: This \"grep\" is fine in real non-C locales, but\n+# GETTEXT_POISON poisons the refname along with the enclosing\n+# error message.\n test_expect_success 'rebase --onto outputs the invalid ref' '\n \ttest_must_fail git rebase --onto invalid-ref HEAD HEAD 2>err &&\n-\tgrep \"invalid-ref\" err\n+\ttest_i18ngrep \"invalid-ref\" err\n '\n \n test_done\n-- \n1.7.12.rc0.16.gf4916ac\n"},{"id":"195729","messageId":"1ddee15de2edd59f870023ea25cefb5846daeba4.1343205009.git.worldhello.net@gmail.com","threadId":"31095","inReplyTo":"a8429a6fed3eb0d83d92f798ebf8241a0eeb49c1.1343205009.git.worldhello.net@gmail.com","subject":"[PATCH v5 3/7] i18n: Rewrite gettext messages start with dash","fromName":"Jiang Xin","fromEmail":"worldhello.net@gmail.com","sentAt":"2012-07-25T08:34:08Z","receivedAt":"2012-07-25T08:34:08Z","isPatch":true,"sender":{"key":"worldhello.net@gmail.com","avatar":"https://avatars.githubusercontent.com/u/183860?v=4"},"body":"Gettext message in a shell script should not start with '-', one\nworkaround is adding '--' between gettext and the message, like:\n\n    gettext -- \"--exec option ...\"\n\nBut due to a bug in the xgettext extraction, xgettext can not\nextract the actual message for this case. Rewriting the message\nis a simpler and better solution.\n\nSigned-off-by: Jiang Xin <worldhello.net@gmail.com>\nSigned-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\nReported-by: Vincent van Ravesteijn <vfr@lyx.org>\nReviewed-by: Stefano Lattarini <stefano.lattarini@gmail.com>\n---\n git-rebase.sh                 | 2 +-\n git-submodule.sh              | 2 +-\n t/t3404-rebase-interactive.sh | 2 +-\n 3 files changed, 3 insertions(+), 3 deletions(-)\n\ndiff --git a/git-rebase.sh b/git-rebase.sh\nindex 8710d..705bd 100755\n--- a/git-rebase.sh\n+++ b/git-rebase.sh\n@@ -317,7 +317,7 @@ test $# -gt 2 && usage\n if test -n \"$cmd\" &&\n    test \"$interactive_rebase\" != explicit\n then\n-\tdie \"$(gettext -- \"--exec option must be used with --interactive option\")\"\n+\tdie \"$(gettext \"The --exec option must be used with the --interactive option\")\"\n fi\n \n if test -n \"$action\"\ndiff --git a/git-submodule.sh b/git-submodule.sh\nindex dba4d..5b019 100755\n--- a/git-submodule.sh\n+++ b/git-submodule.sh\n@@ -748,7 +748,7 @@ cmd_summary() {\n \tif [ -n \"$files\" ]\n \tthen\n \t\ttest -n \"$cached\" &&\n-\t\tdie \"$(gettext -- \"--cached cannot be used with --files\")\"\n+\t\tdie \"$(gettext \"The --cached option cannot be used with the --files option\")\"\n \t\tdiff_cmd=diff-files\n \t\thead=\n \tfi\ndiff --git a/t/t3404-rebase-interactive.sh b/t/t3404-rebase-interactive.sh\nindex 8078..f206a 100755\n--- a/t/t3404-rebase-interactive.sh\n+++ b/t/t3404-rebase-interactive.sh\n@@ -858,7 +858,7 @@ test_expect_success 'rebase -ix with --autosquash' '\n test_expect_success 'rebase --exec without -i shows error message' '\n \tgit reset --hard execute &&\n \ttest_must_fail git rebase --exec \"git show HEAD\" HEAD~2 2>actual &&\n-\techo \"--exec option must be used with --interactive option\" >expected &&\n+\techo \"The --exec option must be used with the --interactive option\" >expected &&\n \ttest_i18ncmp expected actual\n '\n \n-- \n1.7.12.rc0.16.gf4916ac\n"},{"id":"195727","messageId":"100127d788275535c8079288ef9720f462a176b4.1343205009.git.worldhello.net@gmail.com","threadId":"31095","inReplyTo":"1ddee15de2edd59f870023ea25cefb5846daeba4.1343205009.git.worldhello.net@gmail.com","subject":"[PATCH v5 4/7] Remove obsolete LONG_USAGE which breaks xgettext","fromName":"Jiang Xin","fromEmail":"worldhello.net@gmail.com","sentAt":"2012-07-25T08:34:09Z","receivedAt":"2012-07-25T08:34:09Z","isPatch":true,"sender":{"key":"worldhello.net@gmail.com","avatar":"https://avatars.githubusercontent.com/u/183860?v=4"},"body":"The obsolete LONG_USAGE variable has the following message in it:\n\n    A'\\''--B'\\''--C'\\''\n\nAnd such complex LONG_USAGE message will breaks xgettext when extracting\nl10n messages. But if single quotes are removed from the message, xgettext\nworks fine on 'git-rebase.sh'.\n\nSince there is a modern OPTIONS_SPEC variable in use in this script,\nit's safe to remove the obsolete USAGE and LONG_USAGE variables.\n\nSigned-off-by: Jiang Xin <worldhello.net@gmail.com>\nReviewed-by: Stefano Lattarini <stefano.lattarini@gmail.com>\n---\n git-rebase.sh | 25 -------------------------\n 1 file changed, 25 deletions(-)\n\ndiff --git a/git-rebase.sh b/git-rebase.sh\nindex 705bd..0e6fd 100755\n--- a/git-rebase.sh\n+++ b/git-rebase.sh\n@@ -3,31 +3,6 @@\n # Copyright (c) 2005 Junio C Hamano.\n #\n \n-USAGE='[--interactive | -i] [--exec | -x <cmd>] [-v] [--force-rebase | -f]\n-       [--no-ff] [--onto <newbase>] [<upstream>|--root] [<branch>] [--quiet | -q]'\n-LONG_USAGE='git-rebase replaces <branch> with a new branch of the\n-same name.  When the --onto option is provided the new branch starts\n-out with a HEAD equal to <newbase>, otherwise it is equal to <upstream>\n-It then attempts to create a new commit for each commit from the original\n-<branch> that does not exist in the <upstream> branch.\n-\n-It is possible that a merge failure will prevent this process from being\n-completely automatic.  You will have to resolve any such merge failure\n-and run git rebase --continue.  Another option is to bypass the commit\n-that caused the merge failure with git rebase --skip.  To check out the\n-original <branch> and remove the .git/rebase-apply working files, use the\n-command git rebase --abort instead.\n-\n-Note that if <branch> is not specified on the command line, the\n-currently checked out branch is used.\n-\n-Example:       git-rebase master~1 topic\n-\n-\tA---B---C topic                   A'\\''--B'\\''--C'\\'' topic\n-       /                   -->           /\n-  D---E---F---G master          D---E---F---G master\n-'\n-\n SUBDIRECTORY_OK=Yes\n OPTIONS_KEEPDASHDASH=\n OPTIONS_SPEC=\"\\\n-- \n1.7.12.rc0.16.gf4916ac\n"},{"id":"195732","messageId":"6d764280b65f1eeb96bed77cdbfead465f8b99e4.1343205009.git.worldhello.net@gmail.com","threadId":"31095","inReplyTo":"100127d788275535c8079288ef9720f462a176b4.1343205009.git.worldhello.net@gmail.com","subject":"[PATCH v5 5/7] i18n: am: mark more strings for translation","fromName":"Jiang Xin","fromEmail":"worldhello.net@gmail.com","sentAt":"2012-07-25T08:34:10Z","receivedAt":"2012-07-25T08:34:10Z","isPatch":true,"sender":{"key":"worldhello.net@gmail.com","avatar":"https://avatars.githubusercontent.com/u/183860?v=4"},"body":"Mark strings in 'git-am.sh' for translation. In the last chunk, I\nchanged '$1' to '-b/--binary' for this reason:\n\n * First, if there is a variable in the l10n message, we could not use\n   gettext. Because the variable will be expanded (evaluated) and will\n   never match the entry in the po file.\n\n * Second, if there is a positional parameter ($1, $2,...) in the\n   message, we could not use eval_gettext either. Because\n   eval_gettext may be a wapper for gettext, and the positional\n   parameter would loose it's original context.\n\nAlso reduce one indentation level for one gettextln clause introduced\nin commit de88c1c.\n\nSigned-off-by: Jiang Xin <worldhello.net@gmail.com>\nReviewed-by: Stefano Lattarini <stefano.lattarini@gmail.com>\nReviewed-by: Jonathan Nieder <jrnieder@gmail.com>\n---\n git-am.sh | 11 +++++------\n 1 file changed, 5 insertions(+), 6 deletions(-)\n\ndiff --git a/git-am.sh b/git-am.sh\nindex 8961a..25d0e 100755\n--- a/git-am.sh\n+++ b/git-am.sh\n@@ -92,7 +92,7 @@ safe_to_abort () {\n \tthen\n \t\treturn 0\n \tfi\n-\t\tgettextln \"You seem to have moved HEAD since the last 'am' failure.\n+\tgettextln \"You seem to have moved HEAD since the last 'am' failure.\n Not rewinding to ORIG_HEAD\" >&2\n \treturn 1\n }\n@@ -136,7 +136,7 @@ fall_back_3way () {\n     git write-tree >\"$dotest/patch-merge-base+\" ||\n     cannot_fallback \"$(gettext \"Repository lacks necessary blobs to fall back on 3-way merge.\")\"\n \n-    say Using index info to reconstruct a base tree...\n+    say \"$(gettext \"Using index info to reconstruct a base tree...\")\"\n \n     cmd='GIT_INDEX_FILE=\"$dotest/patch-merge-tmp-index\"'\n \n@@ -176,8 +176,7 @@ It does not apply to blobs recorded in its index.\")\"\n     fi\n     git-merge-recursive $orig_tree -- HEAD $his_tree || {\n \t    git rerere $allow_rerere_autoupdate\n-\t    echo Failed to merge in the changes.\n-\t    exit 1\n+\t    die \"$(gettext \"Failed to merge in the changes.\")\"\n     }\n     unset GITHEAD_$his_tree\n }\n@@ -387,8 +386,8 @@ do\n \t-i|--interactive)\n \t\tinteractive=t ;;\n \t-b|--binary)\n-\t\techo >&2 \"The $1 option has been a no-op for long time, and\"\n-\t\techo >&2 \"it will be removed. Please do not use it anymore.\"\n+\t\tgettextln >&2 \"The -b/--binary option has been a no-op for long time, and\n+it will be removed. Please do not use it anymore.\"\n \t\t;;\n \t-3|--3way)\n \t\tthreeway=t ;;\n-- \n1.7.12.rc0.16.gf4916ac\n"},{"id":"195730","messageId":"b22ea7d7306745555bfd39bf4ff51f485a005a02.1343205009.git.worldhello.net@gmail.com","threadId":"31095","inReplyTo":"6d764280b65f1eeb96bed77cdbfead465f8b99e4.1343205009.git.worldhello.net@gmail.com","subject":"[PATCH v5 6/7] Remove dead code which contains bad gettext block","fromName":"Jiang Xin","fromEmail":"worldhello.net@gmail.com","sentAt":"2012-07-25T08:34:11Z","receivedAt":"2012-07-25T08:34:11Z","isPatch":true,"sender":{"key":"worldhello.net@gmail.com","avatar":"https://avatars.githubusercontent.com/u/183860?v=4"},"body":"Found this dead code when I examine gettext messages in shell scripts\nstart with dash ('-' or '--'). An error will be raised for this case,\nlike:\n\n    $ gettext \"-d option is no longer supported.  Do not use.\"\n    gettext: missing arguments\n\nIndead, this code has been left as dead for a long time, as Junathan\npoints out:\n\n    The git am -d/--dotest option has errored out with a message\n    since e72c7406 (am: remove support for -d .dotest, 2008-03-04).\n    The error message about lack of support was eliminated along\n    with other cleanups (probably by mistake) a year later by\n    removing the option from the option table in 98ef23b3 (git-am:\n    minor cleanups, 2009-01-28).\n\n    But the code to handle -d and --dotest stayed around even though\n    ever since then it could not be tripped.  Remove this dead code.\n\nSigned-off-by: Jiang Xin <worldhello.net@gmail.com>\nReviewed-by: Stefano Lattarini <stefano.lattarini@gmail.com>\nReviewed-by: Jonathan Nieder <jrnieder@gmail.com>\n---\n git-am.sh | 3 ---\n 1 file changed, 3 deletions(-)\n\ndiff --git a/git-am.sh b/git-am.sh\nindex 25d0e..bd962 100755\n--- a/git-am.sh\n+++ b/git-am.sh\n@@ -413,9 +413,6 @@ it will be removed. Please do not use it anymore.\"\n \t\tabort=t ;;\n \t--rebasing)\n \t\trebasing=t threeway=t ;;\n-\t-d|--dotest)\n-\t\tdie \"$(gettext \"-d option is no longer supported.  Do not use.\")\"\n-\t\t;;\n \t--resolvemsg)\n \t\tshift; resolvemsg=$1 ;;\n \t--whitespace|--directory|--exclude|--include)\n-- \n1.7.12.rc0.16.gf4916ac\n"},{"id":"195731","messageId":"05f97d151b08bd864e967142969af7dd01283e55.1343205009.git.worldhello.net@gmail.com","threadId":"31095","inReplyTo":"b22ea7d7306745555bfd39bf4ff51f485a005a02.1343205009.git.worldhello.net@gmail.com","subject":"[PATCH v5 7/7] i18n: merge-recursive: mark strings for translation","fromName":"Jiang Xin","fromEmail":"worldhello.net@gmail.com","sentAt":"2012-07-25T08:34:12Z","receivedAt":"2012-07-25T08:34:12Z","isPatch":true,"sender":{"key":"worldhello.net@gmail.com","avatar":"https://avatars.githubusercontent.com/u/183860?v=4"},"body":"Mark strings in merge-recursive for translation.\n\nSome test scripts are affected by this update, and would fail if tested\nwith GETTEXT_POISON switch turned on. Using i18n-specific test\nfunctions, such as test_i18ngrep, in the related test scripts will fix\nthese issues.\n\nSigned-off-by: Jiang Xin <worldhello.net@gmail.com>\nReviewed-by: Stefano Lattarini <stefano.lattarini@gmail.com>\n---\n merge-recursive.c                    | 148 +++++++++++++++++++----------------\n t/t6022-merge-rename.sh              |  16 ++--\n t/t6042-merge-rename-corner-cases.sh |   2 +-\n 3 files changed, 88 insertions(+), 78 deletions(-)\n\ndiff --git a/merge-recursive.c b/merge-recursive.c\nindex 68093..8903 100644\n--- a/merge-recursive.c\n+++ b/merge-recursive.c\n@@ -187,7 +187,7 @@ static void output_commit_title(struct merge_options *o, struct commit *commit)\n \telse {\n \t\tprintf(\"%s \", find_unique_abbrev(commit->object.sha1, DEFAULT_ABBREV));\n \t\tif (parse_commit(commit) != 0)\n-\t\t\tprintf(\"(bad commit)\\n\");\n+\t\t\tprintf(_(\"(bad commit)\\n\"));\n \t\telse {\n \t\t\tconst char *title;\n \t\t\tint len = find_commit_subject(commit->buffer, &title);\n@@ -203,7 +203,7 @@ static int add_cacheinfo(unsigned int mode, const unsigned char *sha1,\n \tstruct cache_entry *ce;\n \tce = make_cache_entry(mode, sha1 ? sha1 : null_sha1, path, stage, refresh);\n \tif (!ce)\n-\t\treturn error(\"addinfo_cache failed for path '%s'\", path);\n+\t\treturn error(_(\"addinfo_cache failed for path '%s'\"), path);\n \treturn add_cache_entry(ce, options);\n }\n \n@@ -265,7 +265,7 @@ struct tree *write_tree_from_memory(struct merge_options *o)\n \tif (!cache_tree_fully_valid(active_cache_tree) &&\n \t    cache_tree_update(active_cache_tree,\n \t\t\t      active_cache, active_nr, 0) < 0)\n-\t\tdie(\"error building trees\");\n+\t\tdie(_(\"error building trees\"));\n \n \tresult = lookup_tree(active_cache_tree->sha1);\n \n@@ -494,7 +494,7 @@ static struct string_list *get_renames(struct merge_options *o,\n \topts.show_rename_progress = o->show_rename_progress;\n \topts.output_format = DIFF_FORMAT_NO_OUTPUT;\n \tif (diff_setup_done(&opts) < 0)\n-\t\tdie(\"diff setup failed\");\n+\t\tdie(_(\"diff setup failed\"));\n \tdiff_tree_sha1(o_tree->object.sha1, tree->object.sha1, \"\", &opts);\n \tdiffcore_std(&opts);\n \tif (opts.needed_rename_limit > o->needed_rename_limit)\n@@ -624,7 +624,7 @@ static void flush_buffer(int fd, const char *buf, unsigned long size)\n \t\t\t\tbreak;\n \t\t\tdie_errno(\"merge-recursive\");\n \t\t} else if (!ret) {\n-\t\t\tdie(\"merge-recursive: disk full?\");\n+\t\t\tdie(_(\"merge-recursive: disk full?\"));\n \t\t}\n \t\tsize -= ret;\n \t\tbuf += ret;\n@@ -687,7 +687,7 @@ static int would_lose_untracked(const char *path)\n static int make_room_for_path(struct merge_options *o, const char *path)\n {\n \tint status, i;\n-\tconst char *msg = \"failed to create path '%s'%s\";\n+\tconst char *msg = _(\"failed to create path '%s'%s\");\n \n \t/* Unlink any D/F conflict files that are in the way */\n \tfor (i = 0; i < o->df_conflict_file_set.nr; i++) {\n@@ -698,7 +698,7 @@ static int make_room_for_path(struct merge_options *o, const char *path)\n \t\t    path[df_pathlen] == '/' &&\n \t\t    strncmp(path, df_path, df_pathlen) == 0) {\n \t\t\toutput(o, 3,\n-\t\t\t       \"Removing %s to make room for subdirectory\\n\",\n+\t\t\t       _(\"Removing %s to make room for subdirectory\\n\"),\n \t\t\t       df_path);\n \t\t\tunlink(df_path);\n \t\t\tunsorted_string_list_delete_item(&o->df_conflict_file_set,\n@@ -712,7 +712,7 @@ static int make_room_for_path(struct merge_options *o, const char *path)\n \tif (status) {\n \t\tif (status == -3) {\n \t\t\t/* something else exists */\n-\t\t\terror(msg, path, \": perhaps a D/F conflict?\");\n+\t\t\terror(msg, path, _(\": perhaps a D/F conflict?\"));\n \t\t\treturn -1;\n \t\t}\n \t\tdie(msg, path, \"\");\n@@ -723,7 +723,7 @@ static int make_room_for_path(struct merge_options *o, const char *path)\n \t * tracking it.\n \t */\n \tif (would_lose_untracked(path))\n-\t\treturn error(\"refusing to lose untracked file at '%s'\",\n+\t\treturn error(_(\"refusing to lose untracked file at '%s'\"),\n \t\t\t     path);\n \n \t/* Successful unlink is good.. */\n@@ -733,7 +733,7 @@ static int make_room_for_path(struct merge_options *o, const char *path)\n \tif (errno == ENOENT)\n \t\treturn 0;\n \t/* .. but not some other error (who really cares what?) */\n-\treturn error(msg, path, \": perhaps a D/F conflict?\");\n+\treturn error(msg, path, _(\": perhaps a D/F conflict?\"));\n }\n \n static void update_file_flags(struct merge_options *o,\n@@ -763,9 +763,9 @@ static void update_file_flags(struct merge_options *o,\n \n \t\tbuf = read_sha1_file(sha, &type, &size);\n \t\tif (!buf)\n-\t\t\tdie(\"cannot read object %s '%s'\", sha1_to_hex(sha), path);\n+\t\t\tdie(_(\"cannot read object %s '%s'\"), sha1_to_hex(sha), path);\n \t\tif (type != OBJ_BLOB)\n-\t\t\tdie(\"blob expected for %s '%s'\", sha1_to_hex(sha), path);\n+\t\t\tdie(_(\"blob expected for %s '%s'\"), sha1_to_hex(sha), path);\n \t\tif (S_ISREG(mode)) {\n \t\t\tstruct strbuf strbuf = STRBUF_INIT;\n \t\t\tif (convert_to_working_tree(path, buf, size, &strbuf)) {\n@@ -788,7 +788,7 @@ static void update_file_flags(struct merge_options *o,\n \t\t\t\tmode = 0666;\n \t\t\tfd = open(path, O_WRONLY | O_TRUNC | O_CREAT, mode);\n \t\t\tif (fd < 0)\n-\t\t\t\tdie_errno(\"failed to open '%s'\", path);\n+\t\t\t\tdie_errno(_(\"failed to open '%s'\"), path);\n \t\t\tflush_buffer(fd, buf, size);\n \t\t\tclose(fd);\n \t\t} else if (S_ISLNK(mode)) {\n@@ -796,10 +796,10 @@ static void update_file_flags(struct merge_options *o,\n \t\t\tsafe_create_leading_directories_const(path);\n \t\t\tunlink(path);\n \t\t\tif (symlink(lnk, path))\n-\t\t\t\tdie_errno(\"failed to symlink '%s'\", path);\n+\t\t\t\tdie_errno(_(\"failed to symlink '%s'\"), path);\n \t\t\tfree(lnk);\n \t\t} else\n-\t\t\tdie(\"do not know what to do with %06o %s '%s'\",\n+\t\t\tdie(_(\"do not know what to do with %06o %s '%s'\"),\n \t\t\t    mode, sha1_to_hex(sha), path);\n \t\tfree(buf);\n \t}\n@@ -936,11 +936,11 @@ static struct merge_file_info merge_file_1(struct merge_options *o,\n \t\t\t\t\t\t  branch1, branch2);\n \n \t\t\tif ((merge_status < 0) || !result_buf.ptr)\n-\t\t\t\tdie(\"Failed to execute internal merge\");\n+\t\t\t\tdie(_(\"Failed to execute internal merge\"));\n \n \t\t\tif (write_sha1_file(result_buf.ptr, result_buf.size,\n \t\t\t\t\t    blob_type, result.sha))\n-\t\t\t\tdie(\"Unable to add %s to database\",\n+\t\t\t\tdie(_(\"Unable to add %s to database\"),\n \t\t\t\t    a->path);\n \n \t\t\tfree(result_buf.ptr);\n@@ -956,7 +956,7 @@ static struct merge_file_info merge_file_1(struct merge_options *o,\n \t\t\tif (!sha_eq(a->sha1, b->sha1))\n \t\t\t\tresult.clean = 0;\n \t\t} else {\n-\t\t\tdie(\"unsupported object type in the tree\");\n+\t\t\tdie(_(\"unsupported object type in the tree\"));\n \t\t}\n \t}\n \n@@ -1034,22 +1034,32 @@ static void handle_change_delete(struct merge_options *o,\n \t\tremove_file_from_cache(path);\n \t\tupdate_file(o, 0, o_sha, o_mode, renamed ? renamed : path);\n \t} else if (!a_sha) {\n-\t\toutput(o, 1, \"CONFLICT (%s/delete): %s deleted in %s \"\n-\t\t       \"and %s in %s. Version %s of %s left in tree%s%s.\",\n-\t\t       change, path, o->branch1,\n-\t\t       change_past, o->branch2, o->branch2, path,\n-\t\t       NULL == renamed ? \"\" : \" at \",\n-\t\t       NULL == renamed ? \"\" : renamed);\n-\t\tupdate_file(o, 0, b_sha, b_mode, renamed ? renamed : path);\n+\t\tif (!renamed) {\n+\t\t\toutput(o, 1, _(\"CONFLICT (%s/delete): %s deleted in %s \"\n+\t\t\t       \"and %s in %s. Version %s of %s left in tree.\"),\n+\t\t\t       change, path, o->branch1, change_past,\n+\t\t\t       o->branch2, o->branch2, path);\n+\t\t\tupdate_file(o, 0, b_sha, b_mode, path);\n+\t\t} else {\n+\t\t\toutput(o, 1, _(\"CONFLICT (%s/delete): %s deleted in %s \"\n+\t\t\t       \"and %s in %s. Version %s of %s left in tree at %s.\"),\n+\t\t\t       change, path, o->branch1, change_past,\n+\t\t\t       o->branch2, o->branch2, path, renamed);\n+\t\t\tupdate_file(o, 0, b_sha, b_mode, renamed);\n+\t\t}\n \t} else {\n-\t\toutput(o, 1, \"CONFLICT (%s/delete): %s deleted in %s \"\n-\t\t       \"and %s in %s. Version %s of %s left in tree%s%s.\",\n-\t\t       change, path, o->branch2,\n-\t\t       change_past, o->branch1, o->branch1, path,\n-\t\t       NULL == renamed ? \"\" : \" at \",\n-\t\t       NULL == renamed ? \"\" : renamed);\n-\t\tif (renamed)\n+\t\tif (!renamed) {\n+\t\t\toutput(o, 1, _(\"CONFLICT (%s/delete): %s deleted in %s \"\n+\t\t\t       \"and %s in %s. Version %s of %s left in tree.\"),\n+\t\t\t       change, path, o->branch2, change_past,\n+\t\t\t       o->branch1, o->branch1, path);\n+\t\t} else {\n+\t\t\toutput(o, 1, _(\"CONFLICT (%s/delete): %s deleted in %s \"\n+\t\t\t       \"and %s in %s. Version %s of %s left in tree at %s.\"),\n+\t\t\t       change, path, o->branch2, change_past,\n+\t\t\t       o->branch1, o->branch1, path, renamed);\n \t\t\tupdate_file(o, 0, a_sha, a_mode, renamed);\n+\t\t}\n \t\t/*\n \t\t * No need to call update_file() on path when !renamed, since\n \t\t * that would needlessly touch path.  We could call\n@@ -1085,7 +1095,7 @@ static void conflict_rename_delete(struct merge_options *o,\n \t\t\t     orig->sha1, orig->mode,\n \t\t\t     a_sha, a_mode,\n \t\t\t     b_sha, b_mode,\n-\t\t\t     \"rename\", \"renamed\");\n+\t\t\t     _(\"rename\"), _(\"renamed\"));\n \n \tif (o->call_depth) {\n \t\tremove_file_from_cache(dest->path);\n@@ -1141,7 +1151,7 @@ static void handle_file(struct merge_options *o,\n \t} else {\n \t\tif (dir_in_way(rename->path, !o->call_depth)) {\n \t\t\tdst_name = unique_path(o, rename->path, cur_branch);\n-\t\t\toutput(o, 1, \"%s is a directory in %s adding as %s instead\",\n+\t\t\toutput(o, 1, _(\"%s is a directory in %s adding as %s instead\"),\n \t\t\t       rename->path, other_branch, dst_name);\n \t\t}\n \t}\n@@ -1163,12 +1173,12 @@ static void conflict_rename_rename_1to2(struct merge_options *o,\n \tstruct diff_filespec *a = ci->pair1->two;\n \tstruct diff_filespec *b = ci->pair2->two;\n \n-\toutput(o, 1, \"CONFLICT (rename/rename): \"\n+\toutput(o, 1, _(\"CONFLICT (rename/rename): \"\n \t       \"Rename \\\"%s\\\"->\\\"%s\\\" in branch \\\"%s\\\" \"\n-\t       \"rename \\\"%s\\\"->\\\"%s\\\" in \\\"%s\\\"%s\",\n+\t       \"rename \\\"%s\\\"->\\\"%s\\\" in \\\"%s\\\"%s\"),\n \t       one->path, a->path, ci->branch1,\n \t       one->path, b->path, ci->branch2,\n-\t       o->call_depth ? \" (left unresolved)\" : \"\");\n+\t       o->call_depth ? _(\" (left unresolved)\") : \"\");\n \tif (o->call_depth) {\n \t\tstruct merge_file_info mfi;\n \t\tstruct diff_filespec other;\n@@ -1222,9 +1232,9 @@ static void conflict_rename_rename_2to1(struct merge_options *o,\n \tstruct merge_file_info mfi_c1;\n \tstruct merge_file_info mfi_c2;\n \n-\toutput(o, 1, \"CONFLICT (rename/rename): \"\n+\toutput(o, 1, _(\"CONFLICT (rename/rename): \"\n \t       \"Rename %s->%s in %s. \"\n-\t       \"Rename %s->%s in %s\",\n+\t       \"Rename %s->%s in %s\"),\n \t       a->path, c1->path, ci->branch1,\n \t       b->path, c2->path, ci->branch2);\n \n@@ -1252,7 +1262,7 @@ static void conflict_rename_rename_2to1(struct merge_options *o,\n \t} else {\n \t\tchar *new_path1 = unique_path(o, path, ci->branch1);\n \t\tchar *new_path2 = unique_path(o, path, ci->branch2);\n-\t\toutput(o, 1, \"Renaming %s to %s and %s to %s instead\",\n+\t\toutput(o, 1, _(\"Renaming %s to %s and %s to %s instead\"),\n \t\t       a->path, new_path1, b->path, new_path2);\n \t\tremove_file(o, 0, path, 0);\n \t\tupdate_file(o, 0, mfi_c1.sha, mfi_c1.mode, new_path1);\n@@ -1451,8 +1461,8 @@ static int process_renames(struct merge_options *o,\n \t\t\t} else if (!sha_eq(dst_other.sha1, null_sha1)) {\n \t\t\t\tclean_merge = 0;\n \t\t\t\ttry_merge = 1;\n-\t\t\t\toutput(o, 1, \"CONFLICT (rename/add): Rename %s->%s in %s. \"\n-\t\t\t\t       \"%s added in %s\",\n+\t\t\t\toutput(o, 1, _(\"CONFLICT (rename/add): Rename %s->%s in %s. \"\n+\t\t\t\t       \"%s added in %s\"),\n \t\t\t\t       ren1_src, ren1_dst, branch1,\n \t\t\t\t       ren1_dst, branch2);\n \t\t\t\tif (o->call_depth) {\n@@ -1461,12 +1471,12 @@ static int process_renames(struct merge_options *o,\n \t\t\t\t\t\t\t ren1->pair->two->sha1, ren1->pair->two->mode,\n \t\t\t\t\t\t\t dst_other.sha1, dst_other.mode,\n \t\t\t\t\t\t\t branch1, branch2);\n-\t\t\t\t\toutput(o, 1, \"Adding merged %s\", ren1_dst);\n+\t\t\t\t\toutput(o, 1, _(\"Adding merged %s\"), ren1_dst);\n \t\t\t\t\tupdate_file(o, 0, mfi.sha, mfi.mode, ren1_dst);\n \t\t\t\t\ttry_merge = 0;\n \t\t\t\t} else {\n \t\t\t\t\tchar *new_path = unique_path(o, ren1_dst, branch2);\n-\t\t\t\t\toutput(o, 1, \"Adding as %s instead\", new_path);\n+\t\t\t\t\toutput(o, 1, _(\"Adding as %s instead\"), new_path);\n \t\t\t\t\tupdate_file(o, 0, dst_other.sha1, dst_other.mode, new_path);\n \t\t\t\t\tfree(new_path);\n \t\t\t\t}\n@@ -1517,10 +1527,10 @@ static int read_sha1_strbuf(const unsigned char *sha1, struct strbuf *dst)\n \tunsigned long size;\n \tbuf = read_sha1_file(sha1, &type, &size);\n \tif (!buf)\n-\t\treturn error(\"cannot read object %s\", sha1_to_hex(sha1));\n+\t\treturn error(_(\"cannot read object %s\"), sha1_to_hex(sha1));\n \tif (type != OBJ_BLOB) {\n \t\tfree(buf);\n-\t\treturn error(\"object %s is not a blob\", sha1_to_hex(sha1));\n+\t\treturn error(_(\"object %s is not a blob\"), sha1_to_hex(sha1));\n \t}\n \tstrbuf_attach(dst, buf, size, size + 1);\n \treturn 0;\n@@ -1568,7 +1578,7 @@ static void handle_modify_delete(struct merge_options *o,\n \t\t\t     o_sha, o_mode,\n \t\t\t     a_sha, a_mode,\n \t\t\t     b_sha, b_mode,\n-\t\t\t     \"modify\", \"modified\");\n+\t\t\t     _(\"modify\"), _(\"modified\"));\n }\n \n static int merge_content(struct merge_options *o,\n@@ -1578,14 +1588,14 @@ static int merge_content(struct merge_options *o,\n \t\t\t unsigned char *b_sha, int b_mode,\n \t\t\t struct rename_conflict_info *rename_conflict_info)\n {\n-\tconst char *reason = \"content\";\n+\tconst char *reason = _(\"content\");\n \tconst char *path1 = NULL, *path2 = NULL;\n \tstruct merge_file_info mfi;\n \tstruct diff_filespec one, a, b;\n \tunsigned df_conflict_remains = 0;\n \n \tif (!o_sha) {\n-\t\treason = \"add/add\";\n+\t\treason = _(\"add/add\");\n \t\to_sha = (unsigned char *)null_sha1;\n \t}\n \tone.path = a.path = b.path = (char *)path;\n@@ -1619,7 +1629,7 @@ static int merge_content(struct merge_options *o,\n \tif (mfi.clean && !df_conflict_remains &&\n \t    sha_eq(mfi.sha, a_sha) && mfi.mode == a_mode) {\n \t\tint path_renamed_outside_HEAD;\n-\t\toutput(o, 3, \"Skipped %s (merged same as existing)\", path);\n+\t\toutput(o, 3, _(\"Skipped %s (merged same as existing)\"), path);\n \t\t/*\n \t\t * The content merge resulted in the same file contents we\n \t\t * already had.  We can return early if those file contents\n@@ -1633,12 +1643,12 @@ static int merge_content(struct merge_options *o,\n \t\t\treturn mfi.clean;\n \t\t}\n \t} else\n-\t\toutput(o, 2, \"Auto-merging %s\", path);\n+\t\toutput(o, 2, _(\"Auto-merging %s\"), path);\n \n \tif (!mfi.clean) {\n \t\tif (S_ISGITLINK(mfi.mode))\n-\t\t\treason = \"submodule\";\n-\t\toutput(o, 1, \"CONFLICT (%s): Merge conflict in %s\",\n+\t\t\treason = _(\"submodule\");\n+\t\toutput(o, 1, _(\"CONFLICT (%s): Merge conflict in %s\"),\n \t\t\t\treason, path);\n \t\tif (rename_conflict_info && !df_conflict_remains)\n \t\t\tupdate_stages(path, &one, &a, &b);\n@@ -1664,7 +1674,7 @@ static int merge_content(struct merge_options *o,\n \n \t\t}\n \t\tnew_path = unique_path(o, path, rename_conflict_info->branch1);\n-\t\toutput(o, 1, \"Adding as %s instead\", new_path);\n+\t\toutput(o, 1, _(\"Adding as %s instead\"), new_path);\n \t\tupdate_file(o, 0, mfi.sha, mfi.mode, new_path);\n \t\tfree(new_path);\n \t\tmfi.clean = 0;\n@@ -1728,7 +1738,7 @@ static int process_entry(struct merge_options *o,\n \t\t\t/* Deleted in both or deleted in one and\n \t\t\t * unchanged in the other */\n \t\t\tif (a_sha)\n-\t\t\t\toutput(o, 2, \"Removing %s\", path);\n+\t\t\t\toutput(o, 2, _(\"Removing %s\"), path);\n \t\t\t/* do not touch working file if it did not exist */\n \t\t\tremove_file(o, 1, path, !a_sha);\n \t\t} else {\n@@ -1753,19 +1763,19 @@ static int process_entry(struct merge_options *o,\n \t\t\tother_branch = o->branch2;\n \t\t\tmode = a_mode;\n \t\t\tsha = a_sha;\n-\t\t\tconf = \"file/directory\";\n+\t\t\tconf = _(\"file/directory\");\n \t\t} else {\n \t\t\tadd_branch = o->branch2;\n \t\t\tother_branch = o->branch1;\n \t\t\tmode = b_mode;\n \t\t\tsha = b_sha;\n-\t\t\tconf = \"directory/file\";\n+\t\t\tconf = _(\"directory/file\");\n \t\t}\n \t\tif (dir_in_way(path, !o->call_depth)) {\n \t\t\tchar *new_path = unique_path(o, path, add_branch);\n \t\t\tclean_merge = 0;\n-\t\t\toutput(o, 1, \"CONFLICT (%s): There is a directory with name %s in %s. \"\n-\t\t\t       \"Adding %s as %s\",\n+\t\t\toutput(o, 1, _(\"CONFLICT (%s): There is a directory with name %s in %s. \"\n+\t\t\t       \"Adding %s as %s\"),\n \t\t\t       conf, path, other_branch, path, new_path);\n \t\t\tif (o->call_depth)\n \t\t\t\tremove_file_from_cache(path);\n@@ -1774,7 +1784,7 @@ static int process_entry(struct merge_options *o,\n \t\t\t\tremove_file_from_cache(path);\n \t\t\tfree(new_path);\n \t\t} else {\n-\t\t\toutput(o, 2, \"Adding %s\", path);\n+\t\t\toutput(o, 2, _(\"Adding %s\"), path);\n \t\t\t/* do not overwrite file if already present */\n \t\t\tupdate_file_flags(o, sha, mode, path, 1, !a_sha);\n \t\t}\n@@ -1791,7 +1801,7 @@ static int process_entry(struct merge_options *o,\n \t\t */\n \t\tremove_file(o, 1, path, !a_mode);\n \t} else\n-\t\tdie(\"Fatal merge failure, shouldn't happen.\");\n+\t\tdie(_(\"Fatal merge failure, shouldn't happen.\"));\n \n \treturn clean_merge;\n }\n@@ -1810,7 +1820,7 @@ int merge_trees(struct merge_options *o,\n \t}\n \n \tif (sha_eq(common->object.sha1, merge->object.sha1)) {\n-\t\toutput(o, 0, \"Already up-to-date!\");\n+\t\toutput(o, 0, _(\"Already up-to-date!\"));\n \t\t*result = head;\n \t\treturn 1;\n \t}\n@@ -1819,7 +1829,7 @@ int merge_trees(struct merge_options *o,\n \n \tif (code != 0) {\n \t\tif (show(o, 4) || o->call_depth)\n-\t\t\tdie(\"merging of trees %s and %s failed\",\n+\t\t\tdie(_(\"merging of trees %s and %s failed\"),\n \t\t\t    sha1_to_hex(head->object.sha1),\n \t\t\t    sha1_to_hex(merge->object.sha1));\n \t\telse\n@@ -1849,7 +1859,7 @@ int merge_trees(struct merge_options *o,\n \t\tfor (i = 0; i < entries->nr; i++) {\n \t\t\tstruct stage_data *e = entries->items[i].util;\n \t\t\tif (!e->processed)\n-\t\t\t\tdie(\"Unprocessed path??? %s\",\n+\t\t\t\tdie(_(\"Unprocessed path??? %s\"),\n \t\t\t\t    entries->items[i].string);\n \t\t}\n \n@@ -1894,7 +1904,7 @@ int merge_recursive(struct merge_options *o,\n \tint clean;\n \n \tif (show(o, 4)) {\n-\t\toutput(o, 4, \"Merging:\");\n+\t\toutput(o, 4, _(\"Merging:\"));\n \t\toutput_commit_title(o, h1);\n \t\toutput_commit_title(o, h2);\n \t}\n@@ -1905,7 +1915,7 @@ int merge_recursive(struct merge_options *o,\n \t}\n \n \tif (show(o, 5)) {\n-\t\toutput(o, 5, \"found %u common ancestor(s):\", commit_list_count(ca));\n+\t\toutput(o, 5, _(\"found %u common ancestor(s):\"), commit_list_count(ca));\n \t\tfor (iter = ca; iter; iter = iter->next)\n \t\t\toutput_commit_title(o, iter->item);\n \t}\n@@ -1941,7 +1951,7 @@ int merge_recursive(struct merge_options *o,\n \t\to->call_depth--;\n \n \t\tif (!merged_common_ancestors)\n-\t\t\tdie(\"merge returned no commit\");\n+\t\t\tdie(_(\"merge returned no commit\"));\n \t}\n \n \tdiscard_cache();\n@@ -1998,7 +2008,7 @@ int merge_recursive_generic(struct merge_options *o,\n \t\tfor (i = 0; i < num_base_list; ++i) {\n \t\t\tstruct commit *base;\n \t\t\tif (!(base = get_ref(base_list[i], sha1_to_hex(base_list[i]))))\n-\t\t\t\treturn error(\"Could not parse object '%s'\",\n+\t\t\t\treturn error(_(\"Could not parse object '%s'\"),\n \t\t\t\t\tsha1_to_hex(base_list[i]));\n \t\t\tcommit_list_insert(base, &ca);\n \t\t}\n@@ -2010,7 +2020,7 @@ int merge_recursive_generic(struct merge_options *o,\n \tif (active_cache_changed &&\n \t\t\t(write_cache(index_fd, active_cache, active_nr) ||\n \t\t\t commit_locked_index(lock)))\n-\t\treturn error(\"Unable to write index.\");\n+\t\treturn error(_(\"Unable to write index.\"));\n \n \treturn clean ? 0 : 1;\n }\ndiff --git a/t/t6022-merge-rename.sh b/t/t6022-merge-rename.sh\nindex 11042..c680f 100755\n--- a/t/t6022-merge-rename.sh\n+++ b/t/t6022-merge-rename.sh\n@@ -242,10 +242,10 @@ test_expect_success 'merge of identical changes in a renamed file' '\n \trm -f A M N &&\n \tgit reset --hard &&\n \tgit checkout change+rename &&\n-\tGIT_MERGE_VERBOSITY=3 git merge change | grep \"^Skipped B\" &&\n+\tGIT_MERGE_VERBOSITY=3 git merge change | test_i18ngrep \"^Skipped B\" &&\n \tgit reset --hard HEAD^ &&\n \tgit checkout change &&\n-\tGIT_MERGE_VERBOSITY=3 git merge change+rename | grep \"^Skipped B\"\n+\tGIT_MERGE_VERBOSITY=3 git merge change+rename | test_i18ngrep \"^Skipped B\"\n '\n \n test_expect_success 'setup for rename + d/f conflicts' '\n@@ -303,9 +303,9 @@ test_expect_success 'Rename+D/F conflict; renamed file merges but dir in way' '\n \tgit checkout -q renamed-file-has-no-conflicts^0 &&\n \ttest_must_fail git merge --strategy=recursive dir-in-way >output &&\n \n-\tgrep \"CONFLICT (modify/delete): dir/file-in-the-way\" output &&\n-\tgrep \"Auto-merging dir\" output &&\n-\tgrep \"Adding as dir~HEAD instead\" output &&\n+\ttest_i18ngrep \"CONFLICT (modify/delete): dir/file-in-the-way\" output &&\n+\ttest_i18ngrep \"Auto-merging dir\" output &&\n+\ttest_i18ngrep \"Adding as dir~HEAD instead\" output &&\n \n \ttest 3 -eq \"$(git ls-files -u | wc -l)\" &&\n \ttest 2 -eq \"$(git ls-files -u dir/file-in-the-way | wc -l)\" &&\n@@ -325,9 +325,9 @@ test_expect_success 'Same as previous, but merged other way' '\n \ttest_must_fail git merge --strategy=recursive renamed-file-has-no-conflicts >output 2>errors &&\n \n \t! grep \"error: refusing to lose untracked file at\" errors &&\n-\tgrep \"CONFLICT (modify/delete): dir/file-in-the-way\" output &&\n-\tgrep \"Auto-merging dir\" output &&\n-\tgrep \"Adding as dir~renamed-file-has-no-conflicts instead\" output &&\n+\ttest_i18ngrep \"CONFLICT (modify/delete): dir/file-in-the-way\" output &&\n+\ttest_i18ngrep \"Auto-merging dir\" output &&\n+\ttest_i18ngrep \"Adding as dir~renamed-file-has-no-conflicts instead\" output &&\n \n \ttest 3 -eq \"$(git ls-files -u | wc -l)\" &&\n \ttest 2 -eq \"$(git ls-files -u dir/file-in-the-way | wc -l)\" &&\ndiff --git a/t/t6042-merge-rename-corner-cases.sh b/t/t6042-merge-rename-corner-cases.sh\nindex 466fa3..4115 100755\n--- a/t/t6042-merge-rename-corner-cases.sh\n+++ b/t/t6042-merge-rename-corner-cases.sh\n@@ -380,7 +380,7 @@ test_expect_success 'handle rename/rename (2to1) conflict correctly' '\n \tgit checkout B^0 &&\n \n \ttest_must_fail git merge -s recursive C^0 >out &&\n-\tgrep \"CONFLICT (rename/rename)\" out &&\n+\ttest_i18ngrep \"CONFLICT (rename/rename)\" out &&\n \n \ttest 2 -eq $(git ls-files -s | wc -l) &&\n \ttest 2 -eq $(git ls-files -u | wc -l) &&\n-- \n1.7.12.rc0.16.gf4916ac\n"},{"id":"195738","messageId":"20120725113009.GA4732@burratino","threadId":"31095","inReplyTo":"b22ea7d7306745555bfd39bf4ff51f485a005a02.1343205009.git.worldhello.net@gmail.com","subject":"Re: [PATCH v5 6/7] Remove dead code which contains bad gettext block","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2012-07-25T11:30:09Z","receivedAt":"2012-07-25T11:30:09Z","isPatch":true,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"Jiang Xin wrote:\n\n> Found this dead code when I examine gettext messages in shell scripts\n> start with dash ('-' or '--'). An error will be raised for this case,\n> like:\n>\n>     $ gettext \"-d option is no longer supported.  Do not use.\"\n>     gettext: missing arguments\n>\n> Indead, this code has been left as dead for a long time, as Junathan\n> points out:\n\ns/Junathan/Jonathan/, please, unless you are trying to say that both\nJunio and I pointed it out at the same time.\n"},{"id":"195739","messageId":"CANYiYbF9KsBeRsVV1RCD9k5KQFnf-9ubc-YLHLg+LjMSoPLVoA@mail.gmail.com","threadId":"31095","inReplyTo":"20120725113009.GA4732@burratino","subject":"Re: [PATCH v5 6/7] Remove dead code which contains bad gettext block","fromName":"Jiang Xin","fromEmail":"worldhello.net@gmail.com","sentAt":"2012-07-25T13:31:29Z","receivedAt":"2012-07-25T13:31:29Z","isPatch":true,"sender":{"key":"worldhello.net@gmail.com","avatar":"https://avatars.githubusercontent.com/u/183860?v=4"},"body":"2012/7/25 Jonathan Nieder <jrnieder@gmail.com>:\n> Jiang Xin wrote:\n> s/Junathan/Jonathan/, please, unless you are trying to say that both\n> Junio and I pointed it out at the same time.\n\nSorry. Correct it in next series of patches.\nI don't know how this happens until now.\n\n-- \nJiang Xin\n"},{"id":"195847","messageId":"CACsJy8BW+TUbY4yo0GqUvLrE0TivX=H+aqE+3tw=u0KZYyDtQA@mail.gmail.com","threadId":"31095","inReplyTo":"CANYiYbF9KsBeRsVV1RCD9k5KQFnf-9ubc-YLHLg+LjMSoPLVoA@mail.gmail.com","subject":"Re: [PATCH v5 6/7] Remove dead code which contains bad gettext block","fromName":"Nguyen Thai Ngoc Duy","fromEmail":"pclouds@gmail.com","sentAt":"2012-07-26T12:21:01Z","receivedAt":"2012-07-26T12:21:01Z","isPatch":true,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"On Wed, Jul 25, 2012 at 8:31 PM, Jiang Xin <worldhello.net@gmail.com> wrote:\n> 2012/7/25 Jonathan Nieder <jrnieder@gmail.com>:\n>> Jiang Xin wrote:\n>> s/Junathan/Jonathan/, please, unless you are trying to say that both\n>> Junio and I pointed it out at the same time.\n>\n> Sorry. Correct it in next series of patches.\n> I don't know how this happens until now.\n\nI think it's nice. I can think of a few occasions to use this name.\nNow I only need to train both of them to recognize their new name ;)\n-- \nDuy\n"}]}