{"thread":{"id":"48805","subject":"[PATCH 00/23] Mark strings for translation","startedAt":"2018-06-30T09:08:30Z","lastAt":"2018-07-02T20:32:16Z","messageCount":29,"participants":["Nguyễn Thái Ngọc Duy","Elijah Newren","Derrick Stolee"],"isPatch":true,"patchVersion":1,"patchTotal":23},"messages":[{"id":"351412","messageId":"20180630090818.28937-1-pclouds@gmail.com","threadId":"48805","inReplyTo":null,"subject":"[PATCH 00/23] Mark strings for translation","fromName":"Nguyễn Thái Ngọc Duy","fromEmail":"pclouds@gmail.com","sentAt":"2018-06-30T09:07:55Z","receivedAt":"2018-06-30T09:08:30Z","isPatch":true,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"This is a rebased version of v2 [1], sent during rc time and was\nprobably fell through the cracks.\n\n[1] https://public-inbox.org/git/20180603163420.13702-1-pclouds@gmail.com/\n\nNguyễn Thái Ngọc Duy (23):\n  Update messages in preparation for i18n\n  archive-tar.c: mark more strings for translation\n  archive-zip.c: mark more strings for translation\n  builtin/config.c: mark more strings for translation\n  builtin/grep.c: mark strings for translation and no full stops\n  builtin/pack-objects.c: mark more strings for translation\n  builtin/replace.c: mark more strings for translation\n  commit-graph.c: mark more strings for translation\n  config.c: mark more strings for translation\n  connect.c: mark more strings for translation\n  convert.c: mark more strings for translation\n  dir.c: mark more strings for translation\n  environment.c: mark more strings for translation\n  exec-cmd.c: mark more strings for translation\n  object.c: mark more strings for translation\n  pkt-line.c: mark more strings for translation\n  refs.c: mark more strings for translation\n  refspec.c: mark more strings for translation\n  replace-object.c: mark more strings for translation\n  sequencer.c: mark more strings for translation\n  sha1-file.c: mark more strings for translation\n  transport.c: mark more strings for translation\n  transport-helper.c: mark more strings for translation\n\n archive-tar.c                         |  12 +--\n archive-zip.c                         |  14 ++--\n builtin/config.c                      |  50 ++++++------\n builtin/grep.c                        |  12 +--\n builtin/pack-objects.c                | 108 ++++++++++++-------------\n builtin/replace.c                     |  90 ++++++++++-----------\n commit-graph.c                        |  20 ++---\n config.c                              |  76 +++++++++---------\n connect.c                             |  85 +++++++++++---------\n convert.c                             |  42 +++++-----\n dir.c                                 |   8 +-\n environment.c                         |   4 +-\n exec-cmd.c                            |   2 +-\n object.c                              |  10 +--\n pkt-line.c                            |  26 +++---\n refs.c                                |  40 +++++-----\n refspec.c                             |   2 +-\n replace-object.c                      |   6 +-\n sequencer.c                           |  28 ++++---\n sha1-file.c                           | 110 +++++++++++++-------------\n t/t0021-conversion.sh                 |   2 +-\n t/t1305-config-include.sh             |   2 +-\n t/t1308-config-set.sh                 |   2 +-\n t/t1400-update-ref.sh                 |  20 ++---\n t/t1404-update-ref-errors.sh          |   4 +-\n t/t1450-fsck.sh                       |   2 +-\n t/t3005-ls-files-relative.sh          |   8 +-\n t/t3210-pack-refs.sh                  |   2 +-\n t/t3310-notes-merge-manual-resolve.sh |   6 +-\n t/t5500-fetch-pack.sh                 |   2 +-\n t/t5505-remote.sh                     |   2 +-\n t/t5570-git-daemon.sh                 |   6 +-\n t/t5801-remote-helpers.sh             |   8 +-\n t/t7063-status-untracked-cache.sh     |   2 +-\n t/t7400-submodule-basic.sh            |   2 +-\n transport-helper.c                    |  89 ++++++++++-----------\n transport.c                           |  18 ++---\n 37 files changed, 470 insertions(+), 452 deletions(-)\n\n-- \n2.18.0.rc2.476.g39500d3211\n\n"},{"id":"351413","messageId":"20180630090818.28937-2-pclouds@gmail.com","threadId":"48805","inReplyTo":"20180630090818.28937-1-pclouds@gmail.com","subject":"[PATCH 01/23] Update messages in preparation for i18n","fromName":"Nguyễn Thái Ngọc Duy","fromEmail":"pclouds@gmail.com","sentAt":"2018-06-30T09:07:56Z","receivedAt":"2018-06-30T09:08:44Z","isPatch":true,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"Many messages will be marked for translation in the following\ncommits. This commit updates some of them to be more consistent and\nreduce diff noise in those commits. Changes are\n\n- keep the first letter of die(), error() and warning() in lowercase\n- no full stop in die(), error() or warning() if it's single sentence\n  messages\n- indentation\n- some messages are turned to BUG(), or prefixed with \"BUG:\" and will\n  not be marked for i18n\n- some messages are improved to give more information\n- some messages are broken down by sentence to be i18n friendly\n- the trailing \\n is converted to printf_ln if possible\n- errno_errno() is used instead of explicit strerror()\n\nSigned-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>\n---\n archive-zip.c                     |  2 +-\n builtin/config.c                  | 18 +++++++-----\n builtin/grep.c                    | 10 +++----\n builtin/pack-objects.c            | 10 +++----\n builtin/replace.c                 | 22 +++++++-------\n config.c                          |  2 +-\n connect.c                         | 33 +++++++++++----------\n convert.c                         |  6 ++--\n dir.c                             |  4 +--\n pkt-line.c                        |  2 +-\n refs.c                            | 12 ++++----\n refspec.c                         |  2 +-\n sequencer.c                       |  8 +++---\n sha1-file.c                       |  8 +++---\n t/t1400-update-ref.sh             |  8 +++---\n t/t3005-ls-files-relative.sh      |  4 +--\n t/t5801-remote-helpers.sh         |  6 ++--\n t/t7063-status-untracked-cache.sh |  2 +-\n transport-helper.c                | 48 +++++++++++++++----------------\n transport.c                       |  8 +++---\n 20 files changed, 111 insertions(+), 104 deletions(-)\n\ndiff --git a/archive-zip.c b/archive-zip.c\nindex 74f3fe9103..48d843489c 100644\n--- a/archive-zip.c\n+++ b/archive-zip.c\n@@ -309,7 +309,7 @@ static int write_zip_entry(struct archiver_args *args,\n \t\tif (is_utf8(path))\n \t\t\tflags |= ZIP_UTF8;\n \t\telse\n-\t\t\twarning(\"Path is not valid UTF-8: %s\", path);\n+\t\t\twarning(\"path is not valid UTF-8: %s\", path);\n \t}\n \n \tif (pathlen > 0xffff) {\ndiff --git a/builtin/config.c b/builtin/config.c\nindex b29d26dede..ebeb4c5638 100644\n--- a/builtin/config.c\n+++ b/builtin/config.c\n@@ -110,7 +110,7 @@ static int option_parse_type(const struct option *opt, const char *arg,\n \t\t * --int' and '--type=bool\n \t\t * --type=int'.\n \t\t */\n-\t\terror(\"only one type at a time.\");\n+\t\terror(\"only one type at a time\");\n \t\tusage_with_options(builtin_config_usage,\n \t\t\tbuiltin_config_options);\n \t}\n@@ -160,7 +160,11 @@ static struct option builtin_config_options[] = {\n static void check_argc(int argc, int min, int max) {\n \tif (argc >= min && argc <= max)\n \t\treturn;\n-\terror(\"wrong number of arguments\");\n+\tif (min == max)\n+\t\terror(\"wrong number of arguments, should be %d\", min);\n+\telse\n+\t\terror(\"wrong number of arguments, should be from %d to %d\",\n+\t\t      min, max);\n \tusage_with_options(builtin_config_usage, builtin_config_options);\n }\n \n@@ -595,7 +599,7 @@ int cmd_config(int argc, const char **argv, const char *prefix)\n \n \tif (use_global_config + use_system_config + use_local_config +\n \t    !!given_config_source.file + !!given_config_source.blob > 1) {\n-\t\terror(\"only one config file at a time.\");\n+\t\terror(\"only one config file at a time\");\n \t\tusage_with_options(builtin_config_usage, builtin_config_options);\n \t}\n \n@@ -622,7 +626,7 @@ int cmd_config(int argc, const char **argv, const char *prefix)\n \t\t\t * location; error out even if XDG_CONFIG_HOME\n \t\t\t * is set and points at a sane location.\n \t\t\t */\n-\t\t\tdie(\"$HOME not set\");\n+\t\t\tdie(\"$HOME is not set\");\n \n \t\tif (access_or_warn(user_config, R_OK, 0) &&\n \t\t    xdg_config && !access_or_warn(xdg_config, R_OK, 0)) {\n@@ -664,7 +668,7 @@ int cmd_config(int argc, const char **argv, const char *prefix)\n \t}\n \n \tif (HAS_MULTI_BITS(actions)) {\n-\t\terror(\"only one action at a time.\");\n+\t\terror(\"only one action at a time\");\n \t\tusage_with_options(builtin_config_usage, builtin_config_options);\n \t}\n \tif (actions == 0)\n@@ -819,7 +823,7 @@ int cmd_config(int argc, const char **argv, const char *prefix)\n \t\tif (ret < 0)\n \t\t\treturn ret;\n \t\tif (ret == 0)\n-\t\t\tdie(\"No such section!\");\n+\t\t\tdie(\"no such section: %s\", argv[0]);\n \t}\n \telse if (actions == ACTION_REMOVE_SECTION) {\n \t\tint ret;\n@@ -830,7 +834,7 @@ int cmd_config(int argc, const char **argv, const char *prefix)\n \t\tif (ret < 0)\n \t\t\treturn ret;\n \t\tif (ret == 0)\n-\t\t\tdie(\"No such section!\");\n+\t\t\tdie(\"no such section: %s\", argv[0]);\n \t}\n \telse if (actions == ACTION_GET_COLOR) {\n \t\tcheck_argc(argc, 1, 2);\ndiff --git a/builtin/grep.c b/builtin/grep.c\nindex ee753a403e..9774920999 100644\n--- a/builtin/grep.c\n+++ b/builtin/grep.c\n@@ -959,7 +959,7 @@ int cmd_grep(int argc, const char **argv, const char *prefix)\n \t}\n \n \tif (!opt.pattern_list)\n-\t\tdie(_(\"no pattern given.\"));\n+\t\tdie(_(\"no pattern given\"));\n \n \t/*\n \t * We have to find \"--\" in a separate pass, because its presence\n@@ -1085,19 +1085,19 @@ int cmd_grep(int argc, const char **argv, const char *prefix)\n \t}\n \n \tif (recurse_submodules && (!use_index || untracked))\n-\t\tdie(_(\"option not supported with --recurse-submodules.\"));\n+\t\tdie(_(\"option not supported with --recurse-submodules\"));\n \n \tif (!show_in_pager && !opt.status_only)\n \t\tsetup_pager();\n \n \tif (!use_index && (untracked || cached))\n-\t\tdie(_(\"--cached or --untracked cannot be used with --no-index.\"));\n+\t\tdie(_(\"--cached or --untracked cannot be used with --no-index\"));\n \n \tif (!use_index || untracked) {\n \t\tint use_exclude = (opt_exclude < 0) ? use_index : !!opt_exclude;\n \t\thit = grep_directory(&opt, &pathspec, use_exclude, use_index);\n \t} else if (0 <= opt_exclude) {\n-\t\tdie(_(\"--[no-]exclude-standard cannot be used for tracked contents.\"));\n+\t\tdie(_(\"--[no-]exclude-standard cannot be used for tracked contents\"));\n \t} else if (!list.nr) {\n \t\tif (!cached)\n \t\t\tsetup_work_tree();\n@@ -1105,7 +1105,7 @@ int cmd_grep(int argc, const char **argv, const char *prefix)\n \t\thit = grep_cache(&opt, the_repository, &pathspec, cached);\n \t} else {\n \t\tif (cached)\n-\t\t\tdie(_(\"both --cached and trees are given.\"));\n+\t\t\tdie(_(\"both --cached and trees are given\"));\n \n \t\thit = grep_objects(&opt, &pathspec, &list);\n \t}\ndiff --git a/builtin/pack-objects.c b/builtin/pack-objects.c\nindex 71056d8294..1a6ece425d 100644\n--- a/builtin/pack-objects.c\n+++ b/builtin/pack-objects.c\n@@ -2341,7 +2341,7 @@ static void ll_find_deltas(struct object_entry **list, unsigned list_size,\n \t\treturn;\n \t}\n \tif (progress > pack_to_stdout)\n-\t\tfprintf(stderr, \"Delta compression using up to %d threads.\\n\",\n+\t\tfprintf_ln(stderr, \"Delta compression using up to %d threads.\",\n \t\t\t\tdelta_search_threads);\n \tp = xcalloc(delta_search_threads, sizeof(*p));\n \n@@ -2638,7 +2638,7 @@ static void read_object_list_from_stdin(void)\n \t\t\tif (feof(stdin))\n \t\t\t\tbreak;\n \t\t\tif (!ferror(stdin))\n-\t\t\t\tdie(\"fgets returned NULL, not EOF, not error!\");\n+\t\t\t\tdie(\"BUG: fgets returned NULL, not EOF, not error!\");\n \t\t\tif (errno != EINTR)\n \t\t\t\tdie_errno(\"fgets\");\n \t\t\tclearerr(stdin);\n@@ -3353,8 +3353,8 @@ int cmd_pack_objects(int argc, const char **argv, const char *prefix)\n \t\tprepare_pack(window, depth);\n \twrite_pack_file();\n \tif (progress)\n-\t\tfprintf(stderr, \"Total %\"PRIu32\" (delta %\"PRIu32\"),\"\n-\t\t\t\" reused %\"PRIu32\" (delta %\"PRIu32\")\\n\",\n-\t\t\twritten, written_delta, reused, reused_delta);\n+\t\tfprintf_ln(stderr, \"Total %\"PRIu32\" (delta %\"PRIu32\"),\"\n+\t\t\t   \" reused %\"PRIu32\" (delta %\"PRIu32\")\",\n+\t\t\t   written, written_delta, reused, reused_delta);\n \treturn 0;\n }\ndiff --git a/builtin/replace.c b/builtin/replace.c\nindex 6da2411e14..de826e8209 100644\n--- a/builtin/replace.c\n+++ b/builtin/replace.c\n@@ -54,7 +54,7 @@ static int show_reference(const char *refname, const struct object_id *oid,\n \t\t\tenum object_type obj_type, repl_type;\n \n \t\t\tif (get_oid(refname, &object))\n-\t\t\t\treturn error(\"Failed to resolve '%s' as a valid ref.\", refname);\n+\t\t\t\treturn error(\"failed to resolve '%s' as a valid ref\", refname);\n \n \t\t\tobj_type = oid_object_info(the_repository, &object,\n \t\t\t\t\t\t   NULL);\n@@ -108,7 +108,7 @@ static int for_each_replace_name(const char **argv, each_replace_name_fn fn)\n \n \tfor (p = argv; *p; p++) {\n \t\tif (get_oid(*p, &oid)) {\n-\t\t\terror(\"Failed to resolve '%s' as a valid ref.\", *p);\n+\t\t\terror(\"failed to resolve '%s' as a valid ref\", *p);\n \t\t\thad_error = 1;\n \t\t\tcontinue;\n \t\t}\n@@ -118,7 +118,7 @@ static int for_each_replace_name(const char **argv, each_replace_name_fn fn)\n \t\tfull_hex = ref.buf + base_len;\n \n \t\tif (read_ref(ref.buf, &oid)) {\n-\t\t\terror(\"replace ref '%s' not found.\", full_hex);\n+\t\t\terror(\"replace ref '%s' not found\", full_hex);\n \t\t\thad_error = 1;\n \t\t\tcontinue;\n \t\t}\n@@ -134,7 +134,7 @@ static int delete_replace_ref(const char *name, const char *ref,\n {\n \tif (delete_ref(NULL, ref, oid, 0))\n \t\treturn 1;\n-\tprintf(\"Deleted replace ref '%s'\\n\", name);\n+\tprintf_ln(\"Deleted replace ref '%s'\", name);\n \treturn 0;\n }\n \n@@ -146,7 +146,7 @@ static int check_ref_valid(struct object_id *object,\n \tstrbuf_reset(ref);\n \tstrbuf_addf(ref, \"%s%s\", git_replace_ref_base, oid_to_hex(object));\n \tif (check_refname_format(ref->buf, 0))\n-\t\treturn error(\"'%s' is not a valid ref name.\", ref->buf);\n+\t\treturn error(\"'%s' is not a valid ref name\", ref->buf);\n \n \tif (read_ref(ref->buf, prev))\n \t\toidclr(prev);\n@@ -200,10 +200,10 @@ static int replace_object(const char *object_ref, const char *replace_ref, int f\n \tstruct object_id object, repl;\n \n \tif (get_oid(object_ref, &object))\n-\t\treturn error(\"Failed to resolve '%s' as a valid ref.\",\n+\t\treturn error(\"failed to resolve '%s' as a valid ref\",\n \t\t\t     object_ref);\n \tif (get_oid(replace_ref, &repl))\n-\t\treturn error(\"Failed to resolve '%s' as a valid ref.\",\n+\t\treturn error(\"failed to resolve '%s' as a valid ref\",\n \t\t\t     replace_ref);\n \n \treturn replace_object_oid(object_ref, &object, replace_ref, &repl, force);\n@@ -315,7 +315,7 @@ static int edit_and_replace(const char *object_ref, int force, int raw)\n \tstruct strbuf ref = STRBUF_INIT;\n \n \tif (get_oid(object_ref, &old_oid) < 0)\n-\t\treturn error(\"Not a valid object name: '%s'\", object_ref);\n+\t\treturn error(\"not a valid object name: '%s'\", object_ref);\n \n \ttype = oid_object_info(the_repository, &old_oid, NULL);\n \tif (type < 0)\n@@ -368,7 +368,7 @@ static int replace_parents(struct strbuf *buf, int argc, const char **argv)\n \t\tstruct object_id oid;\n \t\tif (get_oid(argv[i], &oid) < 0) {\n \t\t\tstrbuf_release(&new_parents);\n-\t\t\treturn error(_(\"Not a valid object name: '%s'\"),\n+\t\t\treturn error(_(\"not a valid object name: '%s'\"),\n \t\t\t\t     argv[i]);\n \t\t}\n \t\tif (!lookup_commit_reference(&oid)) {\n@@ -412,7 +412,7 @@ static int check_one_mergetag(struct commit *commit,\n \tfor (i = 1; i < mergetag_data->argc; i++) {\n \t\tstruct object_id oid;\n \t\tif (get_oid(mergetag_data->argv[i], &oid) < 0)\n-\t\t\treturn error(_(\"Not a valid object name: '%s'\"),\n+\t\t\treturn error(_(\"not a valid object name: '%s'\"),\n \t\t\t\t     mergetag_data->argv[i]);\n \t\tif (!oidcmp(&tag->tagged->oid, &oid))\n \t\t\treturn 0; /* found */\n@@ -442,7 +442,7 @@ static int create_graft(int argc, const char **argv, int force, int gentle)\n \tunsigned long size;\n \n \tif (get_oid(old_ref, &old_oid) < 0)\n-\t\treturn error(_(\"Not a valid object name: '%s'\"), old_ref);\n+\t\treturn error(_(\"not a valid object name: '%s'\"), old_ref);\n \tcommit = lookup_commit_reference(&old_oid);\n \tif (!commit)\n \t\treturn error(_(\"could not parse %s\"), old_ref);\ndiff --git a/config.c b/config.c\nindex f4a208a166..bb2e30fe3d 100644\n--- a/config.c\n+++ b/config.c\n@@ -461,7 +461,7 @@ int git_config_from_parameters(config_fn_t fn, void *data)\n \tenvw = xstrdup(env);\n \n \tif (sq_dequote_to_argv(envw, &argv, &nr, &alloc) < 0) {\n-\t\tret = error(\"bogus format in \" CONFIG_DATA_ENVIRONMENT);\n+\t\tret = error(\"bogus format in %s\", CONFIG_DATA_ENVIRONMENT);\n \t\tgoto out;\n \t}\n \ndiff --git a/connect.c b/connect.c\nindex 968e91b18c..083cf804a7 100644\n--- a/connect.c\n+++ b/connect.c\n@@ -58,7 +58,7 @@ static NORETURN void die_initial_contact(int unexpected)\n \t * response does not necessarily mean an ACL problem, though.\n \t */\n \tif (unexpected)\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@@ -230,7 +230,7 @@ static int process_dummy_ref(const char *line)\n static void check_no_capabilities(const char *line, int len)\n {\n \tif (strlen(line) != len)\n-\t\twarning(\"Ignoring capabilities after first line '%s'\",\n+\t\twarning(\"ignoring capabilities after first line '%s'\",\n \t\t\tline + strlen(line));\n }\n \n@@ -544,7 +544,7 @@ static enum protocol get_protocol(const char *name)\n \t\treturn PROTO_SSH;\n \tif (!strcmp(name, \"file\"))\n \t\treturn PROTO_FILE;\n-\tdie(\"I don't handle protocol '%s'\", name);\n+\tdie(\"protocol '%s' is not supported\", name);\n }\n \n static char *host_end(char **hoststart, int removebrackets)\n@@ -595,8 +595,7 @@ static void enable_keepalive(int sockfd)\n \tint ka = 1;\n \n \tif (setsockopt(sockfd, SOL_SOCKET, SO_KEEPALIVE, &ka, sizeof(ka)) < 0)\n-\t\tfprintf(stderr, \"unable to set SO_KEEPALIVE on socket: %s\\n\",\n-\t\t\tstrerror(errno));\n+\t\terror_errno(\"unable to set SO_KEEPALIVE on socket\");\n }\n \n #ifndef NO_IPV6\n@@ -640,10 +639,12 @@ static int git_tcp_connect_sock(char *host, int flags)\n \n \tgai = getaddrinfo(host, port, &hints, &ai);\n \tif (gai)\n-\t\tdie(\"Unable to look up %s (port %s) (%s)\", host, port, gai_strerror(gai));\n+\t\tdie(\"unable to look up %s (port %s) (%s)\", host, port, gai_strerror(gai));\n \n-\tif (flags & CONNECT_VERBOSE)\n-\t\tfprintf(stderr, \"done.\\nConnecting to %s (port %s) ... \", host, port);\n+\tif (flags & CONNECT_VERBOSE) {\n+\t\tfprintf_ln(stderr, \"done.\");\n+\t\tfprintf(stderr, \"Connecting to %s (port %s) ... \", host, port);\n+\t}\n \n \tfor (ai0 = ai; ai; ai = ai->ai_next, cnt++) {\n \t\tsockfd = socket(ai->ai_family,\n@@ -670,7 +671,7 @@ static int git_tcp_connect_sock(char *host, int flags)\n \tenable_keepalive(sockfd);\n \n \tif (flags & CONNECT_VERBOSE)\n-\t\tfprintf(stderr, \"done.\\n\");\n+\t\tfprintf_ln(stderr, \"done.\");\n \n \tstrbuf_release(&error_message);\n \n@@ -701,18 +702,20 @@ static int git_tcp_connect_sock(char *host, int flags)\n \n \the = gethostbyname(host);\n \tif (!he)\n-\t\tdie(\"Unable to look up %s (%s)\", host, hstrerror(h_errno));\n+\t\tdie(\"unable to look up %s (%s)\", host, hstrerror(h_errno));\n \tnport = strtoul(port, &ep, 10);\n \tif ( ep == port || *ep ) {\n \t\t/* Not numeric */\n \t\tstruct servent *se = getservbyname(port,\"tcp\");\n \t\tif ( !se )\n-\t\t\tdie(\"Unknown port %s\", port);\n+\t\t\tdie(\"unknown port %s\", port);\n \t\tnport = se->s_port;\n \t}\n \n-\tif (flags & CONNECT_VERBOSE)\n-\t\tfprintf(stderr, \"done.\\nConnecting to %s (port %s) ... \", host, port);\n+\tif (flags & CONNECT_VERBOSE) {\n+\t\tfprintf_ln(stderr, \"done.\");\n+\t\tfprintf(stderr, \"Connecting to %s (port %s) ... \", host, port);\n+\t}\n \n \tfor (cnt = 0, ap = he->h_addr_list; *ap; ap++, cnt++) {\n \t\tmemset(&sa, 0, sizeof sa);\n@@ -745,7 +748,7 @@ static int git_tcp_connect_sock(char *host, int flags)\n \tenable_keepalive(sockfd);\n \n \tif (flags & CONNECT_VERBOSE)\n-\t\tfprintf(stderr, \"done.\\n\");\n+\t\tfprintf_ln(stderr, \"done.\");\n \n \treturn sockfd;\n }\n@@ -921,7 +924,7 @@ static enum protocol parse_connect_url(const char *url_orig, char **ret_host,\n \t\tpath = strchr(end, separator);\n \n \tif (!path || !*path)\n-\t\tdie(\"No path specified. See 'man git-pull' for valid url syntax\");\n+\t\tdie(\"no path specified; see 'git help pull' for valid url syntax\");\n \n \t/*\n \t * null-terminate hostname and point path to ~ for URL's like this:\ndiff --git a/convert.c b/convert.c\nindex 64d0d30e08..f47e60022e 100644\n--- a/convert.c\n+++ b/convert.c\n@@ -190,7 +190,7 @@ static enum eol output_eol(enum crlf_action crlf_action)\n \t\t/* fall through */\n \t\treturn text_eol_is_crlf() ? EOL_CRLF : EOL_LF;\n \t}\n-\twarning(\"Illegal crlf_action %d\\n\", (int)crlf_action);\n+\twarning(\"illegal crlf_action %d\", (int)crlf_action);\n \treturn core_eol;\n }\n \n@@ -203,7 +203,7 @@ static void check_global_conv_flags_eol(const char *path, enum crlf_action crlf_\n \t\t * CRLFs would not be restored by checkout\n \t\t */\n \t\tif (conv_flags & CONV_EOL_RNDTRP_DIE)\n-\t\t\tdie(_(\"CRLF would be replaced by LF in %s.\"), path);\n+\t\t\tdie(_(\"CRLF would be replaced by LF in %s\"), path);\n \t\telse if (conv_flags & CONV_EOL_RNDTRP_WARN)\n \t\t\twarning(_(\"CRLF will be replaced by LF in %s.\\n\"\n \t\t\t\t  \"The file will have its original line\"\n@@ -493,7 +493,7 @@ static int encode_to_worktree(const char *path, const char *src, size_t src_len,\n \t\t\t\t  &dst_len);\n \tif (!dst) {\n \t\terror(\"failed to encode '%s' from %s to %s\",\n-\t\t\tpath, default_encoding, enc);\n+\t\t      path, default_encoding, enc);\n \t\treturn 0;\n \t}\n \ndiff --git a/dir.c b/dir.c\nindex fe9bf58e4c..e1a2e1cffb 100644\n--- a/dir.c\n+++ b/dir.c\n@@ -560,7 +560,7 @@ int report_path_error(const char *ps_matched,\n \t\tif (found_dup)\n \t\t\tcontinue;\n \n-\t\terror(\"pathspec '%s' did not match any file(s) known to git.\",\n+\t\terror(\"pathspec '%s' did not match any file(s) known to git\",\n \t\t      pathspec->items[num].original);\n \t\terrors++;\n \t}\n@@ -2230,7 +2230,7 @@ static struct untracked_cache_dir *validate_untracked_cache(struct dir_struct *d\n \t\treturn NULL;\n \n \tif (!ident_in_untracked(dir->untracked)) {\n-\t\twarning(_(\"Untracked cache is disabled on this system or location.\"));\n+\t\twarning(_(\"untracked cache is disabled on this system or location\"));\n \t\treturn NULL;\n \t}\n \ndiff --git a/pkt-line.c b/pkt-line.c\nindex a593c08aad..941e41dfc1 100644\n--- a/pkt-line.c\n+++ b/pkt-line.c\n@@ -296,7 +296,7 @@ static int get_packet_data(int fd, char **src_buf, size_t *src_size,\n \t\tif (options & PACKET_READ_GENTLE_ON_EOF)\n \t\t\treturn -1;\n \n-\t\tdie(\"The remote end hung up unexpectedly\");\n+\t\tdie(\"the remote end hung up unexpectedly\");\n \t}\n \n \treturn ret;\ndiff --git a/refs.c b/refs.c\nindex 0eb379f931..a033910353 100644\n--- a/refs.c\n+++ b/refs.c\n@@ -567,9 +567,9 @@ int expand_ref(const char *str, int len, struct object_id *oid, char **ref)\n \t\t\tif (!warn_ambiguous_refs)\n \t\t\t\tbreak;\n \t\t} else if ((flag & REF_ISSYMREF) && strcmp(fullref.buf, \"HEAD\")) {\n-\t\t\twarning(\"ignoring dangling symref %s.\", fullref.buf);\n+\t\t\twarning(\"ignoring dangling symref %s\", fullref.buf);\n \t\t} else if ((flag & REF_ISBROKEN) && strchr(fullref.buf, '/')) {\n-\t\t\twarning(\"ignoring broken ref %s.\", fullref.buf);\n+\t\t\twarning(\"ignoring broken ref %s\", fullref.buf);\n \t\t}\n \t}\n \tstrbuf_release(&fullref);\n@@ -871,13 +871,13 @@ static int read_ref_at_ent(struct object_id *ooid, struct object_id *noid,\n \t\tif (!is_null_oid(&cb->ooid)) {\n \t\t\toidcpy(cb->oid, noid);\n \t\t\tif (oidcmp(&cb->ooid, noid))\n-\t\t\t\twarning(\"Log for ref %s has gap after %s.\",\n+\t\t\t\twarning(\"log for ref %s has gap after %s\",\n \t\t\t\t\tcb->refname, show_date(cb->date, cb->tz, DATE_MODE(RFC2822)));\n \t\t}\n \t\telse if (cb->date == cb->at_time)\n \t\t\toidcpy(cb->oid, noid);\n \t\telse if (oidcmp(noid, cb->oid))\n-\t\t\twarning(\"Log for ref %s unexpectedly ended on %s.\",\n+\t\t\twarning(\"log for ref %s unexpectedly ended on %s\",\n \t\t\t\tcb->refname, show_date(cb->date, cb->tz,\n \t\t\t\t\t\t       DATE_MODE(RFC2822)));\n \t\toidcpy(&cb->ooid, ooid);\n@@ -935,7 +935,7 @@ int read_ref_at(const char *refname, unsigned int flags, timestamp_t at_time, in\n \t\tif (flags & GET_OID_QUIETLY)\n \t\t\texit(128);\n \t\telse\n-\t\t\tdie(\"Log for %s is empty.\", refname);\n+\t\t\tdie(\"log for %s is empty\", refname);\n \t}\n \tif (cb.found_it)\n \t\treturn 0;\n@@ -1845,7 +1845,7 @@ int ref_update_reject_duplicates(struct string_list *refnames,\n \n \t\tif (!cmp) {\n \t\t\tstrbuf_addf(err,\n-\t\t\t\t    \"multiple updates for ref '%s' not allowed.\",\n+\t\t\t\t    \"multiple updates for ref '%s' not allowed\",\n \t\t\t\t    refnames->items[i].string);\n \t\t\treturn 1;\n \t\t} else if (cmp > 0) {\ndiff --git a/refspec.c b/refspec.c\nindex e8010dce0c..c66351743b 100644\n--- a/refspec.c\n+++ b/refspec.c\n@@ -134,7 +134,7 @@ void refspec_item_init_or_die(struct refspec_item *item, const char *refspec,\n \t\t\t      int fetch)\n {\n \tif (!refspec_item_init(item, refspec, fetch))\n-\t\tdie(\"Invalid refspec '%s'\", refspec);\n+\t\tdie(\"invalid refspec '%s'\", refspec);\n }\n \n void refspec_item_clear(struct refspec_item *item)\ndiff --git a/sequencer.c b/sequencer.c\nindex 5354d4d51e..6b6162d194 100644\n--- a/sequencer.c\n+++ b/sequencer.c\n@@ -306,7 +306,7 @@ static const char *action_name(const struct replay_opts *opts)\n \tcase REPLAY_INTERACTIVE_REBASE:\n \t\treturn N_(\"rebase -i\");\n \t}\n-\tdie(_(\"Unknown action: %d\"), opts->action);\n+\tdie(_(\"unknown action: %d\"), opts->action);\n }\n \n struct commit_message {\n@@ -1444,7 +1444,7 @@ static const char *command_to_string(const enum todo_command command)\n {\n \tif (command < TODO_COMMENT)\n \t\treturn todo_command_info[command].str;\n-\tdie(\"Unknown command: %d\", command);\n+\tdie(\"unknown command: %d\", command);\n }\n \n static char command_to_char(const enum todo_command command)\n@@ -2608,7 +2608,7 @@ static int error_with_patch(struct commit *commit,\n \t\t\t\"\\n\"\n \t\t\t\"  git rebase --continue\\n\", gpg_sign_opt_quoted(opts));\n \t} else if (exit_code)\n-\t\tfprintf(stderr, \"Could not apply %s... %.*s\\n\",\n+\t\tfprintf_ln(stderr, \"Could not apply %s... %.*s\",\n \t\t\tshort_commit_name(commit), subject_len, subject);\n \n \treturn exit_code;\n@@ -2719,7 +2719,7 @@ static int do_label(const char *name, int len)\n \tstruct object_id head_oid;\n \n \tif (len == 1 && *name == '#')\n-\t\treturn error(\"Illegal label name: '%.*s'\", len, name);\n+\t\treturn error(\"illegal label name: '%.*s'\", len, name);\n \n \tstrbuf_addf(&ref_name, \"refs/rewritten/%.*s\", len, name);\n \tstrbuf_addf(&msg, \"rebase -i (label) '%.*s'\", len, name);\ndiff --git a/sha1-file.c b/sha1-file.c\nindex de4839e634..ed7ac73fa9 100644\n--- a/sha1-file.c\n+++ b/sha1-file.c\n@@ -71,17 +71,17 @@ static void git_hash_sha1_final(unsigned char *hash, git_hash_ctx *ctx)\n \n static void git_hash_unknown_init(git_hash_ctx *ctx)\n {\n-\tdie(\"trying to init unknown hash\");\n+\tBUG(\"trying to init unknown hash\");\n }\n \n static void git_hash_unknown_update(git_hash_ctx *ctx, const void *data, size_t len)\n {\n-\tdie(\"trying to update unknown hash\");\n+\tBUG(\"trying to update unknown hash\");\n }\n \n static void git_hash_unknown_final(unsigned char *hash, git_hash_ctx *ctx)\n {\n-\tdie(\"trying to finalize unknown hash\");\n+\tBUG(\"trying to finalize unknown hash\");\n }\n \n const struct git_hash_algo hash_algos[GIT_HASH_NALGOS] = {\n@@ -379,7 +379,7 @@ static int alt_odb_usable(struct raw_object_store *o,\n \t/* Detect cases where alternate disappeared */\n \tif (!is_directory(path->buf)) {\n \t\terror(\"object directory %s does not exist; \"\n-\t\t      \"check .git/objects/info/alternates.\",\n+\t\t      \"check .git/objects/info/alternates\",\n \t\t      path->buf);\n \t\treturn 0;\n \t}\ndiff --git a/t/t1400-update-ref.sh b/t/t1400-update-ref.sh\nindex e1fd0f0ca8..05e68a6671 100755\n--- a/t/t1400-update-ref.sh\n+++ b/t/t1400-update-ref.sh\n@@ -390,7 +390,7 @@ test_expect_success 'Query \"master@{2005-05-26 23:33:01}\" (middle of history wit\n \ttest_when_finished \"rm -f o e\" &&\n \tgit rev-parse --verify \"master@{2005-05-26 23:33:01}\" >o 2>e &&\n \ttest $B = $(cat o) &&\n-\ttest \"warning: Log for ref $m has gap after $gd.\" = \"$(cat e)\"\n+\ttest \"warning: log for ref $m has gap after $gd\" = \"$(cat e)\"\n '\n test_expect_success 'Query \"master@{2005-05-26 23:38:00}\" (middle of history)' '\n \ttest_when_finished \"rm -f o e\" &&\n@@ -408,7 +408,7 @@ test_expect_success 'Query \"master@{2005-05-28}\" (past end of history)' '\n \ttest_when_finished \"rm -f o e\" &&\n \tgit rev-parse --verify \"master@{2005-05-28}\" >o 2>e &&\n \ttest $D = $(cat o) &&\n-\ttest \"warning: Log for ref $m unexpectedly ended on $ld.\" = \"$(cat e)\"\n+\ttest \"warning: log for ref $m unexpectedly ended on $ld\" = \"$(cat e)\"\n '\n \n rm -f .git/$m .git/logs/$m expect\n@@ -650,7 +650,7 @@ test_expect_success 'stdin fails with duplicate refs' '\n \tcreate $a $m\n \tEOF\n \ttest_must_fail git update-ref --stdin <stdin 2>err &&\n-\tgrep \"fatal: multiple updates for ref '\"'\"'$a'\"'\"' not allowed.\" err\n+\tgrep \"fatal: multiple updates for ref '\"'\"'$a'\"'\"' not allowed\" err\n '\n \n test_expect_success 'stdin create ref works' '\n@@ -1052,7 +1052,7 @@ test_expect_success 'stdin -z fails option with unknown name' '\n test_expect_success 'stdin -z fails with duplicate refs' '\n \tprintf $F \"create $a\" \"$m\" \"create $b\" \"$m\" \"create $a\" \"$m\" >stdin &&\n \ttest_must_fail git update-ref -z --stdin <stdin 2>err &&\n-\tgrep \"fatal: multiple updates for ref '\"'\"'$a'\"'\"' not allowed.\" err\n+\tgrep \"fatal: multiple updates for ref '\"'\"'$a'\"'\"' not allowed\" err\n '\n \n test_expect_success 'stdin -z create ref works' '\ndiff --git a/t/t3005-ls-files-relative.sh b/t/t3005-ls-files-relative.sh\nindex 377869432e..341fad54ce 100755\n--- a/t/t3005-ls-files-relative.sh\n+++ b/t/t3005-ls-files-relative.sh\n@@ -44,7 +44,7 @@ test_expect_success 'ls-files -c' '\n \t\tcd top/sub &&\n \t\tfor f in ../y*\n \t\tdo\n-\t\t\techo \"error: pathspec $sq$f$sq did not match any file(s) known to git.\"\n+\t\t\techo \"error: pathspec $sq$f$sq did not match any file(s) known to git\"\n \t\tdone >expect.err &&\n \t\techo \"Did you forget to ${sq}git add${sq}?\" >>expect.err &&\n \t\tls ../x* >expect.out &&\n@@ -59,7 +59,7 @@ test_expect_success 'ls-files -o' '\n \t\tcd top/sub &&\n \t\tfor f in ../x*\n \t\tdo\n-\t\t\techo \"error: pathspec $sq$f$sq did not match any file(s) known to git.\"\n+\t\t\techo \"error: pathspec $sq$f$sq did not match any file(s) known to git\"\n \t\tdone >expect.err &&\n \t\techo \"Did you forget to ${sq}git add${sq}?\" >>expect.err &&\n \t\tls ../y* >expect.out &&\ndiff --git a/t/t5801-remote-helpers.sh b/t/t5801-remote-helpers.sh\nindex 362b1581e0..88c7f158ef 100755\n--- a/t/t5801-remote-helpers.sh\n+++ b/t/t5801-remote-helpers.sh\n@@ -126,7 +126,7 @@ test_expect_success 'forced push' '\n test_expect_success 'cloning without refspec' '\n \tGIT_REMOTE_TESTGIT_REFSPEC=\"\" \\\n \tgit clone \"testgit::${PWD}/server\" local2 2>error &&\n-\tgrep \"This remote helper should implement refspec capability\" error &&\n+\tgrep \"this remote helper should implement refspec capability\" error &&\n \tcompare_refs local2 HEAD server HEAD\n '\n \n@@ -134,7 +134,7 @@ test_expect_success 'pulling without refspecs' '\n \t(cd local2 &&\n \tgit reset --hard &&\n \tGIT_REMOTE_TESTGIT_REFSPEC=\"\" git pull 2>../error) &&\n-\tgrep \"This remote helper should implement refspec capability\" error &&\n+\tgrep \"this remote helper should implement refspec capability\" error &&\n \tcompare_refs local2 HEAD server HEAD\n '\n \n@@ -246,7 +246,7 @@ test_expect_success 'proper failure checks for fetching' '\n \t(cd local &&\n \ttest_must_fail env GIT_REMOTE_TESTGIT_FAILURE=1 git fetch 2>error &&\n \tcat error &&\n-\tgrep -q \"Error while running fast-import\" error\n+\tgrep -q \"error while running fast-import\" error\n \t)\n '\n \ndiff --git a/t/t7063-status-untracked-cache.sh b/t/t7063-status-untracked-cache.sh\nindex c61e304e97..c9162c54f4 100755\n--- a/t/t7063-status-untracked-cache.sh\n+++ b/t/t7063-status-untracked-cache.sh\n@@ -666,7 +666,7 @@ test_expect_success 'test ident field is working' '\n \tmkdir ../other_worktree &&\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+\techo \"warning: untracked cache is disabled on this system or location\" >../expect &&\n \ttest_i18ncmp ../expect ../err\n '\n \ndiff --git a/transport-helper.c b/transport-helper.c\nindex 1f8ff7e942..9f487cc905 100644\n--- a/transport-helper.c\n+++ b/transport-helper.c\n@@ -48,7 +48,7 @@ static void sendline(struct helper_data *helper, struct strbuf *buffer)\n \tif (debug)\n \t\tfprintf(stderr, \"Debug: Remote helper: -> %s\", buffer->buf);\n \tif (write_in_full(helper->helper->in, buffer->buf, buffer->len) < 0)\n-\t\tdie_errno(\"Full write to remote helper failed\");\n+\t\tdie_errno(\"full write to remote helper failed\");\n }\n \n static int recvline_fh(FILE *helper, struct strbuf *buffer)\n@@ -77,7 +77,7 @@ static void write_constant(int fd, const char *str)\n \tif (debug)\n \t\tfprintf(stderr, \"Debug: Remote helper: -> %s\", str);\n \tif (write_in_full(fd, str, strlen(str)) < 0)\n-\t\tdie_errno(\"Full write to remote helper failed\");\n+\t\tdie_errno(\"full write to remote helper failed\");\n }\n \n static const char *remove_ext_force(const char *url)\n@@ -129,7 +129,7 @@ static struct child_process *get_helper(struct transport *transport)\n \n \tcode = start_command(helper);\n \tif (code < 0 && errno == ENOENT)\n-\t\tdie(\"Unable to find remote helper for '%s'\", data->name);\n+\t\tdie(\"unable to find remote helper for '%s'\", data->name);\n \telse if (code != 0)\n \t\texit(code);\n \n@@ -145,7 +145,7 @@ static struct child_process *get_helper(struct transport *transport)\n \t */\n \tduped = dup(helper->out);\n \tif (duped < 0)\n-\t\tdie_errno(\"Can't dup helper output fd\");\n+\t\tdie_errno(\"can't dup helper output fd\");\n \tdata->out = xfdopen(duped, \"r\");\n \n \twrite_constant(helper->in, \"capabilities\\n\");\n@@ -196,13 +196,13 @@ static struct child_process *get_helper(struct transport *transport)\n \t\t} else if (starts_with(capname, \"no-private-update\")) {\n \t\t\tdata->no_private_update = 1;\n \t\t} else if (mandatory) {\n-\t\t\tdie(\"Unknown mandatory capability %s. This remote \"\n-\t\t\t    \"helper probably needs newer version of Git.\",\n+\t\t\tdie(\"unknown mandatory capability %s; this remote \"\n+\t\t\t    \"helper probably needs newer version of Git\",\n \t\t\t    capname);\n \t\t}\n \t}\n \tif (!data->rs.nr && (data->import || data->bidi_import || data->export)) {\n-\t\twarning(\"This remote helper should implement refspec capability.\");\n+\t\twarning(\"this remote helper should implement refspec capability\");\n \t}\n \tstrbuf_release(&buf);\n \tif (debug)\n@@ -476,7 +476,7 @@ static int fetch_with_import(struct transport *transport,\n \tget_helper(transport);\n \n \tif (get_importer(transport, &fastimport))\n-\t\tdie(\"Couldn't run fast-import\");\n+\t\tdie(\"couldn't run fast-import\");\n \n \tfor (i = 0; i < nr_heads; i++) {\n \t\tposn = to_fetch[i];\n@@ -499,7 +499,7 @@ static int fetch_with_import(struct transport *transport,\n \t */\n \n \tif (finish_command(&fastimport))\n-\t\tdie(\"Error while running fast-import\");\n+\t\tdie(\"error while running fast-import\");\n \n \t/*\n \t * The fast-import stream of a remote helper that advertises\n@@ -528,7 +528,7 @@ static int fetch_with_import(struct transport *transport,\n \t\t\tprivate = xstrdup(name);\n \t\tif (private) {\n \t\t\tif (read_ref(private, &posn->old_oid) < 0)\n-\t\t\t\tdie(\"Could not read ref %s\", private);\n+\t\t\t\tdie(\"could not read ref %s\", private);\n \t\t\tfree(private);\n \t\t}\n \t}\n@@ -554,7 +554,7 @@ static int run_connect(struct transport *transport, struct strbuf *cmdbuf)\n \t */\n \tduped = dup(helper->out);\n \tif (duped < 0)\n-\t\tdie_errno(\"Can't dup helper output fd\");\n+\t\tdie_errno(\"can't dup helper output fd\");\n \tinput = xfdopen(duped, \"r\");\n \tsetvbuf(input, NULL, _IONBF, 0);\n \n@@ -573,7 +573,7 @@ static int run_connect(struct transport *transport, struct strbuf *cmdbuf)\n \t\t\tfprintf(stderr, \"Debug: Falling back to dumb \"\n \t\t\t\t\"transport.\\n\");\n \t} else {\n-\t\tdie(\"Unknown response to connect: %s\",\n+\t\tdie(\"unknown response to connect: %s\",\n \t\t\tcmdbuf->buf);\n \t}\n \n@@ -595,9 +595,9 @@ static int process_connect_service(struct transport *transport,\n \tif (strcmp(name, exec)) {\n \t\tint r = set_helper_option(transport, \"servpath\", exec);\n \t\tif (r > 0)\n-\t\t\twarning(\"Setting remote service path not supported by protocol.\");\n+\t\t\twarning(\"setting remote service path not supported by protocol\");\n \t\telse if (r < 0)\n-\t\t\twarning(\"Invalid remote service path.\");\n+\t\t\twarning(\"invalid remote service path\");\n \t}\n \n \tif (data->connect) {\n@@ -640,10 +640,10 @@ static int connect_helper(struct transport *transport, const char *name,\n \t/* Get_helper so connect is inited. */\n \tget_helper(transport);\n \tif (!data->connect)\n-\t\tdie(\"Operation not supported by protocol.\");\n+\t\tdie(\"operation not supported by protocol\");\n \n \tif (!process_connect_service(transport, name, exec))\n-\t\tdie(\"Can't connect to subservice %s.\", name);\n+\t\tdie(\"can't connect to subservice %s\", name);\n \n \tfd[0] = data->helper->out;\n \tfd[1] = data->helper->in;\n@@ -978,12 +978,12 @@ static int push_refs_with_export(struct transport *transport,\n \t}\n \n \tif (get_exporter(transport, &exporter, &revlist_args))\n-\t\tdie(\"Couldn't run fast-export\");\n+\t\tdie(\"couldn't run fast-export\");\n \n \tstring_list_clear(&revlist_args, 1);\n \n \tif (finish_command(&exporter))\n-\t\tdie(\"Error while running fast-export\");\n+\t\tdie(\"error while running fast-export\");\n \tif (push_update_refs_status(data, remote_refs, flags))\n \t\treturn 1;\n \n@@ -1070,7 +1070,7 @@ static struct ref *get_refs_list(struct transport *transport, int for_push,\n \n \t\teov = strchr(buf.buf, ' ');\n \t\tif (!eov)\n-\t\t\tdie(\"Malformed response in ref list: %s\", buf.buf);\n+\t\t\tdie(\"malformed response in ref list: %s\", buf.buf);\n \t\teon = strchr(eov + 1, ' ');\n \t\t*eov = '\\0';\n \t\tif (eon)\n@@ -1084,7 +1084,7 @@ static struct ref *get_refs_list(struct transport *transport, int for_push,\n \t\t\tif (has_attribute(eon + 1, \"unchanged\")) {\n \t\t\t\t(*tail)->status |= REF_STATUS_UPTODATE;\n \t\t\t\tif (read_ref((*tail)->name, &(*tail)->old_oid) < 0)\n-\t\t\t\t\tdie(_(\"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@@ -1322,11 +1322,11 @@ static int tloop_spawnwait_tasks(struct bidirectional_transfer_state *s)\n \terr = pthread_create(&gtp_thread, NULL, udt_copy_task_routine,\n \t\t&s->gtp);\n \tif (err)\n-\t\tdie(\"Can't start thread for copying data: %s\", strerror(err));\n+\t\tdie(\"can't start thread for copying data: %s\", strerror(err));\n \terr = pthread_create(&ptg_thread, NULL, udt_copy_task_routine,\n \t\t&s->ptg);\n \tif (err)\n-\t\tdie(\"Can't start thread for copying data: %s\", strerror(err));\n+\t\tdie(\"can't start thread for copying data: %s\", strerror(err));\n \n \tret |= tloop_join(gtp_thread, \"Git to program copy\");\n \tret |= tloop_join(ptg_thread, \"Program to git copy\");\n@@ -1385,7 +1385,7 @@ static int tloop_spawnwait_tasks(struct bidirectional_transfer_state *s)\n \t/* Fork thread #1: git to program. */\n \tpid1 = fork();\n \tif (pid1 < 0)\n-\t\tdie_errno(\"Can't start thread for copying data\");\n+\t\tdie_errno(\"can't start thread for copying data\");\n \telse if (pid1 == 0) {\n \t\tudt_kill_transfer(&s->ptg);\n \t\texit(udt_copy_task_routine(&s->gtp) ? 0 : 1);\n@@ -1394,7 +1394,7 @@ static int tloop_spawnwait_tasks(struct bidirectional_transfer_state *s)\n \t/* Fork thread #2: program to git. */\n \tpid2 = fork();\n \tif (pid2 < 0)\n-\t\tdie_errno(\"Can't start thread for copying data\");\n+\t\tdie_errno(\"can't start thread for copying data\");\n \telse if (pid2 == 0) {\n \t\tudt_kill_transfer(&s->gtp);\n \t\texit(udt_copy_task_routine(&s->ptg) ? 0 : 1);\ndiff --git a/transport.c b/transport.c\nindex a32da30dee..2f6a7cb4cd 100644\n--- a/transport.c\n+++ b/transport.c\n@@ -139,7 +139,7 @@ static struct ref *get_refs_from_bundle(struct transport *transport,\n \t\tclose(data->fd);\n \tdata->fd = read_bundle_header(transport->url, &data->header);\n \tif (data->fd < 0)\n-\t\tdie (\"Could not read bundle '%s'.\", transport->url);\n+\t\tdie(\"could not read bundle '%s'.\", transport->url);\n \tfor (i = 0; i < data->header.references.nr; i++) {\n \t\tstruct ref_list_entry *e = data->header.references.list + i;\n \t\tstruct ref *ref = alloc_ref(e->name);\n@@ -875,7 +875,7 @@ struct transport *transport_get(struct remote *remote, const char *url)\n \tret->progress = isatty(2);\n \n \tif (!remote)\n-\t\tdie(\"No remote provided to transport_get()\");\n+\t\tBUG(\"No remote provided to transport_get()\");\n \n \tret->got_remote_refs = 0;\n \tret->remote = remote;\n@@ -1143,7 +1143,7 @@ int transport_push(struct transport *transport,\n \t\t\t\t\t\t      transport->push_options,\n \t\t\t\t\t\t      pretend)) {\n \t\t\t\toid_array_clear(&commits);\n-\t\t\t\tdie(\"Failed to push all needed submodules!\");\n+\t\t\t\tdie(\"failed to push all needed submodules!\");\n \t\t\t}\n \t\t\toid_array_clear(&commits);\n \t\t}\n@@ -1265,7 +1265,7 @@ int transport_connect(struct transport *transport, const char *name,\n \tif (transport->vtable->connect)\n \t\treturn transport->vtable->connect(transport, name, exec, fd);\n \telse\n-\t\tdie(\"Operation not supported by protocol\");\n+\t\tdie(\"operation not supported by protocol\");\n }\n \n int transport_disconnect(struct transport *transport)\n-- \n2.18.0.rc2.476.g39500d3211\n\n"},{"id":"351414","messageId":"20180630090818.28937-4-pclouds@gmail.com","threadId":"48805","inReplyTo":"20180630090818.28937-1-pclouds@gmail.com","subject":"[PATCH 03/23] archive-zip.c: mark more strings for translation","fromName":"Nguyễn Thái Ngọc Duy","fromEmail":"pclouds@gmail.com","sentAt":"2018-06-30T09:07:58Z","receivedAt":"2018-06-30T09:08:44Z","isPatch":true,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>\n---\n archive-zip.c | 14 +++++++-------\n 1 file changed, 7 insertions(+), 7 deletions(-)\n\ndiff --git a/archive-zip.c b/archive-zip.c\nindex 48d843489c..7ad46d8854 100644\n--- a/archive-zip.c\n+++ b/archive-zip.c\n@@ -309,11 +309,11 @@ static int write_zip_entry(struct archiver_args *args,\n \t\tif (is_utf8(path))\n \t\t\tflags |= ZIP_UTF8;\n \t\telse\n-\t\t\twarning(\"path is not valid UTF-8: %s\", path);\n+\t\t\twarning(_(\"path is not valid UTF-8: %s\"), path);\n \t}\n \n \tif (pathlen > 0xffff) {\n-\t\treturn error(\"path too long (%d chars, SHA1: %s): %s\",\n+\t\treturn error(_(\"path too long (%d chars, SHA1: %s): %s\"),\n \t\t\t\t(int)pathlen, oid_to_hex(oid), path);\n \t}\n \n@@ -340,7 +340,7 @@ static int write_zip_entry(struct archiver_args *args,\n \t\t    size > big_file_threshold) {\n \t\t\tstream = open_istream(oid, &type, &size, NULL);\n \t\t\tif (!stream)\n-\t\t\t\treturn error(\"cannot stream blob %s\",\n+\t\t\t\treturn error(_(\"cannot stream blob %s\"),\n \t\t\t\t\t     oid_to_hex(oid));\n \t\t\tflags |= ZIP_STREAM;\n \t\t\tout = buffer = NULL;\n@@ -348,7 +348,7 @@ static int write_zip_entry(struct archiver_args *args,\n \t\t\tbuffer = object_file_to_archive(args, path, oid, mode,\n \t\t\t\t\t\t\t&type, &size);\n \t\t\tif (!buffer)\n-\t\t\t\treturn error(\"cannot read %s\",\n+\t\t\t\treturn error(_(\"cannot read %s\"),\n \t\t\t\t\t     oid_to_hex(oid));\n \t\t\tcrc = crc32(crc, buffer, size);\n \t\t\tis_binary = entry_is_binary(path_without_prefix,\n@@ -357,7 +357,7 @@ static int write_zip_entry(struct archiver_args *args,\n \t\t}\n \t\tcompressed_size = (method == 0) ? size : 0;\n \t} else {\n-\t\treturn error(\"unsupported file mode: 0%o (SHA1: %s)\", mode,\n+\t\treturn error(_(\"unsupported file mode: 0%o (SHA1: %s)\"), mode,\n \t\t\t\toid_to_hex(oid));\n \t}\n \n@@ -466,7 +466,7 @@ static int write_zip_entry(struct archiver_args *args,\n \t\t\tzstream.avail_in = readlen;\n \t\t\tresult = git_deflate(&zstream, 0);\n \t\t\tif (result != Z_OK)\n-\t\t\t\tdie(\"deflate error (%d)\", result);\n+\t\t\t\tdie(_(\"deflate error (%d)\"), result);\n \t\t\tout_len = zstream.next_out - compressed;\n \n \t\t\tif (out_len > 0) {\n@@ -601,7 +601,7 @@ static void dos_time(timestamp_t *timestamp, int *dos_date, int *dos_time)\n \tstruct tm *t;\n \n \tif (date_overflows(*timestamp))\n-\t\tdie(\"timestamp too large for this system: %\"PRItime,\n+\t\tdie(_(\"timestamp too large for this system: %\"PRItime),\n \t\t    *timestamp);\n \ttime = (time_t)*timestamp;\n \tt = localtime(&time);\n-- \n2.18.0.rc2.476.g39500d3211\n\n"},{"id":"351415","messageId":"20180630090818.28937-3-pclouds@gmail.com","threadId":"48805","inReplyTo":"20180630090818.28937-1-pclouds@gmail.com","subject":"[PATCH 02/23] archive-tar.c: mark more strings for translation","fromName":"Nguyễn Thái Ngọc Duy","fromEmail":"pclouds@gmail.com","sentAt":"2018-06-30T09:07:57Z","receivedAt":"2018-06-30T09:08:45Z","isPatch":true,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>\n---\n archive-tar.c | 12 ++++++------\n 1 file changed, 6 insertions(+), 6 deletions(-)\n\ndiff --git a/archive-tar.c b/archive-tar.c\nindex b6f58ddf38..68e72d9176 100644\n--- a/archive-tar.c\n+++ b/archive-tar.c\n@@ -121,7 +121,7 @@ static int stream_blocked(const struct object_id *oid)\n \n \tst = open_istream(oid, &type, &sz, NULL);\n \tif (!st)\n-\t\treturn error(\"cannot stream blob %s\", oid_to_hex(oid));\n+\t\treturn error(_(\"cannot stream blob %s\"), oid_to_hex(oid));\n \tfor (;;) {\n \t\treadlen = read_istream(st, buf, sizeof(buf));\n \t\tif (readlen <= 0)\n@@ -256,7 +256,7 @@ static int write_tar_entry(struct archiver_args *args,\n \t\t*header.typeflag = TYPEFLAG_REG;\n \t\tmode = (mode | ((mode & 0100) ? 0777 : 0666)) & ~tar_umask;\n \t} else {\n-\t\treturn error(\"unsupported file mode: 0%o (SHA1: %s)\",\n+\t\treturn error(_(\"unsupported file mode: 0%o (SHA1: %s)\"),\n \t\t\t     mode, oid_to_hex(oid));\n \t}\n \tif (pathlen > sizeof(header.name)) {\n@@ -283,7 +283,7 @@ static int write_tar_entry(struct archiver_args *args,\n \t\tenum object_type type;\n \t\tbuffer = object_file_to_archive(args, path, oid, old_mode, &type, &size);\n \t\tif (!buffer)\n-\t\t\treturn error(\"cannot read %s\", oid_to_hex(oid));\n+\t\t\treturn error(_(\"cannot read %s\"), oid_to_hex(oid));\n \t} else {\n \t\tbuffer = NULL;\n \t\tsize = 0;\n@@ -454,17 +454,17 @@ static int write_tar_filter_archive(const struct archiver *ar,\n \tfilter.in = -1;\n \n \tif (start_command(&filter) < 0)\n-\t\tdie_errno(\"unable to start '%s' filter\", argv[0]);\n+\t\tdie_errno(_(\"unable to start '%s' filter\"), argv[0]);\n \tclose(1);\n \tif (dup2(filter.in, 1) < 0)\n-\t\tdie_errno(\"unable to redirect descriptor\");\n+\t\tdie_errno(_(\"unable to redirect descriptor\"));\n \tclose(filter.in);\n \n \tr = write_tar_archive(ar, args);\n \n \tclose(1);\n \tif (finish_command(&filter) != 0)\n-\t\tdie(\"'%s' filter reported error\", argv[0]);\n+\t\tdie(_(\"'%s' filter reported error\"), argv[0]);\n \n \tstrbuf_release(&cmd);\n \treturn r;\n-- \n2.18.0.rc2.476.g39500d3211\n\n"},{"id":"351416","messageId":"20180630090818.28937-5-pclouds@gmail.com","threadId":"48805","inReplyTo":"20180630090818.28937-1-pclouds@gmail.com","subject":"[PATCH 04/23] builtin/config.c: mark more strings for translation","fromName":"Nguyễn Thái Ngọc Duy","fromEmail":"pclouds@gmail.com","sentAt":"2018-06-30T09:07:59Z","receivedAt":"2018-06-30T09:08:51Z","isPatch":true,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>\n---\n builtin/config.c      | 48 +++++++++++++++++++++----------------------\n t/t1308-config-set.sh |  2 +-\n 2 files changed, 25 insertions(+), 25 deletions(-)\n\ndiff --git a/builtin/config.c b/builtin/config.c\nindex ebeb4c5638..3c26df6c48 100644\n--- a/builtin/config.c\n+++ b/builtin/config.c\n@@ -110,7 +110,7 @@ static int option_parse_type(const struct option *opt, const char *arg,\n \t\t * --int' and '--type=bool\n \t\t * --type=int'.\n \t\t */\n-\t\terror(\"only one type at a time\");\n+\t\terror(_(\"only one type at a time\"));\n \t\tusage_with_options(builtin_config_usage,\n \t\t\tbuiltin_config_options);\n \t}\n@@ -161,9 +161,9 @@ static void check_argc(int argc, int min, int max) {\n \tif (argc >= min && argc <= max)\n \t\treturn;\n \tif (min == max)\n-\t\terror(\"wrong number of arguments, should be %d\", min);\n+\t\terror(_(\"wrong number of arguments, should be %d\"), min);\n \telse\n-\t\terror(\"wrong number of arguments, should be from %d to %d\",\n+\t\terror(_(\"wrong number of arguments, should be from %d to %d\"),\n \t\t      min, max);\n \tusage_with_options(builtin_config_usage, builtin_config_options);\n }\n@@ -297,7 +297,7 @@ static int get_value(const char *key_, const char *regex_)\n \n \t\tkey_regexp = (regex_t*)xmalloc(sizeof(regex_t));\n \t\tif (regcomp(key_regexp, key, REG_EXTENDED)) {\n-\t\t\terror(\"invalid key pattern: %s\", key_);\n+\t\t\terror(_(\"invalid key pattern: %s\"), key_);\n \t\t\tFREE_AND_NULL(key_regexp);\n \t\t\tret = CONFIG_INVALID_PATTERN;\n \t\t\tgoto free_strings;\n@@ -317,7 +317,7 @@ static int get_value(const char *key_, const char *regex_)\n \n \t\tregexp = (regex_t*)xmalloc(sizeof(regex_t));\n \t\tif (regcomp(regexp, regex_, REG_EXTENDED)) {\n-\t\t\terror(\"invalid pattern: %s\", regex_);\n+\t\t\terror(_(\"invalid pattern: %s\"), regex_);\n \t\t\tFREE_AND_NULL(regexp);\n \t\t\tret = CONFIG_INVALID_PATTERN;\n \t\t\tgoto free_strings;\n@@ -390,7 +390,7 @@ static char *normalize_value(const char *key, const char *value)\n \tif (type == TYPE_COLOR) {\n \t\tchar v[COLOR_MAXLEN];\n \t\tif (git_config_color(v, key, value))\n-\t\t\tdie(\"cannot parse color '%s'\", value);\n+\t\t\tdie(_(\"cannot parse color '%s'\"), value);\n \n \t\t/*\n \t\t * The contents of `v` now contain an ANSI escape\n@@ -485,13 +485,13 @@ static int get_colorbool(const char *var, int print)\n static void check_write(void)\n {\n \tif (!given_config_source.file && !startup_info->have_repository)\n-\t\tdie(\"not in a git directory\");\n+\t\tdie(_(\"not in a git directory\"));\n \n \tif (given_config_source.use_stdin)\n-\t\tdie(\"writing to stdin is not supported\");\n+\t\tdie(_(\"writing to stdin is not supported\"));\n \n \tif (given_config_source.blob)\n-\t\tdie(\"writing config blobs is not supported\");\n+\t\tdie(_(\"writing config blobs is not supported\"));\n }\n \n struct urlmatch_current_candidate_value {\n@@ -599,7 +599,7 @@ int cmd_config(int argc, const char **argv, const char *prefix)\n \n \tif (use_global_config + use_system_config + use_local_config +\n \t    !!given_config_source.file + !!given_config_source.blob > 1) {\n-\t\terror(\"only one config file at a time\");\n+\t\terror(_(\"only one config file at a time\"));\n \t\tusage_with_options(builtin_config_usage, builtin_config_options);\n \t}\n \n@@ -626,7 +626,7 @@ int cmd_config(int argc, const char **argv, const char *prefix)\n \t\t\t * location; error out even if XDG_CONFIG_HOME\n \t\t\t * is set and points at a sane location.\n \t\t\t */\n-\t\t\tdie(\"$HOME is not set\");\n+\t\t\tdie(_(\"$HOME is not set\"));\n \n \t\tif (access_or_warn(user_config, R_OK, 0) &&\n \t\t    xdg_config && !access_or_warn(xdg_config, R_OK, 0)) {\n@@ -663,12 +663,12 @@ int cmd_config(int argc, const char **argv, const char *prefix)\n \t}\n \n \tif ((actions & (ACTION_GET_COLOR|ACTION_GET_COLORBOOL)) && type) {\n-\t\terror(\"--get-color and variable type are incoherent\");\n+\t\terror(_(\"--get-color and variable type are incoherent\"));\n \t\tusage_with_options(builtin_config_usage, builtin_config_options);\n \t}\n \n \tif (HAS_MULTI_BITS(actions)) {\n-\t\terror(\"only one action at a time\");\n+\t\terror(_(\"only one action at a time\"));\n \t\tusage_with_options(builtin_config_usage, builtin_config_options);\n \t}\n \tif (actions == 0)\n@@ -681,19 +681,19 @@ int cmd_config(int argc, const char **argv, const char *prefix)\n \t\t}\n \tif (omit_values &&\n \t    !(actions == ACTION_LIST || actions == ACTION_GET_REGEXP)) {\n-\t\terror(\"--name-only is only applicable to --list or --get-regexp\");\n+\t\terror(_(\"--name-only is only applicable to --list or --get-regexp\"));\n \t\tusage_with_options(builtin_config_usage, builtin_config_options);\n \t}\n \n \tif (show_origin && !(actions &\n \t\t(ACTION_GET|ACTION_GET_ALL|ACTION_GET_REGEXP|ACTION_LIST))) {\n-\t\terror(\"--show-origin is only applicable to --get, --get-all, \"\n-\t\t\t  \"--get-regexp, and --list.\");\n+\t\terror(_(\"--show-origin is only applicable to --get, --get-all, \"\n+\t\t\t\"--get-regexp, and --list\"));\n \t\tusage_with_options(builtin_config_usage, builtin_config_options);\n \t}\n \n \tif (default_value && !(actions & ACTION_GET)) {\n-\t\terror(\"--default is only applicable to --get\");\n+\t\terror(_(\"--default is only applicable to --get\"));\n \t\tusage_with_options(builtin_config_usage,\n \t\t\tbuiltin_config_options);\n \t}\n@@ -707,10 +707,10 @@ int cmd_config(int argc, const char **argv, const char *prefix)\n \t\t\t\t\t&given_config_source,\n \t\t\t\t\t&config_options) < 0) {\n \t\t\tif (given_config_source.file)\n-\t\t\t\tdie_errno(\"unable to read config file '%s'\",\n+\t\t\t\tdie_errno(_(\"unable to read config file '%s'\"),\n \t\t\t\t\t  given_config_source.file);\n \t\t\telse\n-\t\t\t\tdie(\"error processing config file(s)\");\n+\t\t\t\tdie(_(\"error processing config file(s)\"));\n \t\t}\n \t}\n \telse if (actions == ACTION_EDIT) {\n@@ -718,11 +718,11 @@ int cmd_config(int argc, const char **argv, const char *prefix)\n \n \t\tcheck_argc(argc, 0, 0);\n \t\tif (!given_config_source.file && nongit)\n-\t\t\tdie(\"not in a git directory\");\n+\t\t\tdie(_(\"not in a git directory\"));\n \t\tif (given_config_source.use_stdin)\n-\t\t\tdie(\"editing stdin is not supported\");\n+\t\t\tdie(_(\"editing stdin is not supported\"));\n \t\tif (given_config_source.blob)\n-\t\t\tdie(\"editing blobs is not supported\");\n+\t\t\tdie(_(\"editing blobs is not supported\"));\n \t\tgit_config(git_default_config, NULL);\n \t\tconfig_file = given_config_source.file ?\n \t\t\t\txstrdup(given_config_source.file) :\n@@ -823,7 +823,7 @@ int cmd_config(int argc, const char **argv, const char *prefix)\n \t\tif (ret < 0)\n \t\t\treturn ret;\n \t\tif (ret == 0)\n-\t\t\tdie(\"no such section: %s\", argv[0]);\n+\t\t\tdie(_(\"no such section: %s\"), argv[0]);\n \t}\n \telse if (actions == ACTION_REMOVE_SECTION) {\n \t\tint ret;\n@@ -834,7 +834,7 @@ int cmd_config(int argc, const char **argv, const char *prefix)\n \t\tif (ret < 0)\n \t\t\treturn ret;\n \t\tif (ret == 0)\n-\t\t\tdie(\"no such section: %s\", argv[0]);\n+\t\t\tdie(_(\"no such section: %s\"), argv[0]);\n \t}\n \telse if (actions == ACTION_GET_COLOR) {\n \t\tcheck_argc(argc, 1, 2);\ndiff --git a/t/t1308-config-set.sh b/t/t1308-config-set.sh\nindex 3e00d1af01..d0a2727b85 100755\n--- a/t/t1308-config-set.sh\n+++ b/t/t1308-config-set.sh\n@@ -233,7 +233,7 @@ test_expect_success 'check line errors for malformed values' '\n \n test_expect_success 'error on modifying repo config without repo' '\n \tnongit test_must_fail git config a.b c 2>err &&\n-\tgrep \"not in a git directory\" err\n+\ttest_i18ngrep \"not in a git directory\" err\n '\n \n cmdline_config=\"'foo.bar=from-cmdline'\"\n-- \n2.18.0.rc2.476.g39500d3211\n\n"},{"id":"351417","messageId":"20180630090818.28937-6-pclouds@gmail.com","threadId":"48805","inReplyTo":"20180630090818.28937-1-pclouds@gmail.com","subject":"[PATCH 05/23] builtin/grep.c: mark strings for translation and no full stops","fromName":"Nguyễn Thái Ngọc Duy","fromEmail":"pclouds@gmail.com","sentAt":"2018-06-30T09:08:00Z","receivedAt":"2018-06-30T09:08:56Z","isPatch":true,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>\n---\n builtin/grep.c | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/builtin/grep.c b/builtin/grep.c\nindex 9774920999..58f941e951 100644\n--- a/builtin/grep.c\n+++ b/builtin/grep.c\n@@ -489,7 +489,7 @@ static int grep_cache(struct grep_opt *opt, struct repository *repo,\n \t}\n \n \tif (repo_read_index(repo) < 0)\n-\t\tdie(\"index file corrupt\");\n+\t\tdie(_(\"index file corrupt\"));\n \n \tfor (nr = 0; nr < repo->index->cache_nr; nr++) {\n \t\tconst struct cache_entry *ce = repo->index->cache[nr];\n-- \n2.18.0.rc2.476.g39500d3211\n\n"},{"id":"351418","messageId":"20180630090818.28937-7-pclouds@gmail.com","threadId":"48805","inReplyTo":"20180630090818.28937-1-pclouds@gmail.com","subject":"[PATCH 06/23] builtin/pack-objects.c: mark more strings for translation","fromName":"Nguyễn Thái Ngọc Duy","fromEmail":"pclouds@gmail.com","sentAt":"2018-06-30T09:08:01Z","receivedAt":"2018-06-30T09:08:57Z","isPatch":true,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"Most of these are straight forward. GETTEXT_POISON does catch the last\nstring in cmd_pack_objects(), but since this is --progress output, it's\nnot supposed to be machine-readable.\n\nSigned-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>\n---\n builtin/pack-objects.c | 108 +++++++++++++++++++++--------------------\n t/t5500-fetch-pack.sh  |   2 +-\n 2 files changed, 56 insertions(+), 54 deletions(-)\n\ndiff --git a/builtin/pack-objects.c b/builtin/pack-objects.c\nindex 1a6ece425d..5c697279a9 100644\n--- a/builtin/pack-objects.c\n+++ b/builtin/pack-objects.c\n@@ -140,7 +140,7 @@ static void *get_delta(struct object_entry *entry)\n \n \tbuf = read_object_file(&entry->idx.oid, &type, &size);\n \tif (!buf)\n-\t\tdie(\"unable to read %s\", oid_to_hex(&entry->idx.oid));\n+\t\tdie(_(\"unable to read %s\"), oid_to_hex(&entry->idx.oid));\n \tbase_buf = read_object_file(&DELTA(entry)->idx.oid, &type,\n \t\t\t\t    &base_size);\n \tif (!base_buf)\n@@ -149,7 +149,7 @@ static void *get_delta(struct object_entry *entry)\n \tdelta_buf = diff_delta(base_buf, base_size,\n \t\t\t       buf, size, &delta_size, 0);\n \tif (!delta_buf || delta_size != DELTA_SIZE(entry))\n-\t\tdie(\"delta size changed\");\n+\t\tdie(_(\"delta size changed\"));\n \tfree(buf);\n \tfree(base_buf);\n \treturn delta_buf;\n@@ -406,7 +406,7 @@ static off_t write_reuse_object(struct hashfile *f, struct object_entry *entry,\n \tdatalen = revidx[1].offset - offset;\n \tif (!pack_to_stdout && p->index_version > 1 &&\n \t    check_pack_crc(p, &w_curs, offset, datalen, revidx->nr)) {\n-\t\terror(\"bad packed object CRC for %s\",\n+\t\terror(_(\"bad packed object CRC for %s\"),\n \t\t      oid_to_hex(&entry->idx.oid));\n \t\tunuse_pack(&w_curs);\n \t\treturn write_no_reuse_object(f, entry, limit, usable_delta);\n@@ -417,7 +417,7 @@ static off_t write_reuse_object(struct hashfile *f, struct object_entry *entry,\n \n \tif (!pack_to_stdout && p->index_version == 1 &&\n \t    check_pack_inflate(p, &w_curs, offset, datalen, entry_size)) {\n-\t\terror(\"corrupt packed object for %s\",\n+\t\terror(_(\"corrupt packed object for %s\"),\n \t\t      oid_to_hex(&entry->idx.oid));\n \t\tunuse_pack(&w_curs);\n \t\treturn write_no_reuse_object(f, entry, limit, usable_delta);\n@@ -548,7 +548,7 @@ static enum write_one_status write_one(struct hashfile *f,\n \t */\n \trecursing = (e->idx.offset == 1);\n \tif (recursing) {\n-\t\twarning(\"recursive delta detected for object %s\",\n+\t\twarning(_(\"recursive delta detected for object %s\"),\n \t\t\toid_to_hex(&e->idx.oid));\n \t\treturn WRITE_ONE_RECURSIVE;\n \t} else if (e->idx.offset || e->preferred_base) {\n@@ -582,7 +582,7 @@ static enum write_one_status write_one(struct hashfile *f,\n \n \t/* make sure off_t is sufficiently large not to wrap */\n \tif (signed_add_overflows(*offset, size))\n-\t\tdie(\"pack too large for current definition of off_t\");\n+\t\tdie(_(\"pack too large for current definition of off_t\"));\n \t*offset += size;\n \treturn WRITE_ONE_WRITTEN;\n }\n@@ -748,7 +748,8 @@ static struct object_entry **compute_write_order(void)\n \t}\n \n \tif (wo_end != to_pack.nr_objects)\n-\t\tdie(\"ordered %u objects, expected %\"PRIu32, wo_end, to_pack.nr_objects);\n+\t\tdie(_(\"ordered %u objects, expected %\"PRIu32),\n+\t\t    wo_end, to_pack.nr_objects);\n \n \treturn wo;\n }\n@@ -760,15 +761,15 @@ static off_t write_reused_pack(struct hashfile *f)\n \tint fd;\n \n \tif (!is_pack_valid(reuse_packfile))\n-\t\tdie(\"packfile is invalid: %s\", reuse_packfile->pack_name);\n+\t\tdie(_(\"packfile is invalid: %s\"), reuse_packfile->pack_name);\n \n \tfd = git_open(reuse_packfile->pack_name);\n \tif (fd < 0)\n-\t\tdie_errno(\"unable to open packfile for reuse: %s\",\n+\t\tdie_errno(_(\"unable to open packfile for reuse: %s\"),\n \t\t\t  reuse_packfile->pack_name);\n \n \tif (lseek(fd, sizeof(struct pack_header), SEEK_SET) == -1)\n-\t\tdie_errno(\"unable to seek in reused packfile\");\n+\t\tdie_errno(_(\"unable to seek in reused packfile\"));\n \n \tif (reuse_packfile_offset < 0)\n \t\treuse_packfile_offset = reuse_packfile->pack_size - the_hash_algo->rawsz;\n@@ -779,7 +780,7 @@ static off_t write_reused_pack(struct hashfile *f)\n \t\tint read_pack = xread(fd, buffer, sizeof(buffer));\n \n \t\tif (read_pack <= 0)\n-\t\t\tdie_errno(\"unable to read from reused packfile\");\n+\t\t\tdie_errno(_(\"unable to read from reused packfile\"));\n \n \t\tif (read_pack > to_write)\n \t\t\tread_pack = to_write;\n@@ -882,7 +883,7 @@ static void write_pack_file(void)\n \t\t\t * to preserve this property.\n \t\t\t */\n \t\t\tif (stat(pack_tmp_name, &st) < 0) {\n-\t\t\t\twarning_errno(\"failed to stat %s\", pack_tmp_name);\n+\t\t\t\twarning_errno(_(\"failed to stat %s\"), pack_tmp_name);\n \t\t\t} else if (!last_mtime) {\n \t\t\t\tlast_mtime = st.st_mtime;\n \t\t\t} else {\n@@ -890,7 +891,7 @@ static void write_pack_file(void)\n \t\t\t\tutb.actime = st.st_atime;\n \t\t\t\tutb.modtime = --last_mtime;\n \t\t\t\tif (utime(pack_tmp_name, &utb) < 0)\n-\t\t\t\t\twarning_errno(\"failed utime() on %s\", pack_tmp_name);\n+\t\t\t\t\twarning_errno(_(\"failed utime() on %s\"), pack_tmp_name);\n \t\t\t}\n \n \t\t\tstrbuf_addf(&tmpname, \"%s-\", base_name);\n@@ -935,8 +936,8 @@ static void write_pack_file(void)\n \tfree(write_order);\n \tstop_progress(&progress_state);\n \tif (written != nr_result)\n-\t\tdie(\"wrote %\"PRIu32\" objects while expecting %\"PRIu32,\n-\t\t\twritten, nr_result);\n+\t\tdie(_(\"wrote %\"PRIu32\" objects while expecting %\"PRIu32),\n+\t\t    written, nr_result);\n }\n \n static int no_try_delta(const char *path)\n@@ -1480,7 +1481,7 @@ static void check_object(struct object_entry *entry)\n \t\t\twhile (c & 128) {\n \t\t\t\tofs += 1;\n \t\t\t\tif (!ofs || MSB(ofs, 7)) {\n-\t\t\t\t\terror(\"delta base offset overflow in pack for %s\",\n+\t\t\t\t\terror(_(\"delta base offset overflow in pack for %s\"),\n \t\t\t\t\t      oid_to_hex(&entry->idx.oid));\n \t\t\t\t\tgoto give_up;\n \t\t\t\t}\n@@ -1489,7 +1490,7 @@ static void check_object(struct object_entry *entry)\n \t\t\t}\n \t\t\tofs = entry->in_pack_offset - ofs;\n \t\t\tif (ofs <= 0 || ofs >= entry->in_pack_offset) {\n-\t\t\t\terror(\"delta base offset out of bound for %s\",\n+\t\t\t\terror(_(\"delta base offset out of bound for %s\"),\n \t\t\t\t      oid_to_hex(&entry->idx.oid));\n \t\t\t\tgoto give_up;\n \t\t\t}\n@@ -1974,10 +1975,10 @@ static int try_delta(struct unpacked *trg, struct unpacked *src,\n \t\ttrg->data = read_object_file(&trg_entry->idx.oid, &type, &sz);\n \t\tread_unlock();\n \t\tif (!trg->data)\n-\t\t\tdie(\"object %s cannot be read\",\n+\t\t\tdie(_(\"object %s cannot be read\"),\n \t\t\t    oid_to_hex(&trg_entry->idx.oid));\n \t\tif (sz != trg_size)\n-\t\t\tdie(\"object %s inconsistent object length (%lu vs %lu)\",\n+\t\t\tdie(_(\"object %s inconsistent object length (%lu vs %lu)\"),\n \t\t\t    oid_to_hex(&trg_entry->idx.oid), sz,\n \t\t\t    trg_size);\n \t\t*mem_usage += sz;\n@@ -1990,7 +1991,7 @@ static int try_delta(struct unpacked *trg, struct unpacked *src,\n \t\t\tif (src_entry->preferred_base) {\n \t\t\t\tstatic int warned = 0;\n \t\t\t\tif (!warned++)\n-\t\t\t\t\twarning(\"object %s cannot be read\",\n+\t\t\t\t\twarning(_(\"object %s cannot be read\"),\n \t\t\t\t\t\toid_to_hex(&src_entry->idx.oid));\n \t\t\t\t/*\n \t\t\t\t * Those objects are not included in the\n@@ -2000,11 +2001,11 @@ static int try_delta(struct unpacked *trg, struct unpacked *src,\n \t\t\t\t */\n \t\t\t\treturn 0;\n \t\t\t}\n-\t\t\tdie(\"object %s cannot be read\",\n+\t\t\tdie(_(\"object %s cannot be read\"),\n \t\t\t    oid_to_hex(&src_entry->idx.oid));\n \t\t}\n \t\tif (sz != src_size)\n-\t\t\tdie(\"object %s inconsistent object length (%lu vs %lu)\",\n+\t\t\tdie(_(\"object %s inconsistent object length (%lu vs %lu)\"),\n \t\t\t    oid_to_hex(&src_entry->idx.oid), sz,\n \t\t\t    src_size);\n \t\t*mem_usage += sz;\n@@ -2014,7 +2015,7 @@ static int try_delta(struct unpacked *trg, struct unpacked *src,\n \t\tif (!src->index) {\n \t\t\tstatic int warned = 0;\n \t\t\tif (!warned++)\n-\t\t\t\twarning(\"suboptimal pack - out of memory\");\n+\t\t\t\twarning(_(\"suboptimal pack - out of memory\"));\n \t\t\treturn 0;\n \t\t}\n \t\t*mem_usage += sizeof_delta_index(src->index);\n@@ -2341,8 +2342,8 @@ static void ll_find_deltas(struct object_entry **list, unsigned list_size,\n \t\treturn;\n \t}\n \tif (progress > pack_to_stdout)\n-\t\tfprintf_ln(stderr, \"Delta compression using up to %d threads.\",\n-\t\t\t\tdelta_search_threads);\n+\t\tfprintf_ln(stderr, _(\"Delta compression using up to %d threads\"),\n+\t\t\t   delta_search_threads);\n \tp = xcalloc(delta_search_threads, sizeof(*p));\n \n \t/* Partition the work amongst work threads. */\n@@ -2382,7 +2383,7 @@ static void ll_find_deltas(struct object_entry **list, unsigned list_size,\n \t\tret = pthread_create(&p[i].thread, NULL,\n \t\t\t\t     threaded_find_deltas, &p[i]);\n \t\tif (ret)\n-\t\t\tdie(\"unable to create thread: %s\", strerror(ret));\n+\t\t\tdie(_(\"unable to create thread: %s\"), strerror(ret));\n \t\tactive_threads++;\n \t}\n \n@@ -2477,7 +2478,7 @@ static void add_tag_chain(const struct object_id *oid)\n \ttag = lookup_tag(oid);\n \twhile (1) {\n \t\tif (!tag || parse_tag(tag) || !tag->tagged)\n-\t\t\tdie(\"unable to pack objects reachable from tag %s\",\n+\t\t\tdie(_(\"unable to pack objects reachable from tag %s\"),\n \t\t\t    oid_to_hex(oid));\n \n \t\tadd_object_entry(&tag->object.oid, OBJ_TAG, NULL, 0);\n@@ -2543,7 +2544,7 @@ static void prepare_pack(int window, int depth)\n \t\tif (!entry->preferred_base) {\n \t\t\tnr_deltas++;\n \t\t\tif (oe_type(entry) < 0)\n-\t\t\t\tdie(\"unable to get type of object %s\",\n+\t\t\t\tdie(_(\"unable to get type of object %s\"),\n \t\t\t\t    oid_to_hex(&entry->idx.oid));\n \t\t} else {\n \t\t\tif (oe_type(entry) < 0) {\n@@ -2567,7 +2568,7 @@ static void prepare_pack(int window, int depth)\n \t\tll_find_deltas(delta_list, n, window+1, depth, &nr_done);\n \t\tstop_progress(&progress_state);\n \t\tif (nr_done != nr_deltas)\n-\t\t\tdie(\"inconsistency with delta count\");\n+\t\t\tdie(_(\"inconsistency with delta count\"));\n \t}\n \tfree(delta_list);\n }\n@@ -2607,11 +2608,11 @@ static int git_pack_config(const char *k, const char *v, void *cb)\n \tif (!strcmp(k, \"pack.threads\")) {\n \t\tdelta_search_threads = git_config_int(k, v);\n \t\tif (delta_search_threads < 0)\n-\t\t\tdie(\"invalid number of threads specified (%d)\",\n+\t\t\tdie(_(\"invalid number of threads specified (%d)\"),\n \t\t\t    delta_search_threads);\n #ifdef NO_PTHREADS\n \t\tif (delta_search_threads != 1) {\n-\t\t\twarning(\"no threads support, ignoring %s\", k);\n+\t\t\twarning(_(\"no threads support, ignoring %s\"), k);\n \t\t\tdelta_search_threads = 0;\n \t\t}\n #endif\n@@ -2620,7 +2621,7 @@ static int git_pack_config(const char *k, const char *v, void *cb)\n \tif (!strcmp(k, \"pack.indexversion\")) {\n \t\tpack_idx_opts.version = git_config_int(k, v);\n \t\tif (pack_idx_opts.version > 2)\n-\t\t\tdie(\"bad pack.indexversion=%\"PRIu32,\n+\t\t\tdie(_(\"bad pack.indexversion=%\"PRIu32),\n \t\t\t    pack_idx_opts.version);\n \t\treturn 0;\n \t}\n@@ -2646,13 +2647,13 @@ static void read_object_list_from_stdin(void)\n \t\t}\n \t\tif (line[0] == '-') {\n \t\t\tif (get_oid_hex(line+1, &oid))\n-\t\t\t\tdie(\"expected edge object ID, got garbage:\\n %s\",\n+\t\t\t\tdie(_(\"expected edge object ID, got garbage:\\n %s\"),\n \t\t\t\t    line);\n \t\t\tadd_preferred_base(&oid);\n \t\t\tcontinue;\n \t\t}\n \t\tif (parse_oid_hex(line, &oid, &p))\n-\t\t\tdie(\"expected object ID, got garbage:\\n %s\", line);\n+\t\t\tdie(_(\"expected object ID, got garbage:\\n %s\"), line);\n \n \t\tadd_preferred_base_object(p + 1);\n \t\tadd_object_entry(&oid, OBJ_NONE, p + 1, 0);\n@@ -2791,7 +2792,7 @@ static void add_objects_in_unpacked_packs(struct rev_info *revs)\n \t\tif (!p->pack_local || p->pack_keep || p->pack_keep_in_core)\n \t\t\tcontinue;\n \t\tif (open_pack_index(p))\n-\t\t\tdie(\"cannot open pack index\");\n+\t\t\tdie(_(\"cannot open pack index\"));\n \n \t\tALLOC_GROW(in_pack.array,\n \t\t\t   in_pack.nr + p->num_objects,\n@@ -2822,7 +2823,7 @@ static int add_loose_object(const struct object_id *oid, const char *path,\n \tenum object_type type = oid_object_info(the_repository, oid, NULL);\n \n \tif (type < 0) {\n-\t\twarning(\"loose object at %s could not be examined\", path);\n+\t\twarning(_(\"loose object at %s could not be examined\"), path);\n \t\treturn 0;\n \t}\n \n@@ -2899,7 +2900,7 @@ static void loosen_unused_packed_objects(struct rev_info *revs)\n \t\t\tcontinue;\n \n \t\tif (open_pack_index(p))\n-\t\t\tdie(\"cannot open pack index\");\n+\t\t\tdie(_(\"cannot open pack index\"));\n \n \t\tfor (i = 0; i < p->num_objects; i++) {\n \t\t\tnth_packed_object_oid(&oid, p, i);\n@@ -2907,7 +2908,7 @@ static void loosen_unused_packed_objects(struct rev_info *revs)\n \t\t\t    !has_sha1_pack_kept_or_nonlocal(&oid) &&\n \t\t\t    !loosened_object_can_be_discarded(&oid, p->mtime))\n \t\t\t\tif (force_object_loose(&oid, p->mtime))\n-\t\t\t\t\tdie(\"unable to force loose object\");\n+\t\t\t\t\tdie(_(\"unable to force loose object\"));\n \t\t}\n \t}\n }\n@@ -2991,17 +2992,17 @@ static void get_object_list(int ac, const char **av)\n \t\t\t\tuse_bitmap_index = 0;\n \t\t\t\tcontinue;\n \t\t\t}\n-\t\t\tdie(\"not a rev '%s'\", line);\n+\t\t\tdie(_(\"not a rev '%s'\"), line);\n \t\t}\n \t\tif (handle_revision_arg(line, &revs, flags, REVARG_CANNOT_BE_FILENAME))\n-\t\t\tdie(\"bad revision '%s'\", line);\n+\t\t\tdie(_(\"bad revision '%s'\"), line);\n \t}\n \n \tif (use_bitmap_index && !get_object_list_from_bitmap(&revs))\n \t\treturn;\n \n \tif (prepare_revision_walk(&revs))\n-\t\tdie(\"revision walk setup failed\");\n+\t\tdie(_(\"revision walk setup failed\"));\n \tmark_edges_uninteresting(&revs, show_edge);\n \n \tif (!fn_show_object)\n@@ -3014,9 +3015,9 @@ static void get_object_list(int ac, const char **av)\n \t\trevs.ignore_missing_links = 1;\n \t\tif (add_unseen_recent_objects_to_traversal(&revs,\n \t\t\t\tunpack_unreachable_expiration))\n-\t\t\tdie(\"unable to add recent objects\");\n+\t\t\tdie(_(\"unable to add recent objects\"));\n \t\tif (prepare_revision_walk(&revs))\n-\t\t\tdie(\"revision walk setup failed\");\n+\t\t\tdie(_(\"revision walk setup failed\"));\n \t\ttraverse_commit_list(&revs, record_recent_commit,\n \t\t\t\t     record_recent_object, NULL);\n \t}\n@@ -3251,35 +3252,35 @@ int cmd_pack_objects(int argc, const char **argv, const char *prefix)\n \tif (pack_compression_level == -1)\n \t\tpack_compression_level = Z_DEFAULT_COMPRESSION;\n \telse if (pack_compression_level < 0 || pack_compression_level > Z_BEST_COMPRESSION)\n-\t\tdie(\"bad pack compression level %d\", pack_compression_level);\n+\t\tdie(_(\"bad pack compression level %d\"), pack_compression_level);\n \n \tif (!delta_search_threads)\t/* --threads=0 means autodetect */\n \t\tdelta_search_threads = online_cpus();\n \n #ifdef NO_PTHREADS\n \tif (delta_search_threads != 1)\n-\t\twarning(\"no threads support, ignoring --threads\");\n+\t\twarning(_(\"no threads support, ignoring --threads\"));\n #endif\n \tif (!pack_to_stdout && !pack_size_limit)\n \t\tpack_size_limit = pack_size_limit_cfg;\n \tif (pack_to_stdout && pack_size_limit)\n-\t\tdie(\"--max-pack-size cannot be used to build a pack for transfer.\");\n+\t\tdie(_(\"--max-pack-size cannot be used to build a pack for transfer\"));\n \tif (pack_size_limit && pack_size_limit < 1024*1024) {\n-\t\twarning(\"minimum pack size limit is 1 MiB\");\n+\t\twarning(_(\"minimum pack size limit is 1 MiB\"));\n \t\tpack_size_limit = 1024*1024;\n \t}\n \n \tif (!pack_to_stdout && thin)\n-\t\tdie(\"--thin cannot be used to build an indexable pack.\");\n+\t\tdie(_(\"--thin cannot be used to build an indexable pack\"));\n \n \tif (keep_unreachable && unpack_unreachable)\n-\t\tdie(\"--keep-unreachable and --unpack-unreachable are incompatible.\");\n+\t\tdie(_(\"--keep-unreachable and --unpack-unreachable are incompatible\"));\n \tif (!rev_list_all || !rev_list_reflog || !rev_list_index)\n \t\tunpack_unreachable_expiration = 0;\n \n \tif (filter_options.choice) {\n \t\tif (!pack_to_stdout)\n-\t\t\tdie(\"cannot use --filter without --stdout.\");\n+\t\t\tdie(_(\"cannot use --filter without --stdout\"));\n \t\tuse_bitmap_index = 0;\n \t}\n \n@@ -3353,8 +3354,9 @@ int cmd_pack_objects(int argc, const char **argv, const char *prefix)\n \t\tprepare_pack(window, depth);\n \twrite_pack_file();\n \tif (progress)\n-\t\tfprintf_ln(stderr, \"Total %\"PRIu32\" (delta %\"PRIu32\"),\"\n-\t\t\t   \" reused %\"PRIu32\" (delta %\"PRIu32\")\",\n-\t\t\t   written, written_delta, reused, reused_delta);\n+\t\tfprintf_ln(stderr,\n+\t\t\t   _(\"Total %\"PRIu32\" (delta %\"PRIu32\"),\"\n+\t\t\t     \" reused %\"PRIu32\" (delta %\"PRIu32\")\"),\n+\t\t\twritten, written_delta, reused, reused_delta);\n \treturn 0;\n }\ndiff --git a/t/t5500-fetch-pack.sh b/t/t5500-fetch-pack.sh\nindex ea6570e819..d2d27f9b54 100755\n--- a/t/t5500-fetch-pack.sh\n+++ b/t/t5500-fetch-pack.sh\n@@ -403,7 +403,7 @@ test_expect_success 'fetch creating new shallow root' '\n \t\tgit fetch --depth=1 --progress 2>actual &&\n \t\t# This should fetch only the empty commit, no tree or\n \t\t# blob objects\n-\t\tgrep \"remote: Total 1\" actual\n+\t\ttest_i18ngrep \"remote: Total 1\" actual\n \t)\n '\n \n-- \n2.18.0.rc2.476.g39500d3211\n\n"},{"id":"351419","messageId":"20180630090818.28937-8-pclouds@gmail.com","threadId":"48805","inReplyTo":"20180630090818.28937-1-pclouds@gmail.com","subject":"[PATCH 07/23] builtin/replace.c: mark more strings for translation","fromName":"Nguyễn Thái Ngọc Duy","fromEmail":"pclouds@gmail.com","sentAt":"2018-06-30T09:08:02Z","receivedAt":"2018-06-30T09:08:57Z","isPatch":true,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>\n---\n builtin/replace.c | 82 +++++++++++++++++++++++------------------------\n 1 file changed, 41 insertions(+), 41 deletions(-)\n\ndiff --git a/builtin/replace.c b/builtin/replace.c\nindex de826e8209..c77b325aa1 100644\n--- a/builtin/replace.c\n+++ b/builtin/replace.c\n@@ -54,7 +54,7 @@ static int show_reference(const char *refname, const struct object_id *oid,\n \t\t\tenum object_type obj_type, repl_type;\n \n \t\t\tif (get_oid(refname, &object))\n-\t\t\t\treturn error(\"failed to resolve '%s' as a valid ref\", refname);\n+\t\t\t\treturn error(_(\"failed to resolve '%s' as a valid ref\"), refname);\n \n \t\t\tobj_type = oid_object_info(the_repository, &object,\n \t\t\t\t\t\t   NULL);\n@@ -83,8 +83,8 @@ static int list_replace_refs(const char *pattern, const char *format)\n \telse if (!strcmp(format, \"long\"))\n \t\tdata.format = REPLACE_FORMAT_LONG;\n \telse\n-\t\treturn error(\"invalid replace format '%s'\\n\"\n-\t\t\t     \"valid formats are 'short', 'medium' and 'long'\\n\",\n+\t\treturn error(_(\"invalid replace format '%s'\\n\"\n+\t\t\t       \"valid formats are 'short', 'medium' and 'long'\"),\n \t\t\t     format);\n \n \tfor_each_replace_ref(the_repository, show_reference, (void *)&data);\n@@ -118,7 +118,7 @@ static int for_each_replace_name(const char **argv, each_replace_name_fn fn)\n \t\tfull_hex = ref.buf + base_len;\n \n \t\tif (read_ref(ref.buf, &oid)) {\n-\t\t\terror(\"replace ref '%s' not found\", full_hex);\n+\t\t\terror(_(\"replace ref '%s' not found\"), full_hex);\n \t\t\thad_error = 1;\n \t\t\tcontinue;\n \t\t}\n@@ -134,7 +134,7 @@ static int delete_replace_ref(const char *name, const char *ref,\n {\n \tif (delete_ref(NULL, ref, oid, 0))\n \t\treturn 1;\n-\tprintf_ln(\"Deleted replace ref '%s'\", name);\n+\tprintf_ln(_(\"Deleted replace ref '%s'\"), name);\n \treturn 0;\n }\n \n@@ -146,12 +146,12 @@ static int check_ref_valid(struct object_id *object,\n \tstrbuf_reset(ref);\n \tstrbuf_addf(ref, \"%s%s\", git_replace_ref_base, oid_to_hex(object));\n \tif (check_refname_format(ref->buf, 0))\n-\t\treturn error(\"'%s' is not a valid ref name\", ref->buf);\n+\t\treturn error(_(\"'%s' is not a valid ref name\"), ref->buf);\n \n \tif (read_ref(ref->buf, prev))\n \t\toidclr(prev);\n \telse if (!force)\n-\t\treturn error(\"replace ref '%s' already exists\", ref->buf);\n+\t\treturn error(_(\"replace ref '%s' already exists\"), ref->buf);\n \treturn 0;\n }\n \n@@ -171,10 +171,10 @@ static int replace_object_oid(const char *object_ref,\n \tobj_type = oid_object_info(the_repository, object, NULL);\n \trepl_type = oid_object_info(the_repository, repl, NULL);\n \tif (!force && obj_type != repl_type)\n-\t\treturn error(\"Objects must be of the same type.\\n\"\n-\t\t\t     \"'%s' points to a replaced object of type '%s'\\n\"\n-\t\t\t     \"while '%s' points to a replacement object of \"\n-\t\t\t     \"type '%s'.\",\n+\t\treturn error(_(\"Objects must be of the same type.\\n\"\n+\t\t\t       \"'%s' points to a replaced object of type '%s'\\n\"\n+\t\t\t       \"while '%s' points to a replacement object of \"\n+\t\t\t       \"type '%s'.\"),\n \t\t\t     object_ref, type_name(obj_type),\n \t\t\t     replace_ref, type_name(repl_type));\n \n@@ -200,10 +200,10 @@ static int replace_object(const char *object_ref, const char *replace_ref, int f\n \tstruct object_id object, repl;\n \n \tif (get_oid(object_ref, &object))\n-\t\treturn error(\"failed to resolve '%s' as a valid ref\",\n+\t\treturn error(_(\"failed to resolve '%s' as a valid ref\"),\n \t\t\t     object_ref);\n \tif (get_oid(replace_ref, &repl))\n-\t\treturn error(\"failed to resolve '%s' as a valid ref\",\n+\t\treturn error(_(\"failed to resolve '%s' as a valid ref\"),\n \t\t\t     replace_ref);\n \n \treturn replace_object_oid(object_ref, &object, replace_ref, &repl, force);\n@@ -222,7 +222,7 @@ static int export_object(const struct object_id *oid, enum object_type type,\n \n \tfd = open(filename, O_WRONLY | O_CREAT | O_TRUNC, 0666);\n \tif (fd < 0)\n-\t\treturn error_errno(\"unable to open %s for writing\", filename);\n+\t\treturn error_errno(_(\"unable to open %s for writing\"), filename);\n \n \targv_array_push(&cmd.args, \"--no-replace-objects\");\n \targv_array_push(&cmd.args, \"cat-file\");\n@@ -235,7 +235,7 @@ static int export_object(const struct object_id *oid, enum object_type type,\n \tcmd.out = fd;\n \n \tif (run_command(&cmd))\n-\t\treturn error(\"cat-file reported failure\");\n+\t\treturn error(_(\"cat-file reported failure\"));\n \treturn 0;\n }\n \n@@ -251,7 +251,7 @@ static int import_object(struct object_id *oid, enum object_type type,\n \n \tfd = open(filename, O_RDONLY);\n \tif (fd < 0)\n-\t\treturn error_errno(\"unable to open %s for reading\", filename);\n+\t\treturn error_errno(_(\"unable to open %s for reading\"), filename);\n \n \tif (!raw && type == OBJ_TREE) {\n \t\tconst char *argv[] = { \"mktree\", NULL };\n@@ -265,11 +265,11 @@ static int import_object(struct object_id *oid, enum object_type type,\n \n \t\tif (start_command(&cmd)) {\n \t\t\tclose(fd);\n-\t\t\treturn error(\"unable to spawn mktree\");\n+\t\t\treturn error(_(\"unable to spawn mktree\"));\n \t\t}\n \n \t\tif (strbuf_read(&result, cmd.out, 41) < 0) {\n-\t\t\terror_errno(\"unable to read from mktree\");\n+\t\t\terror_errno(_(\"unable to read from mktree\"));\n \t\t\tclose(fd);\n \t\t\tclose(cmd.out);\n \t\t\treturn -1;\n@@ -278,11 +278,11 @@ static int import_object(struct object_id *oid, enum object_type type,\n \n \t\tif (finish_command(&cmd)) {\n \t\t\tstrbuf_release(&result);\n-\t\t\treturn error(\"mktree reported failure\");\n+\t\t\treturn error(_(\"mktree reported failure\"));\n \t\t}\n \t\tif (get_oid_hex(result.buf, oid) < 0) {\n \t\t\tstrbuf_release(&result);\n-\t\t\treturn error(\"mktree did not return an object name\");\n+\t\t\treturn error(_(\"mktree did not return an object name\"));\n \t\t}\n \n \t\tstrbuf_release(&result);\n@@ -291,12 +291,12 @@ static int import_object(struct object_id *oid, enum object_type type,\n \t\tint flags = HASH_FORMAT_CHECK | HASH_WRITE_OBJECT;\n \n \t\tif (fstat(fd, &st) < 0) {\n-\t\t\terror_errno(\"unable to fstat %s\", filename);\n+\t\t\terror_errno(_(\"unable to fstat %s\"), filename);\n \t\t\tclose(fd);\n \t\t\treturn -1;\n \t\t}\n \t\tif (index_fd(oid, fd, &st, type, NULL, flags) < 0)\n-\t\t\treturn error(\"unable to write object to database\");\n+\t\t\treturn error(_(\"unable to write object to database\"));\n \t\t/* index_fd close()s fd for us */\n \t}\n \n@@ -315,11 +315,11 @@ static int edit_and_replace(const char *object_ref, int force, int raw)\n \tstruct strbuf ref = STRBUF_INIT;\n \n \tif (get_oid(object_ref, &old_oid) < 0)\n-\t\treturn error(\"not a valid object name: '%s'\", object_ref);\n+\t\treturn error(_(\"not a valid object name: '%s'\"), object_ref);\n \n \ttype = oid_object_info(the_repository, &old_oid, NULL);\n \tif (type < 0)\n-\t\treturn error(\"unable to get object type for %s\",\n+\t\treturn error(_(\"unable to get object type for %s\"),\n \t\t\t     oid_to_hex(&old_oid));\n \n \tif (check_ref_valid(&old_oid, &prev, &ref, force)) {\n@@ -335,7 +335,7 @@ static int edit_and_replace(const char *object_ref, int force, int raw)\n \t}\n \tif (launch_editor(tmpfile, NULL, NULL) < 0) {\n \t\tfree(tmpfile);\n-\t\treturn error(\"editing object file failed\");\n+\t\treturn error(_(\"editing object file failed\"));\n \t}\n \tif (import_object(&new_oid, type, raw, tmpfile)) {\n \t\tfree(tmpfile);\n@@ -344,7 +344,7 @@ static int edit_and_replace(const char *object_ref, int force, int raw)\n \tfree(tmpfile);\n \n \tif (!oidcmp(&old_oid, &new_oid))\n-\t\treturn error(\"new object is the same as the old one: '%s'\", oid_to_hex(&old_oid));\n+\t\treturn error(_(\"new object is the same as the old one: '%s'\"), oid_to_hex(&old_oid));\n \n \treturn replace_object_oid(object_ref, &old_oid, \"replacement\", &new_oid, force);\n }\n@@ -456,10 +456,10 @@ static int create_graft(int argc, const char **argv, int force, int gentle)\n \t\treturn -1;\n \t}\n \n-\tif (remove_signature(&buf)) {\n-\t\twarning(_(\"the original commit '%s' has a gpg signature.\"), old_ref);\n-\t\twarning(_(\"the signature will be removed in the replacement commit!\"));\n-\t}\n+\tif (remove_signature(&buf))\n+\t\twarning(_(\"the original commit '%s' has a gpg signature.\\n\"\n+\t\t\t  \"The signature will be removed in the replacement commit!\"),\n+\t\t\told_ref);\n \n \tif (check_mergetags(commit, argc, argv)) {\n \t\tstrbuf_release(&buf);\n@@ -476,10 +476,10 @@ static int create_graft(int argc, const char **argv, int force, int gentle)\n \n \tif (!oidcmp(&old_oid, &new_oid)) {\n \t\tif (gentle) {\n-\t\t\twarning(\"graft for '%s' unnecessary\", oid_to_hex(&old_oid));\n+\t\t\twarning(_(\"graft for '%s' unnecessary\"), oid_to_hex(&old_oid));\n \t\t\treturn 0;\n \t\t}\n-\t\treturn error(\"new commit is the same as the old one: '%s'\", oid_to_hex(&old_oid));\n+\t\treturn error(_(\"new commit is the same as the old one: '%s'\"), oid_to_hex(&old_oid));\n \t}\n \n \treturn replace_object_oid(old_ref, &old_oid, \"replacement\", &new_oid, force);\n@@ -553,7 +553,7 @@ int cmd_replace(int argc, const char **argv, const char *prefix)\n \t\tcmdmode = argc ? MODE_REPLACE : MODE_LIST;\n \n \tif (format && cmdmode != MODE_LIST)\n-\t\tusage_msg_opt(\"--format cannot be used when not listing\",\n+\t\tusage_msg_opt(_(\"--format cannot be used when not listing\"),\n \t\t\t      git_replace_usage, options);\n \n \tif (force &&\n@@ -561,47 +561,47 @@ int cmd_replace(int argc, const char **argv, const char *prefix)\n \t    cmdmode != MODE_EDIT &&\n \t    cmdmode != MODE_GRAFT &&\n \t    cmdmode != MODE_CONVERT_GRAFT_FILE)\n-\t\tusage_msg_opt(\"-f only makes sense when writing a replacement\",\n+\t\tusage_msg_opt(_(\"-f only makes sense when writing a replacement\"),\n \t\t\t      git_replace_usage, options);\n \n \tif (raw && cmdmode != MODE_EDIT)\n-\t\tusage_msg_opt(\"--raw only makes sense with --edit\",\n+\t\tusage_msg_opt(_(\"--raw only makes sense with --edit\"),\n \t\t\t      git_replace_usage, options);\n \n \tswitch (cmdmode) {\n \tcase MODE_DELETE:\n \t\tif (argc < 1)\n-\t\t\tusage_msg_opt(\"-d needs at least one argument\",\n+\t\t\tusage_msg_opt(_(\"-d needs at least one argument\"),\n \t\t\t\t      git_replace_usage, options);\n \t\treturn for_each_replace_name(argv, delete_replace_ref);\n \n \tcase MODE_REPLACE:\n \t\tif (argc != 2)\n-\t\t\tusage_msg_opt(\"bad number of arguments\",\n+\t\t\tusage_msg_opt(_(\"bad number of arguments\"),\n \t\t\t\t      git_replace_usage, options);\n \t\treturn replace_object(argv[0], argv[1], force);\n \n \tcase MODE_EDIT:\n \t\tif (argc != 1)\n-\t\t\tusage_msg_opt(\"-e needs exactly one argument\",\n+\t\t\tusage_msg_opt(_(\"-e needs exactly one argument\"),\n \t\t\t\t      git_replace_usage, options);\n \t\treturn edit_and_replace(argv[0], force, raw);\n \n \tcase MODE_GRAFT:\n \t\tif (argc < 1)\n-\t\t\tusage_msg_opt(\"-g needs at least one argument\",\n+\t\t\tusage_msg_opt(_(\"-g needs at least one argument\"),\n \t\t\t\t      git_replace_usage, options);\n \t\treturn create_graft(argc, argv, force, 0);\n \n \tcase MODE_CONVERT_GRAFT_FILE:\n \t\tif (argc != 0)\n-\t\t\tusage_msg_opt(\"--convert-graft-file takes no argument\",\n+\t\t\tusage_msg_opt(_(\"--convert-graft-file takes no argument\"),\n \t\t\t\t      git_replace_usage, options);\n \t\treturn !!convert_graft_file(force);\n \n \tcase MODE_LIST:\n \t\tif (argc > 1)\n-\t\t\tusage_msg_opt(\"only one pattern can be given with -l\",\n+\t\t\tusage_msg_opt(_(\"only one pattern can be given with -l\"),\n \t\t\t\t      git_replace_usage, options);\n \t\treturn list_replace_refs(argv[0], format);\n \n-- \n2.18.0.rc2.476.g39500d3211\n\n"},{"id":"351420","messageId":"20180630090818.28937-9-pclouds@gmail.com","threadId":"48805","inReplyTo":"20180630090818.28937-1-pclouds@gmail.com","subject":"[PATCH 08/23] commit-graph.c: mark more strings for translation","fromName":"Nguyễn Thái Ngọc Duy","fromEmail":"pclouds@gmail.com","sentAt":"2018-06-30T09:08:03Z","receivedAt":"2018-06-30T09:09:03Z","isPatch":true,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>\n---\n commit-graph.c | 20 ++++++++++----------\n 1 file changed, 10 insertions(+), 10 deletions(-)\n\ndiff --git a/commit-graph.c b/commit-graph.c\nindex b63a1fc85e..c8d521923c 100644\n--- a/commit-graph.c\n+++ b/commit-graph.c\n@@ -77,28 +77,28 @@ struct commit_graph *load_commit_graph_one(const char *graph_file)\n \n \tif (graph_size < GRAPH_MIN_SIZE) {\n \t\tclose(fd);\n-\t\tdie(\"graph file %s is too small\", graph_file);\n+\t\tdie(_(\"graph file %s is too small\"), graph_file);\n \t}\n \tgraph_map = xmmap(NULL, graph_size, PROT_READ, MAP_PRIVATE, fd, 0);\n \tdata = (const unsigned char *)graph_map;\n \n \tgraph_signature = get_be32(data);\n \tif (graph_signature != GRAPH_SIGNATURE) {\n-\t\terror(\"graph signature %X does not match signature %X\",\n+\t\terror(_(\"graph signature %X does not match signature %X\"),\n \t\t      graph_signature, GRAPH_SIGNATURE);\n \t\tgoto cleanup_fail;\n \t}\n \n \tgraph_version = *(unsigned char*)(data + 4);\n \tif (graph_version != GRAPH_VERSION) {\n-\t\terror(\"graph version %X does not match version %X\",\n+\t\terror(_(\"graph version %X does not match version %X\"),\n \t\t      graph_version, GRAPH_VERSION);\n \t\tgoto cleanup_fail;\n \t}\n \n \thash_version = *(unsigned char*)(data + 5);\n \tif (hash_version != GRAPH_OID_VERSION) {\n-\t\terror(\"hash version %X does not match version %X\",\n+\t\terror(_(\"hash version %X does not match version %X\"),\n \t\t      hash_version, GRAPH_OID_VERSION);\n \t\tgoto cleanup_fail;\n \t}\n@@ -122,7 +122,7 @@ struct commit_graph *load_commit_graph_one(const char *graph_file)\n \t\tchunk_lookup += GRAPH_CHUNKLOOKUP_WIDTH;\n \n \t\tif (chunk_offset > graph_size - GIT_MAX_RAWSZ) {\n-\t\t\terror(\"improper chunk offset %08x%08x\", (uint32_t)(chunk_offset >> 32),\n+\t\t\terror(_(\"improper chunk offset %08x%08x\"), (uint32_t)(chunk_offset >> 32),\n \t\t\t      (uint32_t)chunk_offset);\n \t\t\tgoto cleanup_fail;\n \t\t}\n@@ -158,7 +158,7 @@ struct commit_graph *load_commit_graph_one(const char *graph_file)\n \t\t}\n \n \t\tif (chunk_repeated) {\n-\t\t\terror(\"chunk id %08x appears multiple times\", chunk_id);\n+\t\t\terror(_(\"chunk id %08x appears multiple times\"), chunk_id);\n \t\t\tgoto cleanup_fail;\n \t\t}\n \n@@ -244,7 +244,7 @@ static struct commit_list **insert_parent_or_die(struct commit_graph *g,\n \thashcpy(oid.hash, g->chunk_oid_lookup + g->hash_len * pos);\n \tc = lookup_commit(&oid);\n \tif (!c)\n-\t\tdie(\"could not find commit %s\", oid_to_hex(&oid));\n+\t\tdie(_(\"could not find commit %s\"), oid_to_hex(&oid));\n \tc->graph_pos = pos;\n \treturn &commit_list_insert(c, pptr)->next;\n }\n@@ -537,7 +537,7 @@ static int add_packed_commits(const struct object_id *oid,\n \n \toi.typep = &type;\n \tif (packed_object_info(the_repository, pack, offset, &oi) < 0)\n-\t\tdie(\"unable to get type of object %s\", oid_to_hex(oid));\n+\t\tdie(_(\"unable to get type of object %s\"), oid_to_hex(oid));\n \n \tif (type != OBJ_COMMIT)\n \t\treturn 0;\n@@ -683,9 +683,9 @@ void write_commit_graph(const char *obj_dir,\n \t\t\tstrbuf_addstr(&packname, pack_indexes[i]);\n \t\t\tp = add_packed_git(packname.buf, packname.len, 1);\n \t\t\tif (!p)\n-\t\t\t\tdie(\"error adding pack %s\", packname.buf);\n+\t\t\t\tdie(_(\"error adding pack %s\"), packname.buf);\n \t\t\tif (open_pack_index(p))\n-\t\t\t\tdie(\"error opening index for %s\", packname.buf);\n+\t\t\t\tdie(_(\"error opening index for %s\"), packname.buf);\n \t\t\tfor_each_object_in_pack(p, add_packed_commits, &oids);\n \t\t\tclose_pack(p);\n \t\t}\n-- \n2.18.0.rc2.476.g39500d3211\n\n"},{"id":"351421","messageId":"20180630090818.28937-16-pclouds@gmail.com","threadId":"48805","inReplyTo":"20180630090818.28937-1-pclouds@gmail.com","subject":"[PATCH 15/23] object.c: mark more strings for translation","fromName":"Nguyễn Thái Ngọc Duy","fromEmail":"pclouds@gmail.com","sentAt":"2018-06-30T09:08:10Z","receivedAt":"2018-06-30T09:09:04Z","isPatch":true,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>\n---\n object.c        | 10 +++++-----\n t/t1450-fsck.sh |  2 +-\n 2 files changed, 6 insertions(+), 6 deletions(-)\n\ndiff --git a/object.c b/object.c\nindex 10d167825e..477e686da7 100644\n--- a/object.c\n+++ b/object.c\n@@ -49,7 +49,7 @@ int type_from_string_gently(const char *str, ssize_t len, int gentle)\n \tif (gentle)\n \t\treturn -1;\n \n-\tdie(\"invalid object type \\\"%s\\\"\", str);\n+\tdie(_(\"invalid object type \\\"%s\\\"\"), str);\n }\n \n /*\n@@ -169,7 +169,7 @@ void *object_as_type(struct object *obj, enum object_type type, int quiet)\n \t}\n \telse {\n \t\tif (!quiet)\n-\t\t\terror(\"object %s is a %s, not a %s\",\n+\t\t\terror(_(\"object %s is a %s, not a %s\"),\n \t\t\t      oid_to_hex(&obj->oid),\n \t\t\t      type_name(obj->type), type_name(type));\n \t\treturn NULL;\n@@ -229,7 +229,7 @@ struct object *parse_object_buffer(const struct object_id *oid, enum object_type\n \t\t\tobj = &tag->object;\n \t\t}\n \t} else {\n-\t\twarning(\"object %s has unknown type id %d\", oid_to_hex(oid), type);\n+\t\twarning(_(\"object %s has unknown type id %d\"), oid_to_hex(oid), type);\n \t\tobj = NULL;\n \t}\n \treturn obj;\n@@ -262,7 +262,7 @@ struct object *parse_object(const struct object_id *oid)\n \t    (!obj && has_object_file(oid) &&\n \t     oid_object_info(the_repository, oid, NULL) == OBJ_BLOB)) {\n \t\tif (check_object_signature(repl, NULL, 0, NULL) < 0) {\n-\t\t\terror(\"sha1 mismatch %s\", oid_to_hex(oid));\n+\t\t\terror(_(\"sha1 mismatch %s\"), oid_to_hex(oid));\n \t\t\treturn NULL;\n \t\t}\n \t\tparse_blob_buffer(lookup_blob(oid), NULL, 0);\n@@ -273,7 +273,7 @@ struct object *parse_object(const struct object_id *oid)\n \tif (buffer) {\n \t\tif (check_object_signature(repl, buffer, size, type_name(type)) < 0) {\n \t\t\tfree(buffer);\n-\t\t\terror(\"sha1 mismatch %s\", oid_to_hex(repl));\n+\t\t\terror(_(\"sha1 mismatch %s\"), oid_to_hex(repl));\n \t\t\treturn NULL;\n \t\t}\n \ndiff --git a/t/t1450-fsck.sh b/t/t1450-fsck.sh\nindex 91fd71444d..7b7602ddb4 100755\n--- a/t/t1450-fsck.sh\n+++ b/t/t1450-fsck.sh\n@@ -372,7 +372,7 @@ test_expect_success 'rev-list --verify-objects with bad sha1' '\n \n \ttest_might_fail git rev-list --verify-objects refs/heads/bogus >/dev/null 2>out &&\n \tcat out &&\n-\tgrep -q \"error: sha1 mismatch 63ffffffffffffffffffffffffffffffffffffff\" out\n+\ttest_i18ngrep -q \"error: sha1 mismatch 63ffffffffffffffffffffffffffffffffffffff\" out\n '\n \n test_expect_success 'force fsck to ignore double author' '\n-- \n2.18.0.rc2.476.g39500d3211\n\n"},{"id":"351422","messageId":"20180630090818.28937-18-pclouds@gmail.com","threadId":"48805","inReplyTo":"20180630090818.28937-1-pclouds@gmail.com","subject":"[PATCH 17/23] refs.c: mark more strings for translation","fromName":"Nguyễn Thái Ngọc Duy","fromEmail":"pclouds@gmail.com","sentAt":"2018-06-30T09:08:12Z","receivedAt":"2018-06-30T09:09:07Z","isPatch":true,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>\n---\n refs.c                                | 40 +++++++++++++--------------\n t/t1400-update-ref.sh                 | 20 +++++++-------\n t/t1404-update-ref-errors.sh          |  4 +--\n t/t3210-pack-refs.sh                  |  2 +-\n t/t3310-notes-merge-manual-resolve.sh |  6 ++--\n t/t5505-remote.sh                     |  2 +-\n 6 files changed, 37 insertions(+), 37 deletions(-)\n\ndiff --git a/refs.c b/refs.c\nindex a033910353..becb78e441 100644\n--- a/refs.c\n+++ b/refs.c\n@@ -188,7 +188,7 @@ int ref_resolves_to_object(const char *refname,\n \tif (flags & REF_ISBROKEN)\n \t\treturn 0;\n \tif (!has_sha1_file(oid->hash)) {\n-\t\terror(\"%s does not point to a valid object!\", refname);\n+\t\terror(_(\"%s does not point to a valid object!\"), refname);\n \t\treturn 0;\n \t}\n \treturn 1;\n@@ -567,9 +567,9 @@ int expand_ref(const char *str, int len, struct object_id *oid, char **ref)\n \t\t\tif (!warn_ambiguous_refs)\n \t\t\t\tbreak;\n \t\t} else if ((flag & REF_ISSYMREF) && strcmp(fullref.buf, \"HEAD\")) {\n-\t\t\twarning(\"ignoring dangling symref %s\", fullref.buf);\n+\t\t\twarning(_(\"ignoring dangling symref %s\"), fullref.buf);\n \t\t} else if ((flag & REF_ISBROKEN) && strchr(fullref.buf, '/')) {\n-\t\t\twarning(\"ignoring broken ref %s\", fullref.buf);\n+\t\t\twarning(_(\"ignoring broken ref %s\"), fullref.buf);\n \t\t}\n \t}\n \tstrbuf_release(&fullref);\n@@ -673,7 +673,7 @@ static int write_pseudoref(const char *pseudoref, const struct object_id *oid,\n \tfd = hold_lock_file_for_update_timeout(&lock, filename, 0,\n \t\t\t\t\t       get_files_ref_lock_timeout_ms());\n \tif (fd < 0) {\n-\t\tstrbuf_addf(err, \"could not open '%s' for writing: %s\",\n+\t\tstrbuf_addf(err, _(\"could not open '%s' for writing: %s\"),\n \t\t\t    filename, strerror(errno));\n \t\tgoto done;\n \t}\n@@ -683,18 +683,18 @@ static int write_pseudoref(const char *pseudoref, const struct object_id *oid,\n \n \t\tif (read_ref(pseudoref, &actual_old_oid)) {\n \t\t\tif (!is_null_oid(old_oid)) {\n-\t\t\t\tstrbuf_addf(err, \"could not read ref '%s'\",\n+\t\t\t\tstrbuf_addf(err, _(\"could not read ref '%s'\"),\n \t\t\t\t\t    pseudoref);\n \t\t\t\trollback_lock_file(&lock);\n \t\t\t\tgoto done;\n \t\t\t}\n \t\t} else if (is_null_oid(old_oid)) {\n-\t\t\tstrbuf_addf(err, \"ref '%s' already exists\",\n+\t\t\tstrbuf_addf(err, _(\"ref '%s' already exists\"),\n \t\t\t\t    pseudoref);\n \t\t\trollback_lock_file(&lock);\n \t\t\tgoto done;\n \t\t} else if (oidcmp(&actual_old_oid, old_oid)) {\n-\t\t\tstrbuf_addf(err, \"unexpected object ID when writing '%s'\",\n+\t\t\tstrbuf_addf(err, _(\"unexpected object ID when writing '%s'\"),\n \t\t\t\t    pseudoref);\n \t\t\trollback_lock_file(&lock);\n \t\t\tgoto done;\n@@ -702,7 +702,7 @@ static int write_pseudoref(const char *pseudoref, const struct object_id *oid,\n \t}\n \n \tif (write_in_full(fd, buf.buf, buf.len) < 0) {\n-\t\tstrbuf_addf(err, \"could not write to '%s'\", filename);\n+\t\tstrbuf_addf(err, _(\"could not write to '%s'\"), filename);\n \t\trollback_lock_file(&lock);\n \t\tgoto done;\n \t}\n@@ -734,9 +734,9 @@ static int delete_pseudoref(const char *pseudoref, const struct object_id *old_o\n \t\t\treturn -1;\n \t\t}\n \t\tif (read_ref(pseudoref, &actual_old_oid))\n-\t\t\tdie(\"could not read ref '%s'\", pseudoref);\n+\t\t\tdie(_(\"could not read ref '%s'\"), pseudoref);\n \t\tif (oidcmp(&actual_old_oid, old_oid)) {\n-\t\t\terror(\"unexpected object ID when deleting '%s'\",\n+\t\t\terror(_(\"unexpected object ID when deleting '%s'\"),\n \t\t\t      pseudoref);\n \t\t\trollback_lock_file(&lock);\n \t\t\treturn -1;\n@@ -871,13 +871,13 @@ static int read_ref_at_ent(struct object_id *ooid, struct object_id *noid,\n \t\tif (!is_null_oid(&cb->ooid)) {\n \t\t\toidcpy(cb->oid, noid);\n \t\t\tif (oidcmp(&cb->ooid, noid))\n-\t\t\t\twarning(\"log for ref %s has gap after %s\",\n+\t\t\t\twarning(_(\"log for ref %s has gap after %s\"),\n \t\t\t\t\tcb->refname, show_date(cb->date, cb->tz, DATE_MODE(RFC2822)));\n \t\t}\n \t\telse if (cb->date == cb->at_time)\n \t\t\toidcpy(cb->oid, noid);\n \t\telse if (oidcmp(noid, cb->oid))\n-\t\t\twarning(\"log for ref %s unexpectedly ended on %s\",\n+\t\t\twarning(_(\"log for ref %s unexpectedly ended on %s\"),\n \t\t\t\tcb->refname, show_date(cb->date, cb->tz,\n \t\t\t\t\t\t       DATE_MODE(RFC2822)));\n \t\toidcpy(&cb->ooid, ooid);\n@@ -935,7 +935,7 @@ int read_ref_at(const char *refname, unsigned int flags, timestamp_t at_time, in\n \t\tif (flags & GET_OID_QUIETLY)\n \t\t\texit(128);\n \t\telse\n-\t\t\tdie(\"log for %s is empty\", refname);\n+\t\t\tdie(_(\"log for %s is empty\"), refname);\n \t}\n \tif (cb.found_it)\n \t\treturn 0;\n@@ -1027,7 +1027,7 @@ int ref_transaction_update(struct ref_transaction *transaction,\n \tif ((new_oid && !is_null_oid(new_oid)) ?\n \t    check_refname_format(refname, REFNAME_ALLOW_ONELEVEL) :\n \t    !refname_is_safe(refname)) {\n-\t\tstrbuf_addf(err, \"refusing to update ref with bad name '%s'\",\n+\t\tstrbuf_addf(err, _(\"refusing to update ref with bad name '%s'\"),\n \t\t\t    refname);\n \t\treturn -1;\n \t}\n@@ -1103,7 +1103,7 @@ int refs_update_ref(struct ref_store *refs, const char *msg,\n \t\t}\n \t}\n \tif (ret) {\n-\t\tconst char *str = \"update_ref failed for ref '%s': %s\";\n+\t\tconst char *str = _(\"update_ref failed for ref '%s': %s\");\n \n \t\tswitch (onerr) {\n \t\tcase UPDATE_REFS_MSG_ON_ERR:\n@@ -1845,7 +1845,7 @@ int ref_update_reject_duplicates(struct string_list *refnames,\n \n \t\tif (!cmp) {\n \t\t\tstrbuf_addf(err,\n-\t\t\t\t    \"multiple updates for ref '%s' not allowed\",\n+\t\t\t\t    _(\"multiple updates for ref '%s' not allowed\"),\n \t\t\t\t    refnames->items[i].string);\n \t\t\treturn 1;\n \t\t} else if (cmp > 0) {\n@@ -1973,13 +1973,13 @@ int refs_verify_refname_available(struct ref_store *refs,\n \t\t\tcontinue;\n \n \t\tif (!refs_read_raw_ref(refs, dirname.buf, &oid, &referent, &type)) {\n-\t\t\tstrbuf_addf(err, \"'%s' exists; cannot create '%s'\",\n+\t\t\tstrbuf_addf(err, _(\"'%s' exists; cannot create '%s'\"),\n \t\t\t\t    dirname.buf, refname);\n \t\t\tgoto cleanup;\n \t\t}\n \n \t\tif (extras && string_list_has_string(extras, dirname.buf)) {\n-\t\t\tstrbuf_addf(err, \"cannot process '%s' and '%s' at the same time\",\n+\t\t\tstrbuf_addf(err, _(\"cannot process '%s' and '%s' at the same time\"),\n \t\t\t\t    refname, dirname.buf);\n \t\t\tgoto cleanup;\n \t\t}\n@@ -2003,7 +2003,7 @@ int refs_verify_refname_available(struct ref_store *refs,\n \t\t    string_list_has_string(skip, iter->refname))\n \t\t\tcontinue;\n \n-\t\tstrbuf_addf(err, \"'%s' exists; cannot create '%s'\",\n+\t\tstrbuf_addf(err, _(\"'%s' exists; cannot create '%s'\"),\n \t\t\t    iter->refname, refname);\n \t\tref_iterator_abort(iter);\n \t\tgoto cleanup;\n@@ -2014,7 +2014,7 @@ int refs_verify_refname_available(struct ref_store *refs,\n \n \textra_refname = find_descendant_ref(dirname.buf, extras, skip);\n \tif (extra_refname)\n-\t\tstrbuf_addf(err, \"cannot process '%s' and '%s' at the same time\",\n+\t\tstrbuf_addf(err, _(\"cannot process '%s' and '%s' at the same time\"),\n \t\t\t    refname, extra_refname);\n \telse\n \t\tret = 0;\ndiff --git a/t/t1400-update-ref.sh b/t/t1400-update-ref.sh\nindex 05e68a6671..7c8df20955 100755\n--- a/t/t1400-update-ref.sh\n+++ b/t/t1400-update-ref.sh\n@@ -390,7 +390,7 @@ test_expect_success 'Query \"master@{2005-05-26 23:33:01}\" (middle of history wit\n \ttest_when_finished \"rm -f o e\" &&\n \tgit rev-parse --verify \"master@{2005-05-26 23:33:01}\" >o 2>e &&\n \ttest $B = $(cat o) &&\n-\ttest \"warning: log for ref $m has gap after $gd\" = \"$(cat e)\"\n+\ttest_i18ngrep -F \"warning: log for ref $m has gap after $gd\" e\n '\n test_expect_success 'Query \"master@{2005-05-26 23:38:00}\" (middle of history)' '\n \ttest_when_finished \"rm -f o e\" &&\n@@ -408,7 +408,7 @@ test_expect_success 'Query \"master@{2005-05-28}\" (past end of history)' '\n \ttest_when_finished \"rm -f o e\" &&\n \tgit rev-parse --verify \"master@{2005-05-28}\" >o 2>e &&\n \ttest $D = $(cat o) &&\n-\ttest \"warning: log for ref $m unexpectedly ended on $ld\" = \"$(cat e)\"\n+\ttest_i18ngrep -F \"warning: log for ref $m unexpectedly ended on $ld\" e\n '\n \n rm -f .git/$m .git/logs/$m expect\n@@ -462,7 +462,7 @@ test_expect_success 'git cat-file blob master@{2005-05-26 23:42}:F (expect OTHER\n test_expect_success 'given old value for missing pseudoref, do not create' '\n \ttest_must_fail git update-ref PSEUDOREF $A $B 2>err &&\n \ttest_path_is_missing .git/PSEUDOREF &&\n-\tgrep \"could not read ref\" err\n+\ttest_i18ngrep \"could not read ref\" err\n '\n \n test_expect_success 'create pseudoref' '\n@@ -483,7 +483,7 @@ test_expect_success 'overwrite pseudoref with correct old value' '\n test_expect_success 'do not overwrite pseudoref with wrong old value' '\n \ttest_must_fail git update-ref PSEUDOREF $D $E 2>err &&\n \ttest $C = $(cat .git/PSEUDOREF) &&\n-\tgrep \"unexpected object ID\" err\n+\ttest_i18ngrep \"unexpected object ID\" err\n '\n \n test_expect_success 'delete pseudoref' '\n@@ -495,7 +495,7 @@ test_expect_success 'do not delete pseudoref with wrong old value' '\n \tgit update-ref PSEUDOREF $A &&\n \ttest_must_fail git update-ref -d PSEUDOREF $B 2>err &&\n \ttest $A = $(cat .git/PSEUDOREF) &&\n-\tgrep \"unexpected object ID\" err\n+\ttest_i18ngrep \"unexpected object ID\" err\n '\n \n test_expect_success 'delete pseudoref with correct old value' '\n@@ -512,7 +512,7 @@ test_expect_success 'do not overwrite pseudoref with old OID zero' '\n \ttest_when_finished git update-ref -d PSEUDOREF &&\n \ttest_must_fail git update-ref PSEUDOREF $B $Z 2>err &&\n \ttest $A = $(cat .git/PSEUDOREF) &&\n-\tgrep \"already exists\" err\n+\ttest_i18ngrep \"already exists\" err\n '\n \n # Test --stdin\n@@ -650,7 +650,7 @@ test_expect_success 'stdin fails with duplicate refs' '\n \tcreate $a $m\n \tEOF\n \ttest_must_fail git update-ref --stdin <stdin 2>err &&\n-\tgrep \"fatal: multiple updates for ref '\"'\"'$a'\"'\"' not allowed\" err\n+\ttest_i18ngrep \"fatal: multiple updates for ref '\"'\"'$a'\"'\"' not allowed\" err\n '\n \n test_expect_success 'stdin create ref works' '\n@@ -1052,7 +1052,7 @@ test_expect_success 'stdin -z fails option with unknown name' '\n test_expect_success 'stdin -z fails with duplicate refs' '\n \tprintf $F \"create $a\" \"$m\" \"create $b\" \"$m\" \"create $a\" \"$m\" >stdin &&\n \ttest_must_fail git update-ref -z --stdin <stdin 2>err &&\n-\tgrep \"fatal: multiple updates for ref '\"'\"'$a'\"'\"' not allowed\" err\n+\ttest_i18ngrep \"fatal: multiple updates for ref '\"'\"'$a'\"'\"' not allowed\" err\n '\n \n test_expect_success 'stdin -z create ref works' '\n@@ -1283,7 +1283,7 @@ test_expect_success 'fails with duplicate HEAD update' '\n \tupdate HEAD $B\n \tEOF\n \ttest_must_fail git update-ref --stdin <stdin 2>err &&\n-\tgrep \"fatal: multiple updates for '\\''HEAD'\\'' (including one via its referent .refs/heads/target1.) are not allowed\" err &&\n+\ttest_i18ngrep \"fatal: multiple updates for '\\''HEAD'\\'' (including one via its referent .refs/heads/target1.) are not allowed\" err &&\n \techo \"refs/heads/target1\" >expect &&\n \tgit symbolic-ref HEAD >actual &&\n \ttest_cmp expect actual &&\n@@ -1300,7 +1300,7 @@ test_expect_success 'fails with duplicate ref update via symref' '\n \tupdate refs/heads/symref2 $B\n \tEOF\n \ttest_must_fail git update-ref --stdin <stdin 2>err &&\n-\tgrep \"fatal: multiple updates for '\\''refs/heads/target2'\\'' (including one via symref .refs/heads/symref2.) are not allowed\" err &&\n+\ttest_i18ngrep \"fatal: multiple updates for '\\''refs/heads/target2'\\'' (including one via symref .refs/heads/symref2.) are not allowed\" err &&\n \techo \"refs/heads/target2\" >expect &&\n \tgit symbolic-ref refs/heads/symref2 >actual &&\n \ttest_cmp expect actual &&\ndiff --git a/t/t1404-update-ref-errors.sh b/t/t1404-update-ref-errors.sh\nindex 3a887b5113..2a42a589a4 100755\n--- a/t/t1404-update-ref-errors.sh\n+++ b/t/t1404-update-ref-errors.sh\n@@ -27,7 +27,7 @@ test_update_rejected () {\n \tfi &&\n \tprintf \"create $prefix/%s $C\\n\" $create >input &&\n \ttest_must_fail git update-ref --stdin <input 2>output.err &&\n-\tgrep -F \"$error\" output.err &&\n+\ttest_i18ngrep -F \"$error\" output.err &&\n \tgit for-each-ref $prefix >actual &&\n \ttest_cmp unchanged actual\n }\n@@ -103,7 +103,7 @@ df_test() {\n \t\tprintf \"%s\\n\" \"delete $delname\" \"create $addname $D\"\n \tfi >commands &&\n \ttest_must_fail git update-ref --stdin <commands 2>output.err &&\n-\ttest_cmp expected-err output.err &&\n+\ttest_i18ncmp expected-err output.err &&\n \tprintf \"%s\\n\" \"$C $delref\" >expected-refs &&\n \tgit for-each-ref --format=\"%(objectname) %(refname)\" $prefix/r >actual-refs &&\n \ttest_cmp expected-refs actual-refs\ndiff --git a/t/t3210-pack-refs.sh b/t/t3210-pack-refs.sh\nindex afa27ffe2d..7e95713f9e 100755\n--- a/t/t3210-pack-refs.sh\n+++ b/t/t3210-pack-refs.sh\n@@ -186,7 +186,7 @@ test_expect_success 'notice d/f conflict with existing directory' '\n \n test_expect_success 'existing directory reports concrete ref' '\n \ttest_must_fail git branch foo 2>stderr &&\n-\tgrep refs/heads/foo/bar/baz stderr\n+\ttest_i18ngrep refs/heads/foo/bar/baz stderr\n '\n \n test_expect_success 'notice d/f conflict with existing ref' '\ndiff --git a/t/t3310-notes-merge-manual-resolve.sh b/t/t3310-notes-merge-manual-resolve.sh\nindex 9c1bf6eb3d..68436eed82 100755\n--- a/t/t3310-notes-merge-manual-resolve.sh\n+++ b/t/t3310-notes-merge-manual-resolve.sh\n@@ -541,9 +541,9 @@ EOF\n \ttest \"$(git rev-parse refs/notes/y)\" = \"$(git rev-parse NOTES_MERGE_PARTIAL^1)\" &&\n \ttest \"$(git rev-parse refs/notes/m)\" != \"$(git rev-parse NOTES_MERGE_PARTIAL^1)\" &&\n \t# Mention refs/notes/m, and its current and expected value in output\n-\tgrep -q \"refs/notes/m\" output &&\n-\tgrep -q \"$(git rev-parse refs/notes/m)\" output &&\n-\tgrep -q \"$(git rev-parse NOTES_MERGE_PARTIAL^1)\" output &&\n+\ttest_i18ngrep -q \"refs/notes/m\" output &&\n+\ttest_i18ngrep -q \"$(git rev-parse refs/notes/m)\" output &&\n+\ttest_i18ngrep -q \"$(git rev-parse NOTES_MERGE_PARTIAL^1)\" output &&\n \t# Verify that other notes refs has not changed (w, x, y and z)\n \tverify_notes w &&\n \tverify_notes x &&\ndiff --git a/t/t5505-remote.sh b/t/t5505-remote.sh\nindex a6c0178f3a..ca4c222743 100755\n--- a/t/t5505-remote.sh\n+++ b/t/t5505-remote.sh\n@@ -876,7 +876,7 @@ test_expect_success 'remote prune to cause a dangling symref' '\n \t\tcd eight &&\n \t\ttest_must_fail git branch nomore origin\n \t) 2>err &&\n-\tgrep \"dangling symref\" err\n+\ttest_i18ngrep \"dangling symref\" err\n '\n \n test_expect_success 'show empty remote' '\n-- \n2.18.0.rc2.476.g39500d3211\n\n"},{"id":"351423","messageId":"20180630090818.28937-17-pclouds@gmail.com","threadId":"48805","inReplyTo":"20180630090818.28937-1-pclouds@gmail.com","subject":"[PATCH 16/23] pkt-line.c: mark more strings for translation","fromName":"Nguyễn Thái Ngọc Duy","fromEmail":"pclouds@gmail.com","sentAt":"2018-06-30T09:08:11Z","receivedAt":"2018-06-30T09:09:13Z","isPatch":true,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>\n---\n pkt-line.c | 26 +++++++++++++-------------\n 1 file changed, 13 insertions(+), 13 deletions(-)\n\ndiff --git a/pkt-line.c b/pkt-line.c\nindex 941e41dfc1..04d10bbd03 100644\n--- a/pkt-line.c\n+++ b/pkt-line.c\n@@ -101,7 +101,7 @@ int packet_flush_gently(int fd)\n {\n \tpacket_trace(\"0000\", 4, 1);\n \tif (write_in_full(fd, \"0000\", 4) < 0)\n-\t\treturn error(\"flush packet write failed\");\n+\t\treturn error(_(\"flush packet write failed\"));\n \treturn 0;\n }\n \n@@ -139,7 +139,7 @@ static void format_packet(struct strbuf *out, const char *fmt, va_list args)\n \tn = out->len - orig_len;\n \n \tif (n > LARGE_PACKET_MAX)\n-\t\tdie(\"protocol error: impossibly long line\");\n+\t\tdie(_(\"protocol error: impossibly long line\"));\n \n \tset_packet_header(&out->buf[orig_len], n);\n \tpacket_trace(out->buf + orig_len + 4, n - 4, 1);\n@@ -155,9 +155,9 @@ static int packet_write_fmt_1(int fd, int gently,\n \tif (write_in_full(fd, buf.buf, buf.len) < 0) {\n \t\tif (!gently) {\n \t\t\tcheck_pipe(errno);\n-\t\t\tdie_errno(\"packet write with format failed\");\n+\t\t\tdie_errno(_(\"packet write with format failed\"));\n \t\t}\n-\t\treturn error(\"packet write with format failed\");\n+\t\treturn error(_(\"packet write with format failed\"));\n \t}\n \n \treturn 0;\n@@ -189,21 +189,21 @@ static int packet_write_gently(const int fd_out, const char *buf, size_t size)\n \tsize_t packet_size;\n \n \tif (size > sizeof(packet_write_buffer) - 4)\n-\t\treturn error(\"packet write failed - data exceeds max packet size\");\n+\t\treturn error(_(\"packet write failed - data exceeds max packet size\"));\n \n \tpacket_trace(buf, size, 1);\n \tpacket_size = size + 4;\n \tset_packet_header(packet_write_buffer, packet_size);\n \tmemcpy(packet_write_buffer + 4, buf, size);\n \tif (write_in_full(fd_out, packet_write_buffer, packet_size) < 0)\n-\t\treturn error(\"packet write failed\");\n+\t\treturn error(_(\"packet write failed\"));\n \treturn 0;\n }\n \n void packet_write(int fd_out, const char *buf, size_t size)\n {\n \tif (packet_write_gently(fd_out, buf, size))\n-\t\tdie_errno(\"packet write failed\");\n+\t\tdie_errno(_(\"packet write failed\"));\n }\n \n void packet_buf_write(struct strbuf *buf, const char *fmt, ...)\n@@ -225,7 +225,7 @@ void packet_buf_write_len(struct strbuf *buf, const char *data, size_t len)\n \tn = buf->len - orig_len;\n \n \tif (n > LARGE_PACKET_MAX)\n-\t\tdie(\"protocol error: impossibly long line\");\n+\t\tdie(_(\"protocol error: impossibly long line\"));\n \n \tset_packet_header(&buf->buf[orig_len], n);\n \tpacket_trace(data, len, 1);\n@@ -288,7 +288,7 @@ static int get_packet_data(int fd, char **src_buf, size_t *src_size,\n \t} else {\n \t\tret = read_in_full(fd, dst, size);\n \t\tif (ret < 0)\n-\t\t\tdie_errno(\"read error\");\n+\t\t\tdie_errno(_(\"read error\"));\n \t}\n \n \t/* And complain if we didn't get enough bytes to satisfy the read. */\n@@ -296,7 +296,7 @@ static int get_packet_data(int fd, char **src_buf, size_t *src_size,\n \t\tif (options & PACKET_READ_GENTLE_ON_EOF)\n \t\t\treturn -1;\n \n-\t\tdie(\"the remote end hung up unexpectedly\");\n+\t\tdie(_(\"the remote end hung up unexpectedly\"));\n \t}\n \n \treturn ret;\n@@ -324,7 +324,7 @@ enum packet_read_status packet_read_with_status(int fd, char **src_buffer,\n \tlen = packet_length(linelen);\n \n \tif (len < 0) {\n-\t\tdie(\"protocol error: bad line length character: %.4s\", linelen);\n+\t\tdie(_(\"protocol error: bad line length character: %.4s\"), linelen);\n \t} else if (!len) {\n \t\tpacket_trace(\"0000\", 4, 0);\n \t\t*pktlen = 0;\n@@ -334,12 +334,12 @@ enum packet_read_status packet_read_with_status(int fd, char **src_buffer,\n \t\t*pktlen = 0;\n \t\treturn PACKET_READ_DELIM;\n \t} else if (len < 4) {\n-\t\tdie(\"protocol error: bad line length %d\", len);\n+\t\tdie(_(\"protocol error: bad line length %d\"), len);\n \t}\n \n \tlen -= 4;\n \tif ((unsigned)len >= size)\n-\t\tdie(\"protocol error: bad line length %d\", len);\n+\t\tdie(_(\"protocol error: bad line length %d\"), len);\n \n \tif (get_packet_data(fd, src_buffer, src_len, buffer, len, options) < 0) {\n \t\t*pktlen = -1;\n-- \n2.18.0.rc2.476.g39500d3211\n\n"},{"id":"351424","messageId":"20180630090818.28937-20-pclouds@gmail.com","threadId":"48805","inReplyTo":"20180630090818.28937-1-pclouds@gmail.com","subject":"[PATCH 19/23] replace-object.c: mark more strings for translation","fromName":"Nguyễn Thái Ngọc Duy","fromEmail":"pclouds@gmail.com","sentAt":"2018-06-30T09:08:14Z","receivedAt":"2018-06-30T09:09:16Z","isPatch":true,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>\n---\n replace-object.c | 6 +++---\n 1 file changed, 3 insertions(+), 3 deletions(-)\n\ndiff --git a/replace-object.c b/replace-object.c\nindex 801b5c1678..ddc1546b8c 100644\n--- a/replace-object.c\n+++ b/replace-object.c\n@@ -17,7 +17,7 @@ static int register_replace_ref(const char *refname,\n \n \tif (get_oid_hex(hash, &repl_obj->original.oid)) {\n \t\tfree(repl_obj);\n-\t\twarning(\"bad replace ref name: %s\", refname);\n+\t\twarning(_(\"bad replace ref name: %s\"), refname);\n \t\treturn 0;\n \t}\n \n@@ -26,7 +26,7 @@ static int register_replace_ref(const char *refname,\n \n \t/* Register new object */\n \tif (oidmap_put(the_repository->objects->replace_map, repl_obj))\n-\t\tdie(\"duplicate replace ref: %s\", refname);\n+\t\tdie(_(\"duplicate replace ref: %s\"), refname);\n \n \treturn 0;\n }\n@@ -69,5 +69,5 @@ const struct object_id *do_lookup_replace_object(struct repository *r,\n \t\t\treturn cur;\n \t\tcur = &repl_obj->replacement;\n \t}\n-\tdie(\"replace depth too high for object %s\", oid_to_hex(oid));\n+\tdie(_(\"replace depth too high for object %s\"), oid_to_hex(oid));\n }\n-- \n2.18.0.rc2.476.g39500d3211\n\n"},{"id":"351425","messageId":"20180630090818.28937-19-pclouds@gmail.com","threadId":"48805","inReplyTo":"20180630090818.28937-1-pclouds@gmail.com","subject":"[PATCH 18/23] refspec.c: mark more strings for translation","fromName":"Nguyễn Thái Ngọc Duy","fromEmail":"pclouds@gmail.com","sentAt":"2018-06-30T09:08:13Z","receivedAt":"2018-06-30T09:09:19Z","isPatch":true,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>\n---\n refspec.c | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/refspec.c b/refspec.c\nindex c66351743b..f529092fd6 100644\n--- a/refspec.c\n+++ b/refspec.c\n@@ -134,7 +134,7 @@ void refspec_item_init_or_die(struct refspec_item *item, const char *refspec,\n \t\t\t      int fetch)\n {\n \tif (!refspec_item_init(item, refspec, fetch))\n-\t\tdie(\"invalid refspec '%s'\", refspec);\n+\t\tdie(_(\"invalid refspec '%s'\"), refspec);\n }\n \n void refspec_item_clear(struct refspec_item *item)\n-- \n2.18.0.rc2.476.g39500d3211\n\n"},{"id":"351426","messageId":"20180630090818.28937-15-pclouds@gmail.com","threadId":"48805","inReplyTo":"20180630090818.28937-1-pclouds@gmail.com","subject":"[PATCH 14/23] exec-cmd.c: mark more strings for translation","fromName":"Nguyễn Thái Ngọc Duy","fromEmail":"pclouds@gmail.com","sentAt":"2018-06-30T09:08:09Z","receivedAt":"2018-06-30T09:09:20Z","isPatch":true,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>\n---\n exec-cmd.c | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/exec-cmd.c b/exec-cmd.c\nindex 02d31ee897..4f81f44310 100644\n--- a/exec-cmd.c\n+++ b/exec-cmd.c\n@@ -358,7 +358,7 @@ int execl_git_cmd(const char *cmd, ...)\n \t}\n \tva_end(param);\n \tif (MAX_ARGS <= argc)\n-\t\treturn error(\"too many args to run %s\", cmd);\n+\t\treturn error(_(\"too many args to run %s\"), cmd);\n \n \targv[argc] = NULL;\n \treturn execv_git_cmd(argv);\n-- \n2.18.0.rc2.476.g39500d3211\n\n"},{"id":"351427","messageId":"20180630090818.28937-14-pclouds@gmail.com","threadId":"48805","inReplyTo":"20180630090818.28937-1-pclouds@gmail.com","subject":"[PATCH 13/23] environment.c: mark more strings for translation","fromName":"Nguyễn Thái Ngọc Duy","fromEmail":"pclouds@gmail.com","sentAt":"2018-06-30T09:08:08Z","receivedAt":"2018-06-30T09:09:23Z","isPatch":true,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>\n---\n environment.c | 4 ++--\n 1 file changed, 2 insertions(+), 2 deletions(-)\n\ndiff --git a/environment.c b/environment.c\nindex 2a6de2330b..d129c4adc5 100644\n--- a/environment.c\n+++ b/environment.c\n@@ -147,7 +147,7 @@ static char *expand_namespace(const char *raw_namespace)\n \t\t\tstrbuf_addf(&buf, \"refs/namespaces/%s\", (*c)->buf);\n \tstrbuf_list_free(components);\n \tif (check_refname_format(buf.buf, 0))\n-\t\tdie(\"bad git namespace path \\\"%s\\\"\", raw_namespace);\n+\t\tdie(_(\"bad git namespace path \\\"%s\\\"\"), raw_namespace);\n \tstrbuf_addch(&buf, '/');\n \treturn strbuf_detach(&buf, NULL);\n }\n@@ -329,7 +329,7 @@ char *get_graft_file(void)\n static void set_git_dir_1(const char *path)\n {\n \tif (setenv(GIT_DIR_ENVIRONMENT, path, 1))\n-\t\tdie(\"could not set GIT_DIR to '%s'\", path);\n+\t\tdie(_(\"could not set GIT_DIR to '%s'\"), path);\n \tsetup_git_env(path);\n }\n \n-- \n2.18.0.rc2.476.g39500d3211\n\n"},{"id":"351428","messageId":"20180630090818.28937-13-pclouds@gmail.com","threadId":"48805","inReplyTo":"20180630090818.28937-1-pclouds@gmail.com","subject":"[PATCH 12/23] dir.c: mark more strings for translation","fromName":"Nguyễn Thái Ngọc Duy","fromEmail":"pclouds@gmail.com","sentAt":"2018-06-30T09:08:07Z","receivedAt":"2018-06-30T09:09:26Z","isPatch":true,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>\n---\n dir.c                        | 6 +++---\n t/t3005-ls-files-relative.sh | 4 ++--\n t/t7400-submodule-basic.sh   | 2 +-\n 3 files changed, 6 insertions(+), 6 deletions(-)\n\ndiff --git a/dir.c b/dir.c\nindex e1a2e1cffb..7c6e7a0a37 100644\n--- a/dir.c\n+++ b/dir.c\n@@ -560,7 +560,7 @@ int report_path_error(const char *ps_matched,\n \t\tif (found_dup)\n \t\t\tcontinue;\n \n-\t\terror(\"pathspec '%s' did not match any file(s) known to git\",\n+\t\terror(_(\"pathspec '%s' did not match any file(s) known to git\"),\n \t\t      pathspec->items[num].original);\n \t\terrors++;\n \t}\n@@ -949,7 +949,7 @@ static void add_excludes_from_file_1(struct dir_struct *dir, const char *fname,\n \t\tdir->unmanaged_exclude_files++;\n \tel = add_exclude_list(dir, EXC_FILE, fname);\n \tif (add_excludes(fname, \"\", 0, el, NULL, oid_stat) < 0)\n-\t\tdie(\"cannot use %s as an exclude file\", fname);\n+\t\tdie(_(\"cannot use %s as an exclude file\"), fname);\n }\n \n void add_excludes_from_file(struct dir_struct *dir, const char *fname)\n@@ -3028,7 +3028,7 @@ static void connect_wt_gitdir_in_nested(const char *sub_worktree,\n \t\treturn;\n \n \tif (repo_read_index(&subrepo) < 0)\n-\t\tdie(\"index file corrupt in repo %s\", subrepo.gitdir);\n+\t\tdie(_(\"index file corrupt in repo %s\"), subrepo.gitdir);\n \n \tfor (i = 0; i < subrepo.index->cache_nr; i++) {\n \t\tconst struct cache_entry *ce = subrepo.index->cache[i];\ndiff --git a/t/t3005-ls-files-relative.sh b/t/t3005-ls-files-relative.sh\nindex 341fad54ce..209b4c7cd8 100755\n--- a/t/t3005-ls-files-relative.sh\n+++ b/t/t3005-ls-files-relative.sh\n@@ -50,7 +50,7 @@ test_expect_success 'ls-files -c' '\n \t\tls ../x* >expect.out &&\n \t\ttest_must_fail git ls-files -c --error-unmatch ../[xy]* >actual.out 2>actual.err &&\n \t\ttest_cmp expect.out actual.out &&\n-\t\ttest_cmp expect.err actual.err\n+\t\ttest_i18ncmp expect.err actual.err\n \t)\n '\n \n@@ -65,7 +65,7 @@ test_expect_success 'ls-files -o' '\n \t\tls ../y* >expect.out &&\n \t\ttest_must_fail git ls-files -o --error-unmatch ../[xy]* >actual.out 2>actual.err &&\n \t\ttest_cmp expect.out actual.out &&\n-\t\ttest_cmp expect.err actual.err\n+\t\ttest_i18ncmp expect.err actual.err\n \t)\n '\n \ndiff --git a/t/t7400-submodule-basic.sh b/t/t7400-submodule-basic.sh\nindex 812db137b8..d6853e94be 100755\n--- a/t/t7400-submodule-basic.sh\n+++ b/t/t7400-submodule-basic.sh\n@@ -377,7 +377,7 @@ test_expect_success 'init should register submodule url in .git/config' '\n \n test_failure_with_unknown_submodule () {\n \ttest_must_fail git submodule $1 no-such-submodule 2>output.err &&\n-\tgrep \"^error: .*no-such-submodule\" output.err\n+\ttest_i18ngrep \"^error: .*no-such-submodule\" output.err\n }\n \n test_expect_success 'init should fail with unknown submodule' '\n-- \n2.18.0.rc2.476.g39500d3211\n\n"},{"id":"351429","messageId":"20180630090818.28937-12-pclouds@gmail.com","threadId":"48805","inReplyTo":"20180630090818.28937-1-pclouds@gmail.com","subject":"[PATCH 11/23] convert.c: mark more strings for translation","fromName":"Nguyễn Thái Ngọc Duy","fromEmail":"pclouds@gmail.com","sentAt":"2018-06-30T09:08:06Z","receivedAt":"2018-06-30T09:09:31Z","isPatch":true,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>\n---\n convert.c             | 38 ++++++++++++++++++++------------------\n t/t0021-conversion.sh |  2 +-\n 2 files changed, 21 insertions(+), 19 deletions(-)\n\ndiff --git a/convert.c b/convert.c\nindex f47e60022e..e53911d4f8 100644\n--- a/convert.c\n+++ b/convert.c\n@@ -190,7 +190,7 @@ static enum eol output_eol(enum crlf_action crlf_action)\n \t\t/* fall through */\n \t\treturn text_eol_is_crlf() ? EOL_CRLF : EOL_LF;\n \t}\n-\twarning(\"illegal crlf_action %d\", (int)crlf_action);\n+\twarning(_(\"illegal crlf_action %d\"), (int)crlf_action);\n \treturn core_eol;\n }\n \n@@ -207,7 +207,7 @@ static void check_global_conv_flags_eol(const char *path, enum crlf_action crlf_\n \t\telse if (conv_flags & CONV_EOL_RNDTRP_WARN)\n \t\t\twarning(_(\"CRLF will be replaced by LF in %s.\\n\"\n \t\t\t\t  \"The file will have its original line\"\n-\t\t\t\t  \" endings in your working directory.\"), path);\n+\t\t\t\t  \" endings in your working directory\"), path);\n \t} else if (old_stats->lonelf && !new_stats->lonelf ) {\n \t\t/*\n \t\t * CRLFs would be added by checkout\n@@ -217,7 +217,7 @@ static void check_global_conv_flags_eol(const char *path, enum crlf_action crlf_\n \t\telse if (conv_flags & CONV_EOL_RNDTRP_WARN)\n \t\t\twarning(_(\"LF will be replaced by CRLF in %s.\\n\"\n \t\t\t\t  \"The file will have its original line\"\n-\t\t\t\t  \" endings in your working directory.\"), path);\n+\t\t\t\t  \" endings in your working directory\"), path);\n \t}\n }\n \n@@ -492,7 +492,7 @@ static int encode_to_worktree(const char *path, const char *src, size_t src_len,\n \tdst = reencode_string_len(src, src_len, enc, default_encoding,\n \t\t\t\t  &dst_len);\n \tif (!dst) {\n-\t\terror(\"failed to encode '%s' from %s to %s\",\n+\t\terror(_(\"failed to encode '%s' from %s to %s\"),\n \t\t      path, default_encoding, enc);\n \t\treturn 0;\n \t}\n@@ -670,7 +670,8 @@ static int filter_buffer_or_fd(int in, int out, void *data)\n \n \tif (start_command(&child_process)) {\n \t\tstrbuf_release(&cmd);\n-\t\treturn error(\"cannot fork to run external filter '%s'\", params->cmd);\n+\t\treturn error(_(\"cannot fork to run external filter '%s'\"),\n+\t\t\t     params->cmd);\n \t}\n \n \tsigchain_push(SIGPIPE, SIG_IGN);\n@@ -689,13 +690,14 @@ static int filter_buffer_or_fd(int in, int out, void *data)\n \tif (close(child_process.in))\n \t\twrite_err = 1;\n \tif (write_err)\n-\t\terror(\"cannot feed the input to external filter '%s'\", params->cmd);\n+\t\terror(_(\"cannot feed the input to external filter '%s'\"),\n+\t\t      params->cmd);\n \n \tsigchain_pop(SIGPIPE);\n \n \tstatus = finish_command(&child_process);\n \tif (status)\n-\t\terror(\"external filter '%s' failed %d\", params->cmd, status);\n+\t\terror(_(\"external filter '%s' failed %d\"), params->cmd, status);\n \n \tstrbuf_release(&cmd);\n \treturn (write_err || status);\n@@ -730,13 +732,13 @@ static int apply_single_file_filter(const char *path, const char *src, size_t le\n \t\treturn 0;\t/* error was already reported */\n \n \tif (strbuf_read(&nbuf, async.out, len) < 0) {\n-\t\terr = error(\"read from external filter '%s' failed\", cmd);\n+\t\terr = error(_(\"read from external filter '%s' failed\"), cmd);\n \t}\n \tif (close(async.out)) {\n-\t\terr = error(\"read from external filter '%s' failed\", cmd);\n+\t\terr = error(_(\"read from external filter '%s' failed\"), cmd);\n \t}\n \tif (finish_async(&async)) {\n-\t\terr = error(\"external filter '%s' failed\", cmd);\n+\t\terr = error(_(\"external filter '%s' failed\"), cmd);\n \t}\n \n \tif (!err) {\n@@ -790,7 +792,7 @@ static void handle_filter_error(const struct strbuf *filter_status,\n \t\t * Something went wrong with the protocol filter.\n \t\t * Force shutdown and restart if another blob requires filtering.\n \t\t */\n-\t\terror(\"external filter '%s' failed\", entry->subprocess.cmd);\n+\t\terror(_(\"external filter '%s' failed\"), entry->subprocess.cmd);\n \t\tsubprocess_stop(&subprocess_map, &entry->subprocess);\n \t\tfree(entry);\n \t}\n@@ -838,7 +840,7 @@ static int apply_multi_file_filter(const char *path, const char *src, size_t len\n \telse if (wanted_capability & CAP_SMUDGE)\n \t\tfilter_type = \"smudge\";\n \telse\n-\t\tdie(\"unexpected filter type\");\n+\t\tdie(_(\"unexpected filter type\"));\n \n \tsigchain_push(SIGPIPE, SIG_IGN);\n \n@@ -849,7 +851,7 @@ static int apply_multi_file_filter(const char *path, const char *src, size_t len\n \n \terr = strlen(path) > LARGE_PACKET_DATA_MAX - strlen(\"pathname=\\n\");\n \tif (err) {\n-\t\terror(\"path name too long for external filter\");\n+\t\terror(_(\"path name too long for external filter\"));\n \t\tgoto done;\n \t}\n \n@@ -923,8 +925,8 @@ int async_query_available_blobs(const char *cmd, struct string_list *available_p\n \tassert(subprocess_map_initialized);\n \tentry = (struct cmd2process *)subprocess_find_entry(&subprocess_map, cmd);\n \tif (!entry) {\n-\t\terror(\"external filter '%s' is not available anymore although \"\n-\t\t      \"not all paths have been filtered\", cmd);\n+\t\terror(_(\"external filter '%s' is not available anymore although \"\n+\t\t\t\"not all paths have been filtered\"), cmd);\n \t\treturn 0;\n \t}\n \tprocess = &entry->subprocess.process;\n@@ -1395,7 +1397,7 @@ int convert_to_git(const struct index_state *istate,\n \n \tret |= apply_filter(path, src, len, -1, dst, ca.drv, CAP_CLEAN, NULL);\n \tif (!ret && ca.drv && ca.drv->required)\n-\t\tdie(\"%s: clean filter '%s' failed\", path, ca.drv->name);\n+\t\tdie(_(\"%s: clean filter '%s' failed\"), path, ca.drv->name);\n \n \tif (ret && dst) {\n \t\tsrc = dst->buf;\n@@ -1429,7 +1431,7 @@ void convert_to_git_filter_fd(const struct index_state *istate,\n \tassert(ca.drv->clean || ca.drv->process);\n \n \tif (!apply_filter(path, NULL, 0, fd, dst, ca.drv, CAP_CLEAN, NULL))\n-\t\tdie(\"%s: clean filter '%s' failed\", path, ca.drv->name);\n+\t\tdie(_(\"%s: clean filter '%s' failed\"), path, ca.drv->name);\n \n \tencode_to_git(path, dst->buf, dst->len, dst, ca.working_tree_encoding, conv_flags);\n \tcrlf_to_git(istate, path, dst->buf, dst->len, dst, ca.crlf_action, conv_flags);\n@@ -1472,7 +1474,7 @@ static int convert_to_working_tree_internal(const char *path, const char *src,\n \tret_filter = apply_filter(\n \t\tpath, src, len, -1, dst, ca.drv, CAP_SMUDGE, dco);\n \tif (!ret_filter && ca.drv && ca.drv->required)\n-\t\tdie(\"%s: smudge filter %s failed\", path, ca.drv->name);\n+\t\tdie(_(\"%s: smudge filter %s failed\"), path, ca.drv->name);\n \n \treturn ret | ret_filter;\n }\ndiff --git a/t/t0021-conversion.sh b/t/t0021-conversion.sh\nindex 9479a4aaab..306b862d7f 100755\n--- a/t/t0021-conversion.sh\n+++ b/t/t0021-conversion.sh\n@@ -583,7 +583,7 @@ test_expect_success PERL 'process filter should restart after unexpected write f\n \t\tgit checkout --quiet --no-progress . 2>git-stderr.log &&\n \n \t\tgrep \"smudge write error at\" git-stderr.log &&\n-\t\tgrep \"error: external filter\" git-stderr.log &&\n+\t\ttest_i18ngrep \"error: external filter\" git-stderr.log &&\n \n \t\tcat >expected.log <<-EOF &&\n \t\t\tSTART\n-- \n2.18.0.rc2.476.g39500d3211\n\n"},{"id":"351430","messageId":"20180630090818.28937-11-pclouds@gmail.com","threadId":"48805","inReplyTo":"20180630090818.28937-1-pclouds@gmail.com","subject":"[PATCH 10/23] connect.c: mark more strings for translation","fromName":"Nguyễn Thái Ngọc Duy","fromEmail":"pclouds@gmail.com","sentAt":"2018-06-30T09:08:05Z","receivedAt":"2018-06-30T09:09:35Z","isPatch":true,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>\n---\n connect.c             | 78 +++++++++++++++++++++++--------------------\n t/t5570-git-daemon.sh |  6 ++--\n 2 files changed, 44 insertions(+), 40 deletions(-)\n\ndiff --git a/connect.c b/connect.c\nindex 083cf804a7..70b97cfef6 100644\n--- a/connect.c\n+++ b/connect.c\n@@ -78,7 +78,7 @@ int server_supports_v2(const char *c, int die_on_error)\n \t}\n \n \tif (die_on_error)\n-\t\tdie(\"server doesn't support '%s'\", c);\n+\t\tdie(_(\"server doesn't support '%s'\"), c);\n \n \treturn 0;\n }\n@@ -100,7 +100,7 @@ int server_supports_feature(const char *c, const char *feature,\n \t}\n \n \tif (die_on_error)\n-\t\tdie(\"server doesn't support feature '%s'\", feature);\n+\t\tdie(_(\"server doesn't support feature '%s'\"), feature);\n \n \treturn 0;\n }\n@@ -111,7 +111,7 @@ static void process_capabilities_v2(struct packet_reader *reader)\n \t\targv_array_push(&server_capabilities_v2, reader->line);\n \n \tif (reader->status != PACKET_READ_FLUSH)\n-\t\tdie(\"expected flush after capabilities\");\n+\t\tdie(_(\"expected flush after capabilities\"));\n }\n \n enum protocol_version discover_version(struct packet_reader *reader)\n@@ -230,7 +230,7 @@ static int process_dummy_ref(const char *line)\n static void check_no_capabilities(const char *line, int len)\n {\n \tif (strlen(line) != len)\n-\t\twarning(\"ignoring capabilities after first line '%s'\",\n+\t\twarning(_(\"ignoring capabilities after first line '%s'\"),\n \t\t\tline + strlen(line));\n }\n \n@@ -249,7 +249,7 @@ static int process_ref(const char *line, int len, struct ref ***list,\n \tif (extra_have && !strcmp(name, \".have\")) {\n \t\toid_array_append(extra_have, &old_oid);\n \t} else if (!strcmp(name, \"capabilities^{}\")) {\n-\t\tdie(\"protocol error: unexpected capabilities^{}\");\n+\t\tdie(_(\"protocol error: unexpected capabilities^{}\"));\n \t} else if (check_ref(name, flags)) {\n \t\tstruct ref *ref = alloc_ref(name);\n \t\toidcpy(&ref->old_oid, &old_oid);\n@@ -270,9 +270,9 @@ static int process_shallow(const char *line, int len,\n \t\treturn 0;\n \n \tif (get_oid_hex(arg, &old_oid))\n-\t\tdie(\"protocol error: expected shallow sha-1, got '%s'\", arg);\n+\t\tdie(_(\"protocol error: expected shallow sha-1, got '%s'\"), arg);\n \tif (!shallow_points)\n-\t\tdie(\"repository on the other end cannot be shallow\");\n+\t\tdie(_(\"repository on the other end cannot be shallow\"));\n \toid_array_append(shallow_points, &old_oid);\n \tcheck_no_capabilities(line, len);\n \treturn 1;\n@@ -307,13 +307,13 @@ struct ref **get_remote_heads(struct packet_reader *reader,\n \t\tcase PACKET_READ_NORMAL:\n \t\t\tlen = reader->pktlen;\n \t\t\tif (len > 4 && skip_prefix(reader->line, \"ERR \", &arg))\n-\t\t\t\tdie(\"remote error: %s\", arg);\n+\t\t\t\tdie(_(\"remote error: %s\"), arg);\n \t\t\tbreak;\n \t\tcase PACKET_READ_FLUSH:\n \t\t\tstate = EXPECTING_DONE;\n \t\t\tbreak;\n \t\tcase PACKET_READ_DELIM:\n-\t\t\tdie(\"invalid packet\");\n+\t\t\tdie(_(\"invalid packet\"));\n \t\t}\n \n \t\tswitch (state) {\n@@ -333,7 +333,7 @@ struct ref **get_remote_heads(struct packet_reader *reader,\n \t\tcase EXPECTING_SHALLOW:\n \t\t\tif (process_shallow(reader->line, len, shallow_points))\n \t\t\t\tbreak;\n-\t\t\tdie(\"protocol error: unexpected '%s'\", reader->line);\n+\t\t\tdie(_(\"protocol error: unexpected '%s'\"), reader->line);\n \t\tcase EXPECTING_DONE:\n \t\t\tbreak;\n \t\t}\n@@ -441,11 +441,11 @@ struct ref **get_remote_refs(int fd_out, struct packet_reader *reader,\n \t/* Process response from server */\n \twhile (packet_reader_read(reader) == PACKET_READ_NORMAL) {\n \t\tif (!process_ref_v2(reader->line, &list))\n-\t\t\tdie(\"invalid ls-refs response: %s\", reader->line);\n+\t\t\tdie(_(\"invalid ls-refs response: %s\"), reader->line);\n \t}\n \n \tif (reader->status != PACKET_READ_FLUSH)\n-\t\tdie(\"expected flush after ref listing\");\n+\t\tdie(_(\"expected flush after ref listing\"));\n \n \treturn list;\n }\n@@ -544,7 +544,7 @@ static enum protocol get_protocol(const char *name)\n \t\treturn PROTO_SSH;\n \tif (!strcmp(name, \"file\"))\n \t\treturn PROTO_FILE;\n-\tdie(\"protocol '%s' is not supported\", name);\n+\tdie(_(\"protocol '%s' is not supported\"), name);\n }\n \n static char *host_end(char **hoststart, int removebrackets)\n@@ -595,7 +595,7 @@ static void enable_keepalive(int sockfd)\n \tint ka = 1;\n \n \tif (setsockopt(sockfd, SOL_SOCKET, SO_KEEPALIVE, &ka, sizeof(ka)) < 0)\n-\t\terror_errno(\"unable to set SO_KEEPALIVE on socket\");\n+\t\terror_errno(_(\"unable to set SO_KEEPALIVE on socket\"));\n }\n \n #ifndef NO_IPV6\n@@ -635,15 +635,16 @@ static int git_tcp_connect_sock(char *host, int flags)\n \thints.ai_protocol = IPPROTO_TCP;\n \n \tif (flags & CONNECT_VERBOSE)\n-\t\tfprintf(stderr, \"Looking up %s ... \", host);\n+\t\tfprintf(stderr, _(\"Looking up %s ... \"), host);\n \n \tgai = getaddrinfo(host, port, &hints, &ai);\n \tif (gai)\n-\t\tdie(\"unable to look up %s (port %s) (%s)\", host, port, gai_strerror(gai));\n+\t\tdie(_(\"unable to look up %s (port %s) (%s)\"), host, port, gai_strerror(gai));\n \n \tif (flags & CONNECT_VERBOSE) {\n-\t\tfprintf_ln(stderr, \"done.\");\n-\t\tfprintf(stderr, \"Connecting to %s (port %s) ... \", host, port);\n+\t\t/* TRANSLATORS: this is the end of \"Looking up %s ... \" */\n+\t\tfprintf_ln(stderr, _(\"done.\"));\n+\t\tfprintf(stderr, _(\"Connecting to %s (port %s) ... \"), host, port);\n \t}\n \n \tfor (ai0 = ai; ai; ai = ai->ai_next, cnt++) {\n@@ -666,12 +667,13 @@ static int git_tcp_connect_sock(char *host, int flags)\n \tfreeaddrinfo(ai0);\n \n \tif (sockfd < 0)\n-\t\tdie(\"unable to connect to %s:\\n%s\", host, error_message.buf);\n+\t\tdie(_(\"unable to connect to %s:\\n%s\"), host, error_message.buf);\n \n \tenable_keepalive(sockfd);\n \n \tif (flags & CONNECT_VERBOSE)\n-\t\tfprintf_ln(stderr, \"done.\");\n+\t\t/* TRANSLATORS: this is the end of \"Connecting to %s (port %s) ... \" */\n+\t\tfprintf_ln(stderr, _(\"done.\"));\n \n \tstrbuf_release(&error_message);\n \n@@ -698,23 +700,24 @@ static int git_tcp_connect_sock(char *host, int flags)\n \tget_host_and_port(&host, &port);\n \n \tif (flags & CONNECT_VERBOSE)\n-\t\tfprintf(stderr, \"Looking up %s ... \", host);\n+\t\tfprintf(stderr, _(\"Looking up %s ... \"), host);\n \n \the = gethostbyname(host);\n \tif (!he)\n-\t\tdie(\"unable to look up %s (%s)\", host, hstrerror(h_errno));\n+\t\tdie(_(\"unable to look up %s (%s)\"), host, hstrerror(h_errno));\n \tnport = strtoul(port, &ep, 10);\n \tif ( ep == port || *ep ) {\n \t\t/* Not numeric */\n \t\tstruct servent *se = getservbyname(port,\"tcp\");\n \t\tif ( !se )\n-\t\t\tdie(\"unknown port %s\", port);\n+\t\t\tdie(_(\"unknown port %s\"), port);\n \t\tnport = se->s_port;\n \t}\n \n \tif (flags & CONNECT_VERBOSE) {\n-\t\tfprintf_ln(stderr, \"done.\");\n-\t\tfprintf(stderr, \"Connecting to %s (port %s) ... \", host, port);\n+\t\t/* TRANSLATORS: this is the end of \"Looking up %s ... \" */\n+\t\tfprintf_ln(stderr, _(\"done.\"));\n+\t\tfprintf(stderr, _(\"Connecting to %s (port %s) ... \"), host, port);\n \t}\n \n \tfor (cnt = 0, ap = he->h_addr_list; *ap; ap++, cnt++) {\n@@ -743,12 +746,13 @@ static int git_tcp_connect_sock(char *host, int flags)\n \t}\n \n \tif (sockfd < 0)\n-\t\tdie(\"unable to connect to %s:\\n%s\", host, error_message.buf);\n+\t\tdie(_(\"unable to connect to %s:\\n%s\"), host, error_message.buf);\n \n \tenable_keepalive(sockfd);\n \n \tif (flags & CONNECT_VERBOSE)\n-\t\tfprintf_ln(stderr, \"done.\");\n+\t\t/* TRANSLATORS: this is the end of \"Connecting to %s (port %s) ... \" */\n+\t\tfprintf_ln(stderr, _(\"done.\"));\n \n \treturn sockfd;\n }\n@@ -845,9 +849,9 @@ static struct child_process *git_proxy_connect(int fd[2], char *host)\n \tget_host_and_port(&host, &port);\n \n \tif (looks_like_command_line_option(host))\n-\t\tdie(\"strange hostname '%s' blocked\", host);\n+\t\tdie(_(\"strange hostname '%s' blocked\"), host);\n \tif (looks_like_command_line_option(port))\n-\t\tdie(\"strange port '%s' blocked\", port);\n+\t\tdie(_(\"strange port '%s' blocked\"), port);\n \n \tproxy = xmalloc(sizeof(*proxy));\n \tchild_process_init(proxy);\n@@ -857,7 +861,7 @@ static struct child_process *git_proxy_connect(int fd[2], char *host)\n \tproxy->in = -1;\n \tproxy->out = -1;\n \tif (start_command(proxy))\n-\t\tdie(\"cannot start proxy %s\", git_proxy_command);\n+\t\tdie(_(\"cannot start proxy %s\"), git_proxy_command);\n \tfd[0] = proxy->out; /* read from proxy stdout */\n \tfd[1] = proxy->in;  /* write to proxy stdin */\n \treturn proxy;\n@@ -924,7 +928,7 @@ static enum protocol parse_connect_url(const char *url_orig, char **ret_host,\n \t\tpath = strchr(end, separator);\n \n \tif (!path || !*path)\n-\t\tdie(\"no path specified; see 'git help pull' for valid url syntax\");\n+\t\tdie(_(\"no path specified; see 'git help pull' for valid url syntax\"));\n \n \t/*\n \t * null-terminate hostname and point path to ~ for URL's like this:\n@@ -1119,7 +1123,7 @@ static void push_ssh_options(struct argv_array *args, struct argv_array *env,\n \t\tcase VARIANT_AUTO:\n \t\t\tBUG(\"VARIANT_AUTO passed to push_ssh_options\");\n \t\tcase VARIANT_SIMPLE:\n-\t\t\tdie(\"ssh variant 'simple' does not support -4\");\n+\t\t\tdie(_(\"ssh variant 'simple' does not support -4\"));\n \t\tcase VARIANT_SSH:\n \t\tcase VARIANT_PLINK:\n \t\tcase VARIANT_PUTTY:\n@@ -1131,7 +1135,7 @@ static void push_ssh_options(struct argv_array *args, struct argv_array *env,\n \t\tcase VARIANT_AUTO:\n \t\t\tBUG(\"VARIANT_AUTO passed to push_ssh_options\");\n \t\tcase VARIANT_SIMPLE:\n-\t\t\tdie(\"ssh variant 'simple' does not support -6\");\n+\t\t\tdie(_(\"ssh variant 'simple' does not support -6\"));\n \t\tcase VARIANT_SSH:\n \t\tcase VARIANT_PLINK:\n \t\tcase VARIANT_PUTTY:\n@@ -1148,7 +1152,7 @@ static void push_ssh_options(struct argv_array *args, struct argv_array *env,\n \t\tcase VARIANT_AUTO:\n \t\t\tBUG(\"VARIANT_AUTO passed to push_ssh_options\");\n \t\tcase VARIANT_SIMPLE:\n-\t\t\tdie(\"ssh variant 'simple' does not support setting port\");\n+\t\t\tdie(_(\"ssh variant 'simple' does not support setting port\"));\n \t\tcase VARIANT_SSH:\n \t\t\targv_array_push(args, \"-p\");\n \t\t\tbreak;\n@@ -1171,7 +1175,7 @@ static void fill_ssh_args(struct child_process *conn, const char *ssh_host,\n \tenum ssh_variant variant;\n \n \tif (looks_like_command_line_option(ssh_host))\n-\t\tdie(\"strange hostname '%s' blocked\", ssh_host);\n+\t\tdie(_(\"strange hostname '%s' blocked\"), ssh_host);\n \n \tssh = get_ssh_command();\n \tif (ssh) {\n@@ -1259,7 +1263,7 @@ struct child_process *git_connect(int fd[2], const char *url,\n \t\tchild_process_init(conn);\n \n \t\tif (looks_like_command_line_option(path))\n-\t\t\tdie(\"strange pathname '%s' blocked\", path);\n+\t\t\tdie(_(\"strange pathname '%s' blocked\"), path);\n \n \t\tstrbuf_addstr(&cmd, prog);\n \t\tstrbuf_addch(&cmd, ' ');\n@@ -1304,7 +1308,7 @@ struct child_process *git_connect(int fd[2], const char *url,\n \t\targv_array_push(&conn->args, cmd.buf);\n \n \t\tif (start_command(conn))\n-\t\t\tdie(\"unable to fork\");\n+\t\t\tdie(_(\"unable to fork\"));\n \n \t\tfd[0] = conn->out; /* read from child's stdout */\n \t\tfd[1] = conn->in;  /* write to child's stdin */\ndiff --git a/t/t5570-git-daemon.sh b/t/t5570-git-daemon.sh\nindex 0d4c52016b..a571f22bfd 100755\n--- a/t/t5570-git-daemon.sh\n+++ b/t/t5570-git-daemon.sh\n@@ -7,9 +7,9 @@ test_description='test fetching over git protocol'\n start_git_daemon\n \n check_verbose_connect () {\n-\tgrep -F \"Looking up 127.0.0.1 ...\" stderr &&\n-\tgrep -F \"Connecting to 127.0.0.1 (port \" stderr &&\n-\tgrep -F \"done.\" stderr\n+\ttest_i18ngrep -F \"Looking up 127.0.0.1 ...\" stderr &&\n+\ttest_i18ngrep -F \"Connecting to 127.0.0.1 (port \" stderr &&\n+\ttest_i18ngrep -F \"done.\" stderr\n }\n \n test_expect_success 'setup repository' '\n-- \n2.18.0.rc2.476.g39500d3211\n\n"},{"id":"351431","messageId":"20180630090818.28937-10-pclouds@gmail.com","threadId":"48805","inReplyTo":"20180630090818.28937-1-pclouds@gmail.com","subject":"[PATCH 09/23] config.c: mark more strings for translation","fromName":"Nguyễn Thái Ngọc Duy","fromEmail":"pclouds@gmail.com","sentAt":"2018-06-30T09:08:04Z","receivedAt":"2018-06-30T09:09:37Z","isPatch":true,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>\n---\n config.c                  | 76 +++++++++++++++++++--------------------\n t/t1305-config-include.sh |  2 +-\n 2 files changed, 39 insertions(+), 39 deletions(-)\n\ndiff --git a/config.c b/config.c\nindex bb2e30fe3d..58d076e833 100644\n--- a/config.c\n+++ b/config.c\n@@ -116,12 +116,12 @@ static long config_buf_ftell(struct config_source *conf)\n }\n \n #define MAX_INCLUDE_DEPTH 10\n-static const char include_depth_advice[] =\n+static const char include_depth_advice[] = N_(\n \"exceeded maximum include depth (%d) while including\\n\"\n \"\t%s\\n\"\n \"from\\n\"\n \"\t%s\\n\"\n-\"Do you have circular includes?\";\n+\"Do you have circular includes?\");\n static int handle_path_include(const char *path, struct config_include_data *inc)\n {\n \tint ret = 0;\n@@ -133,7 +133,7 @@ static int handle_path_include(const char *path, struct config_include_data *inc\n \n \texpanded = expand_user_path(path, 0);\n \tif (!expanded)\n-\t\treturn error(\"could not expand include path '%s'\", path);\n+\t\treturn error(_(\"could not expand include path '%s'\"), path);\n \tpath = expanded;\n \n \t/*\n@@ -144,7 +144,7 @@ static int handle_path_include(const char *path, struct config_include_data *inc\n \t\tchar *slash;\n \n \t\tif (!cf || !cf->path)\n-\t\t\treturn error(\"relative config includes must come from files\");\n+\t\t\treturn error(_(\"relative config includes must come from files\"));\n \n \t\tslash = find_last_dir_sep(cf->path);\n \t\tif (slash)\n@@ -155,7 +155,7 @@ static int handle_path_include(const char *path, struct config_include_data *inc\n \n \tif (!access_or_die(path, R_OK, 0)) {\n \t\tif (++inc->depth > MAX_INCLUDE_DEPTH)\n-\t\t\tdie(include_depth_advice, MAX_INCLUDE_DEPTH, path,\n+\t\t\tdie(_(include_depth_advice), MAX_INCLUDE_DEPTH, path,\n \t\t\t    !cf ? \"<unknown>\" :\n \t\t\t    cf->name ? cf->name :\n \t\t\t    \"the command line\");\n@@ -342,13 +342,13 @@ static int git_config_parse_key_1(const char *key, char **store_key, int *basele\n \n \tif (last_dot == NULL || last_dot == key) {\n \t\tif (!quiet)\n-\t\t\terror(\"key does not contain a section: %s\", key);\n+\t\t\terror(_(\"key does not contain a section: %s\"), key);\n \t\treturn -CONFIG_NO_SECTION_OR_NAME;\n \t}\n \n \tif (!last_dot[1]) {\n \t\tif (!quiet)\n-\t\t\terror(\"key does not contain variable name: %s\", key);\n+\t\t\terror(_(\"key does not contain variable name: %s\"), key);\n \t\treturn -CONFIG_NO_SECTION_OR_NAME;\n \t}\n \n@@ -372,13 +372,13 @@ static int git_config_parse_key_1(const char *key, char **store_key, int *basele\n \t\t\tif (!iskeychar(c) ||\n \t\t\t    (i == baselen + 1 && !isalpha(c))) {\n \t\t\t\tif (!quiet)\n-\t\t\t\t\terror(\"invalid key: %s\", key);\n+\t\t\t\t\terror(_(\"invalid key: %s\"), key);\n \t\t\t\tgoto out_free_ret_1;\n \t\t\t}\n \t\t\tc = tolower(c);\n \t\t} else if (c == '\\n') {\n \t\t\tif (!quiet)\n-\t\t\t\terror(\"invalid key (newline): %s\", key);\n+\t\t\t\terror(_(\"invalid key (newline): %s\"), key);\n \t\t\tgoto out_free_ret_1;\n \t\t}\n \t\tif (store_key)\n@@ -414,7 +414,7 @@ int git_config_parse_parameter(const char *text,\n \n \tpair = strbuf_split_str(text, '=', 2);\n \tif (!pair[0])\n-\t\treturn error(\"bogus config parameter: %s\", text);\n+\t\treturn error(_(\"bogus config parameter: %s\"), text);\n \n \tif (pair[0]->len && pair[0]->buf[pair[0]->len - 1] == '=') {\n \t\tstrbuf_setlen(pair[0], pair[0]->len - 1);\n@@ -426,7 +426,7 @@ int git_config_parse_parameter(const char *text,\n \tstrbuf_trim(pair[0]);\n \tif (!pair[0]->len) {\n \t\tstrbuf_list_free(pair);\n-\t\treturn error(\"bogus config parameter: %s\", text);\n+\t\treturn error(_(\"bogus config parameter: %s\"), text);\n \t}\n \n \tif (git_config_parse_key(pair[0]->buf, &canonical_name, NULL)) {\n@@ -461,7 +461,7 @@ int git_config_from_parameters(config_fn_t fn, void *data)\n \tenvw = xstrdup(env);\n \n \tif (sq_dequote_to_argv(envw, &argv, &nr, &alloc) < 0) {\n-\t\tret = error(\"bogus format in %s\", CONFIG_DATA_ENVIRONMENT);\n+\t\tret = error(_(\"bogus format in %s\"), CONFIG_DATA_ENVIRONMENT);\n \t\tgoto out;\n \t}\n \n@@ -1154,7 +1154,7 @@ static int git_default_core_config(const char *var, const char *value)\n \t\telse {\n \t\t\tint abbrev = git_config_int(var, value);\n \t\t\tif (abbrev < minimum_abbrev || abbrev > 40)\n-\t\t\t\treturn error(\"abbrev length out of range: %d\", abbrev);\n+\t\t\t\treturn error(_(\"abbrev length out of range: %d\"), abbrev);\n \t\t\tdefault_abbrev = abbrev;\n \t\t}\n \t\treturn 0;\n@@ -1271,7 +1271,7 @@ static int git_default_core_config(const char *var, const char *value)\n \t\t\tcomment_line_char = value[0];\n \t\t\tauto_comment_line_char = 0;\n \t\t} else\n-\t\t\treturn error(\"core.commentChar should only be one character\");\n+\t\t\treturn error(_(\"core.commentChar should only be one character\"));\n \t\treturn 0;\n \t}\n \n@@ -1384,7 +1384,7 @@ static int git_default_branch_config(const char *var, const char *value)\n \t\telse if (!strcmp(value, \"always\"))\n \t\t\tautorebase = AUTOREBASE_ALWAYS;\n \t\telse\n-\t\t\treturn error(\"malformed value for %s\", var);\n+\t\t\treturn error(_(\"malformed value for %s\"), var);\n \t\treturn 0;\n \t}\n \n@@ -1409,11 +1409,11 @@ static int git_default_push_config(const char *var, const char *value)\n \t\t\tpush_default = PUSH_DEFAULT_UPSTREAM;\n \t\telse if (!strcmp(value, \"current\"))\n \t\t\tpush_default = PUSH_DEFAULT_CURRENT;\n-\t\telse {\n-\t\t\terror(\"malformed value for %s: %s\", var, value);\n-\t\t\treturn error(\"Must be one of nothing, matching, simple, \"\n-\t\t\t\t     \"upstream or current.\");\n-\t\t}\n+\t\telse\n+\t\t\treturn error(_(\"malformed value for %s: %s\\n\"\n+\t\t\t\t       \"Must be one of nothing, matching, simple, \"\n+\t\t\t\t       \"upstream or current.\"),\n+\t\t\t\t     var, value);\n \t\treturn 0;\n \t}\n \n@@ -1589,10 +1589,10 @@ int git_config_from_blob_oid(config_fn_t fn,\n \n \tbuf = read_object_file(oid, &type, &size);\n \tif (!buf)\n-\t\treturn error(\"unable to load config blob object '%s'\", name);\n+\t\treturn error(_(\"unable to load config blob object '%s'\"), name);\n \tif (type != OBJ_BLOB) {\n \t\tfree(buf);\n-\t\treturn error(\"reference '%s' does not point to a blob\", name);\n+\t\treturn error(_(\"reference '%s' does not point to a blob\"), name);\n \t}\n \n \tret = git_config_from_mem(fn, CONFIG_ORIGIN_BLOB, name, buf, size, data);\n@@ -1608,7 +1608,7 @@ static int git_config_from_blob_ref(config_fn_t fn,\n \tstruct object_id oid;\n \n \tif (get_oid(name, &oid) < 0)\n-\t\treturn error(\"unable to resolve config blob '%s'\", name);\n+\t\treturn error(_(\"unable to resolve config blob '%s'\"), name);\n \treturn git_config_from_blob_oid(fn, name, &oid, data);\n }\n \n@@ -1638,7 +1638,7 @@ unsigned long git_env_ulong(const char *k, unsigned long val)\n {\n \tconst char *v = getenv(k);\n \tif (v && !git_parse_ulong(v, &val))\n-\t\tdie(\"failed to parse %s\", k);\n+\t\tdie(_(\"failed to parse %s\"), k);\n \treturn val;\n }\n \n@@ -2372,7 +2372,7 @@ static int store_aux_event(enum config_event_t type,\n \n \tif (type == CONFIG_EVENT_SECTION) {\n \t\tif (cf->var.len < 2 || cf->var.buf[cf->var.len - 1] != '.')\n-\t\t\treturn error(\"invalid section name '%s'\", cf->var.buf);\n+\t\t\treturn error(_(\"invalid section name '%s'\"), cf->var.buf);\n \n \t\t/* Is this the section we were looking for? */\n \t\tstore->is_keys_section =\n@@ -2428,7 +2428,7 @@ static int store_aux(const char *key, const char *value, void *cb)\n \n static int write_error(const char *filename)\n {\n-\terror(\"failed to write new configuration file %s\", filename);\n+\terror(_(\"failed to write new configuration file %s\"), filename);\n \n \t/* Same error code as \"failed to rename\". */\n \treturn 4;\n@@ -2679,7 +2679,7 @@ int git_config_set_multivar_in_file_gently(const char *config_filename,\n \t */\n \tfd = hold_lock_file_for_update(&lock, config_filename, 0);\n \tif (fd < 0) {\n-\t\terror_errno(\"could not lock config file %s\", config_filename);\n+\t\terror_errno(_(\"could not lock config file %s\"), config_filename);\n \t\tret = CONFIG_NO_LOCK;\n \t\tgoto out_free;\n \t}\n@@ -2690,7 +2690,7 @@ int git_config_set_multivar_in_file_gently(const char *config_filename,\n \tin_fd = open(config_filename, O_RDONLY);\n \tif ( in_fd < 0 ) {\n \t\tif ( ENOENT != errno ) {\n-\t\t\terror_errno(\"opening %s\", config_filename);\n+\t\t\terror_errno(_(\"opening %s\"), config_filename);\n \t\t\tret = CONFIG_INVALID_FILE; /* same as \"invalid config file\" */\n \t\t\tgoto out_free;\n \t\t}\n@@ -2725,7 +2725,7 @@ int git_config_set_multivar_in_file_gently(const char *config_filename,\n \t\t\tstore.value_regex = (regex_t*)xmalloc(sizeof(regex_t));\n \t\t\tif (regcomp(store.value_regex, value_regex,\n \t\t\t\t\tREG_EXTENDED)) {\n-\t\t\t\terror(\"invalid pattern: %s\", value_regex);\n+\t\t\t\terror(_(\"invalid pattern: %s\"), value_regex);\n \t\t\t\tFREE_AND_NULL(store.value_regex);\n \t\t\t\tret = CONFIG_INVALID_PATTERN;\n \t\t\t\tgoto out_free;\n@@ -2750,7 +2750,7 @@ int git_config_set_multivar_in_file_gently(const char *config_filename,\n \t\tif (git_config_from_file_with_options(store_aux,\n \t\t\t\t\t\t      config_filename,\n \t\t\t\t\t\t      &store, &opts)) {\n-\t\t\terror(\"invalid config file %s\", config_filename);\n+\t\t\terror(_(\"invalid config file %s\"), config_filename);\n \t\t\tret = CONFIG_INVALID_FILE;\n \t\t\tgoto out_free;\n \t\t}\n@@ -2774,7 +2774,7 @@ int git_config_set_multivar_in_file_gently(const char *config_filename,\n \t\tif (contents == MAP_FAILED) {\n \t\t\tif (errno == ENODEV && S_ISDIR(st.st_mode))\n \t\t\t\terrno = EISDIR;\n-\t\t\terror_errno(\"unable to mmap '%s'\", config_filename);\n+\t\t\terror_errno(_(\"unable to mmap '%s'\"), config_filename);\n \t\t\tret = CONFIG_INVALID_FILE;\n \t\t\tcontents = NULL;\n \t\t\tgoto out_free;\n@@ -2783,7 +2783,7 @@ int git_config_set_multivar_in_file_gently(const char *config_filename,\n \t\tin_fd = -1;\n \n \t\tif (chmod(get_lock_file_path(&lock), st.st_mode & 07777) < 0) {\n-\t\t\terror_errno(\"chmod on %s failed\", get_lock_file_path(&lock));\n+\t\t\terror_errno(_(\"chmod on %s failed\"), get_lock_file_path(&lock));\n \t\t\tret = CONFIG_NO_WRITE;\n \t\t\tgoto out_free;\n \t\t}\n@@ -2868,7 +2868,7 @@ int git_config_set_multivar_in_file_gently(const char *config_filename,\n \t}\n \n \tif (commit_lock_file(&lock) < 0) {\n-\t\terror_errno(\"could not write config file %s\", config_filename);\n+\t\terror_errno(_(\"could not write config file %s\"), config_filename);\n \t\tret = CONFIG_NO_WRITE;\n \t\tgoto out_free;\n \t}\n@@ -2994,7 +2994,7 @@ static int git_config_copy_or_rename_section_in_file(const char *config_filename\n \tmemset(&store, 0, sizeof(store));\n \n \tif (new_name && !section_name_is_ok(new_name)) {\n-\t\tret = error(\"invalid section name: %s\", new_name);\n+\t\tret = error(_(\"invalid section name: %s\"), new_name);\n \t\tgoto out_no_rollback;\n \t}\n \n@@ -3003,7 +3003,7 @@ static int git_config_copy_or_rename_section_in_file(const char *config_filename\n \n \tout_fd = hold_lock_file_for_update(&lock, config_filename, 0);\n \tif (out_fd < 0) {\n-\t\tret = error(\"could not lock config file %s\", config_filename);\n+\t\tret = error(_(\"could not lock config file %s\"), config_filename);\n \t\tgoto out;\n \t}\n \n@@ -3021,7 +3021,7 @@ static int git_config_copy_or_rename_section_in_file(const char *config_filename\n \t}\n \n \tif (chmod(get_lock_file_path(&lock), st.st_mode & 07777) < 0) {\n-\t\tret = error_errno(\"chmod on %s failed\",\n+\t\tret = error_errno(_(\"chmod on %s failed\"),\n \t\t\t\t  get_lock_file_path(&lock));\n \t\tgoto out;\n \t}\n@@ -3118,7 +3118,7 @@ static int git_config_copy_or_rename_section_in_file(const char *config_filename\n \tconfig_file = NULL;\n commit_and_out:\n \tif (commit_lock_file(&lock) < 0)\n-\t\tret = error_errno(\"could not write config file %s\",\n+\t\tret = error_errno(_(\"could not write config file %s\"),\n \t\t\t\t  config_filename);\n out:\n \tif (config_file)\n@@ -3161,7 +3161,7 @@ int git_config_copy_section(const char *old_name, const char *new_name)\n #undef config_error_nonbool\n int config_error_nonbool(const char *var)\n {\n-\treturn error(\"missing value for '%s'\", var);\n+\treturn error(_(\"missing value for '%s'\"), var);\n }\n \n int parse_config_key(const char *var,\ndiff --git a/t/t1305-config-include.sh b/t/t1305-config-include.sh\nindex f035ee40a3..635918505d 100755\n--- a/t/t1305-config-include.sh\n+++ b/t/t1305-config-include.sh\n@@ -310,7 +310,7 @@ test_expect_success 'include cycles are detected' '\n \tcycle\n \tEOF\n \ttest_must_fail git config --get-all test.value 2>stderr &&\n-\tgrep \"exceeded maximum include depth\" stderr\n+\ttest_i18ngrep \"exceeded maximum include depth\" stderr\n '\n \n test_done\n-- \n2.18.0.rc2.476.g39500d3211\n\n"},{"id":"351432","messageId":"20180630090818.28937-21-pclouds@gmail.com","threadId":"48805","inReplyTo":"20180630090818.28937-1-pclouds@gmail.com","subject":"[PATCH 20/23] sequencer.c: mark more strings for translation","fromName":"Nguyễn Thái Ngọc Duy","fromEmail":"pclouds@gmail.com","sentAt":"2018-06-30T09:08:15Z","receivedAt":"2018-06-30T09:09:39Z","isPatch":true,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>\n---\n sequencer.c | 26 ++++++++++++++------------\n 1 file changed, 14 insertions(+), 12 deletions(-)\n\ndiff --git a/sequencer.c b/sequencer.c\nindex 6b6162d194..f7c2f2422d 100644\n--- a/sequencer.c\n+++ b/sequencer.c\n@@ -716,7 +716,7 @@ static const char *read_author_ident(struct strbuf *buf)\n \t/* dequote values and construct ident line in-place */\n \tfor (in = out = buf->buf; i < 3 && in - buf->buf < buf->len; i++) {\n \t\tif (!skip_prefix(in, keys[i], (const char **)&in)) {\n-\t\t\twarning(\"could not parse '%s' (looking for '%s'\",\n+\t\t\twarning(_(\"could not parse '%s' (looking for '%s'\"),\n \t\t\t\trebase_path_author_script(), keys[i]);\n \t\t\treturn NULL;\n \t\t}\n@@ -738,7 +738,7 @@ static const char *read_author_ident(struct strbuf *buf)\n \t}\n \n \tif (i < 3) {\n-\t\twarning(\"could not parse '%s' (looking for '%s')\",\n+\t\twarning(_(\"could not parse '%s' (looking for '%s')\"),\n \t\t\trebase_path_author_script(), keys[i]);\n \t\treturn NULL;\n \t}\n@@ -1444,7 +1444,7 @@ static const char *command_to_string(const enum todo_command command)\n {\n \tif (command < TODO_COMMENT)\n \t\treturn todo_command_info[command].str;\n-\tdie(\"unknown command: %d\", command);\n+\tdie(_(\"unknown command: %d\"), command);\n }\n \n static char command_to_char(const enum todo_command command)\n@@ -2600,15 +2600,17 @@ static int error_with_patch(struct commit *commit,\n \t\tif (intend_to_amend())\n \t\t\treturn -1;\n \n-\t\tfprintf(stderr, \"You can amend the commit now, with\\n\"\n-\t\t\t\"\\n\"\n-\t\t\t\"  git commit --amend %s\\n\"\n-\t\t\t\"\\n\"\n-\t\t\t\"Once you are satisfied with your changes, run\\n\"\n-\t\t\t\"\\n\"\n-\t\t\t\"  git rebase --continue\\n\", gpg_sign_opt_quoted(opts));\n+\t\tfprintf(stderr,\n+\t\t\t_(\"You can amend the commit now, with\\n\"\n+\t\t\t  \"\\n\"\n+\t\t\t  \"  git commit --amend %s\\n\"\n+\t\t\t  \"\\n\"\n+\t\t\t  \"Once you are satisfied with your changes, run\\n\"\n+\t\t\t  \"\\n\"\n+\t\t\t  \"  git rebase --continue\\n\"),\n+\t\t\tgpg_sign_opt_quoted(opts));\n \t} else if (exit_code)\n-\t\tfprintf_ln(stderr, \"Could not apply %s... %.*s\",\n+\t\tfprintf_ln(stderr, _(\"Could not apply %s... %.*s\"),\n \t\t\tshort_commit_name(commit), subject_len, subject);\n \n \treturn exit_code;\n@@ -2719,7 +2721,7 @@ static int do_label(const char *name, int len)\n \tstruct object_id head_oid;\n \n \tif (len == 1 && *name == '#')\n-\t\treturn error(\"illegal label name: '%.*s'\", len, name);\n+\t\treturn error(_(\"illegal label name: '%.*s'\"), len, name);\n \n \tstrbuf_addf(&ref_name, \"refs/rewritten/%.*s\", len, name);\n \tstrbuf_addf(&msg, \"rebase -i (label) '%.*s'\", len, name);\n-- \n2.18.0.rc2.476.g39500d3211\n\n"},{"id":"351433","messageId":"20180630090818.28937-22-pclouds@gmail.com","threadId":"48805","inReplyTo":"20180630090818.28937-1-pclouds@gmail.com","subject":"[PATCH 21/23] sha1-file.c: mark more strings for translation","fromName":"Nguyễn Thái Ngọc Duy","fromEmail":"pclouds@gmail.com","sentAt":"2018-06-30T09:08:16Z","receivedAt":"2018-06-30T09:09:49Z","isPatch":true,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>\n---\n sha1-file.c | 104 ++++++++++++++++++++++++++--------------------------\n 1 file changed, 52 insertions(+), 52 deletions(-)\n\ndiff --git a/sha1-file.c b/sha1-file.c\nindex ed7ac73fa9..92c27583db 100644\n--- a/sha1-file.c\n+++ b/sha1-file.c\n@@ -378,8 +378,8 @@ static int alt_odb_usable(struct raw_object_store *o,\n \n \t/* Detect cases where alternate disappeared */\n \tif (!is_directory(path->buf)) {\n-\t\terror(\"object directory %s does not exist; \"\n-\t\t      \"check .git/objects/info/alternates\",\n+\t\terror(_(\"object directory %s does not exist; \"\n+\t\t\t\"check .git/objects/info/alternates\"),\n \t\t      path->buf);\n \t\treturn 0;\n \t}\n@@ -429,7 +429,7 @@ static int link_alt_odb_entry(struct repository *r, const char *entry,\n \tstrbuf_addstr(&pathbuf, entry);\n \n \tif (strbuf_normalize_path(&pathbuf) < 0 && relative_base) {\n-\t\terror(\"unable to normalize alternate object path: %s\",\n+\t\terror(_(\"unable to normalize alternate object path: %s\"),\n \t\t      pathbuf.buf);\n \t\tstrbuf_release(&pathbuf);\n \t\treturn -1;\n@@ -500,14 +500,14 @@ static void link_alt_odb_entries(struct repository *r, const char *alt,\n \t\treturn;\n \n \tif (depth > 5) {\n-\t\terror(\"%s: ignoring alternate object stores, nesting too deep.\",\n+\t\terror(_(\"%s: ignoring alternate object stores, nesting too deep\"),\n \t\t\t\trelative_base);\n \t\treturn;\n \t}\n \n \tstrbuf_add_absolute_path(&objdirbuf, r->objects->objectdir);\n \tif (strbuf_normalize_path(&objdirbuf) < 0)\n-\t\tdie(\"unable to normalize object directory: %s\",\n+\t\tdie(_(\"unable to normalize object directory: %s\"),\n \t\t    objdirbuf.buf);\n \n \twhile (*alt) {\n@@ -562,7 +562,7 @@ void add_to_alternates_file(const char *reference)\n \thold_lock_file_for_update(&lock, alts, LOCK_DIE_ON_ERROR);\n \tout = fdopen_lock_file(&lock, \"w\");\n \tif (!out)\n-\t\tdie_errno(\"unable to fdopen alternates lockfile\");\n+\t\tdie_errno(_(\"unable to fdopen alternates lockfile\"));\n \n \tin = fopen(alts, \"r\");\n \tif (in) {\n@@ -580,14 +580,14 @@ void add_to_alternates_file(const char *reference)\n \t\tfclose(in);\n \t}\n \telse if (errno != ENOENT)\n-\t\tdie_errno(\"unable to read alternates file\");\n+\t\tdie_errno(_(\"unable to read alternates file\"));\n \n \tif (found) {\n \t\trollback_lock_file(&lock);\n \t} else {\n \t\tfprintf_or_die(out, \"%s\\n\", reference);\n \t\tif (commit_lock_file(&lock))\n-\t\t\tdie_errno(\"unable to move new alternates file into place\");\n+\t\t\tdie_errno(_(\"unable to move new alternates file into place\"));\n \t\tif (the_repository->objects->alt_odb_tail)\n \t\t\tlink_alt_odb_entries(the_repository, reference,\n \t\t\t\t\t     '\\n', NULL, 0);\n@@ -778,7 +778,7 @@ static void mmap_limit_check(size_t length)\n \t\t\tlimit = SIZE_MAX;\n \t}\n \tif (length > limit)\n-\t\tdie(\"attempting to mmap %\"PRIuMAX\" over limit %\"PRIuMAX,\n+\t\tdie(_(\"attempting to mmap %\"PRIuMAX\" over limit %\"PRIuMAX),\n \t\t    (uintmax_t)length, (uintmax_t)limit);\n }\n \n@@ -803,7 +803,7 @@ void *xmmap(void *start, size_t length,\n {\n \tvoid *ret = xmmap_gently(start, length, prot, flags, fd, offset);\n \tif (ret == MAP_FAILED)\n-\t\tdie_errno(\"mmap failed\");\n+\t\tdie_errno(_(\"mmap failed\"));\n \treturn ret;\n }\n \n@@ -970,7 +970,7 @@ static void *map_sha1_file_1(struct repository *r, const char *path,\n \t\t\t*size = xsize_t(st.st_size);\n \t\t\tif (!*size) {\n \t\t\t\t/* mmap() is forbidden on empty files */\n-\t\t\t\terror(\"object file %s is empty\", path);\n+\t\t\t\terror(_(\"object file %s is empty\"), path);\n \t\t\t\treturn NULL;\n \t\t\t}\n \t\t\tmap = xmmap(NULL, *size, PROT_READ, MAP_PRIVATE, fd, 0);\n@@ -1090,9 +1090,9 @@ static void *unpack_sha1_rest(git_zstream *stream, void *buffer, unsigned long s\n \t}\n \n \tif (status < 0)\n-\t\terror(\"corrupt loose object '%s'\", sha1_to_hex(sha1));\n+\t\terror(_(\"corrupt loose object '%s'\"), sha1_to_hex(sha1));\n \telse if (stream->avail_in)\n-\t\terror(\"garbage at end of loose object '%s'\",\n+\t\terror(_(\"garbage at end of loose object '%s'\"),\n \t\t      sha1_to_hex(sha1));\n \tfree(buf);\n \treturn NULL;\n@@ -1134,7 +1134,7 @@ static int parse_sha1_header_extended(const char *hdr, struct object_info *oi,\n \tif ((flags & OBJECT_INFO_ALLOW_UNKNOWN_TYPE) && (type < 0))\n \t\ttype = 0;\n \telse if (type < 0)\n-\t\tdie(\"invalid object type\");\n+\t\tdie(_(\"invalid object type\"));\n \tif (oi->typep)\n \t\t*oi->typep = type;\n \n@@ -1216,19 +1216,19 @@ static int sha1_loose_object_info(struct repository *r,\n \t\t*oi->disk_sizep = mapsize;\n \tif ((flags & OBJECT_INFO_ALLOW_UNKNOWN_TYPE)) {\n \t\tif (unpack_sha1_header_to_strbuf(&stream, map, mapsize, hdr, sizeof(hdr), &hdrbuf) < 0)\n-\t\t\tstatus = error(\"unable to unpack %s header with --allow-unknown-type\",\n+\t\t\tstatus = error(_(\"unable to unpack %s header with --allow-unknown-type\"),\n \t\t\t\t       sha1_to_hex(sha1));\n \t} else if (unpack_sha1_header(&stream, map, mapsize, hdr, sizeof(hdr)) < 0)\n-\t\tstatus = error(\"unable to unpack %s header\",\n+\t\tstatus = error(_(\"unable to unpack %s header\"),\n \t\t\t       sha1_to_hex(sha1));\n \tif (status < 0)\n \t\t; /* Do nothing */\n \telse if (hdrbuf.len) {\n \t\tif ((status = parse_sha1_header_extended(hdrbuf.buf, oi, flags)) < 0)\n-\t\t\tstatus = error(\"unable to parse %s header with --allow-unknown-type\",\n+\t\t\tstatus = error(_(\"unable to parse %s header with --allow-unknown-type\"),\n \t\t\t\t       sha1_to_hex(sha1));\n \t} else if ((status = parse_sha1_header_extended(hdr, oi, flags)) < 0)\n-\t\tstatus = error(\"unable to parse %s header\", sha1_to_hex(sha1));\n+\t\tstatus = error(_(\"unable to parse %s header\"), sha1_to_hex(sha1));\n \n \tif (status >= 0 && oi->contentp) {\n \t\t*oi->contentp = unpack_sha1_rest(&stream, hdr,\n@@ -1419,19 +1419,19 @@ void *read_object_file_extended(const struct object_id *oid,\n \t\treturn data;\n \n \tif (errno && errno != ENOENT)\n-\t\tdie_errno(\"failed to read object %s\", oid_to_hex(oid));\n+\t\tdie_errno(_(\"failed to read object %s\"), oid_to_hex(oid));\n \n \t/* die if we replaced an object with one that does not exist */\n \tif (repl != oid)\n-\t\tdie(\"replacement %s not found for %s\",\n+\t\tdie(_(\"replacement %s not found for %s\"),\n \t\t    oid_to_hex(repl), oid_to_hex(oid));\n \n \tif (!stat_sha1_file(the_repository, repl->hash, &st, &path))\n-\t\tdie(\"loose object %s (stored in %s) is corrupt\",\n+\t\tdie(_(\"loose object %s (stored in %s) is corrupt\"),\n \t\t    oid_to_hex(repl), path);\n \n \tif ((p = has_packed_and_bad(repl->hash)) != NULL)\n-\t\tdie(\"packed object %s (stored in %s) is corrupt\",\n+\t\tdie(_(\"packed object %s (stored in %s) is corrupt\"),\n \t\t    oid_to_hex(repl), p->pack_name);\n \n \treturn NULL;\n@@ -1533,21 +1533,21 @@ int finalize_object_file(const char *tmpfile, const char *filename)\n \tunlink_or_warn(tmpfile);\n \tif (ret) {\n \t\tif (ret != EEXIST) {\n-\t\t\treturn error_errno(\"unable to write sha1 filename %s\", filename);\n+\t\t\treturn error_errno(_(\"unable to write sha1 filename %s\"), filename);\n \t\t}\n \t\t/* FIXME!!! Collision check here ? */\n \t}\n \n out:\n \tif (adjust_shared_perm(filename))\n-\t\treturn error(\"unable to set permission to '%s'\", filename);\n+\t\treturn error(_(\"unable to set permission to '%s'\"), filename);\n \treturn 0;\n }\n \n static int write_buffer(int fd, const void *buf, size_t len)\n {\n \tif (write_in_full(fd, buf, len) < 0)\n-\t\treturn error_errno(\"file write error\");\n+\t\treturn error_errno(_(\"file write error\"));\n \treturn 0;\n }\n \n@@ -1566,7 +1566,7 @@ static void close_sha1_file(int fd)\n \tif (fsync_object_files)\n \t\tfsync_or_die(fd, \"sha1 file\");\n \tif (close(fd) != 0)\n-\t\tdie_errno(\"error when closing sha1 file\");\n+\t\tdie_errno(_(\"error when closing sha1 file\"));\n }\n \n /* Size of directory component, including the ending '/' */\n@@ -1632,9 +1632,9 @@ static int write_loose_object(const struct object_id *oid, char *hdr,\n \tfd = create_tmpfile(&tmp_file, filename.buf);\n \tif (fd < 0) {\n \t\tif (errno == EACCES)\n-\t\t\treturn error(\"insufficient permission for adding an object to repository database %s\", get_object_directory());\n+\t\t\treturn error(_(\"insufficient permission for adding an object to repository database %s\"), get_object_directory());\n \t\telse\n-\t\t\treturn error_errno(\"unable to create temporary file\");\n+\t\t\treturn error_errno(_(\"unable to create temporary file\"));\n \t}\n \n \t/* Set it up */\n@@ -1658,21 +1658,21 @@ static int write_loose_object(const struct object_id *oid, char *hdr,\n \t\tret = git_deflate(&stream, Z_FINISH);\n \t\tthe_hash_algo->update_fn(&c, in0, stream.next_in - in0);\n \t\tif (write_buffer(fd, compressed, stream.next_out - compressed) < 0)\n-\t\t\tdie(\"unable to write sha1 file\");\n+\t\t\tdie(_(\"unable to write sha1 file\"));\n \t\tstream.next_out = compressed;\n \t\tstream.avail_out = sizeof(compressed);\n \t} while (ret == Z_OK);\n \n \tif (ret != Z_STREAM_END)\n-\t\tdie(\"unable to deflate new object %s (%d)\", oid_to_hex(oid),\n+\t\tdie(_(\"unable to deflate new object %s (%d)\"), oid_to_hex(oid),\n \t\t    ret);\n \tret = git_deflate_end_gently(&stream);\n \tif (ret != Z_OK)\n-\t\tdie(\"deflateEnd on object %s failed (%d)\", oid_to_hex(oid),\n+\t\tdie(_(\"deflateEnd on object %s failed (%d)\"), oid_to_hex(oid),\n \t\t    ret);\n \tthe_hash_algo->final_fn(parano_oid.hash, &c);\n \tif (oidcmp(oid, &parano_oid) != 0)\n-\t\tdie(\"confused by unstable object source data for %s\",\n+\t\tdie(_(\"confused by unstable object source data for %s\"),\n \t\t    oid_to_hex(oid));\n \n \tclose_sha1_file(fd);\n@@ -1682,7 +1682,7 @@ static int write_loose_object(const struct object_id *oid, char *hdr,\n \t\tutb.actime = mtime;\n \t\tutb.modtime = mtime;\n \t\tif (utime(tmp_file.buf, &utb) < 0)\n-\t\t\twarning_errno(\"failed utime() on %s\", tmp_file.buf);\n+\t\t\twarning_errno(_(\"failed utime() on %s\"), tmp_file.buf);\n \t}\n \n \treturn finalize_object_file(tmp_file.buf, filename.buf);\n@@ -1757,7 +1757,7 @@ int force_object_loose(const struct object_id *oid, time_t mtime)\n \t\treturn 0;\n \tbuf = read_object(oid->hash, &type, &len);\n \tif (!buf)\n-\t\treturn error(\"cannot read sha1_file for %s\", oid_to_hex(oid));\n+\t\treturn error(_(\"cannot read sha1_file for %s\"), oid_to_hex(oid));\n \thdrlen = xsnprintf(hdr, sizeof(hdr), \"%s %lu\", type_name(type), len) + 1;\n \tret = write_loose_object(oid, hdr, hdrlen, buf, len, mtime);\n \tfree(buf);\n@@ -1802,7 +1802,7 @@ static void check_commit(const void *buf, size_t size)\n \tstruct commit c;\n \tmemset(&c, 0, sizeof(c));\n \tif (parse_commit_buffer(&c, buf, size, 0))\n-\t\tdie(\"corrupt commit\");\n+\t\tdie(_(\"corrupt commit\"));\n }\n \n static void check_tag(const void *buf, size_t size)\n@@ -1810,7 +1810,7 @@ static void check_tag(const void *buf, size_t size)\n \tstruct tag t;\n \tmemset(&t, 0, sizeof(t));\n \tif (parse_tag_buffer(&t, buf, size))\n-\t\tdie(\"corrupt tag\");\n+\t\tdie(_(\"corrupt tag\"));\n }\n \n static int index_mem(struct object_id *oid, void *buf, size_t size,\n@@ -1903,10 +1903,10 @@ static int index_core(struct object_id *oid, int fd, size_t size,\n \t\tchar *buf = xmalloc(size);\n \t\tssize_t read_result = read_in_full(fd, buf, size);\n \t\tif (read_result < 0)\n-\t\t\tret = error_errno(\"read error while indexing %s\",\n+\t\t\tret = error_errno(_(\"read error while indexing %s\"),\n \t\t\t\t\t  path ? path : \"<unknown>\");\n \t\telse if (read_result != size)\n-\t\t\tret = error(\"short read while indexing %s\",\n+\t\t\tret = error(_(\"short read while indexing %s\"),\n \t\t\t\t    path ? path : \"<unknown>\");\n \t\telse\n \t\t\tret = index_mem(oid, buf, size, type, path, flags);\n@@ -1977,7 +1977,7 @@ int index_path(struct object_id *oid, const char *path, struct stat *st, unsigne\n \t\tif (fd < 0)\n \t\t\treturn error_errno(\"open(\\\"%s\\\")\", path);\n \t\tif (index_fd(oid, fd, st, OBJ_BLOB, path, flags) < 0)\n-\t\t\treturn error(\"%s: failed to insert into database\",\n+\t\t\treturn error(_(\"%s: failed to insert into database\"),\n \t\t\t\t     path);\n \t\tbreak;\n \tcase S_IFLNK:\n@@ -1986,13 +1986,13 @@ int index_path(struct object_id *oid, const char *path, struct stat *st, unsigne\n \t\tif (!(flags & HASH_WRITE_OBJECT))\n \t\t\thash_object_file(sb.buf, sb.len, blob_type, oid);\n \t\telse if (write_object_file(sb.buf, sb.len, blob_type, oid))\n-\t\t\trc = error(\"%s: failed to insert into database\", path);\n+\t\t\trc = error(_(\"%s: failed to insert into database\"), path);\n \t\tstrbuf_release(&sb);\n \t\tbreak;\n \tcase S_IFDIR:\n \t\treturn resolve_gitlink_ref(path, \"HEAD\", oid);\n \tdefault:\n-\t\treturn error(\"%s: unsupported file type\", path);\n+\t\treturn error(_(\"%s: unsupported file type\"), path);\n \t}\n \treturn rc;\n }\n@@ -2016,9 +2016,9 @@ void assert_oid_type(const struct object_id *oid, enum object_type expect)\n {\n \tenum object_type type = oid_object_info(the_repository, oid, NULL);\n \tif (type < 0)\n-\t\tdie(\"%s is not a valid object\", oid_to_hex(oid));\n+\t\tdie(_(\"%s is not a valid object\"), oid_to_hex(oid));\n \tif (type != expect)\n-\t\tdie(\"%s is not a valid '%s' object\", oid_to_hex(oid),\n+\t\tdie(_(\"%s is not a valid '%s' object\"), oid_to_hex(oid),\n \t\t    type_name(expect));\n }\n \n@@ -2045,7 +2045,7 @@ int for_each_file_in_obj_subdir(unsigned int subdir_nr,\n \tdir = opendir(path->buf);\n \tif (!dir) {\n \t\tif (errno != ENOENT)\n-\t\t\tr = error_errno(\"unable to open %s\", path->buf);\n+\t\t\tr = error_errno(_(\"unable to open %s\"), path->buf);\n \t\tstrbuf_setlen(path, origlen);\n \t\treturn r;\n \t}\n@@ -2202,18 +2202,18 @@ static int check_stream_sha1(git_zstream *stream,\n \tgit_inflate_end(stream);\n \n \tif (status != Z_STREAM_END) {\n-\t\terror(\"corrupt loose object '%s'\", sha1_to_hex(expected_sha1));\n+\t\terror(_(\"corrupt loose object '%s'\"), sha1_to_hex(expected_sha1));\n \t\treturn -1;\n \t}\n \tif (stream->avail_in) {\n-\t\terror(\"garbage at end of loose object '%s'\",\n+\t\terror(_(\"garbage at end of loose object '%s'\"),\n \t\t      sha1_to_hex(expected_sha1));\n \t\treturn -1;\n \t}\n \n \tthe_hash_algo->final_fn(real_sha1, &c);\n \tif (hashcmp(expected_sha1, real_sha1)) {\n-\t\terror(\"sha1 mismatch for %s (expected %s)\", path,\n+\t\terror(_(\"sha1 mismatch for %s (expected %s)\"), path,\n \t\t      sha1_to_hex(expected_sha1));\n \t\treturn -1;\n \t}\n@@ -2237,18 +2237,18 @@ int read_loose_object(const char *path,\n \n \tmap = map_sha1_file_1(the_repository, path, NULL, &mapsize);\n \tif (!map) {\n-\t\terror_errno(\"unable to mmap %s\", path);\n+\t\terror_errno(_(\"unable to mmap %s\"), path);\n \t\tgoto out;\n \t}\n \n \tif (unpack_sha1_header(&stream, map, mapsize, hdr, sizeof(hdr)) < 0) {\n-\t\terror(\"unable to unpack header of %s\", path);\n+\t\terror(_(\"unable to unpack header of %s\"), path);\n \t\tgoto out;\n \t}\n \n \t*type = parse_sha1_header(hdr, size);\n \tif (*type < 0) {\n-\t\terror(\"unable to parse header of %s\", path);\n+\t\terror(_(\"unable to parse header of %s\"), path);\n \t\tgit_inflate_end(&stream);\n \t\tgoto out;\n \t}\n@@ -2259,13 +2259,13 @@ int read_loose_object(const char *path,\n \t} else {\n \t\t*contents = unpack_sha1_rest(&stream, hdr, *size, expected_oid->hash);\n \t\tif (!*contents) {\n-\t\t\terror(\"unable to unpack contents of %s\", path);\n+\t\t\terror(_(\"unable to unpack contents of %s\"), path);\n \t\t\tgit_inflate_end(&stream);\n \t\t\tgoto out;\n \t\t}\n \t\tif (check_object_signature(expected_oid, *contents,\n \t\t\t\t\t *size, type_name(*type))) {\n-\t\t\terror(\"sha1 mismatch for %s (expected %s)\", path,\n+\t\t\terror(_(\"sha1 mismatch for %s (expected %s)\"), path,\n \t\t\t      oid_to_hex(expected_oid));\n \t\t\tfree(*contents);\n \t\t\tgoto out;\n-- \n2.18.0.rc2.476.g39500d3211\n\n"},{"id":"351434","messageId":"20180630090818.28937-23-pclouds@gmail.com","threadId":"48805","inReplyTo":"20180630090818.28937-1-pclouds@gmail.com","subject":"[PATCH 22/23] transport.c: mark more strings for translation","fromName":"Nguyễn Thái Ngọc Duy","fromEmail":"pclouds@gmail.com","sentAt":"2018-06-30T09:08:17Z","receivedAt":"2018-06-30T09:09:54Z","isPatch":true,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>\n---\n transport.c | 16 ++++++++--------\n 1 file changed, 8 insertions(+), 8 deletions(-)\n\ndiff --git a/transport.c b/transport.c\nindex 2f6a7cb4cd..516a83b7f6 100644\n--- a/transport.c\n+++ b/transport.c\n@@ -139,7 +139,7 @@ static struct ref *get_refs_from_bundle(struct transport *transport,\n \t\tclose(data->fd);\n \tdata->fd = read_bundle_header(transport->url, &data->header);\n \tif (data->fd < 0)\n-\t\tdie(\"could not read bundle '%s'.\", transport->url);\n+\t\tdie(_(\"could not read bundle '%s'\"), transport->url);\n \tfor (i = 0; i < data->header.references.nr; i++) {\n \t\tstruct ref_list_entry *e = data->header.references.list + i;\n \t\tstruct ref *ref = alloc_ref(e->name);\n@@ -654,7 +654,7 @@ static int git_transport_push(struct transport *transport, struct ref *remote_re\n \n \tswitch (data->version) {\n \tcase protocol_v2:\n-\t\tdie(\"support for protocol v2 not implemented yet\");\n+\t\tdie(_(\"support for protocol v2 not implemented yet\"));\n \t\tbreak;\n \tcase protocol_v1:\n \tcase protocol_v0:\n@@ -780,7 +780,7 @@ static enum protocol_allow_config parse_protocol_config(const char *key,\n \telse if (!strcasecmp(value, \"user\"))\n \t\treturn PROTOCOL_ALLOW_USER_ONLY;\n \n-\tdie(\"unknown value for config '%s': %s\", key, value);\n+\tdie(_(\"unknown value for config '%s': %s\"), key, value);\n }\n \n static enum protocol_allow_config get_protocol_config(const char *type)\n@@ -846,7 +846,7 @@ int is_transport_allowed(const char *type, int from_user)\n void transport_check_allowed(const char *type)\n {\n \tif (!is_transport_allowed(type, -1))\n-\t\tdie(\"transport '%s' not allowed\", type);\n+\t\tdie(_(\"transport '%s' not allowed\"), type);\n }\n \n static struct transport_vtable bundle_vtable = {\n@@ -898,7 +898,7 @@ struct transport *transport_get(struct remote *remote, const char *url)\n \tif (helper) {\n \t\ttransport_helper_init(ret, helper);\n \t} else if (starts_with(url, \"rsync:\")) {\n-\t\tdie(\"git-over-rsync is no longer supported\");\n+\t\tdie(_(\"git-over-rsync is no longer supported\"));\n \t} else if (url_is_local_not_ssh(url) && is_file(url) && is_bundle(url, 1)) {\n \t\tstruct bundle_transport_data *data = xcalloc(1, sizeof(*data));\n \t\ttransport_check_allowed(\"file\");\n@@ -1143,7 +1143,7 @@ int transport_push(struct transport *transport,\n \t\t\t\t\t\t      transport->push_options,\n \t\t\t\t\t\t      pretend)) {\n \t\t\t\toid_array_clear(&commits);\n-\t\t\t\tdie(\"failed to push all needed submodules!\");\n+\t\t\t\tdie(_(\"failed to push all needed submodules\"));\n \t\t\t}\n \t\t\toid_array_clear(&commits);\n \t\t}\n@@ -1265,7 +1265,7 @@ int transport_connect(struct transport *transport, const char *name,\n \tif (transport->vtable->connect)\n \t\treturn transport->vtable->connect(transport, name, exec, fd);\n \telse\n-\t\tdie(\"operation not supported by protocol\");\n+\t\tdie(_(\"operation not supported by protocol\"));\n }\n \n int transport_disconnect(struct transport *transport)\n@@ -1347,7 +1347,7 @@ static void read_alternate_refs(const char *path,\n \n \t\tif (get_oid_hex(line.buf, &oid) ||\n \t\t    line.buf[GIT_SHA1_HEXSZ] != ' ') {\n-\t\t\twarning(\"invalid line while parsing alternate refs: %s\",\n+\t\t\twarning(_(\"invalid line while parsing alternate refs: %s\"),\n \t\t\t\tline.buf);\n \t\t\tbreak;\n \t\t}\n-- \n2.18.0.rc2.476.g39500d3211\n\n"},{"id":"351435","messageId":"20180630090818.28937-24-pclouds@gmail.com","threadId":"48805","inReplyTo":"20180630090818.28937-1-pclouds@gmail.com","subject":"[PATCH 23/23] transport-helper.c: mark more strings for translation","fromName":"Nguyễn Thái Ngọc Duy","fromEmail":"pclouds@gmail.com","sentAt":"2018-06-30T09:08:18Z","receivedAt":"2018-06-30T09:09:56Z","isPatch":true,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>\n---\n t/t5801-remote-helpers.sh |  8 ++--\n transport-helper.c        | 87 ++++++++++++++++++++-------------------\n 2 files changed, 48 insertions(+), 47 deletions(-)\n\ndiff --git a/t/t5801-remote-helpers.sh b/t/t5801-remote-helpers.sh\nindex 88c7f158ef..e3bc53b0c7 100755\n--- a/t/t5801-remote-helpers.sh\n+++ b/t/t5801-remote-helpers.sh\n@@ -126,7 +126,7 @@ test_expect_success 'forced push' '\n test_expect_success 'cloning without refspec' '\n \tGIT_REMOTE_TESTGIT_REFSPEC=\"\" \\\n \tgit clone \"testgit::${PWD}/server\" local2 2>error &&\n-\tgrep \"this remote helper should implement refspec capability\" error &&\n+\ttest_i18ngrep \"this remote helper should implement refspec capability\" error &&\n \tcompare_refs local2 HEAD server HEAD\n '\n \n@@ -134,7 +134,7 @@ test_expect_success 'pulling without refspecs' '\n \t(cd local2 &&\n \tgit reset --hard &&\n \tGIT_REMOTE_TESTGIT_REFSPEC=\"\" git pull 2>../error) &&\n-\tgrep \"this remote helper should implement refspec capability\" error &&\n+\ttest_i18ngrep \"this remote helper should implement refspec capability\" error &&\n \tcompare_refs local2 HEAD server HEAD\n '\n \n@@ -146,7 +146,7 @@ test_expect_success 'pushing without refspecs' '\n \tGIT_REMOTE_TESTGIT_REFSPEC=\"\" &&\n \texport GIT_REMOTE_TESTGIT_REFSPEC &&\n \ttest_must_fail git push 2>../error) &&\n-\tgrep \"remote-helper doesn.t support push; refspec needed\" error\n+\ttest_i18ngrep \"remote-helper doesn.t support push; refspec needed\" error\n '\n \n test_expect_success 'pulling without marks' '\n@@ -246,7 +246,7 @@ test_expect_success 'proper failure checks for fetching' '\n \t(cd local &&\n \ttest_must_fail env GIT_REMOTE_TESTGIT_FAILURE=1 git fetch 2>error &&\n \tcat error &&\n-\tgrep -q \"error while running fast-import\" error\n+\ttest_i18ngrep -q \"error while running fast-import\" error\n \t)\n '\n \ndiff --git a/transport-helper.c b/transport-helper.c\nindex 9f487cc905..84a10661cc 100644\n--- a/transport-helper.c\n+++ b/transport-helper.c\n@@ -48,7 +48,7 @@ static void sendline(struct helper_data *helper, struct strbuf *buffer)\n \tif (debug)\n \t\tfprintf(stderr, \"Debug: Remote helper: -> %s\", buffer->buf);\n \tif (write_in_full(helper->helper->in, buffer->buf, buffer->len) < 0)\n-\t\tdie_errno(\"full write to remote helper failed\");\n+\t\tdie_errno(_(\"full write to remote helper failed\"));\n }\n \n static int recvline_fh(FILE *helper, struct strbuf *buffer)\n@@ -77,7 +77,7 @@ static void write_constant(int fd, const char *str)\n \tif (debug)\n \t\tfprintf(stderr, \"Debug: Remote helper: -> %s\", str);\n \tif (write_in_full(fd, str, strlen(str)) < 0)\n-\t\tdie_errno(\"full write to remote helper failed\");\n+\t\tdie_errno(_(\"full write to remote helper failed\"));\n }\n \n static const char *remove_ext_force(const char *url)\n@@ -129,7 +129,7 @@ static struct child_process *get_helper(struct transport *transport)\n \n \tcode = start_command(helper);\n \tif (code < 0 && errno == ENOENT)\n-\t\tdie(\"unable to find remote helper for '%s'\", data->name);\n+\t\tdie(_(\"unable to find remote helper for '%s'\"), data->name);\n \telse if (code != 0)\n \t\texit(code);\n \n@@ -145,7 +145,7 @@ static struct child_process *get_helper(struct transport *transport)\n \t */\n \tduped = dup(helper->out);\n \tif (duped < 0)\n-\t\tdie_errno(\"can't dup helper output fd\");\n+\t\tdie_errno(_(\"can't dup helper output fd\"));\n \tdata->out = xfdopen(duped, \"r\");\n \n \twrite_constant(helper->in, \"capabilities\\n\");\n@@ -196,13 +196,13 @@ static struct child_process *get_helper(struct transport *transport)\n \t\t} else if (starts_with(capname, \"no-private-update\")) {\n \t\t\tdata->no_private_update = 1;\n \t\t} else if (mandatory) {\n-\t\t\tdie(\"unknown mandatory capability %s; this remote \"\n-\t\t\t    \"helper probably needs newer version of Git\",\n+\t\t\tdie(_(\"unknown mandatory capability %s; this remote \"\n+\t\t\t      \"helper probably needs newer version of Git\"),\n \t\t\t    capname);\n \t\t}\n \t}\n \tif (!data->rs.nr && (data->import || data->bidi_import || data->export)) {\n-\t\twarning(\"this remote helper should implement refspec capability\");\n+\t\twarning(_(\"this remote helper should implement refspec capability\"));\n \t}\n \tstrbuf_release(&buf);\n \tif (debug)\n@@ -269,7 +269,7 @@ static int strbuf_set_helper_option(struct helper_data *data,\n \telse if (!strcmp(buf->buf, \"unsupported\"))\n \t\tret = 1;\n \telse {\n-\t\twarning(\"%s unexpectedly said: '%s'\", data->name, buf->buf);\n+\t\twarning(_(\"%s unexpectedly said: '%s'\"), data->name, buf->buf);\n \t\tret = 1;\n \t}\n \treturn ret;\n@@ -398,7 +398,7 @@ static int fetch_with_fetch(struct transport *transport,\n \t\tif (starts_with(buf.buf, \"lock \")) {\n \t\t\tconst char *name = buf.buf + 5;\n \t\t\tif (transport->pack_lockfile)\n-\t\t\t\twarning(\"%s also locked %s\", data->name, name);\n+\t\t\t\twarning(_(\"%s also locked %s\"), data->name, name);\n \t\t\telse\n \t\t\t\ttransport->pack_lockfile = xstrdup(name);\n \t\t}\n@@ -409,7 +409,7 @@ static int fetch_with_fetch(struct transport *transport,\n \t\telse if (!buf.len)\n \t\t\tbreak;\n \t\telse\n-\t\t\twarning(\"%s unexpectedly said: '%s'\", data->name, buf.buf);\n+\t\t\twarning(_(\"%s unexpectedly said: '%s'\"), data->name, buf.buf);\n \t}\n \tstrbuf_release(&buf);\n \treturn 0;\n@@ -476,7 +476,7 @@ static int fetch_with_import(struct transport *transport,\n \tget_helper(transport);\n \n \tif (get_importer(transport, &fastimport))\n-\t\tdie(\"couldn't run fast-import\");\n+\t\tdie(_(\"couldn't run fast-import\"));\n \n \tfor (i = 0; i < nr_heads; i++) {\n \t\tposn = to_fetch[i];\n@@ -499,7 +499,7 @@ static int fetch_with_import(struct transport *transport,\n \t */\n \n \tif (finish_command(&fastimport))\n-\t\tdie(\"error while running fast-import\");\n+\t\tdie(_(\"error while running fast-import\"));\n \n \t/*\n \t * The fast-import stream of a remote helper that advertises\n@@ -528,7 +528,7 @@ static int fetch_with_import(struct transport *transport,\n \t\t\tprivate = xstrdup(name);\n \t\tif (private) {\n \t\t\tif (read_ref(private, &posn->old_oid) < 0)\n-\t\t\t\tdie(\"could not read ref %s\", private);\n+\t\t\t\tdie(_(\"could not read ref %s\"), private);\n \t\t\tfree(private);\n \t\t}\n \t}\n@@ -554,7 +554,7 @@ static int run_connect(struct transport *transport, struct strbuf *cmdbuf)\n \t */\n \tduped = dup(helper->out);\n \tif (duped < 0)\n-\t\tdie_errno(\"can't dup helper output fd\");\n+\t\tdie_errno(_(\"can't dup helper output fd\"));\n \tinput = xfdopen(duped, \"r\");\n \tsetvbuf(input, NULL, _IONBF, 0);\n \n@@ -573,8 +573,8 @@ static int run_connect(struct transport *transport, struct strbuf *cmdbuf)\n \t\t\tfprintf(stderr, \"Debug: Falling back to dumb \"\n \t\t\t\t\"transport.\\n\");\n \t} else {\n-\t\tdie(\"unknown response to connect: %s\",\n-\t\t\tcmdbuf->buf);\n+\t\tdie(_(_(\"unknown response to connect: %s\")),\n+\t\t    cmdbuf->buf);\n \t}\n \n \tfclose(input);\n@@ -595,9 +595,9 @@ static int process_connect_service(struct transport *transport,\n \tif (strcmp(name, exec)) {\n \t\tint r = set_helper_option(transport, \"servpath\", exec);\n \t\tif (r > 0)\n-\t\t\twarning(\"setting remote service path not supported by protocol\");\n+\t\t\twarning(_(\"setting remote service path not supported by protocol\"));\n \t\telse if (r < 0)\n-\t\t\twarning(\"invalid remote service path\");\n+\t\t\twarning(_(\"invalid remote service path\"));\n \t}\n \n \tif (data->connect) {\n@@ -640,10 +640,10 @@ static int connect_helper(struct transport *transport, const char *name,\n \t/* Get_helper so connect is inited. */\n \tget_helper(transport);\n \tif (!data->connect)\n-\t\tdie(\"operation not supported by protocol\");\n+\t\tdie(_(\"operation not supported by protocol\"));\n \n \tif (!process_connect_service(transport, name, exec))\n-\t\tdie(\"can't connect to subservice %s\", name);\n+\t\tdie(_(\"can't connect to subservice %s\"), name);\n \n \tfd[0] = data->helper->out;\n \tfd[1] = data->helper->in;\n@@ -707,7 +707,7 @@ static int push_update_ref_status(struct strbuf *buf,\n \t\tstatus = REF_STATUS_REMOTE_REJECT;\n \t\trefname = buf->buf + 6;\n \t} else\n-\t\tdie(\"expected ok/error, helper said '%s'\", buf->buf);\n+\t\tdie(_(\"expected ok/error, helper said '%s'\"), buf->buf);\n \n \tmsg = strchr(refname, ' ');\n \tif (msg) {\n@@ -760,7 +760,7 @@ static int push_update_ref_status(struct strbuf *buf,\n \tif (!*ref)\n \t\t*ref = find_ref_by_name(remote_refs, refname);\n \tif (!*ref) {\n-\t\twarning(\"helper reported unexpected status of %s\", refname);\n+\t\twarning(_(\"helper reported unexpected status of %s\"), refname);\n \t\treturn 1;\n \t}\n \n@@ -821,20 +821,20 @@ static void set_common_push_options(struct transport *transport,\n {\n \tif (flags & TRANSPORT_PUSH_DRY_RUN) {\n \t\tif (set_helper_option(transport, \"dry-run\", \"true\") != 0)\n-\t\t\tdie(\"helper %s does not support dry-run\", name);\n+\t\t\tdie(_(\"helper %s does not support dry-run\"), name);\n \t} else if (flags & TRANSPORT_PUSH_CERT_ALWAYS) {\n \t\tif (set_helper_option(transport, TRANS_OPT_PUSH_CERT, \"true\") != 0)\n-\t\t\tdie(\"helper %s does not support --signed\", name);\n+\t\t\tdie(_(\"helper %s does not support --signed\"), name);\n \t} else if (flags & TRANSPORT_PUSH_CERT_IF_ASKED) {\n \t\tif (set_helper_option(transport, TRANS_OPT_PUSH_CERT, \"if-asked\") != 0)\n-\t\t\tdie(\"helper %s does not support --signed=if-asked\", name);\n+\t\t\tdie(_(\"helper %s does not support --signed=if-asked\"), name);\n \t}\n \n \tif (flags & TRANSPORT_PUSH_OPTIONS) {\n \t\tstruct string_list_item *item;\n \t\tfor_each_string_list_item(item, transport->push_options)\n \t\t\tif (set_helper_option(transport, \"push-option\", item->string) != 0)\n-\t\t\t\tdie(\"helper %s does not support 'push-option'\", name);\n+\t\t\t\tdie(_(\"helper %s does not support 'push-option'\"), name);\n \t}\n }\n \n@@ -926,12 +926,12 @@ static int push_refs_with_export(struct transport *transport,\n \tstruct strbuf buf = STRBUF_INIT;\n \n \tif (!data->rs.nr)\n-\t\tdie(\"remote-helper doesn't support push; refspec needed\");\n+\t\tdie(_(\"remote-helper doesn't support push; refspec needed\"));\n \n \tset_common_push_options(transport, data->name, flags);\n \tif (flags & TRANSPORT_PUSH_FORCE) {\n \t\tif (set_helper_option(transport, \"force\", \"true\") != 0)\n-\t\t\twarning(\"helper %s does not support 'force'\", data->name);\n+\t\t\twarning(_(\"helper %s does not support 'force'\"), data->name);\n \t}\n \n \thelper = get_helper(transport);\n@@ -978,12 +978,12 @@ static int push_refs_with_export(struct transport *transport,\n \t}\n \n \tif (get_exporter(transport, &exporter, &revlist_args))\n-\t\tdie(\"couldn't run fast-export\");\n+\t\tdie(_(\"couldn't run fast-export\"));\n \n \tstring_list_clear(&revlist_args, 1);\n \n \tif (finish_command(&exporter))\n-\t\tdie(\"error while running fast-export\");\n+\t\tdie(_(\"error while running fast-export\"));\n \tif (push_update_refs_status(data, remote_refs, flags))\n \t\treturn 1;\n \n@@ -1007,8 +1007,9 @@ static int push_refs(struct transport *transport,\n \t}\n \n \tif (!remote_refs) {\n-\t\tfprintf(stderr, \"No refs in common and none specified; doing nothing.\\n\"\n-\t\t\t\"Perhaps you should specify a branch such as 'master'.\\n\");\n+\t\tfprintf(stderr,\n+\t\t\t_(\"No refs in common and none specified; doing nothing.\\n\"\n+\t\t\t  \"Perhaps you should specify a branch such as 'master'.\\n\"));\n \t\treturn 0;\n \t}\n \n@@ -1070,7 +1071,7 @@ static struct ref *get_refs_list(struct transport *transport, int for_push,\n \n \t\teov = strchr(buf.buf, ' ');\n \t\tif (!eov)\n-\t\t\tdie(\"malformed response in ref list: %s\", buf.buf);\n+\t\t\tdie(_(\"malformed response in ref list: %s\"), buf.buf);\n \t\teon = strchr(eov + 1, ' ');\n \t\t*eov = '\\0';\n \t\tif (eon)\n@@ -1223,7 +1224,7 @@ static int udt_do_read(struct unidirectional_transfer *t)\n \tbytes = read(t->src, t->buf + t->bufuse, BUFFERSIZE - t->bufuse);\n \tif (bytes < 0 && errno != EWOULDBLOCK && errno != EAGAIN &&\n \t\terrno != EINTR) {\n-\t\terror_errno(\"read(%s) failed\", t->src_name);\n+\t\terror_errno(_(\"read(%s) failed\"), t->src_name);\n \t\treturn -1;\n \t} else if (bytes == 0) {\n \t\ttransfer_debug(\"%s EOF (with %i bytes in buffer)\",\n@@ -1250,7 +1251,7 @@ static int udt_do_write(struct unidirectional_transfer *t)\n \ttransfer_debug(\"%s is writable\", t->dest_name);\n \tbytes = xwrite(t->dest, t->buf, t->bufuse);\n \tif (bytes < 0 && errno != EWOULDBLOCK) {\n-\t\terror_errno(\"write(%s) failed\", t->dest_name);\n+\t\terror_errno(_(\"write(%s) failed\"), t->dest_name);\n \t\treturn -1;\n \t} else if (bytes > 0) {\n \t\tt->bufuse -= bytes;\n@@ -1299,11 +1300,11 @@ static int tloop_join(pthread_t thread, const char *name)\n \tvoid *tret;\n \terr = pthread_join(thread, &tret);\n \tif (!tret) {\n-\t\terror(\"%s thread failed\", name);\n+\t\terror(_(\"%s thread failed\"), name);\n \t\treturn 1;\n \t}\n \tif (err) {\n-\t\terror(\"%s thread failed to join: %s\", name, strerror(err));\n+\t\terror(_(\"%s thread failed to join: %s\"), name, strerror(err));\n \t\treturn 1;\n \t}\n \treturn 0;\n@@ -1322,11 +1323,11 @@ static int tloop_spawnwait_tasks(struct bidirectional_transfer_state *s)\n \terr = pthread_create(&gtp_thread, NULL, udt_copy_task_routine,\n \t\t&s->gtp);\n \tif (err)\n-\t\tdie(\"can't start thread for copying data: %s\", strerror(err));\n+\t\tdie(_(\"can't start thread for copying data: %s\"), strerror(err));\n \terr = pthread_create(&ptg_thread, NULL, udt_copy_task_routine,\n \t\t&s->ptg);\n \tif (err)\n-\t\tdie(\"can't start thread for copying data: %s\", strerror(err));\n+\t\tdie(_(\"can't start thread for copying data: %s\"), strerror(err));\n \n \tret |= tloop_join(gtp_thread, \"Git to program copy\");\n \tret |= tloop_join(ptg_thread, \"Program to git copy\");\n@@ -1363,11 +1364,11 @@ static int tloop_join(pid_t pid, const char *name)\n {\n \tint tret;\n \tif (waitpid(pid, &tret, 0) < 0) {\n-\t\terror_errno(\"%s process failed to wait\", name);\n+\t\terror_errno(_(\"%s process failed to wait\"), name);\n \t\treturn 1;\n \t}\n \tif (!WIFEXITED(tret) || WEXITSTATUS(tret)) {\n-\t\terror(\"%s process failed\", name);\n+\t\terror(_(\"%s process failed\"), name);\n \t\treturn 1;\n \t}\n \treturn 0;\n@@ -1385,7 +1386,7 @@ static int tloop_spawnwait_tasks(struct bidirectional_transfer_state *s)\n \t/* Fork thread #1: git to program. */\n \tpid1 = fork();\n \tif (pid1 < 0)\n-\t\tdie_errno(\"can't start thread for copying data\");\n+\t\tdie_errno(_(\"can't start thread for copying data\"));\n \telse if (pid1 == 0) {\n \t\tudt_kill_transfer(&s->ptg);\n \t\texit(udt_copy_task_routine(&s->gtp) ? 0 : 1);\n@@ -1394,7 +1395,7 @@ static int tloop_spawnwait_tasks(struct bidirectional_transfer_state *s)\n \t/* Fork thread #2: program to git. */\n \tpid2 = fork();\n \tif (pid2 < 0)\n-\t\tdie_errno(\"can't start thread for copying data\");\n+\t\tdie_errno(_(\"can't start thread for copying data\"));\n \telse if (pid2 == 0) {\n \t\tudt_kill_transfer(&s->gtp);\n \t\texit(udt_copy_task_routine(&s->ptg) ? 0 : 1);\n-- \n2.18.0.rc2.476.g39500d3211\n\n"},{"id":"351472","messageId":"CABPp-BGTAGaQm7D3QSdMbcK0abNNhLwfwHj_CoAuedCSoKWvZg@mail.gmail.com","threadId":"48805","inReplyTo":"20180630090818.28937-5-pclouds@gmail.com","subject":"Re: [PATCH 04/23] builtin/config.c: mark more strings for translation","fromName":"Elijah Newren","fromEmail":"newren@gmail.com","sentAt":"2018-07-01T05:18:04Z","receivedAt":"2018-07-01T05:18:12Z","isPatch":true,"sender":{"key":"newren@gmail.com","avatar":"https://avatars.githubusercontent.com/u/5455730?v=4"},"body":"On Sat, Jun 30, 2018 at 2:07 AM, Nguyễn Thái Ngọc Duy <pclouds@gmail.com> wrote:\n\n>         if (show_origin && !(actions &\n>                 (ACTION_GET|ACTION_GET_ALL|ACTION_GET_REGEXP|ACTION_LIST))) {\n> -               error(\"--show-origin is only applicable to --get, --get-all, \"\n> -                         \"--get-regexp, and --list.\");\n> +               error(_(\"--show-origin is only applicable to --get, --get-all, \"\n> +                       \"--get-regexp, and --list\"));\n\nI would have expected the fullstop removal to have been part of patch\n1 instead of this patch.\n\n\nDidn't spot any other issues.\n"},{"id":"351473","messageId":"CABPp-BFZhCY4HWmo0pSZWtqGSyn1siMyq2a4Wbew3E=PbSe9jA@mail.gmail.com","threadId":"48805","inReplyTo":"20180630090818.28937-7-pclouds@gmail.com","subject":"Re: [PATCH 06/23] builtin/pack-objects.c: mark more strings for translation","fromName":"Elijah Newren","fromEmail":"newren@gmail.com","sentAt":"2018-07-01T05:28:40Z","receivedAt":"2018-07-01T05:28:44Z","isPatch":true,"sender":{"key":"newren@gmail.com","avatar":"https://avatars.githubusercontent.com/u/5455730?v=4"},"body":"On Sat, Jun 30, 2018 at 2:08 AM, Nguyễn Thái Ngọc Duy <pclouds@gmail.com> wrote:\n> Most of these are straight forward. GETTEXT_POISON does catch the last\n> string in cmd_pack_objects(), but since this is --progress output, it's\n> not supposed to be machine-readable.\n>\n\n> @@ -2341,8 +2342,8 @@ static void ll_find_deltas(struct object_entry **list, unsigned list_size,\n>                 return;\n>         }\n>         if (progress > pack_to_stdout)\n> -               fprintf_ln(stderr, \"Delta compression using up to %d threads.\",\n> -                               delta_search_threads);\n> +               fprintf_ln(stderr, _(\"Delta compression using up to %d threads\"),\n> +                          delta_search_threads);\n\nFull stop removal that probably belongs in patch 1 instead.\n\n>         if (!pack_to_stdout && !pack_size_limit)\n>                 pack_size_limit = pack_size_limit_cfg;\n>         if (pack_to_stdout && pack_size_limit)\n> -               die(\"--max-pack-size cannot be used to build a pack for transfer.\");\n> +               die(_(\"--max-pack-size cannot be used to build a pack for transfer\"));\n\nsame.\n\n>         if (keep_unreachable && unpack_unreachable)\n> -               die(\"--keep-unreachable and --unpack-unreachable are incompatible.\");\n> +               die(_(\"--keep-unreachable and --unpack-unreachable are incompatible\"));\n\nsame.\n\n>         if (filter_options.choice) {\n>                 if (!pack_to_stdout)\n> -                       die(\"cannot use --filter without --stdout.\");\n> +                       die(_(\"cannot use --filter without --stdout\"));\n\nsame.\n"},{"id":"351474","messageId":"CABPp-BEQyEeYvE_JVDeVTWQSpOYj8pCzELQY6dpaz4p2S9d0NQ@mail.gmail.com","threadId":"48805","inReplyTo":"20180630090818.28937-8-pclouds@gmail.com","subject":"Re: [PATCH 07/23] builtin/replace.c: mark more strings for translation","fromName":"Elijah Newren","fromEmail":"newren@gmail.com","sentAt":"2018-07-01T05:34:14Z","receivedAt":"2018-07-01T05:34:19Z","isPatch":true,"sender":{"key":"newren@gmail.com","avatar":"https://avatars.githubusercontent.com/u/5455730?v=4"},"body":"On Sat, Jun 30, 2018 at 2:08 AM, Nguyễn Thái Ngọc Duy <pclouds@gmail.com> wrote:\n> Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>\n> ---\n>  builtin/replace.c | 82 +++++++++++++++++++++++------------------------\n>  1 file changed, 41 insertions(+), 41 deletions(-)\n>\n\n> -               return error(\"invalid replace format '%s'\\n\"\n> -                            \"valid formats are 'short', 'medium' and 'long'\\n\",\n> +               return error(_(\"invalid replace format '%s'\\n\"\n> +                              \"valid formats are 'short', 'medium' and 'long'\"),\n\nWas the removal of the trailing newline intentional?  If so, move it to patch 1?\n\n> @@ -456,10 +456,10 @@ static int create_graft(int argc, const char **argv, int force, int gentle)\n>                 return -1;\n>         }\n>\n> -       if (remove_signature(&buf)) {\n> -               warning(_(\"the original commit '%s' has a gpg signature.\"), old_ref);\n> -               warning(_(\"the signature will be removed in the replacement commit!\"));\n> -       }\n> +       if (remove_signature(&buf))\n> +               warning(_(\"the original commit '%s' has a gpg signature.\\n\"\n> +                         \"The signature will be removed in the replacement commit!\"),\n> +                       old_ref);\n\nMore message changes that probably belong in patch 1 for consistency.\n"},{"id":"351475","messageId":"CABPp-BHQSTxe4=adMSo9Arg0QT7-U_SjsU-AgO42cHiMgUxPog@mail.gmail.com","threadId":"48805","inReplyTo":"20180630090818.28937-10-pclouds@gmail.com","subject":"Re: [PATCH 09/23] config.c: mark more strings for translation","fromName":"Elijah Newren","fromEmail":"newren@gmail.com","sentAt":"2018-07-01T05:38:11Z","receivedAt":"2018-07-01T05:38:16Z","isPatch":true,"sender":{"key":"newren@gmail.com","avatar":"https://avatars.githubusercontent.com/u/5455730?v=4"},"body":"On Sat, Jun 30, 2018 at 2:08 AM, Nguyễn Thái Ngọc Duy <pclouds@gmail.com> wrote:\n\n> @@ -1409,11 +1409,11 @@ static int git_default_push_config(const char *var, const char *value)\n>                         push_default = PUSH_DEFAULT_UPSTREAM;\n>                 else if (!strcmp(value, \"current\"))\n>                         push_default = PUSH_DEFAULT_CURRENT;\n> -               else {\n> -                       error(\"malformed value for %s: %s\", var, value);\n> -                       return error(\"Must be one of nothing, matching, simple, \"\n> -                                    \"upstream or current.\");\n> -               }\n> +               else\n> +                       return error(_(\"malformed value for %s: %s\\n\"\n> +                                      \"Must be one of nothing, matching, simple, \"\n> +                                      \"upstream or current.\"),\n> +                                    var, value);\n\nPatch 1?\n\n\nNo other issues noticed.\n"},{"id":"351558","messageId":"bf4c5872-aca8-899d-2175-ae3f4eea7fad@gmail.com","threadId":"48805","inReplyTo":"20180630090818.28937-9-pclouds@gmail.com","subject":"Re: [PATCH 08/23] commit-graph.c: mark more strings for translation","fromName":"Derrick Stolee","fromEmail":"stolee@gmail.com","sentAt":"2018-07-02T20:32:10Z","receivedAt":"2018-07-02T20:32:16Z","isPatch":true,"sender":{"key":"stolee@gmail.com","avatar":"https://avatars.githubusercontent.com/u/570044?v=4"},"body":"On 6/30/2018 5:08 AM, Nguyễn Thái Ngọc Duy wrote:\n> Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>\n> ---\n>   commit-graph.c | 20 ++++++++++----------\n>   1 file changed, 10 insertions(+), 10 deletions(-)\n>\n> diff --git a/commit-graph.c b/commit-graph.c\n> index b63a1fc85e..c8d521923c 100644\n> --- a/commit-graph.c\n> +++ b/commit-graph.c\n> @@ -77,28 +77,28 @@ struct commit_graph *load_commit_graph_one(const char *graph_file)\n>   \n>   \tif (graph_size < GRAPH_MIN_SIZE) {\n>   \t\tclose(fd);\n> -\t\tdie(\"graph file %s is too small\", graph_file);\n> +\t\tdie(_(\"graph file %s is too small\"), graph_file);\n>   \t}\n>   \tgraph_map = xmmap(NULL, graph_size, PROT_READ, MAP_PRIVATE, fd, 0);\n>   \tdata = (const unsigned char *)graph_map;\n>   \n>   \tgraph_signature = get_be32(data);\n>   \tif (graph_signature != GRAPH_SIGNATURE) {\n> -\t\terror(\"graph signature %X does not match signature %X\",\n> +\t\terror(_(\"graph signature %X does not match signature %X\"),\n>   \t\t      graph_signature, GRAPH_SIGNATURE);\n>   \t\tgoto cleanup_fail;\n>   \t}\n>   \n>   \tgraph_version = *(unsigned char*)(data + 4);\n>   \tif (graph_version != GRAPH_VERSION) {\n> -\t\terror(\"graph version %X does not match version %X\",\n> +\t\terror(_(\"graph version %X does not match version %X\"),\n>   \t\t      graph_version, GRAPH_VERSION);\n>   \t\tgoto cleanup_fail;\n>   \t}\n>   \n>   \thash_version = *(unsigned char*)(data + 5);\n>   \tif (hash_version != GRAPH_OID_VERSION) {\n> -\t\terror(\"hash version %X does not match version %X\",\n> +\t\terror(_(\"hash version %X does not match version %X\"),\n>   \t\t      hash_version, GRAPH_OID_VERSION);\n>   \t\tgoto cleanup_fail;\n>   \t}\n> @@ -122,7 +122,7 @@ struct commit_graph *load_commit_graph_one(const char *graph_file)\n>   \t\tchunk_lookup += GRAPH_CHUNKLOOKUP_WIDTH;\n>   \n>   \t\tif (chunk_offset > graph_size - GIT_MAX_RAWSZ) {\n> -\t\t\terror(\"improper chunk offset %08x%08x\", (uint32_t)(chunk_offset >> 32),\n> +\t\t\terror(_(\"improper chunk offset %08x%08x\"), (uint32_t)(chunk_offset >> 32),\n>   \t\t\t      (uint32_t)chunk_offset);\n>   \t\t\tgoto cleanup_fail;\n>   \t\t}\n> @@ -158,7 +158,7 @@ struct commit_graph *load_commit_graph_one(const char *graph_file)\n>   \t\t}\n>   \n>   \t\tif (chunk_repeated) {\n> -\t\t\terror(\"chunk id %08x appears multiple times\", chunk_id);\n> +\t\t\terror(_(\"chunk id %08x appears multiple times\"), chunk_id);\n>   \t\t\tgoto cleanup_fail;\n>   \t\t}\n>   \n> @@ -244,7 +244,7 @@ static struct commit_list **insert_parent_or_die(struct commit_graph *g,\n>   \thashcpy(oid.hash, g->chunk_oid_lookup + g->hash_len * pos);\n>   \tc = lookup_commit(&oid);\n>   \tif (!c)\n> -\t\tdie(\"could not find commit %s\", oid_to_hex(&oid));\n> +\t\tdie(_(\"could not find commit %s\"), oid_to_hex(&oid));\n>   \tc->graph_pos = pos;\n>   \treturn &commit_list_insert(c, pptr)->next;\n>   }\n> @@ -537,7 +537,7 @@ static int add_packed_commits(const struct object_id *oid,\n>   \n>   \toi.typep = &type;\n>   \tif (packed_object_info(the_repository, pack, offset, &oi) < 0)\n> -\t\tdie(\"unable to get type of object %s\", oid_to_hex(oid));\n> +\t\tdie(_(\"unable to get type of object %s\"), oid_to_hex(oid));\n>   \n>   \tif (type != OBJ_COMMIT)\n>   \t\treturn 0;\n> @@ -683,9 +683,9 @@ void write_commit_graph(const char *obj_dir,\n>   \t\t\tstrbuf_addstr(&packname, pack_indexes[i]);\n>   \t\t\tp = add_packed_git(packname.buf, packname.len, 1);\n>   \t\t\tif (!p)\n> -\t\t\t\tdie(\"error adding pack %s\", packname.buf);\n> +\t\t\t\tdie(_(\"error adding pack %s\"), packname.buf);\n>   \t\t\tif (open_pack_index(p))\n> -\t\t\t\tdie(\"error opening index for %s\", packname.buf);\n> +\t\t\t\tdie(_(\"error opening index for %s\"), packname.buf);\n>   \t\t\tfor_each_object_in_pack(p, add_packed_commits, &oids);\n>   \t\t\tclose_pack(p);\n>   \t\t}\n\nThese all look good to me. Thanks!\n"}]}