{"thread":{"id":"44110","subject":"[PATCH 1/6] i18n: commit: mark message for translation","startedAt":"2016-09-19T13:09:25Z","lastAt":"2016-09-21T17:18:31Z","messageCount":11,"participants":["Vasco Almeida","Junio C Hamano","Jean-Noël AVILA"],"isPatch":true,"patchVersion":1,"patchTotal":6},"messages":[{"id":"302127","messageId":"1474290501-2743-1-git-send-email-vascomalmeida@sapo.pt","threadId":"44110","inReplyTo":null,"subject":"[PATCH 1/6] i18n: commit: mark message for translation","fromName":"Vasco Almeida","fromEmail":"vascomalmeida@sapo.pt","sentAt":"2016-09-19T13:08:16Z","receivedAt":"2016-09-19T13:09:25Z","isPatch":true,"sender":{"key":"vascomalmeida@sapo.pt","avatar":"https://avatars.githubusercontent.com/u/9001556?v=4"},"body":"Mark message commit_utf8_warn for translation.\n\nUpdate tests to reflect changes.\n\nSigned-off-by: Vasco Almeida <vascomalmeida@sapo.pt>\n---\n commit.c               | 8 ++++----\n t/t3900-i18n-commit.sh | 8 ++++----\n t/t3901-i18n-patch.sh  | 2 +-\n 3 files changed, 9 insertions(+), 9 deletions(-)\n\ndiff --git a/commit.c b/commit.c\nindex ba6dee3..8eb1707 100644\n--- a/commit.c\n+++ b/commit.c\n@@ -1511,9 +1511,9 @@ static int verify_utf8(struct strbuf *buf)\n }\n \n static const char commit_utf8_warn[] =\n-\"Warning: commit message did not conform to UTF-8.\\n\"\n-\"You may want to amend it after fixing the message, or set the config\\n\"\n-\"variable i18n.commitencoding to the encoding your project uses.\\n\";\n+N_(\"Warning: commit message did not conform to UTF-8.\\n\"\n+   \"You may want to amend it after fixing the message, or set the config\\n\"\n+   \"variable i18n.commitencoding to the encoding your project uses.\\n\");\n \n int commit_tree_extended(const char *msg, size_t msg_len,\n \t\t\t const unsigned char *tree,\n@@ -1566,7 +1566,7 @@ int commit_tree_extended(const char *msg, size_t msg_len,\n \n \t/* And check the encoding */\n \tif (encoding_is_utf8 && !verify_utf8(&buffer))\n-\t\tfprintf(stderr, commit_utf8_warn);\n+\t\tfprintf(stderr, _(commit_utf8_warn));\n \n \tif (sign_commit && do_sign_commit(&buffer, sign_commit))\n \t\treturn -1;\ndiff --git a/t/t3900-i18n-commit.sh b/t/t3900-i18n-commit.sh\nindex 4bf1dbe..3b94283 100755\n--- a/t/t3900-i18n-commit.sh\n+++ b/t/t3900-i18n-commit.sh\n@@ -45,7 +45,7 @@ test_expect_success 'UTF-8 invalid characters refused' '\n \tprintf \"Commit message\\n\\nInvalid surrogate:\\355\\240\\200\\n\" \\\n \t\t>\"$HOME/invalid\" &&\n \tgit commit -a -F \"$HOME/invalid\" 2>\"$HOME\"/stderr &&\n-\tgrep \"did not conform\" \"$HOME\"/stderr\n+\ttest_i18ngrep \"did not conform\" \"$HOME\"/stderr\n '\n \n test_expect_success 'UTF-8 overlong sequences rejected' '\n@@ -55,7 +55,7 @@ test_expect_success 'UTF-8 overlong sequences rejected' '\n \tprintf \"\\340\\202\\251ommit message\\n\\nThis is not a space:\\300\\240\\n\" \\\n \t\t>\"$HOME/invalid\" &&\n \tgit commit -a -F \"$HOME/invalid\" 2>\"$HOME\"/stderr &&\n-\tgrep \"did not conform\" \"$HOME\"/stderr\n+\ttest_i18ngrep \"did not conform\" \"$HOME\"/stderr\n '\n \n test_expect_success 'UTF-8 non-characters refused' '\n@@ -64,7 +64,7 @@ test_expect_success 'UTF-8 non-characters refused' '\n \tprintf \"Commit message\\n\\nNon-character:\\364\\217\\277\\276\\n\" \\\n \t\t>\"$HOME/invalid\" &&\n \tgit commit -a -F \"$HOME/invalid\" 2>\"$HOME\"/stderr &&\n-\tgrep \"did not conform\" \"$HOME\"/stderr\n+\ttest_i18ngrep \"did not conform\" \"$HOME\"/stderr\n '\n \n test_expect_success 'UTF-8 non-characters refused' '\n@@ -73,7 +73,7 @@ test_expect_success 'UTF-8 non-characters refused' '\n \tprintf \"Commit message\\n\\nNon-character:\\357\\267\\220\\n\" \\\n \t\t>\"$HOME/invalid\" &&\n \tgit commit -a -F \"$HOME/invalid\" 2>\"$HOME\"/stderr &&\n-\tgrep \"did not conform\" \"$HOME\"/stderr\n+\ttest_i18ngrep \"did not conform\" \"$HOME\"/stderr\n '\n \n for H in ISO8859-1 eucJP ISO-2022-JP\ndiff --git a/t/t3901-i18n-patch.sh b/t/t3901-i18n-patch.sh\nindex 509084e..f663d56 100755\n--- a/t/t3901-i18n-patch.sh\n+++ b/t/t3901-i18n-patch.sh\n@@ -295,7 +295,7 @@ test_expect_success 'am --no-utf8 (U/L)' '\n \n \t# commit-tree will warn that the commit message does not contain valid UTF-8\n \t# as mailinfo did not convert it\n-\tgrep \"did not conform\" err &&\n+\ttest_i18ngrep \"did not conform\" err &&\n \n \tcheck_encoding 2\n '\n-- \n2.7.4\n\n"},{"id":"302128","messageId":"1474290501-2743-2-git-send-email-vascomalmeida@sapo.pt","threadId":"44110","inReplyTo":"1474290501-2743-1-git-send-email-vascomalmeida@sapo.pt","subject":"[PATCH 2/6] i18n: connect: mark die messages for translation","fromName":"Vasco Almeida","fromEmail":"vascomalmeida@sapo.pt","sentAt":"2016-09-19T13:08:17Z","receivedAt":"2016-09-19T13:09:31Z","isPatch":true,"sender":{"key":"vascomalmeida@sapo.pt","avatar":"https://avatars.githubusercontent.com/u/9001556?v=4"},"body":"Mark messages passed to die() in die_initial_contact().\n\nUpdate test to reflect changes.\n\nSigned-off-by: Vasco Almeida <vascomalmeida@sapo.pt>\n---\n connect.c            | 8 ++++----\n t/t5512-ls-remote.sh | 2 +-\n 2 files changed, 5 insertions(+), 5 deletions(-)\n\ndiff --git a/connect.c b/connect.c\nindex 722dc3f..06bff0b 100644\n--- a/connect.c\n+++ b/connect.c\n@@ -46,11 +46,11 @@ int check_ref_type(const struct ref *ref, int flags)\n static void die_initial_contact(int got_at_least_one_head)\n {\n \tif (got_at_least_one_head)\n-\t\tdie(\"The remote end hung up upon initial contact\");\n+\t\tdie(_(\"The remote end hung up upon initial contact\"));\n \telse\n-\t\tdie(\"Could not read from remote repository.\\n\\n\"\n-\t\t    \"Please make sure you have the correct access rights\\n\"\n-\t\t    \"and the repository exists.\");\n+\t\tdie(_(\"Could not read from remote repository.\\n\\n\"\n+\t\t      \"Please make sure you have the correct access rights\\n\"\n+\t\t      \"and the repository exists.\"));\n }\n \n static void parse_one_symref_info(struct string_list *symref, const char *val, int len)\ndiff --git a/t/t5512-ls-remote.sh b/t/t5512-ls-remote.sh\nindex 819b9dd..c23434b 100755\n--- a/t/t5512-ls-remote.sh\n+++ b/t/t5512-ls-remote.sh\n@@ -99,7 +99,7 @@ test_expect_success 'confuses pattern as remote when no remote specified' '\n \t# We could just as easily have used \"master\"; the \"*\" emphasizes its\n \t# role as a pattern.\n \ttest_must_fail git ls-remote refs*master >actual 2>&1 &&\n-\ttest_cmp exp actual\n+\ttest_i18ncmp exp actual\n '\n \n test_expect_success 'die with non-2 for wrong repository even with --exit-code' '\n-- \n2.7.4\n\n"},{"id":"302129","messageId":"1474290501-2743-4-git-send-email-vascomalmeida@sapo.pt","threadId":"44110","inReplyTo":"1474290501-2743-1-git-send-email-vascomalmeida@sapo.pt","subject":"[PATCH 4/6] i18n: ident: mark hint for translation","fromName":"Vasco Almeida","fromEmail":"vascomalmeida@sapo.pt","sentAt":"2016-09-19T13:08:19Z","receivedAt":"2016-09-19T13:09:34Z","isPatch":true,"sender":{"key":"vascomalmeida@sapo.pt","avatar":"https://avatars.githubusercontent.com/u/9001556?v=4"},"body":"Mark env_hint for translation.\n\nSigned-off-by: Vasco Almeida <vascomalmeida@sapo.pt>\n---\n ident.c | 32 ++++++++++++++++----------------\n 1 file changed, 16 insertions(+), 16 deletions(-)\n\ndiff --git a/ident.c b/ident.c\nindex e20a772..92c3cca 100644\n--- a/ident.c\n+++ b/ident.c\n@@ -331,17 +331,17 @@ int split_ident_line(struct ident_split *split, const char *line, int len)\n }\n \n static const char *env_hint =\n-\"\\n\"\n-\"*** Please tell me who you are.\\n\"\n-\"\\n\"\n-\"Run\\n\"\n-\"\\n\"\n-\"  git config --global user.email \\\"you@example.com\\\"\\n\"\n-\"  git config --global user.name \\\"Your Name\\\"\\n\"\n-\"\\n\"\n-\"to set your account\\'s default identity.\\n\"\n-\"Omit --global to set the identity only in this repository.\\n\"\n-\"\\n\";\n+N_(\"\\n\"\n+   \"*** Please tell me who you are.\\n\"\n+   \"\\n\"\n+   \"Run\\n\"\n+   \"\\n\"\n+   \"  git config --global user.email \\\"you@example.com\\\"\\n\"\n+   \"  git config --global user.name \\\"Your Name\\\"\\n\"\n+   \"\\n\"\n+   \"to set your account\\'s default identity.\\n\"\n+   \"Omit --global to set the identity only in this repository.\\n\"\n+   \"\\n\");\n \n const char *fmt_ident(const char *name, const char *email,\n \t\t      const char *date_str, int flag)\n@@ -356,13 +356,13 @@ const char *fmt_ident(const char *name, const char *email,\n \t\tif (!name) {\n \t\t\tif (strict && ident_use_config_only\n \t\t\t    && !(ident_config_given & IDENT_NAME_GIVEN)) {\n-\t\t\t\tfputs(env_hint, stderr);\n+\t\t\t\tfputs(_(env_hint), stderr);\n \t\t\t\tdie(\"no name was given and auto-detection is disabled\");\n \t\t\t}\n \t\t\tname = ident_default_name();\n \t\t\tusing_default = 1;\n \t\t\tif (strict && default_name_is_bogus) {\n-\t\t\t\tfputs(env_hint, stderr);\n+\t\t\t\tfputs(_(env_hint), stderr);\n \t\t\t\tdie(\"unable to auto-detect name (got '%s')\", name);\n \t\t\t}\n \t\t}\n@@ -370,7 +370,7 @@ const char *fmt_ident(const char *name, const char *email,\n \t\t\tstruct passwd *pw;\n \t\t\tif (strict) {\n \t\t\t\tif (using_default)\n-\t\t\t\t\tfputs(env_hint, stderr);\n+\t\t\t\t\tfputs(_(env_hint), stderr);\n \t\t\t\tdie(\"empty ident name (for <%s>) not allowed\", email);\n \t\t\t}\n \t\t\tpw = xgetpwuid_self(NULL);\n@@ -381,12 +381,12 @@ const char *fmt_ident(const char *name, const char *email,\n \tif (!email) {\n \t\tif (strict && ident_use_config_only\n \t\t    && !(ident_config_given & IDENT_MAIL_GIVEN)) {\n-\t\t\tfputs(env_hint, stderr);\n+\t\t\tfputs(_(env_hint), stderr);\n \t\t\tdie(\"no email was given and auto-detection is disabled\");\n \t\t}\n \t\temail = ident_default_email();\n \t\tif (strict && default_email_is_bogus) {\n-\t\t\tfputs(env_hint, stderr);\n+\t\t\tfputs(_(env_hint), stderr);\n \t\t\tdie(\"unable to auto-detect email address (got '%s')\", email);\n \t\t}\n \t}\n-- \n2.7.4\n\n"},{"id":"302130","messageId":"1474290501-2743-3-git-send-email-vascomalmeida@sapo.pt","threadId":"44110","inReplyTo":"1474290501-2743-1-git-send-email-vascomalmeida@sapo.pt","subject":"[PATCH 3/6] i18n: diff: mark die errors for translation","fromName":"Vasco Almeida","fromEmail":"vascomalmeida@sapo.pt","sentAt":"2016-09-19T13:08:18Z","receivedAt":"2016-09-19T13:09:35Z","isPatch":true,"sender":{"key":"vascomalmeida@sapo.pt","avatar":"https://avatars.githubusercontent.com/u/9001556?v=4"},"body":"Signed-off-by: Vasco Almeida <vascomalmeida@sapo.pt>\n---\n diff.c | 10 +++++-----\n 1 file changed, 5 insertions(+), 5 deletions(-)\n\ndiff --git a/diff.c b/diff.c\nindex b4310f8..d82ad79 100644\n--- a/diff.c\n+++ b/diff.c\n@@ -3325,7 +3325,7 @@ void diff_setup_done(struct diff_options *options)\n \tif (options->output_format & DIFF_FORMAT_NO_OUTPUT)\n \t\tcount++;\n \tif (count > 1)\n-\t\tdie(\"--name-only, --name-status, --check and -s are mutually exclusive\");\n+\t\tdie(_(\"--name-only, --name-status, --check and -s are mutually exclusive\"));\n \n \t/*\n \t * Most of the time we can say \"there are changes\"\n@@ -3521,7 +3521,7 @@ static int stat_opt(struct diff_options *options, const char **av)\n \t\t\tif (*arg == '=')\n \t\t\t\twidth = strtoul(arg + 1, &end, 10);\n \t\t\telse if (!*arg && !av[1])\n-\t\t\t\tdie(\"Option '--stat-width' requires a value\");\n+\t\t\t\tdie(_(\"Option '--stat-width' requires a value\"));\n \t\t\telse if (!*arg) {\n \t\t\t\twidth = strtoul(av[1], &end, 10);\n \t\t\t\targcount = 2;\n@@ -3530,7 +3530,7 @@ static int stat_opt(struct diff_options *options, const char **av)\n \t\t\tif (*arg == '=')\n \t\t\t\tname_width = strtoul(arg + 1, &end, 10);\n \t\t\telse if (!*arg && !av[1])\n-\t\t\t\tdie(\"Option '--stat-name-width' requires a value\");\n+\t\t\t\tdie(_(\"Option '--stat-name-width' requires a value\"));\n \t\t\telse if (!*arg) {\n \t\t\t\tname_width = strtoul(av[1], &end, 10);\n \t\t\t\targcount = 2;\n@@ -3539,7 +3539,7 @@ static int stat_opt(struct diff_options *options, const char **av)\n \t\t\tif (*arg == '=')\n \t\t\t\tgraph_width = strtoul(arg + 1, &end, 10);\n \t\t\telse if (!*arg && !av[1])\n-\t\t\t\tdie(\"Option '--stat-graph-width' requires a value\");\n+\t\t\t\tdie(_(\"Option '--stat-graph-width' requires a value\"));\n \t\t\telse if (!*arg) {\n \t\t\t\tgraph_width = strtoul(av[1], &end, 10);\n \t\t\t\targcount = 2;\n@@ -3548,7 +3548,7 @@ static int stat_opt(struct diff_options *options, const char **av)\n \t\t\tif (*arg == '=')\n \t\t\t\tcount = strtoul(arg + 1, &end, 10);\n \t\t\telse if (!*arg && !av[1])\n-\t\t\t\tdie(\"Option '--stat-count' requires a value\");\n+\t\t\t\tdie(_(\"Option '--stat-count' requires a value\"));\n \t\t\telse if (!*arg) {\n \t\t\t\tcount = strtoul(av[1], &end, 10);\n \t\t\t\targcount = 2;\n-- \n2.7.4\n\n"},{"id":"302131","messageId":"1474290501-2743-5-git-send-email-vascomalmeida@sapo.pt","threadId":"44110","inReplyTo":"1474290501-2743-1-git-send-email-vascomalmeida@sapo.pt","subject":"[PATCH 5/6] i18n: notes-merge: mark die messages for translation","fromName":"Vasco Almeida","fromEmail":"vascomalmeida@sapo.pt","sentAt":"2016-09-19T13:08:20Z","receivedAt":"2016-09-19T13:09:36Z","isPatch":true,"sender":{"key":"vascomalmeida@sapo.pt","avatar":"https://avatars.githubusercontent.com/u/9001556?v=4"},"body":"Update test to reflect changes.\n\nSigned-off-by: Vasco Almeida <vascomalmeida@sapo.pt>\n---\n notes-merge.c                         | 8 ++++----\n t/t3310-notes-merge-manual-resolve.sh | 2 +-\n 2 files changed, 5 insertions(+), 5 deletions(-)\n\ndiff --git a/notes-merge.c b/notes-merge.c\nindex 97fc42f..3bbeb86 100644\n--- a/notes-merge.c\n+++ b/notes-merge.c\n@@ -269,15 +269,15 @@ static void check_notes_merge_worktree(struct notes_merge_options *o)\n \t\tif (file_exists(git_path(NOTES_MERGE_WORKTREE)) &&\n \t\t    !is_empty_dir(git_path(NOTES_MERGE_WORKTREE))) {\n \t\t\tif (advice_resolve_conflict)\n-\t\t\t\tdie(\"You have not concluded your previous \"\n+\t\t\t\tdie(_(\"You have not concluded your previous \"\n \t\t\t\t    \"notes merge (%s exists).\\nPlease, use \"\n \t\t\t\t    \"'git notes merge --commit' or 'git notes \"\n \t\t\t\t    \"merge --abort' to commit/abort the \"\n \t\t\t\t    \"previous merge before you start a new \"\n-\t\t\t\t    \"notes merge.\", git_path(\"NOTES_MERGE_*\"));\n+\t\t\t\t    \"notes merge.\"), git_path(\"NOTES_MERGE_*\"));\n \t\t\telse\n-\t\t\t\tdie(\"You have not concluded your notes merge \"\n-\t\t\t\t    \"(%s exists).\", git_path(\"NOTES_MERGE_*\"));\n+\t\t\t\tdie(_(\"You have not concluded your notes merge \"\n+\t\t\t\t    \"(%s exists).\"), git_path(\"NOTES_MERGE_*\"));\n \t\t}\n \n \t\tif (safe_create_leading_directories_const(git_path(\ndiff --git a/t/t3310-notes-merge-manual-resolve.sh b/t/t3310-notes-merge-manual-resolve.sh\nindex 6967436..baef2d6 100755\n--- a/t/t3310-notes-merge-manual-resolve.sh\n+++ b/t/t3310-notes-merge-manual-resolve.sh\n@@ -225,7 +225,7 @@ test_expect_success 'cannot do merge w/conflicts when previous merge is unfinish\n \ttest -d .git/NOTES_MERGE_WORKTREE &&\n \ttest_must_fail git notes merge z >output 2>&1 &&\n \t# Output should indicate what is wrong\n-\tgrep -q \"\\\\.git/NOTES_MERGE_\\\\* exists\" output\n+\ttest_i18ngrep -q \"\\\\.git/NOTES_MERGE_\\\\* exists\" output\n '\n \n # Setup non-conflicting merge between x and new notes ref w\n-- \n2.7.4\n\n"},{"id":"302132","messageId":"1474290501-2743-6-git-send-email-vascomalmeida@sapo.pt","threadId":"44110","inReplyTo":"1474290501-2743-1-git-send-email-vascomalmeida@sapo.pt","subject":"[PATCH 6/6] i18n: stash: mark messages for translation","fromName":"Vasco Almeida","fromEmail":"vascomalmeida@sapo.pt","sentAt":"2016-09-19T13:08:21Z","receivedAt":"2016-09-19T13:09:43Z","isPatch":true,"sender":{"key":"vascomalmeida@sapo.pt","avatar":"https://avatars.githubusercontent.com/u/9001556?v=4"},"body":"Signed-off-by: Vasco Almeida <vascomalmeida@sapo.pt>\n---\n git-stash.sh | 6 +++---\n 1 file changed, 3 insertions(+), 3 deletions(-)\n\ndiff --git a/git-stash.sh b/git-stash.sh\nindex 826af18..90d63f2 100755\n--- a/git-stash.sh\n+++ b/git-stash.sh\n@@ -100,7 +100,7 @@ create_stash () {\n \t\t\t\tu_tree=$(git write-tree) &&\n \t\t\t\tprintf 'untracked files on %s\\n' \"$msg\" | git commit-tree $u_tree  &&\n \t\t\t\trm -f \"$TMPindex\"\n-\t\t) ) || die \"Cannot save the untracked files\"\n+\t\t) ) || die \"$(gettext \"Cannot save the untracked files\")\"\n \n \t\tuntracked_commit_option=\"-p $u_commit\";\n \telse\n@@ -248,7 +248,7 @@ save_stash () {\n \n \tif test -n \"$patch_mode\" && test -n \"$untracked\"\n \tthen\n-\t    die \"Can't use --patch and --include-untracked or --all at the same time\"\n+\t\tdie \"$(gettext \"Can't use --patch and --include-untracked or --all at the same time\")\"\n \tfi\n \n \tstash_msg=\"$*\"\n@@ -494,7 +494,7 @@ apply_stash () {\n \t\tGIT_INDEX_FILE=\"$TMPindex\" git-read-tree \"$u_tree\" &&\n \t\tGIT_INDEX_FILE=\"$TMPindex\" git checkout-index --all &&\n \t\trm -f \"$TMPindex\" ||\n-\t\tdie 'Could not restore untracked files from stash'\n+\t\tdie \"$(gettext \"Could not restore untracked files from stash\")\"\n \tfi\n \n \teval \"\n-- \n2.7.4\n\n"},{"id":"302158","messageId":"xmqq60prg4gy.fsf@gitster.mtv.corp.google.com","threadId":"44110","inReplyTo":"1474290501-2743-1-git-send-email-vascomalmeida@sapo.pt","subject":"Re: [PATCH 1/6] i18n: commit: mark message for translation","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2016-09-19T17:54:37Z","receivedAt":"2016-09-19T17:54:45Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\nI am responding to 1/6, as the series lacked a cover letter, but all\nof them looked good.\n\nThanks.\n"},{"id":"302182","messageId":"34292875.FKhN8jTqO5@cayenne","threadId":"44110","inReplyTo":"xmqq60prg4gy.fsf@gitster.mtv.corp.google.com","subject":"Re: [PATCH 1/6] i18n: commit: mark message for translation","fromName":"Jean-Noël AVILA","fromEmail":"jn.avila@free.fr","sentAt":"2016-09-19T20:34:49Z","receivedAt":"2016-09-19T20:35:01Z","isPatch":true,"sender":{"key":"jn.avila@free.fr","avatar":"https://avatars.githubusercontent.com/u/156172?v=4"},"body":"On lundi 19 septembre 2016 10:54:37 CEST Junio C Hamano wrote:\n> I am responding to 1/6, as the series lacked a cover letter, but all\n> of them looked good.\n> \n> Thanks.\n\nMaybe 3/6 would have benefited from some code factorization. But that's ok for \na few more sentences.\n\nThanks.\n\n"},{"id":"302187","messageId":"xmqq4m5begxj.fsf@gitster.mtv.corp.google.com","threadId":"44110","inReplyTo":"34292875.FKhN8jTqO5@cayenne","subject":"Re: [PATCH 1/6] i18n: commit: mark message for translation","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2016-09-19T21:08:24Z","receivedAt":"2016-09-19T21:08:49Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Jean-Noël AVILA <jn.avila@free.fr> writes:\n\n> Maybe 3/6 would have benefited from some code factorization. But that's ok for \n> a few more sentences.\n\nAh, let me see I understood what you mean.  Adding something like\nthis\n\n\tstatic NORETURN void die_want_option(const char *option_name)\n        {\n        \tdie(_(\"option '%s' requires a value\"), option_name);\n\t}\n\nand have many of the callers of die() call it would reduce the\nnumber of strings that translators would need to touch.\n\nI agree, but I think we can do that in a later follow-up.\n\nThanks.\n"},{"id":"302244","messageId":"1579845.fzuqLqrEJ8@cayenne","threadId":"44110","inReplyTo":"xmqq4m5begxj.fsf@gitster.mtv.corp.google.com","subject":"Re: [PATCH 1/6] i18n: commit: mark message for translation","fromName":"Jean-Noël AVILA","fromEmail":"jn.avila@free.fr","sentAt":"2016-09-20T19:04:27Z","receivedAt":"2016-09-20T19:04:40Z","isPatch":true,"sender":{"key":"jn.avila@free.fr","avatar":"https://avatars.githubusercontent.com/u/156172?v=4"},"body":"Signed-off-by: Vasco Almeida <vascomalmeida@sapo.pt>\nSigned-off-by: Jean-Noel Avila <jn.avila@free.fr>\n---\n\nInstead of distillating change requests, I'd better do it by myself. Here is the reworked version of the patch.\n\n diff.c | 15 ++++++++++-----\n 1 file changed, 10 insertions(+), 5 deletions(-)\n\ndiff --git a/diff.c b/diff.c\nindex c6da383..494f723 100644\n--- a/diff.c\n+++ b/diff.c\n@@ -55,6 +55,11 @@ static char diff_colors[][COLOR_MAXLEN] = {\n \tGIT_COLOR_NORMAL,\t/* FUNCINFO */\n };\n \n+static NORETURN void die_want_option(const char *option_name)\n+{\n+\tdie(_(\"option '%s' requires a value\"), option_name);\n+}\n+\n static int parse_diff_color_slot(const char *var)\n {\n \tif (!strcasecmp(var, \"context\") || !strcasecmp(var, \"plain\"))\n@@ -3325,7 +3330,7 @@ void diff_setup_done(struct diff_options *options)\n \tif (options->output_format & DIFF_FORMAT_NO_OUTPUT)\n \t\tcount++;\n \tif (count > 1)\n-\t\tdie(\"--name-only, --name-status, --check and -s are mutually exclusive\");\n+\t\tdie(_(\"--name-only, --name-status, --check and -s are mutually exclusive\"));\n \n \t/*\n \t * Most of the time we can say \"there are changes\"\n@@ -3521,7 +3526,7 @@ static int stat_opt(struct diff_options *options, const char **av)\n \t\t\tif (*arg == '=')\n \t\t\t\twidth = strtoul(arg + 1, &end, 10);\n \t\t\telse if (!*arg && !av[1])\n-\t\t\t\tdie(\"Option '--stat-width' requires a value\");\n+\t\t\t\tdie_want_option(\"--stat-width\");\n \t\t\telse if (!*arg) {\n \t\t\t\twidth = strtoul(av[1], &end, 10);\n \t\t\t\targcount = 2;\n@@ -3530,7 +3535,7 @@ static int stat_opt(struct diff_options *options, const char **av)\n \t\t\tif (*arg == '=')\n \t\t\t\tname_width = strtoul(arg + 1, &end, 10);\n \t\t\telse if (!*arg && !av[1])\n-\t\t\t\tdie(\"Option '--stat-name-width' requires a value\");\n+\t\t\t\tdie_want_option(\"--stat-name-width\");\n \t\t\telse if (!*arg) {\n \t\t\t\tname_width = strtoul(av[1], &end, 10);\n \t\t\t\targcount = 2;\n@@ -3539,7 +3544,7 @@ static int stat_opt(struct diff_options *options, const char **av)\n \t\t\tif (*arg == '=')\n \t\t\t\tgraph_width = strtoul(arg + 1, &end, 10);\n \t\t\telse if (!*arg && !av[1])\n-\t\t\t\tdie(\"Option '--stat-graph-width' requires a value\");\n+\t\t\t\tdie_want_option(\"--stat-graph-width\");\n \t\t\telse if (!*arg) {\n \t\t\t\tgraph_width = strtoul(av[1], &end, 10);\n \t\t\t\targcount = 2;\n@@ -3548,7 +3553,7 @@ static int stat_opt(struct diff_options *options, const char **av)\n \t\t\tif (*arg == '=')\n \t\t\t\tcount = strtoul(arg + 1, &end, 10);\n \t\t\telse if (!*arg && !av[1])\n-\t\t\t\tdie(\"Option '--stat-count' requires a value\");\n+\t\t\t\tdie_want_option(\"--stat-count\");\n \t\t\telse if (!*arg) {\n \t\t\t\tcount = strtoul(av[1], &end, 10);\n \t\t\t\targcount = 2;\n-- \n2.10.0\n\n\n"},{"id":"302297","messageId":"xmqqintp9np6.fsf@gitster.mtv.corp.google.com","threadId":"44110","inReplyTo":"1579845.fzuqLqrEJ8@cayenne","subject":"Re: [PATCH 1/6] i18n: commit: mark message for translation","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2016-09-21T17:17:57Z","receivedAt":"2016-09-21T17:18:31Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Jean-Noël AVILA <jn.avila@free.fr> writes:\n\n> Signed-off-by: Vasco Almeida <vascomalmeida@sapo.pt>\n> Signed-off-by: Jean-Noel Avila <jn.avila@free.fr>\n> ---\n>\n> Instead of distillating change requests, I'd better do it by\n> myself. Here is the reworked version of the patch.\n>\n\nIt would have helped if you had an in-body header to retitle this\npatch for 3/6, instead of leaving it as 1/6 for \"commit\" X-<.\n\nWill tweak and fit it in.  Thanks.\n\n>  diff.c | 15 ++++++++++-----\n>  1 file changed, 10 insertions(+), 5 deletions(-)\n>\n> diff --git a/diff.c b/diff.c\n> index c6da383..494f723 100644\n> --- a/diff.c\n> +++ b/diff.c\n> @@ -55,6 +55,11 @@ static char diff_colors[][COLOR_MAXLEN] = {\n>  \tGIT_COLOR_NORMAL,\t/* FUNCINFO */\n>  };\n>  \n> +static NORETURN void die_want_option(const char *option_name)\n> +{\n> +\tdie(_(\"option '%s' requires a value\"), option_name);\n> +}\n> +\n>  static int parse_diff_color_slot(const char *var)\n>  {\n>  \tif (!strcasecmp(var, \"context\") || !strcasecmp(var, \"plain\"))\n> @@ -3325,7 +3330,7 @@ void diff_setup_done(struct diff_options *options)\n>  \tif (options->output_format & DIFF_FORMAT_NO_OUTPUT)\n>  \t\tcount++;\n>  \tif (count > 1)\n> -\t\tdie(\"--name-only, --name-status, --check and -s are mutually exclusive\");\n> +\t\tdie(_(\"--name-only, --name-status, --check and -s are mutually exclusive\"));\n>  \n>  \t/*\n>  \t * Most of the time we can say \"there are changes\"\n> @@ -3521,7 +3526,7 @@ static int stat_opt(struct diff_options *options, const char **av)\n>  \t\t\tif (*arg == '=')\n>  \t\t\t\twidth = strtoul(arg + 1, &end, 10);\n>  \t\t\telse if (!*arg && !av[1])\n> -\t\t\t\tdie(\"Option '--stat-width' requires a value\");\n> +\t\t\t\tdie_want_option(\"--stat-width\");\n>  \t\t\telse if (!*arg) {\n>  \t\t\t\twidth = strtoul(av[1], &end, 10);\n>  \t\t\t\targcount = 2;\n> @@ -3530,7 +3535,7 @@ static int stat_opt(struct diff_options *options, const char **av)\n>  \t\t\tif (*arg == '=')\n>  \t\t\t\tname_width = strtoul(arg + 1, &end, 10);\n>  \t\t\telse if (!*arg && !av[1])\n> -\t\t\t\tdie(\"Option '--stat-name-width' requires a value\");\n> +\t\t\t\tdie_want_option(\"--stat-name-width\");\n>  \t\t\telse if (!*arg) {\n>  \t\t\t\tname_width = strtoul(av[1], &end, 10);\n>  \t\t\t\targcount = 2;\n> @@ -3539,7 +3544,7 @@ static int stat_opt(struct diff_options *options, const char **av)\n>  \t\t\tif (*arg == '=')\n>  \t\t\t\tgraph_width = strtoul(arg + 1, &end, 10);\n>  \t\t\telse if (!*arg && !av[1])\n> -\t\t\t\tdie(\"Option '--stat-graph-width' requires a value\");\n> +\t\t\t\tdie_want_option(\"--stat-graph-width\");\n>  \t\t\telse if (!*arg) {\n>  \t\t\t\tgraph_width = strtoul(av[1], &end, 10);\n>  \t\t\t\targcount = 2;\n> @@ -3548,7 +3553,7 @@ static int stat_opt(struct diff_options *options, const char **av)\n>  \t\t\tif (*arg == '=')\n>  \t\t\t\tcount = strtoul(arg + 1, &end, 10);\n>  \t\t\telse if (!*arg && !av[1])\n> -\t\t\t\tdie(\"Option '--stat-count' requires a value\");\n> +\t\t\t\tdie_want_option(\"--stat-count\");\n>  \t\t\telse if (!*arg) {\n>  \t\t\t\tcount = strtoul(av[1], &end, 10);\n>  \t\t\t\targcount = 2;\n"}]}