{"thread":{"id":"64397","subject":"[PATCH 0/5] fast-export/import: cleanups and translation","startedAt":"2025-10-28T08:13:03Z","lastAt":"2025-11-01T15:16:37Z","messageCount":22,"participants":["Christian Couder","Junio C Hamano","Elijah Newren"],"isPatch":true,"patchVersion":1,"patchTotal":5},"messages":[{"id":"529764","messageId":"20251028081232.3068147-1-christian.couder@gmail.com","threadId":"64397","inReplyTo":null,"subject":"[PATCH 0/5] fast-export/import: cleanups and translation","fromName":"Christian Couder","fromEmail":"christian.couder@gmail.com","sentAt":"2025-10-28T08:12:27Z","receivedAt":"2025-10-28T08:13:03Z","isPatch":true,"sender":{"key":"christian.couder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/208954?v=4"},"body":"In a previous v2 patch series[1] that I sent last May, there were two\npreparatory cleanup patches[2][3] that have been dropped in the v3 and\nnext versions. I think these two cleanup patches are worth resending\nin their own series though.\n\nWhile at cleaning things up, I realized that, when working in this\narea of the code, I have often been annoyed by the fact that few error\nand warning messages were marked for translation. So I decided to also\naddress this here.\n\nSo patches 1/5 and 2/5 are small code cleanups that are resent, while\npatches 3/5, 4/5 and 5/5 are about marking strings for translation.\n\n[1] https://lore.kernel.org/git/20250526103314.1542316-1-christian.couder@gmail.com/\n[2] https://lore.kernel.org/git/20250526103314.1542316-2-christian.couder@gmail.com/\n[3] https://lore.kernel.org/git/20250526103314.1542316-3-christian.couder@gmail.com/\n\nCI build:\n---------\n\nAll the tests pass, except for the \"win + Meson build\" which seems to\nfail at a Rust related step:\n\nhttps://github.com/chriscool/git/actions/runs/18856740498\n\nChristian Couder (5):\n  gpg-interface: simplify ssh fingerprint parsing\n  gpg-interface: use left shift to define GPG_VERIFY_*\n  fast-export: mark strings for translation\n  fast-import: mark strings for translation\n  gpg-interface: mark a string for translation\n\n builtin/fast-export.c |  77 ++++++------\n builtin/fast-import.c | 270 +++++++++++++++++++++---------------------\n gpg-interface.c       |   4 +-\n gpg-interface.h       |   6 +-\n 4 files changed, 179 insertions(+), 178 deletions(-)\n\n-- \n2.51.2.540.g4ad31e1014\n\n"},{"id":"529765","messageId":"20251028081232.3068147-2-christian.couder@gmail.com","threadId":"64397","inReplyTo":"20251028081232.3068147-1-christian.couder@gmail.com","subject":"[PATCH 1/5] gpg-interface: simplify ssh fingerprint parsing","fromName":"Christian Couder","fromEmail":"christian.couder@gmail.com","sentAt":"2025-10-28T08:12:28Z","receivedAt":"2025-10-28T08:13:04Z","isPatch":true,"sender":{"key":"christian.couder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/208954?v=4"},"body":"In \"gpg-interface.c\", the 'parse_ssh_output()' function takes a\n'struct signature_check *sigc' argument and populates many members of\nthis 'sigc' using information parsed from 'sigc->output' which\ncontains the ouput of an `ssh-keygen -Y ...` command that was used to\nverify an SSH signature.\n\nWhen it populates 'sigc->fingerprint' though, it uses\n`xstrdup(strstr(line, \"key \") + 4)` while `strstr(line, \"key \")` has\nalready been computed a few lines above and is already available in\nthe `key` variable.\n\nLet's simplify this.\n\nSigned-off-by: Christian Couder <chriscool@tuxfamily.org>\n---\n gpg-interface.c | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/gpg-interface.c b/gpg-interface.c\nindex 2f4f0e32cb..91d1b58cb4 100644\n--- a/gpg-interface.c\n+++ b/gpg-interface.c\n@@ -443,7 +443,7 @@ static void parse_ssh_output(struct signature_check *sigc)\n \n \tkey = strstr(line, \"key \");\n \tif (key) {\n-\t\tsigc->fingerprint = xstrdup(strstr(line, \"key \") + 4);\n+\t\tsigc->fingerprint = xstrdup(key + 4);\n \t\tsigc->key = xstrdup(sigc->fingerprint);\n \t} else {\n \t\t/*\n-- \n2.51.2.540.g4ad31e1014\n\n"},{"id":"529766","messageId":"20251028081232.3068147-3-christian.couder@gmail.com","threadId":"64397","inReplyTo":"20251028081232.3068147-1-christian.couder@gmail.com","subject":"[PATCH 2/5] gpg-interface: use left shift to define GPG_VERIFY_*","fromName":"Christian Couder","fromEmail":"christian.couder@gmail.com","sentAt":"2025-10-28T08:12:29Z","receivedAt":"2025-10-28T08:13:06Z","isPatch":true,"sender":{"key":"christian.couder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/208954?v=4"},"body":"In \"gpg-interface.h\", the definitions of the GPG_VERIFY_* boolean flags\nare currently using 1, 2 and 4 while we often prefer the bitwise left\nshift operator, `<<`, for that purpose to make it clearer that they are\nboolean.\n\nLet's use the left shift operator here too. Let's also fix an indent\nissue with \"4\" while at it.\n\nSigned-off-by: Christian Couder <chriscool@tuxfamily.org>\n---\n gpg-interface.h | 6 +++---\n 1 file changed, 3 insertions(+), 3 deletions(-)\n\ndiff --git a/gpg-interface.h b/gpg-interface.h\nindex 50487aa148..ead1ed6967 100644\n--- a/gpg-interface.h\n+++ b/gpg-interface.h\n@@ -3,9 +3,9 @@\n \n struct strbuf;\n \n-#define GPG_VERIFY_VERBOSE\t\t1\n-#define GPG_VERIFY_RAW\t\t\t2\n-#define GPG_VERIFY_OMIT_STATUS\t4\n+#define GPG_VERIFY_VERBOSE\t(1<<0)\n+#define GPG_VERIFY_RAW\t\t(1<<1)\n+#define GPG_VERIFY_OMIT_STATUS\t(1<<2)\n \n enum signature_trust_level {\n \tTRUST_UNDEFINED,\n-- \n2.51.2.540.g4ad31e1014\n\n"},{"id":"529767","messageId":"20251028081232.3068147-4-christian.couder@gmail.com","threadId":"64397","inReplyTo":"20251028081232.3068147-1-christian.couder@gmail.com","subject":"[PATCH 3/5] fast-export: mark strings for translation","fromName":"Christian Couder","fromEmail":"christian.couder@gmail.com","sentAt":"2025-10-28T08:12:30Z","receivedAt":"2025-10-28T08:13:07Z","isPatch":true,"sender":{"key":"christian.couder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/208954?v=4"},"body":"Some error or warning messages in \"builtin/fast-export.c\" are marked\nfor translation, but many are not.\n\nTo be more consistent and provide a better experience to people using a\ntranslated version, let's mark all the remaining error or warning\nmessages for translation.\n\nWhile at it, improve how some arguments to some error functions are\nindented.\n\nSigned-off-by: Christian Couder <chriscool@tuxfamily.org>\n---\n builtin/fast-export.c | 77 ++++++++++++++++++++++---------------------\n 1 file changed, 39 insertions(+), 38 deletions(-)\n\ndiff --git a/builtin/fast-export.c b/builtin/fast-export.c\nindex dc2486f9a8..cb532f6325 100644\n--- a/builtin/fast-export.c\n+++ b/builtin/fast-export.c\n@@ -65,7 +65,7 @@ static int parse_opt_sign_mode(const struct option *opt,\n \t\treturn 0;\n \n \tif (parse_sign_mode(arg, val))\n-\t\treturn error(\"Unknown %s mode: %s\", opt->long_name, arg);\n+\t\treturn error(_(\"Unknown %s mode: %s\"), opt->long_name, arg);\n \n \treturn 0;\n }\n@@ -82,7 +82,7 @@ static int parse_opt_tag_of_filtered_mode(const struct option *opt,\n \telse if (!strcmp(arg, \"rewrite\"))\n \t\t*val = REWRITE;\n \telse\n-\t\treturn error(\"Unknown tag-of-filtered mode: %s\", arg);\n+\t\treturn error(_(\"Unknown tag-of-filtered mode: %s\"), arg);\n \treturn 0;\n }\n \n@@ -107,7 +107,7 @@ static int parse_opt_reencode_mode(const struct option *opt,\n \t\tif (!strcasecmp(arg, \"abort\"))\n \t\t\t*val = REENCODE_ABORT;\n \t\telse\n-\t\t\treturn error(\"Unknown reencoding mode: %s\", arg);\n+\t\t\treturn error(_(\"Unknown reencoding mode: %s\"), arg);\n \t}\n \n \treturn 0;\n@@ -318,16 +318,16 @@ static void export_blob(const struct object_id *oid)\n \t} else {\n \t\tbuf = odb_read_object(the_repository->objects, oid, &type, &size);\n \t\tif (!buf)\n-\t\t\tdie(\"could not read blob %s\", oid_to_hex(oid));\n+\t\t\tdie(_(\"could not read blob %s\"), oid_to_hex(oid));\n \t\tif (check_object_signature(the_repository, oid, buf, size,\n \t\t\t\t\t   type) < 0)\n-\t\t\tdie(\"oid mismatch in blob %s\", oid_to_hex(oid));\n+\t\t\tdie(_(\"oid mismatch in blob %s\"), oid_to_hex(oid));\n \t\tobject = parse_object_buffer(the_repository, oid, type,\n \t\t\t\t\t     size, buf, &eaten);\n \t}\n \n \tif (!object)\n-\t\tdie(\"Could not read blob %s\", oid_to_hex(oid));\n+\t\tdie(_(\"Could not read blob %s\"), oid_to_hex(oid));\n \n \tmark_next_object(object);\n \n@@ -336,7 +336,7 @@ static void export_blob(const struct object_id *oid)\n \t\tprintf(\"original-oid %s\\n\", oid_to_hex(oid));\n \tprintf(\"data %\"PRIuMAX\"\\n\", (uintmax_t)size);\n \tif (size && fwrite(buf, size, 1, stdout) != 1)\n-\t\tdie_errno(\"could not write blob '%s'\", oid_to_hex(oid));\n+\t\tdie_errno(_(\"could not write blob '%s'\"), oid_to_hex(oid));\n \tprintf(\"\\n\");\n \n \tshow_progress();\n@@ -499,10 +499,10 @@ static void show_filemodify(struct diff_queue_struct *q,\n \t\t\tbreak;\n \n \t\tdefault:\n-\t\t\tdie(\"Unexpected comparison status '%c' for %s, %s\",\n-\t\t\t\tq->queue[i]->status,\n-\t\t\t\tospec->path ? ospec->path : \"none\",\n-\t\t\t\tspec->path ? spec->path : \"none\");\n+\t\t\tdie(_(\"Unexpected comparison status '%c' for %s, %s\"),\n+\t\t\t    q->queue[i]->status,\n+\t\t\t    ospec->path ? ospec->path : _(\"none\"),\n+\t\t\t    spec->path ? spec->path : _(\"none\"));\n \t\t}\n \t}\n }\n@@ -699,14 +699,14 @@ static void handle_commit(struct commit *commit, struct rev_info *rev,\n \n \tauthor = strstr(commit_buffer_cursor, \"\\nauthor \");\n \tif (!author)\n-\t\tdie(\"could not find author in commit %s\",\n+\t\tdie(_(\"could not find author in commit %s\"),\n \t\t    oid_to_hex(&commit->object.oid));\n \tauthor++;\n \tcommit_buffer_cursor = author_end = strchrnul(author, '\\n');\n \n \tcommitter = strstr(commit_buffer_cursor, \"\\ncommitter \");\n \tif (!committer)\n-\t\tdie(\"could not find committer in commit %s\",\n+\t\tdie(_(\"could not find committer in commit %s\"),\n \t\t    oid_to_hex(&commit->object.oid));\n \tcommitter++;\n \tcommit_buffer_cursor = committer_end = strchrnul(committer, '\\n');\n@@ -781,8 +781,8 @@ static void handle_commit(struct commit *commit, struct rev_info *rev,\n \t\tcase REENCODE_NO:\n \t\t\tbreak;\n \t\tcase REENCODE_ABORT:\n-\t\t\tdie(\"Encountered commit-specific encoding %.*s in commit \"\n-\t\t\t    \"%s; use --reencode=[yes|no] to handle it\",\n+\t\t\tdie(_(\"Encountered commit-specific encoding %.*s in commit \"\n+\t\t\t      \"%s; use --reencode=[yes|no] to handle it\"),\n \t\t\t    (int)encoding_len, encoding,\n \t\t\t    oid_to_hex(&commit->object.oid));\n \t\t}\n@@ -798,11 +798,11 @@ static void handle_commit(struct commit *commit, struct rev_info *rev,\n \tif (signatures.nr) {\n \t\tswitch (signed_commit_mode) {\n \t\tcase SIGN_ABORT:\n-\t\t\tdie(\"encountered signed commit %s; use \"\n-\t\t\t    \"--signed-commits=<mode> to handle it\",\n+\t\t\tdie(_(\"encountered signed commit %s; use \"\n+\t\t\t      \"--signed-commits=<mode> to handle it\"),\n \t\t\t    oid_to_hex(&commit->object.oid));\n \t\tcase SIGN_WARN_VERBATIM:\n-\t\t\twarning(\"exporting %\"PRIuMAX\" signature(s) for commit %s\",\n+\t\t\twarning(_(\"exporting %\"PRIuMAX\" signature(s) for commit %s\"),\n \t\t\t\t(uintmax_t)signatures.nr, oid_to_hex(&commit->object.oid));\n \t\t\t/* fallthru */\n \t\tcase SIGN_VERBATIM:\n@@ -812,7 +812,7 @@ static void handle_commit(struct commit *commit, struct rev_info *rev,\n \t\t\t}\n \t\t\tbreak;\n \t\tcase SIGN_WARN_STRIP:\n-\t\t\twarning(\"stripping signature(s) from commit %s\",\n+\t\t\twarning(_(\"stripping signature(s) from commit %s\"),\n \t\t\t\toid_to_hex(&commit->object.oid));\n \t\t\t/* fallthru */\n \t\tcase SIGN_STRIP:\n@@ -890,7 +890,8 @@ static void handle_tag(const char *name, struct tag *tag)\n \t\ttagged = ((struct tag *)tagged)->tagged;\n \t}\n \tif (tagged->type == OBJ_TREE) {\n-\t\twarning(\"Omitting tag %s,\\nsince tags of trees (or tags of tags of trees, etc.) are not supported.\",\n+\t\twarning(_(\"Omitting tag %s,\\nsince tags of trees (or tags \"\n+\t\t\t  \"of tags of trees, etc.) are not supported.\"),\n \t\t\toid_to_hex(&tag->object.oid));\n \t\treturn;\n \t}\n@@ -898,7 +899,7 @@ static void handle_tag(const char *name, struct tag *tag)\n \tbuf = odb_read_object(the_repository->objects, &tag->object.oid,\n \t\t\t      &type, &size);\n \tif (!buf)\n-\t\tdie(\"could not read tag %s\", oid_to_hex(&tag->object.oid));\n+\t\tdie(_(\"could not read tag %s\"), oid_to_hex(&tag->object.oid));\n \tmessage = memmem(buf, size, \"\\n\\n\", 2);\n \tif (message) {\n \t\tmessage += 2;\n@@ -936,17 +937,17 @@ static void handle_tag(const char *name, struct tag *tag)\n \t\tif (signature)\n \t\t\tswitch (signed_tag_mode) {\n \t\t\tcase SIGN_ABORT:\n-\t\t\t\tdie(\"encountered signed tag %s; use \"\n-\t\t\t\t    \"--signed-tags=<mode> to handle it\",\n+\t\t\t\tdie(_(\"encountered signed tag %s; use \"\n+\t\t\t\t      \"--signed-tags=<mode> to handle it\"),\n \t\t\t\t    oid_to_hex(&tag->object.oid));\n \t\t\tcase SIGN_WARN_VERBATIM:\n-\t\t\t\twarning(\"exporting signed tag %s\",\n+\t\t\t\twarning(_(\"exporting signed tag %s\"),\n \t\t\t\t\toid_to_hex(&tag->object.oid));\n \t\t\t\t/* fallthru */\n \t\t\tcase SIGN_VERBATIM:\n \t\t\t\tbreak;\n \t\t\tcase SIGN_WARN_STRIP:\n-\t\t\t\twarning(\"stripping signature from tag %s\",\n+\t\t\t\twarning(_(\"stripping signature from tag %s\"),\n \t\t\t\t\toid_to_hex(&tag->object.oid));\n \t\t\t\t/* fallthru */\n \t\t\tcase SIGN_STRIP:\n@@ -961,8 +962,8 @@ static void handle_tag(const char *name, struct tag *tag)\n \tif (!tagged_mark) {\n \t\tswitch (tag_of_filtered_mode) {\n \t\tcase TAG_FILTERING_ABORT:\n-\t\t\tdie(\"tag %s tags unexported object; use \"\n-\t\t\t    \"--tag-of-filtered-object=<mode> to handle it\",\n+\t\t\tdie(_(\"tag %s tags unexported object; use \"\n+\t\t\t      \"--tag-of-filtered-object=<mode> to handle it\"),\n \t\t\t    oid_to_hex(&tag->object.oid));\n \t\tcase DROP:\n \t\t\t/* Ignore this tag altogether */\n@@ -1026,7 +1027,7 @@ static struct commit *get_commit(struct rev_cmdline_entry *e, const char *full_n\n \t\t\ttag = (struct tag *)tag->tagged;\n \t\t}\n \t\tif (!tag)\n-\t\t\tdie(\"Tag %s points nowhere?\", e->name);\n+\t\t\tdie(_(\"Tag %s points nowhere?\"), e->name);\n \t\treturn (struct commit *)tag;\n \t}\n \tdefault:\n@@ -1064,7 +1065,7 @@ static void get_tags_and_duplicates(struct rev_cmdline_info *info)\n \n \t\tcommit = get_commit(e, full_name);\n \t\tif (!commit) {\n-\t\t\twarning(\"%s: Unexpected object of type %s, skipping.\",\n+\t\t\twarning(_(\"%s: Unexpected object of type %s, skipping.\"),\n \t\t\t\te->name,\n \t\t\t\ttype_name(e->item->type));\n \t\t\tfree(full_name);\n@@ -1079,7 +1080,7 @@ static void get_tags_and_duplicates(struct rev_cmdline_info *info)\n \t\t\tfree(full_name);\n \t\t\tcontinue;\n \t\tdefault: /* OBJ_TAG (nested tags) is already handled */\n-\t\t\twarning(\"Tag points to object of unexpected type %s, skipping.\",\n+\t\t\twarning(_(\"Tag points to object of unexpected type %s, skipping.\"),\n \t\t\t\ttype_name(commit->object.type));\n \t\t\tfree(full_name);\n \t\t\tcontinue;\n@@ -1175,7 +1176,7 @@ static void export_marks(char *file)\n \n \tf = fopen_for_writing(file);\n \tif (!f)\n-\t\tdie_errno(\"Unable to open marks file %s for writing.\", file);\n+\t\tdie_errno(_(\"Unable to open marks file %s for writing.\"), file);\n \n \tfor (i = 0; i < idnums.size; i++) {\n \t\tif (deco->base && deco->base->type == 1) {\n@@ -1192,7 +1193,7 @@ static void export_marks(char *file)\n \te |= ferror(f);\n \te |= fclose(f);\n \tif (e)\n-\t\terror(\"Unable to write marks file %s.\", file);\n+\t\terror(_(\"Unable to write marks file %s.\"), file);\n }\n \n static void import_marks(char *input_file, int check_exists)\n@@ -1215,20 +1216,20 @@ static void import_marks(char *input_file, int check_exists)\n \n \t\tline_end = strchr(line, '\\n');\n \t\tif (line[0] != ':' || !line_end)\n-\t\t\tdie(\"corrupt mark line: %s\", line);\n+\t\t\tdie(_(\"corrupt mark line: %s\"), line);\n \t\t*line_end = '\\0';\n \n \t\tmark = strtoumax(line + 1, &mark_end, 10);\n \t\tif (!mark || mark_end == line + 1\n \t\t\t|| *mark_end != ' ' || get_oid_hex(mark_end + 1, &oid))\n-\t\t\tdie(\"corrupt mark line: %s\", line);\n+\t\t\tdie(_(\"corrupt mark line: %s\"), line);\n \n \t\tif (last_idnum < mark)\n \t\t\tlast_idnum = mark;\n \n \t\ttype = odb_read_object_info(the_repository->objects, &oid, NULL);\n \t\tif (type < 0)\n-\t\t\tdie(\"object not found: %s\", oid_to_hex(&oid));\n+\t\t\tdie(_(\"object not found: %s\"), oid_to_hex(&oid));\n \n \t\tif (type != OBJ_COMMIT)\n \t\t\t/* only commits */\n@@ -1236,12 +1237,12 @@ static void import_marks(char *input_file, int check_exists)\n \n \t\tcommit = lookup_commit(the_repository, &oid);\n \t\tif (!commit)\n-\t\t\tdie(\"not a commit? can't happen: %s\", oid_to_hex(&oid));\n+\t\t\tdie(_(\"not a commit? can't happen: %s\"), oid_to_hex(&oid));\n \n \t\tobject = &commit->object;\n \n \t\tif (object->flags & SHOWN)\n-\t\t\terror(\"Object %s already has a mark\", oid_to_hex(&oid));\n+\t\t\terror(_(\"Object %s already has a mark\"), oid_to_hex(&oid));\n \n \t\tmark_object(object, mark);\n \n@@ -1395,7 +1396,7 @@ int cmd_fast_export(int argc,\n \tget_tags_and_duplicates(&revs.cmdline);\n \n \tif (prepare_revision_walk(&revs))\n-\t\tdie(\"revision walk setup failed\");\n+\t\tdie(_(\"revision walk setup failed\"));\n \n \trevs.reverse = 1;\n \trevs.diffopt.format_callback = show_filemodify;\n-- \n2.51.2.540.g4ad31e1014\n\n"},{"id":"529768","messageId":"20251028081232.3068147-5-christian.couder@gmail.com","threadId":"64397","inReplyTo":"20251028081232.3068147-1-christian.couder@gmail.com","subject":"[PATCH 4/5] fast-import: mark strings for translation","fromName":"Christian Couder","fromEmail":"christian.couder@gmail.com","sentAt":"2025-10-28T08:12:31Z","receivedAt":"2025-10-28T08:13:09Z","isPatch":true,"sender":{"key":"christian.couder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/208954?v=4"},"body":"Some error or warning messages in \"builtin/fast-import.c\" are marked\nfor translation, but many are not.\n\nTo be more consistent and provide a better experience to people using a\ntranslated version, let's mark all the remaining error or warning\nmessages for translation.\n\nWhile at it, let's make the following small changes:\n\n  - replace \"GIT\" or \"git\" in a few error messages to just \"Git\",\n  - replace \"Expected from command, got %s\" to \"Expected 'from'\n    command, got '%s'\", which makes it clearer that \"from\" is a command\n    and should not be translated,\n  - adjust the indentation of some arguments of the error functions.\n\nSigned-off-by: Christian Couder <chriscool@tuxfamily.org>\n---\n builtin/fast-import.c | 270 +++++++++++++++++++++---------------------\n 1 file changed, 135 insertions(+), 135 deletions(-)\n\ndiff --git a/builtin/fast-import.c b/builtin/fast-import.c\nindex 606c6aea82..96ff0c7360 100644\n--- a/builtin/fast-import.c\n+++ b/builtin/fast-import.c\n@@ -338,12 +338,12 @@ static void write_crash_report(const char *err)\n \tstruct recent_command *rc;\n \n \tif (!rpt) {\n-\t\terror_errno(\"can't write crash report %s\", loc);\n+\t\terror_errno(_(\"can't write crash report %s\"), loc);\n \t\tfree(loc);\n \t\treturn;\n \t}\n \n-\tfprintf(stderr, \"fast-import: dumping crash report to %s\\n\", loc);\n+\tfprintf(stderr, _(\"fast-import: dumping crash report to %s\\n\"), loc);\n \n \tfprintf(rpt, \"fast-import crash report:\\n\");\n \tfprintf(rpt, \"    fast-import process: %\"PRIuMAX\"\\n\", (uintmax_t) getpid());\n@@ -587,7 +587,7 @@ static void *find_mark(struct mark_set *s, uintmax_t idnum)\n \t\t\toe = s->data.marked[idnum];\n \t}\n \tif (!oe)\n-\t\tdie(\"mark :%\" PRIuMAX \" not declared\", orig_idnum);\n+\t\tdie(_(\"mark :%\" PRIuMAX \" not declared\"), orig_idnum);\n \treturn oe;\n }\n \n@@ -627,9 +627,9 @@ static struct branch *new_branch(const char *name)\n \tstruct branch *b = lookup_branch(name);\n \n \tif (b)\n-\t\tdie(\"Invalid attempt to create duplicate branch: %s\", name);\n+\t\tdie(_(\"Invalid attempt to create duplicate branch: %s\"), name);\n \tif (check_refname_format(name, REFNAME_ALLOW_ONELEVEL))\n-\t\tdie(\"Branch name doesn't conform to GIT standards: %s\", name);\n+\t\tdie(_(\"Branch name doesn't conform to Git standards: %s\"), name);\n \n \tb = mem_pool_calloc(&fi_mem_pool, 1, sizeof(struct branch));\n \tb->name = mem_pool_strdup(&fi_mem_pool, name);\n@@ -800,7 +800,7 @@ static const char *create_index(void)\n \t\t\t\t*c++ = &e->idx;\n \tlast = idx + object_count;\n \tif (c != last)\n-\t\tdie(\"internal consistency error creating the index\");\n+\t\tdie(_(\"internal consistency error creating the index\"));\n \n \ttmpfile = write_idx_file(the_repository, NULL, idx, object_count,\n \t\t\t\t &pack_idx_opts, pack_data->hash);\n@@ -818,18 +818,18 @@ static char *keep_pack(const char *curr_index_name)\n \tkeep_fd = safe_create_file_with_leading_directories(pack_data->repo,\n \t\t\t\t\t\t\t    name.buf);\n \tif (keep_fd < 0)\n-\t\tdie_errno(\"cannot create keep file\");\n+\t\tdie_errno(_(\"cannot create keep file\"));\n \twrite_or_die(keep_fd, keep_msg, strlen(keep_msg));\n \tif (close(keep_fd))\n-\t\tdie_errno(\"failed to write keep file\");\n+\t\tdie_errno(_(\"failed to write keep file\"));\n \n \todb_pack_name(pack_data->repo, &name, pack_data->hash, \"pack\");\n \tif (finalize_object_file(pack_data->repo, pack_data->pack_name, name.buf))\n-\t\tdie(\"cannot store pack file\");\n+\t\tdie(_(\"cannot store pack file\"));\n \n \todb_pack_name(pack_data->repo, &name, pack_data->hash, \"idx\");\n \tif (finalize_object_file(pack_data->repo, curr_index_name, name.buf))\n-\t\tdie(\"cannot store index file\");\n+\t\tdie(_(\"cannot store index file\"));\n \tfree((void *)curr_index_name);\n \treturn strbuf_detach(&name, NULL);\n }\n@@ -852,7 +852,7 @@ static int loosen_small_pack(const struct packed_git *p)\n \tstruct child_process unpack = CHILD_PROCESS_INIT;\n \n \tif (lseek(p->pack_fd, 0, SEEK_SET) < 0)\n-\t\tdie_errno(\"Failed seeking to start of '%s'\", p->pack_name);\n+\t\tdie_errno(_(\"Failed seeking to start of '%s'\"), p->pack_name);\n \n \tunpack.in = p->pack_fd;\n \tunpack.git_cmd = 1;\n@@ -902,7 +902,7 @@ static void end_packfile(void)\n \t\tnew_p = packfile_store_load_pack(pack_data->repo->objects->packfiles,\n \t\t\t\t\t\t idx_name, 1);\n \t\tif (!new_p)\n-\t\t\tdie(\"core git rejected index %s\", idx_name);\n+\t\t\tdie(_(\"core Git rejected index %s\"), idx_name);\n \t\tall_packs[pack_id] = new_p;\n \t\tfree(idx_name);\n \n@@ -1089,7 +1089,7 @@ static int store_object(\n static void truncate_pack(struct hashfile_checkpoint *checkpoint)\n {\n \tif (hashfile_truncate(pack_file, checkpoint))\n-\t\tdie_errno(\"cannot truncate pack to skip duplicate\");\n+\t\tdie_errno(_(\"cannot truncate pack to skip duplicate\"));\n \tpack_size = checkpoint->offset;\n }\n \n@@ -1137,7 +1137,7 @@ static void stream_blob(uintmax_t len, struct object_id *oidout, uintmax_t mark)\n \t\t\tsize_t cnt = in_sz < len ? in_sz : (size_t)len;\n \t\t\tsize_t n = fread(in_buf, 1, cnt, stdin);\n \t\t\tif (!n && feof(stdin))\n-\t\t\t\tdie(\"EOF in data (%\" PRIuMAX \" bytes remaining)\", len);\n+\t\t\t\tdie(_(\"EOF in data (%\" PRIuMAX \" bytes remaining)\"), len);\n \n \t\t\tgit_hash_update(&c, in_buf, n);\n \t\t\ts.next_in = in_buf;\n@@ -1161,7 +1161,7 @@ static void stream_blob(uintmax_t len, struct object_id *oidout, uintmax_t mark)\n \t\tcase Z_STREAM_END:\n \t\t\tcontinue;\n \t\tdefault:\n-\t\t\tdie(\"unexpected deflate failure: %d\", status);\n+\t\t\tdie(_(\"unexpected deflate failure: %d\"), status);\n \t\t}\n \t}\n \tgit_deflate_end(&s);\n@@ -1263,16 +1263,16 @@ static void load_tree(struct tree_entry *root)\n \tmyoe = find_object(oid);\n \tif (myoe && myoe->pack_id != MAX_PACK_ID) {\n \t\tif (myoe->type != OBJ_TREE)\n-\t\t\tdie(\"Not a tree: %s\", oid_to_hex(oid));\n+\t\t\tdie(_(\"Not a tree: %s\"), oid_to_hex(oid));\n \t\tt->delta_depth = myoe->depth;\n \t\tbuf = gfi_unpack_entry(myoe, &size);\n \t\tif (!buf)\n-\t\t\tdie(\"Can't load tree %s\", oid_to_hex(oid));\n+\t\t\tdie(_(\"Can't load tree %s\"), oid_to_hex(oid));\n \t} else {\n \t\tenum object_type type;\n \t\tbuf = odb_read_object(the_repository->objects, oid, &type, &size);\n \t\tif (!buf || type != OBJ_TREE)\n-\t\t\tdie(\"Can't load tree %s\", oid_to_hex(oid));\n+\t\t\tdie(_(\"Can't load tree %s\"), oid_to_hex(oid));\n \t}\n \n \tc = buf;\n@@ -1286,7 +1286,7 @@ static void load_tree(struct tree_entry *root)\n \t\te->tree = NULL;\n \t\tc = parse_mode(c, &e->versions[1].mode);\n \t\tif (!c)\n-\t\t\tdie(\"Corrupt mode in %s\", oid_to_hex(oid));\n+\t\t\tdie(_(\"Corrupt mode in %s\"), oid_to_hex(oid));\n \t\te->versions[0].mode = e->versions[1].mode;\n \t\te->name = to_atom(c, strlen(c));\n \t\tc += e->name->str_len + 1;\n@@ -1398,7 +1398,7 @@ static void tree_content_replace(\n \tstruct tree_content *newtree)\n {\n \tif (!S_ISDIR(mode))\n-\t\tdie(\"Root cannot be a non-directory\");\n+\t\tdie(_(\"Root cannot be a non-directory\"));\n \toidclr(&root->versions[0].oid, the_repository->hash_algo);\n \toidcpy(&root->versions[1].oid, oid);\n \tif (root->tree)\n@@ -1421,9 +1421,9 @@ static int tree_content_set(\n \tslash1 = strchrnul(p, '/');\n \tn = slash1 - p;\n \tif (!n)\n-\t\tdie(\"Empty path component found in input\");\n+\t\tdie(_(\"Empty path component found in input\"));\n \tif (!*slash1 && !S_ISDIR(mode) && subtree)\n-\t\tdie(\"Non-directories cannot have subtrees\");\n+\t\tdie(_(\"Non-directories cannot have subtrees\"));\n \n \tif (!root->tree)\n \t\tload_tree(root);\n@@ -1575,7 +1575,7 @@ static int tree_content_get(\n \tslash1 = strchrnul(p, '/');\n \tn = slash1 - p;\n \tif (!n && !allow_root)\n-\t\tdie(\"Empty path component found in input\");\n+\t\tdie(_(\"Empty path component found in input\"));\n \n \tif (!root->tree)\n \t\tload_tree(root);\n@@ -1621,8 +1621,8 @@ static int update_branch(struct branch *b)\n \t    !strcmp(b->name + strlen(replace_prefix),\n \t\t    oid_to_hex(&b->oid))) {\n \t\tif (!quiet)\n-\t\t\twarning(\"Dropping %s since it would point to \"\n-\t\t\t\t\"itself (i.e. to %s)\",\n+\t\t\twarning(_(\"Dropping %s since it would point to \"\n+\t\t\t\t  \"itself (i.e. to %s)\"),\n \t\t\t\tb->name, oid_to_hex(&b->oid));\n \t\trefs_delete_ref(get_main_ref_store(the_repository),\n \t\t\t\tNULL, b->name, NULL, 0);\n@@ -1645,14 +1645,14 @@ static int update_branch(struct branch *b)\n \t\tnew_cmit = lookup_commit_reference_gently(the_repository,\n \t\t\t\t\t\t\t  &b->oid, 0);\n \t\tif (!old_cmit || !new_cmit)\n-\t\t\treturn error(\"Branch %s is missing commits.\", b->name);\n+\t\t\treturn error(_(\"Branch %s is missing commits.\"), b->name);\n \n \t\tret = repo_in_merge_bases(the_repository, old_cmit, new_cmit);\n \t\tif (ret < 0)\n \t\t\texit(128);\n \t\tif (!ret) {\n-\t\t\twarning(\"Not updating %s\"\n-\t\t\t\t\" (new tip %s does not contain %s)\",\n+\t\t\twarning(_(\"Not updating %s\"\n+\t\t\t\t  \" (new tip %s does not contain %s)\"),\n \t\t\t\tb->name, oid_to_hex(&b->oid),\n \t\t\t\toid_to_hex(&old_oid));\n \t\t\treturn -1;\n@@ -1728,13 +1728,13 @@ static void dump_marks(void)\n \t\treturn;\n \n \tif (safe_create_leading_directories_const(the_repository, export_marks_file)) {\n-\t\tfailure |= error_errno(\"unable to create leading directories of %s\",\n+\t\tfailure |= error_errno(_(\"unable to create leading directories of %s\"),\n \t\t\t\t       export_marks_file);\n \t\treturn;\n \t}\n \n \tif (hold_lock_file_for_update(&mark_lock, export_marks_file, 0) < 0) {\n-\t\tfailure |= error_errno(\"Unable to write marks file %s\",\n+\t\tfailure |= error_errno(_(\"Unable to write marks file %s\"),\n \t\t\t\t       export_marks_file);\n \t\treturn;\n \t}\n@@ -1743,14 +1743,14 @@ static void dump_marks(void)\n \tif (!f) {\n \t\tint saved_errno = errno;\n \t\trollback_lock_file(&mark_lock);\n-\t\tfailure |= error(\"Unable to write marks file %s: %s\",\n+\t\tfailure |= error(_(\"Unable to write marks file %s: %s\"),\n \t\t\texport_marks_file, strerror(saved_errno));\n \t\treturn;\n \t}\n \n \tfor_each_mark(marks, 0, dump_marks_fn, f);\n \tif (commit_lock_file(&mark_lock)) {\n-\t\tfailure |= error_errno(\"Unable to write file %s\",\n+\t\tfailure |= error_errno(_(\"Unable to write file %s\"),\n \t\t\t\t       export_marks_file);\n \t\treturn;\n \t}\n@@ -1764,7 +1764,7 @@ static void insert_object_entry(struct mark_set **s, struct object_id *oid, uint\n \t\tenum object_type type = odb_read_object_info(the_repository->objects,\n \t\t\t\t\t\t\t     oid, NULL);\n \t\tif (type < 0)\n-\t\t\tdie(\"object not found: %s\", oid_to_hex(oid));\n+\t\t\tdie(_(\"object not found: %s\"), oid_to_hex(oid));\n \t\te = insert_object(oid);\n \t\te->type = type;\n \t\te->pack_id = MAX_PACK_ID;\n@@ -1791,13 +1791,13 @@ static void read_mark_file(struct mark_set **s, FILE *f, mark_set_inserter_t ins\n \n \t\tend = strchr(line, '\\n');\n \t\tif (line[0] != ':' || !end)\n-\t\t\tdie(\"corrupt mark line: %s\", line);\n+\t\t\tdie(_(\"corrupt mark line: %s\"), line);\n \t\t*end = 0;\n \t\tmark = strtoumax(line + 1, &end, 10);\n \t\tif (!mark || end == line + 1\n \t\t\t|| *end != ' '\n \t\t\t|| get_oid_hex_any(end + 1, &oid) == GIT_HASH_UNKNOWN)\n-\t\t\tdie(\"corrupt mark line: %s\", line);\n+\t\t\tdie(_(\"corrupt mark line: %s\"), line);\n \t\tinserter(s, &oid, mark);\n \t}\n }\n@@ -1810,7 +1810,7 @@ static void read_marks(void)\n \telse if (import_marks_file_ignore_missing && errno == ENOENT)\n \t\tgoto done; /* Marks file does not exist */\n \telse\n-\t\tdie_errno(\"cannot read '%s'\", import_marks_file);\n+\t\tdie_errno(_(\"cannot read '%s'\"), import_marks_file);\n \tread_mark_file(&marks, f, insert_object_entry);\n \tfclose(f);\n done:\n@@ -1896,7 +1896,7 @@ static int parse_data(struct strbuf *sb, uintmax_t limit, uintmax_t *len_res)\n \tstrbuf_reset(sb);\n \n \tif (!skip_prefix(command_buf.buf, \"data \", &data))\n-\t\tdie(\"Expected 'data n' command, found: %s\", command_buf.buf);\n+\t\tdie(_(\"Expected 'data n' command, found: %s\"), command_buf.buf);\n \n \tif (skip_prefix(data, \"<<\", &data)) {\n \t\tchar *term = xstrdup(data);\n@@ -1904,7 +1904,7 @@ static int parse_data(struct strbuf *sb, uintmax_t limit, uintmax_t *len_res)\n \n \t\tfor (;;) {\n \t\t\tif (strbuf_getline_lf(&command_buf, stdin) == EOF)\n-\t\t\t\tdie(\"EOF in data (terminator '%s' not found)\", term);\n+\t\t\t\tdie(_(\"EOF in data (terminator '%s' not found)\"), term);\n \t\t\tif (term_len == command_buf.len\n \t\t\t\t&& !strcmp(term, command_buf.buf))\n \t\t\t\tbreak;\n@@ -1922,12 +1922,12 @@ static int parse_data(struct strbuf *sb, uintmax_t limit, uintmax_t *len_res)\n \t\t\treturn 0;\n \t\t}\n \t\tif (length < len)\n-\t\t\tdie(\"data is too large to use in this context\");\n+\t\t\tdie(_(\"data is too large to use in this context\"));\n \n \t\twhile (n < length) {\n \t\t\tsize_t s = strbuf_fread(sb, length - n, stdin);\n \t\t\tif (!s && feof(stdin))\n-\t\t\t\tdie(\"EOF in data (%lu bytes remaining)\",\n+\t\t\t\tdie(_(\"EOF in data (%lu bytes remaining)\"),\n \t\t\t\t\t(unsigned long)(length - n));\n \t\t\tn += s;\n \t\t}\n@@ -1984,15 +1984,15 @@ static char *parse_ident(const char *buf)\n \n \tltgt = buf + strcspn(buf, \"<>\");\n \tif (*ltgt != '<')\n-\t\tdie(\"Missing < in ident string: %s\", buf);\n+\t\tdie(_(\"Missing < in ident string: %s\"), buf);\n \tif (ltgt != buf && ltgt[-1] != ' ')\n-\t\tdie(\"Missing space before < in ident string: %s\", buf);\n+\t\tdie(_(\"Missing space before < in ident string: %s\"), buf);\n \tltgt = ltgt + 1 + strcspn(ltgt + 1, \"<>\");\n \tif (*ltgt != '>')\n-\t\tdie(\"Missing > in ident string: %s\", buf);\n+\t\tdie(_(\"Missing > in ident string: %s\"), buf);\n \tltgt++;\n \tif (*ltgt != ' ')\n-\t\tdie(\"Missing space after > in ident string: %s\", buf);\n+\t\tdie(_(\"Missing space after > in ident string: %s\"), buf);\n \tltgt++;\n \tname_len = ltgt - buf;\n \tstrbuf_add(&ident, buf, name_len);\n@@ -2000,19 +2000,19 @@ static char *parse_ident(const char *buf)\n \tswitch (whenspec) {\n \tcase WHENSPEC_RAW:\n \t\tif (validate_raw_date(ltgt, &ident, 1) < 0)\n-\t\t\tdie(\"Invalid raw date \\\"%s\\\" in ident: %s\", ltgt, buf);\n+\t\t\tdie(_(\"Invalid raw date \\\"%s\\\" in ident: %s\"), ltgt, buf);\n \t\tbreak;\n \tcase WHENSPEC_RAW_PERMISSIVE:\n \t\tif (validate_raw_date(ltgt, &ident, 0) < 0)\n-\t\t\tdie(\"Invalid raw date \\\"%s\\\" in ident: %s\", ltgt, buf);\n+\t\t\tdie(_(\"Invalid raw date \\\"%s\\\" in ident: %s\"), ltgt, buf);\n \t\tbreak;\n \tcase WHENSPEC_RFC2822:\n \t\tif (parse_date(ltgt, &ident) < 0)\n-\t\t\tdie(\"Invalid rfc2822 date \\\"%s\\\" in ident: %s\", ltgt, buf);\n+\t\t\tdie(_(\"Invalid rfc2822 date \\\"%s\\\" in ident: %s\"), ltgt, buf);\n \t\tbreak;\n \tcase WHENSPEC_NOW:\n \t\tif (strcmp(\"now\", ltgt))\n-\t\t\tdie(\"Date in ident must be 'now': %s\", buf);\n+\t\t\tdie(_(\"Date in ident must be 'now': %s\"), buf);\n \t\tdatestamp(&ident);\n \t\tbreak;\n \t}\n@@ -2106,7 +2106,7 @@ static void construct_path_with_fanout(const char *hex_sha1,\n {\n \tunsigned int i = 0, j = 0;\n \tif (fanout >= the_hash_algo->rawsz)\n-\t\tdie(\"Too large fanout (%u)\", fanout);\n+\t\tdie(_(\"Too large fanout (%u)\"), fanout);\n \twhile (fanout) {\n \t\tpath[i++] = hex_sha1[j++];\n \t\tpath[i++] = hex_sha1[j++];\n@@ -2180,7 +2180,7 @@ static uintmax_t do_change_note_fanout(\n \n \t\t\t/* Rename fullpath to realpath */\n \t\t\tif (!tree_content_remove(orig_root, fullpath, &leaf, 0))\n-\t\t\t\tdie(\"Failed to remove path %s\", fullpath);\n+\t\t\t\tdie(_(\"Failed to remove path %s\"), fullpath);\n \t\t\ttree_content_set(orig_root, realpath,\n \t\t\t\t&leaf.versions[1].oid,\n \t\t\t\tleaf.versions[1].mode,\n@@ -2253,7 +2253,7 @@ static uintmax_t parse_mark_ref(const char *p, char **endptr)\n \tp++;\n \tmark = strtoumax(p, endptr, 10);\n \tif (*endptr == p)\n-\t\tdie(\"No value after ':' in mark: %s\", command_buf.buf);\n+\t\tdie(_(\"No value after ':' in mark: %s\"), command_buf.buf);\n \treturn mark;\n }\n \n@@ -2268,7 +2268,7 @@ static uintmax_t parse_mark_ref_eol(const char *p)\n \n \tmark = parse_mark_ref(p, &end);\n \tif (*end != '\\0')\n-\t\tdie(\"Garbage after mark: %s\", command_buf.buf);\n+\t\tdie(_(\"Garbage after mark: %s\"), command_buf.buf);\n \treturn mark;\n }\n \n@@ -2283,7 +2283,7 @@ static uintmax_t parse_mark_ref_space(const char **p)\n \n \tmark = parse_mark_ref(*p, &end);\n \tif (*end++ != ' ')\n-\t\tdie(\"Missing space after mark: %s\", command_buf.buf);\n+\t\tdie(_(\"Missing space after mark: %s\"), command_buf.buf);\n \t*p = end;\n \treturn mark;\n }\n@@ -2299,9 +2299,9 @@ static void parse_path(struct strbuf *sb, const char *p, const char **endp,\n {\n \tif (*p == '\"') {\n \t\tif (unquote_c_style(sb, p, endp))\n-\t\t\tdie(\"Invalid %s: %s\", field, command_buf.buf);\n+\t\t\tdie(_(\"Invalid %s: %s\"), field, command_buf.buf);\n \t\tif (strlen(sb->buf) != sb->len)\n-\t\t\tdie(\"NUL in %s: %s\", field, command_buf.buf);\n+\t\t\tdie(_(\"NUL in %s: %s\"), field, command_buf.buf);\n \t} else {\n \t\t/*\n \t\t * Unless we are parsing the last field of a line,\n@@ -2324,7 +2324,7 @@ static void parse_path_eol(struct strbuf *sb, const char *p, const char *field)\n \n \tparse_path(sb, p, &end, 1, field);\n \tif (*end)\n-\t\tdie(\"Garbage after %s: %s\", field, command_buf.buf);\n+\t\tdie(_(\"Garbage after %s: %s\"), field, command_buf.buf);\n }\n \n /*\n@@ -2337,7 +2337,7 @@ static void parse_path_space(struct strbuf *sb, const char *p,\n {\n \tparse_path(sb, p, endp, 0, field);\n \tif (**endp != ' ')\n-\t\tdie(\"Missing space after %s: %s\", field, command_buf.buf);\n+\t\tdie(_(\"Missing space after %s: %s\"), field, command_buf.buf);\n \t(*endp)++;\n }\n \n@@ -2350,7 +2350,7 @@ static void file_change_m(const char *p, struct branch *b)\n \n \tp = parse_mode(p, &mode);\n \tif (!p)\n-\t\tdie(\"Corrupt mode: %s\", command_buf.buf);\n+\t\tdie(_(\"Corrupt mode: %s\"), command_buf.buf);\n \tswitch (mode) {\n \tcase 0644:\n \tcase 0755:\n@@ -2363,7 +2363,7 @@ static void file_change_m(const char *p, struct branch *b)\n \t\t/* ok */\n \t\tbreak;\n \tdefault:\n-\t\tdie(\"Corrupt mode: %s\", command_buf.buf);\n+\t\tdie(_(\"Corrupt mode: %s\"), command_buf.buf);\n \t}\n \n \tif (*p == ':') {\n@@ -2374,10 +2374,10 @@ static void file_change_m(const char *p, struct branch *b)\n \t\toe = NULL; /* not used with inline_data, but makes gcc happy */\n \t} else {\n \t\tif (parse_mapped_oid_hex(p, &oid, &p))\n-\t\t\tdie(\"Invalid dataref: %s\", command_buf.buf);\n+\t\t\tdie(_(\"Invalid dataref: %s\"), command_buf.buf);\n \t\toe = find_object(&oid);\n \t\tif (*p++ != ' ')\n-\t\t\tdie(\"Missing space after SHA1: %s\", command_buf.buf);\n+\t\t\tdie(_(\"Missing space after SHA1: %s\"), command_buf.buf);\n \t}\n \n \tstrbuf_reset(&path);\n@@ -2393,11 +2393,11 @@ static void file_change_m(const char *p, struct branch *b)\n \n \tif (S_ISGITLINK(mode)) {\n \t\tif (inline_data)\n-\t\t\tdie(\"Git links cannot be specified 'inline': %s\",\n+\t\t\tdie(_(\"Git links cannot be specified 'inline': %s\"),\n \t\t\t\tcommand_buf.buf);\n \t\telse if (oe) {\n \t\t\tif (oe->type != OBJ_COMMIT)\n-\t\t\t\tdie(\"Not a commit (actually a %s): %s\",\n+\t\t\t\tdie(_(\"Not a commit (actually a %s): %s\"),\n \t\t\t\t\ttype_name(oe->type), command_buf.buf);\n \t\t}\n \t\t/*\n@@ -2406,7 +2406,7 @@ static void file_change_m(const char *p, struct branch *b)\n \t\t */\n \t} else if (inline_data) {\n \t\tif (S_ISDIR(mode))\n-\t\t\tdie(\"Directories cannot be specified 'inline': %s\",\n+\t\t\tdie(_(\"Directories cannot be specified 'inline': %s\"),\n \t\t\t\tcommand_buf.buf);\n \t\twhile (read_next_command() != EOF) {\n \t\t\tconst char *v;\n@@ -2424,11 +2424,11 @@ static void file_change_m(const char *p, struct branch *b)\n \t\t\t\t\todb_read_object_info(the_repository->objects,\n \t\t\t\t\t\t\t     &oid, NULL);\n \t\tif (type < 0)\n-\t\t\tdie(\"%s not found: %s\",\n-\t\t\t\t\tS_ISDIR(mode) ?  \"Tree\" : \"Blob\",\n-\t\t\t\t\tcommand_buf.buf);\n+\t\t\tdie(_(\"%s not found: %s\"),\n+\t\t\t    S_ISDIR(mode) ?  _(\"Tree\") : _(\"Blob\"),\n+\t\t\t    command_buf.buf);\n \t\tif (type != expected)\n-\t\t\tdie(\"Not a %s (actually a %s): %s\",\n+\t\t\tdie(_(\"Not a %s (actually a %s): %s\"),\n \t\t\t\ttype_name(expected), type_name(type),\n \t\t\t\tcommand_buf.buf);\n \t}\n@@ -2439,7 +2439,7 @@ static void file_change_m(const char *p, struct branch *b)\n \t}\n \n \tif (!verify_path(path.buf, mode))\n-\t\tdie(\"invalid path '%s'\", path.buf);\n+\t\tdie(_(\"invalid path '%s'\"), path.buf);\n \ttree_content_set(&b->branch_tree, path.buf, &oid, mode, NULL);\n }\n \n@@ -2469,7 +2469,7 @@ static void file_change_cr(const char *p, struct branch *b, int rename)\n \telse\n \t\ttree_content_get(&b->branch_tree, source.buf, &leaf, 1);\n \tif (!leaf.versions[1].mode)\n-\t\tdie(\"Path %s not in branch\", source.buf);\n+\t\tdie(_(\"Path %s not in branch\"), source.buf);\n \tif (!*dest.buf) {\t/* C \"path/to/subdir\" \"\" */\n \t\ttree_content_replace(&b->branch_tree,\n \t\t\t&leaf.versions[1].oid,\n@@ -2478,7 +2478,7 @@ static void file_change_cr(const char *p, struct branch *b, int rename)\n \t\treturn;\n \t}\n \tif (!verify_path(dest.buf, leaf.versions[1].mode))\n-\t\tdie(\"invalid path '%s'\", dest.buf);\n+\t\tdie(_(\"invalid path '%s'\"), dest.buf);\n \ttree_content_set(&b->branch_tree, dest.buf,\n \t\t&leaf.versions[1].oid,\n \t\tleaf.versions[1].mode,\n@@ -2520,23 +2520,23 @@ static void note_change_n(const char *p, struct branch *b, unsigned char *old_fa\n \t\toe = NULL; /* not used with inline_data, but makes gcc happy */\n \t} else {\n \t\tif (parse_mapped_oid_hex(p, &oid, &p))\n-\t\t\tdie(\"Invalid dataref: %s\", command_buf.buf);\n+\t\t\tdie(_(\"Invalid dataref: %s\"), command_buf.buf);\n \t\toe = find_object(&oid);\n \t\tif (*p++ != ' ')\n-\t\t\tdie(\"Missing space after SHA1: %s\", command_buf.buf);\n+\t\t\tdie(_(\"Missing space after SHA1: %s\"), command_buf.buf);\n \t}\n \n \t/* <commit-ish> */\n \ts = lookup_branch(p);\n \tif (s) {\n \t\tif (is_null_oid(&s->oid))\n-\t\t\tdie(\"Can't add a note on empty branch.\");\n+\t\t\tdie(_(\"Can't add a note on empty branch.\"));\n \t\toidcpy(&commit_oid, &s->oid);\n \t} else if (*p == ':') {\n \t\tuintmax_t commit_mark = parse_mark_ref_eol(p);\n \t\tstruct object_entry *commit_oe = find_mark(marks, commit_mark);\n \t\tif (commit_oe->type != OBJ_COMMIT)\n-\t\t\tdie(\"Mark :%\" PRIuMAX \" not a commit\", commit_mark);\n+\t\t\tdie(_(\"Mark :%\" PRIuMAX \" not a commit\"), commit_mark);\n \t\toidcpy(&commit_oid, &commit_oe->idx.oid);\n \t} else if (!repo_get_oid(the_repository, p, &commit_oid)) {\n \t\tunsigned long size;\n@@ -2544,25 +2544,25 @@ static void note_change_n(const char *p, struct branch *b, unsigned char *old_fa\n \t\t\t\t\t\t   &commit_oid, OBJ_COMMIT, &size,\n \t\t\t\t\t\t   &commit_oid);\n \t\tif (!buf || size < the_hash_algo->hexsz + 6)\n-\t\t\tdie(\"Not a valid commit: %s\", p);\n+\t\t\tdie(_(\"Not a valid commit: %s\"), p);\n \t\tfree(buf);\n \t} else\n-\t\tdie(\"Invalid ref name or SHA1 expression: %s\", p);\n+\t\tdie(_(\"Invalid ref name or SHA1 expression: %s\"), p);\n \n \tif (inline_data) {\n \t\tread_next_command();\n \t\tparse_and_store_blob(&last_blob, &oid, 0);\n \t} else if (oe) {\n \t\tif (oe->type != OBJ_BLOB)\n-\t\t\tdie(\"Not a blob (actually a %s): %s\",\n+\t\t\tdie(_(\"Not a blob (actually a %s): %s\"),\n \t\t\t\ttype_name(oe->type), command_buf.buf);\n \t} else if (!is_null_oid(&oid)) {\n \t\tenum object_type type = odb_read_object_info(the_repository->objects, &oid,\n \t\t\t\t\t\t\tNULL);\n \t\tif (type < 0)\n-\t\t\tdie(\"Blob not found: %s\", command_buf.buf);\n+\t\t\tdie(_(\"Blob not found: %s\"), command_buf.buf);\n \t\tif (type != OBJ_BLOB)\n-\t\t\tdie(\"Not a blob (actually a %s): %s\",\n+\t\t\tdie(_(\"Not a blob (actually a %s): %s\"),\n \t\t\t    type_name(type), command_buf.buf);\n \t}\n \n@@ -2591,10 +2591,10 @@ static void file_change_deleteall(struct branch *b)\n static void parse_from_commit(struct branch *b, char *buf, unsigned long size)\n {\n \tif (!buf || size < the_hash_algo->hexsz + 6)\n-\t\tdie(\"Not a valid commit: %s\", oid_to_hex(&b->oid));\n+\t\tdie(_(\"Not a valid commit: %s\"), oid_to_hex(&b->oid));\n \tif (memcmp(\"tree \", buf, 5)\n \t\t|| get_oid_hex(buf + 5, &b->branch_tree.versions[1].oid))\n-\t\tdie(\"The commit %s is corrupt\", oid_to_hex(&b->oid));\n+\t\tdie(_(\"The commit %s is corrupt\"), oid_to_hex(&b->oid));\n \toidcpy(&b->branch_tree.versions[0].oid,\n \t       &b->branch_tree.versions[1].oid);\n }\n@@ -2624,7 +2624,7 @@ static int parse_objectish(struct branch *b, const char *objectish)\n \n \ts = lookup_branch(objectish);\n \tif (b == s)\n-\t\tdie(\"Can't create a branch from itself: %s\", b->name);\n+\t\tdie(_(\"Can't create a branch from itself: %s\"), b->name);\n \telse if (s) {\n \t\tstruct object_id *t = &s->branch_tree.versions[1].oid;\n \t\toidcpy(&b->oid, &s->oid);\n@@ -2634,7 +2634,7 @@ static int parse_objectish(struct branch *b, const char *objectish)\n \t\tuintmax_t idnum = parse_mark_ref_eol(objectish);\n \t\tstruct object_entry *oe = find_mark(marks, idnum);\n \t\tif (oe->type != OBJ_COMMIT)\n-\t\t\tdie(\"Mark :%\" PRIuMAX \" not a commit\", idnum);\n+\t\t\tdie(_(\"Mark :%\" PRIuMAX \" not a commit\"), idnum);\n \t\tif (!oideq(&b->oid, &oe->idx.oid)) {\n \t\t\toidcpy(&b->oid, &oe->idx.oid);\n \t\t\tif (oe->pack_id != MAX_PACK_ID) {\n@@ -2651,7 +2651,7 @@ static int parse_objectish(struct branch *b, const char *objectish)\n \t\t\tb->delete = 1;\n \t}\n \telse\n-\t\tdie(\"Invalid ref name or SHA1 expression: %s\", objectish);\n+\t\tdie(_(\"Invalid ref name or SHA1 expression: %s\"), objectish);\n \n \tif (b->branch_tree.tree && !oideq(&oid, &b->branch_tree.versions[1].oid)) {\n \t\trelease_tree_content_recursive(b->branch_tree.tree);\n@@ -2698,7 +2698,7 @@ static struct hash_list *parse_merge(unsigned int *count)\n \t\t\tuintmax_t idnum = parse_mark_ref_eol(from);\n \t\t\tstruct object_entry *oe = find_mark(marks, idnum);\n \t\t\tif (oe->type != OBJ_COMMIT)\n-\t\t\t\tdie(\"Mark :%\" PRIuMAX \" not a commit\", idnum);\n+\t\t\t\tdie(_(\"Mark :%\" PRIuMAX \" not a commit\"), idnum);\n \t\t\toidcpy(&n->oid, &oe->idx.oid);\n \t\t} else if (!repo_get_oid(the_repository, from, &n->oid)) {\n \t\t\tunsigned long size;\n@@ -2706,10 +2706,10 @@ static struct hash_list *parse_merge(unsigned int *count)\n \t\t\t\t\t\t\t   &n->oid, OBJ_COMMIT,\n \t\t\t\t\t\t\t   &size, &n->oid);\n \t\t\tif (!buf || size < the_hash_algo->hexsz + 6)\n-\t\t\t\tdie(\"Not a valid commit: %s\", from);\n+\t\t\t\tdie(_(\"Not a valid commit: %s\"), from);\n \t\t\tfree(buf);\n \t\t} else\n-\t\t\tdie(\"Invalid ref name or SHA1 expression: %s\", from);\n+\t\t\tdie(_(\"Invalid ref name or SHA1 expression: %s\"), from);\n \n \t\tn->next = NULL;\n \t\t*tail = n;\n@@ -2733,8 +2733,8 @@ static void parse_one_signature(struct signature_data *sig, const char *v)\n \tchar *space = strchr(args, ' ');\n \n \tif (!space)\n-\t\tdie(\"Expected gpgsig format: 'gpgsig <hash-algo> <signature-format>', \"\n-\t\t    \"got 'gpgsig %s'\", args);\n+\t\tdie(_(\"Expected gpgsig format: 'gpgsig <hash-algo> <signature-format>', \"\n+\t\t      \"got 'gpgsig %s'\"), args);\n \t*space = '\\0';\n \n \tsig->hash_algo = args;\n@@ -2743,13 +2743,13 @@ static void parse_one_signature(struct signature_data *sig, const char *v)\n \t/* Validate hash algorithm */\n \tif (strcmp(sig->hash_algo, \"sha1\") &&\n \t    strcmp(sig->hash_algo, \"sha256\"))\n-\t\tdie(\"Unknown git hash algorithm in gpgsig: '%s'\", sig->hash_algo);\n+\t\tdie(_(\"Unknown git hash algorithm in gpgsig: '%s'\"), sig->hash_algo);\n \n \t/* Validate signature format */\n \tif (!valid_signature_format(sig->sig_format))\n-\t\tdie(\"Invalid signature format in gpgsig: '%s'\", sig->sig_format);\n+\t\tdie(_(\"Invalid signature format in gpgsig: '%s'\"), sig->sig_format);\n \tif (!strcmp(sig->sig_format, \"unknown\"))\n-\t\twarning(\"'unknown' signature format in gpgsig\");\n+\t\twarning(_(\"'unknown' signature format in gpgsig\"));\n \n \t/* Read signature data */\n \tread_next_command();\n@@ -2788,8 +2788,8 @@ static void store_signature(struct signature_data *stored_sig,\n \t\t\t    const char *hash_type)\n {\n \tif (stored_sig->hash_algo) {\n-\t\twarning(\"multiple %s signatures found, \"\n-\t\t\t\"ignoring additional signature\",\n+\t\twarning(_(\"multiple %s signatures found, \"\n+\t\t\t  \"ignoring additional signature\"),\n \t\t\thash_type);\n \t\tstrbuf_release(&new_sig->data);\n \t\tfree(new_sig->hash_algo);\n@@ -2844,15 +2844,15 @@ static void parse_new_commit(const char *arg)\n \t\tread_next_command();\n \t}\n \tif (!committer)\n-\t\tdie(\"Expected committer but didn't get one\");\n+\t\tdie(_(\"Expected committer but didn't get one\"));\n \n \twhile (skip_prefix(command_buf.buf, \"gpgsig \", &v)) {\n \t\tswitch (signed_commit_mode) {\n \n \t\t/* First, modes that don't need the signature to be parsed */\n \t\tcase SIGN_ABORT:\n-\t\t\tdie(\"encountered signed commit; use \"\n-\t\t\t    \"--signed-commits=<mode> to handle it\");\n+\t\t\tdie(_(\"encountered signed commit; use \"\n+\t\t\t      \"--signed-commits=<mode> to handle it\"));\n \t\tcase SIGN_WARN_STRIP:\n \t\t\twarning(_(\"stripping a commit signature\"));\n \t\t\t/* fallthru */\n@@ -2987,11 +2987,11 @@ static void parse_new_tag(const char *arg)\n \n \t/* from ... */\n \tif (!skip_prefix(command_buf.buf, \"from \", &from))\n-\t\tdie(\"Expected from command, got %s\", command_buf.buf);\n+\t\tdie(_(\"Expected 'from' command, got '%s'\"), command_buf.buf);\n \ts = lookup_branch(from);\n \tif (s) {\n \t\tif (is_null_oid(&s->oid))\n-\t\t\tdie(\"Can't tag an empty branch.\");\n+\t\t\tdie(_(\"Can't tag an empty branch.\"));\n \t\toidcpy(&oid, &s->oid);\n \t\ttype = OBJ_COMMIT;\n \t} else if (*from == ':') {\n@@ -3006,11 +3006,11 @@ static void parse_new_tag(const char *arg)\n \t\t\ttype = odb_read_object_info(the_repository->objects,\n \t\t\t\t\t\t    &oid, NULL);\n \t\t\tif (type < 0)\n-\t\t\t\tdie(\"Not a valid object: %s\", from);\n+\t\t\t\tdie(_(\"Not a valid object: %s\"), from);\n \t\t} else\n \t\t\ttype = oe->type;\n \t} else\n-\t\tdie(\"Invalid ref name or SHA1 expression: %s\", from);\n+\t\tdie(_(\"Invalid ref name or SHA1 expression: %s\"), from);\n \tread_next_command();\n \n \t/* original-oid ... */\n@@ -3099,7 +3099,7 @@ static void parse_reset_branch(const char *arg)\n static void cat_blob_write(const char *buf, unsigned long size)\n {\n \tif (write_in_full(cat_blob_fd, buf, size) < 0)\n-\t\tdie_errno(\"Write to frontend failed\");\n+\t\tdie_errno(_(\"Write to frontend failed\"));\n }\n \n static void cat_blob(struct object_entry *oe, struct object_id *oid)\n@@ -3128,9 +3128,9 @@ static void cat_blob(struct object_entry *oe, struct object_id *oid)\n \t\treturn;\n \t}\n \tif (!buf)\n-\t\tdie(\"Can't read object %s\", oid_to_hex(oid));\n+\t\tdie(_(\"Can't read object %s\"), oid_to_hex(oid));\n \tif (type != OBJ_BLOB)\n-\t\tdie(\"Object %s is a %s but a blob was expected.\",\n+\t\tdie(_(\"Object %s is a %s but a blob was expected.\"),\n \t\t    oid_to_hex(oid), type_name(type));\n \tstrbuf_reset(&line);\n \tstrbuf_addf(&line, \"%s %s %\"PRIuMAX\"\\n\", oid_to_hex(oid),\n@@ -3154,11 +3154,11 @@ static void parse_get_mark(const char *p)\n \n \t/* get-mark SP <object> LF */\n \tif (*p != ':')\n-\t\tdie(\"Not a mark: %s\", p);\n+\t\tdie(_(\"Not a mark: %s\"), p);\n \n \toe = find_mark(marks, parse_mark_ref_eol(p));\n \tif (!oe)\n-\t\tdie(\"Unknown mark: %s\", command_buf.buf);\n+\t\tdie(_(\"Unknown mark: %s\"), command_buf.buf);\n \n \txsnprintf(output, sizeof(output), \"%s\\n\", oid_to_hex(&oe->idx.oid));\n \tcat_blob_write(output, the_hash_algo->hexsz + 1);\n@@ -3173,13 +3173,13 @@ static void parse_cat_blob(const char *p)\n \tif (*p == ':') {\n \t\toe = find_mark(marks, parse_mark_ref_eol(p));\n \t\tif (!oe)\n-\t\t\tdie(\"Unknown mark: %s\", command_buf.buf);\n+\t\t\tdie(_(\"Unknown mark: %s\"), command_buf.buf);\n \t\toidcpy(&oid, &oe->idx.oid);\n \t} else {\n \t\tif (parse_mapped_oid_hex(p, &oid, &p))\n-\t\t\tdie(\"Invalid dataref: %s\", command_buf.buf);\n+\t\t\tdie(_(\"Invalid dataref: %s\"), command_buf.buf);\n \t\tif (*p)\n-\t\t\tdie(\"Garbage after SHA1: %s\", command_buf.buf);\n+\t\t\tdie(_(\"Garbage after SHA1: %s\"), command_buf.buf);\n \t\toe = find_object(&oid);\n \t}\n \n@@ -3197,7 +3197,7 @@ static struct object_entry *dereference(struct object_entry *oe,\n \t\tenum object_type type = odb_read_object_info(the_repository->objects,\n \t\t\t\t\t\t\t     oid, NULL);\n \t\tif (type < 0)\n-\t\t\tdie(\"object not found: %s\", oid_to_hex(oid));\n+\t\t\tdie(_(\"object not found: %s\"), oid_to_hex(oid));\n \t\t/* cache it! */\n \t\toe = insert_object(oid);\n \t\toe->type = type;\n@@ -3211,7 +3211,7 @@ static struct object_entry *dereference(struct object_entry *oe,\n \tcase OBJ_TAG:\n \t\tbreak;\n \tdefault:\n-\t\tdie(\"Not a tree-ish: %s\", command_buf.buf);\n+\t\tdie(_(\"Not a tree-ish: %s\"), command_buf.buf);\n \t}\n \n \tif (oe->pack_id != MAX_PACK_ID) {\t/* in a pack being written */\n@@ -3222,19 +3222,19 @@ static struct object_entry *dereference(struct object_entry *oe,\n \t\t\t\t      &unused, &size);\n \t}\n \tif (!buf)\n-\t\tdie(\"Can't load object %s\", oid_to_hex(oid));\n+\t\tdie(_(\"Can't load object %s\"), oid_to_hex(oid));\n \n \t/* Peel one layer. */\n \tswitch (oe->type) {\n \tcase OBJ_TAG:\n \t\tif (size < hexsz + strlen(\"object \") ||\n \t\t    get_oid_hex(buf + strlen(\"object \"), oid))\n-\t\t\tdie(\"Invalid SHA1 in tag: %s\", command_buf.buf);\n+\t\t\tdie(_(\"Invalid SHA1 in tag: %s\"), command_buf.buf);\n \t\tbreak;\n \tcase OBJ_COMMIT:\n \t\tif (size < hexsz + strlen(\"tree \") ||\n \t\t    get_oid_hex(buf + strlen(\"tree \"), oid))\n-\t\t\tdie(\"Invalid SHA1 in commit: %s\", command_buf.buf);\n+\t\t\tdie(_(\"Invalid SHA1 in commit: %s\"), command_buf.buf);\n \t}\n \n \tfree(buf);\n@@ -3285,14 +3285,14 @@ static struct object_entry *parse_treeish_dataref(const char **p)\n \tif (**p == ':') {\t/* <mark> */\n \t\te = find_mark(marks, parse_mark_ref_space(p));\n \t\tif (!e)\n-\t\t\tdie(\"Unknown mark: %s\", command_buf.buf);\n+\t\t\tdie(_(\"Unknown mark: %s\"), command_buf.buf);\n \t\toidcpy(&oid, &e->idx.oid);\n \t} else {\t/* <sha1> */\n \t\tif (parse_mapped_oid_hex(*p, &oid, p))\n-\t\t\tdie(\"Invalid dataref: %s\", command_buf.buf);\n+\t\t\tdie(_(\"Invalid dataref: %s\"), command_buf.buf);\n \t\te = find_object(&oid);\n \t\tif (*(*p)++ != ' ')\n-\t\t\tdie(\"Missing space after tree-ish: %s\", command_buf.buf);\n+\t\t\tdie(_(\"Missing space after tree-ish: %s\"), command_buf.buf);\n \t}\n \n \twhile (!e || e->type != OBJ_TREE)\n@@ -3336,7 +3336,7 @@ static void parse_ls(const char *p, struct branch *b)\n \t/* ls SP (<tree-ish> SP)? <path> */\n \tif (*p == '\"') {\n \t\tif (!b)\n-\t\t\tdie(\"Not in a commit: %s\", command_buf.buf);\n+\t\t\tdie(_(\"Not in a commit: %s\"), command_buf.buf);\n \t\troot = &b->branch_tree;\n \t} else {\n \t\tstruct object_entry *e = parse_treeish_dataref(&p);\n@@ -3422,7 +3422,7 @@ static void option_import_marks(const char *marks,\n {\n \tif (import_marks_file) {\n \t\tif (from_stream)\n-\t\t\tdie(\"Only one import-marks command allowed per stream\");\n+\t\t\tdie(_(\"Only one import-marks command allowed per stream\"));\n \n \t\t/* read previous mark file */\n \t\tif(!import_marks_file_from_stream)\n@@ -3446,7 +3446,7 @@ static void option_date_format(const char *fmt)\n \telse if (!strcmp(fmt, \"now\"))\n \t\twhenspec = WHENSPEC_NOW;\n \telse\n-\t\tdie(\"unknown --date-format argument %s\", fmt);\n+\t\tdie(_(\"unknown --date-format argument %s\"), fmt);\n }\n \n static unsigned long ulong_arg(const char *option, const char *arg)\n@@ -3454,7 +3454,7 @@ static unsigned long ulong_arg(const char *option, const char *arg)\n \tchar *endptr;\n \tunsigned long rv = strtoul(arg, &endptr, 0);\n \tif (strchr(arg, '-') || endptr == arg || *endptr)\n-\t\tdie(\"%s: argument must be a non-negative integer\", option);\n+\t\tdie(_(\"%s: argument must be a non-negative integer\"), option);\n \treturn rv;\n }\n \n@@ -3462,7 +3462,7 @@ static void option_depth(const char *depth)\n {\n \tmax_depth = ulong_arg(\"--depth\", depth);\n \tif (max_depth > MAX_DEPTH)\n-\t\tdie(\"--depth cannot exceed %u\", MAX_DEPTH);\n+\t\tdie(_(\"--depth cannot exceed %u\"), MAX_DEPTH);\n }\n \n static void option_active_branches(const char *branches)\n@@ -3480,7 +3480,7 @@ static void option_cat_blob_fd(const char *fd)\n {\n \tunsigned long n = ulong_arg(\"--cat-blob-fd\", fd);\n \tif (n > (unsigned long) INT_MAX)\n-\t\tdie(\"--cat-blob-fd cannot exceed %d\", INT_MAX);\n+\t\tdie(_(\"--cat-blob-fd cannot exceed %d\"), INT_MAX);\n \tcat_blob_fd = (int) n;\n }\n \n@@ -3508,7 +3508,7 @@ static void option_rewrite_submodules(const char *arg, struct string_list *list)\n \tf = prefix_filename(global_prefix, f);\n \tfp = fopen(f, \"r\");\n \tif (!fp)\n-\t\tdie_errno(\"cannot read '%s'\", f);\n+\t\tdie_errno(_(\"cannot read '%s'\"), f);\n \tread_mark_file(&ms, fp, insert_oid_entry);\n \tfclose(fp);\n \tfree(f);\n@@ -3525,10 +3525,10 @@ static int parse_one_option(const char *option)\n \t\tif (!git_parse_ulong(option, &v))\n \t\t\treturn 0;\n \t\tif (v < 8192) {\n-\t\t\twarning(\"max-pack-size is now in bytes, assuming --max-pack-size=%lum\", v);\n+\t\t\twarning(_(\"max-pack-size is now in bytes, assuming --max-pack-size=%lum\"), v);\n \t\t\tv *= 1024 * 1024;\n \t\t} else if (v < 1024 * 1024) {\n-\t\t\twarning(\"minimum max-pack-size is 1 MiB\");\n+\t\t\twarning(_(\"minimum max-pack-size is 1 MiB\"));\n \t\t\tv = 1024 * 1024;\n \t\t}\n \t\tmax_packsize = v;\n@@ -3612,23 +3612,23 @@ static int parse_one_feature(const char *feature, int from_stream)\n static void parse_feature(const char *feature)\n {\n \tif (seen_data_command)\n-\t\tdie(\"Got feature command '%s' after data command\", feature);\n+\t\tdie(_(\"Got feature command '%s' after data command\"), feature);\n \n \tif (parse_one_feature(feature, 1))\n \t\treturn;\n \n-\tdie(\"This version of fast-import does not support feature %s.\", feature);\n+\tdie(_(\"This version of fast-import does not support feature %s.\"), feature);\n }\n \n static void parse_option(const char *option)\n {\n \tif (seen_data_command)\n-\t\tdie(\"Got option command '%s' after data command\", option);\n+\t\tdie(_(\"Got option command '%s' after data command\"), option);\n \n \tif (parse_one_option(option))\n \t\treturn;\n \n-\tdie(\"This version of fast-import does not support option: %s\", option);\n+\tdie(_(\"This version of fast-import does not support option: %s\"), option);\n }\n \n static void git_pack_config(void)\n@@ -3672,7 +3672,7 @@ static void parse_argv(void)\n \t\t\tbreak;\n \n \t\tif (!skip_prefix(a, \"--\", &a))\n-\t\t\tdie(\"unknown option %s\", a);\n+\t\t\tdie(_(\"unknown option %s\"), a);\n \n \t\tif (parse_one_option(a))\n \t\t\tcontinue;\n@@ -3685,7 +3685,7 @@ static void parse_argv(void)\n \t\t\tcontinue;\n \t\t}\n \n-\t\tdie(\"unknown option --%s\", a);\n+\t\tdie(_(\"unknown option --%s\"), a);\n \t}\n \tif (i != global_argc)\n \t\tusage(fast_import_usage);\n@@ -3774,7 +3774,7 @@ int cmd_fast_import(int argc,\n \t\telse if (starts_with(command_buf.buf, \"option \"))\n \t\t\t/* ignore non-git options*/;\n \t\telse\n-\t\t\tdie(\"Unsupported command: %s\", command_buf.buf);\n+\t\t\tdie(_(\"Unsupported command: %s\"), command_buf.buf);\n \n \t\tif (checkpoint_requested)\n \t\t\tcheckpoint();\n@@ -3785,7 +3785,7 @@ int cmd_fast_import(int argc,\n \t\tparse_argv();\n \n \tif (require_explicit_termination && feof(stdin))\n-\t\tdie(\"stream ends early\");\n+\t\tdie(_(\"stream ends early\"));\n \n \tend_packfile();\n \n-- \n2.51.2.540.g4ad31e1014\n\n"},{"id":"529769","messageId":"20251028081232.3068147-6-christian.couder@gmail.com","threadId":"64397","inReplyTo":"20251028081232.3068147-1-christian.couder@gmail.com","subject":"[PATCH 5/5] gpg-interface: mark a string for translation","fromName":"Christian Couder","fromEmail":"christian.couder@gmail.com","sentAt":"2025-10-28T08:12:32Z","receivedAt":"2025-10-28T08:13:10Z","isPatch":true,"sender":{"key":"christian.couder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/208954?v=4"},"body":"Previous commits have marked a number of error or warning messages in\n\"builtin/fast-export.c\" and \"builtin/fast-import.c\" for translation.\n\nAs \"gpg-interface.c\" code is used by the fast-export and fast-import\ncode, we should make sure that error or warning messages are also all\nmarked for translation in \"gpg-interface.c\".\n\nTo ensure that, let's mark for translation an error message in a\ndie() function.\n\nWith this, all the error and warning messages emitted by fast-export\nand fast-import can be properly translated.\n\nSigned-off-by: Christian Couder <chriscool@tuxfamily.org>\n---\n gpg-interface.c | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/gpg-interface.c b/gpg-interface.c\nindex 91d1b58cb4..6b895f83ed 100644\n--- a/gpg-interface.c\n+++ b/gpg-interface.c\n@@ -876,7 +876,7 @@ static char *get_default_ssh_signing_key(void)\n \tn = split_cmdline(key_command, &argv);\n \n \tif (n < 0)\n-\t\tdie(\"malformed build-time gpg.ssh.defaultKeyCommand: %s\",\n+\t\tdie(_(\"malformed build-time gpg.ssh.defaultKeyCommand: %s\"),\n \t\t    split_cmdline_strerror(n));\n \n \tstrvec_pushv(&ssh_default_key.args, argv);\n-- \n2.51.2.540.g4ad31e1014\n\n"},{"id":"529792","messageId":"xmqqv7jzdtvl.fsf@gitster.g","threadId":"64397","inReplyTo":"20251028081232.3068147-4-christian.couder@gmail.com","subject":"Re: [PATCH 3/5] fast-export: mark strings for translation","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2025-10-28T13:43:26Z","receivedAt":"2025-10-28T13:43:29Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Christian Couder <christian.couder@gmail.com> writes:\n\n> Some error or warning messages in \"builtin/fast-export.c\" are marked\n> for translation, but many are not.\n>\n> To be more consistent and provide a better experience to people using a\n> translated version, let's mark all the remaining error or warning\n> messages for translation.\n\nMakes sense.  Should we also downcase some Unknown and Unexpected?\n\n> While at it, improve how some arguments to some error functions are\n> indented.\n\nOK.\n\n> Signed-off-by: Christian Couder <chriscool@tuxfamily.org>\n> ---\n>  builtin/fast-export.c | 77 ++++++++++++++++++++++---------------------\n>  1 file changed, 39 insertions(+), 38 deletions(-)\n>\n> diff --git a/builtin/fast-export.c b/builtin/fast-export.c\n> index dc2486f9a8..cb532f6325 100644\n> --- a/builtin/fast-export.c\n> +++ b/builtin/fast-export.c\n> @@ -65,7 +65,7 @@ static int parse_opt_sign_mode(const struct option *opt,\n>  \t\treturn 0;\n>  \n>  \tif (parse_sign_mode(arg, val))\n> -\t\treturn error(\"Unknown %s mode: %s\", opt->long_name, arg);\n> +\t\treturn error(_(\"Unknown %s mode: %s\"), opt->long_name, arg);\n>  \n>  \treturn 0;\n>  }\n> @@ -82,7 +82,7 @@ static int parse_opt_tag_of_filtered_mode(const struct option *opt,\n>  \telse if (!strcmp(arg, \"rewrite\"))\n>  \t\t*val = REWRITE;\n>  \telse\n> -\t\treturn error(\"Unknown tag-of-filtered mode: %s\", arg);\n> +\t\treturn error(_(\"Unknown tag-of-filtered mode: %s\"), arg);\n>  \treturn 0;\n>  }\n>  \n> @@ -107,7 +107,7 @@ static int parse_opt_reencode_mode(const struct option *opt,\n>  \t\tif (!strcasecmp(arg, \"abort\"))\n>  \t\t\t*val = REENCODE_ABORT;\n>  \t\telse\n> -\t\t\treturn error(\"Unknown reencoding mode: %s\", arg);\n> +\t\t\treturn error(_(\"Unknown reencoding mode: %s\"), arg);\n>  \t}\n>  \n>  \treturn 0;\n> @@ -318,16 +318,16 @@ static void export_blob(const struct object_id *oid)\n>  \t} else {\n>  \t\tbuf = odb_read_object(the_repository->objects, oid, &type, &size);\n>  \t\tif (!buf)\n> -\t\t\tdie(\"could not read blob %s\", oid_to_hex(oid));\n> +\t\t\tdie(_(\"could not read blob %s\"), oid_to_hex(oid));\n>  \t\tif (check_object_signature(the_repository, oid, buf, size,\n>  \t\t\t\t\t   type) < 0)\n> -\t\t\tdie(\"oid mismatch in blob %s\", oid_to_hex(oid));\n> +\t\t\tdie(_(\"oid mismatch in blob %s\"), oid_to_hex(oid));\n>  \t\tobject = parse_object_buffer(the_repository, oid, type,\n>  \t\t\t\t\t     size, buf, &eaten);\n>  \t}\n>  \n>  \tif (!object)\n> -\t\tdie(\"Could not read blob %s\", oid_to_hex(oid));\n> +\t\tdie(_(\"Could not read blob %s\"), oid_to_hex(oid));\n>  \n>  \tmark_next_object(object);\n>  \n> @@ -336,7 +336,7 @@ static void export_blob(const struct object_id *oid)\n>  \t\tprintf(\"original-oid %s\\n\", oid_to_hex(oid));\n>  \tprintf(\"data %\"PRIuMAX\"\\n\", (uintmax_t)size);\n>  \tif (size && fwrite(buf, size, 1, stdout) != 1)\n> -\t\tdie_errno(\"could not write blob '%s'\", oid_to_hex(oid));\n> +\t\tdie_errno(_(\"could not write blob '%s'\"), oid_to_hex(oid));\n>  \tprintf(\"\\n\");\n>  \n>  \tshow_progress();\n> @@ -499,10 +499,10 @@ static void show_filemodify(struct diff_queue_struct *q,\n>  \t\t\tbreak;\n>  \n>  \t\tdefault:\n> -\t\t\tdie(\"Unexpected comparison status '%c' for %s, %s\",\n> -\t\t\t\tq->queue[i]->status,\n> -\t\t\t\tospec->path ? ospec->path : \"none\",\n> -\t\t\t\tspec->path ? spec->path : \"none\");\n> +\t\t\tdie(_(\"Unexpected comparison status '%c' for %s, %s\"),\n> +\t\t\t    q->queue[i]->status,\n> +\t\t\t    ospec->path ? ospec->path : _(\"none\"),\n> +\t\t\t    spec->path ? spec->path : _(\"none\"));\n>  \t\t}\n>  \t}\n>  }\n> @@ -699,14 +699,14 @@ static void handle_commit(struct commit *commit, struct rev_info *rev,\n>  \n>  \tauthor = strstr(commit_buffer_cursor, \"\\nauthor \");\n>  \tif (!author)\n> -\t\tdie(\"could not find author in commit %s\",\n> +\t\tdie(_(\"could not find author in commit %s\"),\n>  \t\t    oid_to_hex(&commit->object.oid));\n>  \tauthor++;\n>  \tcommit_buffer_cursor = author_end = strchrnul(author, '\\n');\n>  \n>  \tcommitter = strstr(commit_buffer_cursor, \"\\ncommitter \");\n>  \tif (!committer)\n> -\t\tdie(\"could not find committer in commit %s\",\n> +\t\tdie(_(\"could not find committer in commit %s\"),\n>  \t\t    oid_to_hex(&commit->object.oid));\n>  \tcommitter++;\n>  \tcommit_buffer_cursor = committer_end = strchrnul(committer, '\\n');\n> @@ -781,8 +781,8 @@ static void handle_commit(struct commit *commit, struct rev_info *rev,\n>  \t\tcase REENCODE_NO:\n>  \t\t\tbreak;\n>  \t\tcase REENCODE_ABORT:\n> -\t\t\tdie(\"Encountered commit-specific encoding %.*s in commit \"\n> -\t\t\t    \"%s; use --reencode=[yes|no] to handle it\",\n> +\t\t\tdie(_(\"Encountered commit-specific encoding %.*s in commit \"\n> +\t\t\t      \"%s; use --reencode=[yes|no] to handle it\"),\n>  \t\t\t    (int)encoding_len, encoding,\n>  \t\t\t    oid_to_hex(&commit->object.oid));\n>  \t\t}\n> @@ -798,11 +798,11 @@ static void handle_commit(struct commit *commit, struct rev_info *rev,\n>  \tif (signatures.nr) {\n>  \t\tswitch (signed_commit_mode) {\n>  \t\tcase SIGN_ABORT:\n> -\t\t\tdie(\"encountered signed commit %s; use \"\n> -\t\t\t    \"--signed-commits=<mode> to handle it\",\n> +\t\t\tdie(_(\"encountered signed commit %s; use \"\n> +\t\t\t      \"--signed-commits=<mode> to handle it\"),\n>  \t\t\t    oid_to_hex(&commit->object.oid));\n>  \t\tcase SIGN_WARN_VERBATIM:\n> -\t\t\twarning(\"exporting %\"PRIuMAX\" signature(s) for commit %s\",\n> +\t\t\twarning(_(\"exporting %\"PRIuMAX\" signature(s) for commit %s\"),\n>  \t\t\t\t(uintmax_t)signatures.nr, oid_to_hex(&commit->object.oid));\n>  \t\t\t/* fallthru */\n>  \t\tcase SIGN_VERBATIM:\n> @@ -812,7 +812,7 @@ static void handle_commit(struct commit *commit, struct rev_info *rev,\n>  \t\t\t}\n>  \t\t\tbreak;\n>  \t\tcase SIGN_WARN_STRIP:\n> -\t\t\twarning(\"stripping signature(s) from commit %s\",\n> +\t\t\twarning(_(\"stripping signature(s) from commit %s\"),\n>  \t\t\t\toid_to_hex(&commit->object.oid));\n>  \t\t\t/* fallthru */\n>  \t\tcase SIGN_STRIP:\n> @@ -890,7 +890,8 @@ static void handle_tag(const char *name, struct tag *tag)\n>  \t\ttagged = ((struct tag *)tagged)->tagged;\n>  \t}\n>  \tif (tagged->type == OBJ_TREE) {\n> -\t\twarning(\"Omitting tag %s,\\nsince tags of trees (or tags of tags of trees, etc.) are not supported.\",\n> +\t\twarning(_(\"Omitting tag %s,\\nsince tags of trees (or tags \"\n> +\t\t\t  \"of tags of trees, etc.) are not supported.\"),\n>  \t\t\toid_to_hex(&tag->object.oid));\n>  \t\treturn;\n>  \t}\n> @@ -898,7 +899,7 @@ static void handle_tag(const char *name, struct tag *tag)\n>  \tbuf = odb_read_object(the_repository->objects, &tag->object.oid,\n>  \t\t\t      &type, &size);\n>  \tif (!buf)\n> -\t\tdie(\"could not read tag %s\", oid_to_hex(&tag->object.oid));\n> +\t\tdie(_(\"could not read tag %s\"), oid_to_hex(&tag->object.oid));\n>  \tmessage = memmem(buf, size, \"\\n\\n\", 2);\n>  \tif (message) {\n>  \t\tmessage += 2;\n> @@ -936,17 +937,17 @@ static void handle_tag(const char *name, struct tag *tag)\n>  \t\tif (signature)\n>  \t\t\tswitch (signed_tag_mode) {\n>  \t\t\tcase SIGN_ABORT:\n> -\t\t\t\tdie(\"encountered signed tag %s; use \"\n> -\t\t\t\t    \"--signed-tags=<mode> to handle it\",\n> +\t\t\t\tdie(_(\"encountered signed tag %s; use \"\n> +\t\t\t\t      \"--signed-tags=<mode> to handle it\"),\n>  \t\t\t\t    oid_to_hex(&tag->object.oid));\n>  \t\t\tcase SIGN_WARN_VERBATIM:\n> -\t\t\t\twarning(\"exporting signed tag %s\",\n> +\t\t\t\twarning(_(\"exporting signed tag %s\"),\n>  \t\t\t\t\toid_to_hex(&tag->object.oid));\n>  \t\t\t\t/* fallthru */\n>  \t\t\tcase SIGN_VERBATIM:\n>  \t\t\t\tbreak;\n>  \t\t\tcase SIGN_WARN_STRIP:\n> -\t\t\t\twarning(\"stripping signature from tag %s\",\n> +\t\t\t\twarning(_(\"stripping signature from tag %s\"),\n>  \t\t\t\t\toid_to_hex(&tag->object.oid));\n>  \t\t\t\t/* fallthru */\n>  \t\t\tcase SIGN_STRIP:\n> @@ -961,8 +962,8 @@ static void handle_tag(const char *name, struct tag *tag)\n>  \tif (!tagged_mark) {\n>  \t\tswitch (tag_of_filtered_mode) {\n>  \t\tcase TAG_FILTERING_ABORT:\n> -\t\t\tdie(\"tag %s tags unexported object; use \"\n> -\t\t\t    \"--tag-of-filtered-object=<mode> to handle it\",\n> +\t\t\tdie(_(\"tag %s tags unexported object; use \"\n> +\t\t\t      \"--tag-of-filtered-object=<mode> to handle it\"),\n>  \t\t\t    oid_to_hex(&tag->object.oid));\n>  \t\tcase DROP:\n>  \t\t\t/* Ignore this tag altogether */\n> @@ -1026,7 +1027,7 @@ static struct commit *get_commit(struct rev_cmdline_entry *e, const char *full_n\n>  \t\t\ttag = (struct tag *)tag->tagged;\n>  \t\t}\n>  \t\tif (!tag)\n> -\t\t\tdie(\"Tag %s points nowhere?\", e->name);\n> +\t\t\tdie(_(\"Tag %s points nowhere?\"), e->name);\n>  \t\treturn (struct commit *)tag;\n>  \t}\n>  \tdefault:\n> @@ -1064,7 +1065,7 @@ static void get_tags_and_duplicates(struct rev_cmdline_info *info)\n>  \n>  \t\tcommit = get_commit(e, full_name);\n>  \t\tif (!commit) {\n> -\t\t\twarning(\"%s: Unexpected object of type %s, skipping.\",\n> +\t\t\twarning(_(\"%s: Unexpected object of type %s, skipping.\"),\n>  \t\t\t\te->name,\n>  \t\t\t\ttype_name(e->item->type));\n>  \t\t\tfree(full_name);\n> @@ -1079,7 +1080,7 @@ static void get_tags_and_duplicates(struct rev_cmdline_info *info)\n>  \t\t\tfree(full_name);\n>  \t\t\tcontinue;\n>  \t\tdefault: /* OBJ_TAG (nested tags) is already handled */\n> -\t\t\twarning(\"Tag points to object of unexpected type %s, skipping.\",\n> +\t\t\twarning(_(\"Tag points to object of unexpected type %s, skipping.\"),\n>  \t\t\t\ttype_name(commit->object.type));\n>  \t\t\tfree(full_name);\n>  \t\t\tcontinue;\n> @@ -1175,7 +1176,7 @@ static void export_marks(char *file)\n>  \n>  \tf = fopen_for_writing(file);\n>  \tif (!f)\n> -\t\tdie_errno(\"Unable to open marks file %s for writing.\", file);\n> +\t\tdie_errno(_(\"Unable to open marks file %s for writing.\"), file);\n>  \n>  \tfor (i = 0; i < idnums.size; i++) {\n>  \t\tif (deco->base && deco->base->type == 1) {\n> @@ -1192,7 +1193,7 @@ static void export_marks(char *file)\n>  \te |= ferror(f);\n>  \te |= fclose(f);\n>  \tif (e)\n> -\t\terror(\"Unable to write marks file %s.\", file);\n> +\t\terror(_(\"Unable to write marks file %s.\"), file);\n>  }\n>  \n>  static void import_marks(char *input_file, int check_exists)\n> @@ -1215,20 +1216,20 @@ static void import_marks(char *input_file, int check_exists)\n>  \n>  \t\tline_end = strchr(line, '\\n');\n>  \t\tif (line[0] != ':' || !line_end)\n> -\t\t\tdie(\"corrupt mark line: %s\", line);\n> +\t\t\tdie(_(\"corrupt mark line: %s\"), line);\n>  \t\t*line_end = '\\0';\n>  \n>  \t\tmark = strtoumax(line + 1, &mark_end, 10);\n>  \t\tif (!mark || mark_end == line + 1\n>  \t\t\t|| *mark_end != ' ' || get_oid_hex(mark_end + 1, &oid))\n> -\t\t\tdie(\"corrupt mark line: %s\", line);\n> +\t\t\tdie(_(\"corrupt mark line: %s\"), line);\n>  \n>  \t\tif (last_idnum < mark)\n>  \t\t\tlast_idnum = mark;\n>  \n>  \t\ttype = odb_read_object_info(the_repository->objects, &oid, NULL);\n>  \t\tif (type < 0)\n> -\t\t\tdie(\"object not found: %s\", oid_to_hex(&oid));\n> +\t\t\tdie(_(\"object not found: %s\"), oid_to_hex(&oid));\n>  \n>  \t\tif (type != OBJ_COMMIT)\n>  \t\t\t/* only commits */\n> @@ -1236,12 +1237,12 @@ static void import_marks(char *input_file, int check_exists)\n>  \n>  \t\tcommit = lookup_commit(the_repository, &oid);\n>  \t\tif (!commit)\n> -\t\t\tdie(\"not a commit? can't happen: %s\", oid_to_hex(&oid));\n> +\t\t\tdie(_(\"not a commit? can't happen: %s\"), oid_to_hex(&oid));\n>  \n>  \t\tobject = &commit->object;\n>  \n>  \t\tif (object->flags & SHOWN)\n> -\t\t\terror(\"Object %s already has a mark\", oid_to_hex(&oid));\n> +\t\t\terror(_(\"Object %s already has a mark\"), oid_to_hex(&oid));\n>  \n>  \t\tmark_object(object, mark);\n>  \n> @@ -1395,7 +1396,7 @@ int cmd_fast_export(int argc,\n>  \tget_tags_and_duplicates(&revs.cmdline);\n>  \n>  \tif (prepare_revision_walk(&revs))\n> -\t\tdie(\"revision walk setup failed\");\n> +\t\tdie(_(\"revision walk setup failed\"));\n>  \n>  \trevs.reverse = 1;\n>  \trevs.diffopt.format_callback = show_filemodify;\n"},{"id":"529799","messageId":"xmqq4irjdlgn.fsf@gitster.g","threadId":"64397","inReplyTo":"20251028081232.3068147-2-christian.couder@gmail.com","subject":"Re: [PATCH 1/5] gpg-interface: simplify ssh fingerprint parsing","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2025-10-28T16:45:12Z","receivedAt":"2025-10-28T16:45:16Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Christian Couder <christian.couder@gmail.com> writes:\n\n> In \"gpg-interface.c\", the 'parse_ssh_output()' function takes a\n> 'struct signature_check *sigc' argument and populates many members of\n> this 'sigc' using information parsed from 'sigc->output' which\n> contains the ouput of an `ssh-keygen -Y ...` command that was used to\n> verify an SSH signature.\n>\n> When it populates 'sigc->fingerprint' though, it uses\n> `xstrdup(strstr(line, \"key \") + 4)` while `strstr(line, \"key \")` has\n> already been computed a few lines above and is already available in\n> the `key` variable.\n>\n> Let's simplify this.\n>\n> Signed-off-by: Christian Couder <chriscool@tuxfamily.org>\n> ---\n>  gpg-interface.c | 2 +-\n>  1 file changed, 1 insertion(+), 1 deletion(-)\n>\n> diff --git a/gpg-interface.c b/gpg-interface.c\n> index 2f4f0e32cb..91d1b58cb4 100644\n> --- a/gpg-interface.c\n> +++ b/gpg-interface.c\n> @@ -443,7 +443,7 @@ static void parse_ssh_output(struct signature_check *sigc)\n>  \n>  \tkey = strstr(line, \"key \");\n>  \tif (key) {\n> -\t\tsigc->fingerprint = xstrdup(strstr(line, \"key \") + 4);\n> +\t\tsigc->fingerprint = xstrdup(key + 4);\n\nLooks like an obvious avoidance of duplicated work.  I am not sure\nif \"find 'key ' anywhere on the line and take the first one\" is a\nsensible validation, but that is not a fault of this patch ;-)\n\n>  \t\tsigc->key = xstrdup(sigc->fingerprint);\n>  \t} else {\n>  \t\t/*\n"},{"id":"529800","messageId":"xmqqzf9bc6tf.fsf@gitster.g","threadId":"64397","inReplyTo":"20251028081232.3068147-5-christian.couder@gmail.com","subject":"Re: [PATCH 4/5] fast-import: mark strings for translation","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2025-10-28T16:46:52Z","receivedAt":"2025-10-28T16:46:55Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Christian Couder <christian.couder@gmail.com> writes:\n\n> Some error or warning messages in \"builtin/fast-import.c\" are marked\n> for translation, but many are not.\n>\n> To be more consistent and provide a better experience to people using a\n> translated version, let's mark all the remaining error or warning\n> messages for translation.\n>\n> While at it, let's make the following small changes:\n>\n>   - replace \"GIT\" or \"git\" in a few error messages to just \"Git\",\n>   - replace \"Expected from command, got %s\" to \"Expected 'from'\n>     command, got '%s'\", which makes it clearer that \"from\" is a command\n>     and should not be translated,\n>   - adjust the indentation of some arguments of the error functions.\n>\n> Signed-off-by: Christian Couder <chriscool@tuxfamily.org>\n> ---\n>  builtin/fast-import.c | 270 +++++++++++++++++++++---------------------\n>  1 file changed, 135 insertions(+), 135 deletions(-)\n\nSame comments as previous.\n> ...\n> @@ -3774,7 +3774,7 @@ int cmd_fast_import(int argc,\n>  \t\telse if (starts_with(command_buf.buf, \"option \"))\n>  \t\t\t/* ignore non-git options*/;\n>  \t\telse\n> -\t\t\tdie(\"Unsupported command: %s\", command_buf.buf);\n> +\t\t\tdie(_(\"Unsupported command: %s\"), command_buf.buf);\n>  \n>  \t\tif (checkpoint_requested)\n>  \t\t\tcheckpoint();\n> @@ -3785,7 +3785,7 @@ int cmd_fast_import(int argc,\n>  \t\tparse_argv();\n>  \n>  \tif (require_explicit_termination && feof(stdin))\n> -\t\tdie(\"stream ends early\");\n> +\t\tdie(_(\"stream ends early\"));\n>  \n>  \tend_packfile();\n"},{"id":"529867","messageId":"CAP8UFD3S1s3_p3m-ZzRO=B7nQwJvbYMBew8_MZWJwSJEm4oFTA@mail.gmail.com","threadId":"64397","inReplyTo":"xmqqv7jzdtvl.fsf@gitster.g","subject":"Re: [PATCH 3/5] fast-export: mark strings for translation","fromName":"Christian Couder","fromEmail":"christian.couder@gmail.com","sentAt":"2025-10-29T14:29:51Z","receivedAt":"2025-10-29T14:30:05Z","isPatch":true,"sender":{"key":"christian.couder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/208954?v=4"},"body":"On Tue, Oct 28, 2025 at 2:43 PM Junio C Hamano <gitster@pobox.com> wrote:\n>\n> Christian Couder <christian.couder@gmail.com> writes:\n>\n> > Some error or warning messages in \"builtin/fast-export.c\" are marked\n> > for translation, but many are not.\n> >\n> > To be more consistent and provide a better experience to people using a\n> > translated version, let's mark all the remaining error or warning\n> > messages for translation.\n>\n> Makes sense.  Should we also downcase some Unknown and Unexpected?\n\nI am fine with doing it as part of this series, but I wonder if it\nshould be part of this patch or in a separate patch.\n\nIf it's in a separate patch, each patch might be easier to review\nindependently, but a number of lines will be changed several times in\nthis series. So not sure what's the best practice.\n\nThanks.\n"},{"id":"529875","messageId":"xmqqv7jxadq6.fsf@gitster.g","threadId":"64397","inReplyTo":"CAP8UFD3S1s3_p3m-ZzRO=B7nQwJvbYMBew8_MZWJwSJEm4oFTA@mail.gmail.com","subject":"Re: [PATCH 3/5] fast-export: mark strings for translation","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2025-10-29T16:12:49Z","receivedAt":"2025-10-29T16:12:52Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Christian Couder <christian.couder@gmail.com> writes:\n\n> On Tue, Oct 28, 2025 at 2:43 PM Junio C Hamano <gitster@pobox.com> wrote:\n>>\n>> Christian Couder <christian.couder@gmail.com> writes:\n>>\n>> > Some error or warning messages in \"builtin/fast-export.c\" are marked\n>> > for translation, but many are not.\n>> >\n>> > To be more consistent and provide a better experience to people using a\n>> > translated version, let's mark all the remaining error or warning\n>> > messages for translation.\n>>\n>> Makes sense.  Should we also downcase some Unknown and Unexpected?\n>\n> I am fine with doing it as part of this series, but I wonder if it\n> should be part of this patch or in a separate patch.\n>\n> If it's in a separate patch, each patch might be easier to review\n> independently, but a number of lines will be changed several times in\n> this series. So not sure what's the best practice.\n\nRephrasing the messages may need more careful thinking while\nreviewing, but if you limit your changes to only downcasing the\nfirst letter, I would think it would fall in the same bucket as\n\"While at it, improve code indentation\".\n\nThanks.\n"},{"id":"529956","messageId":"20251030123332.3337684-2-christian.couder@gmail.com","threadId":"64397","inReplyTo":"20251030123332.3337684-1-christian.couder@gmail.com","subject":"[PATCH v2 1/5] gpg-interface: simplify ssh fingerprint parsing","fromName":"Christian Couder","fromEmail":"christian.couder@gmail.com","sentAt":"2025-10-30T12:33:28Z","receivedAt":"2025-10-30T12:33:50Z","isPatch":true,"sender":{"key":"christian.couder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/208954?v=4"},"body":"In \"gpg-interface.c\", the 'parse_ssh_output()' function takes a\n'struct signature_check *sigc' argument and populates many members of\nthis 'sigc' using information parsed from 'sigc->output' which\ncontains the ouput of an `ssh-keygen -Y ...` command that was used to\nverify an SSH signature.\n\nWhen it populates 'sigc->fingerprint' though, it uses\n`xstrdup(strstr(line, \"key \") + 4)` while `strstr(line, \"key \")` has\nalready been computed a few lines above and is already available in\nthe `key` variable.\n\nLet's simplify this.\n\nSigned-off-by: Christian Couder <chriscool@tuxfamily.org>\n---\n gpg-interface.c | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/gpg-interface.c b/gpg-interface.c\nindex 2f4f0e32cb..91d1b58cb4 100644\n--- a/gpg-interface.c\n+++ b/gpg-interface.c\n@@ -443,7 +443,7 @@ static void parse_ssh_output(struct signature_check *sigc)\n \n \tkey = strstr(line, \"key \");\n \tif (key) {\n-\t\tsigc->fingerprint = xstrdup(strstr(line, \"key \") + 4);\n+\t\tsigc->fingerprint = xstrdup(key + 4);\n \t\tsigc->key = xstrdup(sigc->fingerprint);\n \t} else {\n \t\t/*\n-- \n2.51.2.617.g2aaa867cd1\n\n"},{"id":"529957","messageId":"20251030123332.3337684-1-christian.couder@gmail.com","threadId":"64397","inReplyTo":"20251028081232.3068147-1-christian.couder@gmail.com","subject":"[PATCH v2 0/5] fast-export/import: cleanups and translation","fromName":"Christian Couder","fromEmail":"christian.couder@gmail.com","sentAt":"2025-10-30T12:33:27Z","receivedAt":"2025-10-30T12:33:50Z","isPatch":true,"sender":{"key":"christian.couder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/208954?v=4"},"body":"\nIntroduction\n------------\n\nIn a previous v2 patch series[1] that I sent last May, there were two\npreparatory cleanup patches[2][3] that have been dropped in the v3 and\nnext versions. I think these two cleanup patches are worth resending\nin their own series though.\n\nWhile at cleaning things up, I realized that, when working in this\narea of the code, I have often been annoyed by the fact that few error\nand warning messages were marked for translation. So I decided to also\naddress this here.\n\nSo patches 1/5 and 2/5 are small code cleanups that are resent, while\npatches 3/5, 4/5 and 5/5 are about marking strings for translation.\n\n[1] https://lore.kernel.org/git/20250526103314.1542316-1-christian.couder@gmail.com/\n[2] https://lore.kernel.org/git/20250526103314.1542316-2-christian.couder@gmail.com/\n[3] https://lore.kernel.org/git/20250526103314.1542316-3-christian.couder@gmail.com/\n\nChanges compared to v1\n----------------------\n\nThanks to Junio for commenting on the v1! \n\nThere are only small changes in patches 3/5 and 4/5. Mostly some\nuppercase letters at the start of error and warning messages have been\ndowncased according to our style.\n\nIn patch 3/5, an error message that started with \"Error: \" has been\nchanged to remove that part.\n\nIn patch 4/5, some tests in \"t9300-fast-import.sh\" had to be adjusted\nbecause they were testing error or warning messages where the first\nletter was downcased.\n\nThe commit messages of patches 3/5 and 4/5 have also been adjusted to\nmention these changes.\n\nCI tests:\n---------\n\nAll the tests passed. See:\n\nhttps://github.com/chriscool/git/actions/runs/18938796521\n\nRange diff compared to v1\n-------------------------\n\n1:  525f8a7bbb = 1:  fbc4a97b6a gpg-interface: simplify ssh fingerprint parsing\n2:  54a4126ad6 = 2:  e653da13fb gpg-interface: use left shift to define GPG_VERIFY_*\n3:  719785dc07 ! 3:  82348e8e42 fast-export: mark strings for translation\n    @@ Commit message\n         translated version, let's mark all the remaining error or warning\n         messages for translation.\n     \n    -    While at it, improve how some arguments to some error functions are\n    -    indented.\n    +    While at it:\n    +\n    +      - improve how some arguments to some error functions are indented,\n    +      - remove \"Error:\" at the start of an error message,\n    +      - downcase error and warning messages that start with an uppercase.\n     \n         Signed-off-by: Christian Couder <chriscool@tuxfamily.org>\n     \n    @@ builtin/fast-export.c: static int parse_opt_sign_mode(const struct option *opt,\n      \n      \tif (parse_sign_mode(arg, val))\n     -\t\treturn error(\"Unknown %s mode: %s\", opt->long_name, arg);\n    -+\t\treturn error(_(\"Unknown %s mode: %s\"), opt->long_name, arg);\n    ++\t\treturn error(_(\"unknown %s mode: %s\"), opt->long_name, arg);\n      \n      \treturn 0;\n      }\n    @@ builtin/fast-export.c: static int parse_opt_tag_of_filtered_mode(const struct op\n      \t\t*val = REWRITE;\n      \telse\n     -\t\treturn error(\"Unknown tag-of-filtered mode: %s\", arg);\n    -+\t\treturn error(_(\"Unknown tag-of-filtered mode: %s\"), arg);\n    ++\t\treturn error(_(\"unknown tag-of-filtered mode: %s\"), arg);\n      \treturn 0;\n      }\n      \n    @@ builtin/fast-export.c: static int parse_opt_reencode_mode(const struct option *o\n      \t\t\t*val = REENCODE_ABORT;\n      \t\telse\n     -\t\t\treturn error(\"Unknown reencoding mode: %s\", arg);\n    -+\t\t\treturn error(_(\"Unknown reencoding mode: %s\"), arg);\n    ++\t\t\treturn error(_(\"unknown reencoding mode: %s\"), arg);\n      \t}\n      \n      \treturn 0;\n    @@ builtin/fast-export.c: static void export_blob(const struct object_id *oid)\n      \n      \tif (!object)\n     -\t\tdie(\"Could not read blob %s\", oid_to_hex(oid));\n    -+\t\tdie(_(\"Could not read blob %s\"), oid_to_hex(oid));\n    ++\t\tdie(_(\"could not read blob %s\"), oid_to_hex(oid));\n      \n      \tmark_next_object(object);\n      \n    @@ builtin/fast-export.c: static void show_filemodify(struct diff_queue_struct *q,\n     -\t\t\t\tq->queue[i]->status,\n     -\t\t\t\tospec->path ? ospec->path : \"none\",\n     -\t\t\t\tspec->path ? spec->path : \"none\");\n    -+\t\t\tdie(_(\"Unexpected comparison status '%c' for %s, %s\"),\n    ++\t\t\tdie(_(\"unexpected comparison status '%c' for %s, %s\"),\n     +\t\t\t    q->queue[i]->status,\n     +\t\t\t    ospec->path ? ospec->path : _(\"none\"),\n     +\t\t\t    spec->path ? spec->path : _(\"none\"));\n    @@ builtin/fast-export.c: static void handle_commit(struct commit *commit, struct r\n      \t\tcase REENCODE_ABORT:\n     -\t\t\tdie(\"Encountered commit-specific encoding %.*s in commit \"\n     -\t\t\t    \"%s; use --reencode=[yes|no] to handle it\",\n    -+\t\t\tdie(_(\"Encountered commit-specific encoding %.*s in commit \"\n    ++\t\t\tdie(_(\"encountered commit-specific encoding %.*s in commit \"\n     +\t\t\t      \"%s; use --reencode=[yes|no] to handle it\"),\n      \t\t\t    (int)encoding_len, encoding,\n      \t\t\t    oid_to_hex(&commit->object.oid));\n    @@ builtin/fast-export.c: static void handle_tag(const char *name, struct tag *tag)\n      \t}\n      \tif (tagged->type == OBJ_TREE) {\n     -\t\twarning(\"Omitting tag %s,\\nsince tags of trees (or tags of tags of trees, etc.) are not supported.\",\n    -+\t\twarning(_(\"Omitting tag %s,\\nsince tags of trees (or tags \"\n    ++\t\twarning(_(\"omitting tag %s,\\nsince tags of trees (or tags \"\n     +\t\t\t  \"of tags of trees, etc.) are not supported.\"),\n      \t\t\toid_to_hex(&tag->object.oid));\n      \t\treturn;\n    @@ builtin/fast-export.c: static void handle_tag(const char *name, struct tag *tag)\n      \tif (message) {\n      \t\tmessage += 2;\n     @@ builtin/fast-export.c: static void handle_tag(const char *name, struct tag *tag)\n    - \t\tif (signature)\n    + \t\tif (sig_offset < message_size)\n      \t\t\tswitch (signed_tag_mode) {\n      \t\t\tcase SIGN_ABORT:\n     -\t\t\t\tdie(\"encountered signed tag %s; use \"\n    @@ builtin/fast-export.c: static void handle_tag(const char *name, struct tag *tag)\n      \t\t\t    oid_to_hex(&tag->object.oid));\n      \t\tcase DROP:\n      \t\t\t/* Ignore this tag altogether */\n    +@@ builtin/fast-export.c: static void handle_tag(const char *name, struct tag *tag)\n    + \t\t\treturn;\n    + \t\tcase REWRITE:\n    + \t\t\tif (tagged->type == OBJ_TAG && !mark_tags) {\n    +-\t\t\t\tdie(_(\"Error: Cannot export nested tags unless --mark-tags is specified.\"));\n    ++\t\t\t\tdie(_(\"cannot export nested tags unless --mark-tags is specified.\"));\n    + \t\t\t} else if (tagged->type == OBJ_COMMIT) {\n    + \t\t\t\tp = rewrite_commit((struct commit *)tagged);\n    + \t\t\t\tif (!p) {\n     @@ builtin/fast-export.c: static struct commit *get_commit(struct rev_cmdline_entry *e, const char *full_n\n      \t\t\ttag = (struct tag *)tag->tagged;\n      \t\t}\n      \t\tif (!tag)\n     -\t\t\tdie(\"Tag %s points nowhere?\", e->name);\n    -+\t\t\tdie(_(\"Tag %s points nowhere?\"), e->name);\n    ++\t\t\tdie(_(\"tag %s points nowhere?\"), e->name);\n      \t\treturn (struct commit *)tag;\n      \t}\n      \tdefault:\n    @@ builtin/fast-export.c: static void get_tags_and_duplicates(struct rev_cmdline_in\n      \t\tcommit = get_commit(e, full_name);\n      \t\tif (!commit) {\n     -\t\t\twarning(\"%s: Unexpected object of type %s, skipping.\",\n    -+\t\t\twarning(_(\"%s: Unexpected object of type %s, skipping.\"),\n    ++\t\t\twarning(_(\"%s: unexpected object of type %s, skipping.\"),\n      \t\t\t\te->name,\n      \t\t\t\ttype_name(e->item->type));\n      \t\t\tfree(full_name);\n    @@ builtin/fast-export.c: static void get_tags_and_duplicates(struct rev_cmdline_in\n      \t\t\tcontinue;\n      \t\tdefault: /* OBJ_TAG (nested tags) is already handled */\n     -\t\t\twarning(\"Tag points to object of unexpected type %s, skipping.\",\n    -+\t\t\twarning(_(\"Tag points to object of unexpected type %s, skipping.\"),\n    ++\t\t\twarning(_(\"tag points to object of unexpected type %s, skipping.\"),\n      \t\t\t\ttype_name(commit->object.type));\n      \t\t\tfree(full_name);\n      \t\t\tcontinue;\n    @@ builtin/fast-export.c: static void export_marks(char *file)\n      \tf = fopen_for_writing(file);\n      \tif (!f)\n     -\t\tdie_errno(\"Unable to open marks file %s for writing.\", file);\n    -+\t\tdie_errno(_(\"Unable to open marks file %s for writing.\"), file);\n    ++\t\tdie_errno(_(\"unable to open marks file %s for writing.\"), file);\n      \n      \tfor (i = 0; i < idnums.size; i++) {\n      \t\tif (deco->base && deco->base->type == 1) {\n    @@ builtin/fast-export.c: static void export_marks(char *file)\n      \te |= fclose(f);\n      \tif (e)\n     -\t\terror(\"Unable to write marks file %s.\", file);\n    -+\t\terror(_(\"Unable to write marks file %s.\"), file);\n    ++\t\terror(_(\"unable to write marks file %s.\"), file);\n      }\n      \n      static void import_marks(char *input_file, int check_exists)\n    @@ builtin/fast-export.c: static void import_marks(char *input_file, int check_exis\n      \n      \t\tif (object->flags & SHOWN)\n     -\t\t\terror(\"Object %s already has a mark\", oid_to_hex(&oid));\n    -+\t\t\terror(_(\"Object %s already has a mark\"), oid_to_hex(&oid));\n    ++\t\t\terror(_(\"object %s already has a mark\"), oid_to_hex(&oid));\n      \n      \t\tmark_object(object, mark);\n      \n4:  bfb336a14f ! 4:  024ffc060e fast-import: mark strings for translation\n    @@ Commit message\n         While at it, let's make the following small changes:\n     \n           - replace \"GIT\" or \"git\" in a few error messages to just \"Git\",\n    -      - replace \"Expected from command, got %s\" to \"Expected 'from'\n    +      - replace \"Expected from command, got %s\" to \"expected 'from'\n             command, got '%s'\", which makes it clearer that \"from\" is a command\n             and should not be translated,\n    +      - downcase error and warning messages that start with an uppercase,\n    +      - fix test cases in \"t9300-fast-import.sh\" that broke because an\n    +        error or warning message was downcased,\n    +      - split error and warning messages that are too long,\n           - adjust the indentation of some arguments of the error functions.\n     \n         Signed-off-by: Christian Couder <chriscool@tuxfamily.org>\n    @@ builtin/fast-import.c: static struct branch *new_branch(const char *name)\n      \n      \tif (b)\n     -\t\tdie(\"Invalid attempt to create duplicate branch: %s\", name);\n    -+\t\tdie(_(\"Invalid attempt to create duplicate branch: %s\"), name);\n    ++\t\tdie(_(\"invalid attempt to create duplicate branch: %s\"), name);\n      \tif (check_refname_format(name, REFNAME_ALLOW_ONELEVEL))\n     -\t\tdie(\"Branch name doesn't conform to GIT standards: %s\", name);\n    -+\t\tdie(_(\"Branch name doesn't conform to Git standards: %s\"), name);\n    ++\t\tdie(_(\"branch name doesn't conform to Git standards: %s\"), name);\n      \n      \tb = mem_pool_calloc(&fi_mem_pool, 1, sizeof(struct branch));\n      \tb->name = mem_pool_strdup(&fi_mem_pool, name);\n    @@ builtin/fast-import.c: static int loosen_small_pack(const struct packed_git *p)\n      \n      \tif (lseek(p->pack_fd, 0, SEEK_SET) < 0)\n     -\t\tdie_errno(\"Failed seeking to start of '%s'\", p->pack_name);\n    -+\t\tdie_errno(_(\"Failed seeking to start of '%s'\"), p->pack_name);\n    ++\t\tdie_errno(_(\"failed seeking to start of '%s'\"), p->pack_name);\n      \n      \tunpack.in = p->pack_fd;\n      \tunpack.git_cmd = 1;\n    @@ builtin/fast-import.c: static void load_tree(struct tree_entry *root)\n      \tif (myoe && myoe->pack_id != MAX_PACK_ID) {\n      \t\tif (myoe->type != OBJ_TREE)\n     -\t\t\tdie(\"Not a tree: %s\", oid_to_hex(oid));\n    -+\t\t\tdie(_(\"Not a tree: %s\"), oid_to_hex(oid));\n    ++\t\t\tdie(_(\"not a tree: %s\"), oid_to_hex(oid));\n      \t\tt->delta_depth = myoe->depth;\n      \t\tbuf = gfi_unpack_entry(myoe, &size);\n      \t\tif (!buf)\n     -\t\t\tdie(\"Can't load tree %s\", oid_to_hex(oid));\n    -+\t\t\tdie(_(\"Can't load tree %s\"), oid_to_hex(oid));\n    ++\t\t\tdie(_(\"can't load tree %s\"), oid_to_hex(oid));\n      \t} else {\n      \t\tenum object_type type;\n      \t\tbuf = odb_read_object(the_repository->objects, oid, &type, &size);\n      \t\tif (!buf || type != OBJ_TREE)\n     -\t\t\tdie(\"Can't load tree %s\", oid_to_hex(oid));\n    -+\t\t\tdie(_(\"Can't load tree %s\"), oid_to_hex(oid));\n    ++\t\t\tdie(_(\"can't load tree %s\"), oid_to_hex(oid));\n      \t}\n      \n      \tc = buf;\n    @@ builtin/fast-import.c: static void load_tree(struct tree_entry *root)\n      \t\tc = parse_mode(c, &e->versions[1].mode);\n      \t\tif (!c)\n     -\t\t\tdie(\"Corrupt mode in %s\", oid_to_hex(oid));\n    -+\t\t\tdie(_(\"Corrupt mode in %s\"), oid_to_hex(oid));\n    ++\t\t\tdie(_(\"corrupt mode in %s\"), oid_to_hex(oid));\n      \t\te->versions[0].mode = e->versions[1].mode;\n      \t\te->name = to_atom(c, strlen(c));\n      \t\tc += e->name->str_len + 1;\n    @@ builtin/fast-import.c: static void tree_content_replace(\n      {\n      \tif (!S_ISDIR(mode))\n     -\t\tdie(\"Root cannot be a non-directory\");\n    -+\t\tdie(_(\"Root cannot be a non-directory\"));\n    ++\t\tdie(_(\"root cannot be a non-directory\"));\n      \toidclr(&root->versions[0].oid, the_repository->hash_algo);\n      \toidcpy(&root->versions[1].oid, oid);\n      \tif (root->tree)\n    @@ builtin/fast-import.c: static int tree_content_set(\n      \tn = slash1 - p;\n      \tif (!n)\n     -\t\tdie(\"Empty path component found in input\");\n    -+\t\tdie(_(\"Empty path component found in input\"));\n    ++\t\tdie(_(\"empty path component found in input\"));\n      \tif (!*slash1 && !S_ISDIR(mode) && subtree)\n     -\t\tdie(\"Non-directories cannot have subtrees\");\n    -+\t\tdie(_(\"Non-directories cannot have subtrees\"));\n    ++\t\tdie(_(\"non-directories cannot have subtrees\"));\n      \n      \tif (!root->tree)\n      \t\tload_tree(root);\n    @@ builtin/fast-import.c: static int tree_content_get(\n      \tn = slash1 - p;\n      \tif (!n && !allow_root)\n     -\t\tdie(\"Empty path component found in input\");\n    -+\t\tdie(_(\"Empty path component found in input\"));\n    ++\t\tdie(_(\"empty path component found in input\"));\n      \n      \tif (!root->tree)\n      \t\tload_tree(root);\n    @@ builtin/fast-import.c: static int update_branch(struct branch *b)\n      \t\tif (!quiet)\n     -\t\t\twarning(\"Dropping %s since it would point to \"\n     -\t\t\t\t\"itself (i.e. to %s)\",\n    -+\t\t\twarning(_(\"Dropping %s since it would point to \"\n    ++\t\t\twarning(_(\"dropping %s since it would point to \"\n     +\t\t\t\t  \"itself (i.e. to %s)\"),\n      \t\t\t\tb->name, oid_to_hex(&b->oid));\n      \t\trefs_delete_ref(get_main_ref_store(the_repository),\n    @@ builtin/fast-import.c: static int update_branch(struct branch *b)\n      \t\t\t\t\t\t\t  &b->oid, 0);\n      \t\tif (!old_cmit || !new_cmit)\n     -\t\t\treturn error(\"Branch %s is missing commits.\", b->name);\n    -+\t\t\treturn error(_(\"Branch %s is missing commits.\"), b->name);\n    ++\t\t\treturn error(_(\"branch %s is missing commits.\"), b->name);\n      \n      \t\tret = repo_in_merge_bases(the_repository, old_cmit, new_cmit);\n      \t\tif (ret < 0)\n    @@ builtin/fast-import.c: static int update_branch(struct branch *b)\n      \t\tif (!ret) {\n     -\t\t\twarning(\"Not updating %s\"\n     -\t\t\t\t\" (new tip %s does not contain %s)\",\n    -+\t\t\twarning(_(\"Not updating %s\"\n    ++\t\t\twarning(_(\"not updating %s\"\n     +\t\t\t\t  \" (new tip %s does not contain %s)\"),\n      \t\t\t\tb->name, oid_to_hex(&b->oid),\n      \t\t\t\toid_to_hex(&old_oid));\n    @@ builtin/fast-import.c: static void dump_marks(void)\n      \n      \tif (hold_lock_file_for_update(&mark_lock, export_marks_file, 0) < 0) {\n     -\t\tfailure |= error_errno(\"Unable to write marks file %s\",\n    -+\t\tfailure |= error_errno(_(\"Unable to write marks file %s\"),\n    ++\t\tfailure |= error_errno(_(\"unable to write marks file %s\"),\n      \t\t\t\t       export_marks_file);\n      \t\treturn;\n      \t}\n    @@ builtin/fast-import.c: static void dump_marks(void)\n      \t\tint saved_errno = errno;\n      \t\trollback_lock_file(&mark_lock);\n     -\t\tfailure |= error(\"Unable to write marks file %s: %s\",\n    -+\t\tfailure |= error(_(\"Unable to write marks file %s: %s\"),\n    ++\t\tfailure |= error(_(\"unable to write marks file %s: %s\"),\n      \t\t\texport_marks_file, strerror(saved_errno));\n      \t\treturn;\n      \t}\n    @@ builtin/fast-import.c: static void dump_marks(void)\n      \tfor_each_mark(marks, 0, dump_marks_fn, f);\n      \tif (commit_lock_file(&mark_lock)) {\n     -\t\tfailure |= error_errno(\"Unable to write file %s\",\n    -+\t\tfailure |= error_errno(_(\"Unable to write file %s\"),\n    ++\t\tfailure |= error_errno(_(\"unable to write file %s\"),\n      \t\t\t\t       export_marks_file);\n      \t\treturn;\n      \t}\n    @@ builtin/fast-import.c: static int parse_data(struct strbuf *sb, uintmax_t limit,\n      \n      \tif (!skip_prefix(command_buf.buf, \"data \", &data))\n     -\t\tdie(\"Expected 'data n' command, found: %s\", command_buf.buf);\n    -+\t\tdie(_(\"Expected 'data n' command, found: %s\"), command_buf.buf);\n    ++\t\tdie(_(\"expected 'data n' command, found: %s\"), command_buf.buf);\n      \n      \tif (skip_prefix(data, \"<<\", &data)) {\n      \t\tchar *term = xstrdup(data);\n    @@ builtin/fast-import.c: static char *parse_ident(const char *buf)\n      \tltgt = buf + strcspn(buf, \"<>\");\n      \tif (*ltgt != '<')\n     -\t\tdie(\"Missing < in ident string: %s\", buf);\n    -+\t\tdie(_(\"Missing < in ident string: %s\"), buf);\n    ++\t\tdie(_(\"missing < in ident string: %s\"), buf);\n      \tif (ltgt != buf && ltgt[-1] != ' ')\n     -\t\tdie(\"Missing space before < in ident string: %s\", buf);\n    -+\t\tdie(_(\"Missing space before < in ident string: %s\"), buf);\n    ++\t\tdie(_(\"missing space before < in ident string: %s\"), buf);\n      \tltgt = ltgt + 1 + strcspn(ltgt + 1, \"<>\");\n      \tif (*ltgt != '>')\n     -\t\tdie(\"Missing > in ident string: %s\", buf);\n    -+\t\tdie(_(\"Missing > in ident string: %s\"), buf);\n    ++\t\tdie(_(\"missing > in ident string: %s\"), buf);\n      \tltgt++;\n      \tif (*ltgt != ' ')\n     -\t\tdie(\"Missing space after > in ident string: %s\", buf);\n    -+\t\tdie(_(\"Missing space after > in ident string: %s\"), buf);\n    ++\t\tdie(_(\"missing space after > in ident string: %s\"), buf);\n      \tltgt++;\n      \tname_len = ltgt - buf;\n      \tstrbuf_add(&ident, buf, name_len);\n    @@ builtin/fast-import.c: static char *parse_ident(const char *buf)\n      \tcase WHENSPEC_RAW:\n      \t\tif (validate_raw_date(ltgt, &ident, 1) < 0)\n     -\t\t\tdie(\"Invalid raw date \\\"%s\\\" in ident: %s\", ltgt, buf);\n    -+\t\t\tdie(_(\"Invalid raw date \\\"%s\\\" in ident: %s\"), ltgt, buf);\n    ++\t\t\tdie(_(\"invalid raw date \\\"%s\\\" in ident: %s\"), ltgt, buf);\n      \t\tbreak;\n      \tcase WHENSPEC_RAW_PERMISSIVE:\n      \t\tif (validate_raw_date(ltgt, &ident, 0) < 0)\n     -\t\t\tdie(\"Invalid raw date \\\"%s\\\" in ident: %s\", ltgt, buf);\n    -+\t\t\tdie(_(\"Invalid raw date \\\"%s\\\" in ident: %s\"), ltgt, buf);\n    ++\t\t\tdie(_(\"invalid raw date \\\"%s\\\" in ident: %s\"), ltgt, buf);\n      \t\tbreak;\n      \tcase WHENSPEC_RFC2822:\n      \t\tif (parse_date(ltgt, &ident) < 0)\n     -\t\t\tdie(\"Invalid rfc2822 date \\\"%s\\\" in ident: %s\", ltgt, buf);\n    -+\t\t\tdie(_(\"Invalid rfc2822 date \\\"%s\\\" in ident: %s\"), ltgt, buf);\n    ++\t\t\tdie(_(\"invalid rfc2822 date \\\"%s\\\" in ident: %s\"), ltgt, buf);\n      \t\tbreak;\n      \tcase WHENSPEC_NOW:\n      \t\tif (strcmp(\"now\", ltgt))\n     -\t\t\tdie(\"Date in ident must be 'now': %s\", buf);\n    -+\t\t\tdie(_(\"Date in ident must be 'now': %s\"), buf);\n    ++\t\t\tdie(_(\"date in ident must be 'now': %s\"), buf);\n      \t\tdatestamp(&ident);\n      \t\tbreak;\n      \t}\n    @@ builtin/fast-import.c: static void construct_path_with_fanout(const char *hex_sh\n      \tunsigned int i = 0, j = 0;\n      \tif (fanout >= the_hash_algo->rawsz)\n     -\t\tdie(\"Too large fanout (%u)\", fanout);\n    -+\t\tdie(_(\"Too large fanout (%u)\"), fanout);\n    ++\t\tdie(_(\"too large fanout (%u)\"), fanout);\n      \twhile (fanout) {\n      \t\tpath[i++] = hex_sha1[j++];\n      \t\tpath[i++] = hex_sha1[j++];\n    @@ builtin/fast-import.c: static uintmax_t do_change_note_fanout(\n      \t\t\t/* Rename fullpath to realpath */\n      \t\t\tif (!tree_content_remove(orig_root, fullpath, &leaf, 0))\n     -\t\t\t\tdie(\"Failed to remove path %s\", fullpath);\n    -+\t\t\t\tdie(_(\"Failed to remove path %s\"), fullpath);\n    ++\t\t\t\tdie(_(\"failed to remove path %s\"), fullpath);\n      \t\t\ttree_content_set(orig_root, realpath,\n      \t\t\t\t&leaf.versions[1].oid,\n      \t\t\t\tleaf.versions[1].mode,\n    @@ builtin/fast-import.c: static uintmax_t parse_mark_ref(const char *p, char **end\n      \tmark = strtoumax(p, endptr, 10);\n      \tif (*endptr == p)\n     -\t\tdie(\"No value after ':' in mark: %s\", command_buf.buf);\n    -+\t\tdie(_(\"No value after ':' in mark: %s\"), command_buf.buf);\n    ++\t\tdie(_(\"no value after ':' in mark: %s\"), command_buf.buf);\n      \treturn mark;\n      }\n      \n    @@ builtin/fast-import.c: static uintmax_t parse_mark_ref_eol(const char *p)\n      \tmark = parse_mark_ref(p, &end);\n      \tif (*end != '\\0')\n     -\t\tdie(\"Garbage after mark: %s\", command_buf.buf);\n    -+\t\tdie(_(\"Garbage after mark: %s\"), command_buf.buf);\n    ++\t\tdie(_(\"garbage after mark: %s\"), command_buf.buf);\n      \treturn mark;\n      }\n      \n    @@ builtin/fast-import.c: static uintmax_t parse_mark_ref_space(const char **p)\n      \tmark = parse_mark_ref(*p, &end);\n      \tif (*end++ != ' ')\n     -\t\tdie(\"Missing space after mark: %s\", command_buf.buf);\n    -+\t\tdie(_(\"Missing space after mark: %s\"), command_buf.buf);\n    ++\t\tdie(_(\"missing space after mark: %s\"), command_buf.buf);\n      \t*p = end;\n      \treturn mark;\n      }\n    @@ builtin/fast-import.c: static void parse_path(struct strbuf *sb, const char *p,\n      \tif (*p == '\"') {\n      \t\tif (unquote_c_style(sb, p, endp))\n     -\t\t\tdie(\"Invalid %s: %s\", field, command_buf.buf);\n    -+\t\t\tdie(_(\"Invalid %s: %s\"), field, command_buf.buf);\n    ++\t\t\tdie(_(\"invalid %s: %s\"), field, command_buf.buf);\n      \t\tif (strlen(sb->buf) != sb->len)\n     -\t\t\tdie(\"NUL in %s: %s\", field, command_buf.buf);\n     +\t\t\tdie(_(\"NUL in %s: %s\"), field, command_buf.buf);\n    @@ builtin/fast-import.c: static void parse_path_eol(struct strbuf *sb, const char\n      \tparse_path(sb, p, &end, 1, field);\n      \tif (*end)\n     -\t\tdie(\"Garbage after %s: %s\", field, command_buf.buf);\n    -+\t\tdie(_(\"Garbage after %s: %s\"), field, command_buf.buf);\n    ++\t\tdie(_(\"garbage after %s: %s\"), field, command_buf.buf);\n      }\n      \n      /*\n    @@ builtin/fast-import.c: static void parse_path_space(struct strbuf *sb, const cha\n      \tparse_path(sb, p, endp, 0, field);\n      \tif (**endp != ' ')\n     -\t\tdie(\"Missing space after %s: %s\", field, command_buf.buf);\n    -+\t\tdie(_(\"Missing space after %s: %s\"), field, command_buf.buf);\n    ++\t\tdie(_(\"missing space after %s: %s\"), field, command_buf.buf);\n      \t(*endp)++;\n      }\n      \n    @@ builtin/fast-import.c: static void file_change_m(const char *p, struct branch *b\n      \tp = parse_mode(p, &mode);\n      \tif (!p)\n     -\t\tdie(\"Corrupt mode: %s\", command_buf.buf);\n    -+\t\tdie(_(\"Corrupt mode: %s\"), command_buf.buf);\n    ++\t\tdie(_(\"corrupt mode: %s\"), command_buf.buf);\n      \tswitch (mode) {\n      \tcase 0644:\n      \tcase 0755:\n    @@ builtin/fast-import.c: static void file_change_m(const char *p, struct branch *b\n      \t\tbreak;\n      \tdefault:\n     -\t\tdie(\"Corrupt mode: %s\", command_buf.buf);\n    -+\t\tdie(_(\"Corrupt mode: %s\"), command_buf.buf);\n    ++\t\tdie(_(\"corrupt mode: %s\"), command_buf.buf);\n      \t}\n      \n      \tif (*p == ':') {\n    @@ builtin/fast-import.c: static void file_change_m(const char *p, struct branch *b\n      \t} else {\n      \t\tif (parse_mapped_oid_hex(p, &oid, &p))\n     -\t\t\tdie(\"Invalid dataref: %s\", command_buf.buf);\n    -+\t\t\tdie(_(\"Invalid dataref: %s\"), command_buf.buf);\n    ++\t\t\tdie(_(\"invalid dataref: %s\"), command_buf.buf);\n      \t\toe = find_object(&oid);\n      \t\tif (*p++ != ' ')\n     -\t\t\tdie(\"Missing space after SHA1: %s\", command_buf.buf);\n    -+\t\t\tdie(_(\"Missing space after SHA1: %s\"), command_buf.buf);\n    ++\t\t\tdie(_(\"missing space after SHA1: %s\"), command_buf.buf);\n      \t}\n      \n      \tstrbuf_reset(&path);\n    @@ builtin/fast-import.c: static void file_change_m(const char *p, struct branch *b\n      \t\telse if (oe) {\n      \t\t\tif (oe->type != OBJ_COMMIT)\n     -\t\t\t\tdie(\"Not a commit (actually a %s): %s\",\n    -+\t\t\t\tdie(_(\"Not a commit (actually a %s): %s\"),\n    ++\t\t\t\tdie(_(\"not a commit (actually a %s): %s\"),\n      \t\t\t\t\ttype_name(oe->type), command_buf.buf);\n      \t\t}\n      \t\t/*\n    @@ builtin/fast-import.c: static void file_change_m(const char *p, struct branch *b\n      \t} else if (inline_data) {\n      \t\tif (S_ISDIR(mode))\n     -\t\t\tdie(\"Directories cannot be specified 'inline': %s\",\n    -+\t\t\tdie(_(\"Directories cannot be specified 'inline': %s\"),\n    ++\t\t\tdie(_(\"directories cannot be specified 'inline': %s\"),\n      \t\t\t\tcommand_buf.buf);\n      \t\twhile (read_next_command() != EOF) {\n      \t\t\tconst char *v;\n    @@ builtin/fast-import.c: static void file_change_m(const char *p, struct branch *b\n     -\t\t\t\t\tS_ISDIR(mode) ?  \"Tree\" : \"Blob\",\n     -\t\t\t\t\tcommand_buf.buf);\n     +\t\t\tdie(_(\"%s not found: %s\"),\n    -+\t\t\t    S_ISDIR(mode) ?  _(\"Tree\") : _(\"Blob\"),\n    ++\t\t\t    S_ISDIR(mode) ?  _(\"tree\") : _(\"blob\"),\n     +\t\t\t    command_buf.buf);\n      \t\tif (type != expected)\n     -\t\t\tdie(\"Not a %s (actually a %s): %s\",\n    -+\t\t\tdie(_(\"Not a %s (actually a %s): %s\"),\n    ++\t\t\tdie(_(\"not a %s (actually a %s): %s\"),\n      \t\t\t\ttype_name(expected), type_name(type),\n      \t\t\t\tcommand_buf.buf);\n      \t}\n    @@ builtin/fast-import.c: static void file_change_cr(const char *p, struct branch *\n      \t\ttree_content_get(&b->branch_tree, source.buf, &leaf, 1);\n      \tif (!leaf.versions[1].mode)\n     -\t\tdie(\"Path %s not in branch\", source.buf);\n    -+\t\tdie(_(\"Path %s not in branch\"), source.buf);\n    ++\t\tdie(_(\"path %s not in branch\"), source.buf);\n      \tif (!*dest.buf) {\t/* C \"path/to/subdir\" \"\" */\n      \t\ttree_content_replace(&b->branch_tree,\n      \t\t\t&leaf.versions[1].oid,\n    @@ builtin/fast-import.c: static void note_change_n(const char *p, struct branch *b\n      \t} else {\n      \t\tif (parse_mapped_oid_hex(p, &oid, &p))\n     -\t\t\tdie(\"Invalid dataref: %s\", command_buf.buf);\n    -+\t\t\tdie(_(\"Invalid dataref: %s\"), command_buf.buf);\n    ++\t\t\tdie(_(\"invalid dataref: %s\"), command_buf.buf);\n      \t\toe = find_object(&oid);\n      \t\tif (*p++ != ' ')\n     -\t\t\tdie(\"Missing space after SHA1: %s\", command_buf.buf);\n    -+\t\t\tdie(_(\"Missing space after SHA1: %s\"), command_buf.buf);\n    ++\t\t\tdie(_(\"missing space after SHA1: %s\"), command_buf.buf);\n      \t}\n      \n      \t/* <commit-ish> */\n    @@ builtin/fast-import.c: static void note_change_n(const char *p, struct branch *b\n      \tif (s) {\n      \t\tif (is_null_oid(&s->oid))\n     -\t\t\tdie(\"Can't add a note on empty branch.\");\n    -+\t\t\tdie(_(\"Can't add a note on empty branch.\"));\n    ++\t\t\tdie(_(\"can't add a note on empty branch.\"));\n      \t\toidcpy(&commit_oid, &s->oid);\n      \t} else if (*p == ':') {\n      \t\tuintmax_t commit_mark = parse_mark_ref_eol(p);\n      \t\tstruct object_entry *commit_oe = find_mark(marks, commit_mark);\n      \t\tif (commit_oe->type != OBJ_COMMIT)\n     -\t\t\tdie(\"Mark :%\" PRIuMAX \" not a commit\", commit_mark);\n    -+\t\t\tdie(_(\"Mark :%\" PRIuMAX \" not a commit\"), commit_mark);\n    ++\t\t\tdie(_(\"mark :%\" PRIuMAX \" not a commit\"), commit_mark);\n      \t\toidcpy(&commit_oid, &commit_oe->idx.oid);\n      \t} else if (!repo_get_oid(the_repository, p, &commit_oid)) {\n      \t\tunsigned long size;\n    @@ builtin/fast-import.c: static void note_change_n(const char *p, struct branch *b\n      \t\t\t\t\t\t   &commit_oid);\n      \t\tif (!buf || size < the_hash_algo->hexsz + 6)\n     -\t\t\tdie(\"Not a valid commit: %s\", p);\n    -+\t\t\tdie(_(\"Not a valid commit: %s\"), p);\n    ++\t\t\tdie(_(\"not a valid commit: %s\"), p);\n      \t\tfree(buf);\n      \t} else\n     -\t\tdie(\"Invalid ref name or SHA1 expression: %s\", p);\n    -+\t\tdie(_(\"Invalid ref name or SHA1 expression: %s\"), p);\n    ++\t\tdie(_(\"invalid ref name or SHA1 expression: %s\"), p);\n      \n      \tif (inline_data) {\n      \t\tread_next_command();\n    @@ builtin/fast-import.c: static void note_change_n(const char *p, struct branch *b\n      \t} else if (oe) {\n      \t\tif (oe->type != OBJ_BLOB)\n     -\t\t\tdie(\"Not a blob (actually a %s): %s\",\n    -+\t\t\tdie(_(\"Not a blob (actually a %s): %s\"),\n    ++\t\t\tdie(_(\"not a blob (actually a %s): %s\"),\n      \t\t\t\ttype_name(oe->type), command_buf.buf);\n      \t} else if (!is_null_oid(&oid)) {\n      \t\tenum object_type type = odb_read_object_info(the_repository->objects, &oid,\n      \t\t\t\t\t\t\tNULL);\n      \t\tif (type < 0)\n     -\t\t\tdie(\"Blob not found: %s\", command_buf.buf);\n    -+\t\t\tdie(_(\"Blob not found: %s\"), command_buf.buf);\n    ++\t\t\tdie(_(\"blob not found: %s\"), command_buf.buf);\n      \t\tif (type != OBJ_BLOB)\n     -\t\t\tdie(\"Not a blob (actually a %s): %s\",\n    -+\t\t\tdie(_(\"Not a blob (actually a %s): %s\"),\n    ++\t\t\tdie(_(\"not a blob (actually a %s): %s\"),\n      \t\t\t    type_name(type), command_buf.buf);\n      \t}\n      \n    @@ builtin/fast-import.c: static void file_change_deleteall(struct branch *b)\n      {\n      \tif (!buf || size < the_hash_algo->hexsz + 6)\n     -\t\tdie(\"Not a valid commit: %s\", oid_to_hex(&b->oid));\n    -+\t\tdie(_(\"Not a valid commit: %s\"), oid_to_hex(&b->oid));\n    ++\t\tdie(_(\"not a valid commit: %s\"), oid_to_hex(&b->oid));\n      \tif (memcmp(\"tree \", buf, 5)\n      \t\t|| get_oid_hex(buf + 5, &b->branch_tree.versions[1].oid))\n     -\t\tdie(\"The commit %s is corrupt\", oid_to_hex(&b->oid));\n    -+\t\tdie(_(\"The commit %s is corrupt\"), oid_to_hex(&b->oid));\n    ++\t\tdie(_(\"the commit %s is corrupt\"), oid_to_hex(&b->oid));\n      \toidcpy(&b->branch_tree.versions[0].oid,\n      \t       &b->branch_tree.versions[1].oid);\n      }\n    @@ builtin/fast-import.c: static int parse_objectish(struct branch *b, const char *\n      \ts = lookup_branch(objectish);\n      \tif (b == s)\n     -\t\tdie(\"Can't create a branch from itself: %s\", b->name);\n    -+\t\tdie(_(\"Can't create a branch from itself: %s\"), b->name);\n    ++\t\tdie(_(\"can't create a branch from itself: %s\"), b->name);\n      \telse if (s) {\n      \t\tstruct object_id *t = &s->branch_tree.versions[1].oid;\n      \t\toidcpy(&b->oid, &s->oid);\n    @@ builtin/fast-import.c: static int parse_objectish(struct branch *b, const char *\n      \t\tstruct object_entry *oe = find_mark(marks, idnum);\n      \t\tif (oe->type != OBJ_COMMIT)\n     -\t\t\tdie(\"Mark :%\" PRIuMAX \" not a commit\", idnum);\n    -+\t\t\tdie(_(\"Mark :%\" PRIuMAX \" not a commit\"), idnum);\n    ++\t\t\tdie(_(\"mark :%\" PRIuMAX \" not a commit\"), idnum);\n      \t\tif (!oideq(&b->oid, &oe->idx.oid)) {\n      \t\t\toidcpy(&b->oid, &oe->idx.oid);\n      \t\t\tif (oe->pack_id != MAX_PACK_ID) {\n    @@ builtin/fast-import.c: static int parse_objectish(struct branch *b, const char *\n      \t}\n      \telse\n     -\t\tdie(\"Invalid ref name or SHA1 expression: %s\", objectish);\n    -+\t\tdie(_(\"Invalid ref name or SHA1 expression: %s\"), objectish);\n    ++\t\tdie(_(\"invalid ref name or SHA1 expression: %s\"), objectish);\n      \n      \tif (b->branch_tree.tree && !oideq(&oid, &b->branch_tree.versions[1].oid)) {\n      \t\trelease_tree_content_recursive(b->branch_tree.tree);\n    @@ builtin/fast-import.c: static struct hash_list *parse_merge(unsigned int *count)\n      \t\t\tstruct object_entry *oe = find_mark(marks, idnum);\n      \t\t\tif (oe->type != OBJ_COMMIT)\n     -\t\t\t\tdie(\"Mark :%\" PRIuMAX \" not a commit\", idnum);\n    -+\t\t\t\tdie(_(\"Mark :%\" PRIuMAX \" not a commit\"), idnum);\n    ++\t\t\t\tdie(_(\"mark :%\" PRIuMAX \" not a commit\"), idnum);\n      \t\t\toidcpy(&n->oid, &oe->idx.oid);\n      \t\t} else if (!repo_get_oid(the_repository, from, &n->oid)) {\n      \t\t\tunsigned long size;\n    @@ builtin/fast-import.c: static struct hash_list *parse_merge(unsigned int *count)\n      \t\t\t\t\t\t\t   &size, &n->oid);\n      \t\t\tif (!buf || size < the_hash_algo->hexsz + 6)\n     -\t\t\t\tdie(\"Not a valid commit: %s\", from);\n    -+\t\t\t\tdie(_(\"Not a valid commit: %s\"), from);\n    ++\t\t\t\tdie(_(\"not a valid commit: %s\"), from);\n      \t\t\tfree(buf);\n      \t\t} else\n     -\t\t\tdie(\"Invalid ref name or SHA1 expression: %s\", from);\n    -+\t\t\tdie(_(\"Invalid ref name or SHA1 expression: %s\"), from);\n    ++\t\t\tdie(_(\"invalid ref name or SHA1 expression: %s\"), from);\n      \n      \t\tn->next = NULL;\n      \t\t*tail = n;\n    @@ builtin/fast-import.c: static void parse_one_signature(struct signature_data *si\n      \tif (!space)\n     -\t\tdie(\"Expected gpgsig format: 'gpgsig <hash-algo> <signature-format>', \"\n     -\t\t    \"got 'gpgsig %s'\", args);\n    -+\t\tdie(_(\"Expected gpgsig format: 'gpgsig <hash-algo> <signature-format>', \"\n    ++\t\tdie(_(\"expected gpgsig format: 'gpgsig <hash-algo> <signature-format>', \"\n     +\t\t      \"got 'gpgsig %s'\"), args);\n      \t*space = '\\0';\n      \n    @@ builtin/fast-import.c: static void parse_one_signature(struct signature_data *si\n      \tif (strcmp(sig->hash_algo, \"sha1\") &&\n      \t    strcmp(sig->hash_algo, \"sha256\"))\n     -\t\tdie(\"Unknown git hash algorithm in gpgsig: '%s'\", sig->hash_algo);\n    -+\t\tdie(_(\"Unknown git hash algorithm in gpgsig: '%s'\"), sig->hash_algo);\n    ++\t\tdie(_(\"unknown git hash algorithm in gpgsig: '%s'\"), sig->hash_algo);\n      \n      \t/* Validate signature format */\n      \tif (!valid_signature_format(sig->sig_format))\n     -\t\tdie(\"Invalid signature format in gpgsig: '%s'\", sig->sig_format);\n    -+\t\tdie(_(\"Invalid signature format in gpgsig: '%s'\"), sig->sig_format);\n    ++\t\tdie(_(\"invalid signature format in gpgsig: '%s'\"), sig->sig_format);\n      \tif (!strcmp(sig->sig_format, \"unknown\"))\n     -\t\twarning(\"'unknown' signature format in gpgsig\");\n     +\t\twarning(_(\"'unknown' signature format in gpgsig\"));\n    @@ builtin/fast-import.c: static void parse_new_commit(const char *arg)\n      \t}\n      \tif (!committer)\n     -\t\tdie(\"Expected committer but didn't get one\");\n    -+\t\tdie(_(\"Expected committer but didn't get one\"));\n    ++\t\tdie(_(\"expected committer but didn't get one\"));\n      \n      \twhile (skip_prefix(command_buf.buf, \"gpgsig \", &v)) {\n      \t\tswitch (signed_commit_mode) {\n    @@ builtin/fast-import.c: static void parse_new_tag(const char *arg)\n      \t/* from ... */\n      \tif (!skip_prefix(command_buf.buf, \"from \", &from))\n     -\t\tdie(\"Expected from command, got %s\", command_buf.buf);\n    -+\t\tdie(_(\"Expected 'from' command, got '%s'\"), command_buf.buf);\n    ++\t\tdie(_(\"expected 'from' command, got '%s'\"), command_buf.buf);\n      \ts = lookup_branch(from);\n      \tif (s) {\n      \t\tif (is_null_oid(&s->oid))\n     -\t\t\tdie(\"Can't tag an empty branch.\");\n    -+\t\t\tdie(_(\"Can't tag an empty branch.\"));\n    ++\t\t\tdie(_(\"can't tag an empty branch.\"));\n      \t\toidcpy(&oid, &s->oid);\n      \t\ttype = OBJ_COMMIT;\n      \t} else if (*from == ':') {\n    @@ builtin/fast-import.c: static void parse_new_tag(const char *arg)\n      \t\t\t\t\t\t    &oid, NULL);\n      \t\t\tif (type < 0)\n     -\t\t\t\tdie(\"Not a valid object: %s\", from);\n    -+\t\t\t\tdie(_(\"Not a valid object: %s\"), from);\n    ++\t\t\t\tdie(_(\"not a valid object: %s\"), from);\n      \t\t} else\n      \t\t\ttype = oe->type;\n      \t} else\n     -\t\tdie(\"Invalid ref name or SHA1 expression: %s\", from);\n    -+\t\tdie(_(\"Invalid ref name or SHA1 expression: %s\"), from);\n    ++\t\tdie(_(\"invalid ref name or SHA1 expression: %s\"), from);\n      \tread_next_command();\n      \n      \t/* original-oid ... */\n    @@ builtin/fast-import.c: static void parse_reset_branch(const char *arg)\n      {\n      \tif (write_in_full(cat_blob_fd, buf, size) < 0)\n     -\t\tdie_errno(\"Write to frontend failed\");\n    -+\t\tdie_errno(_(\"Write to frontend failed\"));\n    ++\t\tdie_errno(_(\"write to frontend failed\"));\n      }\n      \n      static void cat_blob(struct object_entry *oe, struct object_id *oid)\n    @@ builtin/fast-import.c: static void cat_blob(struct object_entry *oe, struct obje\n      \t}\n      \tif (!buf)\n     -\t\tdie(\"Can't read object %s\", oid_to_hex(oid));\n    -+\t\tdie(_(\"Can't read object %s\"), oid_to_hex(oid));\n    ++\t\tdie(_(\"can't read object %s\"), oid_to_hex(oid));\n      \tif (type != OBJ_BLOB)\n     -\t\tdie(\"Object %s is a %s but a blob was expected.\",\n    -+\t\tdie(_(\"Object %s is a %s but a blob was expected.\"),\n    ++\t\tdie(_(\"object %s is a %s but a blob was expected.\"),\n      \t\t    oid_to_hex(oid), type_name(type));\n      \tstrbuf_reset(&line);\n      \tstrbuf_addf(&line, \"%s %s %\"PRIuMAX\"\\n\", oid_to_hex(oid),\n    @@ builtin/fast-import.c: static void parse_get_mark(const char *p)\n      \t/* get-mark SP <object> LF */\n      \tif (*p != ':')\n     -\t\tdie(\"Not a mark: %s\", p);\n    -+\t\tdie(_(\"Not a mark: %s\"), p);\n    ++\t\tdie(_(\"not a mark: %s\"), p);\n      \n      \toe = find_mark(marks, parse_mark_ref_eol(p));\n      \tif (!oe)\n     -\t\tdie(\"Unknown mark: %s\", command_buf.buf);\n    -+\t\tdie(_(\"Unknown mark: %s\"), command_buf.buf);\n    ++\t\tdie(_(\"unknown mark: %s\"), command_buf.buf);\n      \n      \txsnprintf(output, sizeof(output), \"%s\\n\", oid_to_hex(&oe->idx.oid));\n      \tcat_blob_write(output, the_hash_algo->hexsz + 1);\n    @@ builtin/fast-import.c: static void parse_cat_blob(const char *p)\n      \t\toe = find_mark(marks, parse_mark_ref_eol(p));\n      \t\tif (!oe)\n     -\t\t\tdie(\"Unknown mark: %s\", command_buf.buf);\n    -+\t\t\tdie(_(\"Unknown mark: %s\"), command_buf.buf);\n    ++\t\t\tdie(_(\"unknown mark: %s\"), command_buf.buf);\n      \t\toidcpy(&oid, &oe->idx.oid);\n      \t} else {\n      \t\tif (parse_mapped_oid_hex(p, &oid, &p))\n     -\t\t\tdie(\"Invalid dataref: %s\", command_buf.buf);\n    -+\t\t\tdie(_(\"Invalid dataref: %s\"), command_buf.buf);\n    ++\t\t\tdie(_(\"invalid dataref: %s\"), command_buf.buf);\n      \t\tif (*p)\n     -\t\t\tdie(\"Garbage after SHA1: %s\", command_buf.buf);\n    -+\t\t\tdie(_(\"Garbage after SHA1: %s\"), command_buf.buf);\n    ++\t\t\tdie(_(\"garbage after SHA1: %s\"), command_buf.buf);\n      \t\toe = find_object(&oid);\n      \t}\n      \n    @@ builtin/fast-import.c: static struct object_entry *dereference(struct object_ent\n      \t\tbreak;\n      \tdefault:\n     -\t\tdie(\"Not a tree-ish: %s\", command_buf.buf);\n    -+\t\tdie(_(\"Not a tree-ish: %s\"), command_buf.buf);\n    ++\t\tdie(_(\"not a tree-ish: %s\"), command_buf.buf);\n      \t}\n      \n      \tif (oe->pack_id != MAX_PACK_ID) {\t/* in a pack being written */\n    @@ builtin/fast-import.c: static struct object_entry *dereference(struct object_ent\n      \t}\n      \tif (!buf)\n     -\t\tdie(\"Can't load object %s\", oid_to_hex(oid));\n    -+\t\tdie(_(\"Can't load object %s\"), oid_to_hex(oid));\n    ++\t\tdie(_(\"can't load object %s\"), oid_to_hex(oid));\n      \n      \t/* Peel one layer. */\n      \tswitch (oe->type) {\n    @@ builtin/fast-import.c: static struct object_entry *dereference(struct object_ent\n      \t\tif (size < hexsz + strlen(\"object \") ||\n      \t\t    get_oid_hex(buf + strlen(\"object \"), oid))\n     -\t\t\tdie(\"Invalid SHA1 in tag: %s\", command_buf.buf);\n    -+\t\t\tdie(_(\"Invalid SHA1 in tag: %s\"), command_buf.buf);\n    ++\t\t\tdie(_(\"invalid SHA1 in tag: %s\"), command_buf.buf);\n      \t\tbreak;\n      \tcase OBJ_COMMIT:\n      \t\tif (size < hexsz + strlen(\"tree \") ||\n      \t\t    get_oid_hex(buf + strlen(\"tree \"), oid))\n     -\t\t\tdie(\"Invalid SHA1 in commit: %s\", command_buf.buf);\n    -+\t\t\tdie(_(\"Invalid SHA1 in commit: %s\"), command_buf.buf);\n    ++\t\t\tdie(_(\"invalid SHA1 in commit: %s\"), command_buf.buf);\n      \t}\n      \n      \tfree(buf);\n    +@@ builtin/fast-import.c: static void build_mark_map(struct string_list *from, struct string_list *to)\n    + \tfor_each_string_list_item(fromp, from) {\n    + \t\ttop = string_list_lookup(to, fromp->string);\n    + \t\tif (!fromp->util) {\n    +-\t\t\tdie(_(\"Missing from marks for submodule '%s'\"), fromp->string);\n    ++\t\t\tdie(_(\"missing from marks for submodule '%s'\"), fromp->string);\n    + \t\t} else if (!top || !top->util) {\n    +-\t\t\tdie(_(\"Missing to marks for submodule '%s'\"), fromp->string);\n    ++\t\t\tdie(_(\"missing to marks for submodule '%s'\"), fromp->string);\n    + \t\t}\n    + \t\tbuild_mark_map_one(fromp->util, top->util);\n    + \t}\n     @@ builtin/fast-import.c: static struct object_entry *parse_treeish_dataref(const char **p)\n      \tif (**p == ':') {\t/* <mark> */\n      \t\te = find_mark(marks, parse_mark_ref_space(p));\n      \t\tif (!e)\n     -\t\t\tdie(\"Unknown mark: %s\", command_buf.buf);\n    -+\t\t\tdie(_(\"Unknown mark: %s\"), command_buf.buf);\n    ++\t\t\tdie(_(\"unknown mark: %s\"), command_buf.buf);\n      \t\toidcpy(&oid, &e->idx.oid);\n      \t} else {\t/* <sha1> */\n      \t\tif (parse_mapped_oid_hex(*p, &oid, p))\n     -\t\t\tdie(\"Invalid dataref: %s\", command_buf.buf);\n    -+\t\t\tdie(_(\"Invalid dataref: %s\"), command_buf.buf);\n    ++\t\t\tdie(_(\"invalid dataref: %s\"), command_buf.buf);\n      \t\te = find_object(&oid);\n      \t\tif (*(*p)++ != ' ')\n     -\t\t\tdie(\"Missing space after tree-ish: %s\", command_buf.buf);\n    -+\t\t\tdie(_(\"Missing space after tree-ish: %s\"), command_buf.buf);\n    ++\t\t\tdie(_(\"missing space after tree-ish: %s\"), command_buf.buf);\n      \t}\n      \n      \twhile (!e || e->type != OBJ_TREE)\n    @@ builtin/fast-import.c: static void parse_ls(const char *p, struct branch *b)\n      \tif (*p == '\"') {\n      \t\tif (!b)\n     -\t\t\tdie(\"Not in a commit: %s\", command_buf.buf);\n    -+\t\t\tdie(_(\"Not in a commit: %s\"), command_buf.buf);\n    ++\t\t\tdie(_(\"not in a commit: %s\"), command_buf.buf);\n      \t\troot = &b->branch_tree;\n      \t} else {\n      \t\tstruct object_entry *e = parse_treeish_dataref(&p);\n    +@@ builtin/fast-import.c: static void parse_alias(void)\n    + \t/* mark ... */\n    + \tparse_mark();\n    + \tif (!next_mark)\n    +-\t\tdie(_(\"Expected 'mark' command, got %s\"), command_buf.buf);\n    ++\t\tdie(_(\"expected 'mark' command, got %s\"), command_buf.buf);\n    + \n    + \t/* to ... */\n    + \tmemset(&b, 0, sizeof(b));\n    + \tif (!parse_objectish_with_prefix(&b, \"to \"))\n    +-\t\tdie(_(\"Expected 'to' command, got %s\"), command_buf.buf);\n    ++\t\tdie(_(\"expected 'to' command, got %s\"), command_buf.buf);\n    + \te = find_object(&b.oid);\n    + \tassert(e);\n    + \tinsert_mark(&marks, next_mark, e);\n     @@ builtin/fast-import.c: static void option_import_marks(const char *marks,\n      {\n      \tif (import_marks_file) {\n      \t\tif (from_stream)\n     -\t\t\tdie(\"Only one import-marks command allowed per stream\");\n    -+\t\t\tdie(_(\"Only one import-marks command allowed per stream\"));\n    ++\t\t\tdie(_(\"only one import-marks command allowed per stream\"));\n      \n      \t\t/* read previous mark file */\n      \t\tif(!import_marks_file_from_stream)\n    @@ builtin/fast-import.c: static void option_cat_blob_fd(const char *fd)\n      \tcat_blob_fd = (int) n;\n      }\n      \n    +@@ builtin/fast-import.c: static void option_rewrite_submodules(const char *arg, struct string_list *list)\n    + \tchar *s = xstrdup(arg);\n    + \tchar *f = strchr(s, ':');\n    + \tif (!f)\n    +-\t\tdie(_(\"Expected format name:filename for submodule rewrite option\"));\n    ++\t\tdie(_(\"expected format name:filename for submodule rewrite option\"));\n    + \t*f = '\\0';\n    + \tf++;\n    + \tCALLOC_ARRAY(ms, 1);\n     @@ builtin/fast-import.c: static void option_rewrite_submodules(const char *arg, struct string_list *list)\n      \tf = prefix_filename(global_prefix, f);\n      \tfp = fopen(f, \"r\");\n    @@ builtin/fast-import.c: static int parse_one_feature(const char *feature, int fro\n      {\n      \tif (seen_data_command)\n     -\t\tdie(\"Got feature command '%s' after data command\", feature);\n    -+\t\tdie(_(\"Got feature command '%s' after data command\"), feature);\n    ++\t\tdie(_(\"got feature command '%s' after data command\"), feature);\n      \n      \tif (parse_one_feature(feature, 1))\n      \t\treturn;\n      \n     -\tdie(\"This version of fast-import does not support feature %s.\", feature);\n    -+\tdie(_(\"This version of fast-import does not support feature %s.\"), feature);\n    ++\tdie(_(\"this version of fast-import does not support feature %s.\"), feature);\n      }\n      \n      static void parse_option(const char *option)\n      {\n      \tif (seen_data_command)\n     -\t\tdie(\"Got option command '%s' after data command\", option);\n    -+\t\tdie(_(\"Got option command '%s' after data command\"), option);\n    ++\t\tdie(_(\"got option command '%s' after data command\"), option);\n      \n      \tif (parse_one_option(option))\n      \t\treturn;\n      \n     -\tdie(\"This version of fast-import does not support option: %s\", option);\n    -+\tdie(_(\"This version of fast-import does not support option: %s\"), option);\n    ++\tdie(_(\"this version of fast-import does not support option: %s\"), option);\n      }\n      \n      static void git_pack_config(void)\n    @@ builtin/fast-import.c: int cmd_fast_import(int argc,\n      \t\t\t/* ignore non-git options*/;\n      \t\telse\n     -\t\t\tdie(\"Unsupported command: %s\", command_buf.buf);\n    -+\t\t\tdie(_(\"Unsupported command: %s\"), command_buf.buf);\n    ++\t\t\tdie(_(\"unsupported command: %s\"), command_buf.buf);\n      \n      \t\tif (checkpoint_requested)\n      \t\t\tcheckpoint();\n    @@ builtin/fast-import.c: int cmd_fast_import(int argc,\n      \n      \tend_packfile();\n      \n    +\n    + ## t/t9300-fast-import.sh ##\n    +@@ t/t9300-fast-import.sh: test_expect_success 'R: blob appears only once' '\n    + # The error message when a space is missing not at the\n    + # end of the line is:\n    + #\n    +-#   Missing space after ..\n    ++#   missing space after ..\n    + #\n    + # or when extra characters come after the mark at the end\n    + # of the line:\n    + #\n    +-#   Garbage after ..\n    ++#   garbage after ..\n    + #\n    + # or when the dataref is neither \"inline \" or a known SHA1,\n    + #\n    +-#   Invalid dataref ..\n    ++#   invalid dataref ..\n    + #\n    + test_expect_success 'S: initialize for S tests' '\n    + \ttest_tick &&\n    +@@ t/t9300-fast-import.sh: test_path_fail () {\n    + \n    + test_path_base_fail () {\n    + \tlocal change=\"$1\" prefix=\"$2\" field=\"$3\" suffix=\"$4\"\n    +-\ttest_path_fail \"$change\" 'unclosed \" in '\"$field\"          \"$prefix\" '\"hello.c'    \"$suffix\" \"Invalid $field\"\n    +-\ttest_path_fail \"$change\" \"invalid escape in quoted $field\" \"$prefix\" '\"hello\\xff\"' \"$suffix\" \"Invalid $field\"\n    ++\ttest_path_fail \"$change\" 'unclosed \" in '\"$field\"          \"$prefix\" '\"hello.c'    \"$suffix\" \"invalid $field\"\n    ++\ttest_path_fail \"$change\" \"invalid escape in quoted $field\" \"$prefix\" '\"hello\\xff\"' \"$suffix\" \"invalid $field\"\n    + \ttest_path_fail \"$change\" \"escaped NUL in quoted $field\"    \"$prefix\" '\"hello\\000\"' \"$suffix\" \"NUL in $field\"\n    + }\n    + test_path_eol_quoted_fail () {\n    + \tlocal change=\"$1\" prefix=\"$2\" field=\"$3\"\n    + \ttest_path_base_fail \"$change\" \"$prefix\" \"$field\" ''\n    +-\ttest_path_fail \"$change\" \"garbage after quoted $field\" \"$prefix\" '\"hello.c\"' 'x' \"Garbage after $field\"\n    +-\ttest_path_fail \"$change\" \"space after quoted $field\"   \"$prefix\" '\"hello.c\"' ' ' \"Garbage after $field\"\n    ++\ttest_path_fail \"$change\" \"garbage after quoted $field\" \"$prefix\" '\"hello.c\"' 'x' \"garbage after $field\"\n    ++\ttest_path_fail \"$change\" \"space after quoted $field\"   \"$prefix\" '\"hello.c\"' ' ' \"garbage after $field\"\n    + }\n    + test_path_eol_fail () {\n    + \tlocal change=\"$1\" prefix=\"$2\" field=\"$3\"\n    +@@ t/t9300-fast-import.sh: test_path_eol_fail () {\n    + test_path_space_fail () {\n    + \tlocal change=\"$1\" prefix=\"$2\" field=\"$3\"\n    + \ttest_path_base_fail \"$change\" \"$prefix\" \"$field\" ' world.c'\n    +-\ttest_path_fail \"$change\" \"missing space after quoted $field\"   \"$prefix\" '\"hello.c\"' 'x world.c' \"Missing space after $field\"\n    +-\ttest_path_fail \"$change\" \"missing space after unquoted $field\" \"$prefix\" 'hello.c'   ''          \"Missing space after $field\"\n    ++\ttest_path_fail \"$change\" \"missing space after quoted $field\"   \"$prefix\" '\"hello.c\"' 'x world.c' \"missing space after $field\"\n    ++\ttest_path_fail \"$change\" \"missing space after unquoted $field\" \"$prefix\" 'hello.c'   ''          \"missing space after $field\"\n    + }\n    + \n    + test_path_eol_fail   filemodify       'M 100644 :1 ' path\n    +@@ t/t9300-fast-import.sh: test_expect_success 'X: replace ref that becomes useless is removed' '\n    + \t\tsed -e s/othername/somename/ tmp >tmp2 &&\n    + \t\tgit fast-import --force <tmp2 2>msgs &&\n    + \n    +-\t\tgrep \"Dropping.*since it would point to itself\" msgs &&\n    ++\t\tgrep \"dropping.*since it would point to itself\" msgs &&\n    + \t\tgit show-ref >refs &&\n    + \t\t! grep refs/replace refs\n    + \t)\n5:  4ad31e1014 = 5:  158c13c078 gpg-interface: mark a string for translation\n\n\nChristian Couder (5):\n  gpg-interface: simplify ssh fingerprint parsing\n  gpg-interface: use left shift to define GPG_VERIFY_*\n  fast-export: mark strings for translation\n  fast-import: mark strings for translation\n  gpg-interface: mark a string for translation\n\n builtin/fast-export.c  |  79 ++++++------\n builtin/fast-import.c  | 280 ++++++++++++++++++++---------------------\n gpg-interface.c        |   4 +-\n gpg-interface.h        |   6 +-\n t/t9300-fast-import.sh |  20 +--\n 5 files changed, 195 insertions(+), 194 deletions(-)\n\n-- \n2.51.2.617.g2aaa867cd1\n\n"},{"id":"529958","messageId":"20251030123332.3337684-3-christian.couder@gmail.com","threadId":"64397","inReplyTo":"20251030123332.3337684-1-christian.couder@gmail.com","subject":"[PATCH v2 2/5] gpg-interface: use left shift to define GPG_VERIFY_*","fromName":"Christian Couder","fromEmail":"christian.couder@gmail.com","sentAt":"2025-10-30T12:33:29Z","receivedAt":"2025-10-30T12:33:52Z","isPatch":true,"sender":{"key":"christian.couder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/208954?v=4"},"body":"In \"gpg-interface.h\", the definitions of the GPG_VERIFY_* boolean flags\nare currently using 1, 2 and 4 while we often prefer the bitwise left\nshift operator, `<<`, for that purpose to make it clearer that they are\nboolean.\n\nLet's use the left shift operator here too. Let's also fix an indent\nissue with \"4\" while at it.\n\nSigned-off-by: Christian Couder <chriscool@tuxfamily.org>\n---\n gpg-interface.h | 6 +++---\n 1 file changed, 3 insertions(+), 3 deletions(-)\n\ndiff --git a/gpg-interface.h b/gpg-interface.h\nindex 50487aa148..ead1ed6967 100644\n--- a/gpg-interface.h\n+++ b/gpg-interface.h\n@@ -3,9 +3,9 @@\n \n struct strbuf;\n \n-#define GPG_VERIFY_VERBOSE\t\t1\n-#define GPG_VERIFY_RAW\t\t\t2\n-#define GPG_VERIFY_OMIT_STATUS\t4\n+#define GPG_VERIFY_VERBOSE\t(1<<0)\n+#define GPG_VERIFY_RAW\t\t(1<<1)\n+#define GPG_VERIFY_OMIT_STATUS\t(1<<2)\n \n enum signature_trust_level {\n \tTRUST_UNDEFINED,\n-- \n2.51.2.617.g2aaa867cd1\n\n"},{"id":"529959","messageId":"20251030123332.3337684-4-christian.couder@gmail.com","threadId":"64397","inReplyTo":"20251030123332.3337684-1-christian.couder@gmail.com","subject":"[PATCH v2 3/5] fast-export: mark strings for translation","fromName":"Christian Couder","fromEmail":"christian.couder@gmail.com","sentAt":"2025-10-30T12:33:30Z","receivedAt":"2025-10-30T12:33:53Z","isPatch":true,"sender":{"key":"christian.couder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/208954?v=4"},"body":"Some error or warning messages in \"builtin/fast-export.c\" are marked\nfor translation, but many are not.\n\nTo be more consistent and provide a better experience to people using a\ntranslated version, let's mark all the remaining error or warning\nmessages for translation.\n\nWhile at it:\n\n  - improve how some arguments to some error functions are indented,\n  - remove \"Error:\" at the start of an error message,\n  - downcase error and warning messages that start with an uppercase.\n\nSigned-off-by: Christian Couder <chriscool@tuxfamily.org>\n---\n builtin/fast-export.c | 79 ++++++++++++++++++++++---------------------\n 1 file changed, 40 insertions(+), 39 deletions(-)\n\ndiff --git a/builtin/fast-export.c b/builtin/fast-export.c\nindex 7adbc55f0d..0421360ab7 100644\n--- a/builtin/fast-export.c\n+++ b/builtin/fast-export.c\n@@ -65,7 +65,7 @@ static int parse_opt_sign_mode(const struct option *opt,\n \t\treturn 0;\n \n \tif (parse_sign_mode(arg, val))\n-\t\treturn error(\"Unknown %s mode: %s\", opt->long_name, arg);\n+\t\treturn error(_(\"unknown %s mode: %s\"), opt->long_name, arg);\n \n \treturn 0;\n }\n@@ -82,7 +82,7 @@ static int parse_opt_tag_of_filtered_mode(const struct option *opt,\n \telse if (!strcmp(arg, \"rewrite\"))\n \t\t*val = REWRITE;\n \telse\n-\t\treturn error(\"Unknown tag-of-filtered mode: %s\", arg);\n+\t\treturn error(_(\"unknown tag-of-filtered mode: %s\"), arg);\n \treturn 0;\n }\n \n@@ -107,7 +107,7 @@ static int parse_opt_reencode_mode(const struct option *opt,\n \t\tif (!strcasecmp(arg, \"abort\"))\n \t\t\t*val = REENCODE_ABORT;\n \t\telse\n-\t\t\treturn error(\"Unknown reencoding mode: %s\", arg);\n+\t\t\treturn error(_(\"unknown reencoding mode: %s\"), arg);\n \t}\n \n \treturn 0;\n@@ -318,16 +318,16 @@ static void export_blob(const struct object_id *oid)\n \t} else {\n \t\tbuf = odb_read_object(the_repository->objects, oid, &type, &size);\n \t\tif (!buf)\n-\t\t\tdie(\"could not read blob %s\", oid_to_hex(oid));\n+\t\t\tdie(_(\"could not read blob %s\"), oid_to_hex(oid));\n \t\tif (check_object_signature(the_repository, oid, buf, size,\n \t\t\t\t\t   type) < 0)\n-\t\t\tdie(\"oid mismatch in blob %s\", oid_to_hex(oid));\n+\t\t\tdie(_(\"oid mismatch in blob %s\"), oid_to_hex(oid));\n \t\tobject = parse_object_buffer(the_repository, oid, type,\n \t\t\t\t\t     size, buf, &eaten);\n \t}\n \n \tif (!object)\n-\t\tdie(\"Could not read blob %s\", oid_to_hex(oid));\n+\t\tdie(_(\"could not read blob %s\"), oid_to_hex(oid));\n \n \tmark_next_object(object);\n \n@@ -336,7 +336,7 @@ static void export_blob(const struct object_id *oid)\n \t\tprintf(\"original-oid %s\\n\", oid_to_hex(oid));\n \tprintf(\"data %\"PRIuMAX\"\\n\", (uintmax_t)size);\n \tif (size && fwrite(buf, size, 1, stdout) != 1)\n-\t\tdie_errno(\"could not write blob '%s'\", oid_to_hex(oid));\n+\t\tdie_errno(_(\"could not write blob '%s'\"), oid_to_hex(oid));\n \tprintf(\"\\n\");\n \n \tshow_progress();\n@@ -499,10 +499,10 @@ static void show_filemodify(struct diff_queue_struct *q,\n \t\t\tbreak;\n \n \t\tdefault:\n-\t\t\tdie(\"Unexpected comparison status '%c' for %s, %s\",\n-\t\t\t\tq->queue[i]->status,\n-\t\t\t\tospec->path ? ospec->path : \"none\",\n-\t\t\t\tspec->path ? spec->path : \"none\");\n+\t\t\tdie(_(\"unexpected comparison status '%c' for %s, %s\"),\n+\t\t\t    q->queue[i]->status,\n+\t\t\t    ospec->path ? ospec->path : _(\"none\"),\n+\t\t\t    spec->path ? spec->path : _(\"none\"));\n \t\t}\n \t}\n }\n@@ -699,14 +699,14 @@ static void handle_commit(struct commit *commit, struct rev_info *rev,\n \n \tauthor = strstr(commit_buffer_cursor, \"\\nauthor \");\n \tif (!author)\n-\t\tdie(\"could not find author in commit %s\",\n+\t\tdie(_(\"could not find author in commit %s\"),\n \t\t    oid_to_hex(&commit->object.oid));\n \tauthor++;\n \tcommit_buffer_cursor = author_end = strchrnul(author, '\\n');\n \n \tcommitter = strstr(commit_buffer_cursor, \"\\ncommitter \");\n \tif (!committer)\n-\t\tdie(\"could not find committer in commit %s\",\n+\t\tdie(_(\"could not find committer in commit %s\"),\n \t\t    oid_to_hex(&commit->object.oid));\n \tcommitter++;\n \tcommit_buffer_cursor = committer_end = strchrnul(committer, '\\n');\n@@ -781,8 +781,8 @@ static void handle_commit(struct commit *commit, struct rev_info *rev,\n \t\tcase REENCODE_NO:\n \t\t\tbreak;\n \t\tcase REENCODE_ABORT:\n-\t\t\tdie(\"Encountered commit-specific encoding %.*s in commit \"\n-\t\t\t    \"%s; use --reencode=[yes|no] to handle it\",\n+\t\t\tdie(_(\"encountered commit-specific encoding %.*s in commit \"\n+\t\t\t      \"%s; use --reencode=[yes|no] to handle it\"),\n \t\t\t    (int)encoding_len, encoding,\n \t\t\t    oid_to_hex(&commit->object.oid));\n \t\t}\n@@ -798,11 +798,11 @@ static void handle_commit(struct commit *commit, struct rev_info *rev,\n \tif (signatures.nr) {\n \t\tswitch (signed_commit_mode) {\n \t\tcase SIGN_ABORT:\n-\t\t\tdie(\"encountered signed commit %s; use \"\n-\t\t\t    \"--signed-commits=<mode> to handle it\",\n+\t\t\tdie(_(\"encountered signed commit %s; use \"\n+\t\t\t      \"--signed-commits=<mode> to handle it\"),\n \t\t\t    oid_to_hex(&commit->object.oid));\n \t\tcase SIGN_WARN_VERBATIM:\n-\t\t\twarning(\"exporting %\"PRIuMAX\" signature(s) for commit %s\",\n+\t\t\twarning(_(\"exporting %\"PRIuMAX\" signature(s) for commit %s\"),\n \t\t\t\t(uintmax_t)signatures.nr, oid_to_hex(&commit->object.oid));\n \t\t\t/* fallthru */\n \t\tcase SIGN_VERBATIM:\n@@ -812,7 +812,7 @@ static void handle_commit(struct commit *commit, struct rev_info *rev,\n \t\t\t}\n \t\t\tbreak;\n \t\tcase SIGN_WARN_STRIP:\n-\t\t\twarning(\"stripping signature(s) from commit %s\",\n+\t\t\twarning(_(\"stripping signature(s) from commit %s\"),\n \t\t\t\toid_to_hex(&commit->object.oid));\n \t\t\t/* fallthru */\n \t\tcase SIGN_STRIP:\n@@ -890,7 +890,8 @@ static void handle_tag(const char *name, struct tag *tag)\n \t\ttagged = ((struct tag *)tagged)->tagged;\n \t}\n \tif (tagged->type == OBJ_TREE) {\n-\t\twarning(\"Omitting tag %s,\\nsince tags of trees (or tags of tags of trees, etc.) are not supported.\",\n+\t\twarning(_(\"omitting tag %s,\\nsince tags of trees (or tags \"\n+\t\t\t  \"of tags of trees, etc.) are not supported.\"),\n \t\t\toid_to_hex(&tag->object.oid));\n \t\treturn;\n \t}\n@@ -898,7 +899,7 @@ static void handle_tag(const char *name, struct tag *tag)\n \tbuf = odb_read_object(the_repository->objects, &tag->object.oid,\n \t\t\t      &type, &size);\n \tif (!buf)\n-\t\tdie(\"could not read tag %s\", oid_to_hex(&tag->object.oid));\n+\t\tdie(_(\"could not read tag %s\"), oid_to_hex(&tag->object.oid));\n \tmessage = memmem(buf, size, \"\\n\\n\", 2);\n \tif (message) {\n \t\tmessage += 2;\n@@ -935,17 +936,17 @@ static void handle_tag(const char *name, struct tag *tag)\n \t\tif (sig_offset < message_size)\n \t\t\tswitch (signed_tag_mode) {\n \t\t\tcase SIGN_ABORT:\n-\t\t\t\tdie(\"encountered signed tag %s; use \"\n-\t\t\t\t    \"--signed-tags=<mode> to handle it\",\n+\t\t\t\tdie(_(\"encountered signed tag %s; use \"\n+\t\t\t\t      \"--signed-tags=<mode> to handle it\"),\n \t\t\t\t    oid_to_hex(&tag->object.oid));\n \t\t\tcase SIGN_WARN_VERBATIM:\n-\t\t\t\twarning(\"exporting signed tag %s\",\n+\t\t\t\twarning(_(\"exporting signed tag %s\"),\n \t\t\t\t\toid_to_hex(&tag->object.oid));\n \t\t\t\t/* fallthru */\n \t\t\tcase SIGN_VERBATIM:\n \t\t\t\tbreak;\n \t\t\tcase SIGN_WARN_STRIP:\n-\t\t\t\twarning(\"stripping signature from tag %s\",\n+\t\t\t\twarning(_(\"stripping signature from tag %s\"),\n \t\t\t\t\toid_to_hex(&tag->object.oid));\n \t\t\t\t/* fallthru */\n \t\t\tcase SIGN_STRIP:\n@@ -960,8 +961,8 @@ static void handle_tag(const char *name, struct tag *tag)\n \tif (!tagged_mark) {\n \t\tswitch (tag_of_filtered_mode) {\n \t\tcase TAG_FILTERING_ABORT:\n-\t\t\tdie(\"tag %s tags unexported object; use \"\n-\t\t\t    \"--tag-of-filtered-object=<mode> to handle it\",\n+\t\t\tdie(_(\"tag %s tags unexported object; use \"\n+\t\t\t      \"--tag-of-filtered-object=<mode> to handle it\"),\n \t\t\t    oid_to_hex(&tag->object.oid));\n \t\tcase DROP:\n \t\t\t/* Ignore this tag altogether */\n@@ -969,7 +970,7 @@ static void handle_tag(const char *name, struct tag *tag)\n \t\t\treturn;\n \t\tcase REWRITE:\n \t\t\tif (tagged->type == OBJ_TAG && !mark_tags) {\n-\t\t\t\tdie(_(\"Error: Cannot export nested tags unless --mark-tags is specified.\"));\n+\t\t\t\tdie(_(\"cannot export nested tags unless --mark-tags is specified.\"));\n \t\t\t} else if (tagged->type == OBJ_COMMIT) {\n \t\t\t\tp = rewrite_commit((struct commit *)tagged);\n \t\t\t\tif (!p) {\n@@ -1025,7 +1026,7 @@ static struct commit *get_commit(struct rev_cmdline_entry *e, const char *full_n\n \t\t\ttag = (struct tag *)tag->tagged;\n \t\t}\n \t\tif (!tag)\n-\t\t\tdie(\"Tag %s points nowhere?\", e->name);\n+\t\t\tdie(_(\"tag %s points nowhere?\"), e->name);\n \t\treturn (struct commit *)tag;\n \t}\n \tdefault:\n@@ -1063,7 +1064,7 @@ static void get_tags_and_duplicates(struct rev_cmdline_info *info)\n \n \t\tcommit = get_commit(e, full_name);\n \t\tif (!commit) {\n-\t\t\twarning(\"%s: Unexpected object of type %s, skipping.\",\n+\t\t\twarning(_(\"%s: unexpected object of type %s, skipping.\"),\n \t\t\t\te->name,\n \t\t\t\ttype_name(e->item->type));\n \t\t\tfree(full_name);\n@@ -1078,7 +1079,7 @@ static void get_tags_and_duplicates(struct rev_cmdline_info *info)\n \t\t\tfree(full_name);\n \t\t\tcontinue;\n \t\tdefault: /* OBJ_TAG (nested tags) is already handled */\n-\t\t\twarning(\"Tag points to object of unexpected type %s, skipping.\",\n+\t\t\twarning(_(\"tag points to object of unexpected type %s, skipping.\"),\n \t\t\t\ttype_name(commit->object.type));\n \t\t\tfree(full_name);\n \t\t\tcontinue;\n@@ -1174,7 +1175,7 @@ static void export_marks(char *file)\n \n \tf = fopen_for_writing(file);\n \tif (!f)\n-\t\tdie_errno(\"Unable to open marks file %s for writing.\", file);\n+\t\tdie_errno(_(\"unable to open marks file %s for writing.\"), file);\n \n \tfor (i = 0; i < idnums.size; i++) {\n \t\tif (deco->base && deco->base->type == 1) {\n@@ -1191,7 +1192,7 @@ static void export_marks(char *file)\n \te |= ferror(f);\n \te |= fclose(f);\n \tif (e)\n-\t\terror(\"Unable to write marks file %s.\", file);\n+\t\terror(_(\"unable to write marks file %s.\"), file);\n }\n \n static void import_marks(char *input_file, int check_exists)\n@@ -1214,20 +1215,20 @@ static void import_marks(char *input_file, int check_exists)\n \n \t\tline_end = strchr(line, '\\n');\n \t\tif (line[0] != ':' || !line_end)\n-\t\t\tdie(\"corrupt mark line: %s\", line);\n+\t\t\tdie(_(\"corrupt mark line: %s\"), line);\n \t\t*line_end = '\\0';\n \n \t\tmark = strtoumax(line + 1, &mark_end, 10);\n \t\tif (!mark || mark_end == line + 1\n \t\t\t|| *mark_end != ' ' || get_oid_hex(mark_end + 1, &oid))\n-\t\t\tdie(\"corrupt mark line: %s\", line);\n+\t\t\tdie(_(\"corrupt mark line: %s\"), line);\n \n \t\tif (last_idnum < mark)\n \t\t\tlast_idnum = mark;\n \n \t\ttype = odb_read_object_info(the_repository->objects, &oid, NULL);\n \t\tif (type < 0)\n-\t\t\tdie(\"object not found: %s\", oid_to_hex(&oid));\n+\t\t\tdie(_(\"object not found: %s\"), oid_to_hex(&oid));\n \n \t\tif (type != OBJ_COMMIT)\n \t\t\t/* only commits */\n@@ -1235,12 +1236,12 @@ static void import_marks(char *input_file, int check_exists)\n \n \t\tcommit = lookup_commit(the_repository, &oid);\n \t\tif (!commit)\n-\t\t\tdie(\"not a commit? can't happen: %s\", oid_to_hex(&oid));\n+\t\t\tdie(_(\"not a commit? can't happen: %s\"), oid_to_hex(&oid));\n \n \t\tobject = &commit->object;\n \n \t\tif (object->flags & SHOWN)\n-\t\t\terror(\"Object %s already has a mark\", oid_to_hex(&oid));\n+\t\t\terror(_(\"object %s already has a mark\"), oid_to_hex(&oid));\n \n \t\tmark_object(object, mark);\n \n@@ -1394,7 +1395,7 @@ int cmd_fast_export(int argc,\n \tget_tags_and_duplicates(&revs.cmdline);\n \n \tif (prepare_revision_walk(&revs))\n-\t\tdie(\"revision walk setup failed\");\n+\t\tdie(_(\"revision walk setup failed\"));\n \n \trevs.reverse = 1;\n \trevs.diffopt.format_callback = show_filemodify;\n-- \n2.51.2.617.g2aaa867cd1\n\n"},{"id":"529961","messageId":"20251030123332.3337684-5-christian.couder@gmail.com","threadId":"64397","inReplyTo":"20251030123332.3337684-1-christian.couder@gmail.com","subject":"[PATCH v2 4/5] fast-import: mark strings for translation","fromName":"Christian Couder","fromEmail":"christian.couder@gmail.com","sentAt":"2025-10-30T12:33:31Z","receivedAt":"2025-10-30T12:33:55Z","isPatch":true,"sender":{"key":"christian.couder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/208954?v=4"},"body":"Some error or warning messages in \"builtin/fast-import.c\" are marked\nfor translation, but many are not.\n\nTo be more consistent and provide a better experience to people using a\ntranslated version, let's mark all the remaining error or warning\nmessages for translation.\n\nWhile at it, let's make the following small changes:\n\n  - replace \"GIT\" or \"git\" in a few error messages to just \"Git\",\n  - replace \"Expected from command, got %s\" to \"expected 'from'\n    command, got '%s'\", which makes it clearer that \"from\" is a command\n    and should not be translated,\n  - downcase error and warning messages that start with an uppercase,\n  - fix test cases in \"t9300-fast-import.sh\" that broke because an\n    error or warning message was downcased,\n  - split error and warning messages that are too long,\n  - adjust the indentation of some arguments of the error functions.\n\nSigned-off-by: Christian Couder <chriscool@tuxfamily.org>\n---\n builtin/fast-import.c  | 280 ++++++++++++++++++++---------------------\n t/t9300-fast-import.sh |  20 +--\n 2 files changed, 150 insertions(+), 150 deletions(-)\n\ndiff --git a/builtin/fast-import.c b/builtin/fast-import.c\nindex 8714edfc65..22d5deae9a 100644\n--- a/builtin/fast-import.c\n+++ b/builtin/fast-import.c\n@@ -339,12 +339,12 @@ static void write_crash_report(const char *err)\n \tstruct recent_command *rc;\n \n \tif (!rpt) {\n-\t\terror_errno(\"can't write crash report %s\", loc);\n+\t\terror_errno(_(\"can't write crash report %s\"), loc);\n \t\tfree(loc);\n \t\treturn;\n \t}\n \n-\tfprintf(stderr, \"fast-import: dumping crash report to %s\\n\", loc);\n+\tfprintf(stderr, _(\"fast-import: dumping crash report to %s\\n\"), loc);\n \n \tfprintf(rpt, \"fast-import crash report:\\n\");\n \tfprintf(rpt, \"    fast-import process: %\"PRIuMAX\"\\n\", (uintmax_t) getpid());\n@@ -588,7 +588,7 @@ static void *find_mark(struct mark_set *s, uintmax_t idnum)\n \t\t\toe = s->data.marked[idnum];\n \t}\n \tif (!oe)\n-\t\tdie(\"mark :%\" PRIuMAX \" not declared\", orig_idnum);\n+\t\tdie(_(\"mark :%\" PRIuMAX \" not declared\"), orig_idnum);\n \treturn oe;\n }\n \n@@ -628,9 +628,9 @@ static struct branch *new_branch(const char *name)\n \tstruct branch *b = lookup_branch(name);\n \n \tif (b)\n-\t\tdie(\"Invalid attempt to create duplicate branch: %s\", name);\n+\t\tdie(_(\"invalid attempt to create duplicate branch: %s\"), name);\n \tif (check_refname_format(name, REFNAME_ALLOW_ONELEVEL))\n-\t\tdie(\"Branch name doesn't conform to GIT standards: %s\", name);\n+\t\tdie(_(\"branch name doesn't conform to Git standards: %s\"), name);\n \n \tb = mem_pool_calloc(&fi_mem_pool, 1, sizeof(struct branch));\n \tb->name = mem_pool_strdup(&fi_mem_pool, name);\n@@ -801,7 +801,7 @@ static const char *create_index(void)\n \t\t\t\t*c++ = &e->idx;\n \tlast = idx + object_count;\n \tif (c != last)\n-\t\tdie(\"internal consistency error creating the index\");\n+\t\tdie(_(\"internal consistency error creating the index\"));\n \n \ttmpfile = write_idx_file(the_repository, NULL, idx, object_count,\n \t\t\t\t &pack_idx_opts, pack_data->hash);\n@@ -819,18 +819,18 @@ static char *keep_pack(const char *curr_index_name)\n \tkeep_fd = safe_create_file_with_leading_directories(pack_data->repo,\n \t\t\t\t\t\t\t    name.buf);\n \tif (keep_fd < 0)\n-\t\tdie_errno(\"cannot create keep file\");\n+\t\tdie_errno(_(\"cannot create keep file\"));\n \twrite_or_die(keep_fd, keep_msg, strlen(keep_msg));\n \tif (close(keep_fd))\n-\t\tdie_errno(\"failed to write keep file\");\n+\t\tdie_errno(_(\"failed to write keep file\"));\n \n \todb_pack_name(pack_data->repo, &name, pack_data->hash, \"pack\");\n \tif (finalize_object_file(pack_data->repo, pack_data->pack_name, name.buf))\n-\t\tdie(\"cannot store pack file\");\n+\t\tdie(_(\"cannot store pack file\"));\n \n \todb_pack_name(pack_data->repo, &name, pack_data->hash, \"idx\");\n \tif (finalize_object_file(pack_data->repo, curr_index_name, name.buf))\n-\t\tdie(\"cannot store index file\");\n+\t\tdie(_(\"cannot store index file\"));\n \tfree((void *)curr_index_name);\n \treturn strbuf_detach(&name, NULL);\n }\n@@ -853,7 +853,7 @@ static int loosen_small_pack(const struct packed_git *p)\n \tstruct child_process unpack = CHILD_PROCESS_INIT;\n \n \tif (lseek(p->pack_fd, 0, SEEK_SET) < 0)\n-\t\tdie_errno(\"Failed seeking to start of '%s'\", p->pack_name);\n+\t\tdie_errno(_(\"failed seeking to start of '%s'\"), p->pack_name);\n \n \tunpack.in = p->pack_fd;\n \tunpack.git_cmd = 1;\n@@ -903,7 +903,7 @@ static void end_packfile(void)\n \t\tnew_p = packfile_store_load_pack(pack_data->repo->objects->packfiles,\n \t\t\t\t\t\t idx_name, 1);\n \t\tif (!new_p)\n-\t\t\tdie(\"core git rejected index %s\", idx_name);\n+\t\t\tdie(_(\"core Git rejected index %s\"), idx_name);\n \t\tall_packs[pack_id] = new_p;\n \t\tfree(idx_name);\n \n@@ -1090,7 +1090,7 @@ static int store_object(\n static void truncate_pack(struct hashfile_checkpoint *checkpoint)\n {\n \tif (hashfile_truncate(pack_file, checkpoint))\n-\t\tdie_errno(\"cannot truncate pack to skip duplicate\");\n+\t\tdie_errno(_(\"cannot truncate pack to skip duplicate\"));\n \tpack_size = checkpoint->offset;\n }\n \n@@ -1138,7 +1138,7 @@ static void stream_blob(uintmax_t len, struct object_id *oidout, uintmax_t mark)\n \t\t\tsize_t cnt = in_sz < len ? in_sz : (size_t)len;\n \t\t\tsize_t n = fread(in_buf, 1, cnt, stdin);\n \t\t\tif (!n && feof(stdin))\n-\t\t\t\tdie(\"EOF in data (%\" PRIuMAX \" bytes remaining)\", len);\n+\t\t\t\tdie(_(\"EOF in data (%\" PRIuMAX \" bytes remaining)\"), len);\n \n \t\t\tgit_hash_update(&c, in_buf, n);\n \t\t\ts.next_in = in_buf;\n@@ -1162,7 +1162,7 @@ static void stream_blob(uintmax_t len, struct object_id *oidout, uintmax_t mark)\n \t\tcase Z_STREAM_END:\n \t\t\tcontinue;\n \t\tdefault:\n-\t\t\tdie(\"unexpected deflate failure: %d\", status);\n+\t\t\tdie(_(\"unexpected deflate failure: %d\"), status);\n \t\t}\n \t}\n \tgit_deflate_end(&s);\n@@ -1264,16 +1264,16 @@ static void load_tree(struct tree_entry *root)\n \tmyoe = find_object(oid);\n \tif (myoe && myoe->pack_id != MAX_PACK_ID) {\n \t\tif (myoe->type != OBJ_TREE)\n-\t\t\tdie(\"Not a tree: %s\", oid_to_hex(oid));\n+\t\t\tdie(_(\"not a tree: %s\"), oid_to_hex(oid));\n \t\tt->delta_depth = myoe->depth;\n \t\tbuf = gfi_unpack_entry(myoe, &size);\n \t\tif (!buf)\n-\t\t\tdie(\"Can't load tree %s\", oid_to_hex(oid));\n+\t\t\tdie(_(\"can't load tree %s\"), oid_to_hex(oid));\n \t} else {\n \t\tenum object_type type;\n \t\tbuf = odb_read_object(the_repository->objects, oid, &type, &size);\n \t\tif (!buf || type != OBJ_TREE)\n-\t\t\tdie(\"Can't load tree %s\", oid_to_hex(oid));\n+\t\t\tdie(_(\"can't load tree %s\"), oid_to_hex(oid));\n \t}\n \n \tc = buf;\n@@ -1287,7 +1287,7 @@ static void load_tree(struct tree_entry *root)\n \t\te->tree = NULL;\n \t\tc = parse_mode(c, &e->versions[1].mode);\n \t\tif (!c)\n-\t\t\tdie(\"Corrupt mode in %s\", oid_to_hex(oid));\n+\t\t\tdie(_(\"corrupt mode in %s\"), oid_to_hex(oid));\n \t\te->versions[0].mode = e->versions[1].mode;\n \t\te->name = to_atom(c, strlen(c));\n \t\tc += e->name->str_len + 1;\n@@ -1399,7 +1399,7 @@ static void tree_content_replace(\n \tstruct tree_content *newtree)\n {\n \tif (!S_ISDIR(mode))\n-\t\tdie(\"Root cannot be a non-directory\");\n+\t\tdie(_(\"root cannot be a non-directory\"));\n \toidclr(&root->versions[0].oid, the_repository->hash_algo);\n \toidcpy(&root->versions[1].oid, oid);\n \tif (root->tree)\n@@ -1422,9 +1422,9 @@ static int tree_content_set(\n \tslash1 = strchrnul(p, '/');\n \tn = slash1 - p;\n \tif (!n)\n-\t\tdie(\"Empty path component found in input\");\n+\t\tdie(_(\"empty path component found in input\"));\n \tif (!*slash1 && !S_ISDIR(mode) && subtree)\n-\t\tdie(\"Non-directories cannot have subtrees\");\n+\t\tdie(_(\"non-directories cannot have subtrees\"));\n \n \tif (!root->tree)\n \t\tload_tree(root);\n@@ -1576,7 +1576,7 @@ static int tree_content_get(\n \tslash1 = strchrnul(p, '/');\n \tn = slash1 - p;\n \tif (!n && !allow_root)\n-\t\tdie(\"Empty path component found in input\");\n+\t\tdie(_(\"empty path component found in input\"));\n \n \tif (!root->tree)\n \t\tload_tree(root);\n@@ -1622,8 +1622,8 @@ static int update_branch(struct branch *b)\n \t    !strcmp(b->name + strlen(replace_prefix),\n \t\t    oid_to_hex(&b->oid))) {\n \t\tif (!quiet)\n-\t\t\twarning(\"Dropping %s since it would point to \"\n-\t\t\t\t\"itself (i.e. to %s)\",\n+\t\t\twarning(_(\"dropping %s since it would point to \"\n+\t\t\t\t  \"itself (i.e. to %s)\"),\n \t\t\t\tb->name, oid_to_hex(&b->oid));\n \t\trefs_delete_ref(get_main_ref_store(the_repository),\n \t\t\t\tNULL, b->name, NULL, 0);\n@@ -1646,14 +1646,14 @@ static int update_branch(struct branch *b)\n \t\tnew_cmit = lookup_commit_reference_gently(the_repository,\n \t\t\t\t\t\t\t  &b->oid, 0);\n \t\tif (!old_cmit || !new_cmit)\n-\t\t\treturn error(\"Branch %s is missing commits.\", b->name);\n+\t\t\treturn error(_(\"branch %s is missing commits.\"), b->name);\n \n \t\tret = repo_in_merge_bases(the_repository, old_cmit, new_cmit);\n \t\tif (ret < 0)\n \t\t\texit(128);\n \t\tif (!ret) {\n-\t\t\twarning(\"Not updating %s\"\n-\t\t\t\t\" (new tip %s does not contain %s)\",\n+\t\t\twarning(_(\"not updating %s\"\n+\t\t\t\t  \" (new tip %s does not contain %s)\"),\n \t\t\t\tb->name, oid_to_hex(&b->oid),\n \t\t\t\toid_to_hex(&old_oid));\n \t\t\treturn -1;\n@@ -1729,13 +1729,13 @@ static void dump_marks(void)\n \t\treturn;\n \n \tif (safe_create_leading_directories_const(the_repository, export_marks_file)) {\n-\t\tfailure |= error_errno(\"unable to create leading directories of %s\",\n+\t\tfailure |= error_errno(_(\"unable to create leading directories of %s\"),\n \t\t\t\t       export_marks_file);\n \t\treturn;\n \t}\n \n \tif (hold_lock_file_for_update(&mark_lock, export_marks_file, 0) < 0) {\n-\t\tfailure |= error_errno(\"Unable to write marks file %s\",\n+\t\tfailure |= error_errno(_(\"unable to write marks file %s\"),\n \t\t\t\t       export_marks_file);\n \t\treturn;\n \t}\n@@ -1744,14 +1744,14 @@ static void dump_marks(void)\n \tif (!f) {\n \t\tint saved_errno = errno;\n \t\trollback_lock_file(&mark_lock);\n-\t\tfailure |= error(\"Unable to write marks file %s: %s\",\n+\t\tfailure |= error(_(\"unable to write marks file %s: %s\"),\n \t\t\texport_marks_file, strerror(saved_errno));\n \t\treturn;\n \t}\n \n \tfor_each_mark(marks, 0, dump_marks_fn, f);\n \tif (commit_lock_file(&mark_lock)) {\n-\t\tfailure |= error_errno(\"Unable to write file %s\",\n+\t\tfailure |= error_errno(_(\"unable to write file %s\"),\n \t\t\t\t       export_marks_file);\n \t\treturn;\n \t}\n@@ -1765,7 +1765,7 @@ static void insert_object_entry(struct mark_set **s, struct object_id *oid, uint\n \t\tenum object_type type = odb_read_object_info(the_repository->objects,\n \t\t\t\t\t\t\t     oid, NULL);\n \t\tif (type < 0)\n-\t\t\tdie(\"object not found: %s\", oid_to_hex(oid));\n+\t\t\tdie(_(\"object not found: %s\"), oid_to_hex(oid));\n \t\te = insert_object(oid);\n \t\te->type = type;\n \t\te->pack_id = MAX_PACK_ID;\n@@ -1792,13 +1792,13 @@ static void read_mark_file(struct mark_set **s, FILE *f, mark_set_inserter_t ins\n \n \t\tend = strchr(line, '\\n');\n \t\tif (line[0] != ':' || !end)\n-\t\t\tdie(\"corrupt mark line: %s\", line);\n+\t\t\tdie(_(\"corrupt mark line: %s\"), line);\n \t\t*end = 0;\n \t\tmark = strtoumax(line + 1, &end, 10);\n \t\tif (!mark || end == line + 1\n \t\t\t|| *end != ' '\n \t\t\t|| get_oid_hex_any(end + 1, &oid) == GIT_HASH_UNKNOWN)\n-\t\t\tdie(\"corrupt mark line: %s\", line);\n+\t\t\tdie(_(\"corrupt mark line: %s\"), line);\n \t\tinserter(s, &oid, mark);\n \t}\n }\n@@ -1811,7 +1811,7 @@ static void read_marks(void)\n \telse if (import_marks_file_ignore_missing && errno == ENOENT)\n \t\tgoto done; /* Marks file does not exist */\n \telse\n-\t\tdie_errno(\"cannot read '%s'\", import_marks_file);\n+\t\tdie_errno(_(\"cannot read '%s'\"), import_marks_file);\n \tread_mark_file(&marks, f, insert_object_entry);\n \tfclose(f);\n done:\n@@ -1897,7 +1897,7 @@ static int parse_data(struct strbuf *sb, uintmax_t limit, uintmax_t *len_res)\n \tstrbuf_reset(sb);\n \n \tif (!skip_prefix(command_buf.buf, \"data \", &data))\n-\t\tdie(\"Expected 'data n' command, found: %s\", command_buf.buf);\n+\t\tdie(_(\"expected 'data n' command, found: %s\"), command_buf.buf);\n \n \tif (skip_prefix(data, \"<<\", &data)) {\n \t\tchar *term = xstrdup(data);\n@@ -1905,7 +1905,7 @@ static int parse_data(struct strbuf *sb, uintmax_t limit, uintmax_t *len_res)\n \n \t\tfor (;;) {\n \t\t\tif (strbuf_getline_lf(&command_buf, stdin) == EOF)\n-\t\t\t\tdie(\"EOF in data (terminator '%s' not found)\", term);\n+\t\t\t\tdie(_(\"EOF in data (terminator '%s' not found)\"), term);\n \t\t\tif (term_len == command_buf.len\n \t\t\t\t&& !strcmp(term, command_buf.buf))\n \t\t\t\tbreak;\n@@ -1923,12 +1923,12 @@ static int parse_data(struct strbuf *sb, uintmax_t limit, uintmax_t *len_res)\n \t\t\treturn 0;\n \t\t}\n \t\tif (length < len)\n-\t\t\tdie(\"data is too large to use in this context\");\n+\t\t\tdie(_(\"data is too large to use in this context\"));\n \n \t\twhile (n < length) {\n \t\t\tsize_t s = strbuf_fread(sb, length - n, stdin);\n \t\t\tif (!s && feof(stdin))\n-\t\t\t\tdie(\"EOF in data (%lu bytes remaining)\",\n+\t\t\t\tdie(_(\"EOF in data (%lu bytes remaining)\"),\n \t\t\t\t\t(unsigned long)(length - n));\n \t\t\tn += s;\n \t\t}\n@@ -1985,15 +1985,15 @@ static char *parse_ident(const char *buf)\n \n \tltgt = buf + strcspn(buf, \"<>\");\n \tif (*ltgt != '<')\n-\t\tdie(\"Missing < in ident string: %s\", buf);\n+\t\tdie(_(\"missing < in ident string: %s\"), buf);\n \tif (ltgt != buf && ltgt[-1] != ' ')\n-\t\tdie(\"Missing space before < in ident string: %s\", buf);\n+\t\tdie(_(\"missing space before < in ident string: %s\"), buf);\n \tltgt = ltgt + 1 + strcspn(ltgt + 1, \"<>\");\n \tif (*ltgt != '>')\n-\t\tdie(\"Missing > in ident string: %s\", buf);\n+\t\tdie(_(\"missing > in ident string: %s\"), buf);\n \tltgt++;\n \tif (*ltgt != ' ')\n-\t\tdie(\"Missing space after > in ident string: %s\", buf);\n+\t\tdie(_(\"missing space after > in ident string: %s\"), buf);\n \tltgt++;\n \tname_len = ltgt - buf;\n \tstrbuf_add(&ident, buf, name_len);\n@@ -2001,19 +2001,19 @@ static char *parse_ident(const char *buf)\n \tswitch (whenspec) {\n \tcase WHENSPEC_RAW:\n \t\tif (validate_raw_date(ltgt, &ident, 1) < 0)\n-\t\t\tdie(\"Invalid raw date \\\"%s\\\" in ident: %s\", ltgt, buf);\n+\t\t\tdie(_(\"invalid raw date \\\"%s\\\" in ident: %s\"), ltgt, buf);\n \t\tbreak;\n \tcase WHENSPEC_RAW_PERMISSIVE:\n \t\tif (validate_raw_date(ltgt, &ident, 0) < 0)\n-\t\t\tdie(\"Invalid raw date \\\"%s\\\" in ident: %s\", ltgt, buf);\n+\t\t\tdie(_(\"invalid raw date \\\"%s\\\" in ident: %s\"), ltgt, buf);\n \t\tbreak;\n \tcase WHENSPEC_RFC2822:\n \t\tif (parse_date(ltgt, &ident) < 0)\n-\t\t\tdie(\"Invalid rfc2822 date \\\"%s\\\" in ident: %s\", ltgt, buf);\n+\t\t\tdie(_(\"invalid rfc2822 date \\\"%s\\\" in ident: %s\"), ltgt, buf);\n \t\tbreak;\n \tcase WHENSPEC_NOW:\n \t\tif (strcmp(\"now\", ltgt))\n-\t\t\tdie(\"Date in ident must be 'now': %s\", buf);\n+\t\t\tdie(_(\"date in ident must be 'now': %s\"), buf);\n \t\tdatestamp(&ident);\n \t\tbreak;\n \t}\n@@ -2107,7 +2107,7 @@ static void construct_path_with_fanout(const char *hex_sha1,\n {\n \tunsigned int i = 0, j = 0;\n \tif (fanout >= the_hash_algo->rawsz)\n-\t\tdie(\"Too large fanout (%u)\", fanout);\n+\t\tdie(_(\"too large fanout (%u)\"), fanout);\n \twhile (fanout) {\n \t\tpath[i++] = hex_sha1[j++];\n \t\tpath[i++] = hex_sha1[j++];\n@@ -2181,7 +2181,7 @@ static uintmax_t do_change_note_fanout(\n \n \t\t\t/* Rename fullpath to realpath */\n \t\t\tif (!tree_content_remove(orig_root, fullpath, &leaf, 0))\n-\t\t\t\tdie(\"Failed to remove path %s\", fullpath);\n+\t\t\t\tdie(_(\"failed to remove path %s\"), fullpath);\n \t\t\ttree_content_set(orig_root, realpath,\n \t\t\t\t&leaf.versions[1].oid,\n \t\t\t\tleaf.versions[1].mode,\n@@ -2254,7 +2254,7 @@ static uintmax_t parse_mark_ref(const char *p, char **endptr)\n \tp++;\n \tmark = strtoumax(p, endptr, 10);\n \tif (*endptr == p)\n-\t\tdie(\"No value after ':' in mark: %s\", command_buf.buf);\n+\t\tdie(_(\"no value after ':' in mark: %s\"), command_buf.buf);\n \treturn mark;\n }\n \n@@ -2269,7 +2269,7 @@ static uintmax_t parse_mark_ref_eol(const char *p)\n \n \tmark = parse_mark_ref(p, &end);\n \tif (*end != '\\0')\n-\t\tdie(\"Garbage after mark: %s\", command_buf.buf);\n+\t\tdie(_(\"garbage after mark: %s\"), command_buf.buf);\n \treturn mark;\n }\n \n@@ -2284,7 +2284,7 @@ static uintmax_t parse_mark_ref_space(const char **p)\n \n \tmark = parse_mark_ref(*p, &end);\n \tif (*end++ != ' ')\n-\t\tdie(\"Missing space after mark: %s\", command_buf.buf);\n+\t\tdie(_(\"missing space after mark: %s\"), command_buf.buf);\n \t*p = end;\n \treturn mark;\n }\n@@ -2300,9 +2300,9 @@ static void parse_path(struct strbuf *sb, const char *p, const char **endp,\n {\n \tif (*p == '\"') {\n \t\tif (unquote_c_style(sb, p, endp))\n-\t\t\tdie(\"Invalid %s: %s\", field, command_buf.buf);\n+\t\t\tdie(_(\"invalid %s: %s\"), field, command_buf.buf);\n \t\tif (strlen(sb->buf) != sb->len)\n-\t\t\tdie(\"NUL in %s: %s\", field, command_buf.buf);\n+\t\t\tdie(_(\"NUL in %s: %s\"), field, command_buf.buf);\n \t} else {\n \t\t/*\n \t\t * Unless we are parsing the last field of a line,\n@@ -2325,7 +2325,7 @@ static void parse_path_eol(struct strbuf *sb, const char *p, const char *field)\n \n \tparse_path(sb, p, &end, 1, field);\n \tif (*end)\n-\t\tdie(\"Garbage after %s: %s\", field, command_buf.buf);\n+\t\tdie(_(\"garbage after %s: %s\"), field, command_buf.buf);\n }\n \n /*\n@@ -2338,7 +2338,7 @@ static void parse_path_space(struct strbuf *sb, const char *p,\n {\n \tparse_path(sb, p, endp, 0, field);\n \tif (**endp != ' ')\n-\t\tdie(\"Missing space after %s: %s\", field, command_buf.buf);\n+\t\tdie(_(\"missing space after %s: %s\"), field, command_buf.buf);\n \t(*endp)++;\n }\n \n@@ -2351,7 +2351,7 @@ static void file_change_m(const char *p, struct branch *b)\n \n \tp = parse_mode(p, &mode);\n \tif (!p)\n-\t\tdie(\"Corrupt mode: %s\", command_buf.buf);\n+\t\tdie(_(\"corrupt mode: %s\"), command_buf.buf);\n \tswitch (mode) {\n \tcase 0644:\n \tcase 0755:\n@@ -2364,7 +2364,7 @@ static void file_change_m(const char *p, struct branch *b)\n \t\t/* ok */\n \t\tbreak;\n \tdefault:\n-\t\tdie(\"Corrupt mode: %s\", command_buf.buf);\n+\t\tdie(_(\"corrupt mode: %s\"), command_buf.buf);\n \t}\n \n \tif (*p == ':') {\n@@ -2375,10 +2375,10 @@ static void file_change_m(const char *p, struct branch *b)\n \t\toe = NULL; /* not used with inline_data, but makes gcc happy */\n \t} else {\n \t\tif (parse_mapped_oid_hex(p, &oid, &p))\n-\t\t\tdie(\"Invalid dataref: %s\", command_buf.buf);\n+\t\t\tdie(_(\"invalid dataref: %s\"), command_buf.buf);\n \t\toe = find_object(&oid);\n \t\tif (*p++ != ' ')\n-\t\t\tdie(\"Missing space after SHA1: %s\", command_buf.buf);\n+\t\t\tdie(_(\"missing space after SHA1: %s\"), command_buf.buf);\n \t}\n \n \tstrbuf_reset(&path);\n@@ -2394,11 +2394,11 @@ static void file_change_m(const char *p, struct branch *b)\n \n \tif (S_ISGITLINK(mode)) {\n \t\tif (inline_data)\n-\t\t\tdie(\"Git links cannot be specified 'inline': %s\",\n+\t\t\tdie(_(\"Git links cannot be specified 'inline': %s\"),\n \t\t\t\tcommand_buf.buf);\n \t\telse if (oe) {\n \t\t\tif (oe->type != OBJ_COMMIT)\n-\t\t\t\tdie(\"Not a commit (actually a %s): %s\",\n+\t\t\t\tdie(_(\"not a commit (actually a %s): %s\"),\n \t\t\t\t\ttype_name(oe->type), command_buf.buf);\n \t\t}\n \t\t/*\n@@ -2407,7 +2407,7 @@ static void file_change_m(const char *p, struct branch *b)\n \t\t */\n \t} else if (inline_data) {\n \t\tif (S_ISDIR(mode))\n-\t\t\tdie(\"Directories cannot be specified 'inline': %s\",\n+\t\t\tdie(_(\"directories cannot be specified 'inline': %s\"),\n \t\t\t\tcommand_buf.buf);\n \t\twhile (read_next_command() != EOF) {\n \t\t\tconst char *v;\n@@ -2425,11 +2425,11 @@ static void file_change_m(const char *p, struct branch *b)\n \t\t\t\t\todb_read_object_info(the_repository->objects,\n \t\t\t\t\t\t\t     &oid, NULL);\n \t\tif (type < 0)\n-\t\t\tdie(\"%s not found: %s\",\n-\t\t\t\t\tS_ISDIR(mode) ?  \"Tree\" : \"Blob\",\n-\t\t\t\t\tcommand_buf.buf);\n+\t\t\tdie(_(\"%s not found: %s\"),\n+\t\t\t    S_ISDIR(mode) ?  _(\"tree\") : _(\"blob\"),\n+\t\t\t    command_buf.buf);\n \t\tif (type != expected)\n-\t\t\tdie(\"Not a %s (actually a %s): %s\",\n+\t\t\tdie(_(\"not a %s (actually a %s): %s\"),\n \t\t\t\ttype_name(expected), type_name(type),\n \t\t\t\tcommand_buf.buf);\n \t}\n@@ -2440,7 +2440,7 @@ static void file_change_m(const char *p, struct branch *b)\n \t}\n \n \tif (!verify_path(path.buf, mode))\n-\t\tdie(\"invalid path '%s'\", path.buf);\n+\t\tdie(_(\"invalid path '%s'\"), path.buf);\n \ttree_content_set(&b->branch_tree, path.buf, &oid, mode, NULL);\n }\n \n@@ -2470,7 +2470,7 @@ static void file_change_cr(const char *p, struct branch *b, int rename)\n \telse\n \t\ttree_content_get(&b->branch_tree, source.buf, &leaf, 1);\n \tif (!leaf.versions[1].mode)\n-\t\tdie(\"Path %s not in branch\", source.buf);\n+\t\tdie(_(\"path %s not in branch\"), source.buf);\n \tif (!*dest.buf) {\t/* C \"path/to/subdir\" \"\" */\n \t\ttree_content_replace(&b->branch_tree,\n \t\t\t&leaf.versions[1].oid,\n@@ -2479,7 +2479,7 @@ static void file_change_cr(const char *p, struct branch *b, int rename)\n \t\treturn;\n \t}\n \tif (!verify_path(dest.buf, leaf.versions[1].mode))\n-\t\tdie(\"invalid path '%s'\", dest.buf);\n+\t\tdie(_(\"invalid path '%s'\"), dest.buf);\n \ttree_content_set(&b->branch_tree, dest.buf,\n \t\t&leaf.versions[1].oid,\n \t\tleaf.versions[1].mode,\n@@ -2521,23 +2521,23 @@ static void note_change_n(const char *p, struct branch *b, unsigned char *old_fa\n \t\toe = NULL; /* not used with inline_data, but makes gcc happy */\n \t} else {\n \t\tif (parse_mapped_oid_hex(p, &oid, &p))\n-\t\t\tdie(\"Invalid dataref: %s\", command_buf.buf);\n+\t\t\tdie(_(\"invalid dataref: %s\"), command_buf.buf);\n \t\toe = find_object(&oid);\n \t\tif (*p++ != ' ')\n-\t\t\tdie(\"Missing space after SHA1: %s\", command_buf.buf);\n+\t\t\tdie(_(\"missing space after SHA1: %s\"), command_buf.buf);\n \t}\n \n \t/* <commit-ish> */\n \ts = lookup_branch(p);\n \tif (s) {\n \t\tif (is_null_oid(&s->oid))\n-\t\t\tdie(\"Can't add a note on empty branch.\");\n+\t\t\tdie(_(\"can't add a note on empty branch.\"));\n \t\toidcpy(&commit_oid, &s->oid);\n \t} else if (*p == ':') {\n \t\tuintmax_t commit_mark = parse_mark_ref_eol(p);\n \t\tstruct object_entry *commit_oe = find_mark(marks, commit_mark);\n \t\tif (commit_oe->type != OBJ_COMMIT)\n-\t\t\tdie(\"Mark :%\" PRIuMAX \" not a commit\", commit_mark);\n+\t\t\tdie(_(\"mark :%\" PRIuMAX \" not a commit\"), commit_mark);\n \t\toidcpy(&commit_oid, &commit_oe->idx.oid);\n \t} else if (!repo_get_oid(the_repository, p, &commit_oid)) {\n \t\tunsigned long size;\n@@ -2545,25 +2545,25 @@ static void note_change_n(const char *p, struct branch *b, unsigned char *old_fa\n \t\t\t\t\t\t   &commit_oid, OBJ_COMMIT, &size,\n \t\t\t\t\t\t   &commit_oid);\n \t\tif (!buf || size < the_hash_algo->hexsz + 6)\n-\t\t\tdie(\"Not a valid commit: %s\", p);\n+\t\t\tdie(_(\"not a valid commit: %s\"), p);\n \t\tfree(buf);\n \t} else\n-\t\tdie(\"Invalid ref name or SHA1 expression: %s\", p);\n+\t\tdie(_(\"invalid ref name or SHA1 expression: %s\"), p);\n \n \tif (inline_data) {\n \t\tread_next_command();\n \t\tparse_and_store_blob(&last_blob, &oid, 0);\n \t} else if (oe) {\n \t\tif (oe->type != OBJ_BLOB)\n-\t\t\tdie(\"Not a blob (actually a %s): %s\",\n+\t\t\tdie(_(\"not a blob (actually a %s): %s\"),\n \t\t\t\ttype_name(oe->type), command_buf.buf);\n \t} else if (!is_null_oid(&oid)) {\n \t\tenum object_type type = odb_read_object_info(the_repository->objects, &oid,\n \t\t\t\t\t\t\tNULL);\n \t\tif (type < 0)\n-\t\t\tdie(\"Blob not found: %s\", command_buf.buf);\n+\t\t\tdie(_(\"blob not found: %s\"), command_buf.buf);\n \t\tif (type != OBJ_BLOB)\n-\t\t\tdie(\"Not a blob (actually a %s): %s\",\n+\t\t\tdie(_(\"not a blob (actually a %s): %s\"),\n \t\t\t    type_name(type), command_buf.buf);\n \t}\n \n@@ -2592,10 +2592,10 @@ static void file_change_deleteall(struct branch *b)\n static void parse_from_commit(struct branch *b, char *buf, unsigned long size)\n {\n \tif (!buf || size < the_hash_algo->hexsz + 6)\n-\t\tdie(\"Not a valid commit: %s\", oid_to_hex(&b->oid));\n+\t\tdie(_(\"not a valid commit: %s\"), oid_to_hex(&b->oid));\n \tif (memcmp(\"tree \", buf, 5)\n \t\t|| get_oid_hex(buf + 5, &b->branch_tree.versions[1].oid))\n-\t\tdie(\"The commit %s is corrupt\", oid_to_hex(&b->oid));\n+\t\tdie(_(\"the commit %s is corrupt\"), oid_to_hex(&b->oid));\n \toidcpy(&b->branch_tree.versions[0].oid,\n \t       &b->branch_tree.versions[1].oid);\n }\n@@ -2625,7 +2625,7 @@ static int parse_objectish(struct branch *b, const char *objectish)\n \n \ts = lookup_branch(objectish);\n \tif (b == s)\n-\t\tdie(\"Can't create a branch from itself: %s\", b->name);\n+\t\tdie(_(\"can't create a branch from itself: %s\"), b->name);\n \telse if (s) {\n \t\tstruct object_id *t = &s->branch_tree.versions[1].oid;\n \t\toidcpy(&b->oid, &s->oid);\n@@ -2635,7 +2635,7 @@ static int parse_objectish(struct branch *b, const char *objectish)\n \t\tuintmax_t idnum = parse_mark_ref_eol(objectish);\n \t\tstruct object_entry *oe = find_mark(marks, idnum);\n \t\tif (oe->type != OBJ_COMMIT)\n-\t\t\tdie(\"Mark :%\" PRIuMAX \" not a commit\", idnum);\n+\t\t\tdie(_(\"mark :%\" PRIuMAX \" not a commit\"), idnum);\n \t\tif (!oideq(&b->oid, &oe->idx.oid)) {\n \t\t\toidcpy(&b->oid, &oe->idx.oid);\n \t\t\tif (oe->pack_id != MAX_PACK_ID) {\n@@ -2652,7 +2652,7 @@ static int parse_objectish(struct branch *b, const char *objectish)\n \t\t\tb->delete = 1;\n \t}\n \telse\n-\t\tdie(\"Invalid ref name or SHA1 expression: %s\", objectish);\n+\t\tdie(_(\"invalid ref name or SHA1 expression: %s\"), objectish);\n \n \tif (b->branch_tree.tree && !oideq(&oid, &b->branch_tree.versions[1].oid)) {\n \t\trelease_tree_content_recursive(b->branch_tree.tree);\n@@ -2699,7 +2699,7 @@ static struct hash_list *parse_merge(unsigned int *count)\n \t\t\tuintmax_t idnum = parse_mark_ref_eol(from);\n \t\t\tstruct object_entry *oe = find_mark(marks, idnum);\n \t\t\tif (oe->type != OBJ_COMMIT)\n-\t\t\t\tdie(\"Mark :%\" PRIuMAX \" not a commit\", idnum);\n+\t\t\t\tdie(_(\"mark :%\" PRIuMAX \" not a commit\"), idnum);\n \t\t\toidcpy(&n->oid, &oe->idx.oid);\n \t\t} else if (!repo_get_oid(the_repository, from, &n->oid)) {\n \t\t\tunsigned long size;\n@@ -2707,10 +2707,10 @@ static struct hash_list *parse_merge(unsigned int *count)\n \t\t\t\t\t\t\t   &n->oid, OBJ_COMMIT,\n \t\t\t\t\t\t\t   &size, &n->oid);\n \t\t\tif (!buf || size < the_hash_algo->hexsz + 6)\n-\t\t\t\tdie(\"Not a valid commit: %s\", from);\n+\t\t\t\tdie(_(\"not a valid commit: %s\"), from);\n \t\t\tfree(buf);\n \t\t} else\n-\t\t\tdie(\"Invalid ref name or SHA1 expression: %s\", from);\n+\t\t\tdie(_(\"invalid ref name or SHA1 expression: %s\"), from);\n \n \t\tn->next = NULL;\n \t\t*tail = n;\n@@ -2734,8 +2734,8 @@ static void parse_one_signature(struct signature_data *sig, const char *v)\n \tchar *space = strchr(args, ' ');\n \n \tif (!space)\n-\t\tdie(\"Expected gpgsig format: 'gpgsig <hash-algo> <signature-format>', \"\n-\t\t    \"got 'gpgsig %s'\", args);\n+\t\tdie(_(\"expected gpgsig format: 'gpgsig <hash-algo> <signature-format>', \"\n+\t\t      \"got 'gpgsig %s'\"), args);\n \t*space = '\\0';\n \n \tsig->hash_algo = args;\n@@ -2744,13 +2744,13 @@ static void parse_one_signature(struct signature_data *sig, const char *v)\n \t/* Validate hash algorithm */\n \tif (strcmp(sig->hash_algo, \"sha1\") &&\n \t    strcmp(sig->hash_algo, \"sha256\"))\n-\t\tdie(\"Unknown git hash algorithm in gpgsig: '%s'\", sig->hash_algo);\n+\t\tdie(_(\"unknown git hash algorithm in gpgsig: '%s'\"), sig->hash_algo);\n \n \t/* Validate signature format */\n \tif (!valid_signature_format(sig->sig_format))\n-\t\tdie(\"Invalid signature format in gpgsig: '%s'\", sig->sig_format);\n+\t\tdie(_(\"invalid signature format in gpgsig: '%s'\"), sig->sig_format);\n \tif (!strcmp(sig->sig_format, \"unknown\"))\n-\t\twarning(\"'unknown' signature format in gpgsig\");\n+\t\twarning(_(\"'unknown' signature format in gpgsig\"));\n \n \t/* Read signature data */\n \tread_next_command();\n@@ -2789,8 +2789,8 @@ static void store_signature(struct signature_data *stored_sig,\n \t\t\t    const char *hash_type)\n {\n \tif (stored_sig->hash_algo) {\n-\t\twarning(\"multiple %s signatures found, \"\n-\t\t\t\"ignoring additional signature\",\n+\t\twarning(_(\"multiple %s signatures found, \"\n+\t\t\t  \"ignoring additional signature\"),\n \t\t\thash_type);\n \t\tstrbuf_release(&new_sig->data);\n \t\tfree(new_sig->hash_algo);\n@@ -2845,15 +2845,15 @@ static void parse_new_commit(const char *arg)\n \t\tread_next_command();\n \t}\n \tif (!committer)\n-\t\tdie(\"Expected committer but didn't get one\");\n+\t\tdie(_(\"expected committer but didn't get one\"));\n \n \twhile (skip_prefix(command_buf.buf, \"gpgsig \", &v)) {\n \t\tswitch (signed_commit_mode) {\n \n \t\t/* First, modes that don't need the signature to be parsed */\n \t\tcase SIGN_ABORT:\n-\t\t\tdie(\"encountered signed commit; use \"\n-\t\t\t    \"--signed-commits=<mode> to handle it\");\n+\t\t\tdie(_(\"encountered signed commit; use \"\n+\t\t\t      \"--signed-commits=<mode> to handle it\"));\n \t\tcase SIGN_WARN_STRIP:\n \t\t\twarning(_(\"stripping a commit signature\"));\n \t\t\t/* fallthru */\n@@ -3025,11 +3025,11 @@ static void parse_new_tag(const char *arg)\n \n \t/* from ... */\n \tif (!skip_prefix(command_buf.buf, \"from \", &from))\n-\t\tdie(\"Expected from command, got %s\", command_buf.buf);\n+\t\tdie(_(\"expected 'from' command, got '%s'\"), command_buf.buf);\n \ts = lookup_branch(from);\n \tif (s) {\n \t\tif (is_null_oid(&s->oid))\n-\t\t\tdie(\"Can't tag an empty branch.\");\n+\t\t\tdie(_(\"can't tag an empty branch.\"));\n \t\toidcpy(&oid, &s->oid);\n \t\ttype = OBJ_COMMIT;\n \t} else if (*from == ':') {\n@@ -3044,11 +3044,11 @@ static void parse_new_tag(const char *arg)\n \t\t\ttype = odb_read_object_info(the_repository->objects,\n \t\t\t\t\t\t    &oid, NULL);\n \t\t\tif (type < 0)\n-\t\t\t\tdie(\"Not a valid object: %s\", from);\n+\t\t\t\tdie(_(\"not a valid object: %s\"), from);\n \t\t} else\n \t\t\ttype = oe->type;\n \t} else\n-\t\tdie(\"Invalid ref name or SHA1 expression: %s\", from);\n+\t\tdie(_(\"invalid ref name or SHA1 expression: %s\"), from);\n \tread_next_command();\n \n \t/* original-oid ... */\n@@ -3139,7 +3139,7 @@ static void parse_reset_branch(const char *arg)\n static void cat_blob_write(const char *buf, unsigned long size)\n {\n \tif (write_in_full(cat_blob_fd, buf, size) < 0)\n-\t\tdie_errno(\"Write to frontend failed\");\n+\t\tdie_errno(_(\"write to frontend failed\"));\n }\n \n static void cat_blob(struct object_entry *oe, struct object_id *oid)\n@@ -3168,9 +3168,9 @@ static void cat_blob(struct object_entry *oe, struct object_id *oid)\n \t\treturn;\n \t}\n \tif (!buf)\n-\t\tdie(\"Can't read object %s\", oid_to_hex(oid));\n+\t\tdie(_(\"can't read object %s\"), oid_to_hex(oid));\n \tif (type != OBJ_BLOB)\n-\t\tdie(\"Object %s is a %s but a blob was expected.\",\n+\t\tdie(_(\"object %s is a %s but a blob was expected.\"),\n \t\t    oid_to_hex(oid), type_name(type));\n \tstrbuf_reset(&line);\n \tstrbuf_addf(&line, \"%s %s %\"PRIuMAX\"\\n\", oid_to_hex(oid),\n@@ -3194,11 +3194,11 @@ static void parse_get_mark(const char *p)\n \n \t/* get-mark SP <object> LF */\n \tif (*p != ':')\n-\t\tdie(\"Not a mark: %s\", p);\n+\t\tdie(_(\"not a mark: %s\"), p);\n \n \toe = find_mark(marks, parse_mark_ref_eol(p));\n \tif (!oe)\n-\t\tdie(\"Unknown mark: %s\", command_buf.buf);\n+\t\tdie(_(\"unknown mark: %s\"), command_buf.buf);\n \n \txsnprintf(output, sizeof(output), \"%s\\n\", oid_to_hex(&oe->idx.oid));\n \tcat_blob_write(output, the_hash_algo->hexsz + 1);\n@@ -3213,13 +3213,13 @@ static void parse_cat_blob(const char *p)\n \tif (*p == ':') {\n \t\toe = find_mark(marks, parse_mark_ref_eol(p));\n \t\tif (!oe)\n-\t\t\tdie(\"Unknown mark: %s\", command_buf.buf);\n+\t\t\tdie(_(\"unknown mark: %s\"), command_buf.buf);\n \t\toidcpy(&oid, &oe->idx.oid);\n \t} else {\n \t\tif (parse_mapped_oid_hex(p, &oid, &p))\n-\t\t\tdie(\"Invalid dataref: %s\", command_buf.buf);\n+\t\t\tdie(_(\"invalid dataref: %s\"), command_buf.buf);\n \t\tif (*p)\n-\t\t\tdie(\"Garbage after SHA1: %s\", command_buf.buf);\n+\t\t\tdie(_(\"garbage after SHA1: %s\"), command_buf.buf);\n \t\toe = find_object(&oid);\n \t}\n \n@@ -3237,7 +3237,7 @@ static struct object_entry *dereference(struct object_entry *oe,\n \t\tenum object_type type = odb_read_object_info(the_repository->objects,\n \t\t\t\t\t\t\t     oid, NULL);\n \t\tif (type < 0)\n-\t\t\tdie(\"object not found: %s\", oid_to_hex(oid));\n+\t\t\tdie(_(\"object not found: %s\"), oid_to_hex(oid));\n \t\t/* cache it! */\n \t\toe = insert_object(oid);\n \t\toe->type = type;\n@@ -3251,7 +3251,7 @@ static struct object_entry *dereference(struct object_entry *oe,\n \tcase OBJ_TAG:\n \t\tbreak;\n \tdefault:\n-\t\tdie(\"Not a tree-ish: %s\", command_buf.buf);\n+\t\tdie(_(\"not a tree-ish: %s\"), command_buf.buf);\n \t}\n \n \tif (oe->pack_id != MAX_PACK_ID) {\t/* in a pack being written */\n@@ -3262,19 +3262,19 @@ static struct object_entry *dereference(struct object_entry *oe,\n \t\t\t\t      &unused, &size);\n \t}\n \tif (!buf)\n-\t\tdie(\"Can't load object %s\", oid_to_hex(oid));\n+\t\tdie(_(\"can't load object %s\"), oid_to_hex(oid));\n \n \t/* Peel one layer. */\n \tswitch (oe->type) {\n \tcase OBJ_TAG:\n \t\tif (size < hexsz + strlen(\"object \") ||\n \t\t    get_oid_hex(buf + strlen(\"object \"), oid))\n-\t\t\tdie(\"Invalid SHA1 in tag: %s\", command_buf.buf);\n+\t\t\tdie(_(\"invalid SHA1 in tag: %s\"), command_buf.buf);\n \t\tbreak;\n \tcase OBJ_COMMIT:\n \t\tif (size < hexsz + strlen(\"tree \") ||\n \t\t    get_oid_hex(buf + strlen(\"tree \"), oid))\n-\t\t\tdie(\"Invalid SHA1 in commit: %s\", command_buf.buf);\n+\t\t\tdie(_(\"invalid SHA1 in commit: %s\"), command_buf.buf);\n \t}\n \n \tfree(buf);\n@@ -3309,9 +3309,9 @@ static void build_mark_map(struct string_list *from, struct string_list *to)\n \tfor_each_string_list_item(fromp, from) {\n \t\ttop = string_list_lookup(to, fromp->string);\n \t\tif (!fromp->util) {\n-\t\t\tdie(_(\"Missing from marks for submodule '%s'\"), fromp->string);\n+\t\t\tdie(_(\"missing from marks for submodule '%s'\"), fromp->string);\n \t\t} else if (!top || !top->util) {\n-\t\t\tdie(_(\"Missing to marks for submodule '%s'\"), fromp->string);\n+\t\t\tdie(_(\"missing to marks for submodule '%s'\"), fromp->string);\n \t\t}\n \t\tbuild_mark_map_one(fromp->util, top->util);\n \t}\n@@ -3325,14 +3325,14 @@ static struct object_entry *parse_treeish_dataref(const char **p)\n \tif (**p == ':') {\t/* <mark> */\n \t\te = find_mark(marks, parse_mark_ref_space(p));\n \t\tif (!e)\n-\t\t\tdie(\"Unknown mark: %s\", command_buf.buf);\n+\t\t\tdie(_(\"unknown mark: %s\"), command_buf.buf);\n \t\toidcpy(&oid, &e->idx.oid);\n \t} else {\t/* <sha1> */\n \t\tif (parse_mapped_oid_hex(*p, &oid, p))\n-\t\t\tdie(\"Invalid dataref: %s\", command_buf.buf);\n+\t\t\tdie(_(\"invalid dataref: %s\"), command_buf.buf);\n \t\te = find_object(&oid);\n \t\tif (*(*p)++ != ' ')\n-\t\t\tdie(\"Missing space after tree-ish: %s\", command_buf.buf);\n+\t\t\tdie(_(\"missing space after tree-ish: %s\"), command_buf.buf);\n \t}\n \n \twhile (!e || e->type != OBJ_TREE)\n@@ -3376,7 +3376,7 @@ static void parse_ls(const char *p, struct branch *b)\n \t/* ls SP (<tree-ish> SP)? <path> */\n \tif (*p == '\"') {\n \t\tif (!b)\n-\t\t\tdie(\"Not in a commit: %s\", command_buf.buf);\n+\t\t\tdie(_(\"not in a commit: %s\"), command_buf.buf);\n \t\troot = &b->branch_tree;\n \t} else {\n \t\tstruct object_entry *e = parse_treeish_dataref(&p);\n@@ -3439,12 +3439,12 @@ static void parse_alias(void)\n \t/* mark ... */\n \tparse_mark();\n \tif (!next_mark)\n-\t\tdie(_(\"Expected 'mark' command, got %s\"), command_buf.buf);\n+\t\tdie(_(\"expected 'mark' command, got %s\"), command_buf.buf);\n \n \t/* to ... */\n \tmemset(&b, 0, sizeof(b));\n \tif (!parse_objectish_with_prefix(&b, \"to \"))\n-\t\tdie(_(\"Expected 'to' command, got %s\"), command_buf.buf);\n+\t\tdie(_(\"expected 'to' command, got %s\"), command_buf.buf);\n \te = find_object(&b.oid);\n \tassert(e);\n \tinsert_mark(&marks, next_mark, e);\n@@ -3462,7 +3462,7 @@ static void option_import_marks(const char *marks,\n {\n \tif (import_marks_file) {\n \t\tif (from_stream)\n-\t\t\tdie(\"Only one import-marks command allowed per stream\");\n+\t\t\tdie(_(\"only one import-marks command allowed per stream\"));\n \n \t\t/* read previous mark file */\n \t\tif(!import_marks_file_from_stream)\n@@ -3486,7 +3486,7 @@ static void option_date_format(const char *fmt)\n \telse if (!strcmp(fmt, \"now\"))\n \t\twhenspec = WHENSPEC_NOW;\n \telse\n-\t\tdie(\"unknown --date-format argument %s\", fmt);\n+\t\tdie(_(\"unknown --date-format argument %s\"), fmt);\n }\n \n static unsigned long ulong_arg(const char *option, const char *arg)\n@@ -3494,7 +3494,7 @@ static unsigned long ulong_arg(const char *option, const char *arg)\n \tchar *endptr;\n \tunsigned long rv = strtoul(arg, &endptr, 0);\n \tif (strchr(arg, '-') || endptr == arg || *endptr)\n-\t\tdie(\"%s: argument must be a non-negative integer\", option);\n+\t\tdie(_(\"%s: argument must be a non-negative integer\"), option);\n \treturn rv;\n }\n \n@@ -3502,7 +3502,7 @@ static void option_depth(const char *depth)\n {\n \tmax_depth = ulong_arg(\"--depth\", depth);\n \tif (max_depth > MAX_DEPTH)\n-\t\tdie(\"--depth cannot exceed %u\", MAX_DEPTH);\n+\t\tdie(_(\"--depth cannot exceed %u\"), MAX_DEPTH);\n }\n \n static void option_active_branches(const char *branches)\n@@ -3520,7 +3520,7 @@ static void option_cat_blob_fd(const char *fd)\n {\n \tunsigned long n = ulong_arg(\"--cat-blob-fd\", fd);\n \tif (n > (unsigned long) INT_MAX)\n-\t\tdie(\"--cat-blob-fd cannot exceed %d\", INT_MAX);\n+\t\tdie(_(\"--cat-blob-fd cannot exceed %d\"), INT_MAX);\n \tcat_blob_fd = (int) n;\n }\n \n@@ -3540,7 +3540,7 @@ static void option_rewrite_submodules(const char *arg, struct string_list *list)\n \tchar *s = xstrdup(arg);\n \tchar *f = strchr(s, ':');\n \tif (!f)\n-\t\tdie(_(\"Expected format name:filename for submodule rewrite option\"));\n+\t\tdie(_(\"expected format name:filename for submodule rewrite option\"));\n \t*f = '\\0';\n \tf++;\n \tCALLOC_ARRAY(ms, 1);\n@@ -3548,7 +3548,7 @@ static void option_rewrite_submodules(const char *arg, struct string_list *list)\n \tf = prefix_filename(global_prefix, f);\n \tfp = fopen(f, \"r\");\n \tif (!fp)\n-\t\tdie_errno(\"cannot read '%s'\", f);\n+\t\tdie_errno(_(\"cannot read '%s'\"), f);\n \tread_mark_file(&ms, fp, insert_oid_entry);\n \tfclose(fp);\n \tfree(f);\n@@ -3565,10 +3565,10 @@ static int parse_one_option(const char *option)\n \t\tif (!git_parse_ulong(option, &v))\n \t\t\treturn 0;\n \t\tif (v < 8192) {\n-\t\t\twarning(\"max-pack-size is now in bytes, assuming --max-pack-size=%lum\", v);\n+\t\t\twarning(_(\"max-pack-size is now in bytes, assuming --max-pack-size=%lum\"), v);\n \t\t\tv *= 1024 * 1024;\n \t\t} else if (v < 1024 * 1024) {\n-\t\t\twarning(\"minimum max-pack-size is 1 MiB\");\n+\t\t\twarning(_(\"minimum max-pack-size is 1 MiB\"));\n \t\t\tv = 1024 * 1024;\n \t\t}\n \t\tmax_packsize = v;\n@@ -3655,23 +3655,23 @@ static int parse_one_feature(const char *feature, int from_stream)\n static void parse_feature(const char *feature)\n {\n \tif (seen_data_command)\n-\t\tdie(\"Got feature command '%s' after data command\", feature);\n+\t\tdie(_(\"got feature command '%s' after data command\"), feature);\n \n \tif (parse_one_feature(feature, 1))\n \t\treturn;\n \n-\tdie(\"This version of fast-import does not support feature %s.\", feature);\n+\tdie(_(\"this version of fast-import does not support feature %s.\"), feature);\n }\n \n static void parse_option(const char *option)\n {\n \tif (seen_data_command)\n-\t\tdie(\"Got option command '%s' after data command\", option);\n+\t\tdie(_(\"got option command '%s' after data command\"), option);\n \n \tif (parse_one_option(option))\n \t\treturn;\n \n-\tdie(\"This version of fast-import does not support option: %s\", option);\n+\tdie(_(\"this version of fast-import does not support option: %s\"), option);\n }\n \n static void git_pack_config(void)\n@@ -3715,7 +3715,7 @@ static void parse_argv(void)\n \t\t\tbreak;\n \n \t\tif (!skip_prefix(a, \"--\", &a))\n-\t\t\tdie(\"unknown option %s\", a);\n+\t\t\tdie(_(\"unknown option %s\"), a);\n \n \t\tif (parse_one_option(a))\n \t\t\tcontinue;\n@@ -3728,7 +3728,7 @@ static void parse_argv(void)\n \t\t\tcontinue;\n \t\t}\n \n-\t\tdie(\"unknown option --%s\", a);\n+\t\tdie(_(\"unknown option --%s\"), a);\n \t}\n \tif (i != global_argc)\n \t\tusage(fast_import_usage);\n@@ -3817,7 +3817,7 @@ int cmd_fast_import(int argc,\n \t\telse if (starts_with(command_buf.buf, \"option \"))\n \t\t\t/* ignore non-git options*/;\n \t\telse\n-\t\t\tdie(\"Unsupported command: %s\", command_buf.buf);\n+\t\t\tdie(_(\"unsupported command: %s\"), command_buf.buf);\n \n \t\tif (checkpoint_requested)\n \t\t\tcheckpoint();\n@@ -3828,7 +3828,7 @@ int cmd_fast_import(int argc,\n \t\tparse_argv();\n \n \tif (require_explicit_termination && feof(stdin))\n-\t\tdie(\"stream ends early\");\n+\t\tdie(_(\"stream ends early\"));\n \n \tend_packfile();\n \ndiff --git a/t/t9300-fast-import.sh b/t/t9300-fast-import.sh\nindex 4dc3d645bf..5685cce6fe 100755\n--- a/t/t9300-fast-import.sh\n+++ b/t/t9300-fast-import.sh\n@@ -2927,16 +2927,16 @@ test_expect_success 'R: blob appears only once' '\n # The error message when a space is missing not at the\n # end of the line is:\n #\n-#   Missing space after ..\n+#   missing space after ..\n #\n # or when extra characters come after the mark at the end\n # of the line:\n #\n-#   Garbage after ..\n+#   garbage after ..\n #\n # or when the dataref is neither \"inline \" or a known SHA1,\n #\n-#   Invalid dataref ..\n+#   invalid dataref ..\n #\n test_expect_success 'S: initialize for S tests' '\n \ttest_tick &&\n@@ -3405,15 +3405,15 @@ test_path_fail () {\n \n test_path_base_fail () {\n \tlocal change=\"$1\" prefix=\"$2\" field=\"$3\" suffix=\"$4\"\n-\ttest_path_fail \"$change\" 'unclosed \" in '\"$field\"          \"$prefix\" '\"hello.c'    \"$suffix\" \"Invalid $field\"\n-\ttest_path_fail \"$change\" \"invalid escape in quoted $field\" \"$prefix\" '\"hello\\xff\"' \"$suffix\" \"Invalid $field\"\n+\ttest_path_fail \"$change\" 'unclosed \" in '\"$field\"          \"$prefix\" '\"hello.c'    \"$suffix\" \"invalid $field\"\n+\ttest_path_fail \"$change\" \"invalid escape in quoted $field\" \"$prefix\" '\"hello\\xff\"' \"$suffix\" \"invalid $field\"\n \ttest_path_fail \"$change\" \"escaped NUL in quoted $field\"    \"$prefix\" '\"hello\\000\"' \"$suffix\" \"NUL in $field\"\n }\n test_path_eol_quoted_fail () {\n \tlocal change=\"$1\" prefix=\"$2\" field=\"$3\"\n \ttest_path_base_fail \"$change\" \"$prefix\" \"$field\" ''\n-\ttest_path_fail \"$change\" \"garbage after quoted $field\" \"$prefix\" '\"hello.c\"' 'x' \"Garbage after $field\"\n-\ttest_path_fail \"$change\" \"space after quoted $field\"   \"$prefix\" '\"hello.c\"' ' ' \"Garbage after $field\"\n+\ttest_path_fail \"$change\" \"garbage after quoted $field\" \"$prefix\" '\"hello.c\"' 'x' \"garbage after $field\"\n+\ttest_path_fail \"$change\" \"space after quoted $field\"   \"$prefix\" '\"hello.c\"' ' ' \"garbage after $field\"\n }\n test_path_eol_fail () {\n \tlocal change=\"$1\" prefix=\"$2\" field=\"$3\"\n@@ -3422,8 +3422,8 @@ test_path_eol_fail () {\n test_path_space_fail () {\n \tlocal change=\"$1\" prefix=\"$2\" field=\"$3\"\n \ttest_path_base_fail \"$change\" \"$prefix\" \"$field\" ' world.c'\n-\ttest_path_fail \"$change\" \"missing space after quoted $field\"   \"$prefix\" '\"hello.c\"' 'x world.c' \"Missing space after $field\"\n-\ttest_path_fail \"$change\" \"missing space after unquoted $field\" \"$prefix\" 'hello.c'   ''          \"Missing space after $field\"\n+\ttest_path_fail \"$change\" \"missing space after quoted $field\"   \"$prefix\" '\"hello.c\"' 'x world.c' \"missing space after $field\"\n+\ttest_path_fail \"$change\" \"missing space after unquoted $field\" \"$prefix\" 'hello.c'   ''          \"missing space after $field\"\n }\n \n test_path_eol_fail   filemodify       'M 100644 :1 ' path\n@@ -3820,7 +3820,7 @@ test_expect_success 'X: replace ref that becomes useless is removed' '\n \t\tsed -e s/othername/somename/ tmp >tmp2 &&\n \t\tgit fast-import --force <tmp2 2>msgs &&\n \n-\t\tgrep \"Dropping.*since it would point to itself\" msgs &&\n+\t\tgrep \"dropping.*since it would point to itself\" msgs &&\n \t\tgit show-ref >refs &&\n \t\t! grep refs/replace refs\n \t)\n-- \n2.51.2.617.g2aaa867cd1\n\n"},{"id":"529960","messageId":"20251030123332.3337684-6-christian.couder@gmail.com","threadId":"64397","inReplyTo":"20251030123332.3337684-1-christian.couder@gmail.com","subject":"[PATCH v2 5/5] gpg-interface: mark a string for translation","fromName":"Christian Couder","fromEmail":"christian.couder@gmail.com","sentAt":"2025-10-30T12:33:32Z","receivedAt":"2025-10-30T12:33:56Z","isPatch":true,"sender":{"key":"christian.couder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/208954?v=4"},"body":"Previous commits have marked a number of error or warning messages in\n\"builtin/fast-export.c\" and \"builtin/fast-import.c\" for translation.\n\nAs \"gpg-interface.c\" code is used by the fast-export and fast-import\ncode, we should make sure that error or warning messages are also all\nmarked for translation in \"gpg-interface.c\".\n\nTo ensure that, let's mark for translation an error message in a\ndie() function.\n\nWith this, all the error and warning messages emitted by fast-export\nand fast-import can be properly translated.\n\nSigned-off-by: Christian Couder <chriscool@tuxfamily.org>\n---\n gpg-interface.c | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/gpg-interface.c b/gpg-interface.c\nindex 91d1b58cb4..6b895f83ed 100644\n--- a/gpg-interface.c\n+++ b/gpg-interface.c\n@@ -876,7 +876,7 @@ static char *get_default_ssh_signing_key(void)\n \tn = split_cmdline(key_command, &argv);\n \n \tif (n < 0)\n-\t\tdie(\"malformed build-time gpg.ssh.defaultKeyCommand: %s\",\n+\t\tdie(_(\"malformed build-time gpg.ssh.defaultKeyCommand: %s\"),\n \t\t    split_cmdline_strerror(n));\n \n \tstrvec_pushv(&ssh_default_key.args, argv);\n-- \n2.51.2.617.g2aaa867cd1\n\n"},{"id":"529962","messageId":"CAP8UFD0oOLnvk3wKROeKEWWFcQPVB-x9JUjpeE=8nWsWZYUnrw@mail.gmail.com","threadId":"64397","inReplyTo":"xmqqv7jxadq6.fsf@gitster.g","subject":"Re: [PATCH 3/5] fast-export: mark strings for translation","fromName":"Christian Couder","fromEmail":"christian.couder@gmail.com","sentAt":"2025-10-30T12:39:38Z","receivedAt":"2025-10-30T12:39:52Z","isPatch":true,"sender":{"key":"christian.couder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/208954?v=4"},"body":"On Wed, Oct 29, 2025 at 5:12 PM Junio C Hamano <gitster@pobox.com> wrote:\n>\n> Christian Couder <christian.couder@gmail.com> writes:\n>\n> > On Tue, Oct 28, 2025 at 2:43 PM Junio C Hamano <gitster@pobox.com> wrote:\n\n> >> Makes sense.  Should we also downcase some Unknown and Unexpected?\n> >\n> > I am fine with doing it as part of this series, but I wonder if it\n> > should be part of this patch or in a separate patch.\n> >\n> > If it's in a separate patch, each patch might be easier to review\n> > independently, but a number of lines will be changed several times in\n> > this series. So not sure what's the best practice.\n>\n> Rephrasing the messages may need more careful thinking while\n> reviewing, but if you limit your changes to only downcasing the\n> first letter, I would think it would fall in the same bucket as\n> \"While at it, improve code indentation\".\n\nI did it in the same patches in the v2 I just sent, but an issue I\nfaced was that some tests in \"t9300-fast-import.sh\" check for some\nerror messages in a case sensitive way, so I had to make changes in\nthose tests.\n"},{"id":"529978","messageId":"xmqqikfw5k9x.fsf@gitster.g","threadId":"64397","inReplyTo":"20251030123332.3337684-1-christian.couder@gmail.com","subject":"Re: [PATCH v2 0/5] fast-export/import: cleanups and translation","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2025-10-30T18:14:50Z","receivedAt":"2025-10-30T18:14:53Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Christian Couder <christian.couder@gmail.com> writes:\n\n> There are only small changes in patches 3/5 and 4/5. Mostly some\n> uppercase letters at the start of error and warning messages have been\n> downcased according to our style.\n>\n> In patch 3/5, an error message that started with \"Error: \" has been\n> changed to remove that part.\n>\n> In patch 4/5, some tests in \"t9300-fast-import.sh\" had to be adjusted\n> because they were testing error or warning messages where the first\n> letter was downcased.\n>\n> The commit messages of patches 3/5 and 4/5 have also been adjusted to\n> mention these changes.\n\nThanks, looking good.\n"},{"id":"530048","messageId":"CABPp-BFmL9+oXTz8UM=yPxujXBW6c1xEHMzt2KD=cEXT4EbiOg@mail.gmail.com","threadId":"64397","inReplyTo":"20251030123332.3337684-5-christian.couder@gmail.com","subject":"Re: [PATCH v2 4/5] fast-import: mark strings for translation","fromName":"Elijah Newren","fromEmail":"newren@gmail.com","sentAt":"2025-10-31T19:35:41Z","receivedAt":"2025-10-31T19:35:53Z","isPatch":true,"sender":{"key":"newren@gmail.com","avatar":"https://avatars.githubusercontent.com/u/5455730?v=4"},"body":"On Thu, Oct 30, 2025 at 5:33 AM Christian Couder\n<christian.couder@gmail.com> wrote:\n>\n> Some error or warning messages in \"builtin/fast-import.c\" are marked\n> for translation, but many are not.\n>\n> To be more consistent and provide a better experience to people using a\n> translated version, let's mark all the remaining error or warning\n> messages for translation.\n>\n> While at it, let's make the following small changes:\n>\n>   - replace \"GIT\" or \"git\" in a few error messages to just \"Git\",\n>   - replace \"Expected from command, got %s\" to \"expected 'from'\n>     command, got '%s'\", which makes it clearer that \"from\" is a command\n>     and should not be translated,\n\nThese are all good fixes you are making, but I _especially_ appreciate\nthis fix.  I think you might undersell it, though, not only will it\nhelp translators, it'll help English readers who might assume the\nmessage is garbled or hard to parse realize that 'from' is not a\npreposition as used here.\n\n\n>   - downcase error and warning messages that start with an uppercase,\n>   - fix test cases in \"t9300-fast-import.sh\" that broke because an\n>     error or warning message was downcased,\n>   - split error and warning messages that are too long,\n>   - adjust the indentation of some arguments of the error functions.\n>\n> Signed-off-by: Christian Couder <chriscool@tuxfamily.org>\n> ---\n>  builtin/fast-import.c  | 280 ++++++++++++++++++++---------------------\n>  t/t9300-fast-import.sh |  20 +--\n>  2 files changed, 150 insertions(+), 150 deletions(-)\n>\n> diff --git a/builtin/fast-import.c b/builtin/fast-import.c\n> index 8714edfc65..22d5deae9a 100644\n> --- a/builtin/fast-import.c\n> +++ b/builtin/fast-import.c\n> @@ -339,12 +339,12 @@ static void write_crash_report(const char *err)\n>         struct recent_command *rc;\n>\n>         if (!rpt) {\n> -               error_errno(\"can't write crash report %s\", loc);\n> +               error_errno(_(\"can't write crash report %s\"), loc);\n>                 free(loc);\n>                 return;\n>         }\n>\n> -       fprintf(stderr, \"fast-import: dumping crash report to %s\\n\", loc);\n> +       fprintf(stderr, _(\"fast-import: dumping crash report to %s\\n\"), loc);\n>\n>         fprintf(rpt, \"fast-import crash report:\\n\");\n>         fprintf(rpt, \"    fast-import process: %\"PRIuMAX\"\\n\", (uintmax_t) getpid());\n> @@ -588,7 +588,7 @@ static void *find_mark(struct mark_set *s, uintmax_t idnum)\n>                         oe = s->data.marked[idnum];\n>         }\n>         if (!oe)\n> -               die(\"mark :%\" PRIuMAX \" not declared\", orig_idnum);\n> +               die(_(\"mark :%\" PRIuMAX \" not declared\"), orig_idnum);\n>         return oe;\n>  }\n>\n> @@ -628,9 +628,9 @@ static struct branch *new_branch(const char *name)\n>         struct branch *b = lookup_branch(name);\n>\n>         if (b)\n> -               die(\"Invalid attempt to create duplicate branch: %s\", name);\n> +               die(_(\"invalid attempt to create duplicate branch: %s\"), name);\n>         if (check_refname_format(name, REFNAME_ALLOW_ONELEVEL))\n> -               die(\"Branch name doesn't conform to GIT standards: %s\", name);\n> +               die(_(\"branch name doesn't conform to Git standards: %s\"), name);\n>\n>         b = mem_pool_calloc(&fi_mem_pool, 1, sizeof(struct branch));\n>         b->name = mem_pool_strdup(&fi_mem_pool, name);\n> @@ -801,7 +801,7 @@ static const char *create_index(void)\n>                                 *c++ = &e->idx;\n>         last = idx + object_count;\n>         if (c != last)\n> -               die(\"internal consistency error creating the index\");\n> +               die(_(\"internal consistency error creating the index\"));\n>\n>         tmpfile = write_idx_file(the_repository, NULL, idx, object_count,\n>                                  &pack_idx_opts, pack_data->hash);\n> @@ -819,18 +819,18 @@ static char *keep_pack(const char *curr_index_name)\n>         keep_fd = safe_create_file_with_leading_directories(pack_data->repo,\n>                                                             name.buf);\n>         if (keep_fd < 0)\n> -               die_errno(\"cannot create keep file\");\n> +               die_errno(_(\"cannot create keep file\"));\n>         write_or_die(keep_fd, keep_msg, strlen(keep_msg));\n>         if (close(keep_fd))\n> -               die_errno(\"failed to write keep file\");\n> +               die_errno(_(\"failed to write keep file\"));\n>\n>         odb_pack_name(pack_data->repo, &name, pack_data->hash, \"pack\");\n>         if (finalize_object_file(pack_data->repo, pack_data->pack_name, name.buf))\n> -               die(\"cannot store pack file\");\n> +               die(_(\"cannot store pack file\"));\n>\n>         odb_pack_name(pack_data->repo, &name, pack_data->hash, \"idx\");\n>         if (finalize_object_file(pack_data->repo, curr_index_name, name.buf))\n> -               die(\"cannot store index file\");\n> +               die(_(\"cannot store index file\"));\n>         free((void *)curr_index_name);\n>         return strbuf_detach(&name, NULL);\n>  }\n> @@ -853,7 +853,7 @@ static int loosen_small_pack(const struct packed_git *p)\n>         struct child_process unpack = CHILD_PROCESS_INIT;\n>\n>         if (lseek(p->pack_fd, 0, SEEK_SET) < 0)\n> -               die_errno(\"Failed seeking to start of '%s'\", p->pack_name);\n> +               die_errno(_(\"failed seeking to start of '%s'\"), p->pack_name);\n>\n>         unpack.in = p->pack_fd;\n>         unpack.git_cmd = 1;\n> @@ -903,7 +903,7 @@ static void end_packfile(void)\n>                 new_p = packfile_store_load_pack(pack_data->repo->objects->packfiles,\n>                                                  idx_name, 1);\n>                 if (!new_p)\n> -                       die(\"core git rejected index %s\", idx_name);\n> +                       die(_(\"core Git rejected index %s\"), idx_name);\n>                 all_packs[pack_id] = new_p;\n>                 free(idx_name);\n>\n> @@ -1090,7 +1090,7 @@ static int store_object(\n>  static void truncate_pack(struct hashfile_checkpoint *checkpoint)\n>  {\n>         if (hashfile_truncate(pack_file, checkpoint))\n> -               die_errno(\"cannot truncate pack to skip duplicate\");\n> +               die_errno(_(\"cannot truncate pack to skip duplicate\"));\n>         pack_size = checkpoint->offset;\n>  }\n>\n> @@ -1138,7 +1138,7 @@ static void stream_blob(uintmax_t len, struct object_id *oidout, uintmax_t mark)\n>                         size_t cnt = in_sz < len ? in_sz : (size_t)len;\n>                         size_t n = fread(in_buf, 1, cnt, stdin);\n>                         if (!n && feof(stdin))\n> -                               die(\"EOF in data (%\" PRIuMAX \" bytes remaining)\", len);\n> +                               die(_(\"EOF in data (%\" PRIuMAX \" bytes remaining)\"), len);\n>\n>                         git_hash_update(&c, in_buf, n);\n>                         s.next_in = in_buf;\n> @@ -1162,7 +1162,7 @@ static void stream_blob(uintmax_t len, struct object_id *oidout, uintmax_t mark)\n>                 case Z_STREAM_END:\n>                         continue;\n>                 default:\n> -                       die(\"unexpected deflate failure: %d\", status);\n> +                       die(_(\"unexpected deflate failure: %d\"), status);\n>                 }\n>         }\n>         git_deflate_end(&s);\n> @@ -1264,16 +1264,16 @@ static void load_tree(struct tree_entry *root)\n>         myoe = find_object(oid);\n>         if (myoe && myoe->pack_id != MAX_PACK_ID) {\n>                 if (myoe->type != OBJ_TREE)\n> -                       die(\"Not a tree: %s\", oid_to_hex(oid));\n> +                       die(_(\"not a tree: %s\"), oid_to_hex(oid));\n>                 t->delta_depth = myoe->depth;\n>                 buf = gfi_unpack_entry(myoe, &size);\n>                 if (!buf)\n> -                       die(\"Can't load tree %s\", oid_to_hex(oid));\n> +                       die(_(\"can't load tree %s\"), oid_to_hex(oid));\n>         } else {\n>                 enum object_type type;\n>                 buf = odb_read_object(the_repository->objects, oid, &type, &size);\n>                 if (!buf || type != OBJ_TREE)\n> -                       die(\"Can't load tree %s\", oid_to_hex(oid));\n> +                       die(_(\"can't load tree %s\"), oid_to_hex(oid));\n>         }\n>\n>         c = buf;\n> @@ -1287,7 +1287,7 @@ static void load_tree(struct tree_entry *root)\n>                 e->tree = NULL;\n>                 c = parse_mode(c, &e->versions[1].mode);\n>                 if (!c)\n> -                       die(\"Corrupt mode in %s\", oid_to_hex(oid));\n> +                       die(_(\"corrupt mode in %s\"), oid_to_hex(oid));\n>                 e->versions[0].mode = e->versions[1].mode;\n>                 e->name = to_atom(c, strlen(c));\n>                 c += e->name->str_len + 1;\n> @@ -1399,7 +1399,7 @@ static void tree_content_replace(\n>         struct tree_content *newtree)\n>  {\n>         if (!S_ISDIR(mode))\n> -               die(\"Root cannot be a non-directory\");\n> +               die(_(\"root cannot be a non-directory\"));\n>         oidclr(&root->versions[0].oid, the_repository->hash_algo);\n>         oidcpy(&root->versions[1].oid, oid);\n>         if (root->tree)\n> @@ -1422,9 +1422,9 @@ static int tree_content_set(\n>         slash1 = strchrnul(p, '/');\n>         n = slash1 - p;\n>         if (!n)\n> -               die(\"Empty path component found in input\");\n> +               die(_(\"empty path component found in input\"));\n>         if (!*slash1 && !S_ISDIR(mode) && subtree)\n> -               die(\"Non-directories cannot have subtrees\");\n> +               die(_(\"non-directories cannot have subtrees\"));\n>\n>         if (!root->tree)\n>                 load_tree(root);\n> @@ -1576,7 +1576,7 @@ static int tree_content_get(\n>         slash1 = strchrnul(p, '/');\n>         n = slash1 - p;\n>         if (!n && !allow_root)\n> -               die(\"Empty path component found in input\");\n> +               die(_(\"empty path component found in input\"));\n>\n>         if (!root->tree)\n>                 load_tree(root);\n> @@ -1622,8 +1622,8 @@ static int update_branch(struct branch *b)\n>             !strcmp(b->name + strlen(replace_prefix),\n>                     oid_to_hex(&b->oid))) {\n>                 if (!quiet)\n> -                       warning(\"Dropping %s since it would point to \"\n> -                               \"itself (i.e. to %s)\",\n> +                       warning(_(\"dropping %s since it would point to \"\n> +                                 \"itself (i.e. to %s)\"),\n>                                 b->name, oid_to_hex(&b->oid));\n>                 refs_delete_ref(get_main_ref_store(the_repository),\n>                                 NULL, b->name, NULL, 0);\n> @@ -1646,14 +1646,14 @@ static int update_branch(struct branch *b)\n>                 new_cmit = lookup_commit_reference_gently(the_repository,\n>                                                           &b->oid, 0);\n>                 if (!old_cmit || !new_cmit)\n> -                       return error(\"Branch %s is missing commits.\", b->name);\n> +                       return error(_(\"branch %s is missing commits.\"), b->name);\n>\n>                 ret = repo_in_merge_bases(the_repository, old_cmit, new_cmit);\n>                 if (ret < 0)\n>                         exit(128);\n>                 if (!ret) {\n> -                       warning(\"Not updating %s\"\n> -                               \" (new tip %s does not contain %s)\",\n> +                       warning(_(\"not updating %s\"\n> +                                 \" (new tip %s does not contain %s)\"),\n>                                 b->name, oid_to_hex(&b->oid),\n>                                 oid_to_hex(&old_oid));\n>                         return -1;\n> @@ -1729,13 +1729,13 @@ static void dump_marks(void)\n>                 return;\n>\n>         if (safe_create_leading_directories_const(the_repository, export_marks_file)) {\n> -               failure |= error_errno(\"unable to create leading directories of %s\",\n> +               failure |= error_errno(_(\"unable to create leading directories of %s\"),\n>                                        export_marks_file);\n>                 return;\n>         }\n>\n>         if (hold_lock_file_for_update(&mark_lock, export_marks_file, 0) < 0) {\n> -               failure |= error_errno(\"Unable to write marks file %s\",\n> +               failure |= error_errno(_(\"unable to write marks file %s\"),\n>                                        export_marks_file);\n>                 return;\n>         }\n> @@ -1744,14 +1744,14 @@ static void dump_marks(void)\n>         if (!f) {\n>                 int saved_errno = errno;\n>                 rollback_lock_file(&mark_lock);\n> -               failure |= error(\"Unable to write marks file %s: %s\",\n> +               failure |= error(_(\"unable to write marks file %s: %s\"),\n>                         export_marks_file, strerror(saved_errno));\n>                 return;\n>         }\n>\n>         for_each_mark(marks, 0, dump_marks_fn, f);\n>         if (commit_lock_file(&mark_lock)) {\n> -               failure |= error_errno(\"Unable to write file %s\",\n> +               failure |= error_errno(_(\"unable to write file %s\"),\n>                                        export_marks_file);\n>                 return;\n>         }\n> @@ -1765,7 +1765,7 @@ static void insert_object_entry(struct mark_set **s, struct object_id *oid, uint\n>                 enum object_type type = odb_read_object_info(the_repository->objects,\n>                                                              oid, NULL);\n>                 if (type < 0)\n> -                       die(\"object not found: %s\", oid_to_hex(oid));\n> +                       die(_(\"object not found: %s\"), oid_to_hex(oid));\n>                 e = insert_object(oid);\n>                 e->type = type;\n>                 e->pack_id = MAX_PACK_ID;\n> @@ -1792,13 +1792,13 @@ static void read_mark_file(struct mark_set **s, FILE *f, mark_set_inserter_t ins\n>\n>                 end = strchr(line, '\\n');\n>                 if (line[0] != ':' || !end)\n> -                       die(\"corrupt mark line: %s\", line);\n> +                       die(_(\"corrupt mark line: %s\"), line);\n>                 *end = 0;\n>                 mark = strtoumax(line + 1, &end, 10);\n>                 if (!mark || end == line + 1\n>                         || *end != ' '\n>                         || get_oid_hex_any(end + 1, &oid) == GIT_HASH_UNKNOWN)\n> -                       die(\"corrupt mark line: %s\", line);\n> +                       die(_(\"corrupt mark line: %s\"), line);\n>                 inserter(s, &oid, mark);\n>         }\n>  }\n> @@ -1811,7 +1811,7 @@ static void read_marks(void)\n>         else if (import_marks_file_ignore_missing && errno == ENOENT)\n>                 goto done; /* Marks file does not exist */\n>         else\n> -               die_errno(\"cannot read '%s'\", import_marks_file);\n> +               die_errno(_(\"cannot read '%s'\"), import_marks_file);\n>         read_mark_file(&marks, f, insert_object_entry);\n>         fclose(f);\n>  done:\n> @@ -1897,7 +1897,7 @@ static int parse_data(struct strbuf *sb, uintmax_t limit, uintmax_t *len_res)\n>         strbuf_reset(sb);\n>\n>         if (!skip_prefix(command_buf.buf, \"data \", &data))\n> -               die(\"Expected 'data n' command, found: %s\", command_buf.buf);\n> +               die(_(\"expected 'data n' command, found: %s\"), command_buf.buf);\n>\n>         if (skip_prefix(data, \"<<\", &data)) {\n>                 char *term = xstrdup(data);\n> @@ -1905,7 +1905,7 @@ static int parse_data(struct strbuf *sb, uintmax_t limit, uintmax_t *len_res)\n>\n>                 for (;;) {\n>                         if (strbuf_getline_lf(&command_buf, stdin) == EOF)\n> -                               die(\"EOF in data (terminator '%s' not found)\", term);\n> +                               die(_(\"EOF in data (terminator '%s' not found)\"), term);\n>                         if (term_len == command_buf.len\n>                                 && !strcmp(term, command_buf.buf))\n>                                 break;\n> @@ -1923,12 +1923,12 @@ static int parse_data(struct strbuf *sb, uintmax_t limit, uintmax_t *len_res)\n>                         return 0;\n>                 }\n>                 if (length < len)\n> -                       die(\"data is too large to use in this context\");\n> +                       die(_(\"data is too large to use in this context\"));\n>\n>                 while (n < length) {\n>                         size_t s = strbuf_fread(sb, length - n, stdin);\n>                         if (!s && feof(stdin))\n> -                               die(\"EOF in data (%lu bytes remaining)\",\n> +                               die(_(\"EOF in data (%lu bytes remaining)\"),\n>                                         (unsigned long)(length - n));\n>                         n += s;\n>                 }\n> @@ -1985,15 +1985,15 @@ static char *parse_ident(const char *buf)\n>\n>         ltgt = buf + strcspn(buf, \"<>\");\n>         if (*ltgt != '<')\n> -               die(\"Missing < in ident string: %s\", buf);\n> +               die(_(\"missing < in ident string: %s\"), buf);\n>         if (ltgt != buf && ltgt[-1] != ' ')\n> -               die(\"Missing space before < in ident string: %s\", buf);\n> +               die(_(\"missing space before < in ident string: %s\"), buf);\n>         ltgt = ltgt + 1 + strcspn(ltgt + 1, \"<>\");\n>         if (*ltgt != '>')\n> -               die(\"Missing > in ident string: %s\", buf);\n> +               die(_(\"missing > in ident string: %s\"), buf);\n>         ltgt++;\n>         if (*ltgt != ' ')\n> -               die(\"Missing space after > in ident string: %s\", buf);\n> +               die(_(\"missing space after > in ident string: %s\"), buf);\n>         ltgt++;\n>         name_len = ltgt - buf;\n>         strbuf_add(&ident, buf, name_len);\n> @@ -2001,19 +2001,19 @@ static char *parse_ident(const char *buf)\n>         switch (whenspec) {\n>         case WHENSPEC_RAW:\n>                 if (validate_raw_date(ltgt, &ident, 1) < 0)\n> -                       die(\"Invalid raw date \\\"%s\\\" in ident: %s\", ltgt, buf);\n> +                       die(_(\"invalid raw date \\\"%s\\\" in ident: %s\"), ltgt, buf);\n>                 break;\n>         case WHENSPEC_RAW_PERMISSIVE:\n>                 if (validate_raw_date(ltgt, &ident, 0) < 0)\n> -                       die(\"Invalid raw date \\\"%s\\\" in ident: %s\", ltgt, buf);\n> +                       die(_(\"invalid raw date \\\"%s\\\" in ident: %s\"), ltgt, buf);\n>                 break;\n>         case WHENSPEC_RFC2822:\n>                 if (parse_date(ltgt, &ident) < 0)\n> -                       die(\"Invalid rfc2822 date \\\"%s\\\" in ident: %s\", ltgt, buf);\n> +                       die(_(\"invalid rfc2822 date \\\"%s\\\" in ident: %s\"), ltgt, buf);\n>                 break;\n>         case WHENSPEC_NOW:\n>                 if (strcmp(\"now\", ltgt))\n> -                       die(\"Date in ident must be 'now': %s\", buf);\n> +                       die(_(\"date in ident must be 'now': %s\"), buf);\n>                 datestamp(&ident);\n>                 break;\n>         }\n> @@ -2107,7 +2107,7 @@ static void construct_path_with_fanout(const char *hex_sha1,\n>  {\n>         unsigned int i = 0, j = 0;\n>         if (fanout >= the_hash_algo->rawsz)\n> -               die(\"Too large fanout (%u)\", fanout);\n> +               die(_(\"too large fanout (%u)\"), fanout);\n>         while (fanout) {\n>                 path[i++] = hex_sha1[j++];\n>                 path[i++] = hex_sha1[j++];\n> @@ -2181,7 +2181,7 @@ static uintmax_t do_change_note_fanout(\n>\n>                         /* Rename fullpath to realpath */\n>                         if (!tree_content_remove(orig_root, fullpath, &leaf, 0))\n> -                               die(\"Failed to remove path %s\", fullpath);\n> +                               die(_(\"failed to remove path %s\"), fullpath);\n>                         tree_content_set(orig_root, realpath,\n>                                 &leaf.versions[1].oid,\n>                                 leaf.versions[1].mode,\n> @@ -2254,7 +2254,7 @@ static uintmax_t parse_mark_ref(const char *p, char **endptr)\n>         p++;\n>         mark = strtoumax(p, endptr, 10);\n>         if (*endptr == p)\n> -               die(\"No value after ':' in mark: %s\", command_buf.buf);\n> +               die(_(\"no value after ':' in mark: %s\"), command_buf.buf);\n>         return mark;\n>  }\n>\n> @@ -2269,7 +2269,7 @@ static uintmax_t parse_mark_ref_eol(const char *p)\n>\n>         mark = parse_mark_ref(p, &end);\n>         if (*end != '\\0')\n> -               die(\"Garbage after mark: %s\", command_buf.buf);\n> +               die(_(\"garbage after mark: %s\"), command_buf.buf);\n>         return mark;\n>  }\n>\n> @@ -2284,7 +2284,7 @@ static uintmax_t parse_mark_ref_space(const char **p)\n>\n>         mark = parse_mark_ref(*p, &end);\n>         if (*end++ != ' ')\n> -               die(\"Missing space after mark: %s\", command_buf.buf);\n> +               die(_(\"missing space after mark: %s\"), command_buf.buf);\n>         *p = end;\n>         return mark;\n>  }\n> @@ -2300,9 +2300,9 @@ static void parse_path(struct strbuf *sb, const char *p, const char **endp,\n>  {\n>         if (*p == '\"') {\n>                 if (unquote_c_style(sb, p, endp))\n> -                       die(\"Invalid %s: %s\", field, command_buf.buf);\n> +                       die(_(\"invalid %s: %s\"), field, command_buf.buf);\n>                 if (strlen(sb->buf) != sb->len)\n> -                       die(\"NUL in %s: %s\", field, command_buf.buf);\n> +                       die(_(\"NUL in %s: %s\"), field, command_buf.buf);\n>         } else {\n>                 /*\n>                  * Unless we are parsing the last field of a line,\n> @@ -2325,7 +2325,7 @@ static void parse_path_eol(struct strbuf *sb, const char *p, const char *field)\n>\n>         parse_path(sb, p, &end, 1, field);\n>         if (*end)\n> -               die(\"Garbage after %s: %s\", field, command_buf.buf);\n> +               die(_(\"garbage after %s: %s\"), field, command_buf.buf);\n>  }\n>\n>  /*\n> @@ -2338,7 +2338,7 @@ static void parse_path_space(struct strbuf *sb, const char *p,\n>  {\n>         parse_path(sb, p, endp, 0, field);\n>         if (**endp != ' ')\n> -               die(\"Missing space after %s: %s\", field, command_buf.buf);\n> +               die(_(\"missing space after %s: %s\"), field, command_buf.buf);\n>         (*endp)++;\n>  }\n>\n> @@ -2351,7 +2351,7 @@ static void file_change_m(const char *p, struct branch *b)\n>\n>         p = parse_mode(p, &mode);\n>         if (!p)\n> -               die(\"Corrupt mode: %s\", command_buf.buf);\n> +               die(_(\"corrupt mode: %s\"), command_buf.buf);\n>         switch (mode) {\n>         case 0644:\n>         case 0755:\n> @@ -2364,7 +2364,7 @@ static void file_change_m(const char *p, struct branch *b)\n>                 /* ok */\n>                 break;\n>         default:\n> -               die(\"Corrupt mode: %s\", command_buf.buf);\n> +               die(_(\"corrupt mode: %s\"), command_buf.buf);\n>         }\n>\n>         if (*p == ':') {\n> @@ -2375,10 +2375,10 @@ static void file_change_m(const char *p, struct branch *b)\n>                 oe = NULL; /* not used with inline_data, but makes gcc happy */\n>         } else {\n>                 if (parse_mapped_oid_hex(p, &oid, &p))\n> -                       die(\"Invalid dataref: %s\", command_buf.buf);\n> +                       die(_(\"invalid dataref: %s\"), command_buf.buf);\n>                 oe = find_object(&oid);\n>                 if (*p++ != ' ')\n> -                       die(\"Missing space after SHA1: %s\", command_buf.buf);\n> +                       die(_(\"missing space after SHA1: %s\"), command_buf.buf);\n>         }\n>\n>         strbuf_reset(&path);\n> @@ -2394,11 +2394,11 @@ static void file_change_m(const char *p, struct branch *b)\n>\n>         if (S_ISGITLINK(mode)) {\n>                 if (inline_data)\n> -                       die(\"Git links cannot be specified 'inline': %s\",\n> +                       die(_(\"Git links cannot be specified 'inline': %s\"),\n>                                 command_buf.buf);\n>                 else if (oe) {\n>                         if (oe->type != OBJ_COMMIT)\n> -                               die(\"Not a commit (actually a %s): %s\",\n> +                               die(_(\"not a commit (actually a %s): %s\"),\n>                                         type_name(oe->type), command_buf.buf);\n>                 }\n>                 /*\n> @@ -2407,7 +2407,7 @@ static void file_change_m(const char *p, struct branch *b)\n>                  */\n>         } else if (inline_data) {\n>                 if (S_ISDIR(mode))\n> -                       die(\"Directories cannot be specified 'inline': %s\",\n> +                       die(_(\"directories cannot be specified 'inline': %s\"),\n>                                 command_buf.buf);\n>                 while (read_next_command() != EOF) {\n>                         const char *v;\n> @@ -2425,11 +2425,11 @@ static void file_change_m(const char *p, struct branch *b)\n>                                         odb_read_object_info(the_repository->objects,\n>                                                              &oid, NULL);\n>                 if (type < 0)\n> -                       die(\"%s not found: %s\",\n> -                                       S_ISDIR(mode) ?  \"Tree\" : \"Blob\",\n> -                                       command_buf.buf);\n> +                       die(_(\"%s not found: %s\"),\n> +                           S_ISDIR(mode) ?  _(\"tree\") : _(\"blob\"),\n> +                           command_buf.buf);\n>                 if (type != expected)\n> -                       die(\"Not a %s (actually a %s): %s\",\n> +                       die(_(\"not a %s (actually a %s): %s\"),\n>                                 type_name(expected), type_name(type),\n>                                 command_buf.buf);\n>         }\n> @@ -2440,7 +2440,7 @@ static void file_change_m(const char *p, struct branch *b)\n>         }\n>\n>         if (!verify_path(path.buf, mode))\n> -               die(\"invalid path '%s'\", path.buf);\n> +               die(_(\"invalid path '%s'\"), path.buf);\n>         tree_content_set(&b->branch_tree, path.buf, &oid, mode, NULL);\n>  }\n>\n> @@ -2470,7 +2470,7 @@ static void file_change_cr(const char *p, struct branch *b, int rename)\n>         else\n>                 tree_content_get(&b->branch_tree, source.buf, &leaf, 1);\n>         if (!leaf.versions[1].mode)\n> -               die(\"Path %s not in branch\", source.buf);\n> +               die(_(\"path %s not in branch\"), source.buf);\n>         if (!*dest.buf) {       /* C \"path/to/subdir\" \"\" */\n>                 tree_content_replace(&b->branch_tree,\n>                         &leaf.versions[1].oid,\n> @@ -2479,7 +2479,7 @@ static void file_change_cr(const char *p, struct branch *b, int rename)\n>                 return;\n>         }\n>         if (!verify_path(dest.buf, leaf.versions[1].mode))\n> -               die(\"invalid path '%s'\", dest.buf);\n> +               die(_(\"invalid path '%s'\"), dest.buf);\n>         tree_content_set(&b->branch_tree, dest.buf,\n>                 &leaf.versions[1].oid,\n>                 leaf.versions[1].mode,\n> @@ -2521,23 +2521,23 @@ static void note_change_n(const char *p, struct branch *b, unsigned char *old_fa\n>                 oe = NULL; /* not used with inline_data, but makes gcc happy */\n>         } else {\n>                 if (parse_mapped_oid_hex(p, &oid, &p))\n> -                       die(\"Invalid dataref: %s\", command_buf.buf);\n> +                       die(_(\"invalid dataref: %s\"), command_buf.buf);\n>                 oe = find_object(&oid);\n>                 if (*p++ != ' ')\n> -                       die(\"Missing space after SHA1: %s\", command_buf.buf);\n> +                       die(_(\"missing space after SHA1: %s\"), command_buf.buf);\n>         }\n>\n>         /* <commit-ish> */\n>         s = lookup_branch(p);\n>         if (s) {\n>                 if (is_null_oid(&s->oid))\n> -                       die(\"Can't add a note on empty branch.\");\n> +                       die(_(\"can't add a note on empty branch.\"));\n>                 oidcpy(&commit_oid, &s->oid);\n>         } else if (*p == ':') {\n>                 uintmax_t commit_mark = parse_mark_ref_eol(p);\n>                 struct object_entry *commit_oe = find_mark(marks, commit_mark);\n>                 if (commit_oe->type != OBJ_COMMIT)\n> -                       die(\"Mark :%\" PRIuMAX \" not a commit\", commit_mark);\n> +                       die(_(\"mark :%\" PRIuMAX \" not a commit\"), commit_mark);\n>                 oidcpy(&commit_oid, &commit_oe->idx.oid);\n>         } else if (!repo_get_oid(the_repository, p, &commit_oid)) {\n>                 unsigned long size;\n> @@ -2545,25 +2545,25 @@ static void note_change_n(const char *p, struct branch *b, unsigned char *old_fa\n>                                                    &commit_oid, OBJ_COMMIT, &size,\n>                                                    &commit_oid);\n>                 if (!buf || size < the_hash_algo->hexsz + 6)\n> -                       die(\"Not a valid commit: %s\", p);\n> +                       die(_(\"not a valid commit: %s\"), p);\n>                 free(buf);\n>         } else\n> -               die(\"Invalid ref name or SHA1 expression: %s\", p);\n> +               die(_(\"invalid ref name or SHA1 expression: %s\"), p);\n>\n>         if (inline_data) {\n>                 read_next_command();\n>                 parse_and_store_blob(&last_blob, &oid, 0);\n>         } else if (oe) {\n>                 if (oe->type != OBJ_BLOB)\n> -                       die(\"Not a blob (actually a %s): %s\",\n> +                       die(_(\"not a blob (actually a %s): %s\"),\n>                                 type_name(oe->type), command_buf.buf);\n>         } else if (!is_null_oid(&oid)) {\n>                 enum object_type type = odb_read_object_info(the_repository->objects, &oid,\n>                                                         NULL);\n>                 if (type < 0)\n> -                       die(\"Blob not found: %s\", command_buf.buf);\n> +                       die(_(\"blob not found: %s\"), command_buf.buf);\n>                 if (type != OBJ_BLOB)\n> -                       die(\"Not a blob (actually a %s): %s\",\n> +                       die(_(\"not a blob (actually a %s): %s\"),\n>                             type_name(type), command_buf.buf);\n>         }\n>\n> @@ -2592,10 +2592,10 @@ static void file_change_deleteall(struct branch *b)\n>  static void parse_from_commit(struct branch *b, char *buf, unsigned long size)\n>  {\n>         if (!buf || size < the_hash_algo->hexsz + 6)\n> -               die(\"Not a valid commit: %s\", oid_to_hex(&b->oid));\n> +               die(_(\"not a valid commit: %s\"), oid_to_hex(&b->oid));\n>         if (memcmp(\"tree \", buf, 5)\n>                 || get_oid_hex(buf + 5, &b->branch_tree.versions[1].oid))\n> -               die(\"The commit %s is corrupt\", oid_to_hex(&b->oid));\n> +               die(_(\"the commit %s is corrupt\"), oid_to_hex(&b->oid));\n>         oidcpy(&b->branch_tree.versions[0].oid,\n>                &b->branch_tree.versions[1].oid);\n>  }\n> @@ -2625,7 +2625,7 @@ static int parse_objectish(struct branch *b, const char *objectish)\n>\n>         s = lookup_branch(objectish);\n>         if (b == s)\n> -               die(\"Can't create a branch from itself: %s\", b->name);\n> +               die(_(\"can't create a branch from itself: %s\"), b->name);\n>         else if (s) {\n>                 struct object_id *t = &s->branch_tree.versions[1].oid;\n>                 oidcpy(&b->oid, &s->oid);\n> @@ -2635,7 +2635,7 @@ static int parse_objectish(struct branch *b, const char *objectish)\n>                 uintmax_t idnum = parse_mark_ref_eol(objectish);\n>                 struct object_entry *oe = find_mark(marks, idnum);\n>                 if (oe->type != OBJ_COMMIT)\n> -                       die(\"Mark :%\" PRIuMAX \" not a commit\", idnum);\n> +                       die(_(\"mark :%\" PRIuMAX \" not a commit\"), idnum);\n>                 if (!oideq(&b->oid, &oe->idx.oid)) {\n>                         oidcpy(&b->oid, &oe->idx.oid);\n>                         if (oe->pack_id != MAX_PACK_ID) {\n> @@ -2652,7 +2652,7 @@ static int parse_objectish(struct branch *b, const char *objectish)\n>                         b->delete = 1;\n>         }\n>         else\n> -               die(\"Invalid ref name or SHA1 expression: %s\", objectish);\n> +               die(_(\"invalid ref name or SHA1 expression: %s\"), objectish);\n>\n>         if (b->branch_tree.tree && !oideq(&oid, &b->branch_tree.versions[1].oid)) {\n>                 release_tree_content_recursive(b->branch_tree.tree);\n> @@ -2699,7 +2699,7 @@ static struct hash_list *parse_merge(unsigned int *count)\n>                         uintmax_t idnum = parse_mark_ref_eol(from);\n>                         struct object_entry *oe = find_mark(marks, idnum);\n>                         if (oe->type != OBJ_COMMIT)\n> -                               die(\"Mark :%\" PRIuMAX \" not a commit\", idnum);\n> +                               die(_(\"mark :%\" PRIuMAX \" not a commit\"), idnum);\n>                         oidcpy(&n->oid, &oe->idx.oid);\n>                 } else if (!repo_get_oid(the_repository, from, &n->oid)) {\n>                         unsigned long size;\n> @@ -2707,10 +2707,10 @@ static struct hash_list *parse_merge(unsigned int *count)\n>                                                            &n->oid, OBJ_COMMIT,\n>                                                            &size, &n->oid);\n>                         if (!buf || size < the_hash_algo->hexsz + 6)\n> -                               die(\"Not a valid commit: %s\", from);\n> +                               die(_(\"not a valid commit: %s\"), from);\n>                         free(buf);\n>                 } else\n> -                       die(\"Invalid ref name or SHA1 expression: %s\", from);\n> +                       die(_(\"invalid ref name or SHA1 expression: %s\"), from);\n>\n>                 n->next = NULL;\n>                 *tail = n;\n> @@ -2734,8 +2734,8 @@ static void parse_one_signature(struct signature_data *sig, const char *v)\n>         char *space = strchr(args, ' ');\n>\n>         if (!space)\n> -               die(\"Expected gpgsig format: 'gpgsig <hash-algo> <signature-format>', \"\n> -                   \"got 'gpgsig %s'\", args);\n> +               die(_(\"expected gpgsig format: 'gpgsig <hash-algo> <signature-format>', \"\n> +                     \"got 'gpgsig %s'\"), args);\n>         *space = '\\0';\n>\n>         sig->hash_algo = args;\n> @@ -2744,13 +2744,13 @@ static void parse_one_signature(struct signature_data *sig, const char *v)\n>         /* Validate hash algorithm */\n>         if (strcmp(sig->hash_algo, \"sha1\") &&\n>             strcmp(sig->hash_algo, \"sha256\"))\n> -               die(\"Unknown git hash algorithm in gpgsig: '%s'\", sig->hash_algo);\n> +               die(_(\"unknown git hash algorithm in gpgsig: '%s'\"), sig->hash_algo);\n>\n>         /* Validate signature format */\n>         if (!valid_signature_format(sig->sig_format))\n> -               die(\"Invalid signature format in gpgsig: '%s'\", sig->sig_format);\n> +               die(_(\"invalid signature format in gpgsig: '%s'\"), sig->sig_format);\n>         if (!strcmp(sig->sig_format, \"unknown\"))\n> -               warning(\"'unknown' signature format in gpgsig\");\n> +               warning(_(\"'unknown' signature format in gpgsig\"));\n>\n>         /* Read signature data */\n>         read_next_command();\n> @@ -2789,8 +2789,8 @@ static void store_signature(struct signature_data *stored_sig,\n>                             const char *hash_type)\n>  {\n>         if (stored_sig->hash_algo) {\n> -               warning(\"multiple %s signatures found, \"\n> -                       \"ignoring additional signature\",\n> +               warning(_(\"multiple %s signatures found, \"\n> +                         \"ignoring additional signature\"),\n>                         hash_type);\n>                 strbuf_release(&new_sig->data);\n>                 free(new_sig->hash_algo);\n> @@ -2845,15 +2845,15 @@ static void parse_new_commit(const char *arg)\n>                 read_next_command();\n>         }\n>         if (!committer)\n> -               die(\"Expected committer but didn't get one\");\n> +               die(_(\"expected committer but didn't get one\"));\n>\n>         while (skip_prefix(command_buf.buf, \"gpgsig \", &v)) {\n>                 switch (signed_commit_mode) {\n>\n>                 /* First, modes that don't need the signature to be parsed */\n>                 case SIGN_ABORT:\n> -                       die(\"encountered signed commit; use \"\n> -                           \"--signed-commits=<mode> to handle it\");\n> +                       die(_(\"encountered signed commit; use \"\n> +                             \"--signed-commits=<mode> to handle it\"));\n>                 case SIGN_WARN_STRIP:\n>                         warning(_(\"stripping a commit signature\"));\n>                         /* fallthru */\n> @@ -3025,11 +3025,11 @@ static void parse_new_tag(const char *arg)\n>\n>         /* from ... */\n>         if (!skip_prefix(command_buf.buf, \"from \", &from))\n> -               die(\"Expected from command, got %s\", command_buf.buf);\n> +               die(_(\"expected 'from' command, got '%s'\"), command_buf.buf);\n>         s = lookup_branch(from);\n>         if (s) {\n>                 if (is_null_oid(&s->oid))\n> -                       die(\"Can't tag an empty branch.\");\n> +                       die(_(\"can't tag an empty branch.\"));\n>                 oidcpy(&oid, &s->oid);\n>                 type = OBJ_COMMIT;\n>         } else if (*from == ':') {\n> @@ -3044,11 +3044,11 @@ static void parse_new_tag(const char *arg)\n>                         type = odb_read_object_info(the_repository->objects,\n>                                                     &oid, NULL);\n>                         if (type < 0)\n> -                               die(\"Not a valid object: %s\", from);\n> +                               die(_(\"not a valid object: %s\"), from);\n>                 } else\n>                         type = oe->type;\n>         } else\n> -               die(\"Invalid ref name or SHA1 expression: %s\", from);\n> +               die(_(\"invalid ref name or SHA1 expression: %s\"), from);\n>         read_next_command();\n>\n>         /* original-oid ... */\n> @@ -3139,7 +3139,7 @@ static void parse_reset_branch(const char *arg)\n>  static void cat_blob_write(const char *buf, unsigned long size)\n>  {\n>         if (write_in_full(cat_blob_fd, buf, size) < 0)\n> -               die_errno(\"Write to frontend failed\");\n> +               die_errno(_(\"write to frontend failed\"));\n>  }\n>\n>  static void cat_blob(struct object_entry *oe, struct object_id *oid)\n> @@ -3168,9 +3168,9 @@ static void cat_blob(struct object_entry *oe, struct object_id *oid)\n>                 return;\n>         }\n>         if (!buf)\n> -               die(\"Can't read object %s\", oid_to_hex(oid));\n> +               die(_(\"can't read object %s\"), oid_to_hex(oid));\n>         if (type != OBJ_BLOB)\n> -               die(\"Object %s is a %s but a blob was expected.\",\n> +               die(_(\"object %s is a %s but a blob was expected.\"),\n>                     oid_to_hex(oid), type_name(type));\n>         strbuf_reset(&line);\n>         strbuf_addf(&line, \"%s %s %\"PRIuMAX\"\\n\", oid_to_hex(oid),\n> @@ -3194,11 +3194,11 @@ static void parse_get_mark(const char *p)\n>\n>         /* get-mark SP <object> LF */\n>         if (*p != ':')\n> -               die(\"Not a mark: %s\", p);\n> +               die(_(\"not a mark: %s\"), p);\n>\n>         oe = find_mark(marks, parse_mark_ref_eol(p));\n>         if (!oe)\n> -               die(\"Unknown mark: %s\", command_buf.buf);\n> +               die(_(\"unknown mark: %s\"), command_buf.buf);\n>\n>         xsnprintf(output, sizeof(output), \"%s\\n\", oid_to_hex(&oe->idx.oid));\n>         cat_blob_write(output, the_hash_algo->hexsz + 1);\n> @@ -3213,13 +3213,13 @@ static void parse_cat_blob(const char *p)\n>         if (*p == ':') {\n>                 oe = find_mark(marks, parse_mark_ref_eol(p));\n>                 if (!oe)\n> -                       die(\"Unknown mark: %s\", command_buf.buf);\n> +                       die(_(\"unknown mark: %s\"), command_buf.buf);\n>                 oidcpy(&oid, &oe->idx.oid);\n>         } else {\n>                 if (parse_mapped_oid_hex(p, &oid, &p))\n> -                       die(\"Invalid dataref: %s\", command_buf.buf);\n> +                       die(_(\"invalid dataref: %s\"), command_buf.buf);\n>                 if (*p)\n> -                       die(\"Garbage after SHA1: %s\", command_buf.buf);\n> +                       die(_(\"garbage after SHA1: %s\"), command_buf.buf);\n>                 oe = find_object(&oid);\n>         }\n>\n> @@ -3237,7 +3237,7 @@ static struct object_entry *dereference(struct object_entry *oe,\n>                 enum object_type type = odb_read_object_info(the_repository->objects,\n>                                                              oid, NULL);\n>                 if (type < 0)\n> -                       die(\"object not found: %s\", oid_to_hex(oid));\n> +                       die(_(\"object not found: %s\"), oid_to_hex(oid));\n>                 /* cache it! */\n>                 oe = insert_object(oid);\n>                 oe->type = type;\n> @@ -3251,7 +3251,7 @@ static struct object_entry *dereference(struct object_entry *oe,\n>         case OBJ_TAG:\n>                 break;\n>         default:\n> -               die(\"Not a tree-ish: %s\", command_buf.buf);\n> +               die(_(\"not a tree-ish: %s\"), command_buf.buf);\n>         }\n>\n>         if (oe->pack_id != MAX_PACK_ID) {       /* in a pack being written */\n> @@ -3262,19 +3262,19 @@ static struct object_entry *dereference(struct object_entry *oe,\n>                                       &unused, &size);\n>         }\n>         if (!buf)\n> -               die(\"Can't load object %s\", oid_to_hex(oid));\n> +               die(_(\"can't load object %s\"), oid_to_hex(oid));\n>\n>         /* Peel one layer. */\n>         switch (oe->type) {\n>         case OBJ_TAG:\n>                 if (size < hexsz + strlen(\"object \") ||\n>                     get_oid_hex(buf + strlen(\"object \"), oid))\n> -                       die(\"Invalid SHA1 in tag: %s\", command_buf.buf);\n> +                       die(_(\"invalid SHA1 in tag: %s\"), command_buf.buf);\n>                 break;\n>         case OBJ_COMMIT:\n>                 if (size < hexsz + strlen(\"tree \") ||\n>                     get_oid_hex(buf + strlen(\"tree \"), oid))\n> -                       die(\"Invalid SHA1 in commit: %s\", command_buf.buf);\n> +                       die(_(\"invalid SHA1 in commit: %s\"), command_buf.buf);\n>         }\n>\n>         free(buf);\n> @@ -3309,9 +3309,9 @@ static void build_mark_map(struct string_list *from, struct string_list *to)\n>         for_each_string_list_item(fromp, from) {\n>                 top = string_list_lookup(to, fromp->string);\n>                 if (!fromp->util) {\n> -                       die(_(\"Missing from marks for submodule '%s'\"), fromp->string);\n> +                       die(_(\"missing from marks for submodule '%s'\"), fromp->string);\n>                 } else if (!top || !top->util) {\n> -                       die(_(\"Missing to marks for submodule '%s'\"), fromp->string);\n> +                       die(_(\"missing to marks for submodule '%s'\"), fromp->string);\n>                 }\n>                 build_mark_map_one(fromp->util, top->util);\n>         }\n> @@ -3325,14 +3325,14 @@ static struct object_entry *parse_treeish_dataref(const char **p)\n>         if (**p == ':') {       /* <mark> */\n>                 e = find_mark(marks, parse_mark_ref_space(p));\n>                 if (!e)\n> -                       die(\"Unknown mark: %s\", command_buf.buf);\n> +                       die(_(\"unknown mark: %s\"), command_buf.buf);\n>                 oidcpy(&oid, &e->idx.oid);\n>         } else {        /* <sha1> */\n>                 if (parse_mapped_oid_hex(*p, &oid, p))\n> -                       die(\"Invalid dataref: %s\", command_buf.buf);\n> +                       die(_(\"invalid dataref: %s\"), command_buf.buf);\n>                 e = find_object(&oid);\n>                 if (*(*p)++ != ' ')\n> -                       die(\"Missing space after tree-ish: %s\", command_buf.buf);\n> +                       die(_(\"missing space after tree-ish: %s\"), command_buf.buf);\n>         }\n>\n>         while (!e || e->type != OBJ_TREE)\n> @@ -3376,7 +3376,7 @@ static void parse_ls(const char *p, struct branch *b)\n>         /* ls SP (<tree-ish> SP)? <path> */\n>         if (*p == '\"') {\n>                 if (!b)\n> -                       die(\"Not in a commit: %s\", command_buf.buf);\n> +                       die(_(\"not in a commit: %s\"), command_buf.buf);\n>                 root = &b->branch_tree;\n>         } else {\n>                 struct object_entry *e = parse_treeish_dataref(&p);\n> @@ -3439,12 +3439,12 @@ static void parse_alias(void)\n>         /* mark ... */\n>         parse_mark();\n>         if (!next_mark)\n> -               die(_(\"Expected 'mark' command, got %s\"), command_buf.buf);\n> +               die(_(\"expected 'mark' command, got %s\"), command_buf.buf);\n>\n>         /* to ... */\n>         memset(&b, 0, sizeof(b));\n>         if (!parse_objectish_with_prefix(&b, \"to \"))\n> -               die(_(\"Expected 'to' command, got %s\"), command_buf.buf);\n> +               die(_(\"expected 'to' command, got %s\"), command_buf.buf);\n>         e = find_object(&b.oid);\n>         assert(e);\n>         insert_mark(&marks, next_mark, e);\n> @@ -3462,7 +3462,7 @@ static void option_import_marks(const char *marks,\n>  {\n>         if (import_marks_file) {\n>                 if (from_stream)\n> -                       die(\"Only one import-marks command allowed per stream\");\n> +                       die(_(\"only one import-marks command allowed per stream\"));\n>\n>                 /* read previous mark file */\n>                 if(!import_marks_file_from_stream)\n> @@ -3486,7 +3486,7 @@ static void option_date_format(const char *fmt)\n>         else if (!strcmp(fmt, \"now\"))\n>                 whenspec = WHENSPEC_NOW;\n>         else\n> -               die(\"unknown --date-format argument %s\", fmt);\n> +               die(_(\"unknown --date-format argument %s\"), fmt);\n>  }\n>\n>  static unsigned long ulong_arg(const char *option, const char *arg)\n> @@ -3494,7 +3494,7 @@ static unsigned long ulong_arg(const char *option, const char *arg)\n>         char *endptr;\n>         unsigned long rv = strtoul(arg, &endptr, 0);\n>         if (strchr(arg, '-') || endptr == arg || *endptr)\n> -               die(\"%s: argument must be a non-negative integer\", option);\n> +               die(_(\"%s: argument must be a non-negative integer\"), option);\n>         return rv;\n>  }\n>\n> @@ -3502,7 +3502,7 @@ static void option_depth(const char *depth)\n>  {\n>         max_depth = ulong_arg(\"--depth\", depth);\n>         if (max_depth > MAX_DEPTH)\n> -               die(\"--depth cannot exceed %u\", MAX_DEPTH);\n> +               die(_(\"--depth cannot exceed %u\"), MAX_DEPTH);\n>  }\n>\n>  static void option_active_branches(const char *branches)\n> @@ -3520,7 +3520,7 @@ static void option_cat_blob_fd(const char *fd)\n>  {\n>         unsigned long n = ulong_arg(\"--cat-blob-fd\", fd);\n>         if (n > (unsigned long) INT_MAX)\n> -               die(\"--cat-blob-fd cannot exceed %d\", INT_MAX);\n> +               die(_(\"--cat-blob-fd cannot exceed %d\"), INT_MAX);\n>         cat_blob_fd = (int) n;\n>  }\n>\n> @@ -3540,7 +3540,7 @@ static void option_rewrite_submodules(const char *arg, struct string_list *list)\n>         char *s = xstrdup(arg);\n>         char *f = strchr(s, ':');\n>         if (!f)\n> -               die(_(\"Expected format name:filename for submodule rewrite option\"));\n> +               die(_(\"expected format name:filename for submodule rewrite option\"));\n>         *f = '\\0';\n>         f++;\n>         CALLOC_ARRAY(ms, 1);\n> @@ -3548,7 +3548,7 @@ static void option_rewrite_submodules(const char *arg, struct string_list *list)\n>         f = prefix_filename(global_prefix, f);\n>         fp = fopen(f, \"r\");\n>         if (!fp)\n> -               die_errno(\"cannot read '%s'\", f);\n> +               die_errno(_(\"cannot read '%s'\"), f);\n>         read_mark_file(&ms, fp, insert_oid_entry);\n>         fclose(fp);\n>         free(f);\n> @@ -3565,10 +3565,10 @@ static int parse_one_option(const char *option)\n>                 if (!git_parse_ulong(option, &v))\n>                         return 0;\n>                 if (v < 8192) {\n> -                       warning(\"max-pack-size is now in bytes, assuming --max-pack-size=%lum\", v);\n> +                       warning(_(\"max-pack-size is now in bytes, assuming --max-pack-size=%lum\"), v);\n>                         v *= 1024 * 1024;\n>                 } else if (v < 1024 * 1024) {\n> -                       warning(\"minimum max-pack-size is 1 MiB\");\n> +                       warning(_(\"minimum max-pack-size is 1 MiB\"));\n>                         v = 1024 * 1024;\n>                 }\n>                 max_packsize = v;\n> @@ -3655,23 +3655,23 @@ static int parse_one_feature(const char *feature, int from_stream)\n>  static void parse_feature(const char *feature)\n>  {\n>         if (seen_data_command)\n> -               die(\"Got feature command '%s' after data command\", feature);\n> +               die(_(\"got feature command '%s' after data command\"), feature);\n>\n>         if (parse_one_feature(feature, 1))\n>                 return;\n>\n> -       die(\"This version of fast-import does not support feature %s.\", feature);\n> +       die(_(\"this version of fast-import does not support feature %s.\"), feature);\n>  }\n>\n>  static void parse_option(const char *option)\n>  {\n>         if (seen_data_command)\n> -               die(\"Got option command '%s' after data command\", option);\n> +               die(_(\"got option command '%s' after data command\"), option);\n>\n>         if (parse_one_option(option))\n>                 return;\n>\n> -       die(\"This version of fast-import does not support option: %s\", option);\n> +       die(_(\"this version of fast-import does not support option: %s\"), option);\n>  }\n>\n>  static void git_pack_config(void)\n> @@ -3715,7 +3715,7 @@ static void parse_argv(void)\n>                         break;\n>\n>                 if (!skip_prefix(a, \"--\", &a))\n> -                       die(\"unknown option %s\", a);\n> +                       die(_(\"unknown option %s\"), a);\n>\n>                 if (parse_one_option(a))\n>                         continue;\n> @@ -3728,7 +3728,7 @@ static void parse_argv(void)\n>                         continue;\n>                 }\n>\n> -               die(\"unknown option --%s\", a);\n> +               die(_(\"unknown option --%s\"), a);\n>         }\n>         if (i != global_argc)\n>                 usage(fast_import_usage);\n> @@ -3817,7 +3817,7 @@ int cmd_fast_import(int argc,\n>                 else if (starts_with(command_buf.buf, \"option \"))\n>                         /* ignore non-git options*/;\n>                 else\n> -                       die(\"Unsupported command: %s\", command_buf.buf);\n> +                       die(_(\"unsupported command: %s\"), command_buf.buf);\n>\n>                 if (checkpoint_requested)\n>                         checkpoint();\n> @@ -3828,7 +3828,7 @@ int cmd_fast_import(int argc,\n>                 parse_argv();\n>\n>         if (require_explicit_termination && feof(stdin))\n> -               die(\"stream ends early\");\n> +               die(_(\"stream ends early\"));\n>\n>         end_packfile();\n>\n> diff --git a/t/t9300-fast-import.sh b/t/t9300-fast-import.sh\n> index 4dc3d645bf..5685cce6fe 100755\n> --- a/t/t9300-fast-import.sh\n> +++ b/t/t9300-fast-import.sh\n> @@ -2927,16 +2927,16 @@ test_expect_success 'R: blob appears only once' '\n>  # The error message when a space is missing not at the\n>  # end of the line is:\n>  #\n> -#   Missing space after ..\n> +#   missing space after ..\n>  #\n>  # or when extra characters come after the mark at the end\n>  # of the line:\n>  #\n> -#   Garbage after ..\n> +#   garbage after ..\n>  #\n>  # or when the dataref is neither \"inline \" or a known SHA1,\n>  #\n> -#   Invalid dataref ..\n> +#   invalid dataref ..\n>  #\n>  test_expect_success 'S: initialize for S tests' '\n>         test_tick &&\n> @@ -3405,15 +3405,15 @@ test_path_fail () {\n>\n>  test_path_base_fail () {\n>         local change=\"$1\" prefix=\"$2\" field=\"$3\" suffix=\"$4\"\n> -       test_path_fail \"$change\" 'unclosed \" in '\"$field\"          \"$prefix\" '\"hello.c'    \"$suffix\" \"Invalid $field\"\n> -       test_path_fail \"$change\" \"invalid escape in quoted $field\" \"$prefix\" '\"hello\\xff\"' \"$suffix\" \"Invalid $field\"\n> +       test_path_fail \"$change\" 'unclosed \" in '\"$field\"          \"$prefix\" '\"hello.c'    \"$suffix\" \"invalid $field\"\n> +       test_path_fail \"$change\" \"invalid escape in quoted $field\" \"$prefix\" '\"hello\\xff\"' \"$suffix\" \"invalid $field\"\n>         test_path_fail \"$change\" \"escaped NUL in quoted $field\"    \"$prefix\" '\"hello\\000\"' \"$suffix\" \"NUL in $field\"\n>  }\n>  test_path_eol_quoted_fail () {\n>         local change=\"$1\" prefix=\"$2\" field=\"$3\"\n>         test_path_base_fail \"$change\" \"$prefix\" \"$field\" ''\n> -       test_path_fail \"$change\" \"garbage after quoted $field\" \"$prefix\" '\"hello.c\"' 'x' \"Garbage after $field\"\n> -       test_path_fail \"$change\" \"space after quoted $field\"   \"$prefix\" '\"hello.c\"' ' ' \"Garbage after $field\"\n> +       test_path_fail \"$change\" \"garbage after quoted $field\" \"$prefix\" '\"hello.c\"' 'x' \"garbage after $field\"\n> +       test_path_fail \"$change\" \"space after quoted $field\"   \"$prefix\" '\"hello.c\"' ' ' \"garbage after $field\"\n>  }\n>  test_path_eol_fail () {\n>         local change=\"$1\" prefix=\"$2\" field=\"$3\"\n> @@ -3422,8 +3422,8 @@ test_path_eol_fail () {\n>  test_path_space_fail () {\n>         local change=\"$1\" prefix=\"$2\" field=\"$3\"\n>         test_path_base_fail \"$change\" \"$prefix\" \"$field\" ' world.c'\n> -       test_path_fail \"$change\" \"missing space after quoted $field\"   \"$prefix\" '\"hello.c\"' 'x world.c' \"Missing space after $field\"\n> -       test_path_fail \"$change\" \"missing space after unquoted $field\" \"$prefix\" 'hello.c'   ''          \"Missing space after $field\"\n> +       test_path_fail \"$change\" \"missing space after quoted $field\"   \"$prefix\" '\"hello.c\"' 'x world.c' \"missing space after $field\"\n> +       test_path_fail \"$change\" \"missing space after unquoted $field\" \"$prefix\" 'hello.c'   ''          \"missing space after $field\"\n>  }\n>\n>  test_path_eol_fail   filemodify       'M 100644 :1 ' path\n> @@ -3820,7 +3820,7 @@ test_expect_success 'X: replace ref that becomes useless is removed' '\n>                 sed -e s/othername/somename/ tmp >tmp2 &&\n>                 git fast-import --force <tmp2 2>msgs &&\n>\n> -               grep \"Dropping.*since it would point to itself\" msgs &&\n> +               grep \"dropping.*since it would point to itself\" msgs &&\n>                 git show-ref >refs &&\n>                 ! grep refs/replace refs\n>         )\n> --\n> 2.51.2.617.g2aaa867cd1\n>\n"},{"id":"530049","messageId":"CABPp-BG_PhbFOS-Tre249nzMyc5YGK1yHMVgo8XGMq7Y4LewWw@mail.gmail.com","threadId":"64397","inReplyTo":"20251030123332.3337684-1-christian.couder@gmail.com","subject":"Re: [PATCH v2 0/5] fast-export/import: cleanups and translation","fromName":"Elijah Newren","fromEmail":"newren@gmail.com","sentAt":"2025-10-31T19:37:35Z","receivedAt":"2025-10-31T19:37:47Z","isPatch":true,"sender":{"key":"newren@gmail.com","avatar":"https://avatars.githubusercontent.com/u/5455730?v=4"},"body":"On Thu, Oct 30, 2025 at 5:33 AM Christian Couder\n<christian.couder@gmail.com> wrote:\n>\n>\n> Introduction\n> ------------\n>\n> In a previous v2 patch series[1] that I sent last May, there were two\n> preparatory cleanup patches[2][3] that have been dropped in the v3 and\n> next versions. I think these two cleanup patches are worth resending\n> in their own series though.\n>\n> While at cleaning things up, I realized that, when working in this\n> area of the code, I have often been annoyed by the fact that few error\n> and warning messages were marked for translation. So I decided to also\n> address this here.\n>\n> So patches 1/5 and 2/5 are small code cleanups that are resent, while\n> patches 3/5, 4/5 and 5/5 are about marking strings for translation.\n>\n> [1] https://lore.kernel.org/git/20250526103314.1542316-1-christian.couder@gmail.com/\n> [2] https://lore.kernel.org/git/20250526103314.1542316-2-christian.couder@gmail.com/\n> [3] https://lore.kernel.org/git/20250526103314.1542316-3-christian.couder@gmail.com/\n\nThese all look like simple sensible fixes to me.  The only problem I\nfound looking over the patch is that you undersell the benefits of one\nof the changes in the commit message, but that's not even really a\nproblem.\n\nSeries looks good to me.\n"},{"id":"530062","messageId":"CAP8UFD0ZV56pRtOBUT-d7=n_Eyu0Pbzy3+i7v_p=OrqRMB6zYg@mail.gmail.com","threadId":"64397","inReplyTo":"CABPp-BG_PhbFOS-Tre249nzMyc5YGK1yHMVgo8XGMq7Y4LewWw@mail.gmail.com","subject":"Re: [PATCH v2 0/5] fast-export/import: cleanups and translation","fromName":"Christian Couder","fromEmail":"christian.couder@gmail.com","sentAt":"2025-11-01T15:16:24Z","receivedAt":"2025-11-01T15:16:37Z","isPatch":true,"sender":{"key":"christian.couder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/208954?v=4"},"body":"On Fri, Oct 31, 2025 at 8:37 PM Elijah Newren <newren@gmail.com> wrote:\n\n> These all look like simple sensible fixes to me.  The only problem I\n> found looking over the patch is that you undersell the benefits of one\n> of the changes in the commit message, but that's not even really a\n> problem.\n>\n> Series looks good to me.\n\nThanks for your review!\n"}]}