{"thread":{"id":"31062","subject":"[PATCH v2 0/7] i18n for git-am, git-rebase and git-merge","startedAt":"2012-07-22T01:26:04Z","lastAt":"2012-07-23T08:01:49Z","messageCount":16,"participants":["Jiang Xin","Junio C Hamano","Nguyen Thai Ngoc Duy"],"isPatch":true,"patchVersion":2,"patchTotal":7},"messages":[{"id":"195426","messageId":"cover.1342920089.git.worldhello.net@gmail.com","threadId":"31062","inReplyTo":null,"subject":"[PATCH v2 0/7] i18n for git-am, git-rebase and git-merge","fromName":"Jiang Xin","fromEmail":"worldhello.net@gmail.com","sentAt":"2012-07-22T01:26:04Z","receivedAt":"2012-07-22T01:26:04Z","isPatch":true,"sender":{"key":"worldhello.net@gmail.com","avatar":"https://avatars.githubusercontent.com/u/183860?v=4"},"body":"Mark strings in git-am, git-rebase, and git-merge for translation.\nAnd contain fixes for shell gettext extraction and xgettext workaround.\n\nJiang Xin (7):\n  i18n: New keywords for xgettext extraction from sh\n  i18n: rebase: mark strings 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 unused and bad gettext block from git-am\n  i18n: merge-recursive: mark strings for translation\n\n Makefile                      |   3 +-\n git-am.sh                     |  14 ++--\n git-rebase.sh                 |  83 +++++++++--------------\n git-submodule.sh              |   2 +-\n merge-recursive.c             | 152 ++++++++++++++++++++++--------------------\n t/t3404-rebase-interactive.sh |   2 +-\n 6 files changed, 120 insertions(+), 136 deletions(-)\n\n-- \n1.7.11.2.259.g37fc0e1\n"},{"id":"195432","messageId":"e488b5e8f40859a842f80855a3dd4861a4ced6d0.1342920089.git.worldhello.net@gmail.com","threadId":"31062","inReplyTo":"cover.1342920089.git.worldhello.net@gmail.com","subject":"[PATCH v2 1/7] i18n: New keywords for xgettext extraction from sh","fromName":"Jiang Xin","fromEmail":"worldhello.net@gmail.com","sentAt":"2012-07-22T01:26:05Z","receivedAt":"2012-07-22T01:26:05Z","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 run\n'make pot' to extract messages from shell scripts.\n\nSigned-off-by: Jiang Xin <worldhello.net@gmail.com>\nSigned-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>\n---\n Makefile | 3 ++-\n 1 file changed, 2 insertions(+), 1 deletion(-)\n\ndiff --git a/Makefile b/Makefile\nindex 285c66..e1692 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -2376,7 +2376,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.11.2.259.g37fc0e1\n"},{"id":"195433","messageId":"724ca3989123159c9970b3276b4764dcbd5fd56e.1342920089.git.worldhello.net@gmail.com","threadId":"31062","inReplyTo":"e488b5e8f40859a842f80855a3dd4861a4ced6d0.1342920089.git.worldhello.net@gmail.com","subject":"[PATCH v2 2/7] i18n: rebase: mark strings for translation","fromName":"Jiang Xin","fromEmail":"worldhello.net@gmail.com","sentAt":"2012-07-22T01:26:06Z","receivedAt":"2012-07-22T01:26:06Z","isPatch":true,"sender":{"key":"worldhello.net@gmail.com","avatar":"https://avatars.githubusercontent.com/u/183860?v=4"},"body":"Signed-off-by: Jiang Xin <worldhello.net@gmail.com>\n---\n git-rebase.sh | 58 ++++++++++++++++++++++++++++++----------------------------\n 1 file changed, 30 insertions(+), 28 deletions(-)\n\ndiff --git a/git-rebase.sh b/git-rebase.sh\nindex 1cd06..df5998 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@@ -72,11 +73,11 @@ cd_to_toplevel\n LF='\n '\n ok_to_skip_pre_rebase=\n-resolvemsg=\"\n+resolvemsg=\"$(gettext \"\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-\"\n+\")\"\n unset onto\n cmd=\n strategy=\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,16 @@ 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+\tstate_dir_base=${state_dir##*/}\n+\tdie \"$(eval_gettext \"\n+It seems that there is already a \\$state_dir_base directory, and\n I wonder if you are in the middle of another rebase.  If that is the\n case, please try\n \tgit rebase (--continue | --abort | --skip)\n If that is not the case, please\n-\trm -fr '\"$state_dir\"'\n+\trm -fr \\\"\\$state_dir\\\"\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 +415,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 +439,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 +474,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@@ -488,11 +490,11 @@ case \"$#\" in\n \torig_head=$(git rev-parse --verify \"${branch_name}^0\") || exit\n \t;;\n *)\n-\tdie \"BUG: unexpected number of arguments left to parse\"\n+\tdie \"$(gettext \"BUG: unexpected number of arguments left to parse\")\"\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 +512,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 +526,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 +535,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 +543,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\n-- \n1.7.11.2.259.g37fc0e1\n"},{"id":"195427","messageId":"b3d82ce0b35597c90bf8280f38a5b336066cea18.1342920089.git.worldhello.net@gmail.com","threadId":"31062","inReplyTo":"724ca3989123159c9970b3276b4764dcbd5fd56e.1342920089.git.worldhello.net@gmail.com","subject":"[PATCH v2 3/7] i18n: Rewrite gettext messages start with dash","fromName":"Jiang Xin","fromEmail":"worldhello.net@gmail.com","sentAt":"2012-07-22T01:26:07Z","receivedAt":"2012-07-22T01:26:07Z","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>\nSigned-off-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 df5998..640af 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 5629d..57f98 100755\n--- a/git-submodule.sh\n+++ b/git-submodule.sh\n@@ -746,7 +746,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.11.2.259.g37fc0e1\n"},{"id":"195428","messageId":"16d740e2d6e38e1ce8f3770f506623068b1cf309.1342920089.git.worldhello.net@gmail.com","threadId":"31062","inReplyTo":"b3d82ce0b35597c90bf8280f38a5b336066cea18.1342920089.git.worldhello.net@gmail.com","subject":"[PATCH v2 4/7] Remove obsolete LONG_USAGE which breaks xgettext","fromName":"Jiang Xin","fromEmail":"worldhello.net@gmail.com","sentAt":"2012-07-22T01:26:08Z","receivedAt":"2012-07-22T01:26:08Z","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>\nSigned-off-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 640af..02c63 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.11.2.259.g37fc0e1\n"},{"id":"195429","messageId":"247c407ce218c77a603eb6cf93228d94adc48f04.1342920089.git.worldhello.net@gmail.com","threadId":"31062","inReplyTo":"16d740e2d6e38e1ce8f3770f506623068b1cf309.1342920089.git.worldhello.net@gmail.com","subject":"[PATCH v2 5/7] i18n: am: mark more strings for translation","fromName":"Jiang Xin","fromEmail":"worldhello.net@gmail.com","sentAt":"2012-07-22T01:26:09Z","receivedAt":"2012-07-22T01:26:09Z","isPatch":true,"sender":{"key":"worldhello.net@gmail.com","avatar":"https://avatars.githubusercontent.com/u/183860?v=4"},"body":"Mark additional 3 strings for translation, and reduce one indentation\nlevel for one gettextln clause introduced in commit de88c1c.\n\nSigned-off-by: Jiang Xin <worldhello.net@gmail.com>\nSigned-off-by: Stefano Lattarini <stefano.lattarini@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 b6a53..20c1a 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\techo >&2 $(gettext \"The -b 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.11.2.259.g37fc0e1\n"},{"id":"195431","messageId":"4cf7af65d3f14f61d165fa971e3784d4553d030b.1342920089.git.worldhello.net@gmail.com","threadId":"31062","inReplyTo":"247c407ce218c77a603eb6cf93228d94adc48f04.1342920089.git.worldhello.net@gmail.com","subject":"[PATCH v2 6/7] Remove unused and bad gettext block from git-am","fromName":"Jiang Xin","fromEmail":"worldhello.net@gmail.com","sentAt":"2012-07-22T01:26:10Z","receivedAt":"2012-07-22T01:26:10Z","isPatch":true,"sender":{"key":"worldhello.net@gmail.com","avatar":"https://avatars.githubusercontent.com/u/183860?v=4"},"body":"Gettext message should not start with '-' nor '--'. Since the '-d' and\n'--dotest' options do not exist in OPTIONS_SPEC variable, it's safe to\nremove the block.\n\nSigned-off-by: Jiang Xin <worldhello.net@gmail.com>\nSigned-off-by: Stefano Lattarini <stefano.lattarini@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 20c1a..cfa63 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.11.2.259.g37fc0e1\n"},{"id":"195430","messageId":"11b679b77fb9e30b8ea29c3e8a76e711d969377a.1342920089.git.worldhello.net@gmail.com","threadId":"31062","inReplyTo":"4cf7af65d3f14f61d165fa971e3784d4553d030b.1342920089.git.worldhello.net@gmail.com","subject":"[PATCH v2 7/7] i18n: merge-recursive: mark strings for translation","fromName":"Jiang Xin","fromEmail":"worldhello.net@gmail.com","sentAt":"2012-07-22T01:26:11Z","receivedAt":"2012-07-22T01:26:11Z","isPatch":true,"sender":{"key":"worldhello.net@gmail.com","avatar":"https://avatars.githubusercontent.com/u/183860?v=4"},"body":"Signed-off-by: Jiang Xin <worldhello.net@gmail.com>\n---\n merge-recursive.c | 152 +++++++++++++++++++++++++++++-------------------------\n 1 file changed, 81 insertions(+), 71 deletions(-)\n\ndiff --git a/merge-recursive.c b/merge-recursive.c\nindex 68093..d0167 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@@ -249,14 +249,14 @@ struct tree *write_tree_from_memory(struct merge_options *o)\n \n \tif (unmerged_cache()) {\n \t\tint i;\n-\t\tfprintf(stderr, \"BUG: There are unmerged index entries:\\n\");\n+\t\tfprintf(stderr, _(\"BUG: There are unmerged index entries:\\n\"));\n \t\tfor (i = 0; i < active_nr; i++) {\n \t\t\tstruct cache_entry *ce = active_cache[i];\n \t\t\tif (ce_stage(ce))\n \t\t\t\tfprintf(stderr, \"BUG: %d %.*s\\n\", ce_stage(ce),\n \t\t\t\t\t(int)ce_namelen(ce), ce->name);\n \t\t}\n-\t\tdie(\"Bug in merge-recursive.c\");\n+\t\tdie(_(\"Bug in merge-recursive.c\"));\n \t}\n \n \tif (!active_cache_tree)\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 (NULL == 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 (NULL == 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 }\n-- \n1.7.11.2.259.g37fc0e1\n"},{"id":"195452","messageId":"7vhaszr31r.fsf@alter.siamese.dyndns.org","threadId":"31062","inReplyTo":"724ca3989123159c9970b3276b4764dcbd5fd56e.1342920089.git.worldhello.net@gmail.com","subject":"Re: [PATCH v2 2/7] i18n: rebase: mark strings for translation","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2012-07-22T19:04:07Z","receivedAt":"2012-07-22T19:04:07Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Jiang Xin <worldhello.net@gmail.com> writes:\n\n> -resolvemsg=\"\n> +resolvemsg=\"$(gettext \"\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> -\"\n> +\")\"\n\nTwo micronits:\n\n - A=\"B\" assignment can lose the outermost dq-pair around it\n   (i.e. A=B), which might make the above easier to read.\n\n - The original message had to backslash-quote only because the\n   outermost quote was done with a dq-pair, but it does not use any\n   substitutions, so turning it into a sq-pair might make the above\n   easier to read.\n\nWith \"might\", I am not saying the above should be _fixed_; I am\nmerely saying we may want to consider these points to see if some\nchanges to your patch are improvements.\n\n    resolvemsg=$(gettext '\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    ')\n\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\nThis is a related tangent, but have we resolved that issue with\nxgettext and \"--\"?\n\nAhh, I see you did something in [3/7] ;-)\n\nThanks.\n"},{"id":"195453","messageId":"7vboj7r31p.fsf@alter.siamese.dyndns.org","threadId":"31062","inReplyTo":"11b679b77fb9e30b8ea29c3e8a76e711d969377a.1342920089.git.worldhello.net@gmail.com","subject":"Re: [PATCH v2 7/7] i18n: merge-recursive: mark strings for translation","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2012-07-22T19:37:54Z","receivedAt":"2012-07-22T19:37:54Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Jiang Xin <worldhello.net@gmail.com> writes:\n\n> @@ -249,14 +249,14 @@ struct tree *write_tree_from_memory(struct merge_options *o)\n>  \n>  \tif (unmerged_cache()) {\n>  \t\tint i;\n> -\t\tfprintf(stderr, \"BUG: There are unmerged index entries:\\n\");\n> +\t\tfprintf(stderr, _(\"BUG: There are unmerged index entries:\\n\"));\n\nMicronit. \"BUG:\" entries are only to help Git developers to locate\nthe exact codepath that is buggy, and I think it is better left\nuntranslated.\n\n> +\t\tif (NULL == renamed) {\n\nBetter written as \"if (!renamed)\".\n"},{"id":"195451","messageId":"7vmx2rr320.fsf@alter.siamese.dyndns.org","threadId":"31062","inReplyTo":"cover.1342920089.git.worldhello.net@gmail.com","subject":"Re: [PATCH v2 0/7] i18n for git-am, git-rebase and git-merge","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2012-07-22T19:47:19Z","receivedAt":"2012-07-22T19:47:19Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Jiang Xin <worldhello.net@gmail.com> writes:\n\n> Mark strings in git-am, git-rebase, and git-merge for translation.\n> And contain fixes for shell gettext extraction and xgettext workaround.\n>\n> Jiang Xin (7):\n>   i18n: New keywords for xgettext extraction from sh\n>   i18n: rebase: mark strings 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 unused and bad gettext block from git-am\n>   i18n: merge-recursive: mark strings for translation\n\nI do not understand why many of these have Stefano's S-o-b in them.\nIf you are relaying what Stefano originally wrote, then the author\n(i.e. \"From: \") and the first S-o-b would say Stefano, and your\nS-o-b will follow it, but that is probably not the case.\n\nI'll drop the S-o-b lines for now.\n\nBy the way, is there any existing test that needs to gain GETTEXT_POISON\nor test_i18ncmp with this change?\n"},{"id":"195472","messageId":"CANYiYbFvk60NxfOTxq-xS8vt5t9xW8HLQrE_GuHGkC+u6vWfsw@mail.gmail.com","threadId":"31062","inReplyTo":"7vmx2rr320.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH v2 0/7] i18n for git-am, git-rebase and git-merge","fromName":"Jiang Xin","fromEmail":"worldhello.net@gmail.com","sentAt":"2012-07-23T03:14:17Z","receivedAt":"2012-07-23T03:14:17Z","isPatch":true,"sender":{"key":"worldhello.net@gmail.com","avatar":"https://avatars.githubusercontent.com/u/183860?v=4"},"body":"2012/7/23 Junio C Hamano <gitster@pobox.com>:\n> I do not understand why many of these have Stefano's S-o-b in them.\n> If you are relaying what Stefano originally wrote, then the author\n> (i.e. \"From: \") and the first S-o-b would say Stefano, and your\n> S-o-b will follow it, but that is probably not the case.\n> I'll drop the S-o-b lines for now.\n\nIt is because Stefano offers lots of help for correcting syntax errors\nand misspellings in the original commit logs. Should I use Reviewed-by\ntag instead of S-o-b?\n\nAnd in PATCH 3/7, there is a Ævar's S-o-b, it is because the workaround\ncomes from Ævar's idea. Is this tag suitable? I think I should add a Reported-by\ntag for Vincent, as he report it first in this mail:\n\n    http://thread.gmane.org/gmane.comp.version-control.git/199042\n\n> By the way, is there any existing test that needs to gain GETTEXT_POISON\n> or test_i18ncmp with this change?\n\nI find one test case failed, and correct it in PATCH 3/7.\n\n-- \nJiang Xin\n"},{"id":"195487","messageId":"7v4nozozz0.fsf@alter.siamese.dyndns.org","threadId":"31062","inReplyTo":"CANYiYbFvk60NxfOTxq-xS8vt5t9xW8HLQrE_GuHGkC+u6vWfsw@mail.gmail.com","subject":"Re: [PATCH v2 0/7] i18n for git-am, git-rebase and git-merge","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2012-07-23T04:36:51Z","receivedAt":"2012-07-23T04:36:51Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Jiang Xin <worldhello.net@gmail.com> writes:\n\n> 2012/7/23 Junio C Hamano <gitster@pobox.com>:\n>> I do not understand why many of these have Stefano's S-o-b in them.\n>> If you are relaying what Stefano originally wrote, then the author\n>> (i.e. \"From: \") and the first S-o-b would say Stefano, and your\n>> S-o-b will follow it, but that is probably not the case.\n>> I'll drop the S-o-b lines for now.\n>\n> It is because Stefano offers lots of help for correcting syntax errors\n> and misspellings in the original commit logs. Should I use Reviewed-by\n> tag instead of S-o-b?\n\nYeah, I guessed that you meant reviewed-by.\n\n> And in PATCH 3/7, there is a Ævar's S-o-b, it is because the workaround\n> comes from Ævar's idea.\n\nThis one I remember the previous round, so didn't have any problem.\n\n>> By the way, is there any existing test that needs to gain GETTEXT_POISON\n>> or test_i18ncmp with this change?\n>\n> I find one test case failed, and correct it in PATCH 3/7.\n\nThat test used i18ncmp already, so the update to expected string\nwould be sufficient.  I was worried if there were existing tests\nthat have been expecting that the output from am/rebase/merge would\nnot be i18n'ised and using \"test_cmp expect actual\" to compare their\noutput with expected result.\n"},{"id":"195511","messageId":"CANYiYbGyDcR-y-JG5sPLVx0vfc9P+rQerF5ME2nkQ=0FyQB4xw@mail.gmail.com","threadId":"31062","inReplyTo":"7v4nozozz0.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH v2 0/7] i18n for git-am, git-rebase and git-merge","fromName":"Jiang Xin","fromEmail":"worldhello.net@gmail.com","sentAt":"2012-07-23T07:32:04Z","receivedAt":"2012-07-23T07:32:04Z","isPatch":true,"sender":{"key":"worldhello.net@gmail.com","avatar":"https://avatars.githubusercontent.com/u/183860?v=4"},"body":"2012/7/23 Junio C Hamano <gitster@pobox.com>:\n>> I find one test case failed, and correct it in PATCH 3/7.\n>\n> That test used i18ncmp already, so the update to expected string\n> would be sufficient.  I was worried if there were existing tests\n> that have been expecting that the output from am/rebase/merge would\n> not be i18n'ised and using \"test_cmp expect actual\" to compare their\n> output with expected result.\n\nIf build git with GETTEXT_POISON and test, lots of test cases failed.\nIt seems that we haven't run these test cases for i18n for a long time.\n\ntest of t0006-date.sh failed, because of i18n in commit 7d29af.\n\n    7d29a i18n: mark relative dates for translation\n\ntest of t0040-parse-options.sh failed, because of i18n in commit 54e6dc7:\n\n    54e6d i18n: parseopt: lookup help and argument translations when\nshowing usage\n\nI will try to fix them in next version of the patches.\n\nTest Summary Report\n-------------------\n./t0006-date.sh                                    (Wstat: 256 Tests:\n45 Failed: 11)\n  Failed tests:  1-11\n  Non-zero exit status: 1\n./t0050-filesystem.sh                              (Wstat: 0 Tests: 10\nFailed: 0)\n  TODO passed:   6\n./t0040-parse-options.sh                           (Wstat: 256 Tests:\n36 Failed: 4)\n  Failed tests:  1, 11-12, 27\n  Non-zero exit status: 1\n./t1502-rev-parse-parseopt.sh                      (Wstat: 256 Tests:\n8 Failed: 1)\n  Failed test:  1\n  Non-zero exit status: 1\n./t1450-fsck.sh                                    (Wstat: 256 Tests:\n16 Failed: 1)\n  Failed test:  13\n  Non-zero exit status: 1\n./t1300-repo-config.sh                             (Wstat: 256 Tests:\n104 Failed: 1)\n  Failed test:  48\n  Non-zero exit status: 1\n./t2006-checkout-index-basic.sh                    (Wstat: 256 Tests:\n2 Failed: 2)\n  Failed tests:  1-2\n  Non-zero exit status: 1\n./t2107-update-index-basic.sh                      (Wstat: 256 Tests:\n3 Failed: 1)\n  Failed test:  2\n  Non-zero exit status: 1\n./t3004-ls-files-basic.sh                          (Wstat: 256 Tests:\n4 Failed: 2)\n  Failed tests:  3-4\n  Non-zero exit status: 1\n./t3200-branch.sh                                  (Wstat: 256 Tests:\n82 Failed: 2)\n  Failed tests:  3, 10\n  Non-zero exit status: 1\n./t3406-rebase-message.sh                          (Wstat: 256 Tests:\n6 Failed: 1)\n  Failed test:  6\n  Non-zero exit status: 1\n./t3400-rebase.sh                                  (Wstat: 256 Tests:\n26 Failed: 4)\n  Failed tests:  5-8\n  Non-zero exit status: 1\n./t3501-revert-cherry-pick.sh                      (Wstat: 256 Tests:\n7 Failed: 2)\n  Failed tests:  2-3\n  Non-zero exit status: 1\n./t4006-diff-mode.sh                               (Wstat: 256 Tests:\n7 Failed: 4)\n  Failed tests:  4-7\n  Non-zero exit status: 1\n./t4012-diff-binary.sh                             (Wstat: 256 Tests:\n13 Failed: 2)\n  Failed tests:  7-8\n  Non-zero exit status: 1\n./t4035-diff-quiet.sh                              (Wstat: 256 Tests:\n20 Failed: 3)\n  Failed tests:  16, 18, 20\n  Non-zero exit status: 1\n./t4120-apply-popt.sh                              (Wstat: 256 Tests:\n8 Failed: 2)\n  Failed tests:  3, 5\n  Non-zero exit status: 1\n./t4133-apply-filenames.sh                         (Wstat: 256 Tests:\n2 Failed: 1)\n  Failed test:  2\n  Non-zero exit status: 1\n./t4200-rerere.sh                                  (Wstat: 256 Tests:\n25 Failed: 2)\n  Failed tests:  24-25\n  Non-zero exit status: 1\n./t4205-log-pretty-formats.sh                      (Wstat: 256 Tests:\n13 Failed: 1)\n  Failed test:  12\n  Non-zero exit status: 1\n./t4202-log.sh                                     (Wstat: 256 Tests:\n33 Failed: 1)\n  Failed test:  33\n  Non-zero exit status: 1\n./t3903-stash.sh                                   (Wstat: 256 Tests:\n46 Failed: 1)\n  Failed test:  45\n  Non-zero exit status: 1\n./t5300-pack-object.sh                             (Wstat: 256 Tests:\n33 Failed: 2)\n  Failed tests:  32-33\n  Non-zero exit status: 1\n./t5505-remote.sh                                  (Wstat: 256 Tests:\n68 Failed: 9)\n  Failed tests:  2-3, 6-9, 13, 15, 46\n  Non-zero exit status: 1\n./t5530-upload-pack-error.sh                       (Wstat: 256 Tests:\n10 Failed: 1)\n  Failed test:  3\n  Non-zero exit status: 1\n./t6500-gc.sh                                      (Wstat: 256 Tests:\n3 Failed: 2)\n  Failed tests:  2-3\n  Non-zero exit status: 1\n./t6042-merge-rename-corner-cases.sh               (Wstat: 256 Tests:\n26 Failed: 1)\n  Failed test:  18\n  Non-zero exit status: 1\n./t6022-merge-rename.sh                            (Wstat: 256 Tests:\n46 Failed: 3)\n  Failed tests:  12, 15-16\n  Non-zero exit status: 1\n./t7008-grep-binary.sh                             (Wstat: 0 Tests: 20\nFailed: 0)\n  TODO passed:   12\n./t7508-status.sh                                  (Wstat: 256 Tests:\n76 Failed: 1)\n  Failed test:  5\n  Non-zero exit status: 1\n./t7600-merge.sh                                   (Wstat: 256 Tests:\n48 Failed: 1)\n  Failed test:  3\n  Non-zero exit status: 1\n./t9903-bash-prompt.sh                             (Wstat: 256 Tests:\n44 Failed: 6)\n  Failed tests:  6, 8, 12-15\n  Non-zero exit status: 1\nFiles=595, Tests=8548, 739 wallclock secs ( 5.05 usr  2.11 sys +\n362.59 cusr 466.00 csys = 835.75 CPU)\nResult: FAIL\n\n-- \nJiang Xin\n"},{"id":"195513","messageId":"CACsJy8Ay+iCdSfTA7znXQLWHYg11Qyjt66P21KQLPxu0pEG-+Q@mail.gmail.com","threadId":"31062","inReplyTo":"CANYiYbGyDcR-y-JG5sPLVx0vfc9P+rQerF5ME2nkQ=0FyQB4xw@mail.gmail.com","subject":"Re: [PATCH v2 0/7] i18n for git-am, git-rebase and git-merge","fromName":"Nguyen Thai Ngoc Duy","fromEmail":"pclouds@gmail.com","sentAt":"2012-07-23T07:38:34Z","receivedAt":"2012-07-23T07:38:34Z","isPatch":true,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"On Mon, Jul 23, 2012 at 2:32 PM, Jiang Xin <worldhello.net@gmail.com> wrote:\n> If build git with GETTEXT_POISON and test, lots of test cases failed.\n> It seems that we haven't run these test cases for i18n for a long time.\n\nGaah.. I should have resent the poison-fix series but so far\nprocrastination is winning. Will do it soon.\n-- \nDuy\n"},{"id":"195517","messageId":"CANYiYbEqkP950QsQjtzZDQ-GXU9fmDRLAaJsYegsRz7i7HFRuA@mail.gmail.com","threadId":"31062","inReplyTo":"CACsJy8Ay+iCdSfTA7znXQLWHYg11Qyjt66P21KQLPxu0pEG-+Q@mail.gmail.com","subject":"Re: [PATCH v2 0/7] i18n for git-am, git-rebase and git-merge","fromName":"Jiang Xin","fromEmail":"worldhello.net@gmail.com","sentAt":"2012-07-23T08:01:49Z","receivedAt":"2012-07-23T08:01:49Z","isPatch":true,"sender":{"key":"worldhello.net@gmail.com","avatar":"https://avatars.githubusercontent.com/u/183860?v=4"},"body":"2012/7/23 Nguyen Thai Ngoc Duy <pclouds@gmail.com>:\n> On Mon, Jul 23, 2012 at 2:32 PM, Jiang Xin <worldhello.net@gmail.com> wrote:\n>> If build git with GETTEXT_POISON and test, lots of test cases failed.\n>> It seems that we haven't run these test cases for i18n for a long time.\n>\n> Gaah.. I should have resent the poison-fix series but so far\n> procrastination is winning. Will do it soon.\n\nSo, I will just try to fix what I am responsible for\u0010.\n\n-- \nJiang Xin\n"}]}