{"thread":{"id":"42641","subject":"[PATCH v5 00/38] i18n and test updates","startedAt":"2016-06-17T20:23:48Z","lastAt":"2016-06-17T22:29:55Z","messageCount":41,"participants":["Vasco Almeida","Junio C Hamano"],"isPatch":true,"patchVersion":5,"patchTotal":38},"messages":[{"id":"289471","messageId":"1466194887-18236-1-git-send-email-vascomalmeida@sapo.pt","threadId":"42641","inReplyTo":null,"subject":"[PATCH v5 00/38] i18n and test updates","fromName":"Vasco Almeida","fromEmail":"vascomalmeida@sapo.pt","sentAt":"2016-06-17T20:20:49Z","receivedAt":"2016-06-17T20:23:48Z","isPatch":true,"sender":{"key":"vascomalmeida@sapo.pt","avatar":"https://avatars.githubusercontent.com/u/9001556?v=4"},"body":"Marks several messages for translation and updates tests to pass under\nGETTEXT_POISON. Some tests were updated to fit previous i18n marks, others\nwere updated to fit marks made by these patches. Patches that only touch\ntest file refer to marks done in commits previous to these ones.\n\n\"[PATCH v5 34/38] i18n: init-db: join message pieces\" now updates Icelandic\ntranslation to pass test t0204-gettext-reencode-sanity.sh.\nThat failure went unnoticed because my system did not have the Icelandic\nlocale installed at that time.\nI have only tested with UTF-8 but expect to also pass the ISO-8859-1 locale\nsince the translated strings are the same.\n\nIn order to pass the tests, this series depended upon commit fe17fc0\n(\"t2300: run git-sh-setup in an environment that better mimics the real\nlife\", 2016-06-01) which was previously on 'next' branch, but now it has\ngraduated to 'master'.\n\nInterdiff included below.\n\nVasco Almeida (38):\n  i18n: builtin/remote.c: fix mark for translation\n  i18n: advice: mark string about detached head for translation\n  i18n: advice: internationalize message for conflicts\n  i18n: transport: mark strings for translation\n  i18n: sequencer: mark entire sentences for translation\n  i18n: sequencer: mark string for translation\n  i18n: merge-octopus: mark messages for translation\n  merge-octupus: use die shell function from git-sh-setup.sh\n  i18n: rebase: fix marked string to use eval_gettext variant\n  i18n: rebase: mark placeholder for translation\n  i18n: bisect: simplify error message for i18n\n  t6030: update to use test_i18ncmp\n  i18n: git-sh-setup.sh: mark strings for translation\n  i18n: rebase-interactive: mark strings for translation\n  i18n: rebase-interactive: mark here-doc strings for translation\n  i18n: rebase-interactive: mark comments of squash for translation\n  i18n: setup: mark strings for translation\n  tests: use test_i18n* functions to suppress false positives\n  tests: unpack-trees: update to use test_i18n* functions\n  t9003: become resilient to GETTEXT_POISON\n  t4153: fix negated test_i18ngrep call\n  t5523: use test_i18ngrep for negation\n  i18n: bisect: mark strings for translation\n  i18n: transport-helper.c: change N_() call to _()\n  i18n: notes: mark strings for translation\n  i18n: notes: mark options for translation\n  i18n: config: unfold error messages marked for translation\n  i18n: merge: mark messages for translation\n  i18n: merge: change command option help to lowercase\n  i18n: sequencer: add period to error message\n  i18n: standardise messages\n  i18n: remote: mark URL fallback text for translation\n  i18n: remote: allow translations to reorder message\n  i18n: init-db: join message pieces\n  i18n: submodule: join strings marked for translation\n  i18n: submodule: escape shell variables inside eval_gettext\n  i18n: unmark die messages for translation\n  i18n: branch: mark comment when editing branch description for\n    translation\n\n Makefile                              |   5 +-\n advice.c                              |  23 ++-\n bisect.c                              |  56 ++++---\n builtin/apply.c                       |   6 +-\n builtin/branch.c                      |   6 +-\n builtin/checkout.c                    |   6 +-\n builtin/init-db.c                     |  17 +-\n builtin/merge.c                       |  12 +-\n builtin/notes.c                       |  24 +--\n builtin/pull.c                        |   2 +-\n builtin/remote.c                      |  19 ++-\n builtin/repack.c                      |   2 +-\n cache.h                               |   9 +-\n config.c                              | 101 ++++++++++--\n git-bisect.sh                         |   8 +-\n git-merge-octopus.sh                  |  23 ++-\n git-rebase--interactive.sh            | 290 ++++++++++++++++++++--------------\n git-rebase.sh                         |   5 +-\n git-sh-i18n.sh                        |  18 +++\n git-sh-setup.sh                       |  63 ++++++--\n git-stash.sh                          |   1 -\n git-submodule.sh                      |  23 +--\n po/is.po                              |  46 +++---\n sequencer.c                           |  15 +-\n setup.c                               |  16 +-\n submodule-config.c                    |   2 +-\n t/lib-rebase.sh                       |   1 +\n t/t0008-ignores.sh                    |   4 +-\n t/t1011-read-tree-sparse-checkout.sh  |   2 +-\n t/t1300-repo-config.sh                |   8 +-\n t/t1307-config-blob.sh                |   5 +-\n t/t1308-config-set.sh                 |   4 +-\n t/t1400-update-ref.sh                 |   2 +-\n t/t1506-rev-parse-diagnosis.sh        |   2 +-\n t/t2010-checkout-ambiguous.sh         |   2 +-\n t/t2018-checkout-branch.sh            |   2 +-\n t/t3200-branch.sh                     |   6 +-\n t/t3201-branch-contains.sh            |   2 +-\n t/t3310-notes-merge-manual-resolve.sh |   8 +-\n t/t3320-notes-merge-worktrees.sh      |   4 +-\n t/t3400-rebase.sh                     |   4 +-\n t/t3404-rebase-interactive.sh         |  18 +--\n t/t4153-am-resume-override-opts.sh    |   2 +-\n t/t4208-log-magic-pathspec.sh         |   4 +-\n t/t5505-remote.sh                     |   2 +-\n t/t5510-fetch.sh                      |   2 +-\n t/t5520-pull.sh                       |   2 +-\n t/t5523-push-upstream.sh              |  12 +-\n t/t5536-fetch-conflicts.sh            |   4 +-\n t/t6030-bisect-porcelain.sh           |  26 +--\n t/t6301-for-each-ref-errors.sh        |  10 +-\n t/t7063-status-untracked-cache.sh     |   2 +-\n t/t7102-reset.sh                      |   4 +-\n t/t7201-co.sh                         |   2 +-\n t/t7400-submodule-basic.sh            |   2 +-\n t/t7403-submodule-sync.sh             |   4 +-\n t/t7406-submodule-update.sh           |  10 +-\n t/t7508-status.sh                     |   4 +-\n t/t7607-merge-overwrite.sh            |   2 +-\n t/t9003-help-autocorrect.sh           |   4 +-\n transport-helper.c                    |   2 +-\n transport.c                           |  20 +--\n wt-status.c                           |   4 +-\n 63 files changed, 604 insertions(+), 392 deletions(-)\n\n---- >8 ----\ndiff --git a/po/is.po b/po/is.po\nindex 8692a8b..b8b34fd 100644\n--- a/po/is.po\n+++ b/po/is.po\n@@ -7,14 +7,15 @@ msgid \"\"\n msgstr \"\"\n \"Project-Id-Version: Git\\n\"\n \"Report-Msgid-Bugs-To: Git Mailing List <git@vger.kernel.org>\\n\"\n-\"POT-Creation-Date: 2010-09-20 14:44+0000\\n\"\n-\"PO-Revision-Date: 2010-06-05 19:06 +0000\\n\"\n-\"Last-Translator: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\\n\"\n+\"POT-Creation-Date: 2016-06-17 18:55+0000\\n\"\n+\"PO-Revision-Date: 2016-06-17 19:17+0000\\n\"\n+\"Last-Translator: Vasco Almeida <vascomalmeida@sapo.pt>\\n\"\n \"Language-Team: Git Mailing List <git@vger.kernel.org>\\n\"\n \"Language: is\\n\"\n \"MIME-Version: 1.0\\n\"\n \"Content-Type: text/plain; charset=UTF-8\\n\"\n \"Content-Transfer-Encoding: 8bit\\n\"\n+\"X-Generator: Poedit 1.8.5\\n\"\n \n #. TRANSLATORS: This is a test. You don't need to translate it.\n #: t/t0200/test.c:5\n@@ -72,22 +73,31 @@ msgstr \"TILRAUN: Perl tilraunastrengur\"\n msgid \"TEST: A Perl test variable %s\"\n msgstr \"TILRAUN: Perl tilraunastrengur með breytunni %s\"\n \n-#. TRANSLATORS: The first '%s' is either \"Reinitialized\n-#. existing\" or \"Initialized empty\", the second \" shared\" or\n-#. \"\", and the last '%s%s' is the verbatim directory name.\n-#: builtin/init-db.c:355\n+#: builtin/init-db.c:402\n #, c-format\n-msgid \"%s%s Git repository in %s%s\\n\"\n-msgstr \"%s%s Git lind í %s%s\\n\"\n+msgid \"Reinitialized existing shared Git repository in %s%s\\n\"\n+msgstr \"Endurgerði Git lind í %s%s\\n\"\n \n-#: builtin/init-db.c:356\n-msgid \"Reinitialized existing\"\n-msgstr \"Endurgerði\"\n+#: builtin/init-db.c:403\n+#, c-format\n+msgid \"Reinitialized existing Git repository in %s%s\\n\"\n+msgstr \"Endurgerði Git lind í %s%s\\n\"\n+\n+#: builtin/init-db.c:407\n+#, c-format\n+msgid \"Initialized empty shared Git repository in %s%s\\n\"\n+msgstr \"Bjó til tóma sameiginlega Git lind í %s%s\\n\"\n+\n+#: builtin/init-db.c:408\n+#, c-format\n+msgid \"Initialized empty Git repository in %s%s\\n\"\n+msgstr \"Bjó til tóma Git lind í %s%s\\n\"\n+\n+#~ msgid \"Reinitialized existing\"\n+#~ msgstr \"Endurgerði\"\n \n-#: builtin/init-db.c:356\n-msgid \"Initialized empty\"\n-msgstr \"Bjó til tóma\"\n+#~ msgid \"Initialized empty\"\n+#~ msgstr \"Bjó til tóma\"\n \n-#: builtin/init-db.c:357\n-msgid \" shared\"\n-msgstr \" sameiginlega\"\n+#~ msgid \" shared\"\n+#~ msgstr \" sameiginlega\"\n---- >8 ----\n\n-- \n2.6.6\n\n"},{"id":"289472","messageId":"1466194887-18236-2-git-send-email-vascomalmeida@sapo.pt","threadId":"42641","inReplyTo":"1466194887-18236-1-git-send-email-vascomalmeida@sapo.pt","subject":"[PATCH v5 01/38] i18n: builtin/remote.c: fix mark for translation","fromName":"Vasco Almeida","fromEmail":"vascomalmeida@sapo.pt","sentAt":"2016-06-17T20:20:50Z","receivedAt":"2016-06-17T20:23:53Z","isPatch":true,"sender":{"key":"vascomalmeida@sapo.pt","avatar":"https://avatars.githubusercontent.com/u/9001556?v=4"},"body":"The second string inside _() was not being extracted for translation by\nxgettext, meaning that, although the string was passed to gettext, there\nwas no translation available.\n\nMark each individual string instead of marking the result of ternary if.\n\nSigned-off-by: Vasco Almeida <vascomalmeida@sapo.pt>\n---\n builtin/remote.c | 6 +++---\n 1 file changed, 3 insertions(+), 3 deletions(-)\n\ndiff --git a/builtin/remote.c b/builtin/remote.c\nindex d33766b..ae74da6 100644\n--- a/builtin/remote.c\n+++ b/builtin/remote.c\n@@ -963,9 +963,9 @@ static int show_local_info_item(struct string_list_item *item, void *cb_data)\n \n \tprintf(\"    %-*s \", show_info->width, item->string);\n \tif (branch_info->rebase) {\n-\t\tprintf_ln(_(branch_info->rebase == INTERACTIVE_REBASE ?\n-\t\t\t\"rebases interactively onto remote %s\" :\n-\t\t\t\"rebases onto remote %s\"), merge->items[0].string);\n+\t\tprintf_ln(branch_info->rebase == INTERACTIVE_REBASE\n+\t\t\t  ? _(\"rebases interactively onto remote %s\")\n+\t\t\t  : _(\"rebases onto remote %s\"), merge->items[0].string);\n \t\treturn 0;\n \t} else if (show_info->any_rebase) {\n \t\tprintf_ln(_(\" merges with remote %s\"), merge->items[0].string);\n-- \n2.6.6\n\n"},{"id":"289473","messageId":"1466194887-18236-3-git-send-email-vascomalmeida@sapo.pt","threadId":"42641","inReplyTo":"1466194887-18236-1-git-send-email-vascomalmeida@sapo.pt","subject":"[PATCH v5 02/38] i18n: advice: mark string about detached head for translation","fromName":"Vasco Almeida","fromEmail":"vascomalmeida@sapo.pt","sentAt":"2016-06-17T20:20:51Z","receivedAt":"2016-06-17T20:23:58Z","isPatch":true,"sender":{"key":"vascomalmeida@sapo.pt","avatar":"https://avatars.githubusercontent.com/u/9001556?v=4"},"body":"Mark string with advice seen by the user when in detached head.\n\nUpdate test t7201-co.sh to pass under GETTEXT_POISON build. Pretend\nsuccess if the number of lines of \"git checkout renamer^\" output is not\ngreater than 1 and test are running under GETTEXT_POISON.\n\nSigned-off-by: Vasco Almeida <vascomalmeida@sapo.pt>\n---\n advice.c      | 6 +++---\n t/t7201-co.sh | 2 +-\n 2 files changed, 4 insertions(+), 4 deletions(-)\n\ndiff --git a/advice.c b/advice.c\nindex 4dc5cf1..cb445a7 100644\n--- a/advice.c\n+++ b/advice.c\n@@ -106,14 +106,14 @@ void NORETURN die_conclude_merge(void)\n \n void detach_advice(const char *new_name)\n {\n-\tconst char fmt[] =\n-\t\"Note: checking out '%s'.\\n\\n\"\n+\tconst char *fmt =\n+\t_(\"Note: checking out '%s'.\\n\\n\"\n \t\"You are in 'detached HEAD' state. You can look around, make experimental\\n\"\n \t\"changes and commit them, and you can discard any commits you make in this\\n\"\n \t\"state without impacting any branches by performing another checkout.\\n\\n\"\n \t\"If you want to create a new branch to retain commits you create, you may\\n\"\n \t\"do so (now or later) by using -b with the checkout command again. Example:\\n\\n\"\n-\t\"  git checkout -b <new-branch-name>\\n\\n\";\n+\t\"  git checkout -b <new-branch-name>\\n\\n\");\n \n \tfprintf(stderr, fmt, new_name);\n }\ndiff --git a/t/t7201-co.sh b/t/t7201-co.sh\nindex 8859236..d4b217b 100755\n--- a/t/t7201-co.sh\n+++ b/t/t7201-co.sh\n@@ -257,7 +257,7 @@ test_expect_success 'checkout to detach HEAD' '\n \tgit checkout -f renamer && git clean -f &&\n \tgit checkout renamer^ 2>messages &&\n \ttest_i18ngrep \"HEAD is now at 7329388\" messages &&\n-\ttest_line_count -gt 1 messages &&\n+\t(test_line_count -gt 1 messages || test -n \"$GETTEXT_POISON\") &&\n \tH=$(git rev-parse --verify HEAD) &&\n \tM=$(git show-ref -s --verify refs/heads/master) &&\n \ttest \"z$H\" = \"z$M\" &&\n-- \n2.6.6\n\n"},{"id":"289474","messageId":"1466194887-18236-4-git-send-email-vascomalmeida@sapo.pt","threadId":"42641","inReplyTo":"1466194887-18236-1-git-send-email-vascomalmeida@sapo.pt","subject":"[PATCH v5 03/38] i18n: advice: internationalize message for conflicts","fromName":"Vasco Almeida","fromEmail":"vascomalmeida@sapo.pt","sentAt":"2016-06-17T20:20:52Z","receivedAt":"2016-06-17T20:24:05Z","isPatch":true,"sender":{"key":"vascomalmeida@sapo.pt","avatar":"https://avatars.githubusercontent.com/u/9001556?v=4"},"body":"Mark message for translation telling the user she has conflicts to\nresolve. Expose each particular use case, in order to enable translating\nentire sentences which would facilitate translating into other\nlanguages.\n\nChange \"Pull\" to lowercase to match other instances. Update test\nt5520-pull.sh, that relied on the old error message, to use the new one.\n\nAlthough we loose in source code conciseness, we would gain better\ntranslations because translators can 1) translate the entire sentence,\nincluding those terms concerning Git (committing, merging, etc) 2) have\nleeway to adapt to their languages.\n\nSigned-off-by: Vasco Almeida <vascomalmeida@sapo.pt>\n---\n advice.c        | 17 +++++++++++++++--\n builtin/pull.c  |  2 +-\n t/t5520-pull.sh |  2 +-\n 3 files changed, 17 insertions(+), 4 deletions(-)\n\ndiff --git a/advice.c b/advice.c\nindex cb445a7..b84ae49 100644\n--- a/advice.c\n+++ b/advice.c\n@@ -79,7 +79,20 @@ int git_default_advice_config(const char *var, const char *value)\n \n int error_resolve_conflict(const char *me)\n {\n-\terror(\"%s is not possible because you have unmerged files.\", me);\n+\tif (!strcmp(me, \"cherry-pick\"))\n+\t\terror(_(\"Cherry-picking is not possible because you have unmerged files.\"));\n+\telse if (!strcmp(me, \"commit\"))\n+\t\terror(_(\"Committing is not possible because you have unmerged files.\"));\n+\telse if (!strcmp(me, \"merge\"))\n+\t\terror(_(\"Merging is not possible because you have unmerged files.\"));\n+\telse if (!strcmp(me, \"pull\"))\n+\t\terror(_(\"Pulling is not possible because you have unmerged files.\"));\n+\telse if (!strcmp(me, \"revert\"))\n+\t\terror(_(\"Reverting is not possible because you have unmerged files.\"));\n+\telse\n+\t\terror(_(\"It is not possible to %s because you have unmerged files.\"),\n+\t\t\tme);\n+\n \tif (advice_resolve_conflict)\n \t\t/*\n \t\t * Message used both when 'git commit' fails and when\n@@ -93,7 +106,7 @@ int error_resolve_conflict(const char *me)\n void NORETURN die_resolve_conflict(const char *me)\n {\n \terror_resolve_conflict(me);\n-\tdie(\"Exiting because of an unresolved conflict.\");\n+\tdie(_(\"Exiting because of an unresolved conflict.\"));\n }\n \n void NORETURN die_conclude_merge(void)\ndiff --git a/builtin/pull.c b/builtin/pull.c\nindex 1d7333c..a980dcf 100644\n--- a/builtin/pull.c\n+++ b/builtin/pull.c\n@@ -852,7 +852,7 @@ int cmd_pull(int argc, const char **argv, const char *prefix)\n \tgit_config(git_pull_config, NULL);\n \n \tif (read_cache_unmerged())\n-\t\tdie_resolve_conflict(\"Pull\");\n+\t\tdie_resolve_conflict(\"pull\");\n \n \tif (file_exists(git_path(\"MERGE_HEAD\")))\n \t\tdie_conclude_merge();\ndiff --git a/t/t5520-pull.sh b/t/t5520-pull.sh\nindex 739c089..45e44ca 100755\n--- a/t/t5520-pull.sh\n+++ b/t/t5520-pull.sh\n@@ -211,7 +211,7 @@ test_expect_success 'fail if the index has unresolved entries' '\n \ttest -n \"$(git ls-files -u)\" &&\n \tcp file expected &&\n \ttest_must_fail git pull . second 2>err &&\n-\ttest_i18ngrep \"Pull is not possible because you have unmerged files\" err &&\n+\ttest_i18ngrep \"Pulling is not possible because you have unmerged files.\" err &&\n \ttest_cmp expected file &&\n \tgit add file &&\n \ttest -z \"$(git ls-files -u)\" &&\n-- \n2.6.6\n\n"},{"id":"289475","messageId":"1466194887-18236-5-git-send-email-vascomalmeida@sapo.pt","threadId":"42641","inReplyTo":"1466194887-18236-1-git-send-email-vascomalmeida@sapo.pt","subject":"[PATCH v5 04/38] i18n: transport: mark strings for translation","fromName":"Vasco Almeida","fromEmail":"vascomalmeida@sapo.pt","sentAt":"2016-06-17T20:20:53Z","receivedAt":"2016-06-17T20:24:10Z","isPatch":true,"sender":{"key":"vascomalmeida@sapo.pt","avatar":"https://avatars.githubusercontent.com/u/9001556?v=4"},"body":"Mark one printf string and one error string for translation.\n\nSigned-off-by: Vasco Almeida <vascomalmeida@sapo.pt>\n---\n transport.c | 20 ++++++++++----------\n 1 file changed, 10 insertions(+), 10 deletions(-)\n\ndiff --git a/transport.c b/transport.c\nindex 095e61f..59b911e 100644\n--- a/transport.c\n+++ b/transport.c\n@@ -59,7 +59,7 @@ static void set_upstreams(struct transport *transport, struct ref *refs,\n \t\t\t\tlocalname + 11, transport->remote->name,\n \t\t\t\tremotename);\n \t\telse\n-\t\t\tprintf(\"Would set upstream of '%s' to '%s' of '%s'\\n\",\n+\t\t\tprintf(_(\"Would set upstream of '%s' to '%s' of '%s'\\n\"),\n \t\t\t\tlocalname + 11, remotename + 11,\n \t\t\t\ttransport->remote->name);\n \t}\n@@ -148,7 +148,7 @@ static int set_git_option(struct git_transport_options *opts,\n \t\t\tchar *end;\n \t\t\topts->depth = strtol(value, &end, 0);\n \t\t\tif (*end)\n-\t\t\t\tdie(\"transport: invalid depth option '%s'\", value);\n+\t\t\t\tdie(_(\"transport: invalid depth option '%s'\"), value);\n \t\t}\n \t\treturn 0;\n \t}\n@@ -767,19 +767,19 @@ static void die_with_unpushed_submodules(struct string_list *needs_pushing)\n {\n \tint i;\n \n-\tfprintf(stderr, \"The following submodule paths contain changes that can\\n\"\n-\t\t\t\"not be found on any remote:\\n\");\n+\tfprintf(stderr, _(\"The following submodule paths contain changes that can\\n\"\n+\t\t\t\"not be found on any remote:\\n\"));\n \tfor (i = 0; i < needs_pushing->nr; i++)\n \t\tprintf(\"  %s\\n\", needs_pushing->items[i].string);\n-\tfprintf(stderr, \"\\nPlease try\\n\\n\"\n-\t\t\t\"\tgit push --recurse-submodules=on-demand\\n\\n\"\n-\t\t\t\"or cd to the path and use\\n\\n\"\n-\t\t\t\"\tgit push\\n\\n\"\n-\t\t\t\"to push them to a remote.\\n\\n\");\n+\tfprintf(stderr, _(\"\\nPlease try\\n\\n\"\n+\t\t\t  \"\tgit push --recurse-submodules=on-demand\\n\\n\"\n+\t\t\t  \"or cd to the path and use\\n\\n\"\n+\t\t\t  \"\tgit push\\n\\n\"\n+\t\t\t  \"to push them to a remote.\\n\\n\"));\n \n \tstring_list_clear(needs_pushing, 0);\n \n-\tdie(\"Aborting.\");\n+\tdie(_(\"Aborting.\"));\n }\n \n static int run_pre_push_hook(struct transport *transport,\n-- \n2.6.6\n\n"},{"id":"289476","messageId":"1466194887-18236-6-git-send-email-vascomalmeida@sapo.pt","threadId":"42641","inReplyTo":"1466194887-18236-1-git-send-email-vascomalmeida@sapo.pt","subject":"[PATCH v5 05/38] i18n: sequencer: mark entire sentences for translation","fromName":"Vasco Almeida","fromEmail":"vascomalmeida@sapo.pt","sentAt":"2016-06-17T20:20:54Z","receivedAt":"2016-06-17T20:24:15Z","isPatch":true,"sender":{"key":"vascomalmeida@sapo.pt","avatar":"https://avatars.githubusercontent.com/u/9001556?v=4"},"body":"Mark entire sentences of error message rather than assembling one using\nplaceholders (e.g. \"Cannot %s during a %s\").\n\nThat would facilitate translation work because it is easier to translate\na entire sentence than translating pieces. We would have better\ntranslations at the expense of source code verbosity.\n\nMoreover, translators can now 1) translate the terms \"revert\" and\n\"cherry-pick\" if they please 2) have more leeway to adapt their\ntranslations.\n\nSigned-off-by: Vasco Almeida <vascomalmeida@sapo.pt>\n---\n sequencer.c | 11 ++++++++---\n 1 file changed, 8 insertions(+), 3 deletions(-)\n\ndiff --git a/sequencer.c b/sequencer.c\nindex 4687ad4..88a7c78 100644\n--- a/sequencer.c\n+++ b/sequencer.c\n@@ -697,9 +697,14 @@ static struct commit *parse_insn_line(char *bol, char *eol, struct replay_opts *\n \t * opts; we don't support arbitrary instructions\n \t */\n \tif (action != opts->action) {\n-\t\tconst char *action_str;\n-\t\taction_str = action == REPLAY_REVERT ? \"revert\" : \"cherry-pick\";\n-\t\terror(_(\"Cannot %s during a %s\"), action_str, action_name(opts));\n+\t\tif (action == REPLAY_REVERT)\n+\t\t      error((opts->action == REPLAY_REVERT)\n+\t\t\t    ? _(\"Cannot revert during a another revert.\")\n+\t\t\t    : _(\"Cannot revert during a cherry-pick.\"));\n+\t\telse\n+\t\t      error((opts->action == REPLAY_REVERT)\n+\t\t\t    ? _(\"Cannot cherry-pick during a revert.\")\n+\t\t\t    : _(\"Cannot cherry-pick during another cherry-pick.\"));\n \t\treturn NULL;\n \t}\n \n-- \n2.6.6\n\n"},{"id":"289477","messageId":"1466194887-18236-7-git-send-email-vascomalmeida@sapo.pt","threadId":"42641","inReplyTo":"1466194887-18236-1-git-send-email-vascomalmeida@sapo.pt","subject":"[PATCH v5 06/38] i18n: sequencer: mark string for translation","fromName":"Vasco Almeida","fromEmail":"vascomalmeida@sapo.pt","sentAt":"2016-06-17T20:20:55Z","receivedAt":"2016-06-17T20:24:17Z","isPatch":true,"sender":{"key":"vascomalmeida@sapo.pt","avatar":"https://avatars.githubusercontent.com/u/9001556?v=4"},"body":"Mark informative string \"<action_name>: fast-forward\" for translation.\n\nSigned-off-by: Vasco Almeida <vascomalmeida@sapo.pt>\n---\n sequencer.c | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/sequencer.c b/sequencer.c\nindex 88a7c78..57b3671 100644\n--- a/sequencer.c\n+++ b/sequencer.c\n@@ -225,7 +225,7 @@ static int fast_forward_to(const unsigned char *to, const unsigned char *from,\n \tif (checkout_fast_forward(from, to, 1))\n \t\texit(128); /* the callee should have complained already */\n \n-\tstrbuf_addf(&sb, \"%s: fast-forward\", action_name(opts));\n+\tstrbuf_addf(&sb, _(\"%s: fast-forward\"), action_name(opts));\n \n \ttransaction = ref_transaction_begin(&err);\n \tif (!transaction ||\n-- \n2.6.6\n\n"},{"id":"289478","messageId":"1466194887-18236-8-git-send-email-vascomalmeida@sapo.pt","threadId":"42641","inReplyTo":"1466194887-18236-1-git-send-email-vascomalmeida@sapo.pt","subject":"[PATCH v5 07/38] i18n: merge-octopus: mark messages for translation","fromName":"Vasco Almeida","fromEmail":"vascomalmeida@sapo.pt","sentAt":"2016-06-17T20:20:56Z","receivedAt":"2016-06-17T20:24:22Z","isPatch":true,"sender":{"key":"vascomalmeida@sapo.pt","avatar":"https://avatars.githubusercontent.com/u/9001556?v=4"},"body":"Mark messages in git-merge-octopus.sh for translation.\n\nSigned-off-by: Vasco Almeida <vascomalmeida@sapo.pt>\n---\n git-merge-octopus.sh | 18 ++++++++++--------\n 1 file changed, 10 insertions(+), 8 deletions(-)\n\ndiff --git a/git-merge-octopus.sh b/git-merge-octopus.sh\nindex dc2fd1b..89e967a 100755\n--- a/git-merge-octopus.sh\n+++ b/git-merge-octopus.sh\n@@ -5,6 +5,8 @@\n # Resolve two or more trees.\n #\n \n+. git-sh-i18n\n+\n LF='\n '\n \n@@ -46,7 +48,7 @@ esac\n \n if ! git diff-index --quiet --cached HEAD --\n then\n-    echo \"Error: Your local changes to the following files would be overwritten by merge\"\n+    gettextln \"Error: Your local changes to the following files would be overwritten by merge\"\n     git diff-index --cached --name-only HEAD -- | sed -e 's/^/    /'\n     exit 2\n fi\n@@ -61,8 +63,8 @@ do\n \t\t# We allow only last one to have a hand-resolvable\n \t\t# conflicts.  Last round failed and we still had\n \t\t# a head to merge.\n-\t\techo \"Automated merge did not work.\"\n-\t\techo \"Should not be doing an Octopus.\"\n+\t\tgettextln \"Automated merge did not work.\"\n+\t\tgettextln \"Should not be doing an Octopus.\"\n \t\texit 2\n \tesac\n \n@@ -73,11 +75,11 @@ do\n \t\teval pretty_name=\\${GITHEAD_$SHA1_UP:-$pretty_name}\n \tfi\n \tcommon=$(git merge-base --all $SHA1 $MRC) ||\n-\t\tdie \"Unable to find common commit with $pretty_name\"\n+\t\tdie \"$(eval_gettext \"Unable to find common commit with \\$pretty_name\")\"\n \n \tcase \"$LF$common$LF\" in\n \t*\"$LF$SHA1$LF\"*)\n-\t\techo \"Already up-to-date with $pretty_name\"\n+\t\teval_gettextln \"Already up-to-date with \\$pretty_name\"\n \t\tcontinue\n \t\t;;\n \tesac\n@@ -89,7 +91,7 @@ do\n \t\t# tree as the intermediate result of the merge.\n \t\t# We still need to count this as part of the parent set.\n \n-\t\techo \"Fast-forwarding to: $pretty_name\"\n+\t\teval_gettextln \"Fast-forwarding to: \\$pretty_name\"\n \t\tgit read-tree -u -m $head $SHA1 || exit\n \t\tMRC=$SHA1 MRT=$(git write-tree)\n \t\tcontinue\n@@ -97,12 +99,12 @@ do\n \n \tNON_FF_MERGE=1\n \n-\techo \"Trying simple merge with $pretty_name\"\n+\teval_gettextln \"Trying simple merge with \\$pretty_name\"\n \tgit read-tree -u -m --aggressive  $common $MRT $SHA1 || exit 2\n \tnext=$(git write-tree 2>/dev/null)\n \tif test $? -ne 0\n \tthen\n-\t\techo \"Simple merge did not work, trying automatic merge.\"\n+\t\tgettextln \"Simple merge did not work, trying automatic merge.\"\n \t\tgit-merge-index -o git-merge-one-file -a ||\n \t\tOCTOPUS_FAILURE=1\n \t\tnext=$(git write-tree 2>/dev/null)\n-- \n2.6.6\n\n"},{"id":"289479","messageId":"1466194887-18236-9-git-send-email-vascomalmeida@sapo.pt","threadId":"42641","inReplyTo":"1466194887-18236-1-git-send-email-vascomalmeida@sapo.pt","subject":"[PATCH v5 08/38] merge-octupus: use die shell function from git-sh-setup.sh","fromName":"Vasco Almeida","fromEmail":"vascomalmeida@sapo.pt","sentAt":"2016-06-17T20:20:57Z","receivedAt":"2016-06-17T20:24:24Z","isPatch":true,"sender":{"key":"vascomalmeida@sapo.pt","avatar":"https://avatars.githubusercontent.com/u/9001556?v=4"},"body":"Source git-sh-setup in order to use die shell function from\ngit-sh-setup.sh library instead of using the one defined in\ngit-merge-octopus.sh. Remove the former die function.\n\nSigned-off-by: Vasco Almeida <vascomalmeida@sapo.pt>\n---\n git-merge-octopus.sh | 6 +-----\n 1 file changed, 1 insertion(+), 5 deletions(-)\n\ndiff --git a/git-merge-octopus.sh b/git-merge-octopus.sh\nindex 89e967a..d79fc84 100755\n--- a/git-merge-octopus.sh\n+++ b/git-merge-octopus.sh\n@@ -5,16 +5,12 @@\n # Resolve two or more trees.\n #\n \n+. git-sh-setup\n . git-sh-i18n\n \n LF='\n '\n \n-die () {\n-    echo >&2 \"$*\"\n-    exit 1\n-}\n-\n # The first parameters up to -- are merge bases; the rest are heads.\n bases= head= remotes= sep_seen=\n for arg\n-- \n2.6.6\n\n"},{"id":"289480","messageId":"1466194887-18236-10-git-send-email-vascomalmeida@sapo.pt","threadId":"42641","inReplyTo":"1466194887-18236-1-git-send-email-vascomalmeida@sapo.pt","subject":"[PATCH v5 09/38] i18n: rebase: fix marked string to use eval_gettext variant","fromName":"Vasco Almeida","fromEmail":"vascomalmeida@sapo.pt","sentAt":"2016-06-17T20:20:58Z","receivedAt":"2016-06-17T20:24:24Z","isPatch":true,"sender":{"key":"vascomalmeida@sapo.pt","avatar":"https://avatars.githubusercontent.com/u/9001556?v=4"},"body":"The string message marked for translation should use eval_gettext\nvariant instead of the gettext one, since we want to dollar-substitute\n$head_name in the result.\n\nSigned-off-by: Vasco Almeida <vascomalmeida@sapo.pt>\n---\n git-rebase.sh | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/git-rebase.sh b/git-rebase.sh\nindex 44ede36..1fadc04 100755\n--- a/git-rebase.sh\n+++ b/git-rebase.sh\n@@ -154,7 +154,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 \"$(gettext \"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 }\n-- \n2.6.6\n\n"},{"id":"289481","messageId":"1466194887-18236-13-git-send-email-vascomalmeida@sapo.pt","threadId":"42641","inReplyTo":"1466194887-18236-1-git-send-email-vascomalmeida@sapo.pt","subject":"[PATCH v5 12/38] t6030: update to use test_i18ncmp","fromName":"Vasco Almeida","fromEmail":"vascomalmeida@sapo.pt","sentAt":"2016-06-17T20:21:01Z","receivedAt":"2016-06-17T20:24:29Z","isPatch":true,"sender":{"key":"vascomalmeida@sapo.pt","avatar":"https://avatars.githubusercontent.com/u/9001556?v=4"},"body":"Since the git bisect output tested here is subject to translation, the\nhelper function test_i18ncmp should be used over test_cmp.\n\nSigned-off-by: Vasco Almeida <vascomalmeida@sapo.pt>\n---\n t/t6030-bisect-porcelain.sh | 4 ++--\n 1 file changed, 2 insertions(+), 2 deletions(-)\n\ndiff --git a/t/t6030-bisect-porcelain.sh b/t/t6030-bisect-porcelain.sh\nindex e74662b..7012011 100755\n--- a/t/t6030-bisect-porcelain.sh\n+++ b/t/t6030-bisect-porcelain.sh\n@@ -803,7 +803,7 @@ test_expect_success 'bisect terms needs 0 or 1 argument' '\n \ttest_must_fail git bisect terms 1 2 &&\n \ttest_must_fail git bisect terms 2>actual &&\n \techo \"no terms defined\" >expected &&\n-\ttest_cmp expected actual\n+\ttest_i18ncmp expected actual\n '\n \n test_expect_success 'bisect terms shows good/bad after start' '\n@@ -875,7 +875,7 @@ test_expect_success 'bisect start --term-* does store terms' '\n \tYour current terms are two for the old state\n \tand one for the new state.\n \tEOF\n-\ttest_cmp expected actual &&\n+\ttest_i18ncmp expected actual &&\n \tgit bisect terms --term-bad >actual &&\n \techo one >expected &&\n \ttest_cmp expected actual &&\n-- \n2.6.6\n\n"},{"id":"289482","messageId":"1466194887-18236-12-git-send-email-vascomalmeida@sapo.pt","threadId":"42641","inReplyTo":"1466194887-18236-1-git-send-email-vascomalmeida@sapo.pt","subject":"[PATCH v5 11/38] i18n: bisect: simplify error message for i18n","fromName":"Vasco Almeida","fromEmail":"vascomalmeida@sapo.pt","sentAt":"2016-06-17T20:21:00Z","receivedAt":"2016-06-17T20:24:35Z","isPatch":true,"sender":{"key":"vascomalmeida@sapo.pt","avatar":"https://avatars.githubusercontent.com/u/9001556?v=4"},"body":"The message was not being extracted by xgettext, although it was marked\nfor translation, seemingly because it contained a command substitution.\nMoreover, eval_gettext should be used instead of gettext for strings\nwith substitution.\n\nSee step 4. of section 15.5.2.1 Preparing Shell Scripts for\nInternationalization from gettext manual [1]:\n\"Simplify translatable strings so that they don't contain command\nsubstitution (\"`...`\" or \"$(...)\") [...]\"\n\n[1] http://www.gnu.org/software/gettext/manual/html_node/Preparing-Shell-Scripts.html\n\nSigned-off-by: Vasco Almeida <vascomalmeida@sapo.pt>\n---\n git-bisect.sh | 5 +++--\n 1 file changed, 3 insertions(+), 2 deletions(-)\n\ndiff --git a/git-bisect.sh b/git-bisect.sh\nindex 5d1cb00..737bf05 100755\n--- a/git-bisect.sh\n+++ b/git-bisect.sh\n@@ -277,8 +277,9 @@ bisect_state() {\n \t0,*)\n \t\tdie \"$(gettext \"Please call 'bisect_state' with at least one argument.\")\" ;;\n \t1,\"$TERM_BAD\"|1,\"$TERM_GOOD\"|1,skip)\n-\t\trev=$(git rev-parse --verify $(bisect_head)) ||\n-\t\t\tdie \"$(gettext \"Bad rev input: $(bisect_head)\")\"\n+\t\tbisected_head=$(bisect_head)\n+\t\trev=$(git rev-parse --verify \"$bisected_head\") ||\n+\t\t\tdie \"$(eval_gettext \"Bad rev input: \\$bisected_head\")\"\n \t\tbisect_write \"$state\" \"$rev\"\n \t\tcheck_expected_revs \"$rev\" ;;\n \t2,\"$TERM_BAD\"|*,\"$TERM_GOOD\"|*,skip)\n-- \n2.6.6\n\n"},{"id":"289483","messageId":"1466194887-18236-18-git-send-email-vascomalmeida@sapo.pt","threadId":"42641","inReplyTo":"1466194887-18236-1-git-send-email-vascomalmeida@sapo.pt","subject":"[PATCH v5 17/38] i18n: setup: mark strings for translation","fromName":"Vasco Almeida","fromEmail":"vascomalmeida@sapo.pt","sentAt":"2016-06-17T20:21:06Z","receivedAt":"2016-06-17T20:24:37Z","isPatch":true,"sender":{"key":"vascomalmeida@sapo.pt","avatar":"https://avatars.githubusercontent.com/u/9001556?v=4"},"body":"Update tests that compare the strings newly marked for translation to\nsucceed when running under GETTEXT_POISON.\n\nSigned-off-by: Vasco Almeida <vascomalmeida@sapo.pt>\n---\n setup.c                        | 16 ++++++++--------\n t/t1506-rev-parse-diagnosis.sh |  2 +-\n t/t4208-log-magic-pathspec.sh  |  4 ++--\n 3 files changed, 11 insertions(+), 11 deletions(-)\n\ndiff --git a/setup.c b/setup.c\nindex c86bf5c..6d0e0c9 100644\n--- a/setup.c\n+++ b/setup.c\n@@ -157,8 +157,8 @@ static void NORETURN die_verify_filename(const char *prefix,\n \t\t\t\t\t int diagnose_misspelt_rev)\n {\n \tif (!diagnose_misspelt_rev)\n-\t\tdie(\"%s: no such path in the working tree.\\n\"\n-\t\t    \"Use 'git <command> -- <path>...' to specify paths that do not exist locally.\",\n+\t\tdie(_(\"%s: no such path in the working tree.\\n\"\n+\t\t      \"Use 'git <command> -- <path>...' to specify paths that do not exist locally.\"),\n \t\t    arg);\n \t/*\n \t * Saying \"'(icase)foo' does not exist in the index\" when the\n@@ -170,9 +170,9 @@ static void NORETURN die_verify_filename(const char *prefix,\n \t\tmaybe_die_on_misspelt_object_name(arg, prefix);\n \n \t/* ... or fall back the most general message. */\n-\tdie(\"ambiguous argument '%s': unknown revision or path not in the working tree.\\n\"\n-\t    \"Use '--' to separate paths from revisions, like this:\\n\"\n-\t    \"'git <command> [<revision>...] -- [<file>...]'\", arg);\n+\tdie(_(\"ambiguous argument '%s': unknown revision or path not in the working tree.\\n\"\n+\t      \"Use '--' to separate paths from revisions, like this:\\n\"\n+\t      \"'git <command> [<revision>...] -- [<file>...]'\"), arg);\n \n }\n \n@@ -220,9 +220,9 @@ void verify_non_filename(const char *prefix, const char *arg)\n \t\treturn; /* flag */\n \tif (!check_filename(prefix, arg))\n \t\treturn;\n-\tdie(\"ambiguous argument '%s': both revision and filename\\n\"\n-\t    \"Use '--' to separate paths from revisions, like this:\\n\"\n-\t    \"'git <command> [<revision>...] -- [<file>...]'\", arg);\n+\tdie(_(\"ambiguous argument '%s': both revision and filename\\n\"\n+\t      \"Use '--' to separate paths from revisions, like this:\\n\"\n+\t      \"'git <command> [<revision>...] -- [<file>...]'\"), arg);\n }\n \n int get_common_dir(struct strbuf *sb, const char *gitdir)\ndiff --git a/t/t1506-rev-parse-diagnosis.sh b/t/t1506-rev-parse-diagnosis.sh\nindex 86c2ff2..79a0251 100755\n--- a/t/t1506-rev-parse-diagnosis.sh\n+++ b/t/t1506-rev-parse-diagnosis.sh\n@@ -106,7 +106,7 @@ test_expect_success 'incorrect revision id' '\n \ttest_must_fail git rev-parse foobar:file.txt 2>error &&\n \tgrep \"Invalid object name '\"'\"'foobar'\"'\"'.\" error &&\n \ttest_must_fail git rev-parse foobar 2> error &&\n-\tgrep \"unknown revision or path not in the working tree.\" error\n+\ttest_i18ngrep \"unknown revision or path not in the working tree.\" error\n '\n \n test_expect_success 'incorrect file in sha1:path' '\ndiff --git a/t/t4208-log-magic-pathspec.sh b/t/t4208-log-magic-pathspec.sh\nindex d8f23f4..001343e 100755\n--- a/t/t4208-log-magic-pathspec.sh\n+++ b/t/t4208-log-magic-pathspec.sh\n@@ -18,7 +18,7 @@ test_expect_success '\"git log :/\" should not be ambiguous' '\n test_expect_success '\"git log :/a\" should be ambiguous (applied both rev and worktree)' '\n \t: >a &&\n \ttest_must_fail git log :/a 2>error &&\n-\tgrep ambiguous error\n+\ttest_i18ngrep ambiguous error\n '\n \n test_expect_success '\"git log :/a -- \" should not be ambiguous' '\n@@ -31,7 +31,7 @@ test_expect_success '\"git log -- :/a\" should not be ambiguous' '\n \n test_expect_success '\"git log :\" should be ambiguous' '\n \ttest_must_fail git log : 2>error &&\n-\tgrep ambiguous error\n+\ttest_i18ngrep ambiguous error\n '\n \n test_expect_success 'git log -- :' '\n-- \n2.6.6\n\n"},{"id":"289484","messageId":"1466194887-18236-15-git-send-email-vascomalmeida@sapo.pt","threadId":"42641","inReplyTo":"1466194887-18236-1-git-send-email-vascomalmeida@sapo.pt","subject":"[PATCH v5 14/38] i18n: rebase-interactive: mark strings for translation","fromName":"Vasco Almeida","fromEmail":"vascomalmeida@sapo.pt","sentAt":"2016-06-17T20:21:03Z","receivedAt":"2016-06-17T20:24:37Z","isPatch":true,"sender":{"key":"vascomalmeida@sapo.pt","avatar":"https://avatars.githubusercontent.com/u/9001556?v=4"},"body":"Mark strings in git-rebase--interactive.sh for translation. There is no\nneed to source git-sh-i18n since git-rebase.sh already does so.\n\nAdd git-rebase--interactive.sh to LOCALIZED_SH in Makefile in order to\nenable extracting strings marked for translation by xgettext.\n\nSigned-off-by: Vasco Almeida <vascomalmeida@sapo.pt>\n---\n Makefile                   |   1 +\n git-rebase--interactive.sh | 191 ++++++++++++++++++++++++---------------------\n 2 files changed, 102 insertions(+), 90 deletions(-)\n\ndiff --git a/Makefile b/Makefile\nindex 6169389..3cb1d60 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -2065,6 +2065,7 @@ 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 LOCALIZED_SH += git-parse-remote.sh\n+LOCALIZED_SH += git-rebase--interactive.sh\n LOCALIZED_SH += git-sh-setup.sh\n LOCALIZED_PERL = $(SCRIPT_PERL)\n \ndiff --git a/git-rebase--interactive.sh b/git-rebase--interactive.sh\nindex 6e96abc..2b8a845 100644\n--- a/git-rebase--interactive.sh\n+++ b/git-rebase--interactive.sh\n@@ -128,7 +128,7 @@ mark_action_done () {\n \tif test \"$last_count\" != \"$new_count\"\n \tthen\n \t\tlast_count=$new_count\n-\t\tprintf \"Rebasing (%d/%d)\\r\" $new_count $total\n+\t\teval_gettext \"Rebasing (\\$new_count/\\$total)\"; printf \"\\r\"\n \t\ttest -z \"$verbose\" || echo\n \tfi\n }\n@@ -200,13 +200,14 @@ exit_with_patch () {\n \tmake_patch $1\n \tgit rev-parse --verify HEAD > \"$amend\"\n \tgpg_sign_opt_quoted=${gpg_sign_opt:+$(git rev-parse --sq-quote \"$gpg_sign_opt\")}\n-\twarn \"You can amend the commit now, with\"\n-\twarn\n-\twarn \"\tgit commit --amend $gpg_sign_opt_quoted\"\n-\twarn\n-\twarn \"Once you are satisfied with your changes, run\"\n-\twarn\n-\twarn \"\tgit rebase --continue\"\n+\twarn \"$(eval_gettext \"\\\n+You can amend the commit now, with\n+\n+\tgit commit --amend \\$gpg_sign_opt_quoted\n+\n+Once you are satisfied with your changes, run\n+\n+\tgit rebase --continue\")\"\n \twarn\n \texit $2\n }\n@@ -221,10 +222,12 @@ has_action () {\n }\n \n is_empty_commit() {\n-\ttree=$(git rev-parse -q --verify \"$1\"^{tree} 2>/dev/null ||\n-\t\tdie \"$1: not a commit that can be picked\")\n-\tptree=$(git rev-parse -q --verify \"$1\"^^{tree} 2>/dev/null ||\n-\t\tptree=4b825dc642cb6eb9a060e54bf8d69288fbee4904)\n+\ttree=$(git rev-parse -q --verify \"$1\"^{tree} 2>/dev/null) || {\n+\t\tsha1=$1\n+\t\tdie \"$(eval_gettext \"\\$sha1: not a commit that can be picked\")\"\n+\t}\n+\tptree=$(git rev-parse -q --verify \"$1\"^^{tree} 2>/dev/null) ||\n+\t\tptree=4b825dc642cb6eb9a060e54bf8d69288fbee4904\n \ttest \"$tree\" = \"$ptree\"\n }\n \n@@ -260,7 +263,7 @@ pick_one () {\n \n \tcase \"$1\" in -n) sha1=$2; ff= ;; *) sha1=$1 ;; esac\n \tcase \"$force_rebase\" in '') ;; ?*) ff= ;; esac\n-\toutput git rev-parse --verify $sha1 || die \"Invalid commit name: $sha1\"\n+\toutput git rev-parse --verify $sha1 || die \"$(eval_gettext \"Invalid commit name: \\$sha1\")\"\n \n \tif is_empty_commit \"$sha1\"\n \tthen\n@@ -302,7 +305,7 @@ pick_one_preserving_merges () {\n \t\t\t\tgit rev-parse HEAD > \"$rewritten\"/$current_commit\n \t\t\tdone <\"$state_dir\"/current-commit\n \t\t\trm \"$state_dir\"/current-commit ||\n-\t\t\tdie \"Cannot write current commit's replacement sha1\"\n+\t\t\t\tdie \"$(gettext \"Cannot write current commit's replacement sha1\")\"\n \t\tfi\n \tfi\n \n@@ -354,9 +357,9 @@ pick_one_preserving_merges () {\n \tdone\n \tcase $fast_forward in\n \tt)\n-\t\toutput warn \"Fast-forward to $sha1\"\n+\t\toutput warn \"$(eval_gettext \"Fast-forward to \\$sha1\")\"\n \t\toutput git reset --hard $sha1 ||\n-\t\t\tdie \"Cannot fast-forward to $sha1\"\n+\t\t\tdie \"$(eval_gettext \"Cannot fast-forward to \\$sha1\")\"\n \t\t;;\n \tf)\n \t\tfirst_parent=$(expr \"$new_parents\" : ' \\([^ ]*\\)')\n@@ -365,12 +368,12 @@ pick_one_preserving_merges () {\n \t\tthen\n \t\t\t# detach HEAD to current parent\n \t\t\toutput git checkout $first_parent 2> /dev/null ||\n-\t\t\t\tdie \"Cannot move HEAD to $first_parent\"\n+\t\t\t\tdie \"$(eval_gettext \"Cannot move HEAD to \\$first_parent\")\"\n \t\tfi\n \n \t\tcase \"$new_parents\" in\n \t\t' '*' '*)\n-\t\t\ttest \"a$1\" = a-n && die \"Refusing to squash a merge: $sha1\"\n+\t\t\ttest \"a$1\" = a-n && die \"$(eval_gettext \"Refusing to squash a merge: \\$sha1\")\"\n \n \t\t\t# redo merge\n \t\t\tauthor_script_content=$(get_author_ident_from_commit $sha1)\n@@ -384,7 +387,7 @@ pick_one_preserving_merges () {\n \t\t\t\t$merge_args $strategy_args -m \"$msg_content\" $new_parents'\n \t\t\tthen\n \t\t\t\tprintf \"%s\\n\" \"$msg_content\" > \"$GIT_DIR\"/MERGE_MSG\n-\t\t\t\tdie_with_patch $sha1 \"Error redoing merge $sha1\"\n+\t\t\t\tdie_with_patch $sha1 \"$(eval_gettext \"Error redoing merge \\$sha1\")\"\n \t\t\tfi\n \t\t\techo \"$sha1 $(git rev-parse HEAD^0)\" >> \"$rewritten_list\"\n \t\t\t;;\n@@ -392,7 +395,7 @@ pick_one_preserving_merges () {\n \t\t\toutput eval git cherry-pick \\\n \t\t\t\t${gpg_sign_opt:+$(git rev-parse --sq-quote \"$gpg_sign_opt\")} \\\n \t\t\t\t\"$strategy_args\" \"$@\" ||\n-\t\t\t\tdie_with_patch $sha1 \"Could not pick $sha1\"\n+\t\t\t\tdie_with_patch $sha1 \"$(eval_gettext \"Could not pick \\$sha1\")\"\n \t\t\t;;\n \t\tesac\n \t\t;;\n@@ -459,12 +462,14 @@ peek_next_command () {\n # messages, effectively causing the combined commit to be used as the\n # new basis for any further squash/fixups.  Args: sha1 rest\n die_failed_squash() {\n+\tsha1=$1\n+\trest=$2\n \tmv \"$squash_msg\" \"$msg\" || exit\n \trm -f \"$fixup_msg\"\n \tcp \"$msg\" \"$GIT_DIR\"/MERGE_MSG || exit\n \twarn\n-\twarn \"Could not apply $1... $2\"\n-\tdie_with_patch $1 \"\"\n+\twarn \"$(eval_gettext \"Could not apply \\$sha1... \\$rest\")\"\n+\tdie_with_patch $sha1 \"\"\n }\n \n flush_rewritten_pending() {\n@@ -488,6 +493,8 @@ record_in_rewritten() {\n }\n \n do_pick () {\n+\tsha1=$1\n+\trest=$2\n \tif test \"$(git rev-parse HEAD)\" = \"$squash_onto\"\n \tthen\n \t\t# Set the correct commit message and author info on the\n@@ -499,15 +506,15 @@ do_pick () {\n \t\t# resolve before manually running git commit --amend then git\n \t\t# rebase --continue.\n \t\tgit commit --allow-empty --allow-empty-message --amend \\\n-\t\t\t   --no-post-rewrite -n -q -C $1 &&\n-\t\t\tpick_one -n $1 &&\n+\t\t\t   --no-post-rewrite -n -q -C $sha1 &&\n+\t\t\tpick_one -n $sha1 &&\n \t\t\tgit commit --allow-empty --allow-empty-message \\\n-\t\t\t\t   --amend --no-post-rewrite -n -q -C $1 \\\n+\t\t\t\t   --amend --no-post-rewrite -n -q -C $sha1 \\\n \t\t\t\t   ${gpg_sign_opt:+\"$gpg_sign_opt\"} ||\n-\t\t\tdie_with_patch $1 \"Could not apply $1... $2\"\n+\t\t\t\t   die_with_patch $sha1 \"$(eval_gettext \"Could not apply \\$sha1... \\$rest\")\"\n \telse\n-\t\tpick_one $1 ||\n-\t\t\tdie_with_patch $1 \"Could not apply $1... $2\"\n+\t\tpick_one $sha1 ||\n+\t\t\tdie_with_patch $sha1 \"$(eval_gettext \"Could not apply \\$sha1... \\$rest\")\"\n \tfi\n }\n \n@@ -535,10 +542,11 @@ do_next () {\n \t\tmark_action_done\n \t\tdo_pick $sha1 \"$rest\"\n \t\tgit commit --amend --no-post-rewrite ${gpg_sign_opt:+\"$gpg_sign_opt\"} || {\n-\t\t\twarn \"Could not amend commit after successfully picking $sha1... $rest\"\n-\t\t\twarn \"This is most likely due to an empty commit message, or the pre-commit hook\"\n-\t\t\twarn \"failed. If the pre-commit hook failed, you may need to resolve the issue before\"\n-\t\t\twarn \"you are able to reword the commit.\"\n+\t\t\twarn \"$(eval_gettext \"\\\n+Could not amend commit after successfully picking \\$sha1... \\$rest\n+This is most likely due to an empty commit message, or the pre-commit hook\n+failed. If the pre-commit hook failed, you may need to resolve the issue before\n+you are able to reword the commit.\")\"\n \t\t\texit_with_patch $sha1 1\n \t\t}\n \t\trecord_in_rewritten $sha1\n@@ -549,7 +557,7 @@ do_next () {\n \t\tmark_action_done\n \t\tdo_pick $sha1 \"$rest\"\n \t\tsha1_abbrev=$(git rev-parse --short $sha1)\n-\t\twarn \"Stopped at $sha1_abbrev... $rest\"\n+\t\twarn \"$(eval_gettext \"Stopped at \\$sha1_abbrev... \\$rest\")\"\n \t\texit_with_patch $sha1 0\n \t\t;;\n \tsquash|s|fixup|f)\n@@ -564,7 +572,7 @@ do_next () {\n \t\tcomment_for_reflog $squash_style\n \n \t\ttest -f \"$done\" && has_action \"$done\" ||\n-\t\t\tdie \"Cannot '$squash_style' without a previous commit\"\n+\t\t\tdie \"$(eval_gettext \"Cannot '\\$squash_style' without a previous commit\")\"\n \n \t\tmark_action_done\n \t\tupdate_squash_messages $squash_style $sha1\n@@ -606,7 +614,7 @@ do_next () {\n \tx|\"exec\")\n \t\tread -r command rest < \"$todo\"\n \t\tmark_action_done\n-\t\tprintf 'Executing: %s\\n' \"$rest\"\n+\t\teval_gettextln \"Executing: \\$rest\"\n \t\t\"${SHELL:-@SHELL_PATH@}\" -c \"$rest\" # Actual execution\n \t\tstatus=$?\n \t\t# Run in subshell because require_clean_work_tree can die.\n@@ -614,13 +622,14 @@ do_next () {\n \t\t(require_clean_work_tree \"rebase\" 2>/dev/null) || dirty=t\n \t\tif test \"$status\" -ne 0\n \t\tthen\n-\t\t\twarn \"Execution failed: $rest\"\n+\t\t\twarn \"$(eval_gettext \"Execution failed: \\$rest\")\"\n \t\t\ttest \"$dirty\" = f ||\n-\t\t\twarn \"and made changes to the index and/or the working tree\"\n+\t\t\t\twarn \"$(gettext \"and made changes to the index and/or the working tree\")\"\n \n-\t\t\twarn \"You can fix the problem, and then run\"\n-\t\t\twarn\n-\t\t\twarn \"\tgit rebase --continue\"\n+\t\t\twarn \"$(gettext \"\\\n+You can fix the problem, and then run\n+\n+\tgit rebase --continue\")\"\n \t\t\twarn\n \t\t\tif test $status -eq 127\t\t# command not found\n \t\t\tthen\n@@ -629,18 +638,20 @@ do_next () {\n \t\t\texit \"$status\"\n \t\telif test \"$dirty\" = t\n \t\tthen\n-\t\t\twarn \"Execution succeeded: $rest\"\n-\t\t\twarn \"but left changes to the index and/or the working tree\"\n-\t\t\twarn \"Commit or stash your changes, and then run\"\n-\t\t\twarn\n-\t\t\twarn \"\tgit rebase --continue\"\n+\t\t\t# TRANSLATORS: after these lines is a command to be issued by the user\n+\t\t\twarn \"$(eval_gettext \"\\\n+Execution succeeded: \\$rest\n+but left changes to the index and/or the working tree\n+Commit or stash your changes, and then run\n+\n+\tgit rebase --continue\")\"\n \t\t\twarn\n \t\t\texit 1\n \t\tfi\n \t\t;;\n \t*)\n-\t\twarn \"Unknown command: $command $sha1 $rest\"\n-\t\tfixtodo=\"Please fix this using 'git rebase --edit-todo'.\"\n+\t\twarn \"$(eval_gettext \"Unknown command: \\$command \\$sha1 \\$rest\")\"\n+\t\tfixtodo=\"$(gettext \"Please fix this using 'git rebase --edit-todo'.\")\"\n \t\tif git rev-parse --verify -q \"$sha1\" >/dev/null\n \t\tthen\n \t\t\tdie_with_patch $sha1 \"$fixtodo\"\n@@ -675,7 +686,7 @@ do_next () {\n \t\t\"$hook\" rebase < \"$rewritten_list\"\n \t\ttrue # we don't care if this hook failed\n \tfi &&\n-\twarn \"Successfully rebased and updated $head_name.\"\n+\t\twarn \"$(eval_gettext \"Successfully rebased and updated \\$head_name.\")\"\n \n \treturn 1 # not failure; just to break the do_rest loop\n }\n@@ -722,7 +733,7 @@ skip_unnecessary_picks () {\n \t\trecord_in_rewritten \"$onto\"\n \t\t;;\n \tesac ||\n-\tdie \"Could not skip unnecessary pick commands\"\n+\t\tdie \"$(gettext \"Could not skip unnecessary pick commands\")\"\n }\n \n transform_todo_ids () {\n@@ -880,9 +891,9 @@ check_commit_sha () {\n \tif test $badsha -ne 0\n \tthen\n \t\tline=\"$(sed -n -e \"${2}p\" \"$3\")\"\n-\t\twarn \"Warning: the SHA-1 is missing or isn't\" \\\n-\t\t\t\"a commit in the following line:\"\n-\t\twarn \" - $line\"\n+\t\twarn \"$(eval_gettext \"\\\n+Warning: the SHA-1 is missing or isn't a commit in the following line:\n+ - \\$line\")\"\n \t\twarn\n \tfi\n \n@@ -913,9 +924,9 @@ check_bad_cmd_and_sha () {\n \t\t\t;;\n \t\t*)\n \t\t\tline=\"$(sed -n -e \"${lineno}p\" \"$1\")\"\n-\t\t\twarn \"Warning: the command isn't recognized\" \\\n-\t\t\t\t\"in the following line:\"\n-\t\t\twarn \" - $line\"\n+\t\t\twarn \"$(eval_gettext \"\\\n+Warning: the command isn't recognized in the following line:\n+ - \\$line\")\"\n \t\t\twarn\n \t\t\tretval=1\n \t\t\t;;\n@@ -952,7 +963,7 @@ warn_lines () {\n # Switch to the branch in $into and notify it in the reflog\n checkout_onto () {\n \tGIT_REFLOG_ACTION=\"$GIT_REFLOG_ACTION: checkout $onto_name\"\n-\toutput git checkout $onto || die_abort \"could not detach HEAD\"\n+\toutput git checkout $onto || die_abort \"$(gettext \"could not detach HEAD\")\"\n \tgit update-ref ORIG_HEAD $orig_head\n }\n \n@@ -990,28 +1001,26 @@ check_todo_list () {\n \t\tthen\n \t\t\ttest \"$check_level\" = error && raise_error=t\n \n-\t\t\twarn \"Warning: some commits may have been dropped\" \\\n-\t\t\t\t\"accidentally.\"\n-\t\t\twarn \"Dropped commits (newer to older):\"\n+\t\t\twarn \"$(gettext \"\\\n+Warning: some commits may have been dropped accidentally.\n+Dropped commits (newer to older):\")\"\n \n \t\t\t# Make the list user-friendly and display\n \t\t\topt=\"--no-walk=sorted --format=oneline --abbrev-commit --stdin\"\n \t\t\tgit rev-list $opt <\"$todo\".miss | warn_lines\n \n-\t\t\twarn \"To avoid this message, use \\\"drop\\\" to\" \\\n-\t\t\t\t\"explicitly remove a commit.\"\n-\t\t\twarn\n-\t\t\twarn \"Use 'git config rebase.missingCommitsCheck' to change\" \\\n-\t\t\t\t\"the level of warnings.\"\n-\t\t\twarn \"The possible behaviours are: ignore, warn, error.\"\n+\t\t\twarn \"$(gettext \"\\\n+To avoid this message, use \\\"drop\\\" to explicitly remove a commit.\n+\n+Use 'git config rebase.missingCommitsCheck' to change the level of warnings.\n+The possible behaviours are: ignore, warn, error.\")\"\n \t\t\twarn\n \t\tfi\n \t\t;;\n \tignore)\n \t\t;;\n \t*)\n-\t\twarn \"Unrecognized setting $check_level for option\" \\\n-\t\t\t\"rebase.missingCommitsCheck. Ignoring.\"\n+\t\twarn \"$(eval_gettext \"Unrecognized setting \\$check_level for option rebase.missingCommitsCheck. Ignoring.\")\"\n \t\t;;\n \tesac\n \n@@ -1028,8 +1037,8 @@ check_todo_list () {\n \t\t# placed before the commit of the next action\n \t\tcheckout_onto\n \n-\t\twarn \"You can fix this with 'git rebase --edit-todo'.\"\n-\t\tdie \"Or you can abort the rebase with 'git rebase --abort'.\"\n+\t\twarn \"$(gettext \"You can fix this with 'git rebase --edit-todo'.\")\"\n+\t\tdie \"$(gettext \"Or you can abort the rebase with 'git rebase --abort'.\")\"\n \tfi\n }\n \n@@ -1053,41 +1062,43 @@ continue)\n \n \t\ttest ! -f \"$GIT_DIR\"/CHERRY_PICK_HEAD ||\n \t\trm \"$GIT_DIR\"/CHERRY_PICK_HEAD ||\n-\t\tdie \"Could not remove CHERRY_PICK_HEAD\"\n+\t\tdie \"$(gettext \"Could not remove CHERRY_PICK_HEAD\")\"\n \telse\n \t\tif ! test -f \"$author_script\"\n \t\tthen\n \t\t\tgpg_sign_opt_quoted=${gpg_sign_opt:+$(git rev-parse --sq-quote \"$gpg_sign_opt\")}\n-\t\t\tdie \"You have staged changes in your working tree. If these changes are meant to be\n+\t\t\tdie \"$(eval_gettext \"\\\n+You have staged changes in your working tree.\n+If these changes are meant to be\n squashed into the previous commit, run:\n \n-  git commit --amend $gpg_sign_opt_quoted\n+  git commit --amend \\$gpg_sign_opt_quoted\n \n If they are meant to go into a new commit, run:\n \n-  git commit $gpg_sign_opt_quoted\n+  git commit \\$gpg_sign_opt_quoted\n \n In both case, once you're done, continue with:\n \n   git rebase --continue\n-\"\n+\")\"\n \t\tfi\n \t\t. \"$author_script\" ||\n-\t\t\tdie \"Error trying to find the author identity to amend commit\"\n+\t\t\tdie \"$(gettext \"Error trying to find the author identity to amend commit\")\"\n \t\tif test -f \"$amend\"\n \t\tthen\n \t\t\tcurrent_head=$(git rev-parse --verify HEAD)\n \t\t\ttest \"$current_head\" = $(cat \"$amend\") ||\n-\t\t\tdie \"\\\n-You have uncommitted changes in your working tree. Please, commit them\n-first and then run 'git rebase --continue' again.\"\n+\t\t\tdie \"$(gettext \"\\\n+You have uncommitted changes in your working tree. Please commit them\n+first and then run 'git rebase --continue' again.\")\"\n \t\t\tdo_with_author git commit --amend --no-verify -F \"$msg\" -e \\\n \t\t\t\t${gpg_sign_opt:+\"$gpg_sign_opt\"} ||\n-\t\t\t\tdie \"Could not commit staged changes.\"\n+\t\t\t\tdie \"$(gettext \"Could not commit staged changes.\")\"\n \t\telse\n \t\t\tdo_with_author git commit --no-verify -F \"$msg\" -e \\\n \t\t\t\t${gpg_sign_opt:+\"$gpg_sign_opt\"} ||\n-\t\t\t\tdie \"Could not commit staged changes.\"\n+\t\t\t\tdie \"$(gettext \"Could not commit staged changes.\")\"\n \t\tfi\n \tfi\n \n@@ -1120,7 +1131,7 @@ To continue rebase after editing, run:\n EOF\n \n \tgit_sequence_editor \"$todo\" ||\n-\t\tdie \"Could not execute editor\"\n+\t\tdie \"$(gettext \"Could not execute editor\")\"\n \texpand_todo_ids\n \n \texit\n@@ -1128,7 +1139,7 @@ EOF\n esac\n \n git var GIT_COMMITTER_IDENT >/dev/null ||\n-\tdie \"You need to set your committer info first\"\n+\tdie \"$(gettext \"You need to set your committer info first\")\"\n \n comment_for_reflog start\n \n@@ -1136,15 +1147,15 @@ if test ! -z \"$switch_to\"\n then\n \tGIT_REFLOG_ACTION=\"$GIT_REFLOG_ACTION: checkout $switch_to\"\n \toutput git checkout \"$switch_to\" -- ||\n-\tdie \"Could not checkout $switch_to\"\n+\t\tdie \"$(eval_gettext \"Could not checkout \\$switch_to\")\"\n \n \tcomment_for_reflog start\n fi\n \n-orig_head=$(git rev-parse --verify HEAD) || die \"No HEAD?\"\n-mkdir -p \"$state_dir\" || die \"Could not create temporary $state_dir\"\n+orig_head=$(git rev-parse --verify HEAD) || die \"$(gettext \"No HEAD?\")\"\n+mkdir -p \"$state_dir\" || die \"$(eval_gettext \"Could not create temporary \\$state_dir\")\"\n \n-: > \"$state_dir\"/interactive || die \"Could not mark as interactive\"\n+: > \"$state_dir\"/interactive || die \"$(gettext \"Could not mark as interactive\")\"\n write_basic_state\n if test t = \"$preserve_merges\"\n then\n@@ -1154,12 +1165,12 @@ then\n \t\tfor c in $(git merge-base --all $orig_head $upstream)\n \t\tdo\n \t\t\techo $onto > \"$rewritten\"/$c ||\n-\t\t\t\tdie \"Could not init rewritten commits\"\n+\t\t\t\tdie \"$(gettext \"Could not init rewritten commits\")\"\n \t\tdone\n \telse\n \t\tmkdir \"$rewritten\" &&\n \t\techo $onto > \"$rewritten\"/root ||\n-\t\t\tdie \"Could not init rewritten commits\"\n+\t\t\tdie \"$(gettext \"Could not init rewritten commits\")\"\n \tfi\n \t# No cherry-pick because our first pass is to determine\n \t# parents to rewrite and skipping dropped commits would\n@@ -1269,7 +1280,7 @@ EOF\n \n if test -z \"$keep_empty\"\n then\n-\tprintf '%s\\n' \"$comment_char Note that empty commits are commented out\" >>\"$todo\"\n+\tprintf '%s\\n' \"$comment_char $(gettext \"Note that empty commits are commented out\")\" >>\"$todo\"\n fi\n \n \n@@ -1279,7 +1290,7 @@ has_action \"$todo\" ||\n cp \"$todo\" \"$todo\".backup\n collapse_todo_ids\n git_sequence_editor \"$todo\" ||\n-\tdie_abort \"Could not execute editor\"\n+\tdie_abort \"$(gettext \"Could not execute editor\")\"\n \n has_action \"$todo\" ||\n \treturn 2\n-- \n2.6.6\n\n"},{"id":"289485","messageId":"1466194887-18236-23-git-send-email-vascomalmeida@sapo.pt","threadId":"42641","inReplyTo":"1466194887-18236-1-git-send-email-vascomalmeida@sapo.pt","subject":"[PATCH v5 22/38] t5523: use test_i18ngrep for negation","fromName":"Vasco Almeida","fromEmail":"vascomalmeida@sapo.pt","sentAt":"2016-06-17T20:21:11Z","receivedAt":"2016-06-17T20:24:44Z","isPatch":true,"sender":{"key":"vascomalmeida@sapo.pt","avatar":"https://avatars.githubusercontent.com/u/9001556?v=4"},"body":"Replace the first form with the second one:\n\n\t! grep expected actual\n\ttest_i18ngrep ! expected actual\n\nThe latter syntax is supported by test_i18ngrep defined in\nt/test-lib.sh.\n\nAlthough the test already passes whether GETTEXT_POSION is enabled, use\nthe i18n grep variant for the sake of consistency and also to make\nobvious that those strings are subject to i18n.\n\nSigned-off-by: Vasco Almeida <vascomalmeida@sapo.pt>\n---\n t/t5523-push-upstream.sh | 8 ++++----\n 1 file changed, 4 insertions(+), 4 deletions(-)\n\ndiff --git a/t/t5523-push-upstream.sh b/t/t5523-push-upstream.sh\nindex 4a7b98b..d6981ba 100755\n--- a/t/t5523-push-upstream.sh\n+++ b/t/t5523-push-upstream.sh\n@@ -83,7 +83,7 @@ test_expect_success 'progress messages do not go to non-tty' '\n \n \t# skip progress messages, since stderr is non-tty\n \tgit push -u upstream master >out 2>err &&\n-\t! grep \"Writing objects\" err\n+\ttest_i18ngrep ! \"Writing objects\" err\n '\n \n test_expect_success 'progress messages go to non-tty (forced)' '\n@@ -98,15 +98,15 @@ test_expect_success TTY 'push -q suppresses progress' '\n \tensure_fresh_upstream &&\n \n \ttest_terminal git push -u -q upstream master >out 2>err &&\n-\t! grep \"Writing objects\" err\n+\ttest_i18ngrep ! \"Writing objects\" err\n '\n \n test_expect_success TTY 'push --no-progress suppresses progress' '\n \tensure_fresh_upstream &&\n \n \ttest_terminal git push -u --no-progress upstream master >out 2>err &&\n-\t! grep \"Unpacking objects\" err &&\n-\t! grep \"Writing objects\" err\n+\ttest_i18ngrep ! \"Unpacking objects\" err &&\n+\ttest_i18ngrep ! \"Writing objects\" err\n '\n \n test_expect_success TTY 'quiet push' '\n-- \n2.6.6\n\n"},{"id":"289486","messageId":"1466194887-18236-21-git-send-email-vascomalmeida@sapo.pt","threadId":"42641","inReplyTo":"1466194887-18236-1-git-send-email-vascomalmeida@sapo.pt","subject":"[PATCH v5 20/38] t9003: become resilient to GETTEXT_POISON","fromName":"Vasco Almeida","fromEmail":"vascomalmeida@sapo.pt","sentAt":"2016-06-17T20:21:09Z","receivedAt":"2016-06-17T20:24:46Z","isPatch":true,"sender":{"key":"vascomalmeida@sapo.pt","avatar":"https://avatars.githubusercontent.com/u/9001556?v=4"},"body":"The test t9003-help-autocorrect.sh fails when run under GETTEXT_POISON,\nbecause it's expecting to filter out the original output. Accommodate\ngettext poison case by also filtering out the default simulated output.\n\nSigned-off-by: Vasco Almeida <vascomalmeida@sapo.pt>\n---\n t/t9003-help-autocorrect.sh | 4 ++--\n 1 file changed, 2 insertions(+), 2 deletions(-)\n\ndiff --git a/t/t9003-help-autocorrect.sh b/t/t9003-help-autocorrect.sh\nindex dfe95c9..b1c7919 100755\n--- a/t/t9003-help-autocorrect.sh\n+++ b/t/t9003-help-autocorrect.sh\n@@ -31,10 +31,10 @@ test_expect_success 'autocorrect showing candidates' '\n \tgit config help.autocorrect 0 &&\n \n \ttest_must_fail git lfg 2>actual &&\n-\tsed -e \"1,/^Did you mean this/d\" actual | grep lgf &&\n+\tgrep \"^\tlgf\" actual &&\n \n \ttest_must_fail git distimdist 2>actual &&\n-\tsed -e \"1,/^Did you mean this/d\" actual | grep distimdistim\n+\tgrep \"^\tdistimdistim\" actual\n '\n \n test_expect_success 'autocorrect running commands' '\n-- \n2.6.6\n\n"},{"id":"289487","messageId":"1466194887-18236-29-git-send-email-vascomalmeida@sapo.pt","threadId":"42641","inReplyTo":"1466194887-18236-1-git-send-email-vascomalmeida@sapo.pt","subject":"[PATCH v5 28/38] i18n: merge: mark messages for translation","fromName":"Vasco Almeida","fromEmail":"vascomalmeida@sapo.pt","sentAt":"2016-06-17T20:21:17Z","receivedAt":"2016-06-17T20:24:46Z","isPatch":true,"sender":{"key":"vascomalmeida@sapo.pt","avatar":"https://avatars.githubusercontent.com/u/9001556?v=4"},"body":"Mark messages shown to the user for translation.\n\nSigned-off-by: Vasco Almeida <vascomalmeida@sapo.pt>\n---\n builtin/merge.c | 10 +++++-----\n 1 file changed, 5 insertions(+), 5 deletions(-)\n\ndiff --git a/builtin/merge.c b/builtin/merge.c\nindex b555a1b..961def5 100644\n--- a/builtin/merge.c\n+++ b/builtin/merge.c\n@@ -1014,7 +1014,7 @@ static int default_edit_option(void)\n \tif (e) {\n \t\tint v = git_config_maybe_bool(name, e);\n \t\tif (v < 0)\n-\t\t\tdie(\"Bad value '%s' in environment '%s'\", e, name);\n+\t\t\tdie(_(\"Bad value '%s' in environment '%s'\"), e, name);\n \t\treturn v;\n \t}\n \n@@ -1115,7 +1115,7 @@ static void handle_fetch_head(struct commit_list **remotes, struct strbuf *merge\n \t\tif (!commit) {\n \t\t\tif (ptr)\n \t\t\t\t*ptr = '\\0';\n-\t\t\tdie(\"not something we can merge in %s: %s\",\n+\t\t\tdie(_(\"not something we can merge in %s: %s\"),\n \t\t\t    filename, merge_names->buf + pos);\n \t\t}\n \t\tremotes = &commit_list_insert(commit, remotes)->next;\n@@ -1149,7 +1149,7 @@ static struct commit_list *collect_parents(struct commit *head_commit,\n \t\t\tstruct commit *commit = get_merge_parent(argv[i]);\n \t\t\tif (!commit)\n \t\t\t\thelp_unknown_ref(argv[i], \"merge\",\n-\t\t\t\t\t\t \"not something we can merge\");\n+\t\t\t\t\t\t _(\"not something we can merge\"));\n \t\t\tremotes = &commit_list_insert(commit, remotes)->next;\n \t\t}\n \t\tremoteheads = reduce_parents(head_commit, head_subsumed, remoteheads);\n@@ -1421,7 +1421,7 @@ int cmd_merge(int argc, const char **argv, const char *prefix)\n \t\t * If head can reach all the merge then we are up to date.\n \t\t * but first the most common case of merging one remote.\n \t\t */\n-\t\tfinish_up_to_date(\"Already up-to-date.\");\n+\t\tfinish_up_to_date(_(\"Already up-to-date.\"));\n \t\tgoto done;\n \t} else if (fast_forward != FF_NO && !remoteheads->next &&\n \t\t\t!common->next &&\n@@ -1506,7 +1506,7 @@ int cmd_merge(int argc, const char **argv, const char *prefix)\n \t\t\t}\n \t\t}\n \t\tif (up_to_date) {\n-\t\t\tfinish_up_to_date(\"Already up-to-date. Yeeah!\");\n+\t\t\tfinish_up_to_date(_(\"Already up-to-date. Yeeah!\"));\n \t\t\tgoto done;\n \t\t}\n \t}\n-- \n2.6.6\n\n"},{"id":"289488","messageId":"1466194887-18236-32-git-send-email-vascomalmeida@sapo.pt","threadId":"42641","inReplyTo":"1466194887-18236-1-git-send-email-vascomalmeida@sapo.pt","subject":"[PATCH v5 31/38] i18n: standardise messages","fromName":"Vasco Almeida","fromEmail":"vascomalmeida@sapo.pt","sentAt":"2016-06-17T20:21:20Z","receivedAt":"2016-06-17T20:24:46Z","isPatch":true,"sender":{"key":"vascomalmeida@sapo.pt","avatar":"https://avatars.githubusercontent.com/u/9001556?v=4"},"body":"Standardise messages in order to save translators some work.\n\nNuances fixed in this commit:\n\"failed to read %s\"\n\"read of %s failed\"\n\n\"detach the HEAD at named commit\"\n\"detach HEAD at named commit\"\n\n\"removing '%s' failed\"\n\"failed to remove '%s'\"\n\n\"index file corrupt\"\n\"corrupt index file\"\n\n\"failed to read %s\"\n\"read of %s failed\"\n\n\"detach the HEAD at named commit\"\n\"detach HEAD at named commit\"\n\nSigned-off-by: Vasco Almeida <vascomalmeida@sapo.pt>\n---\n builtin/apply.c    | 6 +++---\n builtin/checkout.c | 6 +++---\n builtin/repack.c   | 2 +-\n 3 files changed, 7 insertions(+), 7 deletions(-)\n\ndiff --git a/builtin/apply.c b/builtin/apply.c\nindex c770d7d..a741274 100644\n--- a/builtin/apply.c\n+++ b/builtin/apply.c\n@@ -3226,7 +3226,7 @@ static int load_patch_target(struct strbuf *buf,\n {\n \tif (cached || check_index) {\n \t\tif (read_file_or_gitlink(ce, buf))\n-\t\t\treturn error(_(\"read of %s failed\"), name);\n+\t\t\treturn error(_(\"failed to read %s\"), name);\n \t} else if (name) {\n \t\tif (S_ISGITLINK(expected_mode)) {\n \t\t\tif (ce)\n@@ -3237,7 +3237,7 @@ static int load_patch_target(struct strbuf *buf,\n \t\t\treturn error(_(\"reading from '%s' beyond a symbolic link\"), name);\n \t\t} else {\n \t\t\tif (read_old_data(st, name, buf))\n-\t\t\t\treturn error(_(\"read of %s failed\"), name);\n+\t\t\t\treturn error(_(\"failed to read %s\"), name);\n \t\t}\n \t}\n \treturn 0;\n@@ -3282,7 +3282,7 @@ static int load_preimage(struct image *image,\n \t\t\tfree_fragment_list(patch->fragments);\n \t\t\tpatch->fragments = NULL;\n \t\t} else if (status) {\n-\t\t\treturn error(_(\"read of %s failed\"), patch->old_name);\n+\t\t\treturn error(_(\"failed to read %s\"), patch->old_name);\n \t\t}\n \t}\n \ndiff --git a/builtin/checkout.c b/builtin/checkout.c\nindex 3398c61..05c7b71 100644\n--- a/builtin/checkout.c\n+++ b/builtin/checkout.c\n@@ -276,7 +276,7 @@ static int checkout_paths(const struct checkout_opts *opts,\n \n \thold_locked_index(lock_file, 1);\n \tif (read_cache_preload(&opts->pathspec) < 0)\n-\t\treturn error(_(\"corrupt index file\"));\n+\t\treturn error(_(\"index file corrupt\"));\n \n \tif (opts->source_tree)\n \t\tread_tree_some(opts->source_tree, &opts->pathspec);\n@@ -470,7 +470,7 @@ static int merge_working_tree(const struct checkout_opts *opts,\n \n \thold_locked_index(lock_file, 1);\n \tif (read_cache_preload(NULL) < 0)\n-\t\treturn error(_(\"corrupt index file\"));\n+\t\treturn error(_(\"index file corrupt\"));\n \n \tresolve_undo_clear();\n \tif (opts->force) {\n@@ -1138,7 +1138,7 @@ int cmd_checkout(int argc, const char **argv, const char *prefix)\n \t\tOPT_STRING('B', NULL, &opts.new_branch_force, N_(\"branch\"),\n \t\t\t   N_(\"create/reset and checkout a branch\")),\n \t\tOPT_BOOL('l', NULL, &opts.new_branch_log, N_(\"create reflog for new branch\")),\n-\t\tOPT_BOOL(0, \"detach\", &opts.force_detach, N_(\"detach the HEAD at named commit\")),\n+\t\tOPT_BOOL(0, \"detach\", &opts.force_detach, N_(\"detach HEAD at named commit\")),\n \t\tOPT_SET_INT('t', \"track\",  &opts.track, N_(\"set upstream info for new branch\"),\n \t\t\tBRANCH_TRACK_EXPLICIT),\n \t\tOPT_STRING(0, \"orphan\", &opts.new_orphan_branch, N_(\"new-branch\"), N_(\"new unparented branch\")),\ndiff --git a/builtin/repack.c b/builtin/repack.c\nindex 858db38..0108819 100644\n--- a/builtin/repack.c\n+++ b/builtin/repack.c\n@@ -378,7 +378,7 @@ int cmd_repack(int argc, const char **argv, const char *prefix)\n \t\t\t\t\t  item->string,\n \t\t\t\t\t  exts[ext].name);\n \t\t\tif (remove_path(fname))\n-\t\t\t\twarning(_(\"removing '%s' failed\"), fname);\n+\t\t\t\twarning(_(\"failed to remove '%s'\"), fname);\n \t\t\tfree(fname);\n \t\t}\n \t}\n-- \n2.6.6\n\n"},{"id":"289489","messageId":"1466194887-18236-34-git-send-email-vascomalmeida@sapo.pt","threadId":"42641","inReplyTo":"1466194887-18236-1-git-send-email-vascomalmeida@sapo.pt","subject":"[PATCH v5 33/38] i18n: remote: allow translations to reorder message","fromName":"Vasco Almeida","fromEmail":"vascomalmeida@sapo.pt","sentAt":"2016-06-17T20:21:22Z","receivedAt":"2016-06-17T20:24:52Z","isPatch":true,"sender":{"key":"vascomalmeida@sapo.pt","avatar":"https://avatars.githubusercontent.com/u/9001556?v=4"},"body":"Before this patch, translations couldn't place the branch name\nwhere it was better fit in the message \"and with remote <branch_name>\".\nAllow translations that, instead of forcing the branch name to display\nright of the message.\n\nSigned-off-by: Vasco Almeida <vascomalmeida@sapo.pt>\n---\n builtin/remote.c | 7 +++----\n 1 file changed, 3 insertions(+), 4 deletions(-)\n\ndiff --git a/builtin/remote.c b/builtin/remote.c\nindex 9f934cb..7f0f78b 100644\n--- a/builtin/remote.c\n+++ b/builtin/remote.c\n@@ -952,7 +952,7 @@ static int show_local_info_item(struct string_list_item *item, void *cb_data)\n \tstruct show_info *show_info = cb_data;\n \tstruct branch_info *branch_info = item->util;\n \tstruct string_list *merge = &branch_info->merge;\n-\tconst char *also;\n+\tint width = show_info->width + 4;\n \tint i;\n \n \tif (branch_info->rebase && branch_info->merge.nr > 1) {\n@@ -969,13 +969,12 @@ static int show_local_info_item(struct string_list_item *item, void *cb_data)\n \t\treturn 0;\n \t} else if (show_info->any_rebase) {\n \t\tprintf_ln(_(\" merges with remote %s\"), merge->items[0].string);\n-\t\talso = _(\"    and with remote\");\n+\t\twidth++;\n \t} else {\n \t\tprintf_ln(_(\"merges with remote %s\"), merge->items[0].string);\n-\t\talso = _(\"   and with remote\");\n \t}\n \tfor (i = 1; i < merge->nr; i++)\n-\t\tprintf(\"    %-*s %s %s\\n\", show_info->width, \"\", also,\n+\t\tprintf(_(\"%-*s    and with remote %s\\n\"), width, \"\",\n \t\t       merge->items[i].string);\n \n \treturn 0;\n-- \n2.6.6\n\n"},{"id":"289490","messageId":"1466194887-18236-31-git-send-email-vascomalmeida@sapo.pt","threadId":"42641","inReplyTo":"1466194887-18236-1-git-send-email-vascomalmeida@sapo.pt","subject":"[PATCH v5 30/38] i18n: sequencer: add period to error message","fromName":"Vasco Almeida","fromEmail":"vascomalmeida@sapo.pt","sentAt":"2016-06-17T20:21:19Z","receivedAt":"2016-06-17T20:24:54Z","isPatch":true,"sender":{"key":"vascomalmeida@sapo.pt","avatar":"https://avatars.githubusercontent.com/u/9001556?v=4"},"body":"Add a period to error message so it matches others instances in\nsequencer.c. Now translator would have to translate such message only\nonce.\n\nSigned-off-by: Vasco Almeida <vascomalmeida@sapo.pt>\n---\n sequencer.c | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/sequencer.c b/sequencer.c\nindex 57b3671..e916387 100644\n--- a/sequencer.c\n+++ b/sequencer.c\n@@ -190,7 +190,7 @@ static void write_message(struct strbuf *msgbuf, const char *filename)\n \t\tdie_errno(_(\"Could not write to %s\"), filename);\n \tstrbuf_release(msgbuf);\n \tif (commit_lock_file(&msg_file) < 0)\n-\t\tdie(_(\"Error wrapping up %s\"), filename);\n+\t\tdie(_(\"Error wrapping up %s.\"), filename);\n }\n \n static struct tree *empty_tree(void)\n-- \n2.6.6\n\n"},{"id":"289491","messageId":"1466194887-18236-33-git-send-email-vascomalmeida@sapo.pt","threadId":"42641","inReplyTo":"1466194887-18236-1-git-send-email-vascomalmeida@sapo.pt","subject":"[PATCH v5 32/38] i18n: remote: mark URL fallback text for translation","fromName":"Vasco Almeida","fromEmail":"vascomalmeida@sapo.pt","sentAt":"2016-06-17T20:21:21Z","receivedAt":"2016-06-17T20:24:54Z","isPatch":true,"sender":{"key":"vascomalmeida@sapo.pt","avatar":"https://avatars.githubusercontent.com/u/9001556?v=4"},"body":"Marks fallback text for translation that may be displayed in git remote\nshow output.\n\nSigned-off-by: Vasco Almeida <vascomalmeida@sapo.pt>\n---\n builtin/remote.c | 6 +++---\n 1 file changed, 3 insertions(+), 3 deletions(-)\n\ndiff --git a/builtin/remote.c b/builtin/remote.c\nindex ae74da6..9f934cb 100644\n--- a/builtin/remote.c\n+++ b/builtin/remote.c\n@@ -1158,11 +1158,11 @@ static int show(int argc, const char **argv)\n \t\t\t   the one in \"  Fetch URL: %s\" translation */\n \t\t\tprintf_ln(_(\"  Push  URL: %s\"), url[i]);\n \t\tif (!i)\n-\t\t\tprintf_ln(_(\"  Push  URL: %s\"), \"(no URL)\");\n+\t\t\tprintf_ln(_(\"  Push  URL: %s\"), _(\"(no URL)\"));\n \t\tif (no_query)\n-\t\t\tprintf_ln(_(\"  HEAD branch: %s\"), \"(not queried)\");\n+\t\t\tprintf_ln(_(\"  HEAD branch: %s\"), _(\"(not queried)\"));\n \t\telse if (!states.heads.nr)\n-\t\t\tprintf_ln(_(\"  HEAD branch: %s\"), \"(unknown)\");\n+\t\t\tprintf_ln(_(\"  HEAD branch: %s\"), _(\"(unknown)\"));\n \t\telse if (states.heads.nr == 1)\n \t\t\tprintf_ln(_(\"  HEAD branch: %s\"), states.heads.items[0].string);\n \t\telse {\n-- \n2.6.6\n\n"},{"id":"289492","messageId":"1466194887-18236-28-git-send-email-vascomalmeida@sapo.pt","threadId":"42641","inReplyTo":"1466194887-18236-1-git-send-email-vascomalmeida@sapo.pt","subject":"[PATCH v5 27/38] i18n: config: unfold error messages marked for translation","fromName":"Vasco Almeida","fromEmail":"vascomalmeida@sapo.pt","sentAt":"2016-06-17T20:21:16Z","receivedAt":"2016-06-17T20:24:58Z","isPatch":true,"sender":{"key":"vascomalmeida@sapo.pt","avatar":"https://avatars.githubusercontent.com/u/9001556?v=4"},"body":"Introduced in 473166b (\"config: add 'origin_type' to config_source\nstruct\", 2016-02-19), Git can inform the user about the origin of a\nconfig error, but the implementation does not allow translators to\ntranslate the keywords 'file', 'blob, 'standard input', and\n'submodule-blob'. Moreover, for the second message, a reason for the\nerror is appended to the message, not allowing translators to translate\nthat reason either.\n\nUnfold the message into several templates for each known origin_type.\nThat would result in better translation at the expense of code\nverbosity.\n\nAdd enum git_config_oringin_type to ease management of the various\nconfiguration origin types (blob, file, etc).\n\nFor the first instance, use xstrfmt() function to prepare the message\nstring, instead of doing something like it's done for the second one,\nbecause intelligibility and code conciseness are improved for that\ninstance.\n\nSigned-off-by: Vasco Almeida <vascomalmeida@sapo.pt>\n---\n cache.h            |   9 ++++-\n config.c           | 101 ++++++++++++++++++++++++++++++++++++++++++++---------\n submodule-config.c |   2 +-\n 3 files changed, 94 insertions(+), 18 deletions(-)\n\ndiff --git a/cache.h b/cache.h\nindex 6049f86..4bded9a 100644\n--- a/cache.h\n+++ b/cache.h\n@@ -1559,10 +1559,17 @@ struct git_config_source {\n \tconst char *blob;\n };\n \n+enum git_config_origin_type {\n+\tCFG_BLOB,\n+\tCFG_FILE,\n+\tCFG_STDIN,\n+\tCFG_SUBMODULE_BLOB\n+};\n+\n typedef int (*config_fn_t)(const char *, const char *, void *);\n extern int git_default_config(const char *, const char *, void *);\n extern int git_config_from_file(config_fn_t fn, const char *, void *);\n-extern int git_config_from_mem(config_fn_t fn, const char *origin_type,\n+extern int git_config_from_mem(config_fn_t fn, const enum git_config_origin_type,\n \t\t\t\t\tconst char *name, const char *buf, size_t len, void *data);\n extern void git_config_push_parameter(const char *text);\n extern int git_config_from_parameters(config_fn_t fn, void *data);\ndiff --git a/config.c b/config.c\nindex f51c56b..e86f0aa 100644\n--- a/config.c\n+++ b/config.c\n@@ -24,7 +24,7 @@ struct config_source {\n \t\t\tsize_t pos;\n \t\t} buf;\n \t} u;\n-\tconst char *origin_type;\n+\tenum git_config_origin_type origin_type;\n \tconst char *name;\n \tconst char *path;\n \tint die_on_error;\n@@ -417,6 +417,8 @@ static int git_parse_source(config_fn_t fn, void *data)\n \tint comment = 0;\n \tint baselen = 0;\n \tstruct strbuf *var = &cf->var;\n+\tint error_return = 0;\n+\tchar *error_msg = NULL;\n \n \t/* U+FEFF Byte Order Mark in UTF8 */\n \tconst char *bomptr = utf8_bom;\n@@ -471,10 +473,36 @@ static int git_parse_source(config_fn_t fn, void *data)\n \t\tif (get_value(fn, data, var) < 0)\n \t\t\tbreak;\n \t}\n+\n+\tswitch (cf->origin_type) {\n+\tcase CFG_BLOB:\n+\t\terror_msg = xstrfmt(_(\"bad config line %d in blob %s\"),\n+\t\t\t\t      cf->linenr, cf->name);\n+\t\tbreak;\n+\tcase CFG_FILE:\n+\t\terror_msg = xstrfmt(_(\"bad config line %d in file %s\"),\n+\t\t\t\t      cf->linenr, cf->name);\n+\t\tbreak;\n+\tcase CFG_STDIN:\n+\t\terror_msg = xstrfmt(_(\"bad config line %d in standard input\"),\n+\t\t\t\t      cf->linenr);\n+\t\tbreak;\n+\tcase CFG_SUBMODULE_BLOB:\n+\t\terror_msg = xstrfmt(_(\"bad config line %d in submodule-blob %s\"),\n+\t\t\t\t       cf->linenr, cf->name);\n+\t\tbreak;\n+\tdefault:\n+\t\terror_msg = xstrfmt(_(\"bad config line %d in %s\"),\n+\t\t\t\t      cf->linenr, cf->name);\n+\t}\n+\n \tif (cf->die_on_error)\n-\t\tdie(_(\"bad config line %d in %s %s\"), cf->linenr, cf->origin_type, cf->name);\n+\t\tdie(error_msg);\n \telse\n-\t\treturn error(_(\"bad config line %d in %s %s\"), cf->linenr, cf->origin_type, cf->name);\n+\t\terror_return =  error(error_msg);\n+\n+\tfree(error_msg);\n+\treturn error_return;\n }\n \n static int parse_unit_factor(const char *end, uintmax_t *val)\n@@ -583,16 +611,42 @@ int git_parse_ulong(const char *value, unsigned long *ret)\n NORETURN\n static void die_bad_number(const char *name, const char *value)\n {\n-\tconst char *reason = errno == ERANGE ?\n-\t\t\t     \"out of range\" :\n-\t\t\t     \"invalid unit\";\n \tif (!value)\n \t\tvalue = \"\";\n \n-\tif (cf && cf->origin_type && cf->name)\n-\t\tdie(_(\"bad numeric config value '%s' for '%s' in %s %s: %s\"),\n-\t\t    value, name, cf->origin_type, cf->name, reason);\n-\tdie(_(\"bad numeric config value '%s' for '%s': %s\"), value, name, reason);\n+\tif (!(cf && cf->name))\n+\t\tdie(errno == ERANGE\n+\t\t    ? _(\"bad numeric config value '%s' for '%s': out of range\")\n+\t\t    : _(\"bad numeric config value '%s' for '%s': invalid unit\"),\n+\t\t    value, name);\n+\n+\tswitch (cf->origin_type) {\n+\tcase CFG_BLOB:\n+\t\tdie(errno == ERANGE\n+\t\t    ? _(\"bad numeric config value '%s' for '%s' in blob %s: out of range\")\n+\t\t    : _(\"bad numeric config value '%s' for '%s' in blob %s: invalid unit\"),\n+\t\t    value, name, cf->name);\n+\tcase CFG_FILE:\n+\t\tdie(errno == ERANGE\n+\t\t    ? _(\"bad numeric config value '%s' for '%s' in file %s: out of range\")\n+\t\t    : _(\"bad numeric config value '%s' for '%s' in file %s: invalid unit\"),\n+\t\t    value, name, cf->name);\n+\tcase CFG_STDIN:\n+\t\tdie(errno == ERANGE\n+\t\t    ? _(\"bad numeric config value '%s' for '%s' in standard input: out of range\")\n+\t\t    : _(\"bad numeric config value '%s' for '%s' in standard input: invalid unit\"),\n+\t\t    value, name);\n+\tcase CFG_SUBMODULE_BLOB:\n+\t\tdie(errno == ERANGE\n+\t\t    ? _(\"bad numeric config value '%s' for '%s' in submodule-blob %s: out of range\")\n+\t\t    : _(\"bad numeric config value '%s' for '%s' in submodule-blob %s: invalid unit\"),\n+\t\t    value, name, cf->name);\n+\tdefault:\n+\t\tdie(errno == ERANGE\n+\t\t    ? _(\"bad numeric config value '%s' for '%s' in %s: out of range\")\n+\t\t    : _(\"bad numeric config value '%s' for '%s' in %s: invalid unit\"),\n+\t\t    value, name, cf->name);\n+\t}\n }\n \n int git_config_int(const char *name, const char *value)\n@@ -1069,7 +1123,8 @@ static int do_config_from(struct config_source *top, config_fn_t fn, void *data)\n }\n \n static int do_config_from_file(config_fn_t fn,\n-\t\tconst char *origin_type, const char *name, const char *path, FILE *f,\n+\t\tconst enum git_config_origin_type origin_type,\n+\t\tconst char *name, const char *path, FILE *f,\n \t\tvoid *data)\n {\n \tstruct config_source top;\n@@ -1088,7 +1143,7 @@ static int do_config_from_file(config_fn_t fn,\n \n static int git_config_from_stdin(config_fn_t fn, void *data)\n {\n-\treturn do_config_from_file(fn, \"standard input\", \"\", NULL, stdin, data);\n+\treturn do_config_from_file(fn, CFG_STDIN, \"\", NULL, stdin, data);\n }\n \n int git_config_from_file(config_fn_t fn, const char *filename, void *data)\n@@ -1099,14 +1154,14 @@ int git_config_from_file(config_fn_t fn, const char *filename, void *data)\n \tf = fopen(filename, \"r\");\n \tif (f) {\n \t\tflockfile(f);\n-\t\tret = do_config_from_file(fn, \"file\", filename, filename, f, data);\n+\t\tret = do_config_from_file(fn, CFG_FILE, filename, filename, f, data);\n \t\tfunlockfile(f);\n \t\tfclose(f);\n \t}\n \treturn ret;\n }\n \n-int git_config_from_mem(config_fn_t fn, const char *origin_type,\n+int git_config_from_mem(config_fn_t fn, const enum git_config_origin_type origin_type,\n \t\t\tconst char *name, const char *buf, size_t len, void *data)\n {\n \tstruct config_source top;\n@@ -1143,7 +1198,7 @@ static int git_config_from_blob_sha1(config_fn_t fn,\n \t\treturn error(\"reference '%s' does not point to a blob\", name);\n \t}\n \n-\tret = git_config_from_mem(fn, \"blob\", name, buf, size, data);\n+\tret = git_config_from_mem(fn, CFG_BLOB, name, buf, size, data);\n \tfree(buf);\n \n \treturn ret;\n@@ -2442,7 +2497,21 @@ int parse_config_key(const char *var,\n \n const char *current_config_origin_type(void)\n {\n-\treturn cf && cf->origin_type ? cf->origin_type : \"command line\";\n+\tif (!cf)\n+\t\treturn \"command line\";\n+\n+\tswitch (cf->origin_type) {\n+\tcase CFG_BLOB:\n+\t\treturn \"blob\";\n+\tcase CFG_FILE:\n+\t\treturn \"file\";\n+\tcase CFG_STDIN:\n+\t\treturn \"standard input\";\n+\tcase CFG_SUBMODULE_BLOB:\n+\t\treturn \"submodule-blob\";\n+\tdefault:\n+\t\treturn \"command line\";\n+\t}\n }\n \n const char *current_config_name(void)\ndiff --git a/submodule-config.c b/submodule-config.c\nindex debab29..f53f6bd 100644\n--- a/submodule-config.c\n+++ b/submodule-config.c\n@@ -439,7 +439,7 @@ static const struct submodule *config_from(struct submodule_cache *cache,\n \tparameter.commit_sha1 = commit_sha1;\n \tparameter.gitmodules_sha1 = sha1;\n \tparameter.overwrite = 0;\n-\tgit_config_from_mem(parse_config, \"submodule-blob\", rev.buf,\n+\tgit_config_from_mem(parse_config, CFG_SUBMODULE_BLOB, rev.buf,\n \t\t\tconfig, config_size, &parameter);\n \tfree(config);\n \n-- \n2.6.6\n\n"},{"id":"289493","messageId":"1466194887-18236-30-git-send-email-vascomalmeida@sapo.pt","threadId":"42641","inReplyTo":"1466194887-18236-1-git-send-email-vascomalmeida@sapo.pt","subject":"[PATCH v5 29/38] i18n: merge: change command option help to lowercase","fromName":"Vasco Almeida","fromEmail":"vascomalmeida@sapo.pt","sentAt":"2016-06-17T20:21:18Z","receivedAt":"2016-06-17T20:25:00Z","isPatch":true,"sender":{"key":"vascomalmeida@sapo.pt","avatar":"https://avatars.githubusercontent.com/u/9001556?v=4"},"body":"Change command option description to lowercase, matching pull\ncounterpart option. Translators would have to translate such message\nonly once.\n\nSigned-off-by: Vasco Almeida <vascomalmeida@sapo.pt>\n---\n builtin/merge.c | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/builtin/merge.c b/builtin/merge.c\nindex 961def5..d82f6c1 100644\n--- a/builtin/merge.c\n+++ b/builtin/merge.c\n@@ -211,7 +211,7 @@ static struct option builtin_merge_options[] = {\n \t\tPARSE_OPT_NOARG | PARSE_OPT_NONEG, NULL, FF_ONLY },\n \tOPT_RERERE_AUTOUPDATE(&allow_rerere_auto),\n \tOPT_BOOL(0, \"verify-signatures\", &verify_signatures,\n-\t\tN_(\"Verify that the named commit has a valid GPG signature\")),\n+\t\tN_(\"verify that the named commit has a valid GPG signature\")),\n \tOPT_CALLBACK('s', \"strategy\", &use_strategies, N_(\"strategy\"),\n \t\tN_(\"merge strategy to use\"), option_parse_strategy),\n \tOPT_CALLBACK('X', \"strategy-option\", &xopts, N_(\"option=value\"),\n-- \n2.6.6\n\n"},{"id":"289494","messageId":"1466194887-18236-24-git-send-email-vascomalmeida@sapo.pt","threadId":"42641","inReplyTo":"1466194887-18236-1-git-send-email-vascomalmeida@sapo.pt","subject":"[PATCH v5 23/38] i18n: bisect: mark strings for translation","fromName":"Vasco Almeida","fromEmail":"vascomalmeida@sapo.pt","sentAt":"2016-06-17T20:21:12Z","receivedAt":"2016-06-17T20:25:00Z","isPatch":true,"sender":{"key":"vascomalmeida@sapo.pt","avatar":"https://avatars.githubusercontent.com/u/9001556?v=4"},"body":"In the last message, involving Q_(), try to mark the message in such way\nthat is suited for RTL (Right to Left) languages.\n\nUpdate test t6030-bisect-porcelain.sh to reflect the changes.\n\nSigned-off-by: Vasco Almeida <vascomalmeida@sapo.pt>\n---\n bisect.c                    | 56 +++++++++++++++++++++++++--------------------\n t/t6030-bisect-porcelain.sh | 22 +++++++++---------\n 2 files changed, 42 insertions(+), 36 deletions(-)\n\ndiff --git a/bisect.c b/bisect.c\nindex 6d93edb..a8713a8 100644\n--- a/bisect.c\n+++ b/bisect.c\n@@ -438,12 +438,12 @@ static void read_bisect_paths(struct argv_array *array)\n \tFILE *fp = fopen(filename, \"r\");\n \n \tif (!fp)\n-\t\tdie_errno(\"Could not open file '%s'\", filename);\n+\t\tdie_errno(_(\"Could not open file '%s'\"), filename);\n \n \twhile (strbuf_getline_lf(&str, fp) != EOF) {\n \t\tstrbuf_trim(&str);\n \t\tif (sq_dequote_to_argv_array(str.buf, array))\n-\t\t\tdie(\"Badly quoted content in file '%s': %s\",\n+\t\t\tdie(_(\"Badly quoted content in file '%s': %s\"),\n \t\t\t    filename, str.buf);\n \t}\n \n@@ -649,7 +649,7 @@ static void exit_if_skipped_commits(struct commit_list *tried,\n \tprint_commit_list(tried, \"%s\\n\", \"%s\\n\");\n \tif (bad)\n \t\tprintf(\"%s\\n\", oid_to_hex(bad));\n-\tprintf(\"We cannot bisect more!\\n\");\n+\tprintf(_(\"We cannot bisect more!\\n\"));\n \texit(2);\n }\n \n@@ -702,7 +702,7 @@ static struct commit *get_commit_reference(const unsigned char *sha1)\n {\n \tstruct commit *r = lookup_commit_reference(sha1);\n \tif (!r)\n-\t\tdie(\"Not a valid commit name %s\", sha1_to_hex(sha1));\n+\t\tdie(_(\"Not a valid commit name %s\"), sha1_to_hex(sha1));\n \treturn r;\n }\n \n@@ -726,27 +726,27 @@ static void handle_bad_merge_base(void)\n \t\tchar *bad_hex = oid_to_hex(current_bad_oid);\n \t\tchar *good_hex = join_sha1_array_hex(&good_revs, ' ');\n \t\tif (!strcmp(term_bad, \"bad\") && !strcmp(term_good, \"good\")) {\n-\t\t\tfprintf(stderr, \"The merge base %s is bad.\\n\"\n+\t\t\tfprintf(stderr, _(\"The merge base %s is bad.\\n\"\n \t\t\t\t\"This means the bug has been fixed \"\n-\t\t\t\t\"between %s and [%s].\\n\",\n+\t\t\t\t\"between %s and [%s].\\n\"),\n \t\t\t\tbad_hex, bad_hex, good_hex);\n \t\t} else if (!strcmp(term_bad, \"new\") && !strcmp(term_good, \"old\")) {\n-\t\t\tfprintf(stderr, \"The merge base %s is new.\\n\"\n+\t\t\tfprintf(stderr, _(\"The merge base %s is new.\\n\"\n \t\t\t\t\"The property has changed \"\n-\t\t\t\t\"between %s and [%s].\\n\",\n+\t\t\t\t\"between %s and [%s].\\n\"),\n \t\t\t\tbad_hex, bad_hex, good_hex);\n \t\t} else {\n-\t\t\tfprintf(stderr, \"The merge base %s is %s.\\n\"\n+\t\t\tfprintf(stderr, _(\"The merge base %s is %s.\\n\"\n \t\t\t\t\"This means the first '%s' commit is \"\n-\t\t\t\t\"between %s and [%s].\\n\",\n+\t\t\t\t\"between %s and [%s].\\n\"),\n \t\t\t\tbad_hex, term_bad, term_good, bad_hex, good_hex);\n \t\t}\n \t\texit(3);\n \t}\n \n-\tfprintf(stderr, \"Some %s revs are not ancestor of the %s rev.\\n\"\n+\tfprintf(stderr, _(\"Some %s revs are not ancestor of the %s rev.\\n\"\n \t\t\"git bisect cannot work properly in this case.\\n\"\n-\t\t\"Maybe you mistook %s and %s revs?\\n\",\n+\t\t\"Maybe you mistook %s and %s revs?\\n\"),\n \t\tterm_good, term_bad, term_good, term_bad);\n \texit(1);\n }\n@@ -757,11 +757,11 @@ static void handle_skipped_merge_base(const unsigned char *mb)\n \tchar *bad_hex = sha1_to_hex(current_bad_oid->hash);\n \tchar *good_hex = join_sha1_array_hex(&good_revs, ' ');\n \n-\twarning(\"the merge base between %s and [%s] \"\n+\twarning(_(\"the merge base between %s and [%s] \"\n \t\t\"must be skipped.\\n\"\n \t\t\"So we cannot be sure the first %s commit is \"\n \t\t\"between %s and %s.\\n\"\n-\t\t\"We continue anyway.\",\n+\t\t\"We continue anyway.\"),\n \t\tbad_hex, good_hex, term_bad, mb_hex, bad_hex);\n \tfree(good_hex);\n }\n@@ -792,7 +792,7 @@ static void check_merge_bases(int no_checkout)\n \t\t} else if (0 <= sha1_array_lookup(&skipped_revs, mb)) {\n \t\t\thandle_skipped_merge_base(mb);\n \t\t} else {\n-\t\t\tprintf(\"Bisecting: a merge base must be tested\\n\");\n+\t\t\tprintf(_(\"Bisecting: a merge base must be tested\\n\"));\n \t\t\texit(bisect_checkout(mb, no_checkout));\n \t\t}\n \t}\n@@ -843,7 +843,7 @@ static void check_good_are_ancestors_of_bad(const char *prefix, int no_checkout)\n \tint fd;\n \n \tif (!current_bad_oid)\n-\t\tdie(\"a %s revision is needed\", term_bad);\n+\t\tdie(_(\"a %s revision is needed\"), term_bad);\n \n \t/* Check if file BISECT_ANCESTORS_OK exists. */\n \tif (!stat(filename, &st) && S_ISREG(st.st_mode))\n@@ -860,7 +860,7 @@ static void check_good_are_ancestors_of_bad(const char *prefix, int no_checkout)\n \t/* Create file BISECT_ANCESTORS_OK. */\n \tfd = open(filename, O_CREAT | O_TRUNC | O_WRONLY, 0600);\n \tif (fd < 0)\n-\t\twarning_errno(\"could not create file '%s'\",\n+\t\twarning_errno(_(\"could not create file '%s'\"),\n \t\t\t      filename);\n \telse\n \t\tclose(fd);\n@@ -910,7 +910,7 @@ void read_bisect_terms(const char **read_bad, const char **read_good)\n \t\t\t*read_good = \"good\";\n \t\t\treturn;\n \t\t} else {\n-\t\t\tdie_errno(\"could not read file '%s'\", filename);\n+\t\t\tdie_errno(_(\"could not read file '%s'\"), filename);\n \t\t}\n \t} else {\n \t\tstrbuf_getline_lf(&str, fp);\n@@ -936,10 +936,11 @@ int bisect_next_all(const char *prefix, int no_checkout)\n \tstruct commit_list *tried;\n \tint reaches = 0, all = 0, nr, steps;\n \tconst unsigned char *bisect_rev;\n+\tchar steps_msg[32];\n \n \tread_bisect_terms(&term_bad, &term_good);\n \tif (read_bisect_refs())\n-\t\tdie(\"reading bisect refs failed\");\n+\t\tdie(_(\"reading bisect refs failed\"));\n \n \tcheck_good_are_ancestors_of_bad(prefix, no_checkout);\n \n@@ -959,7 +960,7 @@ int bisect_next_all(const char *prefix, int no_checkout)\n \t\t */\n \t\texit_if_skipped_commits(tried, NULL);\n \n-\t\tprintf(\"%s was both %s and %s\\n\",\n+\t\tprintf(_(\"%s was both %s and %s\\n\"),\n \t\t       oid_to_hex(current_bad_oid),\n \t\t       term_good,\n \t\t       term_bad);\n@@ -967,8 +968,8 @@ int bisect_next_all(const char *prefix, int no_checkout)\n \t}\n \n \tif (!all) {\n-\t\tfprintf(stderr, \"No testable commit found.\\n\"\n-\t\t\t\"Maybe you started with bad path parameters?\\n\");\n+\t\tfprintf(stderr, _(\"No testable commit found.\\n\"\n+\t\t\t\"Maybe you started with bad path parameters?\\n\"));\n \t\texit(4);\n \t}\n \n@@ -985,9 +986,14 @@ int bisect_next_all(const char *prefix, int no_checkout)\n \n \tnr = all - reaches - 1;\n \tsteps = estimate_bisect_steps(all);\n-\tprintf(\"Bisecting: %d revision%s left to test after this \"\n-\t       \"(roughly %d step%s)\\n\", nr, (nr == 1 ? \"\" : \"s\"),\n-\t       steps, (steps == 1 ? \"\" : \"s\"));\n+\txsnprintf(steps_msg, sizeof(steps_msg),\n+\t\t  Q_(\"(roughly %d step)\", \"(roughly %d steps)\", steps),\n+\t\t  steps);\n+\t/* TRANSLATORS: the last %s will be replaced with\n+\t   \"(roughly %d steps)\" translation */\n+\tprintf(Q_(\"Bisecting: %d revision left to test after this %s\\n\",\n+\t\t  \"Bisecting: %d revisions left to test after this %s\\n\",\n+\t\t  nr), nr, steps_msg);\n \n \treturn bisect_checkout(bisect_rev, no_checkout);\n }\ndiff --git a/t/t6030-bisect-porcelain.sh b/t/t6030-bisect-porcelain.sh\nindex 7012011..86d1380 100755\n--- a/t/t6030-bisect-porcelain.sh\n+++ b/t/t6030-bisect-porcelain.sh\n@@ -362,7 +362,7 @@ test_expect_success 'bisect starting with a detached HEAD' '\n test_expect_success 'bisect errors out if bad and good are mistaken' '\n \tgit bisect reset &&\n \ttest_must_fail git bisect start $HASH2 $HASH4 2> rev_list_error &&\n-\tgrep \"mistook good and bad\" rev_list_error &&\n+\ttest_i18ngrep \"mistook good and bad\" rev_list_error &&\n \tgit bisect reset\n '\n \n@@ -404,7 +404,7 @@ test_expect_success 'side branch creation' '\n \n test_expect_success 'good merge base when good and bad are siblings' '\n \tgit bisect start \"$HASH7\" \"$SIDE_HASH7\" > my_bisect_log.txt &&\n-\tgrep \"merge base must be tested\" my_bisect_log.txt &&\n+\ttest_i18ngrep \"merge base must be tested\" my_bisect_log.txt &&\n \tgrep $HASH4 my_bisect_log.txt &&\n \tgit bisect good > my_bisect_log.txt &&\n \ttest_must_fail grep \"merge base must be tested\" my_bisect_log.txt &&\n@@ -413,7 +413,7 @@ test_expect_success 'good merge base when good and bad are siblings' '\n '\n test_expect_success 'skipped merge base when good and bad are siblings' '\n \tgit bisect start \"$SIDE_HASH7\" \"$HASH7\" > my_bisect_log.txt &&\n-\tgrep \"merge base must be tested\" my_bisect_log.txt &&\n+\ttest_i18ngrep \"merge base must be tested\" my_bisect_log.txt &&\n \tgrep $HASH4 my_bisect_log.txt &&\n \tgit bisect skip > my_bisect_log.txt 2>&1 &&\n \tgrep \"warning\" my_bisect_log.txt &&\n@@ -423,11 +423,11 @@ test_expect_success 'skipped merge base when good and bad are siblings' '\n \n test_expect_success 'bad merge base when good and bad are siblings' '\n \tgit bisect start \"$HASH7\" HEAD > my_bisect_log.txt &&\n-\tgrep \"merge base must be tested\" my_bisect_log.txt &&\n+\ttest_i18ngrep \"merge base must be tested\" my_bisect_log.txt &&\n \tgrep $HASH4 my_bisect_log.txt &&\n \ttest_must_fail git bisect bad > my_bisect_log.txt 2>&1 &&\n-\tgrep \"merge base $HASH4 is bad\" my_bisect_log.txt &&\n-\tgrep \"fixed between $HASH4 and \\[$SIDE_HASH7\\]\" my_bisect_log.txt &&\n+\ttest_i18ngrep \"merge base $HASH4 is bad\" my_bisect_log.txt &&\n+\ttest_i18ngrep \"fixed between $HASH4 and \\[$SIDE_HASH7\\]\" my_bisect_log.txt &&\n \tgit bisect reset\n '\n \n@@ -460,9 +460,9 @@ test_expect_success 'many merge bases creation' '\n \n test_expect_success 'good merge bases when good and bad are siblings' '\n \tgit bisect start \"$B_HASH\" \"$A_HASH\" > my_bisect_log.txt &&\n-\tgrep \"merge base must be tested\" my_bisect_log.txt &&\n+\ttest_i18ngrep \"merge base must be tested\" my_bisect_log.txt &&\n \tgit bisect good > my_bisect_log2.txt &&\n-\tgrep \"merge base must be tested\" my_bisect_log2.txt &&\n+\ttest_i18ngrep \"merge base must be tested\" my_bisect_log2.txt &&\n \t{\n \t\t{\n \t\t\tgrep \"$SIDE_HASH5\" my_bisect_log.txt &&\n@@ -477,14 +477,14 @@ test_expect_success 'good merge bases when good and bad are siblings' '\n \n test_expect_success 'optimized merge base checks' '\n \tgit bisect start \"$HASH7\" \"$SIDE_HASH7\" > my_bisect_log.txt &&\n-\tgrep \"merge base must be tested\" my_bisect_log.txt &&\n+\ttest_i18ngrep \"merge base must be tested\" my_bisect_log.txt &&\n \tgrep \"$HASH4\" my_bisect_log.txt &&\n \tgit bisect good > my_bisect_log2.txt &&\n \ttest -f \".git/BISECT_ANCESTORS_OK\" &&\n \ttest \"$HASH6\" = $(git rev-parse --verify HEAD) &&\n \tgit bisect bad > my_bisect_log3.txt &&\n \tgit bisect good \"$A_HASH\" > my_bisect_log4.txt &&\n-\tgrep \"merge base must be tested\" my_bisect_log4.txt &&\n+\ttest_i18ngrep \"merge base must be tested\" my_bisect_log4.txt &&\n \ttest_must_fail test -f \".git/BISECT_ANCESTORS_OK\"\n '\n \n@@ -562,7 +562,7 @@ test_expect_success 'skipping away from skipped commit' '\n \n test_expect_success 'erroring out when using bad path parameters' '\n \ttest_must_fail git bisect start $PARA_HASH7 $HASH1 -- foobar 2> error.txt &&\n-\tgrep \"bad path parameters\" error.txt\n+\ttest_i18ngrep \"bad path parameters\" error.txt\n '\n \n test_expect_success 'test bisection on bare repo - --no-checkout specified' '\n-- \n2.6.6\n\n"},{"id":"289495","messageId":"1466194887-18236-25-git-send-email-vascomalmeida@sapo.pt","threadId":"42641","inReplyTo":"1466194887-18236-1-git-send-email-vascomalmeida@sapo.pt","subject":"[PATCH v5 24/38] i18n: transport-helper.c: change N_() call to _()","fromName":"Vasco Almeida","fromEmail":"vascomalmeida@sapo.pt","sentAt":"2016-06-17T20:21:13Z","receivedAt":"2016-06-17T20:25:07Z","isPatch":true,"sender":{"key":"vascomalmeida@sapo.pt","avatar":"https://avatars.githubusercontent.com/u/9001556?v=4"},"body":"The N_() no-op call currently marks the string to be extracted by\nxgettext but doesn't trigger the retrieval of the translation at run\ntime, whereas _() does both. Meaning that, in spite of having\ntranslations available, they were never retrieved to make use of them.\n\nSigned-off-by: Vasco Almeida <vascomalmeida@sapo.pt>\n---\n transport-helper.c | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/transport-helper.c b/transport-helper.c\nindex bd666b2..4208743 100644\n--- a/transport-helper.c\n+++ b/transport-helper.c\n@@ -1038,7 +1038,7 @@ static struct ref *get_refs_list(struct transport *transport, int for_push)\n \t\t\t\t(*tail)->status |= REF_STATUS_UPTODATE;\n \t\t\t\tif (read_ref((*tail)->name,\n \t\t\t\t\t     (*tail)->old_oid.hash) < 0)\n-\t\t\t\t\tdie(N_(\"Could not read ref %s\"),\n+\t\t\t\t\tdie(_(\"Could not read ref %s\"),\n \t\t\t\t\t    (*tail)->name);\n \t\t\t}\n \t\t}\n-- \n2.6.6\n\n"},{"id":"289496","messageId":"1466194887-18236-27-git-send-email-vascomalmeida@sapo.pt","threadId":"42641","inReplyTo":"1466194887-18236-1-git-send-email-vascomalmeida@sapo.pt","subject":"[PATCH v5 26/38] i18n: notes: mark options for translation","fromName":"Vasco Almeida","fromEmail":"vascomalmeida@sapo.pt","sentAt":"2016-06-17T20:21:15Z","receivedAt":"2016-06-17T20:25:08Z","isPatch":true,"sender":{"key":"vascomalmeida@sapo.pt","avatar":"https://avatars.githubusercontent.com/u/9001556?v=4"},"body":"Mark options description of git prune for translation.\n\nSigned-off-by: Vasco Almeida <vascomalmeida@sapo.pt>\n---\n builtin/notes.c | 4 ++--\n 1 file changed, 2 insertions(+), 2 deletions(-)\n\ndiff --git a/builtin/notes.c b/builtin/notes.c\nindex d11e6eb..0572051 100644\n--- a/builtin/notes.c\n+++ b/builtin/notes.c\n@@ -934,8 +934,8 @@ static int prune(int argc, const char **argv, const char *prefix)\n \tstruct notes_tree *t;\n \tint show_only = 0, verbose = 0;\n \tstruct option options[] = {\n-\t\tOPT__DRY_RUN(&show_only, \"do not remove, show only\"),\n-\t\tOPT__VERBOSE(&verbose, \"report pruned notes\"),\n+\t\tOPT__DRY_RUN(&show_only, N_(\"do not remove, show only\")),\n+\t\tOPT__VERBOSE(&verbose, N_(\"report pruned notes\")),\n \t\tOPT_END()\n \t};\n \n-- \n2.6.6\n\n"},{"id":"289497","messageId":"1466194887-18236-19-git-send-email-vascomalmeida@sapo.pt","threadId":"42641","inReplyTo":"1466194887-18236-1-git-send-email-vascomalmeida@sapo.pt","subject":"[PATCH v5 18/38] tests: use test_i18n* functions to suppress false positives","fromName":"Vasco Almeida","fromEmail":"vascomalmeida@sapo.pt","sentAt":"2016-06-17T20:21:07Z","receivedAt":"2016-06-17T20:25:10Z","isPatch":true,"sender":{"key":"vascomalmeida@sapo.pt","avatar":"https://avatars.githubusercontent.com/u/9001556?v=4"},"body":"The test functions test_i18ncmp and test_i18ngrep pretend success if run\nunder GETTEXT_POISON. By using those functions to test output which is\ncorrectly marked as translatable, enables one to detect if the strings\nnewly marked for translation are from plumbing output. If they are\nindeed from plumbing, the test would fail, and the string should be\nunmarked, since it is not seen by users.\n\nThus, it is productive to not have false positives when running the test\nunder GETTEXT_POISON. This commit replaces normal test functions by\ntheir i18n aware variants in use-cases know to be correctly marked for\ntranslation, suppressing false positives.\n\nSigned-off-by: Vasco Almeida <vascomalmeida@sapo.pt>\n---\n t/t0008-ignores.sh                |  4 ++--\n t/t1300-repo-config.sh            |  8 ++++----\n t/t1307-config-blob.sh            |  5 +----\n t/t1308-config-set.sh             |  4 ++--\n t/t1400-update-ref.sh             |  2 +-\n t/t2010-checkout-ambiguous.sh     |  2 +-\n t/t2018-checkout-branch.sh        |  2 +-\n t/t3200-branch.sh                 |  6 +++---\n t/t3201-branch-contains.sh        |  2 +-\n t/t3320-notes-merge-worktrees.sh  |  2 +-\n t/t5505-remote.sh                 |  2 +-\n t/t5510-fetch.sh                  |  2 +-\n t/t5523-push-upstream.sh          |  4 ++--\n t/t5536-fetch-conflicts.sh        |  4 ++--\n t/t6301-for-each-ref-errors.sh    | 10 +++++-----\n t/t7063-status-untracked-cache.sh |  2 +-\n t/t7102-reset.sh                  |  4 ++--\n t/t7400-submodule-basic.sh        |  2 +-\n t/t7403-submodule-sync.sh         |  4 ++--\n t/t7406-submodule-update.sh       | 10 +++++-----\n t/t7508-status.sh                 |  4 ++--\n 21 files changed, 41 insertions(+), 44 deletions(-)\n\ndiff --git a/t/t0008-ignores.sh b/t/t0008-ignores.sh\nindex b425f3a..d27f438 100755\n--- a/t/t0008-ignores.sh\n+++ b/t/t0008-ignores.sh\n@@ -34,7 +34,7 @@ expect_from_stdin () {\n test_stderr () {\n \texpected=\"$1\"\n \texpect_in stderr \"$1\" &&\n-\ttest_cmp \"$HOME/expected-stderr\" \"$HOME/stderr\"\n+\ttest_i18ncmp \"$HOME/expected-stderr\" \"$HOME/stderr\"\n }\n \n broken_c_unquote () {\n@@ -47,7 +47,7 @@ broken_c_unquote_verbose () {\n \n stderr_contains () {\n \tregexp=\"$1\"\n-\tif grep \"$regexp\" \"$HOME/stderr\"\n+\tif test_i18ngrep \"$regexp\" \"$HOME/stderr\"\n \tthen\n \t\treturn 0\n \telse\ndiff --git a/t/t1300-repo-config.sh b/t/t1300-repo-config.sh\nindex d934a24..923bfc5 100755\n--- a/t/t1300-repo-config.sh\n+++ b/t/t1300-repo-config.sh\n@@ -886,7 +886,7 @@ test_expect_success !MINGW 'get --path copes with unset $HOME' '\n \t\tgit config --get --path path.normal >>result &&\n \t\tgit config --get --path path.trailingtilde >>result\n \t) &&\n-\tgrep \"[Ff]ailed to expand.*~/\" msg &&\n+\ttest_i18ngrep \"[Ff]ailed to expand.*~/\" msg &&\n \ttest_cmp expect result\n '\n \n@@ -1126,7 +1126,7 @@ test_expect_success 'barf on syntax error' '\n \tkey garbage\n \tEOF\n \ttest_must_fail git config --get section.key >actual 2>error &&\n-\tgrep \" line 3 \" error\n+\ttest_i18ngrep \" line 3 \" error\n '\n \n test_expect_success 'barf on incomplete section header' '\n@@ -1136,7 +1136,7 @@ test_expect_success 'barf on incomplete section header' '\n \tkey = value\n \tEOF\n \ttest_must_fail git config --get section.key >actual 2>error &&\n-\tgrep \" line 2 \" error\n+\ttest_i18ngrep \" line 2 \" error\n '\n \n test_expect_success 'barf on incomplete string' '\n@@ -1146,7 +1146,7 @@ test_expect_success 'barf on incomplete string' '\n \tkey = \"value string\n \tEOF\n \ttest_must_fail git config --get section.key >actual 2>error &&\n-\tgrep \" line 3 \" error\n+\ttest_i18ngrep \" line 3 \" error\n '\n \n test_expect_success 'urlmatch' '\ndiff --git a/t/t1307-config-blob.sh b/t/t1307-config-blob.sh\nindex 3c6791e..eed31ff 100755\n--- a/t/t1307-config-blob.sh\n+++ b/t/t1307-config-blob.sh\n@@ -61,10 +61,7 @@ test_expect_success 'parse errors in blobs are properly attributed' '\n \tgit commit -m broken &&\n \n \ttest_must_fail git config --blob=HEAD:config some.value 2>err &&\n-\n-\t# just grep for our token as the exact error message is likely to\n-\t# change or be internationalized\n-\tgrep \"HEAD:config\" err\n+\ttest_i18ngrep \"HEAD:config\" err\n '\n \n test_expect_success 'can parse blob ending with CR' '\ndiff --git a/t/t1308-config-set.sh b/t/t1308-config-set.sh\nindex 005d66d..cd62063 100755\n--- a/t/t1308-config-set.sh\n+++ b/t/t1308-config-set.sh\n@@ -197,14 +197,14 @@ test_expect_success 'proper error on error in default config files' '\n \techo \"[\" >>.git/config &&\n \techo \"fatal: bad config line 34 in file .git/config\" >expect &&\n \ttest_expect_code 128 test-config get_value foo.bar 2>actual &&\n-\ttest_cmp expect actual\n+\ttest_i18ncmp expect actual\n '\n \n test_expect_success 'proper error on error in custom config files' '\n \techo \"[\" >>syntax-error &&\n \techo \"fatal: bad config line 1 in file syntax-error\" >expect &&\n \ttest_expect_code 128 test-config configset_get_value foo.bar syntax-error 2>actual &&\n-\ttest_cmp expect actual\n+\ttest_i18ncmp expect actual\n '\n \n test_expect_success 'check line errors for malformed values' '\ndiff --git a/t/t1400-update-ref.sh b/t/t1400-update-ref.sh\nindex af1b20d..75fa654 100755\n--- a/t/t1400-update-ref.sh\n+++ b/t/t1400-update-ref.sh\n@@ -361,7 +361,7 @@ test_expect_success 'stdin test setup' '\n \n test_expect_success '-z fails without --stdin' '\n \ttest_must_fail git update-ref -z $m $m $m 2>err &&\n-\tgrep \"usage: git update-ref\" err\n+\ttest_i18ngrep \"usage: git update-ref\" err\n '\n \n test_expect_success 'stdin works with no input' '\ndiff --git a/t/t2010-checkout-ambiguous.sh b/t/t2010-checkout-ambiguous.sh\nindex 87bdf9c..e76e84a 100755\n--- a/t/t2010-checkout-ambiguous.sh\n+++ b/t/t2010-checkout-ambiguous.sh\n@@ -49,7 +49,7 @@ test_expect_success 'disambiguate checking out from a tree-ish' '\n \n test_expect_success 'accurate error message with more than one ref' '\n \ttest_must_fail git checkout HEAD master -- 2>actual &&\n-\tgrep 2 actual &&\n+\ttest_i18ngrep 2 actual &&\n \ttest_i18ngrep \"one reference expected, 2 given\" actual\n '\n \ndiff --git a/t/t2018-checkout-branch.sh b/t/t2018-checkout-branch.sh\nindex 2741262..2131fb2 100755\n--- a/t/t2018-checkout-branch.sh\n+++ b/t/t2018-checkout-branch.sh\n@@ -124,7 +124,7 @@ test_expect_success 'checkout -b to @{-1} fails with the right branch name' '\n \tgit checkout branch2 &&\n \techo  >expect \"fatal: A branch named '\\''branch1'\\'' already exists.\" &&\n \ttest_must_fail git checkout -b @{-1} 2>actual &&\n-\ttest_cmp expect actual\n+\ttest_i18ncmp expect actual\n '\n \n test_expect_success 'checkout -B to an existing branch resets branch to HEAD' '\ndiff --git a/t/t3200-branch.sh b/t/t3200-branch.sh\nindex f3e3b6c..ac9c764 100755\n--- a/t/t3200-branch.sh\n+++ b/t/t3200-branch.sh\n@@ -550,7 +550,7 @@ If you wanted to make '\"'master'\"' track '\"'origin/master'\"', do this:\n     git branch -d origin/master\n     git branch --set-upstream-to origin/master\n EOF\n-\ttest_cmp expected actual\n+\ttest_i18ncmp expected actual\n '\n \n test_expect_success '--set-upstream with two args only shows the deprecation message' '\n@@ -559,7 +559,7 @@ test_expect_success '--set-upstream with two args only shows the deprecation mes\n \tcat >expected <<EOF &&\n The --set-upstream flag is deprecated and will be removed. Consider using --track or --set-upstream-to\n EOF\n-\ttest_cmp expected actual\n+\ttest_i18ncmp expected actual\n '\n \n test_expect_success '--set-upstream with one arg only shows the deprecation message if the branch existed' '\n@@ -568,7 +568,7 @@ test_expect_success '--set-upstream with one arg only shows the deprecation mess\n \tcat >expected <<EOF &&\n The --set-upstream flag is deprecated and will be removed. Consider using --track or --set-upstream-to\n EOF\n-\ttest_cmp expected actual\n+\ttest_i18ncmp expected actual\n '\n \n test_expect_success '--set-upstream-to notices an error to set branch as own upstream' '\ndiff --git a/t/t3201-branch-contains.sh b/t/t3201-branch-contains.sh\nindex 912a663..7f3ec47 100755\n--- a/t/t3201-branch-contains.sh\n+++ b/t/t3201-branch-contains.sh\n@@ -156,7 +156,7 @@ test_expect_success 'branch --merged with --verbose' '\n \t* topic  2c939f4 [ahead 1] foo\n \t  zzz    c77a0a9 second on master\n \tEOF\n-\ttest_cmp expect actual\n+\ttest_i18ncmp expect actual\n '\n \n test_done\ndiff --git a/t/t3320-notes-merge-worktrees.sh b/t/t3320-notes-merge-worktrees.sh\nindex 1f71d58..522157b 100755\n--- a/t/t3320-notes-merge-worktrees.sh\n+++ b/t/t3320-notes-merge-worktrees.sh\n@@ -52,7 +52,7 @@ test_expect_success 'merge z into y while mid-merge in another workdir fails' '\n \t\tcd worktree &&\n \t\tgit config core.notesRef refs/notes/y &&\n \t\ttest_must_fail git notes merge z 2>err &&\n-\t\tgrep \"A notes merge into refs/notes/y is already in-progress at\" err\n+\t\ttest_i18ngrep \"A notes merge into refs/notes/y is already in-progress at\" err\n \t) &&\n \ttest_path_is_missing .git/worktrees/worktree/NOTES_MERGE_REF\n '\ndiff --git a/t/t5505-remote.sh b/t/t5505-remote.sh\nindex dd2e6ce..8198d8e 100755\n--- a/t/t5505-remote.sh\n+++ b/t/t5505-remote.sh\n@@ -1182,7 +1182,7 @@ test_expect_success 'extra args: setup' '\n test_extra_arg () {\n \ttest_expect_success \"extra args: $*\" \"\n \t\ttest_must_fail git remote $* bogus_extra_arg 2>actual &&\n-\t\tgrep '^usage:' actual\n+\t\ttest_i18ngrep '^usage:' actual\n \t\"\n }\n \ndiff --git a/t/t5510-fetch.sh b/t/t5510-fetch.sh\nindex 454d896..88076da 100755\n--- a/t/t5510-fetch.sh\n+++ b/t/t5510-fetch.sh\n@@ -644,7 +644,7 @@ test_expect_success 'fetch --prune prints the remotes url' '\n \t\tgit fetch --prune origin 2>&1 | head -n1 >../actual\n \t) &&\n \techo \"From ${D}/.\" >expect &&\n-\ttest_cmp expect actual\n+\ttest_i18ncmp expect actual\n '\n \n test_expect_success 'branchname D/F conflict resolved by --prune' '\ndiff --git a/t/t5523-push-upstream.sh b/t/t5523-push-upstream.sh\nindex 3683df1..4a7b98b 100755\n--- a/t/t5523-push-upstream.sh\n+++ b/t/t5523-push-upstream.sh\n@@ -75,7 +75,7 @@ test_expect_success TTY 'progress messages go to tty' '\n \tensure_fresh_upstream &&\n \n \ttest_terminal git push -u upstream master >out 2>err &&\n-\tgrep \"Writing objects\" err\n+\ttest_i18ngrep \"Writing objects\" err\n '\n \n test_expect_success 'progress messages do not go to non-tty' '\n@@ -91,7 +91,7 @@ test_expect_success 'progress messages go to non-tty (forced)' '\n \n \t# force progress messages to stderr, even though it is non-tty\n \tgit push -u --progress upstream master >out 2>err &&\n-\tgrep \"Writing objects\" err\n+\ttest_i18ngrep \"Writing objects\" err\n '\n \n test_expect_success TTY 'push -q suppresses progress' '\ndiff --git a/t/t5536-fetch-conflicts.sh b/t/t5536-fetch-conflicts.sh\nindex 6c5d3a4..2e42cf3 100755\n--- a/t/t5536-fetch-conflicts.sh\n+++ b/t/t5536-fetch-conflicts.sh\n@@ -22,8 +22,8 @@ verify_stderr () {\n \tcat >expected &&\n \t# We're not interested in the error\n \t# \"fatal: The remote end hung up unexpectedly\":\n-\tgrep -E '^(fatal|warning):' <error | grep -v 'hung up' >actual | sort &&\n-\ttest_cmp expected actual\n+\ttest_i18ngrep -E '^(fatal|warning):' <error | grep -v 'hung up' >actual | sort &&\n+\ttest_i18ncmp expected actual\n }\n \n test_expect_success 'setup' '\ndiff --git a/t/t6301-for-each-ref-errors.sh b/t/t6301-for-each-ref-errors.sh\nindex cdb67a0..c734ce2 100755\n--- a/t/t6301-for-each-ref-errors.sh\n+++ b/t/t6301-for-each-ref-errors.sh\n@@ -20,8 +20,8 @@ test_expect_success 'Broken refs are reported correctly' '\n \ttest_when_finished \"rm -f .git/$r\" &&\n \techo \"warning: ignoring broken ref $r\" >broken-err &&\n \tgit for-each-ref >out 2>err &&\n-\ttest_cmp full-list out &&\n-\ttest_cmp broken-err err\n+\ttest_i18ncmp full-list out &&\n+\ttest_i18ncmp broken-err err\n '\n \n test_expect_success 'NULL_SHA1 refs are reported correctly' '\n@@ -31,10 +31,10 @@ test_expect_success 'NULL_SHA1 refs are reported correctly' '\n \techo \"warning: ignoring broken ref $r\" >zeros-err &&\n \tgit for-each-ref >out 2>err &&\n \ttest_cmp full-list out &&\n-\ttest_cmp zeros-err err &&\n+\ttest_i18ncmp zeros-err err &&\n \tgit for-each-ref --format=\"%(objectname) %(refname)\" >brief-out 2>brief-err &&\n \ttest_cmp brief-list brief-out &&\n-\ttest_cmp zeros-err brief-err\n+\ttest_i18ncmp zeros-err brief-err\n '\n \n test_expect_success 'Missing objects are reported correctly' '\n@@ -43,7 +43,7 @@ test_expect_success 'Missing objects are reported correctly' '\n \ttest_when_finished \"rm -f .git/$r\" &&\n \techo \"fatal: missing object $MISSING for $r\" >missing-err &&\n \ttest_must_fail git for-each-ref 2>err &&\n-\ttest_cmp missing-err err &&\n+\ttest_i18ncmp missing-err err &&\n \t(\n \t\tcat brief-list &&\n \t\techo \"$MISSING $r\"\ndiff --git a/t/t7063-status-untracked-cache.sh b/t/t7063-status-untracked-cache.sh\nindex a971884..38b3890 100755\n--- a/t/t7063-status-untracked-cache.sh\n+++ b/t/t7063-status-untracked-cache.sh\n@@ -643,7 +643,7 @@ test_expect_success 'test ident field is working' '\n \tcp -R done dthree dtwo four three ../other_worktree &&\n \tGIT_WORK_TREE=../other_worktree git status 2>../err &&\n \techo \"warning: Untracked cache is disabled on this system or location.\" >../expect &&\n-\ttest_cmp ../expect ../err\n+\ttest_i18ncmp ../expect ../err\n '\n \n test_done\ndiff --git a/t/t7102-reset.sh b/t/t7102-reset.sh\nindex 98bcfe2..86f23be 100755\n--- a/t/t7102-reset.sh\n+++ b/t/t7102-reset.sh\n@@ -66,14 +66,14 @@ test_expect_success 'reset --hard message' '\n \thex=$(git log -1 --format=\"%h\") &&\n \tgit reset --hard > .actual &&\n \techo HEAD is now at $hex $(commit_msg) > .expected &&\n-\ttest_cmp .expected .actual\n+\ttest_i18ncmp .expected .actual\n '\n \n test_expect_success 'reset --hard message (ISO8859-1 logoutputencoding)' '\n \thex=$(git log -1 --format=\"%h\") &&\n \tgit -c \"i18n.logOutputEncoding=$test_encoding\" reset --hard > .actual &&\n \techo HEAD is now at $hex $(commit_msg $test_encoding) > .expected &&\n-\ttest_cmp .expected .actual\n+\ttest_i18ncmp .expected .actual\n '\n \n >.diff_expect\ndiff --git a/t/t7400-submodule-basic.sh b/t/t7400-submodule-basic.sh\nindex 3570f7b..b77cce8 100755\n--- a/t/t7400-submodule-basic.sh\n+++ b/t/t7400-submodule-basic.sh\n@@ -942,7 +942,7 @@ test_expect_success 'submodule deinit from subdirectory' '\n \t\tcd sub &&\n \t\tgit submodule deinit ../init >../output\n \t) &&\n-\tgrep \"\\\\.\\\\./init\" output &&\n+\ttest_i18ngrep \"\\\\.\\\\./init\" output &&\n \ttest -z \"$(git config --get-regexp \"submodule\\.example\\.\")\" &&\n \ttest -n \"$(git config --get-regexp \"submodule\\.example2\\.\")\" &&\n \ttest -f example2/.git &&\ndiff --git a/t/t7403-submodule-sync.sh b/t/t7403-submodule-sync.sh\nindex 5503ec0..0726799 100755\n--- a/t/t7403-submodule-sync.sh\n+++ b/t/t7403-submodule-sync.sh\n@@ -157,7 +157,7 @@ test_expect_success '\"git submodule sync\" should update submodule URLs - subdire\n \t\tcd sub &&\n \t\tgit submodule sync >../../output\n \t) &&\n-\tgrep \"\\\\.\\\\./submodule\" output &&\n+\ttest_i18ngrep \"\\\\.\\\\./submodule\" output &&\n \ttest -d \"$(\n \t\tcd super-clone/submodule &&\n \t\tgit config remote.origin.url\n@@ -188,7 +188,7 @@ test_expect_success '\"git submodule sync --recursive\" should update all submodul\n \t\tcd sub &&\n \t\tgit submodule sync --recursive >../../output\n \t) &&\n-\tgrep \"\\\\.\\\\./submodule/sub-submodule\" output &&\n+\ttest_i18ngrep \"\\\\.\\\\./submodule/sub-submodule\" output &&\n \ttest -d \"$(\n \t\tcd super-clone/submodule &&\n \t\tgit config remote.origin.url\ndiff --git a/t/t7406-submodule-update.sh b/t/t7406-submodule-update.sh\nindex 5f27879..88e9750 100755\n--- a/t/t7406-submodule-update.sh\n+++ b/t/t7406-submodule-update.sh\n@@ -136,8 +136,8 @@ test_expect_success 'submodule update --init --recursive from subdirectory' '\n \t cd tmp &&\n \t git submodule update --init --recursive ../super >../../actual 2>../../actual2\n \t) &&\n-\ttest_cmp expect actual &&\n-\ttest_cmp expect2 actual2\n+\ttest_i18ncmp expect actual &&\n+\ttest_i18ncmp expect2 actual2\n '\n \n apos=\"'\";\n@@ -370,7 +370,7 @@ test_expect_success 'submodule update - command in .git/config catches failure'\n \t(cd super &&\n \t test_must_fail git submodule update submodule 2>../actual\n \t) &&\n-\ttest_cmp actual expect\n+\ttest_i18ncmp actual expect\n '\n \n cat << EOF >expect\n@@ -388,7 +388,7 @@ test_expect_success 'submodule update - command in .git/config catches failure -\n \t mkdir tmp && cd tmp &&\n \t test_must_fail git submodule update ../submodule 2>../../actual\n \t) &&\n-\ttest_cmp actual expect\n+\ttest_i18ncmp actual expect\n '\n \n cat << EOF >expect\n@@ -408,7 +408,7 @@ test_expect_success 'recursive submodule update - command in .git/config catches\n \t mkdir -p tmp && cd tmp &&\n \t test_must_fail git submodule update --recursive ../super 2>../../actual\n \t) &&\n-\ttest_cmp actual expect\n+\ttest_i18ncmp actual expect\n '\n \n test_expect_success 'submodule init does not copy command into .git/config' '\ndiff --git a/t/t7508-status.sh b/t/t7508-status.sh\nindex c3ed7cb..b3bdd16 100755\n--- a/t/t7508-status.sh\n+++ b/t/t7508-status.sh\n@@ -1377,7 +1377,7 @@ EOF\n \tgit config --add -f .gitmodules submodule.subname.ignore all &&\n \tgit config --add -f .gitmodules submodule.subname.path sm &&\n \tgit status > output &&\n-\ttest_cmp expect output &&\n+\ttest_i18ncmp expect output &&\n \tgit config -f .gitmodules  --remove-section submodule.subname\n '\n \n@@ -1387,7 +1387,7 @@ test_expect_success '.git/config ignore=all suppresses unstaged submodule summar\n \tgit config --add submodule.subname.ignore all &&\n \tgit config --add submodule.subname.path sm &&\n \tgit status > output &&\n-\ttest_cmp expect output &&\n+\ttest_i18ncmp expect output &&\n \tgit config --remove-section submodule.subname &&\n \tgit config -f .gitmodules  --remove-section submodule.subname\n '\n-- \n2.6.6\n\n"},{"id":"289498","messageId":"1466194887-18236-22-git-send-email-vascomalmeida@sapo.pt","threadId":"42641","inReplyTo":"1466194887-18236-1-git-send-email-vascomalmeida@sapo.pt","subject":"[PATCH v5 21/38] t4153: fix negated test_i18ngrep call","fromName":"Vasco Almeida","fromEmail":"vascomalmeida@sapo.pt","sentAt":"2016-06-17T20:21:10Z","receivedAt":"2016-06-17T20:25:15Z","isPatch":true,"sender":{"key":"vascomalmeida@sapo.pt","avatar":"https://avatars.githubusercontent.com/u/9001556?v=4"},"body":"The function test_i18ngrep fakes success when run under GETTEXT_POISON.\nHence, running in the following manner will always fail under gettext\npoison:\n\n\t! test_i18ngrep expected actual\n\nUse correct syntax: test_i18ngrep ! expected actual\n\nFor other instance of this issue see 41ca19b (\"tests: fix negated\ntest_i18ngrep calls\", 2014-08-13).\n\nSigned-off-by: Vasco Almeida <vascomalmeida@sapo.pt>\n---\n t/t4153-am-resume-override-opts.sh | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/t/t4153-am-resume-override-opts.sh b/t/t4153-am-resume-override-opts.sh\nindex 7c013d8..8ea22d1 100755\n--- a/t/t4153-am-resume-override-opts.sh\n+++ b/t/t4153-am-resume-override-opts.sh\n@@ -53,7 +53,7 @@ test_expect_success '--no-quiet overrides --quiet' '\n \t# Applying side1 will be quiet.\n \ttest_must_fail git am --quiet side[123].eml >out &&\n \ttest_path_is_dir .git/rebase-apply &&\n-\t! test_i18ngrep \"^Applying: \" out &&\n+\ttest_i18ngrep ! \"^Applying: \" out &&\n \techo side1 >file &&\n \tgit add file &&\n \n-- \n2.6.6\n\n"},{"id":"289499","messageId":"1466194887-18236-26-git-send-email-vascomalmeida@sapo.pt","threadId":"42641","inReplyTo":"1466194887-18236-1-git-send-email-vascomalmeida@sapo.pt","subject":"[PATCH v5 25/38] i18n: notes: mark strings for translation","fromName":"Vasco Almeida","fromEmail":"vascomalmeida@sapo.pt","sentAt":"2016-06-17T20:21:14Z","receivedAt":"2016-06-17T20:25:18Z","isPatch":true,"sender":{"key":"vascomalmeida@sapo.pt","avatar":"https://avatars.githubusercontent.com/u/9001556?v=4"},"body":"Mark strings of messages for the user as translatable.\n\nUpdate tests t3310-notes-merge-manual-resolve.sh and\nt3320-notes-merge-worktrees.sh to reflect new translatable messages.\n\nTests that grep for .git/NOTES_MERGE_WORKTREE reflect the translatable\nstring \"Automatic notes merge failed. Fix conflicts in %s and [...]\".\n\nSigned-off-by: Vasco Almeida <vascomalmeida@sapo.pt>\n---\n builtin/notes.c                       | 20 ++++++++++----------\n t/t3310-notes-merge-manual-resolve.sh |  8 ++++----\n t/t3320-notes-merge-worktrees.sh      |  2 +-\n 3 files changed, 15 insertions(+), 15 deletions(-)\n\ndiff --git a/builtin/notes.c b/builtin/notes.c\nindex c65b59a..d11e6eb 100644\n--- a/builtin/notes.c\n+++ b/builtin/notes.c\n@@ -749,7 +749,7 @@ static int git_config_get_notes_strategy(const char *key,\n \tif (git_config_get_string(key, &value))\n \t\treturn 1;\n \tif (parse_notes_merge_strategy(value, strategy))\n-\t\tgit_die_config(key, \"unknown notes merge strategy %s\", value);\n+\t\tgit_die_config(key, _(\"unknown notes merge strategy %s\"), value);\n \n \tfree(value);\n \treturn 0;\n@@ -788,15 +788,15 @@ static int merge(int argc, const char **argv, const char *prefix)\n \tif (strategy || do_commit + do_abort == 0)\n \t\tdo_merge = 1;\n \tif (do_merge + do_commit + do_abort != 1) {\n-\t\terror(\"cannot mix --commit, --abort or -s/--strategy\");\n+\t\terror(_(\"cannot mix --commit, --abort or -s/--strategy\"));\n \t\tusage_with_options(git_notes_merge_usage, options);\n \t}\n \n \tif (do_merge && argc != 1) {\n-\t\terror(\"Must specify a notes ref to merge\");\n+\t\terror(_(\"Must specify a notes ref to merge\"));\n \t\tusage_with_options(git_notes_merge_usage, options);\n \t} else if (!do_merge && argc) {\n-\t\terror(\"too many parameters\");\n+\t\terror(_(\"too many parameters\"));\n \t\tusage_with_options(git_notes_merge_usage, options);\n \t}\n \n@@ -817,7 +817,7 @@ static int merge(int argc, const char **argv, const char *prefix)\n \n \tif (strategy) {\n \t\tif (parse_notes_merge_strategy(strategy, &o.strategy)) {\n-\t\t\terror(\"Unknown -s/--strategy: %s\", strategy);\n+\t\t\terror(_(\"Unknown -s/--strategy: %s\"), strategy);\n \t\t\tusage_with_options(git_notes_merge_usage, options);\n \t\t}\n \t} else {\n@@ -857,11 +857,11 @@ static int merge(int argc, const char **argv, const char *prefix)\n \t\t\tdie(_(\"A notes merge into %s is already in-progress at %s\"),\n \t\t\t    default_notes_ref(), wt->path);\n \t\tif (create_symref(\"NOTES_MERGE_REF\", default_notes_ref(), NULL))\n-\t\t\tdie(\"Failed to store link to current notes ref (%s)\",\n+\t\t\tdie(_(\"Failed to store link to current notes ref (%s)\"),\n \t\t\t    default_notes_ref());\n-\t\tprintf(\"Automatic notes merge failed. Fix conflicts in %s and \"\n-\t\t       \"commit the result with 'git notes merge --commit', or \"\n-\t\t       \"abort the merge with 'git notes merge --abort'.\\n\",\n+\t\tprintf(_(\"Automatic notes merge failed. Fix conflicts in %s and \"\n+\t\t\t \"commit the result with 'git notes merge --commit', or \"\n+\t\t\t \"abort the merge with 'git notes merge --abort'.\\n\"),\n \t\t       git_path(NOTES_MERGE_WORKTREE));\n \t}\n \n@@ -964,7 +964,7 @@ static int get_ref(int argc, const char **argv, const char *prefix)\n \t\t\t     git_notes_get_ref_usage, 0);\n \n \tif (argc) {\n-\t\terror(\"too many parameters\");\n+\t\terror(_(\"too many parameters\"));\n \t\tusage_with_options(git_notes_get_ref_usage, options);\n \t}\n \ndiff --git a/t/t3310-notes-merge-manual-resolve.sh b/t/t3310-notes-merge-manual-resolve.sh\nindex d557212..6967436 100755\n--- a/t/t3310-notes-merge-manual-resolve.sh\n+++ b/t/t3310-notes-merge-manual-resolve.sh\n@@ -178,7 +178,7 @@ test_expect_success 'merge z into m (== y) with default (\"manual\") resolver => C\n \tgit config core.notesRef refs/notes/m &&\n \ttest_must_fail git notes merge z >output &&\n \t# Output should point to where to resolve conflicts\n-\tgrep -q \"\\\\.git/NOTES_MERGE_WORKTREE\" output &&\n+\ttest_i18ngrep \"\\\\.git/NOTES_MERGE_WORKTREE\" output &&\n \t# Inspect merge conflicts\n \tls .git/NOTES_MERGE_WORKTREE >output_conflicts &&\n \ttest_cmp expect_conflicts output_conflicts &&\n@@ -381,7 +381,7 @@ test_expect_success 'redo merge of z into m (== y) with default (\"manual\") resol\n \tgit config core.notesRef refs/notes/m &&\n \ttest_must_fail git notes merge z >output &&\n \t# Output should point to where to resolve conflicts\n-\tgrep -q \"\\\\.git/NOTES_MERGE_WORKTREE\" output &&\n+\ttest_i18ngrep \"\\\\.git/NOTES_MERGE_WORKTREE\" output &&\n \t# Inspect merge conflicts\n \tls .git/NOTES_MERGE_WORKTREE >output_conflicts &&\n \ttest_cmp expect_conflicts output_conflicts &&\n@@ -415,7 +415,7 @@ git rev-parse refs/notes/z > pre_merge_z\n test_expect_success 'redo merge of z into m (== y) with default (\"manual\") resolver => Conflicting 3-way merge' '\n \ttest_must_fail git notes merge z >output &&\n \t# Output should point to where to resolve conflicts\n-\tgrep -q \"\\\\.git/NOTES_MERGE_WORKTREE\" output &&\n+\ttest_i18ngrep \"\\\\.git/NOTES_MERGE_WORKTREE\" output &&\n \t# Inspect merge conflicts\n \tls .git/NOTES_MERGE_WORKTREE >output_conflicts &&\n \ttest_cmp expect_conflicts output_conflicts &&\n@@ -496,7 +496,7 @@ test_expect_success 'redo merge of z into m (== y) with default (\"manual\") resol\n \tgit update-ref refs/notes/m refs/notes/y &&\n \ttest_must_fail git notes merge z >output &&\n \t# Output should point to where to resolve conflicts\n-\tgrep -q \"\\\\.git/NOTES_MERGE_WORKTREE\" output &&\n+\ttest_i18ngrep \"\\\\.git/NOTES_MERGE_WORKTREE\" output &&\n \t# Inspect merge conflicts\n \tls .git/NOTES_MERGE_WORKTREE >output_conflicts &&\n \ttest_cmp expect_conflicts output_conflicts &&\ndiff --git a/t/t3320-notes-merge-worktrees.sh b/t/t3320-notes-merge-worktrees.sh\nindex 522157b..6e05115 100755\n--- a/t/t3320-notes-merge-worktrees.sh\n+++ b/t/t3320-notes-merge-worktrees.sh\n@@ -62,7 +62,7 @@ test_expect_success 'merge z into x while mid-merge on y succeeds' '\n \t\tcd worktree2 &&\n \t\tgit config core.notesRef refs/notes/x &&\n \t\ttest_must_fail git notes merge z 2>&1 >out &&\n-\t\tgrep \"Automatic notes merge failed\" out &&\n+\t\ttest_i18ngrep \"Automatic notes merge failed\" out &&\n \t\tgrep -v \"A notes merge into refs/notes/x is already in-progress in\" out\n \t) &&\n \techo \"ref: refs/notes/x\" >expect &&\n-- \n2.6.6\n\n"},{"id":"289500","messageId":"1466194887-18236-20-git-send-email-vascomalmeida@sapo.pt","threadId":"42641","inReplyTo":"1466194887-18236-1-git-send-email-vascomalmeida@sapo.pt","subject":"[PATCH v5 19/38] tests: unpack-trees: update to use test_i18n* functions","fromName":"Vasco Almeida","fromEmail":"vascomalmeida@sapo.pt","sentAt":"2016-06-17T20:21:08Z","receivedAt":"2016-06-17T20:25:22Z","isPatch":true,"sender":{"key":"vascomalmeida@sapo.pt","avatar":"https://avatars.githubusercontent.com/u/9001556?v=4"},"body":"Use functions test_i18ncmp and test_i18ngrep to successfully pass tests\nrunning under GETTEXT_POISON.\n\nThe output strings compared to in these test were marked for translation\nin ed47fdf (\"i18n: unpack-trees: mark strings for translation\",\n2016-04-09) and later improved in 2e3926b (\"i18n: unpack-trees: avoid\nsubstituting only a verb in sentences\", 2016-05-12).\n\nSigned-off-by: Vasco Almeida <vascomalmeida@sapo.pt>\n---\n t/t1011-read-tree-sparse-checkout.sh | 2 +-\n t/t3400-rebase.sh                    | 4 ++--\n t/t3404-rebase-interactive.sh        | 4 ++--\n t/t7607-merge-overwrite.sh           | 2 +-\n 4 files changed, 6 insertions(+), 6 deletions(-)\n\ndiff --git a/t/t1011-read-tree-sparse-checkout.sh b/t/t1011-read-tree-sparse-checkout.sh\nindex 0c74bee..3583105 100755\n--- a/t/t1011-read-tree-sparse-checkout.sh\n+++ b/t/t1011-read-tree-sparse-checkout.sh\n@@ -247,7 +247,7 @@ error: The following untracked working tree files would be overwritten by checko\n Please move or remove them before you can switch branches.\n Aborting\n EOF\n-\ttest_cmp expected actual\n+\ttest_i18ncmp expected actual\n '\n \n test_expect_success 'checkout without --ignore-skip-worktree-bits' '\ndiff --git a/t/t3400-rebase.sh b/t/t3400-rebase.sh\nindex 47b5682..f5fd15e 100755\n--- a/t/t3400-rebase.sh\n+++ b/t/t3400-rebase.sh\n@@ -136,8 +136,8 @@ test_expect_success 'setup: recover' '\n test_expect_success 'Show verbose error when HEAD could not be detached' '\n \t>B &&\n \ttest_must_fail git rebase topic 2>output.err >output.out &&\n-\tgrep \"The following untracked working tree files would be overwritten by checkout:\" output.err &&\n-\tgrep B output.err\n+\ttest_i18ngrep \"The following untracked working tree files would be overwritten by checkout:\" output.err &&\n+\ttest_i18ngrep B output.err\n '\n rm -f B\n \ndiff --git a/t/t3404-rebase-interactive.sh b/t/t3404-rebase-interactive.sh\nindex f4ccd10..8ac1868 100755\n--- a/t/t3404-rebase-interactive.sh\n+++ b/t/t3404-rebase-interactive.sh\n@@ -219,9 +219,9 @@ test_expect_success 'abort with error when new base cannot be checked out' '\n \tgit commit -m \"remove file in base\" &&\n \tset_fake_editor &&\n \ttest_must_fail git rebase -i master > output 2>&1 &&\n-\tgrep \"The following untracked working tree files would be overwritten by checkout:\" \\\n+\ttest_i18ngrep \"The following untracked working tree files would be overwritten by checkout:\" \\\n \t\toutput &&\n-\tgrep \"file1\" output &&\n+\ttest_i18ngrep \"file1\" output &&\n \ttest_path_is_missing .git/rebase-merge &&\n \tgit reset --hard HEAD^\n '\ndiff --git a/t/t7607-merge-overwrite.sh b/t/t7607-merge-overwrite.sh\nindex 758a623..e8ec54c 100755\n--- a/t/t7607-merge-overwrite.sh\n+++ b/t/t7607-merge-overwrite.sh\n@@ -125,7 +125,7 @@ test_expect_success 'will not overwrite untracked file in leading path' '\n \tcp important sub &&\n \tcp important sub2 &&\n \ttest_must_fail git merge sub 2>out &&\n-\ttest_cmp out expect &&\n+\ttest_i18ncmp out expect &&\n \ttest_path_is_missing .git/MERGE_HEAD &&\n \ttest_cmp important sub &&\n \ttest_cmp important sub2 &&\n-- \n2.6.6\n\n"},{"id":"289501","messageId":"1466194887-18236-16-git-send-email-vascomalmeida@sapo.pt","threadId":"42641","inReplyTo":"1466194887-18236-1-git-send-email-vascomalmeida@sapo.pt","subject":"[PATCH v5 15/38] i18n: rebase-interactive: mark here-doc strings for translation","fromName":"Vasco Almeida","fromEmail":"vascomalmeida@sapo.pt","sentAt":"2016-06-17T20:21:04Z","receivedAt":"2016-06-17T20:25:45Z","isPatch":true,"sender":{"key":"vascomalmeida@sapo.pt","avatar":"https://avatars.githubusercontent.com/u/9001556?v=4"},"body":"Use pipe to send gettext output to git stripspace instead of the\noriginal method of using shell here-document, because command\nsubstitution '$(...)' would not take place inside the here-documents.\nThe exception is the case of the last here-document redirecting to cat,\nin which commands substitution works and, thus, is preserved in this\ncommit.\n\nt3404: adapt test to the strings newly marked for translation\nTest t3404-rebase-interactive.sh would fail under GETTEXT_POISON unless\nusing test_i18ngrep.\n\nAdd eval_ngettext fallback functions to be called when running, for\ninstance, under GETTEXT_POISON. Otherwise, tests would fail under\nGETTEXT_POISON, or other build that doesn't support the GNU gettext,\nbecause that function could not be found.\n\nSigned-off-by: Vasco Almeida <vascomalmeida@sapo.pt>\n---\n git-rebase--interactive.sh    | 30 +++++++++++++++---------------\n git-sh-i18n.sh                | 18 ++++++++++++++++++\n t/t3404-rebase-interactive.sh | 14 +++++++-------\n 3 files changed, 40 insertions(+), 22 deletions(-)\n\ndiff --git a/git-rebase--interactive.sh b/git-rebase--interactive.sh\nindex 2b8a845..a16ce3a 100644\n--- a/git-rebase--interactive.sh\n+++ b/git-rebase--interactive.sh\n@@ -144,29 +144,28 @@ reschedule_last_action () {\n }\n \n append_todo_help () {\n-\tgit stripspace --comment-lines >>\"$todo\" <<\\EOF\n-\n+\tgettext \"\n Commands:\n  p, pick = use commit\n  r, reword = use commit, but edit the commit message\n  e, edit = use commit, but stop for amending\n  s, squash = use commit, but meld into previous commit\n- f, fixup = like \"squash\", but discard this commit's log message\n+ f, fixup = like \\\"squash\\\", but discard this commit's log message\n  x, exec = run command (the rest of the line) using shell\n  d, drop = remove commit\n \n These lines can be re-ordered; they are executed from top to bottom.\n+\" | git stripspace --comment-lines >>\"$todo\"\n \n-EOF\n \tif test $(get_missing_commit_check_level) = error\n \tthen\n-\t\tgit stripspace --comment-lines >>\"$todo\" <<\\EOF\n+\t\tgettext \"\n Do not remove any line. Use 'drop' explicitly to remove a commit.\n-EOF\n+\" | git stripspace --comment-lines >>\"$todo\"\n \telse\n-\t\tgit stripspace --comment-lines >>\"$todo\" <<\\EOF\n+\t\tgettext \"\n If you remove a line here THAT COMMIT WILL BE LOST.\n-EOF\n+\" | git stripspace --comment-lines >>\"$todo\"\n \tfi\n }\n \n@@ -1122,13 +1121,12 @@ edit-todo)\n \tmv -f \"$todo\".new \"$todo\"\n \tcollapse_todo_ids\n \tappend_todo_help\n-\tgit stripspace --comment-lines >>\"$todo\" <<\\EOF\n-\n+\tgettext \"\n You are editing the todo file of an ongoing interactive rebase.\n To continue rebase after editing, run:\n     git rebase --continue\n \n-EOF\n+\" | git stripspace --comment-lines >>\"$todo\"\n \n \tgit_sequence_editor \"$todo\" ||\n \t\tdie \"$(gettext \"Could not execute editor\")\"\n@@ -1269,14 +1267,16 @@ todocount=${todocount##* }\n \n cat >>\"$todo\" <<EOF\n \n-$comment_char Rebase $shortrevisions onto $shortonto ($todocount command(s))\n+$comment_char $(eval_ngettext \\\n+\t\"Rebase \\$shortrevisions onto \\$shortonto (\\$todocount command)\" \\\n+\t\"Rebase \\$shortrevisions onto \\$shortonto (\\$todocount commands)\" \\\n+\t\"$todocount\")\n EOF\n append_todo_help\n-git stripspace --comment-lines >>\"$todo\" <<\\EOF\n-\n+gettext \"\n However, if you remove everything, the rebase will be aborted.\n \n-EOF\n+\" | git stripspace --comment-lines >>\"$todo\"\n \n if test -z \"$keep_empty\"\n then\ndiff --git a/git-sh-i18n.sh b/git-sh-i18n.sh\nindex e6c3116..1ef1889 100644\n--- a/git-sh-i18n.sh\n+++ b/git-sh-i18n.sh\n@@ -53,6 +53,13 @@ gettext_without_eval_gettext)\n \t\t\tgit sh-i18n--envsubst \"$1\"\n \t\t)\n \t}\n+\n+\teval_ngettext () {\n+\t\tngettext \"$1\" \"$2\" \"$3\" | (\n+\t\t\texport PATH $(git sh-i18n--envsubst --variables \"$2\");\n+\t\t\tgit sh-i18n--envsubst \"$2\"\n+\t\t)\n+\t}\n \t;;\n poison)\n \t# Emit garbage so that tests that incorrectly rely on translatable\n@@ -64,6 +71,10 @@ poison)\n \teval_gettext () {\n \t\tprintf \"%s\" \"# GETTEXT POISON #\"\n \t}\n+\n+\teval_ngettext () {\n+\t\tprintf \"%s\" \"# GETTEXT POISON #\"\n+\t}\n \t;;\n *)\n \tgettext () {\n@@ -76,6 +87,13 @@ poison)\n \t\t\tgit sh-i18n--envsubst \"$1\"\n \t\t)\n \t}\n+\n+\teval_ngettext () {\n+\t\t(test \"$3\" = 1 && printf \"%s\" \"$1\" || printf \"%s\" \"$2\") | (\n+\t\t\texport PATH $(git sh-i18n--envsubst --variables \"$2\");\n+\t\t\tgit sh-i18n--envsubst \"$2\"\n+\t\t)\n+\t}\n \t;;\n esac\n \ndiff --git a/t/t3404-rebase-interactive.sh b/t/t3404-rebase-interactive.sh\nindex 66348f1..f4ccd10 100755\n--- a/t/t3404-rebase-interactive.sh\n+++ b/t/t3404-rebase-interactive.sh\n@@ -540,7 +540,7 @@ test_expect_success 'clean error after failed \"exec\"' '\n \techo \"edited again\" > file7 &&\n \tgit add file7 &&\n \ttest_must_fail git rebase --continue 2>error &&\n-\tgrep \"You have staged changes in your working tree.\" error\n+\ttest_i18ngrep \"You have staged changes in your working tree.\" error\n '\n \n test_expect_success 'rebase a detached HEAD' '\n@@ -1060,7 +1060,7 @@ test_expect_success 'todo count' '\n \tEOF\n \ttest_set_editor \"$(pwd)/dump-raw.sh\" &&\n \tgit rebase -i HEAD~4 >actual &&\n-\tgrep \"^# Rebase ..* onto ..* ([0-9]\" actual\n+\ttest_i18ngrep \"^# Rebase ..* onto ..* ([0-9]\" actual\n '\n \n test_expect_success 'rebase -i commits that overwrite untracked files (pick)' '\n@@ -1160,7 +1160,7 @@ test_expect_success 'rebase -i respects rebase.missingCommitsCheck = ignore' '\n \tFAKE_LINES=\"1 2 3 4\" \\\n \t\tgit rebase -i --root 2>actual &&\n \ttest D = $(git cat-file commit HEAD | sed -ne \\$p) &&\n-\ttest_cmp expect actual\n+\ttest_i18ncmp expect actual\n '\n \n cat >expect <<EOF\n@@ -1181,7 +1181,7 @@ test_expect_success 'rebase -i respects rebase.missingCommitsCheck = warn' '\n \tset_fake_editor &&\n \tFAKE_LINES=\"1 2 3 4\" \\\n \t\tgit rebase -i --root 2>actual &&\n-\ttest_cmp expect actual &&\n+\ttest_i18ncmp expect actual &&\n \ttest D = $(git cat-file commit HEAD | sed -ne \\$p)\n '\n \n@@ -1205,7 +1205,7 @@ test_expect_success 'rebase -i respects rebase.missingCommitsCheck = error' '\n \tset_fake_editor &&\n \ttest_must_fail env FAKE_LINES=\"1 2 4\" \\\n \t\tgit rebase -i --root 2>actual &&\n-\ttest_cmp expect actual &&\n+\ttest_i18ncmp expect actual &&\n \tcp .git/rebase-merge/git-rebase-todo.backup \\\n \t\t.git/rebase-merge/git-rebase-todo &&\n \tFAKE_LINES=\"1 2 drop 3 4 drop 5\" \\\n@@ -1228,7 +1228,7 @@ test_expect_success 'static check of bad command' '\n \tset_fake_editor &&\n \ttest_must_fail env FAKE_LINES=\"1 2 3 bad 4 5\" \\\n \t\tgit rebase -i --root 2>actual &&\n-\ttest_cmp expect actual &&\n+\ttest_i18ncmp expect actual &&\n \tFAKE_LINES=\"1 2 3 drop 4 5\" git rebase --edit-todo &&\n \tgit rebase --continue &&\n \ttest E = $(git cat-file commit HEAD | sed -ne \\$p) &&\n@@ -1263,7 +1263,7 @@ test_expect_success 'static check of bad SHA-1' '\n \tset_fake_editor &&\n \ttest_must_fail env FAKE_LINES=\"1 2 edit fakesha 3 4 5 #\" \\\n \t\tgit rebase -i --root 2>actual &&\n-\ttest_cmp expect actual &&\n+\ttest_i18ncmp expect actual &&\n \tFAKE_LINES=\"1 2 4 5 6\" git rebase --edit-todo &&\n \tgit rebase --continue &&\n \ttest E = $(git cat-file commit HEAD | sed -ne \\$p)\n-- \n2.6.6\n\n"},{"id":"289502","messageId":"1466194887-18236-11-git-send-email-vascomalmeida@sapo.pt","threadId":"42641","inReplyTo":"1466194887-18236-1-git-send-email-vascomalmeida@sapo.pt","subject":"[PATCH v5 10/38] i18n: rebase: mark placeholder for translation","fromName":"Vasco Almeida","fromEmail":"vascomalmeida@sapo.pt","sentAt":"2016-06-17T20:20:59Z","receivedAt":"2016-06-17T20:25:50Z","isPatch":true,"sender":{"key":"vascomalmeida@sapo.pt","avatar":"https://avatars.githubusercontent.com/u/9001556?v=4"},"body":"Mark placeholder \"<branch>\" in git-rebase.sh for translation. The string\ncontaining the named placeholder is passed to shell function\nerror_on_missing_default_upstream in git-parse-remote.sh which uses it\nto display a command hint for the user.\n\nSigned-off-by: Vasco Almeida <vascomalmeida@sapo.pt>\n---\n git-rebase.sh | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/git-rebase.sh b/git-rebase.sh\nindex 1fadc04..9ba21ab 100755\n--- a/git-rebase.sh\n+++ b/git-rebase.sh\n@@ -449,7 +449,7 @@ then\n \t\tthen\n \t\t\t. git-parse-remote\n \t\t\terror_on_missing_default_upstream \"rebase\" \"rebase\" \\\n-\t\t\t\t\"against\" \"git rebase <branch>\"\n+\t\t\t\t\"against\" \"git rebase $(gettext '<branch>')\"\n \t\tfi\n \n \t\ttest \"$fork_point\" = auto && fork_point=t\n-- \n2.6.6\n\n"},{"id":"289503","messageId":"1466194887-18236-14-git-send-email-vascomalmeida@sapo.pt","threadId":"42641","inReplyTo":"1466194887-18236-1-git-send-email-vascomalmeida@sapo.pt","subject":"[PATCH v5 13/38] i18n: git-sh-setup.sh: mark strings for translation","fromName":"Vasco Almeida","fromEmail":"vascomalmeida@sapo.pt","sentAt":"2016-06-17T20:21:02Z","receivedAt":"2016-06-17T20:25:57Z","isPatch":true,"sender":{"key":"vascomalmeida@sapo.pt","avatar":"https://avatars.githubusercontent.com/u/9001556?v=4"},"body":"Positional arguments, such as $0, $1, etc, need to be stored on shell\nvariables for use in translatable strings, according to gettext manual\n[1].\n\nAdd git-sh-setup.sh to LOCALIZED_SH variable in Makefile to enable\nextraction of string marked for translation by xgettext.\n\nSource git-sh-i18n in git-sh-setup.sh for gettext support.\ngit-sh-setup.sh is a shell library to be sourced by other shell scripts.\nIn order to avoid other scripts from sourcing git-sh-i18n twice, remove\nline that sources it from them.  Not sourcing git-sh-i18n in any script\nthat uses gettext would lead to failure due to, for instance, gettextln\nnot being found.\n\n[1] http://www.gnu.org/software/gettext/manual/html_node/Preparing-Shell-Scripts.html\n\nSigned-off-by: Vasco Almeida <vascomalmeida@sapo.pt>\n---\n Makefile             |  4 +++-\n git-bisect.sh        |  1 -\n git-merge-octopus.sh |  1 -\n git-rebase.sh        |  1 -\n git-sh-setup.sh      | 63 +++++++++++++++++++++++++++++++++++++++-------------\n git-stash.sh         |  1 -\n git-submodule.sh     |  1 -\n 7 files changed, 50 insertions(+), 22 deletions(-)\n\ndiff --git a/Makefile b/Makefile\nindex de5a030..6169389 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -2063,7 +2063,9 @@ 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) git-parse-remote.sh\n+LOCALIZED_SH = $(SCRIPT_SH)\n+LOCALIZED_SH += git-parse-remote.sh\n+LOCALIZED_SH += git-sh-setup.sh\n LOCALIZED_PERL = $(SCRIPT_PERL)\n \n ifdef XGETTEXT_INCLUDE_TESTS\ndiff --git a/git-bisect.sh b/git-bisect.sh\nindex 737bf05..30d01bb 100755\n--- a/git-bisect.sh\n+++ b/git-bisect.sh\n@@ -33,7 +33,6 @@ Please use \"git help bisect\" to get the full man page.'\n \n OPTIONS_SPEC=\n . git-sh-setup\n-. git-sh-i18n\n \n _x40='[0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]'\n _x40=\"$_x40$_x40$_x40$_x40$_x40$_x40$_x40$_x40\"\ndiff --git a/git-merge-octopus.sh b/git-merge-octopus.sh\nindex d79fc84..308eafd 100755\n--- a/git-merge-octopus.sh\n+++ b/git-merge-octopus.sh\n@@ -6,7 +6,6 @@\n #\n \n . git-sh-setup\n-. git-sh-i18n\n \n LF='\n '\ndiff --git a/git-rebase.sh b/git-rebase.sh\nindex 9ba21ab..04f6e44 100755\n--- a/git-rebase.sh\n+++ b/git-rebase.sh\n@@ -45,7 +45,6 @@ skip!              skip current patch and continue\n edit-todo!         edit the todo list during an interactive rebase\n \"\n . git-sh-setup\n-. git-sh-i18n\n set_reflog_action rebase\n require_work_tree_exists\n cd_to_toplevel\ndiff --git a/git-sh-setup.sh b/git-sh-setup.sh\nindex c48139a..2eda134 100644\n--- a/git-sh-setup.sh\n+++ b/git-sh-setup.sh\n@@ -2,6 +2,9 @@\n # to set up some variables pointing at the normal git directories and\n # a few helper shell functions.\n \n+# Source git-sh-i18n for gettext support.\n+. git-sh-i18n\n+\n # Having this variable in your environment would break scripts because\n # you would cause \"cd\" to be taken to unexpected places.  If you\n # like CDPATH, define it for your interactive shell sessions without\n@@ -83,16 +86,16 @@ if test -n \"$OPTIONS_SPEC\"; then\n else\n \tdashless=$(basename -- \"$0\" | sed -e 's/-/ /')\n \tusage() {\n-\t\tdie \"usage: $dashless $USAGE\"\n+\t\tdie \"$(eval_gettext \"usage: \\$dashless \\$USAGE\")\"\n \t}\n \n \tif [ -z \"$LONG_USAGE\" ]\n \tthen\n-\t\tLONG_USAGE=\"usage: $dashless $USAGE\"\n+\t\tLONG_USAGE=\"$(eval_gettext \"usage: \\$dashless \\$USAGE\")\"\n \telse\n-\t\tLONG_USAGE=\"usage: $dashless $USAGE\n+\t\tLONG_USAGE=\"$(eval_gettext \"usage: \\$dashless \\$USAGE\n \n-$LONG_USAGE\"\n+$LONG_USAGE\")\"\n \tfi\n \n \tcase \"$1\" in\n@@ -182,7 +185,7 @@ is_bare_repository () {\n cd_to_toplevel () {\n \tcdup=$(git rev-parse --show-toplevel) &&\n \tcd \"$cdup\" || {\n-\t\techo >&2 \"Cannot chdir to $cdup, the toplevel of the working tree\"\n+\t\tgettextln \"Cannot chdir to \\$cdup, the toplevel of the working tree\" >&2\n \t\texit 1\n \t}\n }\n@@ -190,13 +193,16 @@ cd_to_toplevel () {\n require_work_tree_exists () {\n \tif test \"z$(git rev-parse --is-bare-repository)\" != zfalse\n \tthen\n-\t\tdie \"fatal: $0 cannot be used without a working tree.\"\n+\t\tprogram_name=$0\n+\t\tdie \"$(gettext \"fatal: \\$program_name cannot be used without a working tree.\")\"\n \tfi\n }\n \n require_work_tree () {\n-\ttest \"$(git rev-parse --is-inside-work-tree 2>/dev/null)\" = true ||\n-\tdie \"fatal: $0 cannot be used without a working tree.\"\n+\ttest \"$(git rev-parse --is-inside-work-tree 2>/dev/null)\" = true || {\n+\t\tprogram_name=$0\n+\t\tdie \"$(gettext \"fatal: \\$program_name cannot be used without a working tree.\")\"\n+\t}\n }\n \n require_clean_work_tree () {\n@@ -206,24 +212,49 @@ require_clean_work_tree () {\n \n \tif ! git diff-files --quiet --ignore-submodules\n \tthen\n-\t\techo >&2 \"Cannot $1: You have unstaged changes.\"\n+\t\taction=$1\n+\t\tcase \"$action\" in\n+\t\trebase)\n+\t\t\tgettextln \"Cannot rebase: You have unstaged changes.\" >&2\n+\t\t\t;;\n+\t\t\"rewrite branches\")\n+\t\t\tgettextln \"Cannot rewrite branches: You have unstaged changes.\" >&2\n+\t\t\t;;\n+\t\t\"pull with rebase\")\n+\t\t\tgettextln \"Cannot pull with rebase: You have unstaged changes.\" >&2\n+\t\t\t;;\n+\t\t*)\n+\t\t\teval_gettextln \"Cannot \\$action: You have unstaged changes.\" >&2\n+\t\t\t;;\n+\t\tesac\n \t\terr=1\n \tfi\n \n \tif ! git diff-index --cached --quiet --ignore-submodules HEAD --\n \tthen\n-\t\tif [ $err = 0 ]\n+\t\tif test $err = 0\n \t\tthen\n-\t\t    echo >&2 \"Cannot $1: Your index contains uncommitted changes.\"\n+\t\t\taction=$1\n+\t\t\tcase \"$action\" in\n+\t\t\trebase)\n+\t\t\t\tgettextln \"Cannot rebase: Your index contains uncommitted changes.\" >&2\n+\t\t\t\t;;\n+\t\t\t\"pull with rebase\")\n+\t\t\t\tgettextln \"Cannot pull with rebase: Your index contains uncommitted changes.\" >&2\n+\t\t\t\t;;\n+\t\t\t*)\n+\t\t\t\teval_gettextln \"Cannot \\$action: Your index contains uncommitted changes.\" >&2\n+\t\t\t\t;;\n+\t\t\tesac\n \t\telse\n-\t\t    echo >&2 \"Additionally, your index contains uncommitted changes.\"\n+\t\t    gettextln \"Additionally, your index contains uncommitted changes.\" >&2\n \t\tfi\n \t\terr=1\n \tfi\n \n-\tif [ $err = 1 ]\n+\tif test $err = 1\n \tthen\n-\t\ttest -n \"$2\" && echo >&2 \"$2\"\n+\t\ttest -n \"$2\" && echo \"$2\" >&2\n \t\texit 1\n \tfi\n }\n@@ -336,12 +367,12 @@ git_dir_init () {\n \tthen\n \t\ttest -z \"$(git rev-parse --show-cdup)\" || {\n \t\t\texit=$?\n-\t\t\techo >&2 \"You need to run this command from the toplevel of the working tree.\"\n+\t\t\tgettextln \"You need to run this command from the toplevel of the working tree.\" >&2\n \t\t\texit $exit\n \t\t}\n \tfi\n \ttest -n \"$GIT_DIR\" && GIT_DIR=$(cd \"$GIT_DIR\" && pwd) || {\n-\t\techo >&2 \"Unable to determine absolute path of git directory\"\n+\t\tgettextln \"Unable to determine absolute path of git directory\" >&2\n \t\texit 1\n \t}\n \t: ${GIT_OBJECT_DIRECTORY=\"$(git rev-parse --git-path objects)\"}\ndiff --git a/git-stash.sh b/git-stash.sh\nindex c7509e8..22fb8bc 100755\n--- a/git-stash.sh\n+++ b/git-stash.sh\n@@ -15,7 +15,6 @@ SUBDIRECTORY_OK=Yes\n OPTIONS_SPEC=\n START_DIR=$(pwd)\n . git-sh-setup\n-. git-sh-i18n\n require_work_tree\n cd_to_toplevel\n \ndiff --git a/git-submodule.sh b/git-submodule.sh\nindex 7fe8a51..5b9674a 100755\n--- a/git-submodule.sh\n+++ b/git-submodule.sh\n@@ -16,7 +16,6 @@ USAGE=\"[--quiet] add [-b <branch>] [-f|--force] [--name <name>] [--reference <re\n OPTIONS_SPEC=\n SUBDIRECTORY_OK=Yes\n . git-sh-setup\n-. git-sh-i18n\n . git-parse-remote\n require_work_tree\n wt_prefix=$(git rev-parse --show-prefix)\n-- \n2.6.6\n\n"},{"id":"289504","messageId":"1466194887-18236-17-git-send-email-vascomalmeida@sapo.pt","threadId":"42641","inReplyTo":"1466194887-18236-1-git-send-email-vascomalmeida@sapo.pt","subject":"[PATCH v5 16/38] i18n: rebase-interactive: mark comments of squash for translation","fromName":"Vasco Almeida","fromEmail":"vascomalmeida@sapo.pt","sentAt":"2016-06-17T20:21:05Z","receivedAt":"2016-06-17T20:25:59Z","isPatch":true,"sender":{"key":"vascomalmeida@sapo.pt","avatar":"https://avatars.githubusercontent.com/u/9001556?v=4"},"body":"Mark comment messages of squash/fixup file ($squash_msg) for\ntranslation.\n\nHelper functions this_nth_commit_message and skip_nth_commit_message\nreplace the previous method of making the comment messages (such as\n\"This is the 2nd commit message:\") aided by nth_string helper function.\nThis step was taken as a workaround to enabled translation of entire\nsentences. However, doesn't change any text seen in English by the user,\nexcept for string \"The first commit's message is:\" which was changed to\nmatch the style of other instances.\n\nThe test t3404-rebase-interactive.sh resorts to set_fake_editor which\ndidn't account for GETTEXT_POISON. Fix it by assuming success when we\nfind dummy gettext poison output where was supposed to find the first\ncomment line \"This is a combination of $count commits.\".\n\nFor that same message, use plural aware eval_ngettext instead of\neval_gettext, since other languages have more complex plural forms.\n\nSigned-off-by: Vasco Almeida <vascomalmeida@sapo.pt>\n---\n git-rebase--interactive.sh | 69 +++++++++++++++++++++++++++++++++++++---------\n t/lib-rebase.sh            |  1 +\n 2 files changed, 57 insertions(+), 13 deletions(-)\n\ndiff --git a/git-rebase--interactive.sh b/git-rebase--interactive.sh\nindex a16ce3a..0446efd 100644\n--- a/git-rebase--interactive.sh\n+++ b/git-rebase--interactive.sh\n@@ -401,12 +401,52 @@ pick_one_preserving_merges () {\n \tesac\n }\n \n-nth_string () {\n-\tcase \"$1\" in\n-\t*1[0-9]|*[04-9]) echo \"$1\"th;;\n-\t*1) echo \"$1\"st;;\n-\t*2) echo \"$1\"nd;;\n-\t*3) echo \"$1\"rd;;\n+this_nth_commit_message () {\n+\tn=$1\n+\tcase \"$n\" in\n+\t1) gettext \"This is the 1st commit message:\";;\n+\t2) gettext \"This is the 2nd commit message:\";;\n+\t3) gettext \"This is the 3rd commit message:\";;\n+\t4) gettext \"This is the 4th commit message:\";;\n+\t5) gettext \"This is the 5th commit message:\";;\n+\t6) gettext \"This is the 6th commit message:\";;\n+\t7) gettext \"This is the 7th commit message:\";;\n+\t8) gettext \"This is the 8th commit message:\";;\n+\t9) gettext \"This is the 9th commit message:\";;\n+\t10) gettext \"This is the 10th commit message:\";;\n+\t# TRANSLATORS: if the language you are translating into\n+\t# doesn't allow you to compose a sentence in this fashion,\n+\t# consider translating as if this and the following few strings\n+\t# were \"This is the commit message ${n}:\"\n+\t*1[0-9]|*[04-9]) eval_gettext \"This is the \\${n}th commit message:\";;\n+\t*1) eval_gettext \"This is the \\${n}st commit message:\";;\n+\t*2) eval_gettext \"This is the \\${n}nd commit message:\";;\n+\t*3) eval_gettext \"This is the \\${n}rd commit message:\";;\n+\t*) eval_gettext \"This is the commit message \\${n}:\";;\n+\tesac\n+}\n+skip_nth_commit_message () {\n+\tn=$1\n+\tcase \"$n\" in\n+\t1) gettext \"The 1st commit message will be skipped:\";;\n+\t2) gettext \"The 2nd commit message will be skipped:\";;\n+\t3) gettext \"The 3rd commit message will be skipped:\";;\n+\t4) gettext \"The 4th commit message will be skipped:\";;\n+\t5) gettext \"The 5th commit message will be skipped:\";;\n+\t6) gettext \"The 6th commit message will be skipped:\";;\n+\t7) gettext \"The 7th commit message will be skipped:\";;\n+\t8) gettext \"The 8th commit message will be skipped:\";;\n+\t9) gettext \"The 9th commit message will be skipped:\";;\n+\t10) gettext \"The 10th commit message will be skipped:\";;\n+\t# TRANSLATORS: if the language you are translating into\n+\t# doesn't allow you to compose a sentence in this fashion,\n+\t# consider translating as if this and the following few strings\n+\t# were \"The commit message ${n} will be skipped:\"\n+\t*1[0-9]|*[04-9]) eval_gettext \"The \\${n}th commit message will be skipped:\";;\n+\t*1) eval_gettext \"The \\${n}st commit message will be skipped:\";;\n+\t*2) eval_gettext \"The \\${n}nd commit message will be skipped:\";;\n+\t*3) eval_gettext \"The \\${n}rd commit message will be skipped:\";;\n+\t*) eval_gettext \"The commit message \\${n} will be skipped:\";;\n \tesac\n }\n \n@@ -414,20 +454,23 @@ update_squash_messages () {\n \tif test -f \"$squash_msg\"; then\n \t\tmv \"$squash_msg\" \"$squash_msg\".bak || exit\n \t\tcount=$(($(sed -n \\\n-\t\t\t-e \"1s/^. This is a combination of \\(.*\\) commits\\./\\1/p\" \\\n+\t\t\t-e \"1s/^$comment_char.*\\([0-9][0-9]*\\).*/\\1/p\" \\\n \t\t\t-e \"q\" < \"$squash_msg\".bak)+1))\n \t\t{\n-\t\t\tprintf '%s\\n' \"$comment_char This is a combination of $count commits.\"\n+\t\t\tprintf '%s\\n' \"$comment_char $(eval_ngettext \\\n+\t\t\t\t\"This is a combination of \\$count commit.\" \\\n+\t\t\t\t\"This is a combination of \\$count commits.\" \\\n+\t\t\t\t$count)\"\n \t\t\tsed -e 1d -e '2,/^./{\n \t\t\t\t/^$/d\n \t\t\t}' <\"$squash_msg\".bak\n \t\t} >\"$squash_msg\"\n \telse\n-\t\tcommit_message HEAD > \"$fixup_msg\" || die \"Cannot write $fixup_msg\"\n+\t\tcommit_message HEAD > \"$fixup_msg\" || die \"$(gettext \"Cannot write \\$fixup_msg\")\"\n \t\tcount=2\n \t\t{\n-\t\t\tprintf '%s\\n' \"$comment_char This is a combination of 2 commits.\"\n-\t\t\tprintf '%s\\n' \"$comment_char The first commit's message is:\"\n+\t\t\tprintf '%s\\n' \"$comment_char $(gettext \"This is a combination of 2 commits.\")\"\n+\t\t\tprintf '%s\\n' \"$comment_char $(gettext \"This is the 1st commit message:\")\"\n \t\t\techo\n \t\t\tcat \"$fixup_msg\"\n \t\t} >\"$squash_msg\"\n@@ -436,13 +479,13 @@ update_squash_messages () {\n \tsquash)\n \t\trm -f \"$fixup_msg\"\n \t\techo\n-\t\tprintf '%s\\n' \"$comment_char This is the $(nth_string $count) commit message:\"\n+\t\tprintf '%s\\n' \"$comment_char $(this_nth_commit_message $count)\"\n \t\techo\n \t\tcommit_message $2\n \t\t;;\n \tfixup)\n \t\techo\n-\t\tprintf '%s\\n' \"$comment_char The $(nth_string $count) commit message will be skipped:\"\n+\t\tprintf '%s\\n' \"$comment_char $(skip_nth_commit_message $count)\"\n \t\techo\n \t\t# Change the space after the comment character to TAB:\n \t\tcommit_message $2 | git stripspace --comment-lines | sed -e 's/ /\t/'\ndiff --git a/t/lib-rebase.sh b/t/lib-rebase.sh\nindex 9a96e15..25a77ee 100644\n--- a/t/lib-rebase.sh\n+++ b/t/lib-rebase.sh\n@@ -29,6 +29,7 @@ set_fake_editor () {\n \t*/COMMIT_EDITMSG)\n \t\ttest -z \"$EXPECT_HEADER_COUNT\" ||\n \t\t\ttest \"$EXPECT_HEADER_COUNT\" = \"$(sed -n '1s/^# This is a combination of \\(.*\\) commits\\./\\1/p' < \"$1\")\" ||\n+\t\t\ttest \"# # GETTEXT POISON #\" = \"$(sed -n '1p' < \"$1\")\" ||\n \t\t\texit\n \t\ttest -z \"$FAKE_COMMIT_MESSAGE\" || echo \"$FAKE_COMMIT_MESSAGE\" > \"$1\"\n \t\ttest -z \"$FAKE_COMMIT_AMEND\" || echo \"$FAKE_COMMIT_AMEND\" >> \"$1\"\n-- \n2.6.6\n\n"},{"id":"289514","messageId":"xmqqoa6zzf3g.fsf@gitster.mtv.corp.google.com","threadId":"42641","inReplyTo":"1466194887-18236-1-git-send-email-vascomalmeida@sapo.pt","subject":"Re: [PATCH v5 00/38] i18n and test updates","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2016-06-17T21:21:23Z","receivedAt":"2016-06-17T21:21:29Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Vasco Almeida <vascomalmeida@sapo.pt> writes:\n\n> Interdiff included below.\n>\n> Vasco Almeida (38):\n>   i18n: builtin/remote.c: fix mark for translation\n>   i18n: advice: mark string about detached head for translation\n>   i18n: advice: internationalize message for conflicts\n>   i18n: transport: mark strings for translation\n>   i18n: sequencer: mark entire sentences for translation\n>   i18n: sequencer: mark string for translation\n>   i18n: merge-octopus: mark messages for translation\n>   merge-octupus: use die shell function from git-sh-setup.sh\n\noctopus.\n\n>   i18n: rebase: fix marked string to use eval_gettext variant\n>   i18n: rebase: mark placeholder for translation\n>   i18n: bisect: simplify error message for i18n\n>   t6030: update to use test_i18ncmp\n>   i18n: git-sh-setup.sh: mark strings for translation\n>   i18n: rebase-interactive: mark strings for translation\n>   i18n: rebase-interactive: mark here-doc strings for translation\n>   i18n: rebase-interactive: mark comments of squash for translation\n>   i18n: setup: mark strings for translation\n>   tests: use test_i18n* functions to suppress false positives\n>   tests: unpack-trees: update to use test_i18n* functions\n>   t9003: become resilient to GETTEXT_POISON\n>   t4153: fix negated test_i18ngrep call\n>   t5523: use test_i18ngrep for negation\n>   i18n: bisect: mark strings for translation\n>   i18n: transport-helper.c: change N_() call to _()\n>   i18n: notes: mark strings for translation\n>   i18n: notes: mark options for translation\n>   i18n: config: unfold error messages marked for translation\n>   i18n: merge: mark messages for translation\n>   i18n: merge: change command option help to lowercase\n>   i18n: sequencer: add period to error message\n>   i18n: standardise messages\n>   i18n: remote: mark URL fallback text for translation\n>   i18n: remote: allow translations to reorder message\n\nThe last 5 patches seem to have been lost...\n\n>   i18n: init-db: join message pieces\n>   i18n: submodule: join strings marked for translation\n>   i18n: submodule: escape shell variables inside eval_gettext\n>   i18n: unmark die messages for translation\n>   i18n: branch: mark comment when editing branch description for\n>     translation\n>\n>  Makefile                              |   5 +-\n>  advice.c                              |  23 ++-\n>  bisect.c                              |  56 ++++---\n>  builtin/apply.c                       |   6 +-\n>  builtin/branch.c                      |   6 +-\n>  builtin/checkout.c                    |   6 +-\n>  builtin/init-db.c                     |  17 +-\n>  builtin/merge.c                       |  12 +-\n>  builtin/notes.c                       |  24 +--\n>  builtin/pull.c                        |   2 +-\n>  builtin/remote.c                      |  19 ++-\n>  builtin/repack.c                      |   2 +-\n>  cache.h                               |   9 +-\n>  config.c                              | 101 ++++++++++--\n>  git-bisect.sh                         |   8 +-\n>  git-merge-octopus.sh                  |  23 ++-\n>  git-rebase--interactive.sh            | 290 ++++++++++++++++++++--------------\n>  git-rebase.sh                         |   5 +-\n>  git-sh-i18n.sh                        |  18 +++\n>  git-sh-setup.sh                       |  63 ++++++--\n>  git-stash.sh                          |   1 -\n>  git-submodule.sh                      |  23 +--\n>  po/is.po                              |  46 +++---\n>  sequencer.c                           |  15 +-\n>  setup.c                               |  16 +-\n>  submodule-config.c                    |   2 +-\n>  t/lib-rebase.sh                       |   1 +\n>  t/t0008-ignores.sh                    |   4 +-\n>  t/t1011-read-tree-sparse-checkout.sh  |   2 +-\n>  t/t1300-repo-config.sh                |   8 +-\n>  t/t1307-config-blob.sh                |   5 +-\n>  t/t1308-config-set.sh                 |   4 +-\n>  t/t1400-update-ref.sh                 |   2 +-\n>  t/t1506-rev-parse-diagnosis.sh        |   2 +-\n>  t/t2010-checkout-ambiguous.sh         |   2 +-\n>  t/t2018-checkout-branch.sh            |   2 +-\n>  t/t3200-branch.sh                     |   6 +-\n>  t/t3201-branch-contains.sh            |   2 +-\n>  t/t3310-notes-merge-manual-resolve.sh |   8 +-\n>  t/t3320-notes-merge-worktrees.sh      |   4 +-\n>  t/t3400-rebase.sh                     |   4 +-\n>  t/t3404-rebase-interactive.sh         |  18 +--\n>  t/t4153-am-resume-override-opts.sh    |   2 +-\n>  t/t4208-log-magic-pathspec.sh         |   4 +-\n>  t/t5505-remote.sh                     |   2 +-\n>  t/t5510-fetch.sh                      |   2 +-\n>  t/t5520-pull.sh                       |   2 +-\n>  t/t5523-push-upstream.sh              |  12 +-\n>  t/t5536-fetch-conflicts.sh            |   4 +-\n>  t/t6030-bisect-porcelain.sh           |  26 +--\n>  t/t6301-for-each-ref-errors.sh        |  10 +-\n>  t/t7063-status-untracked-cache.sh     |   2 +-\n>  t/t7102-reset.sh                      |   4 +-\n>  t/t7201-co.sh                         |   2 +-\n>  t/t7400-submodule-basic.sh            |   2 +-\n>  t/t7403-submodule-sync.sh             |   4 +-\n>  t/t7406-submodule-update.sh           |  10 +-\n>  t/t7508-status.sh                     |   4 +-\n>  t/t7607-merge-overwrite.sh            |   2 +-\n>  t/t9003-help-autocorrect.sh           |   4 +-\n>  transport-helper.c                    |   2 +-\n>  transport.c                           |  20 +--\n>  wt-status.c                           |   4 +-\n>  63 files changed, 604 insertions(+), 392 deletions(-)\n>\n> ---- >8 ----\n> diff --git a/po/is.po b/po/is.po\n> index 8692a8b..b8b34fd 100644\n> --- a/po/is.po\n> +++ b/po/is.po\n> @@ -7,14 +7,15 @@ msgid \"\"\n>  msgstr \"\"\n>  \"Project-Id-Version: Git\\n\"\n>  \"Report-Msgid-Bugs-To: Git Mailing List <git@vger.kernel.org>\\n\"\n> -\"POT-Creation-Date: 2010-09-20 14:44+0000\\n\"\n> -\"PO-Revision-Date: 2010-06-05 19:06 +0000\\n\"\n> -\"Last-Translator: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\\n\"\n> +\"POT-Creation-Date: 2016-06-17 18:55+0000\\n\"\n> +\"PO-Revision-Date: 2016-06-17 19:17+0000\\n\"\n> +\"Last-Translator: Vasco Almeida <vascomalmeida@sapo.pt>\\n\"\n>  \"Language-Team: Git Mailing List <git@vger.kernel.org>\\n\"\n>  \"Language: is\\n\"\n>  \"MIME-Version: 1.0\\n\"\n>  \"Content-Type: text/plain; charset=UTF-8\\n\"\n>  \"Content-Transfer-Encoding: 8bit\\n\"\n> +\"X-Generator: Poedit 1.8.5\\n\"\n>  \n>  #. TRANSLATORS: This is a test. You don't need to translate it.\n>  #: t/t0200/test.c:5\n> @@ -72,22 +73,31 @@ msgstr \"TILRAUN: Perl tilraunastrengur\"\n>  msgid \"TEST: A Perl test variable %s\"\n>  msgstr \"TILRAUN: Perl tilraunastrengur með breytunni %s\"\n>  \n> -#. TRANSLATORS: The first '%s' is either \"Reinitialized\n> -#. existing\" or \"Initialized empty\", the second \" shared\" or\n> -#. \"\", and the last '%s%s' is the verbatim directory name.\n> -#: builtin/init-db.c:355\n> +#: builtin/init-db.c:402\n>  #, c-format\n> -msgid \"%s%s Git repository in %s%s\\n\"\n> -msgstr \"%s%s Git lind í %s%s\\n\"\n> +msgid \"Reinitialized existing shared Git repository in %s%s\\n\"\n> +msgstr \"Endurgerði Git lind í %s%s\\n\"\n>  \n> -#: builtin/init-db.c:356\n> -msgid \"Reinitialized existing\"\n> -msgstr \"Endurgerði\"\n> +#: builtin/init-db.c:403\n> +#, c-format\n> +msgid \"Reinitialized existing Git repository in %s%s\\n\"\n> +msgstr \"Endurgerði Git lind í %s%s\\n\"\n> +\n> +#: builtin/init-db.c:407\n> +#, c-format\n> +msgid \"Initialized empty shared Git repository in %s%s\\n\"\n> +msgstr \"Bjó til tóma sameiginlega Git lind í %s%s\\n\"\n> +\n> +#: builtin/init-db.c:408\n> +#, c-format\n> +msgid \"Initialized empty Git repository in %s%s\\n\"\n> +msgstr \"Bjó til tóma Git lind í %s%s\\n\"\n> +\n> +#~ msgid \"Reinitialized existing\"\n> +#~ msgstr \"Endurgerði\"\n>  \n> -#: builtin/init-db.c:356\n> -msgid \"Initialized empty\"\n> -msgstr \"Bjó til tóma\"\n> +#~ msgid \"Initialized empty\"\n> +#~ msgstr \"Bjó til tóma\"\n>  \n> -#: builtin/init-db.c:357\n> -msgid \" shared\"\n> -msgstr \" sameiginlega\"\n> +#~ msgid \" shared\"\n> +#~ msgstr \" sameiginlega\"\n> ---- >8 ----\n"},{"id":"289517","messageId":"1466200455-16951-5-git-send-email-vascomalmeida@sapo.pt","threadId":"42641","inReplyTo":"1466194887-18236-1-git-send-email-vascomalmeida@sapo.pt","subject":"[PATCH v5 34/38] i18n: init-db: join message pieces","fromName":"Vasco Almeida","fromEmail":"vascomalmeida@sapo.pt","sentAt":"2016-06-17T21:54:11Z","receivedAt":"2016-06-17T21:54:46Z","isPatch":true,"sender":{"key":"vascomalmeida@sapo.pt","avatar":"https://avatars.githubusercontent.com/u/9001556?v=4"},"body":"Join message displayed during repository initialization in one entire\nsentence.  That would improve translations since it's easier translate\nan entire sentence than translating each piece.\n\nUpdate Icelandic translation to reflect the changes.  The Icelandic\ntranslation of these messages is used with test\nt0204-gettext-reencode-sanity.sh and not updating the translation would\nfail the test.\n\nSigned-off-by: Vasco Almeida <vascomalmeida@sapo.pt>\n---\n builtin/init-db.c | 17 ++++++++++-------\n po/is.po          | 46 ++++++++++++++++++++++++++++------------------\n 2 files changed, 38 insertions(+), 25 deletions(-)\n\ndiff --git a/builtin/init-db.c b/builtin/init-db.c\nindex b2d8d40..3a45f0b 100644\n--- a/builtin/init-db.c\n+++ b/builtin/init-db.c\n@@ -397,13 +397,16 @@ int init_db(const char *template_dir, unsigned int flags)\n \tif (!(flags & INIT_DB_QUIET)) {\n \t\tint len = strlen(git_dir);\n \n-\t\t/* TRANSLATORS: The first '%s' is either \"Reinitialized\n-\t\t   existing\" or \"Initialized empty\", the second \" shared\" or\n-\t\t   \"\", and the last '%s%s' is the verbatim directory name. */\n-\t\tprintf(_(\"%s%s Git repository in %s%s\\n\"),\n-\t\t       reinit ? _(\"Reinitialized existing\") : _(\"Initialized empty\"),\n-\t\t       get_shared_repository() ? _(\" shared\") : \"\",\n-\t\t       git_dir, len && git_dir[len-1] != '/' ? \"/\" : \"\");\n+\t\tif (reinit)\n+\t\t\tprintf(get_shared_repository()\n+\t\t\t       ? _(\"Reinitialized existing shared Git repository in %s%s\\n\")\n+\t\t\t       : _(\"Reinitialized existing Git repository in %s%s\\n\"),\n+\t\t\t       git_dir, len && git_dir[len-1] != '/' ? \"/\" : \"\");\n+\t\telse\n+\t\t\tprintf(get_shared_repository()\n+\t\t\t       ? _(\"Initialized empty shared Git repository in %s%s\\n\")\n+\t\t\t       : _(\"Initialized empty Git repository in %s%s\\n\"),\n+\t\t\t       git_dir, len && git_dir[len-1] != '/' ? \"/\" : \"\");\n \t}\n \n \treturn 0;\ndiff --git a/po/is.po b/po/is.po\nindex 8692a8b..b8b34fd 100644\n--- a/po/is.po\n+++ b/po/is.po\n@@ -7,14 +7,15 @@ msgid \"\"\n msgstr \"\"\n \"Project-Id-Version: Git\\n\"\n \"Report-Msgid-Bugs-To: Git Mailing List <git@vger.kernel.org>\\n\"\n-\"POT-Creation-Date: 2010-09-20 14:44+0000\\n\"\n-\"PO-Revision-Date: 2010-06-05 19:06 +0000\\n\"\n-\"Last-Translator: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\\n\"\n+\"POT-Creation-Date: 2016-06-17 18:55+0000\\n\"\n+\"PO-Revision-Date: 2016-06-17 19:17+0000\\n\"\n+\"Last-Translator: Vasco Almeida <vascomalmeida@sapo.pt>\\n\"\n \"Language-Team: Git Mailing List <git@vger.kernel.org>\\n\"\n \"Language: is\\n\"\n \"MIME-Version: 1.0\\n\"\n \"Content-Type: text/plain; charset=UTF-8\\n\"\n \"Content-Transfer-Encoding: 8bit\\n\"\n+\"X-Generator: Poedit 1.8.5\\n\"\n \n #. TRANSLATORS: This is a test. You don't need to translate it.\n #: t/t0200/test.c:5\n@@ -72,22 +73,31 @@ msgstr \"TILRAUN: Perl tilraunastrengur\"\n msgid \"TEST: A Perl test variable %s\"\n msgstr \"TILRAUN: Perl tilraunastrengur með breytunni %s\"\n \n-#. TRANSLATORS: The first '%s' is either \"Reinitialized\n-#. existing\" or \"Initialized empty\", the second \" shared\" or\n-#. \"\", and the last '%s%s' is the verbatim directory name.\n-#: builtin/init-db.c:355\n+#: builtin/init-db.c:402\n #, c-format\n-msgid \"%s%s Git repository in %s%s\\n\"\n-msgstr \"%s%s Git lind í %s%s\\n\"\n+msgid \"Reinitialized existing shared Git repository in %s%s\\n\"\n+msgstr \"Endurgerði Git lind í %s%s\\n\"\n \n-#: builtin/init-db.c:356\n-msgid \"Reinitialized existing\"\n-msgstr \"Endurgerði\"\n+#: builtin/init-db.c:403\n+#, c-format\n+msgid \"Reinitialized existing Git repository in %s%s\\n\"\n+msgstr \"Endurgerði Git lind í %s%s\\n\"\n+\n+#: builtin/init-db.c:407\n+#, c-format\n+msgid \"Initialized empty shared Git repository in %s%s\\n\"\n+msgstr \"Bjó til tóma sameiginlega Git lind í %s%s\\n\"\n+\n+#: builtin/init-db.c:408\n+#, c-format\n+msgid \"Initialized empty Git repository in %s%s\\n\"\n+msgstr \"Bjó til tóma Git lind í %s%s\\n\"\n+\n+#~ msgid \"Reinitialized existing\"\n+#~ msgstr \"Endurgerði\"\n \n-#: builtin/init-db.c:356\n-msgid \"Initialized empty\"\n-msgstr \"Bjó til tóma\"\n+#~ msgid \"Initialized empty\"\n+#~ msgstr \"Bjó til tóma\"\n \n-#: builtin/init-db.c:357\n-msgid \" shared\"\n-msgstr \" sameiginlega\"\n+#~ msgid \" shared\"\n+#~ msgstr \" sameiginlega\"\n-- \n2.6.6\n\n"},{"id":"289518","messageId":"1466200455-16951-7-git-send-email-vascomalmeida@sapo.pt","threadId":"42641","inReplyTo":"1466194887-18236-1-git-send-email-vascomalmeida@sapo.pt","subject":"[PATCH v5 36/38] i18n: submodule: escape shell variables inside eval_gettext","fromName":"Vasco Almeida","fromEmail":"vascomalmeida@sapo.pt","sentAt":"2016-06-17T21:54:13Z","receivedAt":"2016-06-17T21:54:47Z","isPatch":true,"sender":{"key":"vascomalmeida@sapo.pt","avatar":"https://avatars.githubusercontent.com/u/9001556?v=4"},"body":"According to the gettext manual [1], references to shell variables inside\neval_gettext call must be escaped so that eval_gettext receives the\ntranslatable string before the variable values are substituted into it.\n\n[1] http://www.gnu.org/software/gettext/manual/html_node/Preparing-Shell-Scripts.html\n\nSigned-off-by: Vasco Almeida <vascomalmeida@sapo.pt>\n---\n git-submodule.sh | 4 ++--\n 1 file changed, 2 insertions(+), 2 deletions(-)\n\ndiff --git a/git-submodule.sh b/git-submodule.sh\nindex f72b237..1ff2f3a 100755\n--- a/git-submodule.sh\n+++ b/git-submodule.sh\n@@ -618,7 +618,7 @@ cmd_update()\n \t\t\tremote_name=$(sanitize_submodule_env; cd \"$sm_path\" && get_default_remote)\n \t\t\tsha1=$(sanitize_submodule_env; cd \"$sm_path\" &&\n \t\t\t\tgit rev-parse --verify \"${remote_name}/${branch}\") ||\n-\t\t\tdie \"$(eval_gettext \"Unable to find current ${remote_name}/${branch} revision in submodule path '\\$sm_path'\")\"\n+\t\t\tdie \"$(eval_gettext \"Unable to find current \\${remote_name}/\\${branch} revision in submodule path '\\$sm_path'\")\"\n \t\tfi\n \n \t\tif test \"$subsha1\" != \"$sha1\" || test -n \"$force\"\n@@ -642,7 +642,7 @@ cmd_update()\n \t\t\t\t# not be reachable from any of the refs\n \t\t\t\tis_tip_reachable \"$sm_path\" \"$sha1\" ||\n \t\t\t\tfetch_in_submodule \"$sm_path\" \"$sha1\" ||\n-\t\t\t\tdie \"$(eval_gettext \"Fetched in submodule path '\\$displaypath', but it did not contain $sha1. Direct fetching of that commit failed.\")\"\n+\t\t\t\tdie \"$(eval_gettext \"Fetched in submodule path '\\$displaypath', but it did not contain \\$sha1. Direct fetching of that commit failed.\")\"\n \t\t\tfi\n \n \t\t\tmust_die_on_failure=\n-- \n2.6.6\n\n"},{"id":"289519","messageId":"1466200455-16951-8-git-send-email-vascomalmeida@sapo.pt","threadId":"42641","inReplyTo":"1466194887-18236-1-git-send-email-vascomalmeida@sapo.pt","subject":"[PATCH v5 37/38] i18n: unmark die messages for translation","fromName":"Vasco Almeida","fromEmail":"vascomalmeida@sapo.pt","sentAt":"2016-06-17T21:54:14Z","receivedAt":"2016-06-17T21:54:47Z","isPatch":true,"sender":{"key":"vascomalmeida@sapo.pt","avatar":"https://avatars.githubusercontent.com/u/9001556?v=4"},"body":"These messages are relevant for the programmer only, not for the end\nuser.  Thus, they can be unmarked for translation, saving translator\nsome work.\n\nSigned-off-by: Vasco Almeida <vascomalmeida@sapo.pt>\n---\n git-bisect.sh | 2 +-\n wt-status.c   | 4 ++--\n 2 files changed, 3 insertions(+), 3 deletions(-)\n\ndiff --git a/git-bisect.sh b/git-bisect.sh\nindex 30d01bb..ae3cb01 100755\n--- a/git-bisect.sh\n+++ b/git-bisect.sh\n@@ -274,7 +274,7 @@ bisect_state() {\n \tcheck_and_set_terms $state\n \tcase \"$#,$state\" in\n \t0,*)\n-\t\tdie \"$(gettext \"Please call 'bisect_state' with at least one argument.\")\" ;;\n+\t\tdie \"Please call 'bisect_state' with at least one argument.\" ;;\n \t1,\"$TERM_BAD\"|1,\"$TERM_GOOD\"|1,skip)\n \t\tbisected_head=$(bisect_head)\n \t\trev=$(git rev-parse --verify \"$bisected_head\") ||\ndiff --git a/wt-status.c b/wt-status.c\nindex 4f27bd6..5a91279 100644\n--- a/wt-status.c\n+++ b/wt-status.c\n@@ -263,7 +263,7 @@ static const char *wt_status_unmerged_status_string(int stagemask)\n \tcase 7:\n \t\treturn _(\"both modified:\");\n \tdefault:\n-\t\tdie(_(\"bug: unhandled unmerged status %x\"), stagemask);\n+\t\tdie(\"bug: unhandled unmerged status %x\", stagemask);\n \t}\n }\n \n@@ -388,7 +388,7 @@ static void wt_status_print_change_data(struct wt_status *s,\n \tstatus_printf(s, color(WT_STATUS_HEADER, s), \"\\t\");\n \twhat = wt_status_diff_status_string(status);\n \tif (!what)\n-\t\tdie(_(\"bug: unhandled diff status %c\"), status);\n+\t\tdie(\"bug: unhandled diff status %c\", status);\n \tlen = label_width - utf8_strwidth(what);\n \tassert(len >= 0);\n \tif (status == DIFF_STATUS_COPIED || status == DIFF_STATUS_RENAMED)\n-- \n2.6.6\n\n"},{"id":"289520","messageId":"1466200455-16951-6-git-send-email-vascomalmeida@sapo.pt","threadId":"42641","inReplyTo":"1466194887-18236-1-git-send-email-vascomalmeida@sapo.pt","subject":"[PATCH v5 35/38] i18n: submodule: join strings marked for translation","fromName":"Vasco Almeida","fromEmail":"vascomalmeida@sapo.pt","sentAt":"2016-06-17T21:54:12Z","receivedAt":"2016-06-17T21:54:57Z","isPatch":true,"sender":{"key":"vascomalmeida@sapo.pt","avatar":"https://avatars.githubusercontent.com/u/9001556?v=4"},"body":"Join strings marked for translation since that would facilitate and\nimprove translations result.\n\nSigned-off-by: Vasco Almeida <vascomalmeida@sapo.pt>\n---\n git-submodule.sh | 18 ++++++++++--------\n 1 file changed, 10 insertions(+), 8 deletions(-)\n\ndiff --git a/git-submodule.sh b/git-submodule.sh\nindex 5b9674a..f72b237 100755\n--- a/git-submodule.sh\n+++ b/git-submodule.sh\n@@ -239,14 +239,15 @@ Use -f if you really want to add it.\" >&2\n \t\tthen\n \t\t\tif test -z \"$force\"\n \t\t\tthen\n-\t\t\t\techo >&2 \"$(eval_gettext \"A git directory for '\\$sm_name' is found locally with remote(s):\")\"\n+\t\t\t\teval_gettextln >&2 \"A git directory for '\\$sm_name' is found locally with remote(s):\"\n \t\t\t\tGIT_DIR=\".git/modules/$sm_name\" GIT_WORK_TREE=. git remote -v | grep '(fetch)' | sed -e s,^,\"  \", -e s,' (fetch)',, >&2\n-\t\t\t\techo >&2 \"$(eval_gettext \"If you want to reuse this local git directory instead of cloning again from\")\"\n-\t\t\t\techo >&2 \"  $realrepo\"\n-\t\t\t\techo >&2 \"$(eval_gettext \"use the '--force' option. If the local git directory is not the correct repo\")\"\n-\t\t\t\tdie \"$(eval_gettext \"or you are unsure what this means choose another name with the '--name' option.\")\"\n+\t\t\t\tdie \"$(eval_gettextln \"\\\n+If you want to reuse this local git directory instead of cloning again from\n+  \\$realrepo\n+use the '--force' option. If the local git directory is not the correct repo\n+or you are unsure what this means choose another name with the '--name' option.\")\"\n \t\t\telse\n-\t\t\t\techo \"$(eval_gettext \"Reactivating local git directory for submodule '\\$sm_name'.\")\"\n+\t\t\t\teval_gettextln \"Reactivating local git directory for submodule '\\$sm_name'.\"\n \t\t\tfi\n \t\tfi\n \t\tgit submodule--helper clone ${GIT_QUIET:+--quiet} --prefix \"$wt_prefix\" --path \"$sm_path\" --name \"$sm_name\" --url \"$realrepo\" ${reference:+\"$reference\"} ${depth:+\"$depth\"} || exit\n@@ -437,8 +438,9 @@ cmd_deinit()\n \t\t\t# Protect submodules containing a .git directory\n \t\t\tif test -d \"$sm_path/.git\"\n \t\t\tthen\n-\t\t\t\techo >&2 \"$(eval_gettext \"Submodule work tree '\\$displaypath' contains a .git directory\")\"\n-\t\t\t\tdie \"$(eval_gettext \"(use 'rm -rf' if you really want to remove it including all of its history)\")\"\n+\t\t\t\tdie \"$(eval_gettext \"\\\n+Submodule work tree '\\$displaypath' contains a .git directory\n+(use 'rm -rf' if you really want to remove it including all of its history)\")\"\n \t\t\tfi\n \n \t\t\tif test -z \"$force\"\n-- \n2.6.6\n\n"},{"id":"289521","messageId":"1466200455-16951-9-git-send-email-vascomalmeida@sapo.pt","threadId":"42641","inReplyTo":"1466194887-18236-1-git-send-email-vascomalmeida@sapo.pt","subject":"[PATCH v5 38/38] i18n: branch: mark comment when editing branch description for translation","fromName":"Vasco Almeida","fromEmail":"vascomalmeida@sapo.pt","sentAt":"2016-06-17T21:54:15Z","receivedAt":"2016-06-17T21:54:59Z","isPatch":true,"sender":{"key":"vascomalmeida@sapo.pt","avatar":"https://avatars.githubusercontent.com/u/9001556?v=4"},"body":"When one issues git branch --edit-description branch_name, a edit with\nthat message commented out is opened. Mark that message for translation\nin to order to be localized.\n\nSigned-off-by: Vasco Almeida <vascomalmeida@sapo.pt>\n---\n builtin/branch.c | 6 +++---\n 1 file changed, 3 insertions(+), 3 deletions(-)\n\ndiff --git a/builtin/branch.c b/builtin/branch.c\nindex 2ecde53..12203fd 100644\n--- a/builtin/branch.c\n+++ b/builtin/branch.c\n@@ -614,9 +614,9 @@ static int edit_branch_description(const char *branch_name)\n \tif (!buf.len || buf.buf[buf.len-1] != '\\n')\n \t\tstrbuf_addch(&buf, '\\n');\n \tstrbuf_commented_addf(&buf,\n-\t\t    \"Please edit the description for the branch\\n\"\n-\t\t    \"  %s\\n\"\n-\t\t    \"Lines starting with '%c' will be stripped.\\n\",\n+\t\t    _(\"Please edit the description for the branch\\n\"\n+\t\t      \"  %s\\n\"\n+\t\t      \"Lines starting with '%c' will be stripped.\\n\"),\n \t\t    branch_name, comment_line_char);\n \tif (write_file_gently(git_path(edit_description), \"%s\", buf.buf)) {\n \t\tstrbuf_release(&buf);\n-- \n2.6.6\n\n"},{"id":"289525","messageId":"xmqqbn2zzbxf.fsf@gitster.mtv.corp.google.com","threadId":"42641","inReplyTo":"xmqqoa6zzf3g.fsf@gitster.mtv.corp.google.com","subject":"Re: [PATCH v5 00/38] i18n and test updates","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2016-06-17T22:29:48Z","receivedAt":"2016-06-17T22:29:55Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Junio C Hamano <gitster@pobox.com> writes:\n\n> Vasco Almeida <vascomalmeida@sapo.pt> writes:\n>\n>> Interdiff included below.\n>>\n>> Vasco Almeida (38):\n>>   i18n: builtin/remote.c: fix mark for translation\n>>   i18n: advice: mark string about detached head for translation\n>>   i18n: advice: internationalize message for conflicts\n>>   i18n: transport: mark strings for translation\n>>   i18n: sequencer: mark entire sentences for translation\n>>   i18n: sequencer: mark string for translation\n>>   i18n: merge-octopus: mark messages for translation\n>>   merge-octupus: use die shell function from git-sh-setup.sh\n>\n> octopus.\n\n> The last 5 patches seem to have been lost...\n>\n>>   i18n: init-db: join message pieces\n>>   i18n: submodule: join strings marked for translation\n>>   i18n: submodule: escape shell variables inside eval_gettext\n>>   i18n: unmark die messages for translation\n>>   i18n: branch: mark comment when editing branch description for\n>>     translation\n\nNow we see them ;-)  Thanks.\n"}]}