{"thread":{"id":"26561","subject":"[PATCH 00/72] No-op C gettext wrappers","startedAt":"2011-02-19T19:23:43Z","lastAt":"2011-02-27T19:14:11Z","messageCount":222,"participants":["Ævar Arnfjörð Bjarmason","Jonathan Nieder","Erik Faye-Lund","Junio C Hamano","Jakub Narebski","Piotr Krukowiecki"],"isPatch":true,"patchVersion":1,"patchTotal":72},"messages":[{"id":"161641","messageId":"1298143495-3681-1-git-send-email-avarab@gmail.com","threadId":"26561","inReplyTo":null,"subject":"[PATCH 00/72] No-op C gettext wrappers","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2011-02-19T19:23:43Z","receivedAt":"2011-02-19T19:23:43Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"As discussed on-list previously I'm remaking the gettext series in a\nform that'll be easier to swallow. This series is what's at the start\nof my own ab/i18n branch hosted at git://github.com/avar/git.git.\n\nIt only does these:\n\n * A skeleton no-op gettext.h wrapper that does nothing\n * Marking up of the relevant source messages so they can be translated\n * Marking up and changing tests that would break under\n   GETTEXT_POISON=YesPlease\n\nAfter this is in I'll submit similar no-op wrappers and gettextization\nof the *.sh and *.perl files I have gettextized in ab/i18n, after that\nI'll be trying to get the remaining bits of ab/i18n in, which'll be:\n\n * The actual C, Shell and Perl gettext implementation + tests\n * Documentation on how to translate things\n * po/*.po files containing translations\n\nÆvar Arnfjörð Bjarmason (72):\n  gettext.h: add no-op _() and N_() wrappers\n  cache.h: include gettext.h\n  t/test-lib.sh: add always-set NO_GETTEXT_POISON prerequisite\n  gettextize: git-init basic messages\n  gettextize: git-init \"Initialized [...] repository\" message\n  gettextize: git-clone basic messages\n  gettextize: git-clone \"Cloning into\" message\n  gettextize: git-add basic messages\n  gettextize: git-add \"no files added\" message\n  gettextize: git-add \"Use -f if you really want\" message\n  gettextize: git-add \"pathspec [...] did not match\" message\n  gettextize: git-add \"remove '%s'\" message\n  gettextize: git-add refresh_index message\n  gettextize: git-branch basic messages\n  gettextize: git-branch \"remote branch '%s' not found\" message\n  gettextize: git-branch \"Deleted branch [...]\" message\n  gettextize: git-branch \"git branch -v\" messages\n  gettextize: git-branch \"(no branch)\" message\n  gettextize: git-checkout basic messages\n  gettextize: git-checkout: our/their version message\n  gettextize: git-checkout describe_detached_head messages\n  gettextize: git-checkout \"HEAD is now at\" message\n  gettextize: git-checkout \"Switched to a .. branch\" message\n  gettextize: git-commit basic messages\n  gettextize: git-commit \"middle of a merge\" message\n  gettextize: git-commit formatting messages\n  gettextize: git-commit print_summary messages\n  gettextize: git-commit \"enter the commit message\" message\n  gettextize: git-commit advice messages\n  gettextize: git-diff basic messages\n  gettextize: git-fetch basic messages\n  gettextize: git-fetch formatting messages\n  gettextize: git-fetch update_local_ref messages\n  gettextize: git-fetch split up \"(non-fast-forward)\" message\n  gettextize: git-grep basic messages\n  gettextize: git-grep \"--open-files-in-pager\" message\n  gettextize: git-log basic messages\n  gettextize: git-log \"--OPT does not make sense\" messages\n  gettextize: git-merge basic messages\n  gettextize: git-merge \"Updating %s..%s\" message\n  gettextize: git-merge \"You have not concluded your merge\" messages\n  gettextize: git-merge \"Wonderful\" message\n  gettextize: git-mv basic messages\n  gettextize: git-mv \"bad\" messages\n  gettextize: git-rm basic messages\n  gettextize: git-reset basic messages\n  gettextize: git-reset reset_type_names messages\n  gettextize: git-reset \"Unstaged changes after reset\" message\n  gettextize: git-tag basic messages\n  gettextize: git-tag tag_template message\n  gettextize: git-push basic messages\n  gettextize: git-push \"prevent you from losing\" message\n  gettextize: git-status basic messages\n  gettextize: git-status \"nothing to commit\" messages\n  gettextize: git-status shortstatus messages\n  gettextize: git-status \"Changes to be committed\" message\n  gettextize: git-status \"Initial commit\" message\n  gettextize: git-status \"renamed: \" message\n  gettextize: git-archive basic messages\n  gettextize: git-bundle basic messages\n  gettextize: git-clean basic messages\n  gettextize: git-clean clean.requireForce messages\n  gettextize: git-describe basic messages\n  gettextize: git-gc basic messages\n  gettextize: git-gc \"Auto packing the repository\" message\n  gettextize: git-notes basic commands\n  gettextize: git-notes GIT_NOTES_REWRITE_MODE error message\n  gettextize: git-revert basic messages\n  gettextize: git-revert \"Your local changes\" message\n  gettextize: git-revert literal \"me\" messages\n  gettextize: git-revert split up \"could not revert/apply\" message\n  gettextize: git-shortlog basic messages\n\n builtin/add.c                    |   46 ++++++------\n builtin/archive.c                |   14 ++--\n builtin/branch.c                 |   69 ++++++++--------\n builtin/bundle.c                 |    6 +-\n builtin/checkout.c               |   93 +++++++++++-----------\n builtin/clean.c                  |   33 +++++---\n builtin/clone.c                  |   63 ++++++++-------\n builtin/commit.c                 |  162 +++++++++++++++++++-------------------\n builtin/describe.c               |   36 ++++----\n builtin/diff.c                   |   18 ++--\n builtin/fetch.c                  |   82 ++++++++++----------\n builtin/gc.c                     |   24 +++---\n builtin/grep.c                   |   34 ++++----\n builtin/init-db.c                |   58 +++++++------\n builtin/log.c                    |   68 ++++++++--------\n builtin/merge.c                  |  128 +++++++++++++++---------------\n builtin/mv.c                     |   32 ++++----\n builtin/notes.c                  |  112 +++++++++++++-------------\n builtin/push.c                   |   42 +++++-----\n builtin/reset.c                  |   42 +++++-----\n builtin/revert.c                 |   76 ++++++++++--------\n builtin/rm.c                     |   22 +++---\n builtin/shortlog.c               |    8 +-\n builtin/tag.c                    |   66 ++++++++--------\n cache.h                          |    1 +\n gettext.h                        |    9 ++\n t/lib-httpd.sh                   |    2 +-\n t/t0001-init.sh                  |    2 +-\n t/t1200-tutorial.sh              |    5 +-\n t/t2200-add-update.sh            |    2 +-\n t/t2204-add-ignored.sh           |   37 ++++++---\n t/t3030-merge-recursive.sh       |    2 +-\n t/t3200-branch.sh                |    2 +-\n t/t3203-branch-output.sh         |    2 +-\n t/t3501-revert-cherry-pick.sh    |    2 +-\n t/t3507-cherry-pick-conflict.sh  |    2 +-\n t/t3700-add.sh                   |   11 ++-\n t/t4001-diff-rename.sh           |    4 +-\n t/t4014-format-patch.sh          |    2 +-\n t/t5526-fetch-submodules.sh      |   40 ++++++++--\n t/t5541-http-push.sh             |    7 +-\n t/t5601-clone.sh                 |    2 +-\n t/t6040-tracking-info.sh         |    2 +-\n t/t6120-describe.sh              |    2 +-\n t/t7004-tag.sh                   |    1 +\n t/t7012-skip-worktree-writing.sh |    4 +-\n t/t7060-wtstatus.sh              |    2 +-\n t/t7102-reset.sh                 |    2 +-\n t/t7110-reset-merge.sh           |    6 +-\n t/t7201-co.sh                    |   10 +-\n t/t7300-clean.sh                 |    6 +-\n t/t7500-commit.sh                |    8 +-\n t/t7501-commit.sh                |    7 +-\n t/t7502-commit.sh                |   60 +++++++++------\n t/t7506-status-submodule.sh      |   28 +++---\n t/t7508-status.sh                |  115 +++++++++++++++------------\n t/t7600-merge.sh                 |    2 +-\n t/t7607-merge-overwrite.sh       |   10 ++-\n t/t7611-merge-abort.sh           |   20 ++++-\n t/t7811-grep-open.sh             |    2 +-\n t/test-lib.sh                    |    5 +\n wt-status.c                      |  116 ++++++++++++++--------------\n 62 files changed, 1011 insertions(+), 865 deletions(-)\n create mode 100644 gettext.h\n\n-- \n1.7.2.3\n"},{"id":"161643","messageId":"1298143495-3681-2-git-send-email-avarab@gmail.com","threadId":"26561","inReplyTo":"1298143495-3681-1-git-send-email-avarab@gmail.com","subject":"[PATCH 01/72] gettext.h: add no-op _() and N_() wrappers","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2011-02-19T19:23:44Z","receivedAt":"2011-02-19T19:23:44Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"Add a new header called gettext.h which is currently a no-op. To split\nup the gettext series I'm first submitting patches to gettextize the\nsource tree before I add any of the Makefile and C changes needed to\nactually use them.\n\nSigned-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n gettext.h |    9 +++++++++\n 1 files changed, 9 insertions(+), 0 deletions(-)\n create mode 100644 gettext.h\n\ndiff --git a/gettext.h b/gettext.h\nnew file mode 100644\nindex 0000000..c68bbe9\n--- /dev/null\n+++ b/gettext.h\n@@ -0,0 +1,9 @@\n+/*\n+ * Copyright (c) 2010 Ævar Arnfjörð Bjarmason\n+ *\n+ * This is a skeleton no-op implementation of gettext for Git. It'll\n+ * be replaced by something that uses libintl.h and wraps gettext() in\n+ * a future patch series.\n+ */\n+#define N_(s) (s)\n+#define _(s) (s)\n-- \n1.7.2.3\n"},{"id":"161642","messageId":"1298143495-3681-3-git-send-email-avarab@gmail.com","threadId":"26561","inReplyTo":"1298143495-3681-1-git-send-email-avarab@gmail.com","subject":"[PATCH 02/72] cache.h: include gettext.h","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2011-02-19T19:23:45Z","receivedAt":"2011-02-19T19:23:45Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"Change cache.h to include gettext.h. In previous incarnations of the\ngettext series I included gettext.h in builtin.h, then changed\nbuiltin/*.c files to include that when they didn't already.\n\nIt was pointed out by Junio and others that it makes more sense to\nhave the inclusion here, since gettext is going to be used everywhere.\n\nSigned-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n cache.h |    1 +\n 1 files changed, 1 insertions(+), 0 deletions(-)\n\ndiff --git a/cache.h b/cache.h\nindex 3abf895..a465f38 100644\n--- a/cache.h\n+++ b/cache.h\n@@ -5,6 +5,7 @@\n #include \"strbuf.h\"\n #include \"hash.h\"\n #include \"advice.h\"\n+#include \"gettext.h\"\n \n #include SHA1_HEADER\n #ifndef git_SHA_CTX\n-- \n1.7.2.3\n"},{"id":"161645","messageId":"1298143495-3681-4-git-send-email-avarab@gmail.com","threadId":"26561","inReplyTo":"1298143495-3681-1-git-send-email-avarab@gmail.com","subject":"[PATCH 03/72] t/test-lib.sh: add always-set NO_GETTEXT_POISON prerequisite","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2011-02-19T19:23:46Z","receivedAt":"2011-02-19T19:23:46Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"Add a new test prerequisite called NO_GETTEXT_POISON to t/test-lib.sh\nthat's always set for now.\n\nSome of the gettextize patches that'll follow this one will change\ntheir test outputs if a functioning gettext implementation with poison\nsupport is sitting on top of them, but for now I only have harmless\nno-op wrappers in gettext.h so NO_GETTEXT_POISON can be set all the\ntime.\n\nSigned-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n t/test-lib.sh |    5 +++++\n 1 files changed, 5 insertions(+), 0 deletions(-)\n\ndiff --git a/t/test-lib.sh b/t/test-lib.sh\nindex 0fdc541..ffcfa2e 100644\n--- a/t/test-lib.sh\n+++ b/t/test-lib.sh\n@@ -1079,6 +1079,11 @@ esac\n test -z \"$NO_PERL\" && test_set_prereq PERL\n test -z \"$NO_PYTHON\" && test_set_prereq PYTHON\n \n+# Always set the NO_GETTEXT_POISON prerequisite while we don't have a\n+# real gettext implementation in Git. This will be replaced by\n+# something that varies in a future patch series.\n+test_set_prereq NO_GETTEXT_POISON\n+\n # test whether the filesystem supports symbolic links\n ln -s x y 2>/dev/null && test -h y 2>/dev/null && test_set_prereq SYMLINKS\n rm -f y\n-- \n1.7.2.3\n"},{"id":"161646","messageId":"1298143495-3681-5-git-send-email-avarab@gmail.com","threadId":"26561","inReplyTo":"1298143495-3681-1-git-send-email-avarab@gmail.com","subject":"[PATCH 04/72] gettextize: git-init basic messages","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2011-02-19T19:23:47Z","receivedAt":"2011-02-19T19:23:47Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"Change the user visible strings in init-db.c to use gettext\nlocalizations. This only converts messages which needed to be changed\nfrom \"foo\" to _(\"foo\"), and didn't need any TRANSLATORS comments.\n\nI haven't marked the messages in init_db_usage or init_db_options for\ntranslation, since that would require additional changes in\nparse-options.c. Those can be done later.\n\nSigned-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n builtin/init-db.c |   48 ++++++++++++++++++++++++------------------------\n 1 files changed, 24 insertions(+), 24 deletions(-)\n\ndiff --git a/builtin/init-db.c b/builtin/init-db.c\nindex 4f5348e..35f9f13 100644\n--- a/builtin/init-db.c\n+++ b/builtin/init-db.c\n@@ -31,7 +31,7 @@ static void safe_create_dir(const char *dir, int share)\n \t\t}\n \t}\n \telse if (share && adjust_shared_perm(dir))\n-\t\tdie(\"Could not make %s writable by group\", dir);\n+\t\tdie(_(\"Could not make %s writable by group\"), dir);\n }\n \n static void copy_templates_1(char *path, int baselen,\n@@ -58,25 +58,25 @@ static void copy_templates_1(char *path, int baselen,\n \t\tnamelen = strlen(de->d_name);\n \t\tif ((PATH_MAX <= baselen + namelen) ||\n \t\t    (PATH_MAX <= template_baselen + namelen))\n-\t\t\tdie(\"insanely long template name %s\", de->d_name);\n+\t\t\tdie(_(\"insanely long template name %s\"), de->d_name);\n \t\tmemcpy(path + baselen, de->d_name, namelen+1);\n \t\tmemcpy(template + template_baselen, de->d_name, namelen+1);\n \t\tif (lstat(path, &st_git)) {\n \t\t\tif (errno != ENOENT)\n-\t\t\t\tdie_errno(\"cannot stat '%s'\", path);\n+\t\t\t\tdie_errno(_(\"cannot stat '%s'\"), path);\n \t\t}\n \t\telse\n \t\t\texists = 1;\n \n \t\tif (lstat(template, &st_template))\n-\t\t\tdie_errno(\"cannot stat template '%s'\", template);\n+\t\t\tdie_errno(_(\"cannot stat template '%s'\"), template);\n \n \t\tif (S_ISDIR(st_template.st_mode)) {\n \t\t\tDIR *subdir = opendir(template);\n \t\t\tint baselen_sub = baselen + namelen;\n \t\t\tint template_baselen_sub = template_baselen + namelen;\n \t\t\tif (!subdir)\n-\t\t\t\tdie_errno(\"cannot opendir '%s'\", template);\n+\t\t\t\tdie_errno(_(\"cannot opendir '%s'\"), template);\n \t\t\tpath[baselen_sub++] =\n \t\t\t\ttemplate[template_baselen_sub++] = '/';\n \t\t\tpath[baselen_sub] =\n@@ -93,20 +93,20 @@ static void copy_templates_1(char *path, int baselen,\n \t\t\tint len;\n \t\t\tlen = readlink(template, lnk, sizeof(lnk));\n \t\t\tif (len < 0)\n-\t\t\t\tdie_errno(\"cannot readlink '%s'\", template);\n+\t\t\t\tdie_errno(_(\"cannot readlink '%s'\"), template);\n \t\t\tif (sizeof(lnk) <= len)\n-\t\t\t\tdie(\"insanely long symlink %s\", template);\n+\t\t\t\tdie(_(\"insanely long symlink %s\"), template);\n \t\t\tlnk[len] = 0;\n \t\t\tif (symlink(lnk, path))\n-\t\t\t\tdie_errno(\"cannot symlink '%s' '%s'\", lnk, path);\n+\t\t\t\tdie_errno(_(\"cannot symlink '%s' '%s'\"), lnk, path);\n \t\t}\n \t\telse if (S_ISREG(st_template.st_mode)) {\n \t\t\tif (copy_file(path, template, st_template.st_mode))\n-\t\t\t\tdie_errno(\"cannot copy '%s' to '%s'\", template,\n+\t\t\t\tdie_errno(_(\"cannot copy '%s' to '%s'\"), template,\n \t\t\t\t\t  path);\n \t\t}\n \t\telse\n-\t\t\terror(\"ignoring template %s\", template);\n+\t\t\terror(_(\"ignoring template %s\"), template);\n \t}\n }\n \n@@ -129,7 +129,7 @@ static void copy_templates(const char *template_dir)\n \t\treturn;\n \ttemplate_len = strlen(template_dir);\n \tif (PATH_MAX <= (template_len+strlen(\"/config\")))\n-\t\tdie(\"insanely long template path %s\", template_dir);\n+\t\tdie(_(\"insanely long template path %s\"), template_dir);\n \tstrcpy(template_path, template_dir);\n \tif (template_path[template_len-1] != '/') {\n \t\ttemplate_path[template_len++] = '/';\n@@ -137,7 +137,7 @@ static void copy_templates(const char *template_dir)\n \t}\n \tdir = opendir(template_path);\n \tif (!dir) {\n-\t\twarning(\"templates not found %s\", template_dir);\n+\t\twarning(_(\"templates not found %s\"), template_dir);\n \t\treturn;\n \t}\n \n@@ -150,8 +150,8 @@ static void copy_templates(const char *template_dir)\n \n \tif (repository_format_version &&\n \t    repository_format_version != GIT_REPO_VERSION) {\n-\t\twarning(\"not copying templates of \"\n-\t\t\t\"a wrong format version %d from '%s'\",\n+\t\twarning(_(\"not copying templates of \"\n+\t\t\t\"a wrong format version %d from '%s'\"),\n \t\t\trepository_format_version,\n \t\t\ttemplate_dir);\n \t\tclosedir(dir);\n@@ -188,7 +188,7 @@ static int create_default_files(const char *template_path)\n \tint filemode;\n \n \tif (len > sizeof(path)-50)\n-\t\tdie(\"insane git directory %s\", git_dir);\n+\t\tdie(_(\"insane git directory %s\"), git_dir);\n \tmemcpy(path, git_dir, len);\n \n \tif (len && path[len-1] != '/')\n@@ -346,7 +346,7 @@ int init_db(const char *template_dir, unsigned int flags)\n \t\telse if (shared_repository == PERM_EVERYBODY)\n \t\t\tsprintf(buf, \"%d\", OLD_PERM_EVERYBODY);\n \t\telse\n-\t\t\tdie(\"oops\");\n+\t\t\tdie(_(\"oops\"));\n \t\tgit_config_set(\"core.sharedrepository\", buf);\n \t\tgit_config_set(\"receive.denyNonFastforwards\", \"true\");\n \t}\n@@ -375,7 +375,7 @@ static int guess_repository_type(const char *git_dir)\n \tif (!strcmp(\".\", git_dir))\n \t\treturn 1;\n \tif (!getcwd(cwd, sizeof(cwd)))\n-\t\tdie_errno(\"cannot tell cwd\");\n+\t\tdie_errno(_(\"cannot tell cwd\"));\n \tif (!strcmp(git_dir, cwd))\n \t\treturn 1;\n \t/*\n@@ -450,18 +450,18 @@ int cmd_init_db(int argc, const char **argv, const char *prefix)\n \t\t\t\t\terrno = EEXIST;\n \t\t\t\t\t/* fallthru */\n \t\t\t\tcase -1:\n-\t\t\t\t\tdie_errno(\"cannot mkdir %s\", argv[0]);\n+\t\t\t\t\tdie_errno(_(\"cannot mkdir %s\"), argv[0]);\n \t\t\t\t\tbreak;\n \t\t\t\tdefault:\n \t\t\t\t\tbreak;\n \t\t\t\t}\n \t\t\t\tshared_repository = saved;\n \t\t\t\tif (mkdir(argv[0], 0777) < 0)\n-\t\t\t\t\tdie_errno(\"cannot mkdir %s\", argv[0]);\n+\t\t\t\t\tdie_errno(_(\"cannot mkdir %s\"), argv[0]);\n \t\t\t\tmkdir_tried = 1;\n \t\t\t\tgoto retry;\n \t\t\t}\n-\t\t\tdie_errno(\"cannot chdir to %s\", argv[0]);\n+\t\t\tdie_errno(_(\"cannot chdir to %s\"), argv[0]);\n \t\t}\n \t} else if (0 < argc) {\n \t\tusage(init_db_usage[0]);\n@@ -483,8 +483,8 @@ int cmd_init_db(int argc, const char **argv, const char *prefix)\n \tgit_dir = getenv(GIT_DIR_ENVIRONMENT);\n \twork_tree = getenv(GIT_WORK_TREE_ENVIRONMENT);\n \tif ((!git_dir || is_bare_repository_cfg == 1) && work_tree)\n-\t\tdie(\"%s (or --work-tree=<directory>) not allowed without \"\n-\t\t    \"specifying %s (or --git-dir=<directory>)\",\n+\t\tdie(_(\"%s (or --work-tree=<directory>) not allowed without \"\n+\t\t\t  \"specifying %s (or --git-dir=<directory>)\"),\n \t\t    GIT_WORK_TREE_ENVIRONMENT,\n \t\t    GIT_DIR_ENVIRONMENT);\n \n@@ -509,14 +509,14 @@ int cmd_init_db(int argc, const char **argv, const char *prefix)\n \t\tif (!git_work_tree_cfg) {\n \t\t\tgit_work_tree_cfg = xcalloc(PATH_MAX, 1);\n \t\t\tif (!getcwd(git_work_tree_cfg, PATH_MAX))\n-\t\t\t\tdie_errno (\"Cannot access current working directory\");\n+\t\t\t\tdie_errno (_(\"Cannot access current working directory\"));\n \t\t}\n \t\tif (work_tree)\n \t\t\tset_git_work_tree(make_absolute_path(work_tree));\n \t\telse\n \t\t\tset_git_work_tree(git_work_tree_cfg);\n \t\tif (access(get_git_work_tree(), X_OK))\n-\t\t\tdie_errno (\"Cannot access work tree '%s'\",\n+\t\t\tdie_errno (_(\"Cannot access work tree '%s'\"),\n \t\t\t\t   get_git_work_tree());\n \t}\n \telse {\n-- \n1.7.2.3\n"},{"id":"161644","messageId":"1298143495-3681-6-git-send-email-avarab@gmail.com","threadId":"26561","inReplyTo":"1298143495-3681-1-git-send-email-avarab@gmail.com","subject":"[PATCH 05/72] gettextize: git-init \"Initialized [...] repository\" message","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2011-02-19T19:23:48Z","receivedAt":"2011-02-19T19:23:48Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"Change the git-init \"Initialized empty Git repository\" message and its\nvariants to use gettext.\n\nThis is one of the messages that could do with splitting up, I had a\nWIP patch to do that that began like this:\n\n    const char *reinit_shared   = _(\"Reinitialized existing shared Git repository in %s\\n\");\n    const char *init_shared\t    = _(\"Initialized empty shared Git repository in %s\\n\");\n    const char *reinit_noshared = _(\"Reinitialized existing Git repository in %s\\n\");\n    const char *init_noshared   = _(\"Initialized empty Git repository in %s\\n\");\n\nBut in the first round of gettextization I'm aiming to keep code\nchanges to a minimum for ease of review.\n\nWe can solicit input from translators about which messages that use\ntoo much sprintf-ing are troublesome, and change those later.\n\nNote that the TRANSLATORS comment doesn't use the usual Git\nstyle. This is because everything from \"/* TRANSLATORS: \" to \"*/\" will\nextracted as-is xgettext(1) and presented to translators, including\nnewlines and leading \"*\"'s. There seems to be no way to change that,\nshort of patching xgettext itself.\n\nSigned-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n builtin/init-db.c |   10 +++++++---\n t/t0001-init.sh   |    2 +-\n 2 files changed, 8 insertions(+), 4 deletions(-)\n\ndiff --git a/builtin/init-db.c b/builtin/init-db.c\nindex 35f9f13..67462ad 100644\n--- a/builtin/init-db.c\n+++ b/builtin/init-db.c\n@@ -354,9 +354,13 @@ int init_db(const char *template_dir, unsigned int flags)\n \tif (!(flags & INIT_DB_QUIET)) {\n \t\tconst char *git_dir = get_git_dir();\n \t\tint len = strlen(git_dir);\n-\t\tprintf(\"%s%s Git repository in %s%s\\n\",\n-\t\t       reinit ? \"Reinitialized existing\" : \"Initialized empty\",\n-\t\t       shared_repository ? \" shared\" : \"\",\n+\n+\t\t/* TRANSLATORS: The first '%s' is either \"Reinitialized\n+\t\t   existing\" or \"Initialized empty\", the second \" shared\" or\n+\t\t   \"\", and the last '%s%s' is the verbatim directory name. */\n+\t\tprintf(_(\"%s%s Git repository in %s%s\\n\"),\n+\t\t       reinit ? _(\"Reinitialized existing\") : _(\"Initialized empty\"),\n+\t\t       shared_repository ? _(\" shared\") : \"\",\n \t\t       git_dir, len && git_dir[len-1] != '/' ? \"/\" : \"\");\n \t}\n \ndiff --git a/t/t0001-init.sh b/t/t0001-init.sh\nindex f684993..4235ad4 100755\n--- a/t/t0001-init.sh\n+++ b/t/t0001-init.sh\n@@ -180,7 +180,7 @@ test_expect_success 'GIT_DIR & GIT_WORK_TREE (2)' '\n \tfi\n '\n \n-test_expect_success 'reinit' '\n+test_expect_success NO_GETTEXT_POISON 'reinit' '\n \n \t(\n \t\tsane_unset GIT_CONFIG GIT_WORK_TREE GIT_CONFIG &&\n-- \n1.7.2.3\n"},{"id":"161647","messageId":"1298143495-3681-7-git-send-email-avarab@gmail.com","threadId":"26561","inReplyTo":"1298143495-3681-1-git-send-email-avarab@gmail.com","subject":"[PATCH 06/72] gettextize: git-clone basic messages","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2011-02-19T19:23:49Z","receivedAt":"2011-02-19T19:23:49Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n builtin/clone.c |   54 +++++++++++++++++++++++++++---------------------------\n 1 files changed, 27 insertions(+), 27 deletions(-)\n\ndiff --git a/builtin/clone.c b/builtin/clone.c\nindex 60d9a64..f46d09b 100644\n--- a/builtin/clone.c\n+++ b/builtin/clone.c\n@@ -208,7 +208,7 @@ static void setup_reference(const char *repo)\n \tif (is_directory(mkpath(\"%s/.git/objects\", ref_git)))\n \t\tref_git = mkpath(\"%s/.git\", ref_git);\n \telse if (!is_directory(mkpath(\"%s/objects\", ref_git)))\n-\t\tdie(\"reference repository '%s' is not a local directory.\",\n+\t\tdie(_(\"reference repository '%s' is not a local directory.\"),\n \t\t    option_reference);\n \n \tref_git_copy = xstrdup(ref_git);\n@@ -235,15 +235,15 @@ static void copy_or_link_directory(struct strbuf *src, struct strbuf *dest)\n \n \tdir = opendir(src->buf);\n \tif (!dir)\n-\t\tdie_errno(\"failed to open '%s'\", src->buf);\n+\t\tdie_errno(_(\"failed to open '%s'\"), src->buf);\n \n \tif (mkdir(dest->buf, 0777)) {\n \t\tif (errno != EEXIST)\n-\t\t\tdie_errno(\"failed to create directory '%s'\", dest->buf);\n+\t\t\tdie_errno(_(\"failed to create directory '%s'\"), dest->buf);\n \t\telse if (stat(dest->buf, &buf))\n-\t\t\tdie_errno(\"failed to stat '%s'\", dest->buf);\n+\t\t\tdie_errno(_(\"failed to stat '%s'\"), dest->buf);\n \t\telse if (!S_ISDIR(buf.st_mode))\n-\t\t\tdie(\"%s exists and is not a directory\", dest->buf);\n+\t\t\tdie(_(\"%s exists and is not a directory\"), dest->buf);\n \t}\n \n \tstrbuf_addch(src, '/');\n@@ -257,7 +257,7 @@ static void copy_or_link_directory(struct strbuf *src, struct strbuf *dest)\n \t\tstrbuf_setlen(dest, dest_len);\n \t\tstrbuf_addstr(dest, de->d_name);\n \t\tif (stat(src->buf, &buf)) {\n-\t\t\twarning (\"failed to stat %s\\n\", src->buf);\n+\t\t\twarning (_(\"failed to stat %s\\n\"), src->buf);\n \t\t\tcontinue;\n \t\t}\n \t\tif (S_ISDIR(buf.st_mode)) {\n@@ -267,16 +267,16 @@ static void copy_or_link_directory(struct strbuf *src, struct strbuf *dest)\n \t\t}\n \n \t\tif (unlink(dest->buf) && errno != ENOENT)\n-\t\t\tdie_errno(\"failed to unlink '%s'\", dest->buf);\n+\t\t\tdie_errno(_(\"failed to unlink '%s'\"), dest->buf);\n \t\tif (!option_no_hardlinks) {\n \t\t\tif (!link(src->buf, dest->buf))\n \t\t\t\tcontinue;\n \t\t\tif (option_local)\n-\t\t\t\tdie_errno(\"failed to create link '%s'\", dest->buf);\n+\t\t\t\tdie_errno(_(\"failed to create link '%s'\"), dest->buf);\n \t\t\toption_no_hardlinks = 1;\n \t\t}\n \t\tif (copy_file_with_time(dest->buf, src->buf, 0666))\n-\t\t\tdie_errno(\"failed to copy file to '%s'\", dest->buf);\n+\t\t\tdie_errno(_(\"failed to copy file to '%s'\"), dest->buf);\n \t}\n \tclosedir(dir);\n }\n@@ -305,7 +305,7 @@ static const struct ref *clone_local(const char *src_repo,\n \tret = transport_get_remote_refs(transport);\n \ttransport_disconnect(transport);\n \tif (0 <= option_verbosity)\n-\t\tprintf(\"done.\\n\");\n+\t\tprintf(_(\"done.\\n\"));\n \treturn ret;\n }\n \n@@ -387,11 +387,11 @@ int cmd_clone(int argc, const char **argv, const char *prefix)\n \t\t\t     builtin_clone_usage, 0);\n \n \tif (argc > 2)\n-\t\tusage_msg_opt(\"Too many arguments.\",\n+\t\tusage_msg_opt(_(\"Too many arguments.\"),\n \t\t\tbuiltin_clone_usage, builtin_clone_options);\n \n \tif (argc == 0)\n-\t\tusage_msg_opt(\"You must specify a repository to clone.\",\n+\t\tusage_msg_opt(_(\"You must specify a repository to clone.\"),\n \t\t\tbuiltin_clone_usage, builtin_clone_options);\n \n \tif (option_mirror)\n@@ -399,7 +399,7 @@ int cmd_clone(int argc, const char **argv, const char *prefix)\n \n \tif (option_bare) {\n \t\tif (option_origin)\n-\t\t\tdie(\"--bare and --origin %s options are incompatible.\",\n+\t\t\tdie(_(\"--bare and --origin %s options are incompatible.\"),\n \t\t\t    option_origin);\n \t\toption_no_checkout = 1;\n \t}\n@@ -418,7 +418,7 @@ int cmd_clone(int argc, const char **argv, const char *prefix)\n \t\trepo = repo_name;\n \tis_local = path && !is_bundle;\n \tif (is_local && option_depth)\n-\t\twarning(\"--depth is ignored in local clones; use file:// instead.\");\n+\t\twarning(_(\"--depth is ignored in local clones; use file:// instead.\"));\n \n \tif (argc == 2)\n \t\tdir = xstrdup(argv[1]);\n@@ -428,8 +428,8 @@ int cmd_clone(int argc, const char **argv, const char *prefix)\n \n \tdest_exists = !stat(dir, &buf);\n \tif (dest_exists && !is_empty_dir(dir))\n-\t\tdie(\"destination path '%s' already exists and is not \"\n-\t\t\t\"an empty directory.\", dir);\n+\t\tdie(_(\"destination path '%s' already exists and is not \"\n+\t\t\t\"an empty directory.\"), dir);\n \n \tstrbuf_addf(&reflog_msg, \"clone: from %s\", repo);\n \n@@ -438,7 +438,7 @@ int cmd_clone(int argc, const char **argv, const char *prefix)\n \telse {\n \t\twork_tree = getenv(\"GIT_WORK_TREE\");\n \t\tif (work_tree && !stat(work_tree, &buf))\n-\t\t\tdie(\"working tree '%s' already exists.\", work_tree);\n+\t\t\tdie(_(\"working tree '%s' already exists.\"), work_tree);\n \t}\n \n \tif (option_bare || work_tree)\n@@ -451,10 +451,10 @@ int cmd_clone(int argc, const char **argv, const char *prefix)\n \tif (!option_bare) {\n \t\tjunk_work_tree = work_tree;\n \t\tif (safe_create_leading_directories_const(work_tree) < 0)\n-\t\t\tdie_errno(\"could not create leading directories of '%s'\",\n+\t\t\tdie_errno(_(\"could not create leading directories of '%s'\"),\n \t\t\t\t  work_tree);\n \t\tif (!dest_exists && mkdir(work_tree, 0755))\n-\t\t\tdie_errno(\"could not create work tree dir '%s'.\",\n+\t\t\tdie_errno(_(\"could not create work tree dir '%s'.\"),\n \t\t\t\t  work_tree);\n \t\tset_git_work_tree(work_tree);\n \t}\n@@ -465,7 +465,7 @@ int cmd_clone(int argc, const char **argv, const char *prefix)\n \tsetenv(CONFIG_ENVIRONMENT, mkpath(\"%s/config\", git_dir), 1);\n \n \tif (safe_create_leading_directories_const(git_dir) < 0)\n-\t\tdie(\"could not create leading directories of '%s'\", git_dir);\n+\t\tdie(_(\"could not create leading directories of '%s'\"), git_dir);\n \tset_git_dir(make_absolute_path(git_dir));\n \n \tif (0 <= option_verbosity)\n@@ -527,7 +527,7 @@ int cmd_clone(int argc, const char **argv, const char *prefix)\n \t\ttransport = transport_get(remote, remote->url[0]);\n \n \t\tif (!transport->get_refs_list || !transport->fetch)\n-\t\t\tdie(\"Don't know how to clone %s\", transport->url);\n+\t\t\tdie(_(\"Don't know how to clone %s\"), transport->url);\n \n \t\ttransport_set_option(transport, TRANS_OPT_KEEP, \"yes\");\n \n@@ -566,8 +566,8 @@ int cmd_clone(int argc, const char **argv, const char *prefix)\n \t\t\tstrbuf_release(&head);\n \n \t\t\tif (!our_head_points_at) {\n-\t\t\t\twarning(\"Remote branch %s not found in \"\n-\t\t\t\t\t\"upstream %s, using HEAD instead\",\n+\t\t\t\twarning(_(\"Remote branch %s not found in \"\n+\t\t\t\t\t\"upstream %s, using HEAD instead\"),\n \t\t\t\t\toption_branch, option_origin);\n \t\t\t\tour_head_points_at = remote_head_points_at;\n \t\t\t}\n@@ -576,7 +576,7 @@ int cmd_clone(int argc, const char **argv, const char *prefix)\n \t\t\tour_head_points_at = remote_head_points_at;\n \t}\n \telse {\n-\t\twarning(\"You appear to have cloned an empty repository.\");\n+\t\twarning(_(\"You appear to have cloned an empty repository.\"));\n \t\tour_head_points_at = NULL;\n \t\tremote_head_points_at = NULL;\n \t\tremote_head = NULL;\n@@ -618,8 +618,8 @@ int cmd_clone(int argc, const char **argv, const char *prefix)\n \t} else {\n \t\t/* Nothing to checkout out */\n \t\tif (!option_no_checkout)\n-\t\t\twarning(\"remote HEAD refers to nonexistent ref, \"\n-\t\t\t\t\"unable to checkout.\\n\");\n+\t\t\twarning(_(\"remote HEAD refers to nonexistent ref, \"\n+\t\t\t\t\"unable to checkout.\\n\"));\n \t\toption_no_checkout = 1;\n \t}\n \n@@ -655,7 +655,7 @@ int cmd_clone(int argc, const char **argv, const char *prefix)\n \n \t\tif (write_cache(fd, active_cache, active_nr) ||\n \t\t    commit_locked_index(lock_file))\n-\t\t\tdie(\"unable to write new index file\");\n+\t\t\tdie(_(\"unable to write new index file\"));\n \n \t\terr |= run_hook(NULL, \"post-checkout\", sha1_to_hex(null_sha1),\n \t\t\t\tsha1_to_hex(our_head_points_at->old_sha1), \"1\",\n-- \n1.7.2.3\n"},{"id":"161648","messageId":"1298143495-3681-8-git-send-email-avarab@gmail.com","threadId":"26561","inReplyTo":"1298143495-3681-1-git-send-email-avarab@gmail.com","subject":"[PATCH 07/72] gettextize: git-clone \"Cloning into\" message","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2011-02-19T19:23:50Z","receivedAt":"2011-02-19T19:23:50Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"Split up the \"Cloning into %s\" and \"Cloning into bare repository %s\"\nmessages to make them easier to translate.\n\nSigned-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n builtin/clone.c  |    9 ++++++---\n t/t5601-clone.sh |    2 +-\n 2 files changed, 7 insertions(+), 4 deletions(-)\n\ndiff --git a/builtin/clone.c b/builtin/clone.c\nindex f46d09b..dffcf80 100644\n--- a/builtin/clone.c\n+++ b/builtin/clone.c\n@@ -468,9 +468,12 @@ int cmd_clone(int argc, const char **argv, const char *prefix)\n \t\tdie(_(\"could not create leading directories of '%s'\"), git_dir);\n \tset_git_dir(make_absolute_path(git_dir));\n \n-\tif (0 <= option_verbosity)\n-\t\tprintf(\"Cloning into %s%s...\\n\",\n-\t\t       option_bare ? \"bare repository \" : \"\", dir);\n+\tif (0 <= option_verbosity) {\n+\t\tif (option_bare)\n+\t\t\tprintf(_(\"Cloning into bare repository %s\\n\"), dir);\n+\t\telse\n+\t\t\tprintf(_(\"Cloning into %s\\n\"), dir);\n+\t}\n \tinit_db(option_template, INIT_DB_QUIET);\n \n \t/*\ndiff --git a/t/t5601-clone.sh b/t/t5601-clone.sh\nindex 987e0c8..ecb499d 100755\n--- a/t/t5601-clone.sh\n+++ b/t/t5601-clone.sh\n@@ -31,7 +31,7 @@ test_expect_success 'clone with excess parameters (2)' '\n \n '\n \n-test_expect_success 'output from clone' '\n+test_expect_success NO_GETTEXT_POISON 'output from clone' '\n \trm -fr dst &&\n \tgit clone -n \"file://$(pwd)/src\" dst >output &&\n \ttest $(grep Clon output | wc -l) = 1\n-- \n1.7.2.3\n"},{"id":"161649","messageId":"1298143495-3681-9-git-send-email-avarab@gmail.com","threadId":"26561","inReplyTo":"1298143495-3681-1-git-send-email-avarab@gmail.com","subject":"[PATCH 08/72] gettextize: git-add basic messages","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2011-02-19T19:23:51Z","receivedAt":"2011-02-19T19:23:51Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n builtin/add.c |   36 ++++++++++++++++++------------------\n 1 files changed, 18 insertions(+), 18 deletions(-)\n\ndiff --git a/builtin/add.c b/builtin/add.c\nindex 42c906e..a9a78f4 100644\n--- a/builtin/add.c\n+++ b/builtin/add.c\n@@ -38,7 +38,7 @@ static void update_callback(struct diff_queue_struct *q,\n \t\tconst char *path = p->one->path;\n \t\tswitch (p->status) {\n \t\tdefault:\n-\t\t\tdie(\"unexpected diff status %c\", p->status);\n+\t\t\tdie(_(\"unexpected diff status %c\"), p->status);\n \t\tcase DIFF_STATUS_UNMERGED:\n \t\t\t/*\n \t\t\t * ADD_CACHE_IGNORE_REMOVAL is unset if \"git\n@@ -64,7 +64,7 @@ static void update_callback(struct diff_queue_struct *q,\n \t\tcase DIFF_STATUS_TYPE_CHANGED:\n \t\t\tif (add_file_to_index(&the_index, path, data->flags)) {\n \t\t\t\tif (!(data->flags & ADD_CACHE_IGNORE_ERRORS))\n-\t\t\t\t\tdie(\"updating files failed\");\n+\t\t\t\t\tdie(_(\"updating files failed\"));\n \t\t\t\tdata->add_errors++;\n \t\t\t}\n \t\t\tbreak;\n@@ -172,7 +172,7 @@ static void treat_gitlinks(const char **pathspec)\n \t\t\t\t\t/* strip trailing slash */\n \t\t\t\t\tpathspec[j] = xstrndup(ce->name, len);\n \t\t\t\telse\n-\t\t\t\t\tdie (\"Path '%s' is in submodule '%.*s'\",\n+\t\t\t\t\tdie (_(\"Path '%s' is in submodule '%.*s'\"),\n \t\t\t\t\t\tpathspec[j], len, ce->name);\n \t\t\t}\n \t\t}\n@@ -191,7 +191,7 @@ static void refresh(int verbose, const char **pathspec)\n \t\t      pathspec, seen, \"Unstaged changes after refreshing the index:\");\n \tfor (i = 0; i < specs; i++) {\n \t\tif (!seen[i])\n-\t\t\tdie(\"pathspec '%s' did not match any files\", pathspec[i]);\n+\t\t\tdie(_(\"pathspec '%s' did not match any files\"), pathspec[i]);\n \t}\n         free(seen);\n }\n@@ -205,7 +205,7 @@ static const char **validate_pathspec(int argc, const char **argv, const char *p\n \t\tfor (p = pathspec; *p; p++) {\n \t\t\tif (has_symlink_leading_path(*p, strlen(*p))) {\n \t\t\t\tint len = prefix ? strlen(prefix) : 0;\n-\t\t\t\tdie(\"'%s' is beyond a symbolic link\", *p + len);\n+\t\t\t\tdie(_(\"'%s' is beyond a symbolic link\"), *p + len);\n \t\t\t}\n \t\t}\n \t}\n@@ -272,7 +272,7 @@ static int edit_patch(int argc, const char **argv, const char *prefix)\n \tgit_config(git_diff_basic_config, NULL); /* no \"diff\" UI options */\n \n \tif (read_cache() < 0)\n-\t\tdie (\"Could not read the index\");\n+\t\tdie (_(\"Could not read the index\"));\n \n \tinit_revisions(&rev, prefix);\n \trev.diffopt.context = 7;\n@@ -281,24 +281,24 @@ static int edit_patch(int argc, const char **argv, const char *prefix)\n \trev.diffopt.output_format = DIFF_FORMAT_PATCH;\n \tout = open(file, O_CREAT | O_WRONLY, 0644);\n \tif (out < 0)\n-\t\tdie (\"Could not open '%s' for writing.\", file);\n+\t\tdie (_(\"Could not open '%s' for writing.\"), file);\n \trev.diffopt.file = xfdopen(out, \"w\");\n \trev.diffopt.close_file = 1;\n \tif (run_diff_files(&rev, 0))\n-\t\tdie (\"Could not write patch\");\n+\t\tdie (_(\"Could not write patch\"));\n \n \tlaunch_editor(file, NULL, NULL);\n \n \tif (stat(file, &st))\n-\t\tdie_errno(\"Could not stat '%s'\", file);\n+\t\tdie_errno(_(\"Could not stat '%s'\"), file);\n \tif (!st.st_size)\n-\t\tdie(\"Empty patch. Aborted.\");\n+\t\tdie(_(\"Empty patch. Aborted.\"));\n \n \tmemset(&child, 0, sizeof(child));\n \tchild.git_cmd = 1;\n \tchild.argv = apply_argv;\n \tif (run_command(&child))\n-\t\tdie (\"Could not apply '%s'\", file);\n+\t\tdie (_(\"Could not apply '%s'\"), file);\n \n \tunlink(file);\n \treturn 0;\n@@ -354,7 +354,7 @@ static int add_files(struct dir_struct *dir, int flags)\n \tfor (i = 0; i < dir->nr; i++)\n \t\tif (add_file_to_cache(dir->entries[i]->name, flags)) {\n \t\t\tif (!ignore_add_errors)\n-\t\t\t\tdie(\"adding files failed\");\n+\t\t\t\tdie(_(\"adding files failed\"));\n \t\t\texit_status = 1;\n \t\t}\n \treturn exit_status;\n@@ -386,9 +386,9 @@ int cmd_add(int argc, const char **argv, const char *prefix)\n \targv++;\n \n \tif (addremove && take_worktree_changes)\n-\t\tdie(\"-A and -u are mutually incompatible\");\n+\t\tdie(_(\"-A and -u are mutually incompatible\"));\n \tif (!show_only && ignore_missing)\n-\t\tdie(\"Option --ignore-missing can only be used together with --dry-run\");\n+\t\tdie(_(\"Option --ignore-missing can only be used together with --dry-run\"));\n \tif ((addremove || take_worktree_changes) && !argc) {\n \t\tstatic const char *here[2] = { \".\", NULL };\n \t\targc = 1;\n@@ -408,14 +408,14 @@ int cmd_add(int argc, const char **argv, const char *prefix)\n \t\t  ? ADD_CACHE_IGNORE_REMOVAL : 0));\n \n \tif (require_pathspec && argc == 0) {\n-\t\tfprintf(stderr, \"Nothing specified, nothing added.\\n\");\n-\t\tfprintf(stderr, \"Maybe you wanted to say 'git add .'?\\n\");\n+\t\tfprintf(stderr, _(\"Nothing specified, nothing added.\\n\"));\n+\t\tfprintf(stderr, _(\"Maybe you wanted to say 'git add .'?\\n\"));\n \t\treturn 0;\n \t}\n \tpathspec = validate_pathspec(argc, argv, prefix);\n \n \tif (read_cache() < 0)\n-\t\tdie(\"index file corrupt\");\n+\t\tdie(_(\"index file corrupt\"));\n \ttreat_gitlinks(pathspec);\n \n \tif (add_new_files) {\n@@ -467,7 +467,7 @@ int cmd_add(int argc, const char **argv, const char *prefix)\n \tif (active_cache_changed) {\n \t\tif (write_cache(newfd, active_cache, active_nr) ||\n \t\t    commit_locked_index(&lock_file))\n-\t\t\tdie(\"Unable to write new index file\");\n+\t\t\tdie(_(\"Unable to write new index file\"));\n \t}\n \n \treturn exit_status;\n-- \n1.7.2.3\n"},{"id":"161650","messageId":"1298143495-3681-10-git-send-email-avarab@gmail.com","threadId":"26561","inReplyTo":"1298143495-3681-1-git-send-email-avarab@gmail.com","subject":"[PATCH 09/72] gettextize: git-add \"no files added\" message","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2011-02-19T19:23:52Z","receivedAt":"2011-02-19T19:23:52Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n builtin/add.c  |    2 +-\n t/t3700-add.sh |    5 ++++-\n 2 files changed, 5 insertions(+), 2 deletions(-)\n\ndiff --git a/builtin/add.c b/builtin/add.c\nindex a9a78f4..df56429 100644\n--- a/builtin/add.c\n+++ b/builtin/add.c\n@@ -348,7 +348,7 @@ static int add_files(struct dir_struct *dir, int flags)\n \t\tfor (i = 0; i < dir->ignored_nr; i++)\n \t\t\tfprintf(stderr, \"%s\\n\", dir->ignored[i]->name);\n \t\tfprintf(stderr, \"Use -f if you really want to add them.\\n\");\n-\t\tdie(\"no files added\");\n+\t\tdie(_(\"no files added\"));\n \t}\n \n \tfor (i = 0; i < dir->nr; i++)\ndiff --git a/t/t3700-add.sh b/t/t3700-add.sh\nindex ec71083..d4fc563 100755\n--- a/t/t3700-add.sh\n+++ b/t/t3700-add.sh\n@@ -283,7 +283,10 @@ add 'track-this'\n EOF\n \n test_expect_success 'git add --dry-run --ignore-missing of non-existing file' '\n-\ttest_must_fail git add --dry-run --ignore-missing track-this ignored-file >actual.out 2>actual.err &&\n+\ttest_must_fail git add --dry-run --ignore-missing track-this ignored-file >actual.out 2>actual.err\n+'\n+\n+test_expect_success NO_GETTEXT_POISON 'git add --dry-run --ignore-missing of non-existing file output' '\n \ttest_cmp expect.out actual.out &&\n \ttest_cmp expect.err actual.err\n '\n-- \n1.7.2.3\n"},{"id":"161652","messageId":"1298143495-3681-11-git-send-email-avarab@gmail.com","threadId":"26561","inReplyTo":"1298143495-3681-1-git-send-email-avarab@gmail.com","subject":"[PATCH 10/72] gettextize: git-add \"Use -f if you really want\" message","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2011-02-19T19:23:53Z","receivedAt":"2011-02-19T19:23:53Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"Gettextize the \"Use -f if you really want to add them.\\n\"\nmessage. Tests in t2204-add-ignored.sh and t3700-add.sh explicitly\nchecked for this message. Split the tests that did so up and skip\nportion that calls grep on this message under\nGETTEXT_POISON=YesPlease.\n\nSigned-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n builtin/add.c          |    2 +-\n t/t2204-add-ignored.sh |   37 +++++++++++++++++++++++++------------\n 2 files changed, 26 insertions(+), 13 deletions(-)\n\ndiff --git a/builtin/add.c b/builtin/add.c\nindex df56429..fe4ac49 100644\n--- a/builtin/add.c\n+++ b/builtin/add.c\n@@ -347,7 +347,7 @@ static int add_files(struct dir_struct *dir, int flags)\n \t\tfprintf(stderr, ignore_error);\n \t\tfor (i = 0; i < dir->ignored_nr; i++)\n \t\t\tfprintf(stderr, \"%s\\n\", dir->ignored[i]->name);\n-\t\tfprintf(stderr, \"Use -f if you really want to add them.\\n\");\n+\t\tfprintf(stderr, _(\"Use -f if you really want to add them.\\n\"));\n \t\tdie(_(\"no files added\"));\n \t}\n \ndiff --git a/t/t2204-add-ignored.sh b/t/t2204-add-ignored.sh\nindex 24afdab..be66e2d 100755\n--- a/t/t2204-add-ignored.sh\n+++ b/t/t2204-add-ignored.sh\n@@ -31,18 +31,21 @@ do\n \t\trm -f .git/index &&\n \t\ttest_must_fail git add \"$i\" 2>err &&\n \t\tgit ls-files \"$i\" >out &&\n-\t\t! test -s out &&\n-\t\tgrep -e \"Use -f if\" err &&\n-\t\tcat err\n+\t\t! test -s out\n+\t'\n+\n+\ttest_expect_success NO_GETTEXT_POISON \"complaints for ignored $i output\" '\n+\t\tgrep -e \"Use -f if\" err\n \t'\n \n \ttest_expect_success \"complaints for ignored $i with unignored file\" '\n \t\trm -f .git/index &&\n \t\ttest_must_fail git add \"$i\" file 2>err &&\n \t\tgit ls-files \"$i\" >out &&\n-\t\t! test -s out &&\n-\t\tgrep -e \"Use -f if\" err &&\n-\t\tcat err\n+\t\t! test -s out\n+\t'\n+\ttest_expect_success NO_GETTEXT_POISON \"complaints for ignored $i with unignored file output\" '\n+\t\tgrep -e \"Use -f if\" err\n \t'\n done\n \n@@ -54,9 +57,14 @@ do\n \t\t\tcd dir &&\n \t\t\ttest_must_fail git add \"$i\" 2>err &&\n \t\t\tgit ls-files \"$i\" >out &&\n-\t\t\t! test -s out &&\n-\t\t\tgrep -e \"Use -f if\" err &&\n-\t\t\tcat err\n+\t\t\t! test -s out\n+\t\t)\n+\t'\n+\n+\ttest_expect_success NO_GETTEXT_POISON \"complaints for ignored $i in dir output\" '\n+\t\t(\n+\t\t\tcd dir &&\n+\t\t\tgrep -e \"Use -f if\" err\n \t\t)\n \t'\n done\n@@ -69,9 +77,14 @@ do\n \t\t\tcd sub &&\n \t\t\ttest_must_fail git add \"$i\" 2>err &&\n \t\t\tgit ls-files \"$i\" >out &&\n-\t\t\t! test -s out &&\n-\t\t\tgrep -e \"Use -f if\" err &&\n-\t\t\tcat err\n+\t\t\t! test -s out\n+\t\t)\n+\t'\n+\n+\ttest_expect_success NO_GETTEXT_POISON \"complaints for ignored $i in sub output\" '\n+\t\t(\n+\t\t\tcd sub &&\n+\t\t\tgrep -e \"Use -f if\" err\n \t\t)\n \t'\n done\n-- \n1.7.2.3\n"},{"id":"161651","messageId":"1298143495-3681-12-git-send-email-avarab@gmail.com","threadId":"26561","inReplyTo":"1298143495-3681-1-git-send-email-avarab@gmail.com","subject":"[PATCH 11/72] gettextize: git-add \"pathspec [...] did not match\" message","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2011-02-19T19:23:54Z","receivedAt":"2011-02-19T19:23:54Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"Gettextize the \"pathspec '%s' did not match any files\" message. A test\nin t3700-add.sh explicitly checked for this message. Change it to skip\nunder GETTEXT_POISON=YesPlease.\n\nSigned-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n builtin/add.c  |    2 +-\n t/t3700-add.sh |    6 +++++-\n 2 files changed, 6 insertions(+), 2 deletions(-)\n\ndiff --git a/builtin/add.c b/builtin/add.c\nindex fe4ac49..b3640c5 100644\n--- a/builtin/add.c\n+++ b/builtin/add.c\n@@ -451,7 +451,7 @@ int cmd_add(int argc, const char **argv, const char *prefix)\n \t\t\t\t\tif (excluded(&dir, pathspec[i], &dtype))\n \t\t\t\t\t\tdir_add_ignored(&dir, pathspec[i], strlen(pathspec[i]));\n \t\t\t\t} else\n-\t\t\t\t\tdie(\"pathspec '%s' did not match any files\",\n+\t\t\t\t\tdie(_(\"pathspec '%s' did not match any files\"),\n \t\t\t\t\t    pathspec[i]);\n \t\t\t}\n \t\t}\ndiff --git a/t/t3700-add.sh b/t/t3700-add.sh\nindex d4fc563..9507191 100755\n--- a/t/t3700-add.sh\n+++ b/t/t3700-add.sh\n@@ -269,7 +269,11 @@ test_expect_success 'git add --dry-run of existing changed file' \"\n test_expect_success 'git add --dry-run of non-existing file' \"\n \techo ignored-file >>.gitignore &&\n \ttest_must_fail git add --dry-run track-this ignored-file >actual 2>&1 &&\n-\techo \\\"fatal: pathspec 'ignored-file' did not match any files\\\" | test_cmp - actual\n+\techo \\\"fatal: pathspec 'ignored-file' did not match any files\\\" >expect\n+\"\n+\n+test_expect_success NO_GETTEXT_POISON 'git add --dry-run of an existing file output' \"\n+\ttest_cmp expect actual\n \"\n \n cat >expect.err <<\\EOF\n-- \n1.7.2.3\n"},{"id":"161654","messageId":"1298143495-3681-13-git-send-email-avarab@gmail.com","threadId":"26561","inReplyTo":"1298143495-3681-1-git-send-email-avarab@gmail.com","subject":"[PATCH 12/72] gettextize: git-add \"remove '%s'\" message","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2011-02-19T19:23:55Z","receivedAt":"2011-02-19T19:23:55Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"Gettextize the \"remove '%s'\\n\" message. A test in t2200-add-update.sh\nexplicitly checked for this message. Change it to skip under\nGETTEXT_POISON=YesPlease.\n\nSigned-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n builtin/add.c         |    2 +-\n t/t2200-add-update.sh |    2 +-\n 2 files changed, 2 insertions(+), 2 deletions(-)\n\ndiff --git a/builtin/add.c b/builtin/add.c\nindex b3640c5..e399d19 100644\n--- a/builtin/add.c\n+++ b/builtin/add.c\n@@ -74,7 +74,7 @@ static void update_callback(struct diff_queue_struct *q,\n \t\t\tif (!(data->flags & ADD_CACHE_PRETEND))\n \t\t\t\tremove_file_from_index(&the_index, path);\n \t\t\tif (data->flags & (ADD_CACHE_PRETEND|ADD_CACHE_VERBOSE))\n-\t\t\t\tprintf(\"remove '%s'\\n\", path);\n+\t\t\t\tprintf(_(\"remove '%s'\\n\"), path);\n \t\t\tbreak;\n \t\t}\n \t}\ndiff --git a/t/t2200-add-update.sh b/t/t2200-add-update.sh\nindex 0692427..64182d9 100755\n--- a/t/t2200-add-update.sh\n+++ b/t/t2200-add-update.sh\n@@ -111,7 +111,7 @@ test_expect_success 'touch and then add explicitly' '\n \n '\n \n-test_expect_success 'add -n -u should not add but just report' '\n+test_expect_success NO_GETTEXT_POISON 'add -n -u should not add but just report' '\n \n \t(\n \t\techo \"add '\\''check'\\''\" &&\n-- \n1.7.2.3\n"},{"id":"161655","messageId":"1298143495-3681-14-git-send-email-avarab@gmail.com","threadId":"26561","inReplyTo":"1298143495-3681-1-git-send-email-avarab@gmail.com","subject":"[PATCH 13/72] gettextize: git-add refresh_index message","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2011-02-19T19:23:56Z","receivedAt":"2011-02-19T19:23:56Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n builtin/add.c |    2 +-\n 1 files changed, 1 insertions(+), 1 deletions(-)\n\ndiff --git a/builtin/add.c b/builtin/add.c\nindex e399d19..3e75460 100644\n--- a/builtin/add.c\n+++ b/builtin/add.c\n@@ -188,7 +188,7 @@ static void refresh(int verbose, const char **pathspec)\n \t\t/* nothing */;\n \tseen = xcalloc(specs, 1);\n \trefresh_index(&the_index, verbose ? REFRESH_IN_PORCELAIN : REFRESH_QUIET,\n-\t\t      pathspec, seen, \"Unstaged changes after refreshing the index:\");\n+\t\t      pathspec, seen, _(\"Unstaged changes after refreshing the index:\"));\n \tfor (i = 0; i < specs; i++) {\n \t\tif (!seen[i])\n \t\t\tdie(_(\"pathspec '%s' did not match any files\"), pathspec[i]);\n-- \n1.7.2.3\n"},{"id":"161653","messageId":"1298143495-3681-15-git-send-email-avarab@gmail.com","threadId":"26561","inReplyTo":"1298143495-3681-1-git-send-email-avarab@gmail.com","subject":"[PATCH 14/72] gettextize: git-branch basic messages","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2011-02-19T19:23:57Z","receivedAt":"2011-02-19T19:23:57Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n builtin/branch.c |   56 +++++++++++++++++++++++++++---------------------------\n 1 files changed, 28 insertions(+), 28 deletions(-)\n\ndiff --git a/builtin/branch.c b/builtin/branch.c\nindex 9e546e4..6695db4 100644\n--- a/builtin/branch.c\n+++ b/builtin/branch.c\n@@ -133,12 +133,12 @@ static int branch_merged(int kind, const char *name,\n \tif ((head_rev != reference_rev) &&\n \t    in_merge_bases(rev, &head_rev, 1) != merged) {\n \t\tif (merged)\n-\t\t\twarning(\"deleting branch '%s' that has been merged to\\n\"\n-\t\t\t\t\"         '%s', but it is not yet merged to HEAD.\",\n+\t\t\twarning(_(\"deleting branch '%s' that has been merged to\\n\"\n+\t\t\t\t\"         '%s', but it is not yet merged to HEAD.\"),\n \t\t\t\tname, reference_name);\n \t\telse\n-\t\t\twarning(\"not deleting branch '%s' that is not yet merged to\\n\"\n-\t\t\t\t\"         '%s', even though it is merged to HEAD.\",\n+\t\t\twarning(_(\"not deleting branch '%s' that is not yet merged to\\n\"\n+\t\t\t\t\"         '%s', even though it is merged to HEAD.\"),\n \t\t\t\tname, reference_name);\n \t}\n \treturn merged;\n@@ -165,19 +165,19 @@ static int delete_branches(int argc, const char **argv, int force, int kinds)\n \t\tremote = \"\";\n \t\tbreak;\n \tdefault:\n-\t\tdie(\"cannot use -a with -d\");\n+\t\tdie(_(\"cannot use -a with -d\"));\n \t}\n \n \tif (!force) {\n \t\thead_rev = lookup_commit_reference(head_sha1);\n \t\tif (!head_rev)\n-\t\t\tdie(\"Couldn't look up commit object for HEAD\");\n+\t\t\tdie(_(\"Couldn't look up commit object for HEAD\"));\n \t}\n \tfor (i = 0; i < argc; i++, strbuf_release(&bname)) {\n \t\tstrbuf_branchname(&bname, argv[i]);\n \t\tif (kinds == REF_LOCAL_BRANCH && !strcmp(head, bname.buf)) {\n-\t\t\terror(\"Cannot delete the branch '%s' \"\n-\t\t\t      \"which you are currently on.\", bname.buf);\n+\t\t\terror(_(\"Cannot delete the branch '%s' \"\n+\t\t\t      \"which you are currently on.\"), bname.buf);\n \t\t\tret = 1;\n \t\t\tcontinue;\n \t\t}\n@@ -186,7 +186,7 @@ static int delete_branches(int argc, const char **argv, int force, int kinds)\n \n \t\tname = xstrdup(mkpath(fmt, bname.buf));\n \t\tif (!resolve_ref(name, sha1, 1, NULL)) {\n-\t\t\terror(\"%sbranch '%s' not found.\",\n+\t\t\terror(_(\"%sbranch '%s' not found.\"),\n \t\t\t\t\tremote, bname.buf);\n \t\t\tret = 1;\n \t\t\tcontinue;\n@@ -194,21 +194,21 @@ static int delete_branches(int argc, const char **argv, int force, int kinds)\n \n \t\trev = lookup_commit_reference(sha1);\n \t\tif (!rev) {\n-\t\t\terror(\"Couldn't look up commit object for '%s'\", name);\n+\t\t\terror(_(\"Couldn't look up commit object for '%s'\"), name);\n \t\t\tret = 1;\n \t\t\tcontinue;\n \t\t}\n \n \t\tif (!force && !branch_merged(kinds, bname.buf, rev, head_rev)) {\n-\t\t\terror(\"The branch '%s' is not fully merged.\\n\"\n+\t\t\terror(_(\"The branch '%s' is not fully merged.\\n\"\n \t\t\t      \"If you are sure you want to delete it, \"\n-\t\t\t      \"run 'git branch -D %s'.\", bname.buf, bname.buf);\n+\t\t\t      \"run 'git branch -D %s'.\"), bname.buf, bname.buf);\n \t\t\tret = 1;\n \t\t\tcontinue;\n \t\t}\n \n \t\tif (delete_ref(name, sha1, 0)) {\n-\t\t\terror(\"Error deleting %sbranch '%s'\", remote,\n+\t\t\terror(_(\"Error deleting %sbranch '%s'\"), remote,\n \t\t\t      bname.buf);\n \t\t\tret = 1;\n \t\t} else {\n@@ -218,7 +218,7 @@ static int delete_branches(int argc, const char **argv, int force, int kinds)\n \t\t\t       find_unique_abbrev(sha1, DEFAULT_ABBREV));\n \t\t\tstrbuf_addf(&buf, \"branch.%s\", bname.buf);\n \t\t\tif (git_config_rename_section(buf.buf, NULL) < 0)\n-\t\t\t\twarning(\"Update of config-file failed\");\n+\t\t\t\twarning(_(\"Update of config-file failed\"));\n \t\t\tstrbuf_release(&buf);\n \t\t}\n \t}\n@@ -300,7 +300,7 @@ static int append_ref(const char *refname, const unsigned char *sha1, int flags,\n \tif (ref_list->verbose || ref_list->with_commit || merge_filter != NO_FILTER) {\n \t\tcommit = lookup_commit_reference_gently(sha1, 1);\n \t\tif (!commit) {\n-\t\t\tcb->ret = error(\"branch '%s' does not point at a commit\", refname);\n+\t\t\tcb->ret = error(_(\"branch '%s' does not point at a commit\"), refname);\n \t\t\treturn 0;\n \t\t}\n \n@@ -535,7 +535,7 @@ static int print_ref_list(int kinds, int detached, int verbose, int abbrev, stru\n \tfree_ref_list(&ref_list);\n \n \tif (cb.ret)\n-\t\terror(\"some refs could not be read\");\n+\t\terror(_(\"some refs could not be read\"));\n \n \treturn cb.ret;\n }\n@@ -548,7 +548,7 @@ static void rename_branch(const char *oldname, const char *newname, int force)\n \tint recovery = 0;\n \n \tif (!oldname)\n-\t\tdie(\"cannot rename the current branch while not on any.\");\n+\t\tdie(_(\"cannot rename the current branch while not on any.\"));\n \n \tif (strbuf_check_branch_ref(&oldref, oldname)) {\n \t\t/*\n@@ -558,35 +558,35 @@ static void rename_branch(const char *oldname, const char *newname, int force)\n \t\tif (resolve_ref(oldref.buf, sha1, 1, NULL))\n \t\t\trecovery = 1;\n \t\telse\n-\t\t\tdie(\"Invalid branch name: '%s'\", oldname);\n+\t\t\tdie(_(\"Invalid branch name: '%s'\"), oldname);\n \t}\n \n \tif (strbuf_check_branch_ref(&newref, newname))\n-\t\tdie(\"Invalid branch name: '%s'\", newname);\n+\t\tdie(_(\"Invalid branch name: '%s'\"), newname);\n \n \tif (resolve_ref(newref.buf, sha1, 1, NULL) && !force)\n-\t\tdie(\"A branch named '%s' already exists.\", newref.buf + 11);\n+\t\tdie(_(\"A branch named '%s' already exists.\"), newref.buf + 11);\n \n \tstrbuf_addf(&logmsg, \"Branch: renamed %s to %s\",\n \t\t oldref.buf, newref.buf);\n \n \tif (rename_ref(oldref.buf, newref.buf, logmsg.buf))\n-\t\tdie(\"Branch rename failed\");\n+\t\tdie(_(\"Branch rename failed\"));\n \tstrbuf_release(&logmsg);\n \n \tif (recovery)\n-\t\twarning(\"Renamed a misnamed branch '%s' away\", oldref.buf + 11);\n+\t\twarning(_(\"Renamed a misnamed branch '%s' away\"), oldref.buf + 11);\n \n \t/* no need to pass logmsg here as HEAD didn't really move */\n \tif (!strcmp(oldname, head) && create_symref(\"HEAD\", newref.buf, NULL))\n-\t\tdie(\"Branch renamed to %s, but HEAD is not updated!\", newname);\n+\t\tdie(_(\"Branch renamed to %s, but HEAD is not updated!\"), newname);\n \n \tstrbuf_addf(&oldsection, \"branch.%s\", oldref.buf + 11);\n \tstrbuf_release(&oldref);\n \tstrbuf_addf(&newsection, \"branch.%s\", newref.buf + 11);\n \tstrbuf_release(&newref);\n \tif (git_config_rename_section(oldsection.buf, newsection.buf) < 0)\n-\t\tdie(\"Branch is renamed, but update of config-file failed\");\n+\t\tdie(_(\"Branch is renamed, but update of config-file failed\"));\n \tstrbuf_release(&oldsection);\n \tstrbuf_release(&newsection);\n }\n@@ -601,7 +601,7 @@ static int opt_parse_merge_filter(const struct option *opt, const char *arg, int\n \tif (!arg)\n \t\targ = \"HEAD\";\n \tif (get_sha1(arg, merge_filter_ref))\n-\t\tdie(\"malformed object name %s\", arg);\n+\t\tdie(_(\"malformed object name %s\"), arg);\n \treturn 0;\n }\n \n@@ -675,13 +675,13 @@ int cmd_branch(int argc, const char **argv, const char *prefix)\n \n \thead = resolve_ref(\"HEAD\", head_sha1, 0, NULL);\n \tif (!head)\n-\t\tdie(\"Failed to resolve HEAD as a valid ref.\");\n+\t\tdie(_(\"Failed to resolve HEAD as a valid ref.\"));\n \thead = xstrdup(head);\n \tif (!strcmp(head, \"HEAD\")) {\n \t\tdetached = 1;\n \t} else {\n \t\tif (prefixcmp(head, \"refs/heads/\"))\n-\t\t\tdie(\"HEAD not found below refs/heads!\");\n+\t\t\tdie(_(\"HEAD not found below refs/heads!\"));\n \t\thead += 11;\n \t}\n \thashcpy(merge_filter_ref, head_sha1);\n@@ -701,7 +701,7 @@ int cmd_branch(int argc, const char **argv, const char *prefix)\n \t\trename_branch(argv[0], argv[1], rename > 1);\n \telse if (argc <= 2) {\n \t\tif (kinds != REF_LOCAL_BRANCH)\n-\t\t\tdie(\"-a and -r options to 'git branch' do not make sense with a branch name\");\n+\t\t\tdie(_(\"-a and -r options to 'git branch' do not make sense with a branch name\"));\n \t\tcreate_branch(head, argv[0], (argc == 2) ? argv[1] : head,\n \t\t\t      force_create, reflog, track);\n \t} else\n-- \n1.7.2.3\n"},{"id":"161656","messageId":"1298143495-3681-16-git-send-email-avarab@gmail.com","threadId":"26561","inReplyTo":"1298143495-3681-1-git-send-email-avarab@gmail.com","subject":"[PATCH 15/72] gettextize: git-branch \"remote branch '%s' not found\" message","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2011-02-19T19:23:58Z","receivedAt":"2011-02-19T19:23:58Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"This could be done better by splitting it up, but it would change too\nmuch code, which I'm trying to avoid at this point. Instead add a\nTRANSLATORS comment to explain what \"remote \" does.\n\nSigned-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n builtin/branch.c |    3 ++-\n 1 files changed, 2 insertions(+), 1 deletions(-)\n\ndiff --git a/builtin/branch.c b/builtin/branch.c\nindex 6695db4..e9d8a5a 100644\n--- a/builtin/branch.c\n+++ b/builtin/branch.c\n@@ -157,7 +157,8 @@ static int delete_branches(int argc, const char **argv, int force, int kinds)\n \tswitch (kinds) {\n \tcase REF_REMOTE_BRANCH:\n \t\tfmt = \"refs/remotes/%s\";\n-\t\tremote = \"remote \";\n+\t\t/* TRANSLATORS: This is \"remote \" in \"remote branch '%s' not found\" */\n+\t\tremote = _(\"remote \");\n \t\tforce = 1;\n \t\tbreak;\n \tcase REF_LOCAL_BRANCH:\n-- \n1.7.2.3\n"},{"id":"161659","messageId":"1298143495-3681-17-git-send-email-avarab@gmail.com","threadId":"26561","inReplyTo":"1298143495-3681-1-git-send-email-avarab@gmail.com","subject":"[PATCH 16/72] gettextize: git-branch \"Deleted branch [...]\" message","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2011-02-19T19:23:59Z","receivedAt":"2011-02-19T19:23:59Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"Gettextize the \"Deleted %sbranch %s (was %s).\\n\" messages. test in\nt3200-branch.sh explicitly checked for this message. Change it to skip\nunder GETTEXT_POISON=YesPlease.\n\nSigned-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n builtin/branch.c  |    2 +-\n t/t3200-branch.sh |    2 +-\n 2 files changed, 2 insertions(+), 2 deletions(-)\n\ndiff --git a/builtin/branch.c b/builtin/branch.c\nindex e9d8a5a..d276681 100644\n--- a/builtin/branch.c\n+++ b/builtin/branch.c\n@@ -214,7 +214,7 @@ static int delete_branches(int argc, const char **argv, int force, int kinds)\n \t\t\tret = 1;\n \t\t} else {\n \t\t\tstruct strbuf buf = STRBUF_INIT;\n-\t\t\tprintf(\"Deleted %sbranch %s (was %s).\\n\", remote,\n+\t\t\tprintf(_(\"Deleted %sbranch %s (was %s).\\n\"), remote,\n \t\t\t       bname.buf,\n \t\t\t       find_unique_abbrev(sha1, DEFAULT_ABBREV));\n \t\t\tstrbuf_addf(&buf, \"branch.%s\", bname.buf);\ndiff --git a/t/t3200-branch.sh b/t/t3200-branch.sh\nindex f308235..04997cf 100755\n--- a/t/t3200-branch.sh\n+++ b/t/t3200-branch.sh\n@@ -203,7 +203,7 @@ test_expect_success 'test deleting branch deletes branch config' \\\n      test -z \"$(git config branch.my7.remote)\" &&\n      test -z \"$(git config branch.my7.merge)\"'\n \n-test_expect_success 'test deleting branch without config' \\\n+test_expect_success NO_GETTEXT_POISON 'test deleting branch without config' \\\n     'git branch my7 s &&\n      sha1=$(git rev-parse my7 | cut -c 1-7) &&\n      test \"$(git branch -d my7 2>&1)\" = \"Deleted branch my7 (was $sha1).\"'\n-- \n1.7.2.3\n"},{"id":"161657","messageId":"1298143495-3681-18-git-send-email-avarab@gmail.com","threadId":"26561","inReplyTo":"1298143495-3681-1-git-send-email-avarab@gmail.com","subject":"[PATCH 17/72] gettextize: git-branch \"git branch -v\" messages","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2011-02-19T19:24:00Z","receivedAt":"2011-02-19T19:24:00Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"Make the \"git branch -v\" messages translatable, e.g.:\n\n    5054b57 [ahead 8] branch error fixup\n\nThis is possibly a plumbing message.\n\nSigned-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n builtin/branch.c         |    6 +++---\n t/t6040-tracking-info.sh |    2 +-\n 2 files changed, 4 insertions(+), 4 deletions(-)\n\ndiff --git a/builtin/branch.c b/builtin/branch.c\nindex d276681..4c1a256 100644\n--- a/builtin/branch.c\n+++ b/builtin/branch.c\n@@ -373,11 +373,11 @@ static void fill_tracking_info(struct strbuf *stat, const char *branch_name,\n \t\tstrbuf_addf(stat, \"%s: \",\n \t\t\tshorten_unambiguous_ref(branch->merge[0]->dst, 0));\n \tif (!ours)\n-\t\tstrbuf_addf(stat, \"behind %d] \", theirs);\n+\t\tstrbuf_addf(stat, _(\"behind %d] \"), theirs);\n \telse if (!theirs)\n-\t\tstrbuf_addf(stat, \"ahead %d] \", ours);\n+\t\tstrbuf_addf(stat, _(\"ahead %d] \"), ours);\n \telse\n-\t\tstrbuf_addf(stat, \"ahead %d, behind %d] \", ours, theirs);\n+\t\tstrbuf_addf(stat, _(\"ahead %d, behind %d] \"), ours, theirs);\n }\n \n static int matches_merge_filter(struct commit *commit)\ndiff --git a/t/t6040-tracking-info.sh b/t/t6040-tracking-info.sh\nindex 1e0447f..d508a19 100755\n--- a/t/t6040-tracking-info.sh\n+++ b/t/t6040-tracking-info.sh\n@@ -42,7 +42,7 @@ b3 behind 1\n b4 ahead 2\n EOF\n \n-test_expect_success 'branch -v' '\n+test_expect_success NO_GETTEXT_POISON 'branch -v' '\n \t(\n \t\tcd test &&\n \t\tgit branch -v\n-- \n1.7.2.3\n"},{"id":"161658","messageId":"1298143495-3681-19-git-send-email-avarab@gmail.com","threadId":"26561","inReplyTo":"1298143495-3681-1-git-send-email-avarab@gmail.com","subject":"[PATCH 18/72] gettextize: git-branch \"(no branch)\" message","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2011-02-19T19:24:01Z","receivedAt":"2011-02-19T19:24:01Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"Gettextize the \"(no branch)\" message that's shown by \"git branch\" when\nyou're in a detached HEAD.\n\nSigned-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n builtin/branch.c         |    2 +-\n t/t3203-branch-output.sh |    2 +-\n 2 files changed, 2 insertions(+), 2 deletions(-)\n\ndiff --git a/builtin/branch.c b/builtin/branch.c\nindex 4c1a256..244589e 100644\n--- a/builtin/branch.c\n+++ b/builtin/branch.c\n@@ -476,7 +476,7 @@ static void show_detached(struct ref_list *ref_list)\n \n \tif (head_commit && is_descendant_of(head_commit, ref_list->with_commit)) {\n \t\tstruct ref_item item;\n-\t\titem.name = xstrdup(\"(no branch)\");\n+\t\titem.name = xstrdup(_(\"(no branch)\"));\n \t\titem.len = strlen(item.name);\n \t\titem.kind = REF_LOCAL_BRANCH;\n \t\titem.dest = NULL;\ndiff --git a/t/t3203-branch-output.sh b/t/t3203-branch-output.sh\nindex 6028748..cf04bb2 100755\n--- a/t/t3203-branch-output.sh\n+++ b/t/t3203-branch-output.sh\n@@ -72,7 +72,7 @@ cat >expect <<'EOF'\n   branch-two\n   master\n EOF\n-test_expect_success 'git branch shows detached HEAD properly' '\n+test_expect_success NO_GETTEXT_POISON 'git branch shows detached HEAD properly' '\n \tgit checkout HEAD^0 &&\n \tgit branch >actual &&\n \ttest_cmp expect actual\n-- \n1.7.2.3\n"},{"id":"161710","messageId":"1298143495-3681-20-git-send-email-avarab@gmail.com","threadId":"26561","inReplyTo":"1298143495-3681-1-git-send-email-avarab@gmail.com","subject":"[PATCH 19/72] gettextize: git-checkout basic messages","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2011-02-19T19:24:02Z","receivedAt":"2011-02-19T19:24:02Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n builtin/checkout.c |   68 ++++++++++++++++++++++++++--------------------------\n 1 files changed, 34 insertions(+), 34 deletions(-)\n\ndiff --git a/builtin/checkout.c b/builtin/checkout.c\nindex cd7f56e..b5060ab 100644\n--- a/builtin/checkout.c\n+++ b/builtin/checkout.c\n@@ -116,7 +116,7 @@ static int check_all_stages(struct cache_entry *ce, int pos)\n \t    ce_stage(active_cache[pos+1]) != 2 ||\n \t    strcmp(active_cache[pos+2]->name, ce->name) ||\n \t    ce_stage(active_cache[pos+2]) != 3)\n-\t\treturn error(\"path '%s' does not have all three versions\",\n+\t\treturn error(_(\"path '%s' does not have all three versions\"),\n \t\t\t     ce->name);\n \treturn 0;\n }\n@@ -150,7 +150,7 @@ static int checkout_merged(int pos, struct checkout *state)\n \t    ce_stage(active_cache[pos+1]) != 2 ||\n \t    strcmp(active_cache[pos+2]->name, path) ||\n \t    ce_stage(active_cache[pos+2]) != 3)\n-\t\treturn error(\"path '%s' does not have all 3 versions\", path);\n+\t\treturn error(_(\"path '%s' does not have all 3 versions\"), path);\n \n \tread_mmblob(&ancestor, active_cache[pos]->sha1);\n \tread_mmblob(&ours, active_cache[pos+1]->sha1);\n@@ -167,7 +167,7 @@ static int checkout_merged(int pos, struct checkout *state)\n \tfree(theirs.ptr);\n \tif (status < 0 || !result_buf.ptr) {\n \t\tfree(result_buf.ptr);\n-\t\treturn error(\"path '%s': cannot merge\", path);\n+\t\treturn error(_(\"path '%s': cannot merge\"), path);\n \t}\n \n \t/*\n@@ -184,12 +184,12 @@ static int checkout_merged(int pos, struct checkout *state)\n \t */\n \tif (write_sha1_file(result_buf.ptr, result_buf.size,\n \t\t\t    blob_type, sha1))\n-\t\tdie(\"Unable to add merge result for '%s'\", path);\n+\t\tdie(_(\"Unable to add merge result for '%s'\"), path);\n \tce = make_cache_entry(create_ce_mode(active_cache[pos+1]->ce_mode),\n \t\t\t      sha1,\n \t\t\t      path, 2, 0);\n \tif (!ce)\n-\t\tdie(\"make_cache_entry failed for path '%s'\", path);\n+\t\tdie(_(\"make_cache_entry failed for path '%s'\"), path);\n \tstatus = checkout_entry(ce, state, NULL);\n \treturn status;\n }\n@@ -211,7 +211,7 @@ static int checkout_paths(struct tree *source_tree, const char **pathspec,\n \n \tnewfd = hold_locked_index(lock_file, 1);\n \tif (read_cache_preload(pathspec) < 0)\n-\t\treturn error(\"corrupt index file\");\n+\t\treturn error(_(\"corrupt index file\"));\n \n \tif (source_tree)\n \t\tread_tree_some(source_tree, pathspec);\n@@ -239,14 +239,14 @@ static int checkout_paths(struct tree *source_tree, const char **pathspec,\n \t\t\tif (!ce_stage(ce))\n \t\t\t\tcontinue;\n \t\t\tif (opts->force) {\n-\t\t\t\twarning(\"path '%s' is unmerged\", ce->name);\n+\t\t\t\twarning(_(\"path '%s' is unmerged\"), ce->name);\n \t\t\t} else if (stage) {\n \t\t\t\terrs |= check_stage(stage, ce, pos);\n \t\t\t} else if (opts->merge) {\n \t\t\t\terrs |= check_all_stages(ce, pos);\n \t\t\t} else {\n \t\t\t\terrs = 1;\n-\t\t\t\terror(\"path '%s' is unmerged\", ce->name);\n+\t\t\t\terror(_(\"path '%s' is unmerged\"), ce->name);\n \t\t\t}\n \t\t\tpos = skip_same_name(ce, pos) - 1;\n \t\t}\n@@ -275,7 +275,7 @@ static int checkout_paths(struct tree *source_tree, const char **pathspec,\n \n \tif (write_cache(newfd, active_cache, active_nr) ||\n \t    commit_locked_index(lock_file))\n-\t\tdie(\"unable to write new index file\");\n+\t\tdie(_(\"unable to write new index file\"));\n \n \tresolve_ref(\"HEAD\", rev, 0, &flag);\n \thead = lookup_commit_reference_gently(rev, 1);\n@@ -292,7 +292,7 @@ static void show_local_changes(struct object *head, struct diff_options *opts)\n \trev.diffopt.flags = opts->flags;\n \trev.diffopt.output_format |= DIFF_FORMAT_NAME_STATUS;\n \tif (diff_setup_done(&rev.diffopt) < 0)\n-\t\tdie(\"diff_setup_done failed\");\n+\t\tdie(_(\"diff_setup_done failed\"));\n \tadd_pending_object(&rev, head, NULL);\n \trun_diff_index(&rev, 0);\n }\n@@ -366,7 +366,7 @@ static int merge_working_tree(struct checkout_opts *opts,\n \tint newfd = hold_locked_index(lock_file, 1);\n \n \tif (read_cache_preload(NULL) < 0)\n-\t\treturn error(\"corrupt index file\");\n+\t\treturn error(_(\"corrupt index file\"));\n \n \tresolve_undo_clear();\n \tif (opts->force) {\n@@ -388,7 +388,7 @@ static int merge_working_tree(struct checkout_opts *opts,\n \t\trefresh_cache(REFRESH_QUIET);\n \n \t\tif (unmerged_cache()) {\n-\t\t\terror(\"you need to resolve your current index first\");\n+\t\t\terror(_(\"you need to resolve your current index first\"));\n \t\t\treturn 1;\n \t\t}\n \n@@ -470,7 +470,7 @@ static int merge_working_tree(struct checkout_opts *opts,\n \n \tif (write_cache(newfd, active_cache, active_nr) ||\n \t    commit_locked_index(lock_file))\n-\t\tdie(\"unable to write new index file\");\n+\t\tdie(_(\"unable to write new index file\"));\n \n \tif (!opts->force && !opts->quiet)\n \t\tshow_local_changes(&new->commit->object, &opts->diff_options);\n@@ -519,7 +519,7 @@ static void update_refs_for_switch(struct checkout_opts *opts,\n \t\t\t\ttemp = log_all_ref_updates;\n \t\t\t\tlog_all_ref_updates = 1;\n \t\t\t\tif (log_ref_setup(ref_name, log_file, sizeof(log_file))) {\n-\t\t\t\t\tfprintf(stderr, \"Can not do reflog for '%s'\\n\",\n+\t\t\t\t\tfprintf(stderr, _(\"Can not do reflog for '%s'\\n\"),\n \t\t\t\t\t    opts->new_orphan_branch);\n \t\t\t\t\tlog_all_ref_updates = temp;\n \t\t\t\t\treturn;\n@@ -545,14 +545,14 @@ static void update_refs_for_switch(struct checkout_opts *opts,\n \t\tcreate_symref(\"HEAD\", new->path, msg.buf);\n \t\tif (!opts->quiet) {\n \t\t\tif (old->path && !strcmp(new->path, old->path))\n-\t\t\t\tfprintf(stderr, \"Already on '%s'\\n\",\n+\t\t\t\tfprintf(stderr, _(\"Already on '%s'\\n\"),\n \t\t\t\t\tnew->name);\n \t\t\telse if (opts->new_branch)\n \t\t\t\tfprintf(stderr, \"Switched to%s branch '%s'\\n\",\n \t\t\t\t\topts->branch_exists ? \" and reset\" : \" a new\",\n \t\t\t\t\tnew->name);\n \t\t\telse\n-\t\t\t\tfprintf(stderr, \"Switched to branch '%s'\\n\",\n+\t\t\t\tfprintf(stderr, _(\"Switched to branch '%s'\\n\"),\n \t\t\t\t\tnew->name);\n \t\t}\n \t\tif (old->path && old->name) {\n@@ -597,7 +597,7 @@ static int switch_branches(struct checkout_opts *opts, struct branch_info *new)\n \t\tnew->name = \"HEAD\";\n \t\tnew->commit = old.commit;\n \t\tif (!new->commit)\n-\t\t\tdie(\"You are on a branch yet to be born\");\n+\t\t\tdie(_(\"You are on a branch yet to be born\"));\n \t\tparse_commit(new->commit);\n \t}\n \n@@ -724,7 +724,7 @@ int cmd_checkout(int argc, const char **argv, const char *prefix)\n \n \t/* we can assume from now on new_branch = !new_branch_force */\n \tif (opts.new_branch && opts.new_branch_force)\n-\t\tdie(\"-B cannot be used with -b\");\n+\t\tdie(_(\"-B cannot be used with -b\"));\n \n \t/* copy -B over to -b, so that we can just check the latter */\n \tif (opts.new_branch_force)\n@@ -732,28 +732,28 @@ int cmd_checkout(int argc, const char **argv, const char *prefix)\n \n \tif (patch_mode && (opts.track > 0 || opts.new_branch\n \t\t\t   || opts.new_branch_log || opts.merge || opts.force))\n-\t\tdie (\"--patch is incompatible with all other options\");\n+\t\tdie (_(\"--patch is incompatible with all other options\"));\n \n \t/* --track without -b should DWIM */\n \tif (0 < opts.track && !opts.new_branch) {\n \t\tconst char *argv0 = argv[0];\n \t\tif (!argc || !strcmp(argv0, \"--\"))\n-\t\t\tdie (\"--track needs a branch name\");\n+\t\t\tdie (_(\"--track needs a branch name\"));\n \t\tif (!prefixcmp(argv0, \"refs/\"))\n \t\t\targv0 += 5;\n \t\tif (!prefixcmp(argv0, \"remotes/\"))\n \t\t\targv0 += 8;\n \t\targv0 = strchr(argv0, '/');\n \t\tif (!argv0 || !argv0[1])\n-\t\t\tdie (\"Missing branch name; try -b\");\n+\t\t\tdie (_(\"Missing branch name; try -b\"));\n \t\topts.new_branch = argv0 + 1;\n \t}\n \n \tif (opts.new_orphan_branch) {\n \t\tif (opts.new_branch)\n-\t\t\tdie(\"--orphan and -b|-B are mutually exclusive\");\n+\t\t\tdie(_(\"--orphan and -b|-B are mutually exclusive\"));\n \t\tif (opts.track > 0)\n-\t\t\tdie(\"--orphan cannot be used with -t\");\n+\t\t\tdie(_(\"--orphan cannot be used with -t\"));\n \t\topts.new_branch = opts.new_orphan_branch;\n \t}\n \n@@ -763,7 +763,7 @@ int cmd_checkout(int argc, const char **argv, const char *prefix)\n \t}\n \n \tif (opts.force && opts.merge)\n-\t\tdie(\"git checkout: -f and -m are incompatible\");\n+\t\tdie(_(\"git checkout: -f and -m are incompatible\"));\n \n \t/*\n \t * case 1: git checkout <ref> -- [<paths>]\n@@ -809,7 +809,7 @@ int cmd_checkout(int argc, const char **argv, const char *prefix)\n \n \t\tif (get_sha1_mb(arg, rev)) {\n \t\t\tif (has_dash_dash)          /* case (1) */\n-\t\t\t\tdie(\"invalid reference: %s\", arg);\n+\t\t\t\tdie(_(\"invalid reference: %s\"), arg);\n \t\t\tif (!patch_mode &&\n \t\t\t    dwim_new_local_branch &&\n \t\t\t    opts.track == BRANCH_TRACK_UNSPECIFIED &&\n@@ -846,7 +846,7 @@ int cmd_checkout(int argc, const char **argv, const char *prefix)\n \t\t\tsource_tree = parse_tree_indirect(rev);\n \n \t\tif (!source_tree)                   /* case (1): want a tree */\n-\t\t\tdie(\"reference is not a tree: %s\", arg);\n+\t\t\tdie(_(\"reference is not a tree: %s\"), arg);\n \t\tif (!has_dash_dash) {/* case (3 -> 1) */\n \t\t\t/*\n \t\t\t * Do not complain the most common case\n@@ -872,7 +872,7 @@ no_reference:\n \t\tconst char **pathspec = get_pathspec(prefix, argv);\n \n \t\tif (!pathspec)\n-\t\t\tdie(\"invalid path specification\");\n+\t\t\tdie(_(\"invalid path specification\"));\n \n \t\tif (patch_mode)\n \t\t\treturn interactive_checkout(new.name, pathspec, &opts);\n@@ -880,14 +880,14 @@ no_reference:\n \t\t/* Checkout paths */\n \t\tif (opts.new_branch) {\n \t\t\tif (argc == 1) {\n-\t\t\t\tdie(\"git checkout: updating paths is incompatible with switching branches.\\nDid you intend to checkout '%s' which can not be resolved as commit?\", argv[0]);\n+\t\t\t\tdie(_(\"git checkout: updating paths is incompatible with switching branches.\\nDid you intend to checkout '%s' which can not be resolved as commit?\"), argv[0]);\n \t\t\t} else {\n-\t\t\t\tdie(\"git checkout: updating paths is incompatible with switching branches.\");\n+\t\t\t\tdie(_(\"git checkout: updating paths is incompatible with switching branches.\"));\n \t\t\t}\n \t\t}\n \n \t\tif (1 < !!opts.writeout_stage + !!opts.force + !!opts.merge)\n-\t\t\tdie(\"git checkout: --ours/--theirs, --force and --merge are incompatible when\\nchecking out of the index.\");\n+\t\t\tdie(_(\"git checkout: --ours/--theirs, --force and --merge are incompatible when\\nchecking out of the index.\"));\n \n \t\treturn checkout_paths(source_tree, pathspec, &opts);\n \t}\n@@ -898,22 +898,22 @@ no_reference:\n \tif (opts.new_branch) {\n \t\tstruct strbuf buf = STRBUF_INIT;\n \t\tif (strbuf_check_branch_ref(&buf, opts.new_branch))\n-\t\t\tdie(\"git checkout: we do not like '%s' as a branch name.\",\n+\t\t\tdie(_(\"git checkout: we do not like '%s' as a branch name.\"),\n \t\t\t    opts.new_branch);\n \t\tif (!get_sha1(buf.buf, rev)) {\n \t\t\topts.branch_exists = 1;\n \t\t\tif (!opts.new_branch_force)\n-\t\t\t\tdie(\"git checkout: branch %s already exists\",\n+\t\t\t\tdie(_(\"git checkout: branch %s already exists\"),\n \t\t\t\t    opts.new_branch);\n \t\t}\n \t\tstrbuf_release(&buf);\n \t}\n \n \tif (new.name && !new.commit) {\n-\t\tdie(\"Cannot switch branch to a non-commit.\");\n+\t\tdie(_(\"Cannot switch branch to a non-commit.\"));\n \t}\n \tif (opts.writeout_stage)\n-\t\tdie(\"--ours/--theirs is incompatible with switching branches.\");\n+\t\tdie(_(\"--ours/--theirs is incompatible with switching branches.\"));\n \n \treturn switch_branches(&opts, &new);\n }\n-- \n1.7.2.3\n"},{"id":"161660","messageId":"1298143495-3681-21-git-send-email-avarab@gmail.com","threadId":"26561","inReplyTo":"1298143495-3681-1-git-send-email-avarab@gmail.com","subject":"[PATCH 20/72] gettextize: git-checkout: our/their version message","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2011-02-19T19:24:03Z","receivedAt":"2011-02-19T19:24:03Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"Split up the \"does not have our/their version\" message to make it\neasier to translate.\n\nSigned-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n builtin/checkout.c |   14 ++++++++------\n 1 files changed, 8 insertions(+), 6 deletions(-)\n\ndiff --git a/builtin/checkout.c b/builtin/checkout.c\nindex b5060ab..7ba0788 100644\n--- a/builtin/checkout.c\n+++ b/builtin/checkout.c\n@@ -103,9 +103,10 @@ static int check_stage(int stage, struct cache_entry *ce, int pos)\n \t\t\treturn 0;\n \t\tpos++;\n \t}\n-\treturn error(\"path '%s' does not have %s version\",\n-\t\t     ce->name,\n-\t\t     (stage == 2) ? \"our\" : \"their\");\n+\tif (stage == 2)\n+\t\treturn error(_(\"path '%s' does not have our version\"), ce->name);\n+\telse\n+\t\treturn error(_(\"path '%s' does not have their version\"), ce->name);\n }\n \n static int check_all_stages(struct cache_entry *ce, int pos)\n@@ -130,9 +131,10 @@ static int checkout_stage(int stage, struct cache_entry *ce, int pos,\n \t\t\treturn checkout_entry(active_cache[pos], state, NULL);\n \t\tpos++;\n \t}\n-\treturn error(\"path '%s' does not have %s version\",\n-\t\t     ce->name,\n-\t\t     (stage == 2) ? \"our\" : \"their\");\n+\tif (stage == 2)\n+\t\treturn error(_(\"path '%s' does not have our version\"), ce->name);\n+\telse\n+\t\treturn error(_(\"path '%s' does not have their version\"), ce->name);\n }\n \n static int checkout_merged(int pos, struct checkout *state)\n-- \n1.7.2.3\n"},{"id":"161661","messageId":"1298143495-3681-22-git-send-email-avarab@gmail.com","threadId":"26561","inReplyTo":"1298143495-3681-1-git-send-email-avarab@gmail.com","subject":"[PATCH 21/72] gettextize: git-checkout describe_detached_head messages","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2011-02-19T19:24:04Z","receivedAt":"2011-02-19T19:24:04Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n builtin/checkout.c |    2 +-\n 1 files changed, 1 insertions(+), 1 deletions(-)\n\ndiff --git a/builtin/checkout.c b/builtin/checkout.c\nindex 7ba0788..698ac63 100644\n--- a/builtin/checkout.c\n+++ b/builtin/checkout.c\n@@ -613,7 +613,7 @@ static int switch_branches(struct checkout_opts *opts, struct branch_info *new)\n \t * to remind the user that it might be lost.\n \t */\n \tif (!opts->quiet && !old.path && old.commit && new->commit != old.commit)\n-\t\tdescribe_detached_head(\"Previous HEAD position was\", old.commit);\n+\t\tdescribe_detached_head(_(\"Previous HEAD position was\"), old.commit);\n \n \tupdate_refs_for_switch(opts, &old, new);\n \n-- \n1.7.2.3\n"},{"id":"161662","messageId":"1298143495-3681-23-git-send-email-avarab@gmail.com","threadId":"26561","inReplyTo":"1298143495-3681-1-git-send-email-avarab@gmail.com","subject":"[PATCH 22/72] gettextize: git-checkout \"HEAD is now at\" message","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2011-02-19T19:24:05Z","receivedAt":"2011-02-19T19:24:05Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"Gettextize the \"HEAD is now at\" messages. Several tests in t7201-co.sh\nexplicitly checked for this message. Change them to skip under\nGETTEXT_POISON=YesPlease.\n\nSigned-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n builtin/checkout.c |    2 +-\n t/t7201-co.sh      |   10 +++++-----\n 2 files changed, 6 insertions(+), 6 deletions(-)\n\ndiff --git a/builtin/checkout.c b/builtin/checkout.c\nindex 698ac63..f833330 100644\n--- a/builtin/checkout.c\n+++ b/builtin/checkout.c\n@@ -571,7 +571,7 @@ static void update_refs_for_switch(struct checkout_opts *opts,\n \t\tif (!opts->quiet) {\n \t\t\tif (old->path && advice_detached_head)\n \t\t\t\tdetach_advice(old->path, new->name);\n-\t\t\tdescribe_detached_head(\"HEAD is now at\", new->commit);\n+\t\t\tdescribe_detached_head(_(\"HEAD is now at\"), new->commit);\n \t\t}\n \t}\n \tremove_branch_state();\ndiff --git a/t/t7201-co.sh b/t/t7201-co.sh\nindex 1337fa5..fe7536b 100755\n--- a/t/t7201-co.sh\n+++ b/t/t7201-co.sh\n@@ -223,7 +223,7 @@ test_expect_success 'checkout --merge --conflict=diff3 <branch>' '\n \ttest_cmp two expect\n '\n \n-test_expect_success 'checkout to detach HEAD (with advice declined)' '\n+test_expect_success NO_GETTEXT_POISON 'checkout to detach HEAD (with advice declined)' '\n \n \tgit config advice.detachedHead false &&\n \tgit checkout -f renamer && git clean -f &&\n@@ -242,7 +242,7 @@ test_expect_success 'checkout to detach HEAD (with advice declined)' '\n \tfi\n '\n \n-test_expect_success 'checkout to detach HEAD' '\n+test_expect_success NO_GETTEXT_POISON 'checkout to detach HEAD' '\n \tgit config advice.detachedHead true &&\n \tgit checkout -f renamer && git clean -f &&\n \tgit checkout renamer^ 2>messages &&\n@@ -260,7 +260,7 @@ test_expect_success 'checkout to detach HEAD' '\n \tfi\n '\n \n-test_expect_success 'checkout to detach HEAD with branchname^' '\n+test_expect_success NO_GETTEXT_POISON 'checkout to detach HEAD with branchname^' '\n \n \tgit checkout -f master && git clean -f &&\n \tgit checkout renamer^ &&\n@@ -276,7 +276,7 @@ test_expect_success 'checkout to detach HEAD with branchname^' '\n \tfi\n '\n \n-test_expect_success 'checkout to detach HEAD with :/message' '\n+test_expect_success NO_GETTEXT_POISON 'checkout to detach HEAD with :/message' '\n \n \tgit checkout -f master && git clean -f &&\n \tgit checkout \":/Initial\" &&\n@@ -292,7 +292,7 @@ test_expect_success 'checkout to detach HEAD with :/message' '\n \tfi\n '\n \n-test_expect_success 'checkout to detach HEAD with HEAD^0' '\n+test_expect_success NO_GETTEXT_POISON 'checkout to detach HEAD with HEAD^0' '\n \n \tgit checkout -f master && git clean -f &&\n \tgit checkout HEAD^0 &&\n-- \n1.7.2.3\n"},{"id":"161664","messageId":"1298143495-3681-24-git-send-email-avarab@gmail.com","threadId":"26561","inReplyTo":"1298143495-3681-1-git-send-email-avarab@gmail.com","subject":"[PATCH 23/72] gettextize: git-checkout \"Switched to a .. branch\" message","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2011-02-19T19:24:06Z","receivedAt":"2011-02-19T19:24:06Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"Split up the \"Switched to and reset branch\" and \"Switched to a new\nbranch\" messages to make them easier to translate.\n\nSigned-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n builtin/checkout.c |    7 ++++---\n 1 files changed, 4 insertions(+), 3 deletions(-)\n\ndiff --git a/builtin/checkout.c b/builtin/checkout.c\nindex f833330..2bb7759 100644\n--- a/builtin/checkout.c\n+++ b/builtin/checkout.c\n@@ -550,9 +550,10 @@ static void update_refs_for_switch(struct checkout_opts *opts,\n \t\t\t\tfprintf(stderr, _(\"Already on '%s'\\n\"),\n \t\t\t\t\tnew->name);\n \t\t\telse if (opts->new_branch)\n-\t\t\t\tfprintf(stderr, \"Switched to%s branch '%s'\\n\",\n-\t\t\t\t\topts->branch_exists ? \" and reset\" : \" a new\",\n-\t\t\t\t\tnew->name);\n+\t\t\t\tif (opts->branch_exists)\n+\t\t\t\t\tfprintf(stderr, _(\"Switched to and reset branch '%s'\\n\"), new->name);\n+\t\t\t\telse\n+\t\t\t\t\tfprintf(stderr, _(\"Switched to a new branch '%s'\\n\"), new->name);\n \t\t\telse\n \t\t\t\tfprintf(stderr, _(\"Switched to branch '%s'\\n\"),\n \t\t\t\t\tnew->name);\n-- \n1.7.2.3\n"},{"id":"161713","messageId":"1298143495-3681-25-git-send-email-avarab@gmail.com","threadId":"26561","inReplyTo":"1298143495-3681-1-git-send-email-avarab@gmail.com","subject":"[PATCH 24/72] gettextize: git-commit basic messages","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2011-02-19T19:24:07Z","receivedAt":"2011-02-19T19:24:07Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n builtin/commit.c |  118 +++++++++++++++++++++++++++---------------------------\n 1 files changed, 59 insertions(+), 59 deletions(-)\n\ndiff --git a/builtin/commit.c b/builtin/commit.c\nindex d7f55e3..c57f603 100644\n--- a/builtin/commit.c\n+++ b/builtin/commit.c\n@@ -243,7 +243,7 @@ static void add_remove_files(struct string_list *list)\n \n \t\tif (!lstat(p->string, &st)) {\n \t\t\tif (add_to_cache(p->string, &st, 0))\n-\t\t\t\tdie(\"updating files failed\");\n+\t\t\t\tdie(_(\"updating files failed\"));\n \t\t} else\n \t\t\tremove_file_from_cache(p->string);\n \t}\n@@ -270,7 +270,7 @@ static void create_base_index(void)\n \topts.fn = oneway_merge;\n \ttree = parse_tree_indirect(head_sha1);\n \tif (!tree)\n-\t\tdie(\"failed to unpack HEAD tree object\");\n+\t\tdie(_(\"failed to unpack HEAD tree object\"));\n \tparse_tree(tree);\n \tinit_tree_desc(&t, tree->buffer, tree->size);\n \tif (unpack_trees(1, &t, &opts))\n@@ -298,9 +298,9 @@ static char *prepare_index(int argc, const char **argv, const char *prefix, int\n \t\trefresh_flags |= REFRESH_UNMERGED;\n \tif (interactive) {\n \t\tif (interactive_add(argc, argv, prefix) != 0)\n-\t\t\tdie(\"interactive add failed\");\n+\t\t\tdie(_(\"interactive add failed\"));\n \t\tif (read_cache_preload(NULL) < 0)\n-\t\t\tdie(\"index file corrupt\");\n+\t\t\tdie(_(\"index file corrupt\"));\n \t\tcommit_style = COMMIT_AS_IS;\n \t\treturn get_index_file();\n \t}\n@@ -309,7 +309,7 @@ static char *prepare_index(int argc, const char **argv, const char *prefix, int\n \t\tpathspec = get_pathspec(prefix, argv);\n \n \tif (read_cache_preload(pathspec) < 0)\n-\t\tdie(\"index file corrupt\");\n+\t\tdie(_(\"index file corrupt\"));\n \n \t/*\n \t * Non partial, non as-is commit.\n@@ -329,7 +329,7 @@ static char *prepare_index(int argc, const char **argv, const char *prefix, int\n \t\trefresh_cache_or_die(refresh_flags);\n \t\tif (write_cache(fd, active_cache, active_nr) ||\n \t\t    close_lock_file(&index_lock))\n-\t\t\tdie(\"unable to write new_index file\");\n+\t\t\tdie(_(\"unable to write new_index file\"));\n \t\tcommit_style = COMMIT_NORMAL;\n \t\treturn index_lock.filename;\n \t}\n@@ -349,7 +349,7 @@ static char *prepare_index(int argc, const char **argv, const char *prefix, int\n \t\tif (active_cache_changed) {\n \t\t\tif (write_cache(fd, active_cache, active_nr) ||\n \t\t\t    commit_locked_index(&index_lock))\n-\t\t\t\tdie(\"unable to write new_index file\");\n+\t\t\t\tdie(_(\"unable to write new_index file\"));\n \t\t} else {\n \t\t\trollback_lock_file(&index_lock);\n \t\t}\n@@ -379,7 +379,7 @@ static char *prepare_index(int argc, const char **argv, const char *prefix, int\n \tcommit_style = COMMIT_PARTIAL;\n \n \tif (in_merge)\n-\t\tdie(\"cannot do a partial commit during a merge.\");\n+\t\tdie(_(\"cannot do a partial commit during a merge.\"));\n \n \tmemset(&partial, 0, sizeof(partial));\n \tpartial.strdup_strings = 1;\n@@ -388,14 +388,14 @@ static char *prepare_index(int argc, const char **argv, const char *prefix, int\n \n \tdiscard_cache();\n \tif (read_cache() < 0)\n-\t\tdie(\"cannot read the index\");\n+\t\tdie(_(\"cannot read the index\"));\n \n \tfd = hold_locked_index(&index_lock, 1);\n \tadd_remove_files(&partial);\n \trefresh_cache(REFRESH_QUIET);\n \tif (write_cache(fd, active_cache, active_nr) ||\n \t    close_lock_file(&index_lock))\n-\t\tdie(\"unable to write new_index file\");\n+\t\tdie(_(\"unable to write new_index file\"));\n \n \tfd = hold_lock_file_for_update(&false_lock,\n \t\t\t\t       git_path(\"next-index-%\"PRIuMAX,\n@@ -408,7 +408,7 @@ static char *prepare_index(int argc, const char **argv, const char *prefix, int\n \n \tif (write_cache(fd, active_cache, active_nr) ||\n \t    close_lock_file(&false_lock))\n-\t\tdie(\"unable to write temporary index file\");\n+\t\tdie(_(\"unable to write temporary index file\"));\n \n \tdiscard_cache();\n \tread_cache_from(false_lock.filename);\n@@ -455,7 +455,7 @@ static int is_a_merge(const unsigned char *sha1)\n {\n \tstruct commit *commit = lookup_commit(sha1);\n \tif (!commit || parse_commit(commit))\n-\t\tdie(\"could not parse HEAD commit\");\n+\t\tdie(_(\"could not parse HEAD commit\"));\n \treturn !!(commit->parents && commit->parents->next);\n }\n \n@@ -474,13 +474,13 @@ static void determine_author_info(struct strbuf *author_ident)\n \n \t\ta = strstr(use_message_buffer, \"\\nauthor \");\n \t\tif (!a)\n-\t\t\tdie(\"invalid commit: %s\", use_message);\n+\t\t\tdie(_(\"invalid commit: %s\"), use_message);\n \n \t\tlb = strchrnul(a + strlen(\"\\nauthor \"), '<');\n \t\trb = strchrnul(lb, '>');\n \t\teol = strchrnul(rb, '\\n');\n \t\tif (!*lb || !*rb || !*eol)\n-\t\t\tdie(\"invalid commit: %s\", use_message);\n+\t\t\tdie(_(\"invalid commit: %s\"), use_message);\n \n \t\tif (lb == a + strlen(\"\\nauthor \"))\n \t\t\t/* \\nauthor <foo@example.com> */\n@@ -498,7 +498,7 @@ static void determine_author_info(struct strbuf *author_ident)\n \t\tconst char *rb = strchr(force_author, '>');\n \n \t\tif (!lb || !rb)\n-\t\t\tdie(\"malformed --author parameter\");\n+\t\t\tdie(_(\"malformed --author parameter\"));\n \t\tname = xstrndup(force_author, lb - force_author);\n \t\temail = xstrndup(lb + 2, rb - (lb + 2));\n \t}\n@@ -554,7 +554,7 @@ static char *cut_ident_timestamp_part(char *string)\n {\n \tchar *ket = strrchr(string, '>');\n \tif (!ket || ket[1] != ' ')\n-\t\tdie(\"Malformed ident string: '%s'\", string);\n+\t\tdie(_(\"Malformed ident string: '%s'\"), string);\n \t*++ket = '\\0';\n \treturn ket;\n }\n@@ -588,7 +588,7 @@ static int prepare_to_commit(const char *index_file, const char *prefix,\n \t\t\tstruct commit *c;\n \t\t\tc = lookup_commit_reference_by_name(squash_message);\n \t\t\tif (!c)\n-\t\t\t\tdie(\"could not lookup commit %s\", squash_message);\n+\t\t\t\tdie(_(\"could not lookup commit %s\"), squash_message);\n \t\t\tctx.output_encoding = get_commit_output_encoding();\n \t\t\tformat_commit_message(c, \"squash! %s\\n\\n\", &sb,\n \t\t\t\t\t      &ctx);\n@@ -600,19 +600,19 @@ static int prepare_to_commit(const char *index_file, const char *prefix,\n \t\thook_arg1 = \"message\";\n \t} else if (logfile && !strcmp(logfile, \"-\")) {\n \t\tif (isatty(0))\n-\t\t\tfprintf(stderr, \"(reading log message from standard input)\\n\");\n+\t\t\tfprintf(stderr, _(\"(reading log message from standard input)\\n\"));\n \t\tif (strbuf_read(&sb, 0, 0) < 0)\n-\t\t\tdie_errno(\"could not read log from standard input\");\n+\t\t\tdie_errno(_(\"could not read log from standard input\"));\n \t\thook_arg1 = \"message\";\n \t} else if (logfile) {\n \t\tif (strbuf_read_file(&sb, logfile, 0) < 0)\n-\t\t\tdie_errno(\"could not read log file '%s'\",\n+\t\t\tdie_errno(_(\"could not read log file '%s'\"),\n \t\t\t\t  logfile);\n \t\thook_arg1 = \"message\";\n \t} else if (use_message) {\n \t\tbuffer = strstr(use_message_buffer, \"\\n\\n\");\n \t\tif (!buffer || buffer[2] == '\\0')\n-\t\t\tdie(\"commit has empty message\");\n+\t\t\tdie(_(\"commit has empty message\"));\n \t\tstrbuf_add(&sb, buffer + 2, strlen(buffer + 2));\n \t\thook_arg1 = \"commit\";\n \t\thook_arg2 = use_message;\n@@ -621,22 +621,22 @@ static int prepare_to_commit(const char *index_file, const char *prefix,\n \t\tstruct commit *commit;\n \t\tcommit = lookup_commit_reference_by_name(fixup_message);\n \t\tif (!commit)\n-\t\t\tdie(\"could not lookup commit %s\", fixup_message);\n+\t\t\tdie(_(\"could not lookup commit %s\"), fixup_message);\n \t\tctx.output_encoding = get_commit_output_encoding();\n \t\tformat_commit_message(commit, \"fixup! %s\\n\\n\",\n \t\t\t\t      &sb, &ctx);\n \t\thook_arg1 = \"message\";\n \t} else if (!stat(git_path(\"MERGE_MSG\"), &statbuf)) {\n \t\tif (strbuf_read_file(&sb, git_path(\"MERGE_MSG\"), 0) < 0)\n-\t\t\tdie_errno(\"could not read MERGE_MSG\");\n+\t\t\tdie_errno(_(\"could not read MERGE_MSG\"));\n \t\thook_arg1 = \"merge\";\n \t} else if (!stat(git_path(\"SQUASH_MSG\"), &statbuf)) {\n \t\tif (strbuf_read_file(&sb, git_path(\"SQUASH_MSG\"), 0) < 0)\n-\t\t\tdie_errno(\"could not read SQUASH_MSG\");\n+\t\t\tdie_errno(_(\"could not read SQUASH_MSG\"));\n \t\thook_arg1 = \"squash\";\n \t} else if (template_file && !stat(template_file, &statbuf)) {\n \t\tif (strbuf_read_file(&sb, template_file, 0) < 0)\n-\t\t\tdie_errno(\"could not read '%s'\", template_file);\n+\t\t\tdie_errno(_(\"could not read '%s'\"), template_file);\n \t\thook_arg1 = \"template\";\n \t}\n \n@@ -659,7 +659,7 @@ static int prepare_to_commit(const char *index_file, const char *prefix,\n \n \tfp = fopen(git_path(commit_editmsg), \"w\");\n \tif (fp == NULL)\n-\t\tdie_errno(\"could not open '%s'\", git_path(commit_editmsg));\n+\t\tdie_errno(_(\"could not open '%s'\"), git_path(commit_editmsg));\n \n \tif (cleanup_mode != CLEANUP_NONE)\n \t\tstripspace(&sb, 0);\n@@ -683,7 +683,7 @@ static int prepare_to_commit(const char *index_file, const char *prefix,\n \t}\n \n \tif (fwrite(sb.buf, 1, sb.len, fp) < sb.len)\n-\t\tdie_errno(\"could not write commit template\");\n+\t\tdie_errno(_(\"could not write commit template\"));\n \n \tstrbuf_release(&sb);\n \n@@ -752,7 +752,7 @@ static int prepare_to_commit(const char *index_file, const char *prefix,\n \t\tconst char *parent = \"HEAD\";\n \n \t\tif (!active_nr && read_cache() < 0)\n-\t\t\tdie(\"Cannot read index\");\n+\t\t\tdie(_(\"Cannot read index\"));\n \n \t\tif (amend)\n \t\t\tparent = \"HEAD^1\";\n@@ -785,7 +785,7 @@ static int prepare_to_commit(const char *index_file, const char *prefix,\n \t\tactive_cache_tree = cache_tree();\n \tif (cache_tree_update(active_cache_tree,\n \t\t\t      active_cache, active_nr, 0, 0) < 0) {\n-\t\terror(\"Error building trees\");\n+\t\terror(_(\"Error building trees\"));\n \t\treturn 0;\n \t}\n \n@@ -800,7 +800,7 @@ static int prepare_to_commit(const char *index_file, const char *prefix,\n \t\tsnprintf(index, sizeof(index), \"GIT_INDEX_FILE=%s\", index_file);\n \t\tif (launch_editor(git_path(commit_editmsg), NULL, env)) {\n \t\t\tfprintf(stderr,\n-\t\t\t\"Please supply the message using either -m or -F option.\\n\");\n+\t\t\t_(\"Please supply the message using either -m or -F option.\\n\"));\n \t\t\texit(1);\n \t\t}\n \t}\n@@ -880,7 +880,7 @@ static const char *find_author_by_nickname(const char *name)\n \t\tformat_commit_message(commit, \"%an <%ae>\", &buf, &ctx);\n \t\treturn strbuf_detach(&buf, NULL);\n \t}\n-\tdie(\"No existing author found with '%s'\", name);\n+\tdie(_(\"No existing author found with '%s'\"), name);\n }\n \n \n@@ -895,7 +895,7 @@ static void handle_untracked_files_arg(struct wt_status *s)\n \telse if (!strcmp(untracked_files_arg, \"all\"))\n \t\ts->show_untracked_files = SHOW_ALL_UNTRACKED_FILES;\n \telse\n-\t\tdie(\"Invalid untracked files mode '%s'\", untracked_files_arg);\n+\t\tdie(_(\"Invalid untracked files mode '%s'\"), untracked_files_arg);\n }\n \n static int parse_and_validate_options(int argc, const char *argv[],\n@@ -912,7 +912,7 @@ static int parse_and_validate_options(int argc, const char *argv[],\n \t\tforce_author = find_author_by_nickname(force_author);\n \n \tif (force_author && renew_authorship)\n-\t\tdie(\"Using both --reset-author and --author does not make sense\");\n+\t\tdie(_(\"Using both --reset-author and --author does not make sense\"));\n \n \tif (logfile || message.len || use_message || fixup_message)\n \t\tuse_editor = 0;\n@@ -926,7 +926,7 @@ static int parse_and_validate_options(int argc, const char *argv[],\n \n \t/* Sanity check options */\n \tif (amend && initial_commit)\n-\t\tdie(\"You have nothing to amend.\");\n+\t\tdie(_(\"You have nothing to amend.\"));\n \tif (amend && in_merge)\n \t\tdie(\"You are in the middle of a merge -- cannot amend.\");\n \tif (fixup_message && squash_message)\n@@ -940,22 +940,22 @@ static int parse_and_validate_options(int argc, const char *argv[],\n \tif (logfile)\n \t\tf++;\n \tif (f > 1)\n-\t\tdie(\"Only one of -c/-C/-F/--fixup can be used.\");\n+\t\tdie(_(\"Only one of -c/-C/-F/--fixup can be used.\"));\n \tif (message.len && f > 0)\n-\t\tdie(\"Option -m cannot be combined with -c/-C/-F/--fixup.\");\n+\t\tdie((_(\"Option -m cannot be combined with -c/-C/-F/--fixup.\")));\n \tif (edit_message)\n \t\tuse_message = edit_message;\n \tif (amend && !use_message && !fixup_message)\n \t\tuse_message = \"HEAD\";\n \tif (!use_message && renew_authorship)\n-\t\tdie(\"--reset-author can be used only with -C, -c or --amend.\");\n+\t\tdie(_(\"--reset-author can be used only with -C, -c or --amend.\"));\n \tif (use_message) {\n \t\tconst char *out_enc;\n \t\tstruct commit *commit;\n \n \t\tcommit = lookup_commit_reference_by_name(use_message);\n \t\tif (!commit)\n-\t\t\tdie(\"could not lookup commit %s\", use_message);\n+\t\t\tdie(_(\"could not lookup commit %s\"), use_message);\n \t\tout_enc = get_commit_output_encoding();\n \t\tuse_message_buffer = logmsg_reencode(commit, out_enc);\n \n@@ -970,13 +970,13 @@ static int parse_and_validate_options(int argc, const char *argv[],\n \t}\n \n \tif (!!also + !!only + !!all + !!interactive > 1)\n-\t\tdie(\"Only one of --include/--only/--all/--interactive can be used.\");\n+\t\tdie(_(\"Only one of --include/--only/--all/--interactive can be used.\"));\n \tif (argc == 0 && (also || (only && !amend)))\n-\t\tdie(\"No paths with --include/--only does not make sense.\");\n+\t\tdie(_(\"No paths with --include/--only does not make sense.\"));\n \tif (argc == 0 && only && amend)\n-\t\tonly_include_assumed = \"Clever... amending the last one with dirty index.\";\n+\t\tonly_include_assumed = _(\"Clever... amending the last one with dirty index.\");\n \tif (argc > 0 && !also && !only)\n-\t\tonly_include_assumed = \"Explicit paths specified without -i nor -o; assuming --only paths...\";\n+\t\tonly_include_assumed = _(\"Explicit paths specified without -i nor -o; assuming --only paths...\");\n \tif (!cleanup_arg || !strcmp(cleanup_arg, \"default\"))\n \t\tcleanup_mode = use_editor ? CLEANUP_ALL : CLEANUP_SPACE;\n \telse if (!strcmp(cleanup_arg, \"verbatim\"))\n@@ -986,14 +986,14 @@ static int parse_and_validate_options(int argc, const char *argv[],\n \telse if (!strcmp(cleanup_arg, \"strip\"))\n \t\tcleanup_mode = CLEANUP_ALL;\n \telse\n-\t\tdie(\"Invalid cleanup mode %s\", cleanup_arg);\n+\t\tdie(_(\"Invalid cleanup mode %s\"), cleanup_arg);\n \n \thandle_untracked_files_arg(s);\n \n \tif (all && argc > 0)\n-\t\tdie(\"Paths with -a does not make sense.\");\n+\t\tdie(_(\"Paths with -a does not make sense.\"));\n \telse if (interactive && argc > 0)\n-\t\tdie(\"Paths with --interactive does not make sense.\");\n+\t\tdie(_(\"Paths with --interactive does not make sense.\"));\n \n \tif (null_termination && status_format == STATUS_FORMAT_LONG)\n \t\tstatus_format = STATUS_FORMAT_PORCELAIN;\n@@ -1074,7 +1074,7 @@ static int git_status_config(const char *k, const char *v, void *cb)\n \t\telse if (!strcmp(v, \"all\"))\n \t\t\ts->show_untracked_files = SHOW_ALL_UNTRACKED_FILES;\n \t\telse\n-\t\t\treturn error(\"Invalid untracked files mode '%s'\", v);\n+\t\t\treturn error(_(\"Invalid untracked files mode '%s'\"), v);\n \t\treturn 0;\n \t}\n \treturn git_diff_ui_config(k, v, NULL);\n@@ -1180,9 +1180,9 @@ static void print_summary(const char *prefix, const unsigned char *sha1)\n \n \tcommit = lookup_commit(sha1);\n \tif (!commit)\n-\t\tdie(\"couldn't look up newly created commit\");\n+\t\tdie(_(\"couldn't look up newly created commit\"));\n \tif (!commit || parse_commit(commit))\n-\t\tdie(\"could not parse newly created commit\");\n+\t\tdie(_(\"could not parse newly created commit\"));\n \n \tstrbuf_addstr(&format, \"format:%h] %s\");\n \n@@ -1336,7 +1336,7 @@ int cmd_commit(int argc, const char **argv, const char *prefix)\n \t\t\treflog_msg = \"commit (amend)\";\n \t\tcommit = lookup_commit(head_sha1);\n \t\tif (!commit || parse_commit(commit))\n-\t\t\tdie(\"could not parse HEAD commit\");\n+\t\t\tdie(_(\"could not parse HEAD commit\"));\n \n \t\tfor (c = commit->parents; c; c = c->next)\n \t\t\tpptr = &commit_list_insert(c->item, pptr)->next;\n@@ -1349,19 +1349,19 @@ int cmd_commit(int argc, const char **argv, const char *prefix)\n \t\tpptr = &commit_list_insert(lookup_commit(head_sha1), pptr)->next;\n \t\tfp = fopen(git_path(\"MERGE_HEAD\"), \"r\");\n \t\tif (fp == NULL)\n-\t\t\tdie_errno(\"could not open '%s' for reading\",\n+\t\t\tdie_errno(_(\"could not open '%s' for reading\"),\n \t\t\t\t  git_path(\"MERGE_HEAD\"));\n \t\twhile (strbuf_getline(&m, fp, '\\n') != EOF) {\n \t\t\tunsigned char sha1[20];\n \t\t\tif (get_sha1_hex(m.buf, sha1) < 0)\n-\t\t\t\tdie(\"Corrupt MERGE_HEAD file (%s)\", m.buf);\n+\t\t\t\tdie(_(\"Corrupt MERGE_HEAD file (%s)\"), m.buf);\n \t\t\tpptr = &commit_list_insert(lookup_commit(sha1), pptr)->next;\n \t\t}\n \t\tfclose(fp);\n \t\tstrbuf_release(&m);\n \t\tif (!stat(git_path(\"MERGE_MODE\"), &statbuf)) {\n \t\t\tif (strbuf_read_file(&sb, git_path(\"MERGE_MODE\"), 0) < 0)\n-\t\t\t\tdie_errno(\"could not read MERGE_MODE\");\n+\t\t\t\tdie_errno(_(\"could not read MERGE_MODE\"));\n \t\t\tif (!strcmp(sb.buf, \"no-ff\"))\n \t\t\t\tallow_fast_forward = 0;\n \t\t}\n@@ -1378,7 +1378,7 @@ int cmd_commit(int argc, const char **argv, const char *prefix)\n \tif (strbuf_read_file(&sb, git_path(commit_editmsg), 0) < 0) {\n \t\tint saved_errno = errno;\n \t\trollback_index_files();\n-\t\tdie(\"could not read commit message: %s\", strerror(saved_errno));\n+\t\tdie(_(\"could not read commit message: %s\"), strerror(saved_errno));\n \t}\n \n \t/* Truncate the message just before the diff, if any. */\n@@ -1392,14 +1392,14 @@ int cmd_commit(int argc, const char **argv, const char *prefix)\n \t\tstripspace(&sb, cleanup_mode == CLEANUP_ALL);\n \tif (message_is_empty(&sb) && !allow_empty_message) {\n \t\trollback_index_files();\n-\t\tfprintf(stderr, \"Aborting commit due to empty commit message.\\n\");\n+\t\tfprintf(stderr, _(\"Aborting commit due to empty commit message.\\n\"));\n \t\texit(1);\n \t}\n \n \tif (commit_tree(sb.buf, active_cache_tree->sha1, parents, commit_sha1,\n \t\t\tauthor_ident.buf)) {\n \t\trollback_index_files();\n-\t\tdie(\"failed to write commit object\");\n+\t\tdie(_(\"failed to write commit object\"));\n \t}\n \tstrbuf_release(&author_ident);\n \n@@ -1417,11 +1417,11 @@ int cmd_commit(int argc, const char **argv, const char *prefix)\n \n \tif (!ref_lock) {\n \t\trollback_index_files();\n-\t\tdie(\"cannot lock HEAD ref\");\n+\t\tdie(_(\"cannot lock HEAD ref\"));\n \t}\n \tif (write_ref_sha1(ref_lock, commit_sha1, sb.buf) < 0) {\n \t\trollback_index_files();\n-\t\tdie(\"cannot update HEAD ref\");\n+\t\tdie(_(\"cannot update HEAD ref\"));\n \t}\n \n \tunlink(git_path(\"MERGE_HEAD\"));\n@@ -1430,9 +1430,9 @@ int cmd_commit(int argc, const char **argv, const char *prefix)\n \tunlink(git_path(\"SQUASH_MSG\"));\n \n \tif (commit_index_files())\n-\t\tdie (\"Repository has been updated, but unable to write\\n\"\n+\t\tdie (_(\"Repository has been updated, but unable to write\\n\"\n \t\t     \"new_index file. Check that disk is not full or quota is\\n\"\n-\t\t     \"not exceeded, and then \\\"git reset HEAD\\\" to recover.\");\n+\t\t     \"not exceeded, and then \\\"git reset HEAD\\\" to recover.\"));\n \n \trerere(0);\n \trun_hook(get_index_file(), \"post-commit\", NULL);\n-- \n1.7.2.3\n"},{"id":"161706","messageId":"1298143495-3681-26-git-send-email-avarab@gmail.com","threadId":"26561","inReplyTo":"1298143495-3681-1-git-send-email-avarab@gmail.com","subject":"[PATCH 25/72] gettextize: git-commit \"middle of a merge\" message","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2011-02-19T19:24:08Z","receivedAt":"2011-02-19T19:24:08Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"Gettextize the \"You are in the middle of a merge -- cannot amend.\"\nmessage. Several tests in t7110-reset-merge.sh explicitly checked for\nthis message. Change them to skip under GETTEXT_POISON=YesPlease.\n\nSigned-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n builtin/commit.c       |    4 ++--\n t/t7110-reset-merge.sh |    6 +++---\n 2 files changed, 5 insertions(+), 5 deletions(-)\n\ndiff --git a/builtin/commit.c b/builtin/commit.c\nindex c57f603..0198e90 100644\n--- a/builtin/commit.c\n+++ b/builtin/commit.c\n@@ -928,9 +928,9 @@ static int parse_and_validate_options(int argc, const char *argv[],\n \tif (amend && initial_commit)\n \t\tdie(_(\"You have nothing to amend.\"));\n \tif (amend && in_merge)\n-\t\tdie(\"You are in the middle of a merge -- cannot amend.\");\n+\t\tdie(_(\"You are in the middle of a merge -- cannot amend.\"));\n \tif (fixup_message && squash_message)\n-\t\tdie(\"Options --squash and --fixup cannot be used together\");\n+\t\tdie(_(\"Options --squash and --fixup cannot be used together\"));\n \tif (use_message)\n \t\tf++;\n \tif (edit_message)\ndiff --git a/t/t7110-reset-merge.sh b/t/t7110-reset-merge.sh\nindex 70cdd8e..8e54f0c 100755\n--- a/t/t7110-reset-merge.sh\n+++ b/t/t7110-reset-merge.sh\n@@ -233,7 +233,7 @@ test_expect_success '\"reset --merge HEAD^\" is ok with pending merge' '\n #           working index HEAD target         working index HEAD\n #           ----------------------------------------------------\n # file1:     X       U     B    C     --keep   (disallowed)\n-test_expect_success '\"reset --keep HEAD^\" fails with pending merge' '\n+test_expect_success NO_GETTEXT_POISON '\"reset --keep HEAD^\" fails with pending merge' '\n     git reset --hard third &&\n     test_must_fail git merge branch1 &&\n     test_must_fail git reset --keep HEAD^ 2>err.log &&\n@@ -259,7 +259,7 @@ test_expect_success '\"reset --merge HEAD\" is ok with pending merge' '\n #           working index HEAD target         working index HEAD\n #           ----------------------------------------------------\n # file1:     X       U     B    B     --keep   (disallowed)\n-test_expect_success '\"reset --keep HEAD\" fails with pending merge' '\n+test_expect_success NO_GETTEXT_POISON '\"reset --keep HEAD\" fails with pending merge' '\n     git reset --hard third &&\n     test_must_fail git merge branch1 &&\n     test_must_fail git reset --keep HEAD 2>err.log &&\n@@ -280,7 +280,7 @@ test_expect_success '--merge is ok with added/deleted merge' '\n     git diff --exit-code --cached\n '\n \n-test_expect_success '--keep fails with added/deleted merge' '\n+test_expect_success NO_GETTEXT_POISON '--keep fails with added/deleted merge' '\n     git reset --hard third &&\n     rm -f file2 &&\n     test_must_fail git merge branch3 &&\n-- \n1.7.2.3\n"},{"id":"161712","messageId":"1298143495-3681-27-git-send-email-avarab@gmail.com","threadId":"26561","inReplyTo":"1298143495-3681-1-git-send-email-avarab@gmail.com","subject":"[PATCH 26/72] gettextize: git-commit formatting messages","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2011-02-19T19:24:09Z","receivedAt":"2011-02-19T19:24:09Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n builtin/commit.c  |   12 ++++++------\n t/t7502-commit.sh |    4 ++--\n 2 files changed, 8 insertions(+), 8 deletions(-)\n\ndiff --git a/builtin/commit.c b/builtin/commit.c\nindex 0198e90..c7c6c59 100644\n--- a/builtin/commit.c\n+++ b/builtin/commit.c\n@@ -696,12 +696,12 @@ static int prepare_to_commit(const char *index_file, const char *prefix,\n \t\tchar *ai_tmp, *ci_tmp;\n \t\tif (in_merge)\n \t\t\tfprintf(fp,\n-\t\t\t\t\"#\\n\"\n+\t\t\t\t_(\"#\\n\"\n \t\t\t\t\"# It looks like you may be committing a MERGE.\\n\"\n \t\t\t\t\"# If this is not correct, please remove the file\\n\"\n \t\t\t\t\"#\t%s\\n\"\n \t\t\t\t\"# and try again.\\n\"\n-\t\t\t\t\"#\\n\",\n+\t\t\t\t\"#\\n\"),\n \t\t\t\tgit_path(\"MERGE_HEAD\"));\n \n \t\tfprintf(fp,\n@@ -725,15 +725,15 @@ static int prepare_to_commit(const char *index_file, const char *prefix,\n \t\tci_tmp = cut_ident_timestamp_part(committer_ident.buf);\n \t\tif (strcmp(author_ident->buf, committer_ident.buf))\n \t\t\tfprintf(fp,\n-\t\t\t\t\"%s\"\n-\t\t\t\t\"# Author:    %s\\n\",\n+\t\t\t\t_(\"%s\"\n+\t\t\t\t\"# Author:    %s\\n\"),\n \t\t\t\tident_shown++ ? \"\" : \"#\\n\",\n \t\t\t\tauthor_ident->buf);\n \n \t\tif (!user_ident_sufficiently_given())\n \t\t\tfprintf(fp,\n-\t\t\t\t\"%s\"\n-\t\t\t\t\"# Committer: %s\\n\",\n+\t\t\t\t_(\"%s\"\n+\t\t\t\t\"# Committer: %s\\n\"),\n \t\t\t\tident_shown++ ? \"\" : \"#\\n\",\n \t\t\t\tcommitter_ident.buf);\n \ndiff --git a/t/t7502-commit.sh b/t/t7502-commit.sh\nindex 50da034..9204a4d 100755\n--- a/t/t7502-commit.sh\n+++ b/t/t7502-commit.sh\n@@ -234,7 +234,7 @@ echo \"#\n # Author:    $GIT_AUTHOR_NAME <$GIT_AUTHOR_EMAIL>\n #\" >> expect\n \n-test_expect_success 'author different from committer' '\n+test_expect_success NO_GETTEXT_POISON 'author different from committer' '\n \n \techo >>negative &&\n \tgit commit -e -m \"sample\"\n@@ -248,7 +248,7 @@ rm -f expect.tmp\n echo \"# Committer:\n #\" >> expect\n \n-test_expect_success 'committer is automatic' '\n+test_expect_success NO_GETTEXT_POISON 'committer is automatic' '\n \n \techo >>negative &&\n \t(\n-- \n1.7.2.3\n"},{"id":"161709","messageId":"1298143495-3681-28-git-send-email-avarab@gmail.com","threadId":"26561","inReplyTo":"1298143495-3681-1-git-send-email-avarab@gmail.com","subject":"[PATCH 27/72] gettextize: git-commit print_summary messages","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2011-02-19T19:24:10Z","receivedAt":"2011-02-19T19:24:10Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"Gettextize the \"(root-commit)\" and \"detached HEAD\" fragments that\nappear when you commit either the root commit, or a commit in a\ndetached head translatable.\n\nSigned-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n builtin/commit.c  |    4 ++--\n t/t7502-commit.sh |   10 ++++++++--\n 2 files changed, 10 insertions(+), 4 deletions(-)\n\ndiff --git a/builtin/commit.c b/builtin/commit.c\nindex c7c6c59..c90a8cf 100644\n--- a/builtin/commit.c\n+++ b/builtin/commit.c\n@@ -1223,9 +1223,9 @@ static void print_summary(const char *prefix, const unsigned char *sha1)\n \t\t!prefixcmp(head, \"refs/heads/\") ?\n \t\t\thead + 11 :\n \t\t\t!strcmp(head, \"HEAD\") ?\n-\t\t\t\t\"detached HEAD\" :\n+\t\t\t\t_(\"detached HEAD\") :\n \t\t\t\thead,\n-\t\tinitial_commit ? \" (root-commit)\" : \"\");\n+\t\tinitial_commit ? _(\" (root-commit)\") : \"\");\n \n \tif (!log_tree_commit(&rev, commit)) {\n \t\trev.always_show_header = 1;\ndiff --git a/t/t7502-commit.sh b/t/t7502-commit.sh\nindex 9204a4d..298f7d9 100755\n--- a/t/t7502-commit.sh\n+++ b/t/t7502-commit.sh\n@@ -22,7 +22,10 @@ check_summary_oneline() {\n \tSUMMARY_POSTFIX=\"$(git log -1 --pretty='format:%h')\"\n \techo \"[$SUMMARY_PREFIX $SUMMARY_POSTFIX] $2\" >exp &&\n \n-\ttest_cmp exp act\n+\tif test_have_prereq NO_GETTEXT_POISON\n+\tthen\n+\t\ttest_cmp exp act\n+\tfi\n }\n \n test_expect_success 'output summary format' '\n@@ -32,7 +35,10 @@ test_expect_success 'output summary format' '\n \tcheck_summary_oneline \"root-commit\" \"initial\" &&\n \n \techo change >>file1 &&\n-\tgit add file1 &&\n+\tgit add file1\n+'\n+\n+test_expect_success 'output summary format: root-commit' '\n \tcheck_summary_oneline \"\" \"a change\"\n '\n \n-- \n1.7.2.3\n"},{"id":"161708","messageId":"1298143495-3681-29-git-send-email-avarab@gmail.com","threadId":"26561","inReplyTo":"1298143495-3681-1-git-send-email-avarab@gmail.com","subject":"[PATCH 28/72] gettextize: git-commit \"enter the commit message\" message","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2011-02-19T19:24:11Z","receivedAt":"2011-02-19T19:24:11Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"Gettextize the \"# Please enter the commit message for your changes.\"\nmessage. Several tests in t7500-commit.sh and t7502-commit.sh assume\nthat this message starts with a newline. Change the tests to to skip\nunder GETTEXT_POISON=YesPlease.\n\nThese fail under GETTEXT_POISON=YesPlease because the poison editor\nmessage doesn't do the right thing with comments and line breaks, so\nthese messages will be incorrectly broken up across lines.\n\nThis test should not be skipped under a hypothetical future testing\nmode that tests Git under language locales, since those messages\nshould all start with a newline like the original.\n\nSigned-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n builtin/commit.c  |   12 ++++++------\n t/t7500-commit.sh |    8 ++++----\n t/t7502-commit.sh |   26 +++++++++++++++++---------\n 3 files changed, 27 insertions(+), 19 deletions(-)\n\ndiff --git a/builtin/commit.c b/builtin/commit.c\nindex c90a8cf..ac8da45 100644\n--- a/builtin/commit.c\n+++ b/builtin/commit.c\n@@ -705,19 +705,19 @@ static int prepare_to_commit(const char *index_file, const char *prefix,\n \t\t\t\tgit_path(\"MERGE_HEAD\"));\n \n \t\tfprintf(fp,\n-\t\t\t\"\\n\"\n-\t\t\t\"# Please enter the commit message for your changes.\");\n+\t\t\t_(\"\\n\"\n+\t\t\t\"# Please enter the commit message for your changes.\"));\n \t\tif (cleanup_mode == CLEANUP_ALL)\n \t\t\tfprintf(fp,\n-\t\t\t\t\" Lines starting\\n\"\n+\t\t\t\t_(\" Lines starting\\n\"\n \t\t\t\t\"# with '#' will be ignored, and an empty\"\n-\t\t\t\t\" message aborts the commit.\\n\");\n+\t\t\t\t\" message aborts the commit.\\n\"));\n \t\telse /* CLEANUP_SPACE, that is. */\n \t\t\tfprintf(fp,\n-\t\t\t\t\" Lines starting\\n\"\n+\t\t\t\t_(\" Lines starting\\n\"\n \t\t\t\t\"# with '#' will be kept; you may remove them\"\n \t\t\t\t\" yourself if you want to.\\n\"\n-\t\t\t\t\"# An empty message aborts the commit.\\n\");\n+\t\t\t\t\"# An empty message aborts the commit.\\n\"));\n \t\tif (only_include_assumed)\n \t\t\tfprintf(fp, \"# %s\\n\", only_include_assumed);\n \ndiff --git a/t/t7500-commit.sh b/t/t7500-commit.sh\nindex 162527c..70dfc88 100755\n--- a/t/t7500-commit.sh\n+++ b/t/t7500-commit.sh\n@@ -59,7 +59,7 @@ test_expect_success 'adding comments to a template should not commit' '\n \t)\n '\n \n-test_expect_success 'adding real content to a template should commit' '\n+test_expect_success NO_GETTEXT_POISON 'adding real content to a template should commit' '\n \t(\n \t\ttest_set_editor \"$TEST_DIRECTORY\"/t7500/add-content &&\n \t\tgit commit --template \"$TEMPLATE\"\n@@ -67,7 +67,7 @@ test_expect_success 'adding real content to a template should commit' '\n \tcommit_msg_is \"template linecommit message\"\n '\n \n-test_expect_success '-t option should be short for --template' '\n+test_expect_success NO_GETTEXT_POISON '-t option should be short for --template' '\n \techo \"short template\" > \"$TEMPLATE\" &&\n \techo \"new content\" >> foo &&\n \tgit add foo &&\n@@ -78,7 +78,7 @@ test_expect_success '-t option should be short for --template' '\n \tcommit_msg_is \"short templatecommit message\"\n '\n \n-test_expect_success 'config-specified template should commit' '\n+test_expect_success NO_GETTEXT_POISON 'config-specified template should commit' '\n \techo \"new template\" > \"$TEMPLATE\" &&\n \tgit config commit.template \"$TEMPLATE\" &&\n \techo \"more content\" >> foo &&\n@@ -277,7 +277,7 @@ test_expect_success 'commit --squash works with -c for same commit' '\n \tcommit_msg_is \"squash! edited commit\"\n '\n \n-test_expect_success 'commit --squash works with editor' '\n+test_expect_success NO_GETTEXT_POISON 'commit --squash works with editor' '\n \tcommit_for_rebase_autosquash_setup &&\n \ttest_set_editor \"$TEST_DIRECTORY\"/t7500/add-content &&\n \tgit commit --squash HEAD~1 &&\ndiff --git a/t/t7502-commit.sh b/t/t7502-commit.sh\nindex 298f7d9..6586355 100755\n--- a/t/t7502-commit.sh\n+++ b/t/t7502-commit.sh\n@@ -221,19 +221,21 @@ test_expect_success 'cleanup commit messages (strip,-F)' '\n \n '\n \n-echo \"sample\n-\n-# Please enter the commit message for your changes. Lines starting\n-# with '#' will be ignored, and an empty message aborts the commit.\" >expect\n-\n test_expect_success 'cleanup commit messages (strip,-F,-e)' '\n \n \techo >>negative &&\n \t{ echo;echo sample;echo; } >text &&\n \tgit commit -e -F text -a &&\n-\thead -n 4 .git/COMMIT_EDITMSG >actual &&\n-\ttest_cmp expect actual\n+\thead -n 4 .git/COMMIT_EDITMSG >actual\n+'\n+\n+echo \"sample\n \n+# Please enter the commit message for your changes. Lines starting\n+# with '#' will be ignored, and an empty message aborts the commit.\" >expect\n+\n+test_expect_success NO_GETTEXT_POISON 'cleanup commit messages (strip,-F,-e): output' '\n+\ttest_cmp expect actual\n '\n \n echo \"#\n@@ -244,7 +246,10 @@ test_expect_success NO_GETTEXT_POISON 'author different from committer' '\n \n \techo >>negative &&\n \tgit commit -e -m \"sample\"\n-\thead -n 7 .git/COMMIT_EDITMSG >actual &&\n+\thead -n 7 .git/COMMIT_EDITMSG >actual\n+'\n+\n+test_expect_success NO_GETTEXT_POISON 'author different from committer: output' '\n \ttest_cmp expect actual\n '\n \n@@ -264,7 +269,10 @@ test_expect_success NO_GETTEXT_POISON 'committer is automatic' '\n \t\ttest_must_fail git commit -e -m \"sample\"\n \t) &&\n \thead -n 8 .git/COMMIT_EDITMSG |\t\\\n-\tsed \"s/^# Committer: .*/# Committer:/\" >actual &&\n+\tsed \"s/^# Committer: .*/# Committer:/\" >actual\n+'\n+\n+test_expect_success NO_GETTEXT_POISON 'committer is automatic: output' '\n \ttest_cmp expect actual\n '\n \n-- \n1.7.2.3\n"},{"id":"161663","messageId":"1298143495-3681-30-git-send-email-avarab@gmail.com","threadId":"26561","inReplyTo":"1298143495-3681-1-git-send-email-avarab@gmail.com","subject":"[PATCH 29/72] gettextize: git-commit advice messages","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2011-02-19T19:24:12Z","receivedAt":"2011-02-19T19:24:12Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n builtin/commit.c |   12 ++++++------\n 1 files changed, 6 insertions(+), 6 deletions(-)\n\ndiff --git a/builtin/commit.c b/builtin/commit.c\nindex ac8da45..df881d5 100644\n--- a/builtin/commit.c\n+++ b/builtin/commit.c\n@@ -38,7 +38,7 @@ static const char * const builtin_status_usage[] = {\n };\n \n static const char implicit_ident_advice[] =\n-\"Your name and email address were configured automatically based\\n\"\n+N_(\"Your name and email address were configured automatically based\\n\"\n \"on your username and hostname. Please check that they are accurate.\\n\"\n \"You can suppress this message by setting them explicitly:\\n\"\n \"\\n\"\n@@ -47,12 +47,12 @@ static const char implicit_ident_advice[] =\n \"\\n\"\n \"After doing this, you may fix the identity used for this commit with:\\n\"\n \"\\n\"\n-\"    git commit --amend --reset-author\\n\";\n+\"    git commit --amend --reset-author\\n\");\n \n static const char empty_amend_advice[] =\n-\"You asked to amend the most recent commit, but doing so would make\\n\"\n+N_(\"You asked to amend the most recent commit, but doing so would make\\n\"\n \"it empty. You can repeat your command with --allow-empty, or you can\\n\"\n-\"remove the commit entirely with \\\"git reset HEAD^\\\".\\n\";\n+\"remove the commit entirely with \\\"git reset HEAD^\\\".\\n\");\n \n static unsigned char head_sha1[20];\n \n@@ -770,7 +770,7 @@ static int prepare_to_commit(const char *index_file, const char *prefix,\n \t    !(amend && is_a_merge(head_sha1))) {\n \t\trun_status(stdout, index_file, prefix, 0, s);\n \t\tif (amend)\n-\t\t\tfputs(empty_amend_advice, stderr);\n+\t\t\tfputs(_(empty_amend_advice), stderr);\n \t\treturn 0;\n \t}\n \n@@ -1197,7 +1197,7 @@ static void print_summary(const char *prefix, const unsigned char *sha1)\n \t\tstrbuf_addbuf_percentquote(&format, &committer_ident);\n \t\tif (advice_implicit_identity) {\n \t\t\tstrbuf_addch(&format, '\\n');\n-\t\t\tstrbuf_addstr(&format, implicit_ident_advice);\n+\t\t\tstrbuf_addstr(&format, _(implicit_ident_advice));\n \t\t}\n \t}\n \tstrbuf_release(&author_ident);\n-- \n1.7.2.3\n"},{"id":"161665","messageId":"1298143495-3681-31-git-send-email-avarab@gmail.com","threadId":"26561","inReplyTo":"1298143495-3681-1-git-send-email-avarab@gmail.com","subject":"[PATCH 30/72] gettextize: git-diff basic messages","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2011-02-19T19:24:13Z","receivedAt":"2011-02-19T19:24:13Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n builtin/diff.c |   18 +++++++++---------\n 1 files changed, 9 insertions(+), 9 deletions(-)\n\ndiff --git a/builtin/diff.c b/builtin/diff.c\nindex 42822cd..0034273 100644\n--- a/builtin/diff.c\n+++ b/builtin/diff.c\n@@ -71,9 +71,9 @@ static int builtin_diff_b_f(struct rev_info *revs,\n \t\tusage(builtin_diff_usage);\n \n \tif (lstat(path, &st))\n-\t\tdie_errno(\"failed to stat '%s'\", path);\n+\t\tdie_errno(_(\"failed to stat '%s'\"), path);\n \tif (!(S_ISREG(st.st_mode) || S_ISLNK(st.st_mode)))\n-\t\tdie(\"'%s': not a regular file or symlink\", path);\n+\t\tdie(_(\"'%s': not a regular file or symlink\"), path);\n \n \tdiff_set_mnemonic_prefix(&revs->diffopt, \"o/\", \"w/\");\n \n@@ -222,7 +222,7 @@ static int builtin_diff_files(struct rev_info *revs, int argc, const char **argv\n \t\telse if (!strcmp(argv[1], \"-h\"))\n \t\t\tusage(builtin_diff_usage);\n \t\telse\n-\t\t\treturn error(\"invalid option: %s\", argv[1]);\n+\t\t\treturn error(_(\"invalid option: %s\"), argv[1]);\n \t\targv++; argc--;\n \t}\n \n@@ -299,12 +299,12 @@ int cmd_diff(int argc, const char **argv, const char *prefix)\n \tDIFF_OPT_SET(&rev.diffopt, ALLOW_TEXTCONV);\n \n \tif (nongit)\n-\t\tdie(\"Not a git repository\");\n+\t\tdie(_(\"Not a git repository\"));\n \targc = setup_revisions(argc, argv, &rev, NULL);\n \tif (!rev.diffopt.output_format) {\n \t\trev.diffopt.output_format = DIFF_FORMAT_PATCH;\n \t\tif (diff_setup_done(&rev.diffopt) < 0)\n-\t\t\tdie(\"diff_setup_done failed\");\n+\t\t\tdie(_(\"diff_setup_done failed\"));\n \t}\n \n \tDIFF_OPT_SET(&rev.diffopt, RECURSIVE);\n@@ -349,12 +349,12 @@ int cmd_diff(int argc, const char **argv, const char *prefix)\n \t\t\tobj = parse_object(obj->sha1);\n \t\tobj = deref_tag(obj, NULL, 0);\n \t\tif (!obj)\n-\t\t\tdie(\"invalid object '%s' given.\", name);\n+\t\t\tdie(_(\"invalid object '%s' given.\"), name);\n \t\tif (obj->type == OBJ_COMMIT)\n \t\t\tobj = &((struct commit *)obj)->tree->object;\n \t\tif (obj->type == OBJ_TREE) {\n \t\t\tif (ARRAY_SIZE(ent) <= ents)\n-\t\t\t\tdie(\"more than %d trees given: '%s'\",\n+\t\t\t\tdie(_(\"more than %d trees given: '%s'\"),\n \t\t\t\t    (int) ARRAY_SIZE(ent), name);\n \t\t\tobj->flags |= flags;\n \t\t\tent[ents].item = obj;\n@@ -364,7 +364,7 @@ int cmd_diff(int argc, const char **argv, const char *prefix)\n \t\t}\n \t\tif (obj->type == OBJ_BLOB) {\n \t\t\tif (2 <= blobs)\n-\t\t\t\tdie(\"more than two blobs given: '%s'\", name);\n+\t\t\t\tdie(_(\"more than two blobs given: '%s'\"), name);\n \t\t\thashcpy(blob[blobs].sha1, obj->sha1);\n \t\t\tblob[blobs].name = name;\n \t\t\tblob[blobs].mode = list->mode;\n@@ -372,7 +372,7 @@ int cmd_diff(int argc, const char **argv, const char *prefix)\n \t\t\tcontinue;\n \n \t\t}\n-\t\tdie(\"unhandled object '%s' given.\", name);\n+\t\tdie(_(\"unhandled object '%s' given.\"), name);\n \t}\n \tif (rev.prune_data) {\n \t\tconst char **pathspec = rev.prune_data;\n-- \n1.7.2.3\n"},{"id":"161666","messageId":"1298143495-3681-32-git-send-email-avarab@gmail.com","threadId":"26561","inReplyTo":"1298143495-3681-1-git-send-email-avarab@gmail.com","subject":"[PATCH 31/72] gettextize: git-fetch basic messages","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2011-02-19T19:24:14Z","receivedAt":"2011-02-19T19:24:14Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n builtin/fetch.c |   46 +++++++++++++++++++++++-----------------------\n 1 files changed, 23 insertions(+), 23 deletions(-)\n\ndiff --git a/builtin/fetch.c b/builtin/fetch.c\nindex 357f3cd..c27c3e9 100644\n--- a/builtin/fetch.c\n+++ b/builtin/fetch.c\n@@ -184,7 +184,7 @@ static struct ref *get_ref_map(struct transport *transport,\n \t\t} else {\n \t\t\tref_map = get_remote_ref(remote_refs, \"HEAD\");\n \t\t\tif (!ref_map)\n-\t\t\t\tdie(\"Couldn't find remote ref HEAD\");\n+\t\t\t\tdie(_(\"Couldn't find remote ref HEAD\"));\n \t\t\tref_map->merge = 1;\n \t\t\ttail = &ref_map->next;\n \t\t}\n@@ -237,7 +237,7 @@ static int update_local_ref(struct ref *ref,\n \t*display = 0;\n \ttype = sha1_object_info(ref->new_sha1, NULL);\n \tif (type < 0)\n-\t\tdie(\"object %s not found\", sha1_to_hex(ref->new_sha1));\n+\t\tdie(_(\"object %s not found\"), sha1_to_hex(ref->new_sha1));\n \n \tif (!hashcmp(ref->old_sha1, ref->new_sha1)) {\n \t\tif (verbosity > 0)\n@@ -337,7 +337,7 @@ static int store_updated_refs(const char *raw_url, const char *remote_name,\n \n \tfp = fopen(filename, \"a\");\n \tif (!fp)\n-\t\treturn error(\"cannot open %s: %s\\n\", filename, strerror(errno));\n+\t\treturn error(_(\"cannot open %s: %s\\n\"), filename, strerror(errno));\n \n \tif (raw_url)\n \t\turl = transport_anonymize_url(raw_url);\n@@ -426,9 +426,9 @@ static int store_updated_refs(const char *raw_url, const char *remote_name,\n \tfree(url);\n \tfclose(fp);\n \tif (rc & STORE_REF_ERROR_DF_CONFLICT)\n-\t\terror(\"some local refs could not be updated; try running\\n\"\n+\t\terror(_(\"some local refs could not be updated; try running\\n\"\n \t\t      \" 'git remote prune %s' to remove any old, conflicting \"\n-\t\t      \"branches\", remote_name);\n+\t\t      \"branches\"), remote_name);\n \treturn rc;\n }\n \n@@ -476,7 +476,7 @@ static int quickfetch(struct ref *ref_map)\n \n \terr = start_command(&revlist);\n \tif (err) {\n-\t\terror(\"could not run rev-list\");\n+\t\terror(_(\"could not run rev-list\"));\n \t\treturn err;\n \t}\n \n@@ -490,14 +490,14 @@ static int quickfetch(struct ref *ref_map)\n \t\tif (write_in_full(revlist.in, sha1_to_hex(ref->old_sha1), 40) < 0 ||\n \t\t    write_str_in_full(revlist.in, \"\\n\") < 0) {\n \t\t\tif (errno != EPIPE && errno != EINVAL)\n-\t\t\t\terror(\"failed write to rev-list: %s\", strerror(errno));\n+\t\t\t\terror(_(\"failed write to rev-list: %s\"), strerror(errno));\n \t\t\terr = -1;\n \t\t\tbreak;\n \t\t}\n \t}\n \n \tif (close(revlist.in)) {\n-\t\terror(\"failed to close rev-list's stdin: %s\", strerror(errno));\n+\t\terror(_(\"failed to close rev-list's stdin: %s\"), strerror(errno));\n \t\terr = -1;\n \t}\n \n@@ -650,8 +650,8 @@ static void check_not_current_branch(struct ref *ref_map)\n \tfor (; ref_map; ref_map = ref_map->next)\n \t\tif (ref_map->peer_ref && !strcmp(current_branch->refname,\n \t\t\t\t\tref_map->peer_ref->name))\n-\t\t\tdie(\"Refusing to fetch into current branch %s \"\n-\t\t\t    \"of non-bare repository\", current_branch->refname);\n+\t\t\tdie(_(\"Refusing to fetch into current branch %s \"\n+\t\t\t    \"of non-bare repository\"), current_branch->refname);\n }\n \n static int truncate_fetch_head(void)\n@@ -660,7 +660,7 @@ static int truncate_fetch_head(void)\n \tFILE *fp = fopen(filename, \"w\");\n \n \tif (!fp)\n-\t\treturn error(\"cannot open %s: %s\\n\", filename, strerror(errno));\n+\t\treturn error(_(\"cannot open %s: %s\\n\"), filename, strerror(errno));\n \tfclose(fp);\n \treturn 0;\n }\n@@ -684,7 +684,7 @@ static int do_fetch(struct transport *transport,\n \t}\n \n \tif (!transport->get_refs_list || !transport->fetch)\n-\t\tdie(\"Don't know how to fetch from %s\", transport->url);\n+\t\tdie(_(\"Don't know how to fetch from %s\"), transport->url);\n \n \t/* if not appending, truncate FETCH_HEAD */\n \tif (!append && !dry_run) {\n@@ -738,10 +738,10 @@ static void set_option(const char *name, const char *value)\n {\n \tint r = transport_set_option(transport, name, value);\n \tif (r < 0)\n-\t\tdie(\"Option \\\"%s\\\" value \\\"%s\\\" is not valid for %s\",\n+\t\tdie(_(\"Option \\\"%s\\\" value \\\"%s\\\" is not valid for %s\"),\n \t\t\tname, value, transport->url);\n \tif (r > 0)\n-\t\twarning(\"Option \\\"%s\\\" is ignored for %s\\n\",\n+\t\twarning(_(\"Option \\\"%s\\\" is ignored for %s\\n\"),\n \t\t\tname, transport->url);\n }\n \n@@ -838,9 +838,9 @@ static int fetch_multiple(struct string_list *list)\n \t\targv[argc] = name;\n \t\targv[argc + 1] = NULL;\n \t\tif (verbosity >= 0)\n-\t\t\tprintf(\"Fetching %s\\n\", name);\n+\t\t\tprintf(_(\"Fetching %s\\n\"), name);\n \t\tif (run_command_v_opt(argv, RUN_GIT_CMD)) {\n-\t\t\terror(\"Could not fetch %s\", name);\n+\t\t\terror(_(\"Could not fetch %s\"), name);\n \t\t\tresult = 1;\n \t\t}\n \t}\n@@ -856,8 +856,8 @@ static int fetch_one(struct remote *remote, int argc, const char **argv)\n \tint exit_code;\n \n \tif (!remote)\n-\t\tdie(\"No remote repository specified.  Please, specify either a URL or a\\n\"\n-\t\t    \"remote name from which new revisions should be fetched.\");\n+\t\tdie(_(\"No remote repository specified.  Please, specify either a URL or a\\n\"\n+\t\t    \"remote name from which new revisions should be fetched.\"));\n \n \ttransport = transport_get(remote, NULL);\n \ttransport_set_verbosity(transport, verbosity, progress);\n@@ -876,7 +876,7 @@ static int fetch_one(struct remote *remote, int argc, const char **argv)\n \t\t\t\tchar *ref;\n \t\t\t\ti++;\n \t\t\t\tif (i >= argc)\n-\t\t\t\t\tdie(\"You need to specify a tag name.\");\n+\t\t\t\t\tdie(_(\"You need to specify a tag name.\"));\n \t\t\t\tref = xmalloc(strlen(argv[i]) * 2 + 22);\n \t\t\t\tstrcpy(ref, \"refs/tags/\");\n \t\t\t\tstrcat(ref, argv[i]);\n@@ -916,9 +916,9 @@ int cmd_fetch(int argc, const char **argv, const char *prefix)\n \n \tif (all) {\n \t\tif (argc == 1)\n-\t\t\tdie(\"fetch --all does not take a repository argument\");\n+\t\t\tdie(_(\"fetch --all does not take a repository argument\"));\n \t\telse if (argc > 1)\n-\t\t\tdie(\"fetch --all does not make sense with refspecs\");\n+\t\t\tdie(_(\"fetch --all does not make sense with refspecs\"));\n \t\t(void) for_each_remote(get_one_remote_for_fetch, &list);\n \t\tresult = fetch_multiple(&list);\n \t} else if (argc == 0) {\n@@ -929,7 +929,7 @@ int cmd_fetch(int argc, const char **argv, const char *prefix)\n \t\t/* All arguments are assumed to be remotes or groups */\n \t\tfor (i = 0; i < argc; i++)\n \t\t\tif (!add_remote_or_group(argv[i], &list))\n-\t\t\t\tdie(\"No such remote or remote group: %s\", argv[i]);\n+\t\t\t\tdie(_(\"No such remote or remote group: %s\"), argv[i]);\n \t\tresult = fetch_multiple(&list);\n \t} else {\n \t\t/* Single remote or group */\n@@ -937,7 +937,7 @@ int cmd_fetch(int argc, const char **argv, const char *prefix)\n \t\tif (list.nr > 1) {\n \t\t\t/* More than one remote */\n \t\t\tif (argc > 1)\n-\t\t\t\tdie(\"Fetching a group and specifying refspecs does not make sense\");\n+\t\t\t\tdie(_(\"Fetching a group and specifying refspecs does not make sense\"));\n \t\t\tresult = fetch_multiple(&list);\n \t\t} else {\n \t\t\t/* Zero or one remotes */\n-- \n1.7.2.3\n"},{"id":"161707","messageId":"1298143495-3681-33-git-send-email-avarab@gmail.com","threadId":"26561","inReplyTo":"1298143495-3681-1-git-send-email-avarab@gmail.com","subject":"[PATCH 32/72] gettextize: git-fetch formatting messages","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2011-02-19T19:24:15Z","receivedAt":"2011-02-19T19:24:15Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"Translate some of the formatting messages that appear on git-fetch\nshowing how branches/tags etc. were updated.\n\nSigned-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n builtin/fetch.c             |   20 ++++++++++----------\n t/t5526-fetch-submodules.sh |   40 ++++++++++++++++++++++++++++++++--------\n 2 files changed, 42 insertions(+), 18 deletions(-)\n\ndiff --git a/builtin/fetch.c b/builtin/fetch.c\nindex c27c3e9..0a73dff 100644\n--- a/builtin/fetch.c\n+++ b/builtin/fetch.c\n@@ -242,7 +242,7 @@ static int update_local_ref(struct ref *ref,\n \tif (!hashcmp(ref->old_sha1, ref->new_sha1)) {\n \t\tif (verbosity > 0)\n \t\t\tsprintf(display, \"= %-*s %-*s -> %s\", TRANSPORT_SUMMARY_WIDTH,\n-\t\t\t\t\"[up to date]\", REFCOL_WIDTH, remote,\n+\t\t\t\t_(\"[up to date]\"), REFCOL_WIDTH, remote,\n \t\t\t\tpretty_ref);\n \t\treturn 0;\n \t}\n@@ -255,8 +255,8 @@ static int update_local_ref(struct ref *ref,\n \t\t * If this is the head, and it's not okay to update\n \t\t * the head, and the old value of the head isn't empty...\n \t\t */\n-\t\tsprintf(display, \"! %-*s %-*s -> %s  (can't fetch in current branch)\",\n-\t\t\tTRANSPORT_SUMMARY_WIDTH, \"[rejected]\", REFCOL_WIDTH, remote,\n+\t\tsprintf(display, _(\"! %-*s %-*s -> %s  (can't fetch in current branch)\"),\n+\t\t\tTRANSPORT_SUMMARY_WIDTH, _(\"[rejected]\"), REFCOL_WIDTH, remote,\n \t\t\tpretty_ref);\n \t\treturn 1;\n \t}\n@@ -266,8 +266,8 @@ static int update_local_ref(struct ref *ref,\n \t\tint r;\n \t\tr = s_update_ref(\"updating tag\", ref, 0);\n \t\tsprintf(display, \"%c %-*s %-*s -> %s%s\", r ? '!' : '-',\n-\t\t\tTRANSPORT_SUMMARY_WIDTH, \"[tag update]\", REFCOL_WIDTH, remote,\n-\t\t\tpretty_ref, r ? \"  (unable to update local ref)\" : \"\");\n+\t\t\tTRANSPORT_SUMMARY_WIDTH, _(\"[tag update]\"), REFCOL_WIDTH, remote,\n+\t\t\tpretty_ref, r ? _(\"  (unable to update local ref)\") : \"\");\n \t\treturn r;\n \t}\n \n@@ -415,7 +415,7 @@ static int store_updated_refs(const char *raw_url, const char *remote_name,\n \t\t\t\t REFCOL_WIDTH, *what ? what : \"HEAD\");\n \t\tif (*note) {\n \t\t\tif (verbosity >= 0 && !shown_url) {\n-\t\t\t\tfprintf(stderr, \"From %.*s\\n\",\n+\t\t\t\tfprintf(stderr, _(\"From %.*s\\n\"),\n \t\t\t\t\t\turl_len, url);\n \t\t\t\tshown_url = 1;\n \t\t\t}\n@@ -524,16 +524,16 @@ static int prune_refs(struct transport *transport, struct ref *ref_map)\n \tint result = 0;\n \tstruct ref *ref, *stale_refs = get_stale_heads(transport->remote, ref_map);\n \tconst char *dangling_msg = dry_run\n-\t\t? \"   (%s will become dangling)\\n\"\n-\t\t: \"   (%s has become dangling)\\n\";\n+\t\t? _(\"   (%s will become dangling)\\n\")\n+\t\t: _(\"   (%s has become dangling)\\n\");\n \n \tfor (ref = stale_refs; ref; ref = ref->next) {\n \t\tif (!dry_run)\n \t\t\tresult |= delete_ref(ref->name, NULL, 0);\n \t\tif (verbosity >= 0) {\n \t\t\tfprintf(stderr, \" x %-*s %-*s -> %s\\n\",\n-\t\t\t\tTRANSPORT_SUMMARY_WIDTH, \"[deleted]\",\n-\t\t\t\tREFCOL_WIDTH, \"(none)\", prettify_refname(ref->name));\n+\t\t\t\tTRANSPORT_SUMMARY_WIDTH, _(\"[deleted]\"),\n+\t\t\t\tREFCOL_WIDTH, _(\"(none)\"), prettify_refname(ref->name));\n \t\t\twarn_dangling_symref(stderr, dangling_msg, ref->name);\n \t\t}\n \t}\ndiff --git a/t/t5526-fetch-submodules.sh b/t/t5526-fetch-submodules.sh\nindex a5f4585..617ce67 100755\n--- a/t/t5526-fetch-submodules.sh\n+++ b/t/t5526-fetch-submodules.sh\n@@ -66,7 +66,10 @@ test_expect_success \"fetch --recurse-submodules recurses into submodules\" '\n \t(\n \t\tcd downstream &&\n \t\tgit fetch --recurse-submodules >../actual.out 2>../actual.err\n-\t) &&\n+\t)\n+'\n+\n+test_expect_success NO_GETTEXT_POISON \"fetch --recurse-submodules recurses into submodules: output\" '\n \ttest_cmp expect.out actual.out &&\n \ttest_cmp expect.err actual.err\n '\n@@ -95,7 +98,10 @@ test_expect_success \"using fetchRecurseSubmodules=true in .gitmodules recurses i\n \t\tcd downstream &&\n \t\tgit config -f .gitmodules submodule.submodule.fetchRecurseSubmodules true &&\n \t\tgit fetch >../actual.out 2>../actual.err\n-\t) &&\n+\t)\n+'\n+\n+test_expect_success NO_GETTEXT_POISON \"using fetchRecurseSubmodules=true in .gitmodules recurses into submodules\" '\n \ttest_cmp expect.out actual.out &&\n \ttest_cmp expect.err actual.err\n '\n@@ -126,7 +132,10 @@ test_expect_success \"--recurse-submodules overrides fetchRecurseSubmodules setti\n \t\tgit fetch --recurse-submodules >../actual.out 2>../actual.err &&\n \t\tgit config --unset -f .gitmodules submodule.submodule.fetchRecurseSubmodules &&\n \t\tgit config --unset submodule.submodule.fetchRecurseSubmodules\n-\t) &&\n+\t)\n+'\n+\n+test_expect_success NO_GETTEXT_POISON \"--recurse-submodules overrides fetchRecurseSubmodules setting from .git/config: output\" '\n \ttest_cmp expect.out actual.out &&\n \ttest_cmp expect.err actual.err\n '\n@@ -145,13 +154,22 @@ test_expect_success \"--dry-run propagates to submodules\" '\n \t(\n \t\tcd downstream &&\n \t\tgit fetch --recurse-submodules --dry-run >../actual.out 2>../actual.err\n-\t) &&\n+\t)\n+'\n+\n+test_expect_success NO_GETTEXT_POISON \"--dry-run propagates to submodules: output\" '\n \ttest_cmp expect.out actual.out &&\n-\ttest_cmp expect.err actual.err &&\n+\ttest_cmp expect.err actual.err\n+'\n+\n+test_expect_success \"Without --dry-run propagates to submodules\" '\n \t(\n \t\tcd downstream &&\n \t\tgit fetch --recurse-submodules >../actual.out 2>../actual.err\n-\t) &&\n+\t)\n+'\n+\n+test_expect_success NO_GETTEXT_POISON \"Without --dry-run propagates to submodules: output\" '\n \ttest_cmp expect.out actual.out &&\n \ttest_cmp expect.err actual.err\n '\n@@ -162,7 +180,10 @@ test_expect_success \"recurseSubmodules=true propagates into submodules\" '\n \t\tcd downstream &&\n \t\tgit config fetch.recurseSubmodules true\n \t\tgit fetch >../actual.out 2>../actual.err\n-\t) &&\n+\t)\n+'\n+\n+test_expect_success NO_GETTEXT_POISON \"recurseSubmodules=true propagates into submodules: output\" '\n \ttest_cmp expect.out actual.out &&\n \ttest_cmp expect.err actual.err\n '\n@@ -176,7 +197,10 @@ test_expect_success \"--recurse-submodules overrides config in submodule\" '\n \t\t\tgit config fetch.recurseSubmodules false\n \t\t) &&\n \t\tgit fetch --recurse-submodules >../actual.out 2>../actual.err\n-\t) &&\n+\t)\n+'\n+\n+test_expect_success NO_GETTEXT_POISON \"--recurse-submodules overrides config in submodule: output\" '\n \ttest_cmp expect.out actual.out &&\n \ttest_cmp expect.err actual.err\n '\n-- \n1.7.2.3\n"},{"id":"161668","messageId":"1298143495-3681-34-git-send-email-avarab@gmail.com","threadId":"26561","inReplyTo":"1298143495-3681-1-git-send-email-avarab@gmail.com","subject":"[PATCH 33/72] gettextize: git-fetch update_local_ref messages","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2011-02-19T19:24:16Z","receivedAt":"2011-02-19T19:24:16Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"Translate a \"[rejected]\" message spotted by Jeff King, and other\nthings in update_local_ref along with it.\n\nReported-by: Jeff King <peff@peff.net>\nSigned-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n builtin/fetch.c |   10 +++++-----\n 1 files changed, 5 insertions(+), 5 deletions(-)\n\ndiff --git a/builtin/fetch.c b/builtin/fetch.c\nindex 0a73dff..4f622fd 100644\n--- a/builtin/fetch.c\n+++ b/builtin/fetch.c\n@@ -279,17 +279,17 @@ static int update_local_ref(struct ref *ref,\n \t\tint r;\n \t\tif (!strncmp(ref->name, \"refs/tags/\", 10)) {\n \t\t\tmsg = \"storing tag\";\n-\t\t\twhat = \"[new tag]\";\n+\t\t\twhat = _(\"[new tag]\");\n \t\t}\n \t\telse {\n \t\t\tmsg = \"storing head\";\n-\t\t\twhat = \"[new branch]\";\n+\t\t\twhat = _(\"[new branch]\");\n \t\t}\n \n \t\tr = s_update_ref(msg, ref, 0);\n \t\tsprintf(display, \"%c %-*s %-*s -> %s%s\", r ? '!' : '*',\n \t\t\tTRANSPORT_SUMMARY_WIDTH, what, REFCOL_WIDTH, remote, pretty_ref,\n-\t\t\tr ? \"  (unable to update local ref)\" : \"\");\n+\t\t\tr ? _(\"  (unable to update local ref)\") : \"\");\n \t\treturn r;\n \t}\n \n@@ -302,7 +302,7 @@ static int update_local_ref(struct ref *ref,\n \t\tr = s_update_ref(\"fast-forward\", ref, 1);\n \t\tsprintf(display, \"%c %-*s %-*s -> %s%s\", r ? '!' : ' ',\n \t\t\tTRANSPORT_SUMMARY_WIDTH, quickref, REFCOL_WIDTH, remote,\n-\t\t\tpretty_ref, r ? \"  (unable to update local ref)\" : \"\");\n+\t\t\tpretty_ref, r ? _(\"  (unable to update local ref)\") : \"\");\n \t\treturn r;\n \t} else if (force || ref->force) {\n \t\tchar quickref[84];\n@@ -314,7 +314,7 @@ static int update_local_ref(struct ref *ref,\n \t\tsprintf(display, \"%c %-*s %-*s -> %s  (%s)\", r ? '!' : '+',\n \t\t\tTRANSPORT_SUMMARY_WIDTH, quickref, REFCOL_WIDTH, remote,\n \t\t\tpretty_ref,\n-\t\t\tr ? \"unable to update local ref\" : \"forced update\");\n+\t\t\tr ? _(\"unable to update local ref\") : _(\"forced update\"));\n \t\treturn r;\n \t} else {\n \t\tsprintf(display, \"! %-*s %-*s -> %s  (non-fast-forward)\",\n-- \n1.7.2.3\n"},{"id":"161667","messageId":"1298143495-3681-35-git-send-email-avarab@gmail.com","threadId":"26561","inReplyTo":"1298143495-3681-1-git-send-email-avarab@gmail.com","subject":"[PATCH 34/72] gettextize: git-fetch split up \"(non-fast-forward)\" message","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2011-02-19T19:24:17Z","receivedAt":"2011-02-19T19:24:17Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"Split up the \"(non-fast-forward)\" message from printf directives and\nmake it translatable.\n\nSigned-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n builtin/fetch.c |    6 +++---\n 1 files changed, 3 insertions(+), 3 deletions(-)\n\ndiff --git a/builtin/fetch.c b/builtin/fetch.c\nindex 4f622fd..ee2c5f5 100644\n--- a/builtin/fetch.c\n+++ b/builtin/fetch.c\n@@ -317,9 +317,9 @@ static int update_local_ref(struct ref *ref,\n \t\t\tr ? _(\"unable to update local ref\") : _(\"forced update\"));\n \t\treturn r;\n \t} else {\n-\t\tsprintf(display, \"! %-*s %-*s -> %s  (non-fast-forward)\",\n-\t\t\tTRANSPORT_SUMMARY_WIDTH, \"[rejected]\", REFCOL_WIDTH, remote,\n-\t\t\tpretty_ref);\n+\t\tsprintf(display, \"! %-*s %-*s -> %s  %s\",\n+\t\t\tTRANSPORT_SUMMARY_WIDTH, _(\"[rejected]\"), REFCOL_WIDTH, remote,\n+\t\t\tpretty_ref, _(\"(non-fast-forward)\"));\n \t\treturn 1;\n \t}\n }\n-- \n1.7.2.3\n"},{"id":"161678","messageId":"1298143495-3681-36-git-send-email-avarab@gmail.com","threadId":"26561","inReplyTo":"1298143495-3681-1-git-send-email-avarab@gmail.com","subject":"[PATCH 35/72] gettextize: git-grep basic messages","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2011-02-19T19:24:18Z","receivedAt":"2011-02-19T19:24:18Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n builtin/grep.c |   32 ++++++++++++++++----------------\n 1 files changed, 16 insertions(+), 16 deletions(-)\n\ndiff --git a/builtin/grep.c b/builtin/grep.c\nindex fdf7131..d35b76c 100644\n--- a/builtin/grep.c\n+++ b/builtin/grep.c\n@@ -245,7 +245,7 @@ static void start_threads(struct grep_opt *opt)\n \t\terr = pthread_create(&threads[i], NULL, run, o);\n \n \t\tif (err)\n-\t\t\tdie(\"grep: failed to create thread: %s\",\n+\t\t\tdie(_(\"grep: failed to create thread: %s\"),\n \t\t\t    strerror(err));\n \t}\n }\n@@ -450,7 +450,7 @@ static void *load_sha1(const unsigned char *sha1, unsigned long *size,\n \tvoid *data = lock_and_read_sha1_file(sha1, &type, size);\n \n \tif (!data)\n-\t\terror(\"'%s': unable to read %s\", name, sha1_to_hex(sha1));\n+\t\terror(_(\"'%s': unable to read %s\"), name, sha1_to_hex(sha1));\n \n \treturn data;\n }\n@@ -501,7 +501,7 @@ static void *load_file(const char *filename, size_t *sz)\n \tif (lstat(filename, &st) < 0) {\n \terr_ret:\n \t\tif (errno != ENOENT)\n-\t\t\terror(\"'%s': %s\", filename, strerror(errno));\n+\t\t\terror(_(\"'%s': %s\"), filename, strerror(errno));\n \t\treturn 0;\n \t}\n \tif (!S_ISREG(st.st_mode))\n@@ -512,7 +512,7 @@ static void *load_file(const char *filename, size_t *sz)\n \t\tgoto err_ret;\n \tdata = xmalloc(*sz + 1);\n \tif (st.st_size != read_in_full(i, data, *sz)) {\n-\t\terror(\"'%s': short read %s\", filename, strerror(errno));\n+\t\terror(_(\"'%s': short read %s\"), filename, strerror(errno));\n \t\tclose(i);\n \t\tfree(data);\n \t\treturn 0;\n@@ -574,7 +574,7 @@ static void run_pager(struct grep_opt *opt, const char *prefix)\n \targv[path_list->nr] = NULL;\n \n \tif (prefix && chdir(prefix))\n-\t\tdie(\"Failed to chdir: %s\", prefix);\n+\t\tdie(_(\"Failed to chdir: %s\"), prefix);\n \tstatus = run_command_v_opt(argv, RUN_USING_SHELL);\n \tif (status)\n \t\texit(status);\n@@ -664,7 +664,7 @@ static int grep_tree(struct grep_opt *opt, const char **paths,\n \n \t\t\tdata = lock_and_read_sha1_file(entry.sha1, &type, &size);\n \t\t\tif (!data)\n-\t\t\t\tdie(\"unable to read tree (%s)\",\n+\t\t\t\tdie(_(\"unable to read tree (%s)\"),\n \t\t\t\t    sha1_to_hex(entry.sha1));\n \t\t\tinit_tree_desc(&sub, data, size);\n \t\t\thit |= grep_tree(opt, paths, &sub, tree_name, down);\n@@ -690,13 +690,13 @@ static int grep_object(struct grep_opt *opt, const char **paths,\n \t\tdata = read_object_with_reference(obj->sha1, tree_type,\n \t\t\t\t\t\t  &size, NULL);\n \t\tif (!data)\n-\t\t\tdie(\"unable to read tree (%s)\", sha1_to_hex(obj->sha1));\n+\t\t\tdie(_(\"unable to read tree (%s)\"), sha1_to_hex(obj->sha1));\n \t\tinit_tree_desc(&tree, data, size);\n \t\thit = grep_tree(opt, paths, &tree, name, \"\");\n \t\tfree(data);\n \t\treturn hit;\n \t}\n-\tdie(\"unable to grep from object of type %s\", typename(obj->type));\n+\tdie(_(\"unable to grep from object of type %s\"), typename(obj->type));\n }\n \n static int grep_objects(struct grep_opt *opt, const char **paths,\n@@ -748,7 +748,7 @@ static int context_callback(const struct option *opt, const char *arg,\n \t}\n \tvalue = strtol(arg, (char **)&endp, 10);\n \tif (*endp) {\n-\t\treturn error(\"switch `%c' expects a numerical value\",\n+\t\treturn error(_(\"switch `%c' expects a numerical value\"),\n \t\t\t     opt->short_name);\n \t}\n \tgrep_opt->pre_context = grep_opt->post_context = value;\n@@ -764,7 +764,7 @@ static int file_callback(const struct option *opt, const char *arg, int unset)\n \n \tpatterns = fopen(arg, \"r\");\n \tif (!patterns)\n-\t\tdie_errno(\"cannot open '%s'\", arg);\n+\t\tdie_errno(_(\"cannot open '%s'\"), arg);\n \twhile (strbuf_getline(&sb, patterns, '\\n') == 0) {\n \t\tchar *s;\n \t\tsize_t len;\n@@ -1005,11 +1005,11 @@ int cmd_grep(int argc, const char **argv, const char *prefix)\n \t}\n \n \tif (!opt.pattern_list)\n-\t\tdie(\"no pattern given.\");\n+\t\tdie(_(\"no pattern given.\"));\n \tif (!opt.fixed && opt.ignore_case)\n \t\topt.regflags |= REG_ICASE;\n \tif ((opt.regflags != REG_NEWLINE) && opt.fixed)\n-\t\tdie(\"cannot mix --fixed-strings and regexp\");\n+\t\tdie(_(\"cannot mix --fixed-strings and regexp\"));\n \n #ifndef NO_PTHREADS\n \tif (online_cpus() == 1 || !grep_threads_ok(&opt))\n@@ -1034,7 +1034,7 @@ int cmd_grep(int argc, const char **argv, const char *prefix)\n \t\tif (!get_sha1(arg, sha1)) {\n \t\t\tstruct object *object = parse_object(sha1);\n \t\t\tif (!object)\n-\t\t\t\tdie(\"bad object %s\", arg);\n+\t\t\t\tdie(_(\"bad object %s\"), arg);\n \t\t\tadd_object_array(object, arg, &list);\n \t\t\tcontinue;\n \t\t}\n@@ -1086,9 +1086,9 @@ int cmd_grep(int argc, const char **argv, const char *prefix)\n \n \tif (!use_index) {\n \t\tif (cached)\n-\t\t\tdie(\"--cached cannot be used with --no-index.\");\n+\t\t\tdie(_(\"--cached cannot be used with --no-index.\"));\n \t\tif (list.nr)\n-\t\t\tdie(\"--no-index cannot be used with revs.\");\n+\t\t\tdie(_(\"--no-index cannot be used with revs.\"));\n \t\thit = grep_directory(&opt, paths);\n \t} else if (!list.nr) {\n \t\tif (!cached)\n@@ -1097,7 +1097,7 @@ int cmd_grep(int argc, const char **argv, const char *prefix)\n \t\thit = grep_cache(&opt, paths, cached);\n \t} else {\n \t\tif (cached)\n-\t\t\tdie(\"both --cached and trees are given.\");\n+\t\t\tdie(_(\"both --cached and trees are given.\"));\n \t\thit = grep_objects(&opt, paths, &list);\n \t}\n \n-- \n1.7.2.3\n"},{"id":"161677","messageId":"1298143495-3681-37-git-send-email-avarab@gmail.com","threadId":"26561","inReplyTo":"1298143495-3681-1-git-send-email-avarab@gmail.com","subject":"[PATCH 36/72] gettextize: git-grep \"--open-files-in-pager\" message","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2011-02-19T19:24:19Z","receivedAt":"2011-02-19T19:24:19Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"Gettextize the \"--open-files-in-pager only works on the worktree\"\nmessage. A test in t7811-grep-open.sh explicitly checked for this\nmessage. Change it to skip under GETTEXT_POISON=YesPlease.\n\nSigned-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n builtin/grep.c       |    2 +-\n t/t7811-grep-open.sh |    2 +-\n 2 files changed, 2 insertions(+), 2 deletions(-)\n\ndiff --git a/builtin/grep.c b/builtin/grep.c\nindex d35b76c..dfc32fb 100644\n--- a/builtin/grep.c\n+++ b/builtin/grep.c\n@@ -1061,7 +1061,7 @@ int cmd_grep(int argc, const char **argv, const char *prefix)\n \t}\n \n \tif (show_in_pager && (cached || list.nr))\n-\t\tdie(\"--open-files-in-pager only works on the worktree\");\n+\t\tdie(_(\"--open-files-in-pager only works on the worktree\"));\n \n \tif (show_in_pager && opt.pattern_list && !opt.pattern_list->next) {\n \t\tconst char *pager = path_list.items[0].string;\ndiff --git a/t/t7811-grep-open.sh b/t/t7811-grep-open.sh\nindex 568a6f2..3aa544c 100755\n--- a/t/t7811-grep-open.sh\n+++ b/t/t7811-grep-open.sh\n@@ -61,7 +61,7 @@ test_expect_success SIMPLEPAGER 'git grep -O' '\n \ttest_cmp empty out\n '\n \n-test_expect_success 'git grep -O --cached' '\n+test_expect_success NO_GETTEXT_POISON 'git grep -O --cached' '\n \ttest_must_fail git grep --cached -O GREP_PATTERN >out 2>msg &&\n \tgrep open-files-in-pager msg\n '\n-- \n1.7.2.3\n"},{"id":"161711","messageId":"1298143495-3681-38-git-send-email-avarab@gmail.com","threadId":"26561","inReplyTo":"1298143495-3681-1-git-send-email-avarab@gmail.com","subject":"[PATCH 37/72] gettextize: git-log basic messages","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2011-02-19T19:24:20Z","receivedAt":"2011-02-19T19:24:20Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n builtin/log.c |   62 ++++++++++++++++++++++++++++----------------------------\n 1 files changed, 31 insertions(+), 31 deletions(-)\n\ndiff --git a/builtin/log.c b/builtin/log.c\nindex d8c6c28..b36a01e 100644\n--- a/builtin/log.c\n+++ b/builtin/log.c\n@@ -101,7 +101,7 @@ static void cmd_log_init(int argc, const char **argv, const char *prefix,\n \t\t\tconst char *v = skip_prefix(arg, \"--decorate=\");\n \t\t\tdecoration_style = parse_decoration_style(arg, v);\n \t\t\tif (decoration_style < 0)\n-\t\t\t\tdie(\"invalid --decorate option: %s\", arg);\n+\t\t\t\tdie(_(\"invalid --decorate option: %s\"), arg);\n \t\t\tdecoration_given = 1;\n \t\t} else if (!strcmp(arg, \"--no-decorate\")) {\n \t\t\tdecoration_style = 0;\n@@ -110,7 +110,7 @@ static void cmd_log_init(int argc, const char **argv, const char *prefix,\n \t\t} else if (!strcmp(arg, \"-h\")) {\n \t\t\tusage(builtin_log_usage);\n \t\t} else\n-\t\t\tdie(\"unrecognized argument: %s\", arg);\n+\t\t\tdie(_(\"unrecognized argument: %s\"), arg);\n \t}\n \n \t/*\n@@ -153,7 +153,7 @@ static void show_early_header(struct rev_info *rev, const char *stage, int nr)\n \t\tif (rev->commit_format != CMIT_FMT_ONELINE)\n \t\t\tputchar(rev->diffopt.line_termination);\n \t}\n-\tprintf(\"Final output: %d %s\\n\", nr, stage);\n+\tprintf(_(\"Final output: %d %s\\n\"), nr, stage);\n }\n \n static struct itimerval early_output_timer;\n@@ -252,7 +252,7 @@ static int cmd_log_walk(struct rev_info *rev)\n \t\tsetup_early_output(rev);\n \n \tif (prepare_revision_walk(rev))\n-\t\tdie(\"revision walk setup failed\");\n+\t\tdie(_(\"revision walk setup failed\"));\n \n \tif (rev->early_output)\n \t\tfinish_early_output(rev);\n@@ -343,7 +343,7 @@ static int show_object(const unsigned char *sha1, int show_tag_object,\n \tint offset = 0;\n \n \tif (!buf)\n-\t\treturn error(\"Could not read object %s\", sha1_to_hex(sha1));\n+\t\treturn error(_(\"Could not read object %s\"), sha1_to_hex(sha1));\n \n \tif (show_tag_object)\n \t\twhile (offset < size && buf[offset] != '\\n') {\n@@ -430,7 +430,7 @@ int cmd_show(int argc, const char **argv, const char *prefix)\n \t\t\t\tbreak;\n \t\t\to = parse_object(t->tagged->sha1);\n \t\t\tif (!o)\n-\t\t\t\tret = error(\"Could not read object %s\",\n+\t\t\t\tret = error(_(\"Could not read object %s\"),\n \t\t\t\t\t    sha1_to_hex(t->tagged->sha1));\n \t\t\tobjects[i].item = o;\n \t\t\ti--;\n@@ -454,7 +454,7 @@ int cmd_show(int argc, const char **argv, const char *prefix)\n \t\t\tret = cmd_log_walk(&rev);\n \t\t\tbreak;\n \t\tdefault:\n-\t\t\tret = error(\"Unknown type: %d\", o->type);\n+\t\t\tret = error(_(\"Unknown type: %d\"), o->type);\n \t\t}\n \t}\n \tfree(objects);\n@@ -554,7 +554,7 @@ static int git_format_config(const char *var, const char *value, void *cb)\n {\n \tif (!strcmp(var, \"format.headers\")) {\n \t\tif (!value)\n-\t\t\tdie(\"format.headers without value\");\n+\t\t\tdie(_(\"format.headers without value\"));\n \t\tadd_header(value);\n \t\treturn 0;\n \t}\n@@ -626,7 +626,7 @@ static int reopen_stdout(struct commit *commit, struct rev_info *rev)\n \t\tstrbuf_addstr(&filename, output_directory);\n \t\tif (filename.len >=\n \t\t    PATH_MAX - FORMAT_PATCH_NAME_MAX - suffix_len)\n-\t\t\treturn error(\"name of output directory is too long\");\n+\t\t\treturn error(_(\"name of output directory is too long\"));\n \t\tif (filename.buf[filename.len - 1] != '/')\n \t\t\tstrbuf_addch(&filename, '/');\n \t}\n@@ -637,7 +637,7 @@ static int reopen_stdout(struct commit *commit, struct rev_info *rev)\n \t\tfprintf(realstdout, \"%s\\n\", filename.buf + outdir_offset);\n \n \tif (freopen(filename.buf, \"w\", stdout) == NULL)\n-\t\treturn error(\"Cannot open patch file %s\", filename.buf);\n+\t\treturn error(_(\"Cannot open patch file %s\"), filename.buf);\n \n \tstrbuf_release(&filename);\n \treturn 0;\n@@ -651,7 +651,7 @@ static void get_patch_ids(struct rev_info *rev, struct patch_ids *ids, const cha\n \tunsigned flags1, flags2;\n \n \tif (rev->pending.nr != 2)\n-\t\tdie(\"Need exactly one range.\");\n+\t\tdie(_(\"Need exactly one range.\"));\n \n \to1 = rev->pending.objects[0].item;\n \tflags1 = o1->flags;\n@@ -659,7 +659,7 @@ static void get_patch_ids(struct rev_info *rev, struct patch_ids *ids, const cha\n \tflags2 = o2->flags;\n \n \tif ((flags1 & UNINTERESTING) == (flags2 & UNINTERESTING))\n-\t\tdie(\"Not a range.\");\n+\t\tdie(_(\"Not a range.\"));\n \n \tinit_patch_ids(ids);\n \n@@ -670,7 +670,7 @@ static void get_patch_ids(struct rev_info *rev, struct patch_ids *ids, const cha\n \tadd_pending_object(&check_rev, o1, \"o1\");\n \tadd_pending_object(&check_rev, o2, \"o2\");\n \tif (prepare_revision_walk(&check_rev))\n-\t\tdie(\"revision walk setup failed\");\n+\t\tdie(_(\"revision walk setup failed\"));\n \n \twhile ((commit = get_revision(&check_rev)) != NULL) {\n \t\t/* ignore merges */\n@@ -696,7 +696,7 @@ static void gen_message_id(struct rev_info *info, char *base)\n \tconst char *email_end = strrchr(committer, '>');\n \tstruct strbuf buf = STRBUF_INIT;\n \tif (!email_start || !email_end || email_start > email_end - 1)\n-\t\tdie(\"Could not extract email from committer identity.\");\n+\t\tdie(_(\"Could not extract email from committer identity.\"));\n \tstrbuf_addf(&buf, \"%s.%lu.git.%.*s\", base,\n \t\t    (unsigned long) time(NULL),\n \t\t    (int)(email_end - email_start - 1), email_start + 1);\n@@ -728,7 +728,7 @@ static void make_cover_letter(struct rev_info *rev, int use_stdout,\n \tstruct commit *commit = NULL;\n \n \tif (rev->commit_format != CMIT_FMT_EMAIL)\n-\t\tdie(\"Cover letter needs email format\");\n+\t\tdie(_(\"Cover letter needs email format\"));\n \n \tcommitter = git_committer_info(0);\n \n@@ -821,7 +821,7 @@ static const char *clean_message_id(const char *msg_id)\n \t\tm++;\n \t}\n \tif (!z)\n-\t\tdie(\"insane in-reply-to: %s\", msg_id);\n+\t\tdie(_(\"insane in-reply-to: %s\"), msg_id);\n \tif (++z == m)\n \t\treturn a;\n \treturn xmemdupz(a, z - a);\n@@ -894,7 +894,7 @@ static int output_directory_callback(const struct option *opt, const char *arg,\n {\n \tconst char **dir = (const char **)opt->value;\n \tif (*dir)\n-\t\tdie(\"Two output directories?\");\n+\t\tdie(_(\"Two output directories?\"));\n \t*dir = arg;\n \treturn 0;\n }\n@@ -1082,7 +1082,7 @@ int cmd_format_patch(int argc, const char **argv, const char *prefix)\n \t\tcommitter = git_committer_info(IDENT_ERROR_ON_NO_NAME);\n \t\tendpos = strchr(committer, '>');\n \t\tif (!endpos)\n-\t\t\tdie(\"bogus committer info %s\", committer);\n+\t\t\tdie(_(\"bogus committer info %s\"), committer);\n \t\tadd_signoff = xmemdupz(committer, endpos - committer + 1);\n \t}\n \n@@ -1127,13 +1127,13 @@ int cmd_format_patch(int argc, const char **argv, const char *prefix)\n \t\tnumbered = 0;\n \n \tif (numbered && keep_subject)\n-\t\tdie (\"-n and -k are mutually exclusive.\");\n+\t\tdie (_(\"-n and -k are mutually exclusive.\"));\n \tif (keep_subject && subject_prefix)\n-\t\tdie (\"--subject-prefix and -k are mutually exclusive.\");\n+\t\tdie (_(\"--subject-prefix and -k are mutually exclusive.\"));\n \n \targc = setup_revisions(argc, argv, &rev, &s_r_opt);\n \tif (argc > 1)\n-\t\tdie (\"unrecognized argument: %s\", argv[1]);\n+\t\tdie (_(\"unrecognized argument: %s\"), argv[1]);\n \n \tif (rev.diffopt.output_format & DIFF_FORMAT_NAME)\n \t\tdie(\"--name-only does not make sense\");\n@@ -1163,9 +1163,9 @@ int cmd_format_patch(int argc, const char **argv, const char *prefix)\n \n \tif (output_directory) {\n \t\tif (use_stdout)\n-\t\t\tdie(\"standard output, or directory, which one?\");\n+\t\t\tdie(_(\"standard output, or directory, which one?\"));\n \t\tif (mkdir(output_directory, 0777) < 0 && errno != EEXIST)\n-\t\t\tdie_errno(\"Could not create directory '%s'\",\n+\t\t\tdie_errno(_(\"Could not create directory '%s'\"),\n \t\t\t\t  output_directory);\n \t}\n \n@@ -1219,7 +1219,7 @@ int cmd_format_patch(int argc, const char **argv, const char *prefix)\n \t\trealstdout = xfdopen(xdup(1), \"w\");\n \n \tif (prepare_revision_walk(&rev))\n-\t\tdie(\"revision walk setup failed\");\n+\t\tdie(_(\"revision walk setup failed\"));\n \trev.boundary = 1;\n \twhile ((commit = get_revision(&rev)) != NULL) {\n \t\tif (commit->object.flags & BOUNDARY) {\n@@ -1300,7 +1300,7 @@ int cmd_format_patch(int argc, const char **argv, const char *prefix)\n \n \t\tif (!use_stdout && reopen_stdout(numbered_files ? NULL : commit,\n \t\t\t\t\t\t &rev))\n-\t\t\tdie(\"Failed to create output files\");\n+\t\t\tdie(_(\"Failed to create output files\"));\n \t\tshown = log_tree_commit(&rev, commit);\n \t\tfree(commit->buffer);\n \t\tcommit->buffer = NULL;\n@@ -1387,9 +1387,9 @@ int cmd_cherry(int argc, const char **argv, const char *prefix)\n \t\tif (!current_branch || !current_branch->merge\n \t\t\t\t\t|| !current_branch->merge[0]\n \t\t\t\t\t|| !current_branch->merge[0]->dst) {\n-\t\t\tfprintf(stderr, \"Could not find a tracked\"\n+\t\t\tfprintf(stderr, _(\"Could not find a tracked\"\n \t\t\t\t\t\" remote branch, please\"\n-\t\t\t\t\t\" specify <upstream> manually.\\n\");\n+\t\t\t\t\t\" specify <upstream> manually.\\n\"));\n \t\t\tusage_with_options(cherry_usage, options);\n \t\t}\n \n@@ -1403,9 +1403,9 @@ int cmd_cherry(int argc, const char **argv, const char *prefix)\n \tDIFF_OPT_SET(&revs.diffopt, RECURSIVE);\n \n \tif (add_pending_commit(head, &revs, 0))\n-\t\tdie(\"Unknown commit %s\", head);\n+\t\tdie(_(\"Unknown commit %s\"), head);\n \tif (add_pending_commit(upstream, &revs, UNINTERESTING))\n-\t\tdie(\"Unknown commit %s\", upstream);\n+\t\tdie(_(\"Unknown commit %s\"), upstream);\n \n \t/* Don't say anything if head and upstream are the same. */\n \tif (revs.pending.nr == 2) {\n@@ -1417,11 +1417,11 @@ int cmd_cherry(int argc, const char **argv, const char *prefix)\n \tget_patch_ids(&revs, &ids, prefix);\n \n \tif (limit && add_pending_commit(limit, &revs, UNINTERESTING))\n-\t\tdie(\"Unknown commit %s\", limit);\n+\t\tdie(_(\"Unknown commit %s\"), limit);\n \n \t/* reverse the list of commits */\n \tif (prepare_revision_walk(&revs))\n-\t\tdie(\"revision walk setup failed\");\n+\t\tdie(_(\"revision walk setup failed\"));\n \twhile ((commit = get_revision(&revs)) != NULL) {\n \t\t/* ignore merges */\n \t\tif (commit->parents && commit->parents->next)\n-- \n1.7.2.3\n"},{"id":"161705","messageId":"1298143495-3681-39-git-send-email-avarab@gmail.com","threadId":"26561","inReplyTo":"1298143495-3681-1-git-send-email-avarab@gmail.com","subject":"[PATCH 38/72] gettextize: git-log \"--OPT does not make sense\" messages","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2011-02-19T19:24:21Z","receivedAt":"2011-02-19T19:24:21Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"Gettextize the \"--name-only/--name-status/--check does not make sense\"\nmessages. A test in t4014-format-patch.sh explicitly checked for these\nmessages. Change them to skip under GETTEXT_POISON=YesPlease.\n\nSigned-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n builtin/log.c           |    6 +++---\n t/t4014-format-patch.sh |    2 +-\n 2 files changed, 4 insertions(+), 4 deletions(-)\n\ndiff --git a/builtin/log.c b/builtin/log.c\nindex b36a01e..853f5d0 100644\n--- a/builtin/log.c\n+++ b/builtin/log.c\n@@ -1136,11 +1136,11 @@ int cmd_format_patch(int argc, const char **argv, const char *prefix)\n \t\tdie (_(\"unrecognized argument: %s\"), argv[1]);\n \n \tif (rev.diffopt.output_format & DIFF_FORMAT_NAME)\n-\t\tdie(\"--name-only does not make sense\");\n+\t\tdie(_(\"--name-only does not make sense\"));\n \tif (rev.diffopt.output_format & DIFF_FORMAT_NAME_STATUS)\n-\t\tdie(\"--name-status does not make sense\");\n+\t\tdie(_(\"--name-status does not make sense\"));\n \tif (rev.diffopt.output_format & DIFF_FORMAT_CHECKDIFF)\n-\t\tdie(\"--check does not make sense\");\n+\t\tdie(_(\"--check does not make sense\"));\n \n \tif (!use_patch_format &&\n \t\t(!rev.diffopt.output_format ||\ndiff --git a/t/t4014-format-patch.sh b/t/t4014-format-patch.sh\nindex 027c13d..3b182f5 100755\n--- a/t/t4014-format-patch.sh\n+++ b/t/t4014-format-patch.sh\n@@ -614,7 +614,7 @@ echo \"fatal: --name-only does not make sense\" > expect.name-only\n echo \"fatal: --name-status does not make sense\" > expect.name-status\n echo \"fatal: --check does not make sense\" > expect.check\n \n-test_expect_success 'options no longer allowed for format-patch' '\n+test_expect_success NO_GETTEXT_POISON 'options no longer allowed for format-patch' '\n \ttest_must_fail git format-patch --name-only 2> output &&\n \ttest_cmp expect.name-only output &&\n \ttest_must_fail git format-patch --name-status 2> output &&\n-- \n1.7.2.3\n"},{"id":"161703","messageId":"1298143495-3681-40-git-send-email-avarab@gmail.com","threadId":"26561","inReplyTo":"1298143495-3681-1-git-send-email-avarab@gmail.com","subject":"[PATCH 39/72] gettextize: git-merge basic messages","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2011-02-19T19:24:22Z","receivedAt":"2011-02-19T19:24:22Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n builtin/merge.c            |  124 ++++++++++++++++++++++----------------------\n t/t7607-merge-overwrite.sh |   10 +++-\n t/t7611-merge-abort.sh     |   20 ++++++--\n 3 files changed, 86 insertions(+), 68 deletions(-)\n\ndiff --git a/builtin/merge.c b/builtin/merge.c\nindex 8c58c3c..0be4dfa 100644\n--- a/builtin/merge.c\n+++ b/builtin/merge.c\n@@ -80,7 +80,7 @@ static int option_parse_message(const struct option *opt,\n \t\tstrbuf_addf(buf, \"%s%s\", buf->len ? \"\\n\\n\" : \"\", arg);\n \t\thave_message = 1;\n \t} else\n-\t\treturn error(\"switch `m' requires a value\");\n+\t\treturn error(_(\"switch `m' requires a value\"));\n \treturn 0;\n }\n \n@@ -117,13 +117,13 @@ static struct strategy *get_strategy(const char *name)\n \t\texclude_cmds(&main_cmds, &not_strategies);\n \t}\n \tif (!is_in_cmdlist(&main_cmds, name) && !is_in_cmdlist(&other_cmds, name)) {\n-\t\tfprintf(stderr, \"Could not find merge strategy '%s'.\\n\", name);\n-\t\tfprintf(stderr, \"Available strategies are:\");\n+\t\tfprintf(stderr, _(\"Could not find merge strategy '%s'.\\n\"), name);\n+\t\tfprintf(stderr, _(\"Available strategies are:\"));\n \t\tfor (i = 0; i < main_cmds.cnt; i++)\n \t\t\tfprintf(stderr, \" %s\", main_cmds.names[i]->name);\n \t\tfprintf(stderr, \".\\n\");\n \t\tif (other_cmds.cnt) {\n-\t\t\tfprintf(stderr, \"Available custom strategies are:\");\n+\t\t\tfprintf(stderr, _(\"Available custom strategies are:\"));\n \t\t\tfor (i = 0; i < other_cmds.cnt; i++)\n \t\t\t\tfprintf(stderr, \" %s\", other_cmds.names[i]->name);\n \t\t\tfprintf(stderr, \".\\n\");\n@@ -224,17 +224,17 @@ static void save_state(void)\n \tcp.git_cmd = 1;\n \n \tif (start_command(&cp))\n-\t\tdie(\"could not run stash.\");\n+\t\tdie(_(\"could not run stash.\"));\n \tlen = strbuf_read(&buffer, cp.out, 1024);\n \tclose(cp.out);\n \n \tif (finish_command(&cp) || len < 0)\n-\t\tdie(\"stash failed\");\n+\t\tdie(_(\"stash failed\"));\n \telse if (!len)\n \t\treturn;\n \tstrbuf_setlen(&buffer, buffer.len-1);\n \tif (get_sha1(buffer.buf, stash))\n-\t\tdie(\"not a valid object: %s\", buffer.buf);\n+\t\tdie(_(\"not a valid object: %s\"), buffer.buf);\n }\n \n static void read_empty(unsigned const char *sha1, int verbose)\n@@ -252,7 +252,7 @@ static void read_empty(unsigned const char *sha1, int verbose)\n \targs[i] = NULL;\n \n \tif (run_command_v_opt(args, RUN_GIT_CMD))\n-\t\tdie(\"read-tree failed\");\n+\t\tdie(_(\"read-tree failed\"));\n }\n \n static void reset_hard(unsigned const char *sha1, int verbose)\n@@ -269,7 +269,7 @@ static void reset_hard(unsigned const char *sha1, int verbose)\n \targs[i] = NULL;\n \n \tif (run_command_v_opt(args, RUN_GIT_CMD))\n-\t\tdie(\"read-tree failed\");\n+\t\tdie(_(\"read-tree failed\"));\n }\n \n static void restore_state(void)\n@@ -298,7 +298,7 @@ static void restore_state(void)\n static void finish_up_to_date(const char *msg)\n {\n \tif (verbosity >= 0)\n-\t\tprintf(\"%s%s\\n\", squash ? \" (nothing to squash)\" : \"\", msg);\n+\t\tprintf(\"%s%s\\n\", squash ? _(\" (nothing to squash)\") : \"\", msg);\n \tdrop_save();\n }\n \n@@ -311,10 +311,10 @@ static void squash_message(void)\n \tint fd;\n \tstruct pretty_print_context ctx = {0};\n \n-\tprintf(\"Squash commit -- not updating HEAD\\n\");\n+\tprintf(_(\"Squash commit -- not updating HEAD\\n\"));\n \tfd = open(git_path(\"SQUASH_MSG\"), O_WRONLY | O_CREAT, 0666);\n \tif (fd < 0)\n-\t\tdie_errno(\"Could not write to '%s'\", git_path(\"SQUASH_MSG\"));\n+\t\tdie_errno(_(\"Could not write to '%s'\"), git_path(\"SQUASH_MSG\"));\n \n \tinit_revisions(&rev, NULL);\n \trev.ignore_merges = 1;\n@@ -329,7 +329,7 @@ static void squash_message(void)\n \n \tsetup_revisions(0, NULL, &rev, NULL);\n \tif (prepare_revision_walk(&rev))\n-\t\tdie(\"revision walk setup failed\");\n+\t\tdie(_(\"revision walk setup failed\"));\n \n \tctx.abbrev = rev.abbrev;\n \tctx.date_mode = rev.date_mode;\n@@ -342,9 +342,9 @@ static void squash_message(void)\n \t\tpretty_print_commit(rev.commit_format, commit, &out, &ctx);\n \t}\n \tif (write(fd, out.buf, out.len) < 0)\n-\t\tdie_errno(\"Writing SQUASH_MSG\");\n+\t\tdie_errno(_(\"Writing SQUASH_MSG\"));\n \tif (close(fd))\n-\t\tdie_errno(\"Finishing SQUASH_MSG\");\n+\t\tdie_errno(_(\"Finishing SQUASH_MSG\"));\n \tstrbuf_release(&out);\n }\n \n@@ -364,7 +364,7 @@ static void finish(const unsigned char *new_head, const char *msg)\n \t\tsquash_message();\n \t} else {\n \t\tif (verbosity >= 0 && !merge_msg.len)\n-\t\t\tprintf(\"No merge message -- not updating HEAD\\n\");\n+\t\t\tprintf(_(\"No merge message -- not updating HEAD\\n\"));\n \t\telse {\n \t\t\tconst char *argv_gc_auto[] = { \"gc\", \"--auto\", NULL };\n \t\t\tupdate_ref(reflog_message.buf, \"HEAD\",\n@@ -386,7 +386,7 @@ static void finish(const unsigned char *new_head, const char *msg)\n \t\tif (diff_use_color_default > 0)\n \t\t\tDIFF_OPT_SET(&opts, COLOR_DIFF);\n \t\tif (diff_setup_done(&opts) < 0)\n-\t\t\tdie(\"diff_setup_done failed\");\n+\t\t\tdie(_(\"diff_setup_done failed\"));\n \t\tdiff_tree_sha1(head, new_head, \"\", &opts);\n \t\tdiffcore_std(&opts);\n \t\tdiff_flush(&opts);\n@@ -415,7 +415,7 @@ static void merge_name(const char *remote, struct strbuf *msg)\n \tmemset(branch_head, 0, sizeof(branch_head));\n \tremote_head = peel_to_type(remote, 0, NULL, OBJ_COMMIT);\n \tif (!remote_head)\n-\t\tdie(\"'%s' does not point to a commit\", remote);\n+\t\tdie(_(\"'%s' does not point to a commit\"), remote);\n \n \tif (dwim_ref(remote, strlen(remote), branch_head, &found_ref) > 0) {\n \t\tif (!prefixcmp(found_ref, \"refs/heads/\")) {\n@@ -480,7 +480,7 @@ static void merge_name(const char *remote, struct strbuf *msg)\n \n \t\tfp = fopen(git_path(\"FETCH_HEAD\"), \"r\");\n \t\tif (!fp)\n-\t\t\tdie_errno(\"could not open '%s' for reading\",\n+\t\t\tdie_errno(_(\"could not open '%s' for reading\"),\n \t\t\t\t  git_path(\"FETCH_HEAD\"));\n \t\tstrbuf_getline(&line, fp, '\\n');\n \t\tfclose(fp);\n@@ -510,7 +510,7 @@ static int git_merge_config(const char *k, const char *v, void *cb)\n \t\tbuf = xstrdup(v);\n \t\targc = split_cmdline(buf, &argv);\n \t\tif (argc < 0)\n-\t\t\tdie(\"Bad branch.%s.mergeoptions string: %s\", branch,\n+\t\t\tdie(_(\"Bad branch.%s.mergeoptions string: %s\"), branch,\n \t\t\t    split_cmdline_strerror(argc));\n \t\targv = xrealloc(argv, sizeof(*argv) * (argc + 2));\n \t\tmemmove(argv + 1, argv, sizeof(*argv) * (argc + 1));\n@@ -532,7 +532,7 @@ static int git_merge_config(const char *k, const char *v, void *cb)\n \t\tint is_bool;\n \t\tshortlog_len = git_config_bool_or_int(k, v, &is_bool);\n \t\tif (!is_bool && shortlog_len < 0)\n-\t\t\treturn error(\"%s: negative length %s\", k, v);\n+\t\t\treturn error(_(\"%s: negative length %s\"), k, v);\n \t\tif (is_bool && shortlog_len)\n \t\t\tshortlog_len = DEFAULT_MERGE_LOG_LEN;\n \t\treturn 0;\n@@ -579,7 +579,7 @@ static int read_tree_trivial(unsigned char *common, unsigned char *head,\n static void write_tree_trivial(unsigned char *sha1)\n {\n \tif (write_cache_as_tree(sha1, 0, NULL))\n-\t\tdie(\"git write-tree failed to write a tree\");\n+\t\tdie(_(\"git write-tree failed to write a tree\"));\n }\n \n int try_merge_command(const char *strategy, size_t xopts_nr,\n@@ -621,7 +621,7 @@ int try_merge_command(const char *strategy, size_t xopts_nr,\n \tfree(args);\n \tdiscard_cache();\n \tif (read_cache() < 0)\n-\t\tdie(\"failed to read the cache\");\n+\t\tdie(_(\"failed to read the cache\"));\n \tresolve_undo_clear();\n \n \treturn ret;\n@@ -638,7 +638,7 @@ static int try_merge_strategy(const char *strategy, struct commit_list *common,\n \tif (active_cache_changed &&\n \t\t\t(write_cache(index_fd, active_cache, active_nr) ||\n \t\t\t commit_locked_index(lock)))\n-\t\treturn error(\"Unable to write index.\");\n+\t\treturn error(_(\"Unable to write index.\"));\n \trollback_lock_file(lock);\n \n \tif (!strcmp(strategy, \"recursive\") || !strcmp(strategy, \"subtree\")) {\n@@ -651,7 +651,7 @@ static int try_merge_strategy(const char *strategy, struct commit_list *common,\n \t\tstruct commit_list *j;\n \n \t\tif (remoteheads->next) {\n-\t\t\terror(\"Not handling anything other than two heads merge.\");\n+\t\t\terror(_(\"Not handling anything other than two heads merge.\"));\n \t\t\treturn 2;\n \t\t}\n \n@@ -663,7 +663,7 @@ static int try_merge_strategy(const char *strategy, struct commit_list *common,\n \n \t\tfor (x = 0; x < xopts_nr; x++)\n \t\t\tif (parse_merge_opt(&o, xopts[x]))\n-\t\t\t\tdie(\"Unknown option for merge-recursive: -X%s\", xopts[x]);\n+\t\t\t\tdie(_(\"Unknown option for merge-recursive: -X%s\"), xopts[x]);\n \n \t\to.branch1 = head_arg;\n \t\to.branch2 = remoteheads->item->util;\n@@ -677,7 +677,7 @@ static int try_merge_strategy(const char *strategy, struct commit_list *common,\n \t\tif (active_cache_changed &&\n \t\t\t\t(write_cache(index_fd, active_cache, active_nr) ||\n \t\t\t\t commit_locked_index(lock)))\n-\t\t\tdie (\"unable to write %s\", get_index_file());\n+\t\t\tdie (_(\"unable to write %s\"), get_index_file());\n \t\trollback_lock_file(lock);\n \t\treturn clean ? 0 : 1;\n \t} else {\n@@ -749,7 +749,7 @@ int checkout_fast_forward(const unsigned char *head, const unsigned char *remote\n \t\treturn -1;\n \tif (write_cache(fd, active_cache, active_nr) ||\n \t\tcommit_locked_index(lock_file))\n-\t\tdie(\"unable to write new index file\");\n+\t\tdie(_(\"unable to write new index file\"));\n \treturn 0;\n }\n \n@@ -852,7 +852,7 @@ static int suggest_conflicts(int renormalizing)\n \n \tfp = fopen(git_path(\"MERGE_MSG\"), \"a\");\n \tif (!fp)\n-\t\tdie_errno(\"Could not open '%s' for writing\",\n+\t\tdie_errno(_(\"Could not open '%s' for writing\"),\n \t\t\t  git_path(\"MERGE_MSG\"));\n \tfprintf(fp, \"\\nConflicts:\\n\");\n \tfor (pos = 0; pos < active_nr; pos++) {\n@@ -868,8 +868,8 @@ static int suggest_conflicts(int renormalizing)\n \t}\n \tfclose(fp);\n \trerere(allow_rerere_auto);\n-\tprintf(\"Automatic merge failed; \"\n-\t\t\t\"fix conflicts and then commit the result.\\n\");\n+\tprintf(_(\"Automatic merge failed; \"\n+\t\t\t\"fix conflicts and then commit the result.\\n\"));\n \treturn 1;\n }\n \n@@ -883,7 +883,7 @@ static struct commit *is_old_style_invocation(int argc, const char **argv)\n \t\t\treturn NULL;\n \t\tsecond_token = lookup_commit_reference_gently(second_sha1, 0);\n \t\tif (!second_token)\n-\t\t\tdie(\"'%s' is not a commit\", argv[1]);\n+\t\t\tdie(_(\"'%s' is not a commit\"), argv[1]);\n \t\tif (hashcmp(second_token->object.sha1, head))\n \t\t\treturn NULL;\n \t}\n@@ -951,7 +951,7 @@ int cmd_merge(int argc, const char **argv, const char *prefix)\n \t\tconst char *nargv[] = {\"reset\", \"--merge\", NULL};\n \n \t\tif (!file_exists(git_path(\"MERGE_HEAD\")))\n-\t\t\tdie(\"There is no merge to abort (MERGE_HEAD missing).\");\n+\t\t\tdie(_(\"There is no merge to abort (MERGE_HEAD missing).\"));\n \n \t\t/* Invoke 'git reset --merge' */\n \t\treturn cmd_reset(nargc, nargv, prefix);\n@@ -966,10 +966,10 @@ int cmd_merge(int argc, const char **argv, const char *prefix)\n \t\t * add/rm <file>', just 'git commit'.\n \t\t */\n \t\tif (advice_resolve_conflict)\n-\t\t\tdie(\"You have not concluded your merge (MERGE_HEAD exists).\\n\"\n-\t\t\t    \"Please, commit your changes before you can merge.\");\n+\t\t\tdie(_(\"You have not concluded your merge (MERGE_HEAD exists).\\n\"\n+\t\t\t\t  \"Please, commit your changes before you can merge.\"));\n \t\telse\n-\t\t\tdie(\"You have not concluded your merge (MERGE_HEAD exists).\");\n+\t\t\tdie(_(\"You have not concluded your merge (MERGE_HEAD exists).\"));\n \t}\n \tresolve_undo_clear();\n \n@@ -978,12 +978,12 @@ int cmd_merge(int argc, const char **argv, const char *prefix)\n \n \tif (squash) {\n \t\tif (!allow_fast_forward)\n-\t\t\tdie(\"You cannot combine --squash with --no-ff.\");\n+\t\t\tdie(_(\"You cannot combine --squash with --no-ff.\"));\n \t\toption_commit = 0;\n \t}\n \n \tif (!allow_fast_forward && fast_forward_only)\n-\t\tdie(\"You cannot combine --no-ff with --ff-only.\");\n+\t\tdie(_(\"You cannot combine --no-ff with --ff-only.\"));\n \n \tif (!argc)\n \t\tusage_with_options(builtin_merge_usage,\n@@ -1011,16 +1011,16 @@ int cmd_merge(int argc, const char **argv, const char *prefix)\n \t\t * We do the same for \"git pull\".\n \t\t */\n \t\tif (argc != 1)\n-\t\t\tdie(\"Can merge only exactly one commit into \"\n-\t\t\t\t\"empty head\");\n+\t\t\tdie(_(\"Can merge only exactly one commit into \"\n+\t\t\t\t\"empty head\"));\n \t\tif (squash)\n-\t\t\tdie(\"Squash commit into empty head not supported yet\");\n+\t\t\tdie(_(\"Squash commit into empty head not supported yet\"));\n \t\tif (!allow_fast_forward)\n-\t\t\tdie(\"Non-fast-forward commit does not make sense into \"\n-\t\t\t    \"an empty head\");\n+\t\t\tdie(_(\"Non-fast-forward commit does not make sense into \"\n+\t\t\t    \"an empty head\"));\n \t\tremote_head = peel_to_type(argv[0], 0, NULL, OBJ_COMMIT);\n \t\tif (!remote_head)\n-\t\t\tdie(\"%s - not something we can merge\", argv[0]);\n+\t\t\tdie(_(\"%s - not something we can merge\"), argv[0]);\n \t\tupdate_ref(\"initial pull\", \"HEAD\", remote_head->sha1, NULL, 0,\n \t\t\t\tDIE_ON_ERR);\n \t\tread_empty(remote_head->sha1, 0);\n@@ -1066,7 +1066,7 @@ int cmd_merge(int argc, const char **argv, const char *prefix)\n \n \t\to = peel_to_type(argv[i], 0, NULL, OBJ_COMMIT);\n \t\tif (!o)\n-\t\t\tdie(\"%s - not something we can merge\", argv[i]);\n+\t\t\tdie(_(\"%s - not something we can merge\"), argv[i]);\n \t\tcommit = lookup_commit(o->sha1);\n \t\tcommit->util = (void *)argv[i];\n \t\tremotes = &commit_list_insert(commit, remotes)->next;\n@@ -1158,11 +1158,11 @@ int cmd_merge(int argc, const char **argv, const char *prefix)\n \t\tif (allow_trivial && !fast_forward_only) {\n \t\t\t/* See if it is really trivial. */\n \t\t\tgit_committer_info(IDENT_ERROR_ON_NO_NAME);\n-\t\t\tprintf(\"Trying really trivial in-index merge...\\n\");\n+\t\t\tprintf(_(\"Trying really trivial in-index merge...\\n\"));\n \t\t\tif (!read_tree_trivial(common->item->object.sha1,\n \t\t\t\t\thead, remoteheads->item->object.sha1))\n \t\t\t\treturn merge_trivial();\n-\t\t\tprintf(\"Nope.\\n\");\n+\t\t\tprintf(_(\"Nope.\\n\"));\n \t\t}\n \t} else {\n \t\t/*\n@@ -1195,7 +1195,7 @@ int cmd_merge(int argc, const char **argv, const char *prefix)\n \t}\n \n \tif (fast_forward_only)\n-\t\tdie(\"Not possible to fast-forward, aborting.\");\n+\t\tdie(_(\"Not possible to fast-forward, aborting.\"));\n \n \t/* We are going to make a new commit. */\n \tgit_committer_info(IDENT_ERROR_ON_NO_NAME);\n@@ -1221,11 +1221,11 @@ int cmd_merge(int argc, const char **argv, const char *prefix)\n \tfor (i = 0; i < use_strategies_nr; i++) {\n \t\tint ret;\n \t\tif (i) {\n-\t\t\tprintf(\"Rewinding the tree to pristine...\\n\");\n+\t\t\tprintf(_(\"Rewinding the tree to pristine...\\n\"));\n \t\t\trestore_state();\n \t\t}\n \t\tif (use_strategies_nr != 1)\n-\t\t\tprintf(\"Trying merge strategy %s...\\n\",\n+\t\t\tprintf(_(\"Trying merge strategy %s...\\n\"),\n \t\t\t\tuse_strategies[i]->name);\n \t\t/*\n \t\t * Remember which strategy left the state in the working\n@@ -1286,17 +1286,17 @@ int cmd_merge(int argc, const char **argv, const char *prefix)\n \t\trestore_state();\n \t\tif (use_strategies_nr > 1)\n \t\t\tfprintf(stderr,\n-\t\t\t\t\"No merge strategy handled the merge.\\n\");\n+\t\t\t\t_(\"No merge strategy handled the merge.\\n\"));\n \t\telse\n-\t\t\tfprintf(stderr, \"Merge with strategy %s failed.\\n\",\n+\t\t\tfprintf(stderr, _(\"Merge with strategy %s failed.\\n\"),\n \t\t\t\tuse_strategies[0]->name);\n \t\treturn 2;\n \t} else if (best_strategy == wt_strategy)\n \t\t; /* We already have its result in the working tree. */\n \telse {\n-\t\tprintf(\"Rewinding the tree to pristine...\\n\");\n+\t\tprintf(_(\"Rewinding the tree to pristine...\\n\"));\n \t\trestore_state();\n-\t\tprintf(\"Using the %s to prepare resolving by hand.\\n\",\n+\t\tprintf(_(\"Using the %s to prepare resolving by hand.\\n\"),\n \t\t\tbest_strategy);\n \t\ttry_merge_strategy(best_strategy, common, head_arg);\n \t}\n@@ -1312,35 +1312,35 @@ int cmd_merge(int argc, const char **argv, const char *prefix)\n \t\t\t\tsha1_to_hex(j->item->object.sha1));\n \t\tfd = open(git_path(\"MERGE_HEAD\"), O_WRONLY | O_CREAT, 0666);\n \t\tif (fd < 0)\n-\t\t\tdie_errno(\"Could not open '%s' for writing\",\n+\t\t\tdie_errno(_(\"Could not open '%s' for writing\"),\n \t\t\t\t  git_path(\"MERGE_HEAD\"));\n \t\tif (write_in_full(fd, buf.buf, buf.len) != buf.len)\n-\t\t\tdie_errno(\"Could not write to '%s'\", git_path(\"MERGE_HEAD\"));\n+\t\t\tdie_errno(_(\"Could not write to '%s'\"), git_path(\"MERGE_HEAD\"));\n \t\tclose(fd);\n \t\tstrbuf_addch(&merge_msg, '\\n');\n \t\tfd = open(git_path(\"MERGE_MSG\"), O_WRONLY | O_CREAT, 0666);\n \t\tif (fd < 0)\n-\t\t\tdie_errno(\"Could not open '%s' for writing\",\n+\t\t\tdie_errno(_(\"Could not open '%s' for writing\"),\n \t\t\t\t  git_path(\"MERGE_MSG\"));\n \t\tif (write_in_full(fd, merge_msg.buf, merge_msg.len) !=\n \t\t\tmerge_msg.len)\n-\t\t\tdie_errno(\"Could not write to '%s'\", git_path(\"MERGE_MSG\"));\n+\t\t\tdie_errno(_(\"Could not write to '%s'\"), git_path(\"MERGE_MSG\"));\n \t\tclose(fd);\n \t\tfd = open(git_path(\"MERGE_MODE\"), O_WRONLY | O_CREAT | O_TRUNC, 0666);\n \t\tif (fd < 0)\n-\t\t\tdie_errno(\"Could not open '%s' for writing\",\n+\t\t\tdie_errno(_(\"Could not open '%s' for writing\"),\n \t\t\t\t  git_path(\"MERGE_MODE\"));\n \t\tstrbuf_reset(&buf);\n \t\tif (!allow_fast_forward)\n \t\t\tstrbuf_addf(&buf, \"no-ff\");\n \t\tif (write_in_full(fd, buf.buf, buf.len) != buf.len)\n-\t\t\tdie_errno(\"Could not write to '%s'\", git_path(\"MERGE_MODE\"));\n+\t\t\tdie_errno(_(\"Could not write to '%s'\"), git_path(\"MERGE_MODE\"));\n \t\tclose(fd);\n \t}\n \n \tif (merge_was_ok) {\n-\t\tfprintf(stderr, \"Automatic merge went well; \"\n-\t\t\t\"stopped before committing as requested\\n\");\n+\t\tfprintf(stderr, _(\"Automatic merge went well; \"\n+\t\t\t\"stopped before committing as requested\\n\"));\n \t\treturn 0;\n \t} else\n \t\treturn suggest_conflicts(option_renormalize);\ndiff --git a/t/t7607-merge-overwrite.sh b/t/t7607-merge-overwrite.sh\nindex 5f731a1..ccd5a56 100755\n--- a/t/t7607-merge-overwrite.sh\n+++ b/t/t7607-merge-overwrite.sh\n@@ -150,8 +150,14 @@ test_expect_success 'will not overwrite untracked file on unborn branch' '\n \tgit rm -fr . &&\n \tgit checkout --orphan new &&\n \tcp important c0.c &&\n-\ttest_must_fail git merge c0 2>out &&\n-\ttest_cmp out expect &&\n+\ttest_must_fail git merge c0 2>out\n+'\n+\n+test_expect_success NO_GETTEXT_POISON 'will not overwrite untracked file on unborn branch: output' '\n+\ttest_cmp out expect\n+'\n+\n+test_expect_success 'will not overwrite untracked file on unborn branch .git/MERGE_HEAD sanity etc.' '\n \ttest_path_is_missing .git/MERGE_HEAD &&\n \ttest_cmp important c0.c\n '\ndiff --git a/t/t7611-merge-abort.sh b/t/t7611-merge-abort.sh\nindex 61890bc..760271c 100755\n--- a/t/t7611-merge-abort.sh\n+++ b/t/t7611-merge-abort.sh\n@@ -46,8 +46,14 @@ test_expect_success 'setup' '\n pre_merge_head=\"$(git rev-parse HEAD)\"\n \n test_expect_success 'fails without MERGE_HEAD (unstarted merge)' '\n-\ttest_must_fail git merge --abort 2>output &&\n-\tgrep -q MERGE_HEAD output &&\n+\ttest_must_fail git merge --abort 2>output\n+'\n+\n+test_expect_success NO_GETTEXT_POISON 'fails without MERGE_HEAD (unstarted merge): fatal output' '\n+\tgrep -q MERGE_HEAD output\n+'\n+\n+test_expect_success 'fails without MERGE_HEAD (unstarted merge): .git/MERGE_HEAD sanity' '\n \ttest ! -f .git/MERGE_HEAD &&\n \ttest \"$pre_merge_head\" = \"$(git rev-parse HEAD)\"\n '\n@@ -57,8 +63,14 @@ test_expect_success 'fails without MERGE_HEAD (completed merge)' '\n \ttest ! -f .git/MERGE_HEAD &&\n \t# Merge successfully completed\n \tpost_merge_head=\"$(git rev-parse HEAD)\" &&\n-\ttest_must_fail git merge --abort 2>output &&\n-\tgrep -q MERGE_HEAD output &&\n+\ttest_must_fail git merge --abort 2>output\n+'\n+\n+test_expect_success NO_GETTEXT_POISON 'fails without MERGE_HEAD (completed merge): output' '\n+\tgrep -q MERGE_HEAD output\n+'\n+\n+test_expect_success 'fails without MERGE_HEAD (completed merge): .git/MERGE_HEAD sanity' '\n \ttest ! -f .git/MERGE_HEAD &&\n \ttest \"$post_merge_head\" = \"$(git rev-parse HEAD)\"\n '\n-- \n1.7.2.3\n"},{"id":"161699","messageId":"1298143495-3681-41-git-send-email-avarab@gmail.com","threadId":"26561","inReplyTo":"1298143495-3681-1-git-send-email-avarab@gmail.com","subject":"[PATCH 40/72] gettextize: git-merge \"Updating %s..%s\" message","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2011-02-19T19:24:23Z","receivedAt":"2011-02-19T19:24:23Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"Gettextize the \"Updating %s..%s\\n\" message. A test in\nt1200-tutorial.sh explicitly checked for this message. Split it into\ntwo tests to skip the test_cmp test under GETTEXT_POISON=YesPlease.\n\nSigned-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n builtin/merge.c     |    2 +-\n t/t1200-tutorial.sh |    5 ++++-\n 2 files changed, 5 insertions(+), 2 deletions(-)\n\ndiff --git a/builtin/merge.c b/builtin/merge.c\nindex 0be4dfa..4f6b34f 100644\n--- a/builtin/merge.c\n+++ b/builtin/merge.c\n@@ -1124,7 +1124,7 @@ int cmd_merge(int argc, const char **argv, const char *prefix)\n \t\tstrcpy(hex, find_unique_abbrev(head, DEFAULT_ABBREV));\n \n \t\tif (verbosity >= 0)\n-\t\t\tprintf(\"Updating %s..%s\\n\",\n+\t\t\tprintf(_(\"Updating %s..%s\\n\"),\n \t\t\t\thex,\n \t\t\t\tfind_unique_abbrev(remoteheads->item->object.sha1,\n \t\t\t\tDEFAULT_ABBREV));\ndiff --git a/t/t1200-tutorial.sh b/t/t1200-tutorial.sh\nindex bfa2c21..fb02cac 100755\n--- a/t/t1200-tutorial.sh\n+++ b/t/t1200-tutorial.sh\n@@ -163,7 +163,10 @@ test_expect_success 'git resolve' '\n \tgit checkout mybranch &&\n \tgit merge -m \"Merge upstream changes.\" master |\n \t\tsed -e \"1s/[0-9a-f]\\{7\\}/VARIABLE/g\" \\\n-\t\t-e \"s/^Fast[- ]forward /FASTFORWARD /\" >resolve.output &&\n+\t\t-e \"s/^Fast[- ]forward /FASTFORWARD /\" >resolve.output\n+'\n+\n+test_expect_success NO_GETTEXT_POISON 'git resolve output' '\n \ttest_cmp resolve.expect resolve.output\n '\n \n-- \n1.7.2.3\n"},{"id":"161704","messageId":"1298143495-3681-42-git-send-email-avarab@gmail.com","threadId":"26561","inReplyTo":"1298143495-3681-1-git-send-email-avarab@gmail.com","subject":"[PATCH 41/72] gettextize: git-merge \"You have not concluded your merge\" messages","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2011-02-19T19:24:24Z","receivedAt":"2011-02-19T19:24:24Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"Gettextize the \"You have not concluded your merge messages. A test in\nt3030-merge-recursive.sh explicitly checked for this message. Change\nit to skip the test under GETTEXT_POISON=YesPlease.\n\nSigned-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n t/t3030-merge-recursive.sh |    2 +-\n 1 files changed, 1 insertions(+), 1 deletions(-)\n\ndiff --git a/t/t3030-merge-recursive.sh b/t/t3030-merge-recursive.sh\nindex 34794f8..d441036 100755\n--- a/t/t3030-merge-recursive.sh\n+++ b/t/t3030-merge-recursive.sh\n@@ -312,7 +312,7 @@ test_expect_success 'merge-recursive result' '\n \n '\n \n-test_expect_success 'fail if the index has unresolved entries' '\n+test_expect_success NO_GETTEXT_POISON 'fail if the index has unresolved entries' '\n \n \trm -fr [abcd] &&\n \tgit checkout -f \"$c1\" &&\n-- \n1.7.2.3\n"},{"id":"161670","messageId":"1298143495-3681-43-git-send-email-avarab@gmail.com","threadId":"26561","inReplyTo":"1298143495-3681-1-git-send-email-avarab@gmail.com","subject":"[PATCH 42/72] gettextize: git-merge \"Wonderful\" message","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2011-02-19T19:24:25Z","receivedAt":"2011-02-19T19:24:25Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"Gettextize the \"Wonderful\" message. A test in t7600-merge.sh\nexplicitly checked for this message. Change it to skip under\nGETTEXT_POISON=YesPlease.\n\nSigned-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n builtin/merge.c  |    2 +-\n t/t7600-merge.sh |    2 +-\n 2 files changed, 2 insertions(+), 2 deletions(-)\n\ndiff --git a/builtin/merge.c b/builtin/merge.c\nindex 4f6b34f..f998206 100644\n--- a/builtin/merge.c\n+++ b/builtin/merge.c\n@@ -803,7 +803,7 @@ static int merge_trivial(void)\n \tstruct commit_list *parent = xmalloc(sizeof(*parent));\n \n \twrite_tree_trivial(result_tree);\n-\tprintf(\"Wonderful.\\n\");\n+\tprintf(_(\"Wonderful.\\n\"));\n \tparent->item = lookup_commit(head);\n \tparent->next = xmalloc(sizeof(*parent->next));\n \tparent->next->item = remoteheads->item;\ndiff --git a/t/t7600-merge.sh b/t/t7600-merge.sh\nindex b147a1b..3aafdda 100755\n--- a/t/t7600-merge.sh\n+++ b/t/t7600-merge.sh\n@@ -495,7 +495,7 @@ test_expect_success 'merge fast-forward in a dirty tree' '\n \n test_debug 'git log --graph --decorate --oneline --all'\n \n-test_expect_success 'in-index merge' '\n+test_expect_success NO_GETTEXT_POISON 'in-index merge' '\n \tgit reset --hard c0 &&\n \tgit merge --no-ff -s resolve c1 >out &&\n \tgrep \"Wonderful.\" out &&\n-- \n1.7.2.3\n"},{"id":"161669","messageId":"1298143495-3681-44-git-send-email-avarab@gmail.com","threadId":"26561","inReplyTo":"1298143495-3681-1-git-send-email-avarab@gmail.com","subject":"[PATCH 43/72] gettextize: git-mv basic messages","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2011-02-19T19:24:26Z","receivedAt":"2011-02-19T19:24:26Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n builtin/mv.c |   16 ++++++++--------\n 1 files changed, 8 insertions(+), 8 deletions(-)\n\ndiff --git a/builtin/mv.c b/builtin/mv.c\nindex 93e8995..18a2218 100644\n--- a/builtin/mv.c\n+++ b/builtin/mv.c\n@@ -74,7 +74,7 @@ int cmd_mv(int argc, const char **argv, const char *prefix)\n \n \tnewfd = hold_locked_index(&lock_file, 1);\n \tif (read_cache() < 0)\n-\t\tdie(\"index file corrupt\");\n+\t\tdie(_(\"index file corrupt\"));\n \n \tsource = copy_pathspec(prefix, argv, argc, 0);\n \tmodes = xcalloc(argc, sizeof(enum update_mode));\n@@ -100,7 +100,7 @@ int cmd_mv(int argc, const char **argv, const char *prefix)\n \t\tconst char *bad = NULL;\n \n \t\tif (show_only)\n-\t\t\tprintf(\"Checking rename of '%s' to '%s'\\n\", src, dst);\n+\t\t\tprintf(_(\"Checking rename of '%s' to '%s'\\n\"), src, dst);\n \n \t\tlength = strlen(src);\n \t\tif (lstat(src, &st) < 0)\n@@ -120,7 +120,7 @@ int cmd_mv(int argc, const char **argv, const char *prefix)\n \n \t\t\tfirst = cache_name_pos(src_w_slash, len_w_slash);\n \t\t\tif (first >= 0)\n-\t\t\t\tdie (\"Huh? %.*s is in index?\",\n+\t\t\t\tdie (_(\"Huh? %.*s is in index?\"),\n \t\t\t\t\t\tlen_w_slash, src_w_slash);\n \n \t\t\tfirst = -1 - first;\n@@ -172,7 +172,7 @@ int cmd_mv(int argc, const char **argv, const char *prefix)\n \t\t\t\t * check both source and destination\n \t\t\t\t */\n \t\t\t\tif (S_ISREG(st.st_mode) || S_ISLNK(st.st_mode)) {\n-\t\t\t\t\twarning(\"%s; will overwrite!\", bad);\n+\t\t\t\t\twarning(_(\"%s; will overwrite!\"), bad);\n \t\t\t\t\tbad = NULL;\n \t\t\t\t} else\n \t\t\t\t\tbad = \"Cannot overwrite\";\n@@ -193,7 +193,7 @@ int cmd_mv(int argc, const char **argv, const char *prefix)\n \t\t\t\t\ti--;\n \t\t\t\t}\n \t\t\t} else\n-\t\t\t\tdie (\"%s, source=%s, destination=%s\",\n+\t\t\t\tdie (_(\"%s, source=%s, destination=%s\"),\n \t\t\t\t     bad, src, dst);\n \t\t}\n \t}\n@@ -203,10 +203,10 @@ int cmd_mv(int argc, const char **argv, const char *prefix)\n \t\tenum update_mode mode = modes[i];\n \t\tint pos;\n \t\tif (show_only || verbose)\n-\t\t\tprintf(\"Renaming %s to %s\\n\", src, dst);\n+\t\t\tprintf(_(\"Renaming %s to %s\\n\"), src, dst);\n \t\tif (!show_only && mode != INDEX &&\n \t\t\t\trename(src, dst) < 0 && !ignore_errors)\n-\t\t\tdie_errno (\"renaming '%s' failed\", src);\n+\t\t\tdie_errno (_(\"renaming '%s' failed\"), src);\n \n \t\tif (mode == WORKING_DIRECTORY)\n \t\t\tcontinue;\n@@ -220,7 +220,7 @@ int cmd_mv(int argc, const char **argv, const char *prefix)\n \tif (active_cache_changed) {\n \t\tif (write_cache(newfd, active_cache, active_nr) ||\n \t\t    commit_locked_index(&lock_file))\n-\t\t\tdie(\"Unable to write new index file\");\n+\t\t\tdie(_(\"Unable to write new index file\"));\n \t}\n \n \treturn 0;\n-- \n1.7.2.3\n"},{"id":"161700","messageId":"1298143495-3681-45-git-send-email-avarab@gmail.com","threadId":"26561","inReplyTo":"1298143495-3681-1-git-send-email-avarab@gmail.com","subject":"[PATCH 44/72] gettextize: git-mv \"bad\" messages","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2011-02-19T19:24:27Z","receivedAt":"2011-02-19T19:24:27Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"Gettextize messages made by assigning to the \"bad\" char* variable.\n\nSigned-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n builtin/mv.c |   16 ++++++++--------\n 1 files changed, 8 insertions(+), 8 deletions(-)\n\ndiff --git a/builtin/mv.c b/builtin/mv.c\nindex 18a2218..40f33ca 100644\n--- a/builtin/mv.c\n+++ b/builtin/mv.c\n@@ -104,13 +104,13 @@ int cmd_mv(int argc, const char **argv, const char *prefix)\n \n \t\tlength = strlen(src);\n \t\tif (lstat(src, &st) < 0)\n-\t\t\tbad = \"bad source\";\n+\t\t\tbad = _(\"bad source\");\n \t\telse if (!strncmp(src, dst, length) &&\n \t\t\t\t(dst[length] == 0 || dst[length] == '/')) {\n-\t\t\tbad = \"can not move directory into itself\";\n+\t\t\tbad = _(\"can not move directory into itself\");\n \t\t} else if ((src_is_dir = S_ISDIR(st.st_mode))\n \t\t\t\t&& lstat(dst, &st) == 0)\n-\t\t\tbad = \"cannot move directory over file\";\n+\t\t\tbad = _(\"cannot move directory over file\");\n \t\telse if (src_is_dir) {\n \t\t\tconst char *src_w_slash = add_slash(src);\n \t\t\tint len_w_slash = length + 1;\n@@ -132,7 +132,7 @@ int cmd_mv(int argc, const char **argv, const char *prefix)\n \t\t\tfree((char *)src_w_slash);\n \n \t\t\tif (last - first < 1)\n-\t\t\t\tbad = \"source directory is empty\";\n+\t\t\t\tbad = _(\"source directory is empty\");\n \t\t\telse {\n \t\t\t\tint j, dst_len;\n \n@@ -163,9 +163,9 @@ int cmd_mv(int argc, const char **argv, const char *prefix)\n \t\t\t\targc += last - first;\n \t\t\t}\n \t\t} else if (cache_name_pos(src, length) < 0)\n-\t\t\tbad = \"not under version control\";\n+\t\t\tbad = _(\"not under version control\");\n \t\telse if (lstat(dst, &st) == 0) {\n-\t\t\tbad = \"destination exists\";\n+\t\t\tbad = _(\"destination exists\");\n \t\t\tif (force) {\n \t\t\t\t/*\n \t\t\t\t * only files can overwrite each other:\n@@ -175,10 +175,10 @@ int cmd_mv(int argc, const char **argv, const char *prefix)\n \t\t\t\t\twarning(_(\"%s; will overwrite!\"), bad);\n \t\t\t\t\tbad = NULL;\n \t\t\t\t} else\n-\t\t\t\t\tbad = \"Cannot overwrite\";\n+\t\t\t\t\tbad = _(\"Cannot overwrite\");\n \t\t\t}\n \t\t} else if (string_list_has_string(&src_for_dst, dst))\n-\t\t\tbad = \"multiple sources for the same target\";\n+\t\t\tbad = _(\"multiple sources for the same target\");\n \t\telse\n \t\t\tstring_list_insert(&src_for_dst, dst);\n \n-- \n1.7.2.3\n"},{"id":"161671","messageId":"1298143495-3681-46-git-send-email-avarab@gmail.com","threadId":"26561","inReplyTo":"1298143495-3681-1-git-send-email-avarab@gmail.com","subject":"[PATCH 45/72] gettextize: git-rm basic messages","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2011-02-19T19:24:28Z","receivedAt":"2011-02-19T19:24:28Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"Make the basic git-mv messages translatable, but skip things like \"rm\n'%s'\\n\" and \"git rm '%s'\\n\" for now.\n\nSigned-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n builtin/rm.c |   22 +++++++++++-----------\n 1 files changed, 11 insertions(+), 11 deletions(-)\n\ndiff --git a/builtin/rm.c b/builtin/rm.c\nindex ff491d7..90c8a50 100644\n--- a/builtin/rm.c\n+++ b/builtin/rm.c\n@@ -106,19 +106,19 @@ static int check_local_mod(unsigned char *head, int index_only)\n \t\t */\n \t\tif (local_changes && staged_changes) {\n \t\t\tif (!index_only || !(ce->ce_flags & CE_INTENT_TO_ADD))\n-\t\t\t\terrs = error(\"'%s' has staged content different \"\n+\t\t\t\terrs = error(_(\"'%s' has staged content different \"\n \t\t\t\t\t     \"from both the file and the HEAD\\n\"\n-\t\t\t\t\t     \"(use -f to force removal)\", name);\n+\t\t\t\t\t     \"(use -f to force removal)\"), name);\n \t\t}\n \t\telse if (!index_only) {\n \t\t\tif (staged_changes)\n-\t\t\t\terrs = error(\"'%s' has changes staged in the index\\n\"\n+\t\t\t\terrs = error(_(\"'%s' has changes staged in the index\\n\"\n \t\t\t\t\t     \"(use --cached to keep the file, \"\n-\t\t\t\t\t     \"or -f to force removal)\", name);\n+\t\t\t\t\t     \"or -f to force removal)\"), name);\n \t\t\tif (local_changes)\n-\t\t\t\terrs = error(\"'%s' has local modifications\\n\"\n+\t\t\t\terrs = error(_(\"'%s' has local modifications\\n\"\n \t\t\t\t\t     \"(use --cached to keep the file, \"\n-\t\t\t\t\t     \"or -f to force removal)\", name);\n+\t\t\t\t\t     \"or -f to force removal)\"), name);\n \t\t}\n \t}\n \treturn errs;\n@@ -159,7 +159,7 @@ int cmd_rm(int argc, const char **argv, const char *prefix)\n \tnewfd = hold_locked_index(&lock_file, 1);\n \n \tif (read_cache() < 0)\n-\t\tdie(\"index file corrupt\");\n+\t\tdie(_(\"index file corrupt\"));\n \n \tpathspec = get_pathspec(prefix, argv);\n \trefresh_index(&the_index, REFRESH_QUIET, pathspec, NULL, NULL);\n@@ -183,7 +183,7 @@ int cmd_rm(int argc, const char **argv, const char *prefix)\n \t\tfor (i = 0; (match = pathspec[i]) != NULL ; i++) {\n \t\t\tif (!seen[i]) {\n \t\t\t\tif (!ignore_unmatch) {\n-\t\t\t\t\tdie(\"pathspec '%s' did not match any files\",\n+\t\t\t\t\tdie(_(\"pathspec '%s' did not match any files\"),\n \t\t\t\t\t    match);\n \t\t\t\t}\n \t\t\t}\n@@ -191,7 +191,7 @@ int cmd_rm(int argc, const char **argv, const char *prefix)\n \t\t\t\tseen_any = 1;\n \t\t\t}\n \t\t\tif (!recursive && seen[i] == MATCHED_RECURSIVELY)\n-\t\t\t\tdie(\"not removing '%s' recursively without -r\",\n+\t\t\t\tdie(_(\"not removing '%s' recursively without -r\"),\n \t\t\t\t    *match ? match : \".\");\n \t\t}\n \n@@ -227,7 +227,7 @@ int cmd_rm(int argc, const char **argv, const char *prefix)\n \t\t\tprintf(\"rm '%s'\\n\", path);\n \n \t\tif (remove_file_from_cache(path))\n-\t\t\tdie(\"git rm: unable to remove %s\", path);\n+\t\t\tdie(_(\"git rm: unable to remove %s\"), path);\n \t}\n \n \tif (show_only)\n@@ -257,7 +257,7 @@ int cmd_rm(int argc, const char **argv, const char *prefix)\n \tif (active_cache_changed) {\n \t\tif (write_cache(newfd, active_cache, active_nr) ||\n \t\t    commit_locked_index(&lock_file))\n-\t\t\tdie(\"Unable to write new index file\");\n+\t\t\tdie(_(\"Unable to write new index file\"));\n \t}\n \n \treturn 0;\n-- \n1.7.2.3\n"},{"id":"161676","messageId":"1298143495-3681-47-git-send-email-avarab@gmail.com","threadId":"26561","inReplyTo":"1298143495-3681-1-git-send-email-avarab@gmail.com","subject":"[PATCH 46/72] gettextize: git-reset basic messages","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2011-02-19T19:24:29Z","receivedAt":"2011-02-19T19:24:29Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n builtin/reset.c |   26 +++++++++++++-------------\n 1 files changed, 13 insertions(+), 13 deletions(-)\n\ndiff --git a/builtin/reset.c b/builtin/reset.c\nindex 5de2bce..0823955 100644\n--- a/builtin/reset.c\n+++ b/builtin/reset.c\n@@ -92,20 +92,20 @@ static int reset_index_file(const unsigned char *sha1, int reset_type, int quiet\n \tif (reset_type == KEEP) {\n \t\tunsigned char head_sha1[20];\n \t\tif (get_sha1(\"HEAD\", head_sha1))\n-\t\t\treturn error(\"You do not have a valid HEAD.\");\n+\t\t\treturn error(_(\"You do not have a valid HEAD.\"));\n \t\tif (!fill_tree_descriptor(desc, head_sha1))\n-\t\t\treturn error(\"Failed to find tree of HEAD.\");\n+\t\t\treturn error(_(\"Failed to find tree of HEAD.\"));\n \t\tnr++;\n \t\topts.fn = twoway_merge;\n \t}\n \n \tif (!fill_tree_descriptor(desc + nr - 1, sha1))\n-\t\treturn error(\"Failed to find tree of %s.\", sha1_to_hex(sha1));\n+\t\treturn error(_(\"Failed to find tree of %s.\"), sha1_to_hex(sha1));\n \tif (unpack_trees(nr, desc, &opts))\n \t\treturn -1;\n \tif (write_cache(newfd, active_cache, active_nr) ||\n \t    commit_locked_index(lock))\n-\t\treturn error(\"Could not write new index file.\");\n+\t\treturn error(_(\"Could not write new index file.\"));\n \n \treturn 0;\n }\n@@ -115,7 +115,7 @@ static void print_new_head_line(struct commit *commit)\n \tconst char *hex, *body;\n \n \thex = find_unique_abbrev(commit->object.sha1, DEFAULT_ABBREV);\n-\tprintf(\"HEAD is now at %s\", hex);\n+\tprintf(_(\"HEAD is now at %s\"), hex);\n \tbody = strstr(commit->buffer, \"\\n\\n\");\n \tif (body) {\n \t\tconst char *eol;\n@@ -139,7 +139,7 @@ static int update_index_refresh(int fd, struct lock_file *index_lock, int flags)\n \t}\n \n \tif (read_cache() < 0)\n-\t\treturn error(\"Could not read index\");\n+\t\treturn error(_(\"Could not read index\"));\n \n \tresult = refresh_index(&the_index, (flags), NULL, NULL,\n \t\t\t       \"Unstaged changes after reset:\") ? 1 : 0;\n@@ -167,7 +167,7 @@ static void update_index_from_diff(struct diff_queue_struct *q,\n \t\t\tce = make_cache_entry(one->mode, one->sha1, one->path,\n \t\t\t\t0, 0);\n \t\t\tif (!ce)\n-\t\t\t\tdie(\"make_cache_entry failed for path '%s'\",\n+\t\t\t\tdie(_(\"make_cache_entry failed for path '%s'\"),\n \t\t\t\t    one->path);\n \t\t\tadd_cache_entry(ce, ADD_CACHE_OK_TO_ADD |\n \t\t\t\tADD_CACHE_OK_TO_REPLACE);\n@@ -222,7 +222,7 @@ static void prepend_reflog_action(const char *action, char *buf, size_t size)\n \tif (!rla)\n \t\trla = sep = \"\";\n \tif (snprintf(buf, size, \"%s%s%s\", rla, sep, action) >= size)\n-\t\twarning(\"Reflog action message too long: %.*s...\", 50, buf);\n+\t\twarning(_(\"Reflog action message too long: %.*s...\"), 50, buf);\n }\n \n static void die_if_unmerged_cache(int reset_type)\n@@ -300,16 +300,16 @@ int cmd_reset(int argc, const char **argv, const char *prefix)\n \t}\n \n \tif (get_sha1(rev, sha1))\n-\t\tdie(\"Failed to resolve '%s' as a valid ref.\", rev);\n+\t\tdie(_(\"Failed to resolve '%s' as a valid ref.\"), rev);\n \n \tcommit = lookup_commit_reference(sha1);\n \tif (!commit)\n-\t\tdie(\"Could not parse object '%s'.\", rev);\n+\t\tdie(_(\"Could not parse object '%s'.\"), rev);\n \thashcpy(sha1, commit->object.sha1);\n \n \tif (patch_mode) {\n \t\tif (reset_type != NONE)\n-\t\t\tdie(\"--patch is incompatible with --{hard,mixed,soft}\");\n+\t\t\tdie(_(\"--patch is incompatible with --{hard,mixed,soft}\"));\n \t\treturn interactive_reset(rev, argv + i, prefix);\n \t}\n \n@@ -318,7 +318,7 @@ int cmd_reset(int argc, const char **argv, const char *prefix)\n \t * affecting the working tree nor HEAD. */\n \tif (i < argc) {\n \t\tif (reset_type == MIXED)\n-\t\t\twarning(\"--mixed with paths is deprecated; use 'git reset -- <paths>' instead.\");\n+\t\t\twarning(_(\"--mixed with paths is deprecated; use 'git reset -- <paths>' instead.\"));\n \t\telse if (reset_type != NONE)\n \t\t\tdie(\"Cannot do %s reset with paths.\",\n \t\t\t\t\treset_type_names[reset_type]);\n@@ -348,7 +348,7 @@ int cmd_reset(int argc, const char **argv, const char *prefix)\n \t\tif (reset_type == KEEP)\n \t\t\terr = err || reset_index_file(sha1, MIXED, quiet);\n \t\tif (err)\n-\t\t\tdie(\"Could not reset index file to revision '%s'.\", rev);\n+\t\t\tdie(_(\"Could not reset index file to revision '%s'.\"), rev);\n \t}\n \n \t/* Any resets update HEAD to the head being switched to,\n-- \n1.7.2.3\n"},{"id":"161702","messageId":"1298143495-3681-48-git-send-email-avarab@gmail.com","threadId":"26561","inReplyTo":"1298143495-3681-1-git-send-email-avarab@gmail.com","subject":"[PATCH 47/72] gettextize: git-reset reset_type_names messages","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2011-02-19T19:24:30Z","receivedAt":"2011-02-19T19:24:30Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"Make the messages in git-reset that use the reset_type_names static\narray to be translatable by marking the array items with N_() and\nusing _() later.\n\nSigned-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n builtin/reset.c |   14 +++++++-------\n 1 files changed, 7 insertions(+), 7 deletions(-)\n\ndiff --git a/builtin/reset.c b/builtin/reset.c\nindex 0823955..1465174 100644\n--- a/builtin/reset.c\n+++ b/builtin/reset.c\n@@ -30,7 +30,7 @@ static const char * const git_reset_usage[] = {\n \n enum reset_type { MIXED, SOFT, HARD, MERGE, KEEP, NONE };\n static const char *reset_type_names[] = {\n-\t\"mixed\", \"soft\", \"hard\", \"merge\", \"keep\", NULL\n+\tN_(\"mixed\"), N_(\"soft\"), N_(\"hard\"), N_(\"merge\"), N_(\"keep\"), NULL\n };\n \n static char *args_to_str(const char **argv)\n@@ -228,8 +228,8 @@ static void prepend_reflog_action(const char *action, char *buf, size_t size)\n static void die_if_unmerged_cache(int reset_type)\n {\n \tif (is_merge() || read_cache() < 0 || unmerged_cache())\n-\t\tdie(\"Cannot do a %s reset in the middle of a merge.\",\n-\t\t    reset_type_names[reset_type]);\n+\t\tdie(_(\"Cannot do a %s reset in the middle of a merge.\"),\n+\t\t    _(reset_type_names[reset_type]));\n \n }\n \n@@ -320,8 +320,8 @@ int cmd_reset(int argc, const char **argv, const char *prefix)\n \t\tif (reset_type == MIXED)\n \t\t\twarning(_(\"--mixed with paths is deprecated; use 'git reset -- <paths>' instead.\"));\n \t\telse if (reset_type != NONE)\n-\t\t\tdie(\"Cannot do %s reset with paths.\",\n-\t\t\t\t\treset_type_names[reset_type]);\n+\t\t\tdie(_(\"Cannot do %s reset with paths.\"),\n+\t\t\t\t\t_(reset_type_names[reset_type]));\n \t\treturn read_from_tree(prefix, argv + i, sha1,\n \t\t\t\tquiet ? REFRESH_QUIET : REFRESH_IN_PORCELAIN);\n \t}\n@@ -332,8 +332,8 @@ int cmd_reset(int argc, const char **argv, const char *prefix)\n \t\tsetup_work_tree();\n \n \tif (reset_type == MIXED && is_bare_repository())\n-\t\tdie(\"%s reset is not allowed in a bare repository\",\n-\t\t    reset_type_names[reset_type]);\n+\t\tdie(_(\"%s reset is not allowed in a bare repository\"),\n+\t\t    _(reset_type_names[reset_type]));\n \n \t/* Soft reset does not touch the index file nor the working tree\n \t * at all, but requires them in a good order.  Other resets reset\n-- \n1.7.2.3\n"},{"id":"161701","messageId":"1298143495-3681-49-git-send-email-avarab@gmail.com","threadId":"26561","inReplyTo":"1298143495-3681-1-git-send-email-avarab@gmail.com","subject":"[PATCH 48/72] gettextize: git-reset \"Unstaged changes after reset\" message","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2011-02-19T19:24:31Z","receivedAt":"2011-02-19T19:24:31Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"Gettextize the \"\"Unstaged changes after reset:\" message. A test in\nt7102-reset.sh explicitly checked for this message. Change it to skip\nunder GETTEXT_POISON=YesPlease.\n\nSigned-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n builtin/reset.c  |    2 +-\n t/t7102-reset.sh |    2 +-\n 2 files changed, 2 insertions(+), 2 deletions(-)\n\ndiff --git a/builtin/reset.c b/builtin/reset.c\nindex 1465174..1fe5b0f 100644\n--- a/builtin/reset.c\n+++ b/builtin/reset.c\n@@ -142,7 +142,7 @@ static int update_index_refresh(int fd, struct lock_file *index_lock, int flags)\n \t\treturn error(_(\"Could not read index\"));\n \n \tresult = refresh_index(&the_index, (flags), NULL, NULL,\n-\t\t\t       \"Unstaged changes after reset:\") ? 1 : 0;\n+\t\t\t       _(\"Unstaged changes after reset:\")) ? 1 : 0;\n \tif (write_cache(fd, active_cache, active_nr) ||\n \t\t\tcommit_locked_index(index_lock))\n \t\treturn error (\"Could not refresh index\");\ndiff --git a/t/t7102-reset.sh b/t/t7102-reset.sh\nindex b8cf260..1370949 100755\n--- a/t/t7102-reset.sh\n+++ b/t/t7102-reset.sh\n@@ -423,7 +423,7 @@ Unstaged changes after reset:\n M\tfile2\n EOF\n \n-test_expect_success '--mixed refreshes the index' '\n+test_expect_success NO_GETTEXT_POISON '--mixed refreshes the index' '\n \techo 123 >> file2 &&\n \tgit reset --mixed HEAD > output &&\n \ttest_cmp expect output\n-- \n1.7.2.3\n"},{"id":"161675","messageId":"1298143495-3681-50-git-send-email-avarab@gmail.com","threadId":"26561","inReplyTo":"1298143495-3681-1-git-send-email-avarab@gmail.com","subject":"[PATCH 49/72] gettextize: git-tag basic messages","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2011-02-19T19:24:32Z","receivedAt":"2011-02-19T19:24:32Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n builtin/tag.c |   60 ++++++++++++++++++++++++++++----------------------------\n 1 files changed, 30 insertions(+), 30 deletions(-)\n\ndiff --git a/builtin/tag.c b/builtin/tag.c\nindex 246a2bc..4bed7c2 100644\n--- a/builtin/tag.c\n+++ b/builtin/tag.c\n@@ -118,12 +118,12 @@ static int for_each_tag_name(const char **argv, each_tag_name_fn fn)\n \tfor (p = argv; *p; p++) {\n \t\tif (snprintf(ref, sizeof(ref), \"refs/tags/%s\", *p)\n \t\t\t\t\t>= sizeof(ref)) {\n-\t\t\terror(\"tag name too long: %.*s...\", 50, *p);\n+\t\t\terror(_(\"tag name too long: %.*s...\"), 50, *p);\n \t\t\thad_error = 1;\n \t\t\tcontinue;\n \t\t}\n \t\tif (!resolve_ref(ref, sha1, 1, NULL)) {\n-\t\t\terror(\"tag '%s' not found.\", *p);\n+\t\t\terror(_(\"tag '%s' not found.\"), *p);\n \t\t\thad_error = 1;\n \t\t\tcontinue;\n \t\t}\n@@ -138,7 +138,7 @@ static int delete_tag(const char *name, const char *ref,\n {\n \tif (delete_ref(ref, sha1, 0))\n \t\treturn 1;\n-\tprintf(\"Deleted tag '%s' (was %s)\\n\", name, find_unique_abbrev(sha1, DEFAULT_ABBREV));\n+\tprintf(_(\"Deleted tag '%s' (was %s)\\n\"), name, find_unique_abbrev(sha1, DEFAULT_ABBREV));\n \treturn 0;\n }\n \n@@ -150,7 +150,7 @@ static int verify_tag(const char *name, const char *ref,\n \targv_verify_tag[2] = sha1_to_hex(sha1);\n \n \tif (run_command_v_opt(argv_verify_tag, RUN_GIT_CMD))\n-\t\treturn error(\"could not verify the tag '%s'\", name);\n+\t\treturn error(_(\"could not verify the tag '%s'\"), name);\n \treturn 0;\n }\n \n@@ -165,7 +165,7 @@ static int do_sign(struct strbuf *buffer)\n \tif (!*signingkey) {\n \t\tif (strlcpy(signingkey, git_committer_info(IDENT_ERROR_ON_NO_NAME),\n \t\t\t\tsizeof(signingkey)) > sizeof(signingkey) - 1)\n-\t\t\treturn error(\"committer info too long.\");\n+\t\t\treturn error(_(\"committer info too long.\"));\n \t\tbracket = strchr(signingkey, '>');\n \t\tif (bracket)\n \t\t\tbracket[1] = '\\0';\n@@ -185,20 +185,20 @@ static int do_sign(struct strbuf *buffer)\n \targs[3] = NULL;\n \n \tif (start_command(&gpg))\n-\t\treturn error(\"could not run gpg.\");\n+\t\treturn error(_(\"could not run gpg.\"));\n \n \tif (write_in_full(gpg.in, buffer->buf, buffer->len) != buffer->len) {\n \t\tclose(gpg.in);\n \t\tclose(gpg.out);\n \t\tfinish_command(&gpg);\n-\t\treturn error(\"gpg did not accept the tag data\");\n+\t\treturn error(_(\"gpg did not accept the tag data\"));\n \t}\n \tclose(gpg.in);\n \tlen = strbuf_read(buffer, gpg.out, 1024);\n \tclose(gpg.out);\n \n \tif (finish_command(&gpg) || !len || len < 0)\n-\t\treturn error(\"gpg failed to sign the tag\");\n+\t\treturn error(_(\"gpg failed to sign the tag\"));\n \n \t/* Strip CR from the line endings, in case we are on Windows. */\n \tfor (i = j = 0; i < buffer->len; i++)\n@@ -221,7 +221,7 @@ static const char tag_template[] =\n static void set_signingkey(const char *value)\n {\n \tif (strlcpy(signingkey, value, sizeof(signingkey)) >= sizeof(signingkey))\n-\t\tdie(\"signing key value too long (%.10s...)\", value);\n+\t\tdie(_(\"signing key value too long (%.10s...)\"), value);\n }\n \n static int git_tag_config(const char *var, const char *value, void *cb)\n@@ -261,9 +261,9 @@ static void write_tag_body(int fd, const unsigned char *sha1)\n static int build_tag_object(struct strbuf *buf, int sign, unsigned char *result)\n {\n \tif (sign && do_sign(buf) < 0)\n-\t\treturn error(\"unable to sign the tag\");\n+\t\treturn error(_(\"unable to sign the tag\"));\n \tif (write_sha1_file(buf->buf, buf->len, tag_type, result) < 0)\n-\t\treturn error(\"unable to write tag file\");\n+\t\treturn error(_(\"unable to write tag file\"));\n \treturn 0;\n }\n \n@@ -278,7 +278,7 @@ static void create_tag(const unsigned char *object, const char *tag,\n \n \ttype = sha1_object_info(object, NULL);\n \tif (type <= OBJ_NONE)\n-\t    die(\"bad object type.\");\n+\t    die(_(\"bad object type.\"));\n \n \theader_len = snprintf(header_buf, sizeof(header_buf),\n \t\t\t  \"object %s\\n\"\n@@ -291,7 +291,7 @@ static void create_tag(const unsigned char *object, const char *tag,\n \t\t\t  git_committer_info(IDENT_ERROR_ON_NO_NAME));\n \n \tif (header_len > sizeof(header_buf) - 1)\n-\t\tdie(\"tag header too big.\");\n+\t\tdie(_(\"tag header too big.\"));\n \n \tif (!message) {\n \t\tint fd;\n@@ -300,7 +300,7 @@ static void create_tag(const unsigned char *object, const char *tag,\n \t\tpath = git_pathdup(\"TAG_EDITMSG\");\n \t\tfd = open(path, O_CREAT | O_TRUNC | O_WRONLY, 0600);\n \t\tif (fd < 0)\n-\t\t\tdie_errno(\"could not create file '%s'\", path);\n+\t\t\tdie_errno(_(\"could not create file '%s'\"), path);\n \n \t\tif (!is_null_sha1(prev))\n \t\t\twrite_tag_body(fd, prev);\n@@ -310,7 +310,7 @@ static void create_tag(const unsigned char *object, const char *tag,\n \n \t\tif (launch_editor(path, buf, NULL)) {\n \t\t\tfprintf(stderr,\n-\t\t\t\"Please supply the message using either -m or -F option.\\n\");\n+\t\t\t_(\"Please supply the message using either -m or -F option.\\n\"));\n \t\t\texit(1);\n \t\t}\n \t}\n@@ -318,13 +318,13 @@ static void create_tag(const unsigned char *object, const char *tag,\n \tstripspace(buf, 1);\n \n \tif (!message && !buf->len)\n-\t\tdie(\"no tag message?\");\n+\t\tdie(_(\"no tag message?\"));\n \n \tstrbuf_insert(buf, 0, header_buf, header_len);\n \n \tif (build_tag_object(buf, sign, result) < 0) {\n \t\tif (path)\n-\t\t\tfprintf(stderr, \"The tag message has been left in %s\\n\",\n+\t\t\tfprintf(stderr, _(\"The tag message has been left in %s\\n\"),\n \t\t\t\tpath);\n \t\texit(128);\n \t}\n@@ -417,9 +417,9 @@ int cmd_tag(int argc, const char **argv, const char *prefix)\n \t\treturn list_tags(argv[0], lines == -1 ? 0 : lines,\n \t\t\t\t with_commit);\n \tif (lines != -1)\n-\t\tdie(\"-n option is only allowed with -l.\");\n+\t\tdie(_(\"-n option is only allowed with -l.\"));\n \tif (with_commit)\n-\t\tdie(\"--contains option is only allowed with -l.\");\n+\t\tdie(_(\"--contains option is only allowed with -l.\"));\n \tif (delete)\n \t\treturn for_each_tag_name(argv, delete_tag);\n \tif (verify)\n@@ -427,17 +427,17 @@ int cmd_tag(int argc, const char **argv, const char *prefix)\n \n \tif (msg.given || msgfile) {\n \t\tif (msg.given && msgfile)\n-\t\t\tdie(\"only one -F or -m option is allowed.\");\n+\t\t\tdie(_(\"only one -F or -m option is allowed.\"));\n \t\tannotate = 1;\n \t\tif (msg.given)\n \t\t\tstrbuf_addbuf(&buf, &(msg.buf));\n \t\telse {\n \t\t\tif (!strcmp(msgfile, \"-\")) {\n \t\t\t\tif (strbuf_read(&buf, 0, 1024) < 0)\n-\t\t\t\t\tdie_errno(\"cannot read '%s'\", msgfile);\n+\t\t\t\t\tdie_errno(_(\"cannot read '%s'\"), msgfile);\n \t\t\t} else {\n \t\t\t\tif (strbuf_read_file(&buf, msgfile, 1024) < 0)\n-\t\t\t\t\tdie_errno(\"could not open or read '%s'\",\n+\t\t\t\t\tdie_errno(_(\"could not open or read '%s'\"),\n \t\t\t\t\t\tmsgfile);\n \t\t\t}\n \t\t}\n@@ -447,20 +447,20 @@ int cmd_tag(int argc, const char **argv, const char *prefix)\n \n \tobject_ref = argc == 2 ? argv[1] : \"HEAD\";\n \tif (argc > 2)\n-\t\tdie(\"too many params\");\n+\t\tdie(_(\"too many params\"));\n \n \tif (get_sha1(object_ref, object))\n-\t\tdie(\"Failed to resolve '%s' as a valid ref.\", object_ref);\n+\t\tdie(_(\"Failed to resolve '%s' as a valid ref.\"), object_ref);\n \n \tif (snprintf(ref, sizeof(ref), \"refs/tags/%s\", tag) > sizeof(ref) - 1)\n-\t\tdie(\"tag name too long: %.*s...\", 50, tag);\n+\t\tdie(_(\"tag name too long: %.*s...\"), 50, tag);\n \tif (check_ref_format(ref))\n-\t\tdie(\"'%s' is not a valid tag name.\", tag);\n+\t\tdie(_(\"'%s' is not a valid tag name.\"), tag);\n \n \tif (!resolve_ref(ref, prev, 1, NULL))\n \t\thashclr(prev);\n \telse if (!force)\n-\t\tdie(\"tag '%s' already exists\", tag);\n+\t\tdie(_(\"tag '%s' already exists\"), tag);\n \n \tif (annotate)\n \t\tcreate_tag(object, tag, &buf, msg.given || msgfile,\n@@ -468,11 +468,11 @@ int cmd_tag(int argc, const char **argv, const char *prefix)\n \n \tlock = lock_any_ref_for_update(ref, prev, 0);\n \tif (!lock)\n-\t\tdie(\"%s: cannot lock the ref\", ref);\n+\t\tdie(_(\"%s: cannot lock the ref\"), ref);\n \tif (write_ref_sha1(lock, object, NULL) < 0)\n-\t\tdie(\"%s: cannot update the ref\", ref);\n+\t\tdie(_(\"%s: cannot update the ref\"), ref);\n \tif (force && hashcmp(prev, object))\n-\t\tprintf(\"Updated tag '%s' (was %s)\\n\", tag, find_unique_abbrev(prev, DEFAULT_ABBREV));\n+\t\tprintf(_(\"Updated tag '%s' (was %s)\\n\"), tag, find_unique_abbrev(prev, DEFAULT_ABBREV));\n \n \tstrbuf_release(&buf);\n \treturn 0;\n-- \n1.7.2.3\n"},{"id":"161672","messageId":"1298143495-3681-51-git-send-email-avarab@gmail.com","threadId":"26561","inReplyTo":"1298143495-3681-1-git-send-email-avarab@gmail.com","subject":"[PATCH 50/72] gettextize: git-tag tag_template message","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2011-02-19T19:24:33Z","receivedAt":"2011-02-19T19:24:33Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"Mark the tag_template message as translatable with N_() and then use\nit later with _(). We need to skip a test under GETTEXT_POISON that\nrelies on the output having a leading newline.\n\nSigned-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n builtin/tag.c  |    6 +++---\n t/t7004-tag.sh |    1 +\n 2 files changed, 4 insertions(+), 3 deletions(-)\n\ndiff --git a/builtin/tag.c b/builtin/tag.c\nindex 4bed7c2..4242e27 100644\n--- a/builtin/tag.c\n+++ b/builtin/tag.c\n@@ -213,10 +213,10 @@ static int do_sign(struct strbuf *buffer)\n }\n \n static const char tag_template[] =\n-\t\"\\n\"\n+\tN_(\"\\n\"\n \t\"#\\n\"\n \t\"# Write a tag message\\n\"\n-\t\"#\\n\";\n+\t\"#\\n\");\n \n static void set_signingkey(const char *value)\n {\n@@ -305,7 +305,7 @@ static void create_tag(const unsigned char *object, const char *tag,\n \t\tif (!is_null_sha1(prev))\n \t\t\twrite_tag_body(fd, prev);\n \t\telse\n-\t\t\twrite_or_die(fd, tag_template, strlen(tag_template));\n+\t\t\twrite_or_die(fd, _(tag_template), strlen(_(tag_template)));\n \t\tclose(fd);\n \n \t\tif (launch_editor(path, buf, NULL)) {\ndiff --git a/t/t7004-tag.sh b/t/t7004-tag.sh\nindex 3e7baaf..99d1fbc 100755\n--- a/t/t7004-tag.sh\n+++ b/t/t7004-tag.sh\n@@ -1121,6 +1121,7 @@ test_expect_success \\\n '\n \n test_expect_success \\\n+\tNO_GETTEXT_POISON \\\n \t'message in editor has initial comment: first line' '\n \t# check the first line --- should be empty\n \techo >first.expect &&\n-- \n1.7.2.3\n"},{"id":"161698","messageId":"1298143495-3681-52-git-send-email-avarab@gmail.com","threadId":"26561","inReplyTo":"1298143495-3681-1-git-send-email-avarab@gmail.com","subject":"[PATCH 51/72] gettextize: git-push basic messages","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2011-02-19T19:24:34Z","receivedAt":"2011-02-19T19:24:34Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n builtin/push.c |   38 +++++++++++++++++++-------------------\n 1 files changed, 19 insertions(+), 19 deletions(-)\n\ndiff --git a/builtin/push.c b/builtin/push.c\nindex e655eb7..513bc57 100644\n--- a/builtin/push.c\n+++ b/builtin/push.c\n@@ -40,7 +40,7 @@ static void set_refspecs(const char **refs, int nr)\n \t\t\tchar *tag;\n \t\t\tint len;\n \t\t\tif (nr <= ++i)\n-\t\t\t\tdie(\"tag shorthand without <tag>\");\n+\t\t\t\tdie(_(\"tag shorthand without <tag>\"));\n \t\t\tlen = strlen(refs[i]) + 11;\n \t\t\tif (deleterefs) {\n \t\t\t\ttag = xmalloc(len+1);\n@@ -59,7 +59,7 @@ static void set_refspecs(const char **refs, int nr)\n \t\t\tstrcat(delref, ref);\n \t\t\tref = delref;\n \t\t} else if (deleterefs)\n-\t\t\tdie(\"--delete only accepts plain target ref names\");\n+\t\t\tdie(_(\"--delete only accepts plain target ref names\"));\n \t\tadd_refspec(ref);\n \t}\n }\n@@ -69,13 +69,13 @@ static void setup_push_tracking(void)\n \tstruct strbuf refspec = STRBUF_INIT;\n \tstruct branch *branch = branch_get(NULL);\n \tif (!branch)\n-\t\tdie(\"You are not currently on a branch.\");\n+\t\tdie(_(\"You are not currently on a branch.\"));\n \tif (!branch->merge_nr || !branch->merge)\n-\t\tdie(\"The current branch %s is not tracking anything.\",\n+\t\tdie(_(\"The current branch %s is not tracking anything.\"),\n \t\t    branch->name);\n \tif (branch->merge_nr != 1)\n-\t\tdie(\"The current branch %s is tracking multiple branches, \"\n-\t\t    \"refusing to push.\", branch->name);\n+\t\tdie(_(\"The current branch %s is tracking multiple branches, \"\n+\t\t    \"refusing to push.\"), branch->name);\n \tstrbuf_addf(&refspec, \"%s:%s\", branch->name, branch->merge[0]->src);\n \tadd_refspec(refspec.buf);\n }\n@@ -97,8 +97,8 @@ static void setup_default_push_refspecs(void)\n \t\tbreak;\n \n \tcase PUSH_DEFAULT_NOTHING:\n-\t\tdie(\"You didn't specify any refspecs to push, and \"\n-\t\t    \"push.default is \\\"nothing\\\".\");\n+\t\tdie(_(\"You didn't specify any refspecs to push, and \"\n+\t\t    \"push.default is \\\"nothing\\\".\"));\n \t\tbreak;\n \t}\n }\n@@ -117,11 +117,11 @@ static int push_with_options(struct transport *transport, int flags)\n \t\ttransport_set_option(transport, TRANS_OPT_THIN, \"yes\");\n \n \tif (verbosity > 0)\n-\t\tfprintf(stderr, \"Pushing to %s\\n\", transport->url);\n+\t\tfprintf(stderr, _(\"Pushing to %s\\n\"), transport->url);\n \terr = transport_push(transport, refspec_nr, refspec, flags,\n \t\t\t     &nonfastforward);\n \tif (err != 0)\n-\t\terror(\"failed to push some refs to '%s'\", transport->url);\n+\t\terror(_(\"failed to push some refs to '%s'\"), transport->url);\n \n \terr |= transport_disconnect(transport);\n \n@@ -146,8 +146,8 @@ static int do_push(const char *repo, int flags)\n \n \tif (!remote) {\n \t\tif (repo)\n-\t\t\tdie(\"bad repository '%s'\", repo);\n-\t\tdie(\"No destination configured to push to.\");\n+\t\t\tdie(_(\"bad repository '%s'\"), repo);\n+\t\tdie(_(\"No destination configured to push to.\"));\n \t}\n \n \tif (remote->mirror)\n@@ -155,19 +155,19 @@ static int do_push(const char *repo, int flags)\n \n \tif ((flags & TRANSPORT_PUSH_ALL) && refspec) {\n \t\tif (!strcmp(*refspec, \"refs/tags/*\"))\n-\t\t\treturn error(\"--all and --tags are incompatible\");\n-\t\treturn error(\"--all can't be combined with refspecs\");\n+\t\t\treturn error(_(\"--all and --tags are incompatible\"));\n+\t\treturn error(_(\"--all can't be combined with refspecs\"));\n \t}\n \n \tif ((flags & TRANSPORT_PUSH_MIRROR) && refspec) {\n \t\tif (!strcmp(*refspec, \"refs/tags/*\"))\n-\t\t\treturn error(\"--mirror and --tags are incompatible\");\n-\t\treturn error(\"--mirror can't be combined with refspecs\");\n+\t\t\treturn error(_(\"--mirror and --tags are incompatible\"));\n+\t\treturn error(_(\"--mirror can't be combined with refspecs\"));\n \t}\n \n \tif ((flags & (TRANSPORT_PUSH_ALL|TRANSPORT_PUSH_MIRROR)) ==\n \t\t\t\t(TRANSPORT_PUSH_ALL|TRANSPORT_PUSH_MIRROR)) {\n-\t\treturn error(\"--all and --mirror are incompatible\");\n+\t\treturn error(_(\"--all and --mirror are incompatible\"));\n \t}\n \n \tif (!refspec && !(flags & TRANSPORT_PUSH_ALL)) {\n@@ -232,9 +232,9 @@ int cmd_push(int argc, const char **argv, const char *prefix)\n \targc = parse_options(argc, argv, prefix, options, push_usage, 0);\n \n \tif (deleterefs && (tags || (flags & (TRANSPORT_PUSH_ALL | TRANSPORT_PUSH_MIRROR))))\n-\t\tdie(\"--delete is incompatible with --all, --mirror and --tags\");\n+\t\tdie(_(\"--delete is incompatible with --all, --mirror and --tags\"));\n \tif (deleterefs && argc < 2)\n-\t\tdie(\"--delete doesn't make sense without any refs\");\n+\t\tdie(_(\"--delete doesn't make sense without any refs\"));\n \n \tif (tags)\n \t\tadd_refspec(\"refs/tags/*\");\n-- \n1.7.2.3\n"},{"id":"161673","messageId":"1298143495-3681-53-git-send-email-avarab@gmail.com","threadId":"26561","inReplyTo":"1298143495-3681-1-git-send-email-avarab@gmail.com","subject":"[PATCH 52/72] gettextize: git-push \"prevent you from losing\" message","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2011-02-19T19:24:35Z","receivedAt":"2011-02-19T19:24:35Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"Gettextize the \"To prevent you from losing history\" message. A test in\nlib-httpd.sh and another in t5541-http-push.sh explicitly checked for\nthis message. Change them to skip under GETTEXT_POISON=YesPlease.\n\nSigned-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n builtin/push.c       |    4 ++--\n t/lib-httpd.sh       |    2 +-\n t/t5541-http-push.sh |    7 +++++--\n 3 files changed, 8 insertions(+), 5 deletions(-)\n\ndiff --git a/builtin/push.c b/builtin/push.c\nindex 513bc57..8c8d8c7 100644\n--- a/builtin/push.c\n+++ b/builtin/push.c\n@@ -129,9 +129,9 @@ static int push_with_options(struct transport *transport, int flags)\n \t\treturn 0;\n \n \tif (nonfastforward && advice_push_nonfastforward) {\n-\t\tfprintf(stderr, \"To prevent you from losing history, non-fast-forward updates were rejected\\n\"\n+\t\tfprintf(stderr, _(\"To prevent you from losing history, non-fast-forward updates were rejected\\n\"\n \t\t\t\t\"Merge the remote changes (e.g. 'git pull') before pushing again.  See the\\n\"\n-\t\t\t\t\"'Note about fast-forwards' section of 'git push --help' for details.\\n\");\n+\t\t\t\t\"'Note about fast-forwards' section of 'git push --help' for details.\\n\"));\n \t}\n \n \treturn 1;\ndiff --git a/t/lib-httpd.sh b/t/lib-httpd.sh\nindex 3f24384..0f0b35a 100644\n--- a/t/lib-httpd.sh\n+++ b/t/lib-httpd.sh\n@@ -157,7 +157,7 @@ test_http_push_nonff() {\n \t\tgrep \"^ ! \\[rejected\\][ ]*$BRANCH -> $BRANCH (non-fast-forward)$\" output\n \t'\n \n-\ttest_expect_success 'non-fast-forward push shows help message' '\n+\ttest_expect_success NO_GETTEXT_POISON 'non-fast-forward push shows help message' '\n \t\tgrep \"To prevent you from losing history, non-fast-forward updates were rejected\" \\\n \t\t\toutput\n \t'\ndiff --git a/t/t5541-http-push.sh b/t/t5541-http-push.sh\nindex b0c2a2c..b341d8b 100755\n--- a/t/t5541-http-push.sh\n+++ b/t/t5541-http-push.sh\n@@ -128,11 +128,14 @@ test_expect_success 'push fails for non-fast-forward refs unmatched by remote he\n \n \t# push master too; this ensures there is at least one '\"'push'\"' command to\n \t# the remote helper and triggers interaction with the helper.\n-\ttest_must_fail git push -v origin +master master:retsam >output 2>&1 &&\n+\ttest_must_fail git push -v origin +master master:retsam >output 2>&1'\n \n+test_expect_success 'push fails for non-fast-forward refs unmatched by remote helper: remote output' '\n \tgrep \"^ + [a-f0-9]*\\.\\.\\.[a-f0-9]* *master -> master (forced update)$\" output &&\n-\tgrep \"^ ! \\[rejected\\] *master -> retsam (non-fast-forward)$\" output &&\n+\tgrep \"^ ! \\[rejected\\] *master -> retsam (non-fast-forward)$\" output\n+'\n \n+test_expect_success NO_GETTEXT_POISON 'push fails for non-fast-forward refs unmatched by remote helper: our output' '\n \tgrep \"To prevent you from losing history, non-fast-forward updates were rejected\" \\\n \t\toutput\n '\n-- \n1.7.2.3\n"},{"id":"161693","messageId":"1298143495-3681-54-git-send-email-avarab@gmail.com","threadId":"26561","inReplyTo":"1298143495-3681-1-git-send-email-avarab@gmail.com","subject":"[PATCH 53/72] gettextize: git-status basic messages","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2011-02-19T19:24:36Z","receivedAt":"2011-02-19T19:24:36Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"Gettextize the most common git-status messages. Many tests checked for\nthese explicitly. Change them to skip under GETTEXT_POISON=YesPlease.\n\nSome of the tests in t7508-status.sh needed to be split up when I\nadded NO_GETTEXT_POISON to them, since parts of them affected later\ntests (some of which aren't being skipped) indirectly.\n\nSigned-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n t/t7060-wtstatus.sh         |    2 +-\n t/t7506-status-submodule.sh |   20 ++++----\n t/t7508-status.sh           |  115 ++++++++++++++++++++++++-------------------\n wt-status.c                 |   86 ++++++++++++++++----------------\n 4 files changed, 119 insertions(+), 104 deletions(-)\n\ndiff --git a/t/t7060-wtstatus.sh b/t/t7060-wtstatus.sh\nindex fcac472..7205154 100755\n--- a/t/t7060-wtstatus.sh\n+++ b/t/t7060-wtstatus.sh\n@@ -38,7 +38,7 @@ cat >expect <<EOF\n no changes added to commit (use \"git add\" and/or \"git commit -a\")\n EOF\n \n-test_expect_success 'M/D conflict does not segfault' '\n+test_expect_success NO_GETTEXT_POISON 'M/D conflict does not segfault' '\n \tmkdir mdconflict &&\n \t(\n \t\tcd mdconflict &&\ndiff --git a/t/t7506-status-submodule.sh b/t/t7506-status-submodule.sh\nindex 3d4f85d..74e0f6f 100755\n--- a/t/t7506-status-submodule.sh\n+++ b/t/t7506-status-submodule.sh\n@@ -30,7 +30,7 @@ test_expect_success 'commit --dry-run -a clean' '\n \tgrep \"nothing to commit\" output\n '\n \n-test_expect_success 'status with modified file in submodule' '\n+test_expect_success NO_GETTEXT_POISON 'status with modified file in submodule' '\n \t(cd sub && git reset --hard) &&\n \techo \"changed\" >sub/foo &&\n \tgit status >output &&\n@@ -46,7 +46,7 @@ test_expect_success 'status with modified file in submodule (porcelain)' '\n \tEOF\n '\n \n-test_expect_success 'status with added file in submodule' '\n+test_expect_success NO_GETTEXT_POISON 'status with added file in submodule' '\n \t(cd sub && git reset --hard && echo >foo && git add foo) &&\n \tgit status >output &&\n \tgrep \"modified:   sub (modified content)\" output\n@@ -60,14 +60,14 @@ test_expect_success 'status with added file in submodule (porcelain)' '\n \tEOF\n '\n \n-test_expect_success 'status with untracked file in submodule' '\n+test_expect_success NO_GETTEXT_POISON 'status with untracked file in submodule' '\n \t(cd sub && git reset --hard) &&\n \techo \"content\" >sub/new-file &&\n \tgit status >output &&\n \tgrep \"modified:   sub (untracked content)\" output\n '\n \n-test_expect_success 'status -uno with untracked file in submodule' '\n+test_expect_success NO_GETTEXT_POISON 'status -uno with untracked file in submodule' '\n \tgit status -uno >output &&\n \tgrep \"^nothing to commit\" output\n '\n@@ -79,7 +79,7 @@ test_expect_success 'status with untracked file in submodule (porcelain)' '\n \tEOF\n '\n \n-test_expect_success 'status with added and untracked file in submodule' '\n+test_expect_success NO_GETTEXT_POISON 'status with added and untracked file in submodule' '\n \t(cd sub && git reset --hard && echo >foo && git add foo) &&\n \techo \"content\" >sub/new-file &&\n \tgit status >output &&\n@@ -95,7 +95,7 @@ test_expect_success 'status with added and untracked file in submodule (porcelai\n \tEOF\n '\n \n-test_expect_success 'status with modified file in modified submodule' '\n+test_expect_success NO_GETTEXT_POISON 'status with modified file in modified submodule' '\n \t(cd sub && git reset --hard) &&\n \trm sub/new-file &&\n \t(cd sub && echo \"next change\" >foo && git commit -m \"next change\" foo) &&\n@@ -113,7 +113,7 @@ test_expect_success 'status with modified file in modified submodule (porcelain)\n \tEOF\n '\n \n-test_expect_success 'status with added file in modified submodule' '\n+test_expect_success NO_GETTEXT_POISON 'status with added file in modified submodule' '\n \t(cd sub && git reset --hard && echo >foo && git add foo) &&\n \tgit status >output &&\n \tgrep \"modified:   sub (new commits, modified content)\" output\n@@ -127,7 +127,7 @@ test_expect_success 'status with added file in modified submodule (porcelain)' '\n \tEOF\n '\n \n-test_expect_success 'status with untracked file in modified submodule' '\n+test_expect_success NO_GETTEXT_POISON 'status with untracked file in modified submodule' '\n \t(cd sub && git reset --hard) &&\n \techo \"content\" >sub/new-file &&\n \tgit status >output &&\n@@ -141,7 +141,7 @@ test_expect_success 'status with untracked file in modified submodule (porcelain\n \tEOF\n '\n \n-test_expect_success 'status with added and untracked file in modified submodule' '\n+test_expect_success NO_GETTEXT_POISON 'status with added and untracked file in modified submodule' '\n \t(cd sub && git reset --hard && echo >foo && git add foo) &&\n \techo \"content\" >sub/new-file &&\n \tgit status >output &&\n@@ -167,7 +167,7 @@ test_expect_success 'setup .git file for sub' '\n \t git commit -m \"added .real to .gitignore\" .gitignore\n '\n \n-test_expect_success 'status with added file in modified submodule with .git file' '\n+test_expect_success NO_GETTEXT_POISON 'status with added file in modified submodule with .git file' '\n \t(cd sub && git reset --hard && echo >foo && git add foo) &&\n \tgit status >output &&\n \tgrep \"modified:   sub (new commits, modified content)\" output\ndiff --git a/t/t7508-status.sh b/t/t7508-status.sh\nindex f1dc5c3..d79737f 100755\n--- a/t/t7508-status.sh\n+++ b/t/t7508-status.sh\n@@ -55,7 +55,7 @@ test_expect_success 'setup' '\n \tgit add dir2/added\n '\n \n-test_expect_success 'status (1)' '\n+test_expect_success NO_GETTEXT_POISON 'status (1)' '\n \n \tgrep \"use \\\"git rm --cached <file>\\.\\.\\.\\\" to unstage\" output\n \n@@ -85,7 +85,7 @@ cat >expect <<\\EOF\n #\tuntracked\n EOF\n \n-test_expect_success 'status (2)' '\n+test_expect_success NO_GETTEXT_POISON 'status (2)' '\n \n \tgit status >output &&\n \ttest_cmp expect output\n@@ -111,7 +111,7 @@ EOF\n \n git config advice.statusHints false\n \n-test_expect_success 'status (advice.statusHints false)' '\n+test_expect_success NO_GETTEXT_POISON 'status (advice.statusHints false)' '\n \n \tgit status >output &&\n \ttest_cmp expect output\n@@ -157,6 +157,12 @@ test_expect_success 'status -s -b' '\n \n '\n \n+test_expect_success 'setup dir3' '\n+\tmkdir dir3 &&\n+\t: >dir3/untracked1 &&\n+\t: >dir3/untracked2\n+'\n+\n cat >expect <<EOF\n # On branch master\n # Changes to be committed:\n@@ -172,16 +178,14 @@ cat >expect <<EOF\n #\n # Untracked files not listed (use -u option to show untracked files)\n EOF\n-test_expect_success 'status -uno' '\n-\tmkdir dir3 &&\n-\t: >dir3/untracked1 &&\n-\t: >dir3/untracked2 &&\n+test_expect_success NO_GETTEXT_POISON 'status -uno' '\n \tgit status -uno >output &&\n \ttest_cmp expect output\n '\n \n-test_expect_success 'status (status.showUntrackedFiles no)' '\n+test_expect_success NO_GETTEXT_POISON 'status (status.showUntrackedFiles no)' '\n \tgit config status.showuntrackedfiles no\n+\ttest_when_finished \"git config --unset status.showuntrackedfiles\" &&\n \tgit status >output &&\n \ttest_cmp expect output\n '\n@@ -197,7 +201,7 @@ cat >expect <<EOF\n # Untracked files not listed\n EOF\n git config advice.statusHints false\n-test_expect_success 'status -uno (advice.statusHints false)' '\n+test_expect_success NO_GETTEXT_POISON 'status -uno (advice.statusHints false)' '\n \tgit status -uno >output &&\n \ttest_cmp expect output\n '\n@@ -208,7 +212,6 @@ cat >expect << EOF\n A  dir2/added\n EOF\n test_expect_success 'status -s -uno' '\n-\tgit config --unset status.showuntrackedfiles\n \tgit status -s -uno >output &&\n \ttest_cmp expect output\n '\n@@ -243,13 +246,14 @@ cat >expect <<EOF\n #\toutput\n #\tuntracked\n EOF\n-test_expect_success 'status -unormal' '\n+test_expect_success NO_GETTEXT_POISON 'status -unormal' '\n \tgit status -unormal >output &&\n \ttest_cmp expect output\n '\n \n-test_expect_success 'status (status.showUntrackedFiles normal)' '\n+test_expect_success NO_GETTEXT_POISON 'status (status.showUntrackedFiles normal)' '\n \tgit config status.showuntrackedfiles normal\n+\ttest_when_finished \"git config --unset status.showuntrackedfiles\" &&\n \tgit status >output &&\n \ttest_cmp expect output\n '\n@@ -266,7 +270,6 @@ A  dir2/added\n ?? untracked\n EOF\n test_expect_success 'status -s -unormal' '\n-\tgit config --unset status.showuntrackedfiles\n \tgit status -s -unormal >output &&\n \ttest_cmp expect output\n '\n@@ -302,18 +305,21 @@ cat >expect <<EOF\n #\toutput\n #\tuntracked\n EOF\n-test_expect_success 'status -uall' '\n+test_expect_success NO_GETTEXT_POISON 'status -uall' '\n \tgit status -uall >output &&\n \ttest_cmp expect output\n '\n-test_expect_success 'status (status.showUntrackedFiles all)' '\n+test_expect_success NO_GETTEXT_POISON 'status (status.showUntrackedFiles all)' '\n \tgit config status.showuntrackedfiles all\n+\ttest_when_finished \"git config --unset status.showuntrackedfiles\" &&\n \tgit status >output &&\n-\trm -rf dir3 &&\n-\tgit config --unset status.showuntrackedfiles &&\n \ttest_cmp expect output\n '\n \n+test_expect_success 'teardown dir3' '\n+\trm -rf dir3\n+'\n+\n cat >expect <<EOF\n  M dir1/modified\n A  dir2/added\n@@ -361,7 +367,7 @@ cat >expect <<\\EOF\n #\t../untracked\n EOF\n \n-test_expect_success 'status with relative paths' '\n+test_expect_success NO_GETTEXT_POISON 'status with relative paths' '\n \n \t(cd dir1 && git status) >output &&\n \ttest_cmp expect output\n@@ -434,18 +440,19 @@ cat >expect <<\\EOF\n #\t<BLUE>untracked<RESET>\n EOF\n \n-test_expect_success 'status with color.ui' '\n+test_expect_success NO_GETTEXT_POISON 'status with color.ui' '\n \n \tgit config color.ui always &&\n+\ttest_when_finished \"git config --unset color.ui\" &&\n \tgit status | test_decode_color >output &&\n \ttest_cmp expect output\n \n '\n \n-test_expect_success 'status with color.status' '\n+test_expect_success NO_GETTEXT_POISON 'status with color.status' '\n \n-\tgit config --unset color.ui &&\n \tgit config color.status always &&\n+\ttest_when_finished \"git config --unset color.status\" &&\n \tgit status | test_decode_color >output &&\n \ttest_cmp expect output\n \n@@ -464,7 +471,6 @@ EOF\n \n test_expect_success 'status -s with color.ui' '\n \n-\tgit config --unset color.status &&\n \tgit config color.ui always &&\n \tgit status -s | test_decode_color >output &&\n \ttest_cmp expect output\n@@ -564,9 +570,10 @@ cat >expect <<\\EOF\n EOF\n \n \n-test_expect_success 'status without relative paths' '\n+test_expect_success NO_GETTEXT_POISON 'status without relative paths' '\n \n-\tgit config status.relativePaths false\n+\tgit config status.relativePaths false &&\n+\ttest_when_finished \"git config --unset status.relativePaths\" &&\n \t(cd dir1 && git status) >output &&\n \ttest_cmp expect output\n \n@@ -585,6 +592,8 @@ EOF\n \n test_expect_success 'status -s without relative paths' '\n \n+\tgit config status.relativePaths false &&\n+\ttest_when_finished \"git config --unset status.relativePaths\" &&\n \t(cd dir1 && git status -s) >output &&\n \ttest_cmp expect output\n \n@@ -607,7 +616,10 @@ cat <<EOF >expect\n #\tuntracked\n EOF\n test_expect_success 'dry-run of partial commit excluding new file in index' '\n-\tgit commit --dry-run dir1/modified >output &&\n+\tgit commit --dry-run dir1/modified >output\n+'\n+\n+test_expect_success NO_GETTEXT_POISON 'dry-run of partial commit excluding new file in index: output' '\n \ttest_cmp expect output\n '\n \n@@ -655,13 +667,13 @@ cat >expect <<EOF\n #\toutput\n #\tuntracked\n EOF\n-test_expect_success 'status submodule summary is disabled by default' '\n+test_expect_success NO_GETTEXT_POISON 'status submodule summary is disabled by default' '\n \tgit status >output &&\n \ttest_cmp expect output\n '\n \n # we expect the same as the previous test\n-test_expect_success 'status --untracked-files=all does not show submodule' '\n+test_expect_success NO_GETTEXT_POISON 'status --untracked-files=all does not show submodule' '\n \tgit status --untracked-files=all >output &&\n \ttest_cmp expect output\n '\n@@ -719,7 +731,7 @@ cat >expect <<EOF\n #\toutput\n #\tuntracked\n EOF\n-test_expect_success 'status submodule summary' '\n+test_expect_success NO_GETTEXT_POISON 'status submodule summary' '\n \tgit config status.submodulesummary 10 &&\n \tgit status >output &&\n \ttest_cmp expect output\n@@ -760,8 +772,11 @@ cat >expect <<EOF\n #\tuntracked\n no changes added to commit (use \"git add\" and/or \"git commit -a\")\n EOF\n-test_expect_success 'status submodule summary (clean submodule)' '\n-\tgit commit -m \"commit submodule\" &&\n+test_expect_success 'status submodule summary (clean submodule): commit' '\n+\tgit commit -m \"commit submodule\"\n+'\n+\n+test_expect_success NO_GETTEXT_POISON 'status submodule summary (clean submodule): output' '\n \tgit config status.submodulesummary 10 &&\n \ttest_must_fail git commit --dry-run >output &&\n \ttest_cmp expect output &&\n@@ -812,7 +827,7 @@ cat >expect <<EOF\n #\toutput\n #\tuntracked\n EOF\n-test_expect_success 'commit --dry-run submodule summary (--amend)' '\n+test_expect_success NO_GETTEXT_POISON 'commit --dry-run submodule summary (--amend)' '\n \tgit config status.submodulesummary 10 &&\n \tgit commit --dry-run --amend >output &&\n \ttest_cmp expect output\n@@ -867,13 +882,13 @@ cat > expect << EOF\n #\tuntracked\n EOF\n \n-test_expect_success '--ignore-submodules=untracked suppresses submodules with untracked content' '\n+test_expect_success NO_GETTEXT_POISON '--ignore-submodules=untracked suppresses submodules with untracked content' '\n \techo modified > sm/untracked &&\n \tgit status --ignore-submodules=untracked > output &&\n \ttest_cmp expect output\n '\n \n-test_expect_success '.gitmodules ignore=untracked suppresses submodules with untracked content' '\n+test_expect_success NO_GETTEXT_POISON '.gitmodules ignore=untracked suppresses submodules with untracked content' '\n \tgit config diff.ignoreSubmodules dirty &&\n \tgit status >output &&\n \ttest_cmp expect output &&\n@@ -885,7 +900,7 @@ test_expect_success '.gitmodules ignore=untracked suppresses submodules with unt\n \tgit config --unset diff.ignoreSubmodules\n '\n \n-test_expect_success '.git/config ignore=untracked suppresses submodules with untracked content' '\n+test_expect_success NO_GETTEXT_POISON '.git/config ignore=untracked suppresses submodules with untracked content' '\n \tgit config --add -f .gitmodules submodule.subname.ignore none &&\n \tgit config --add -f .gitmodules submodule.subname.path sm &&\n \tgit config --add submodule.subname.ignore untracked &&\n@@ -896,12 +911,12 @@ test_expect_success '.git/config ignore=untracked suppresses submodules with unt\n \tgit config --remove-section -f .gitmodules submodule.subname\n '\n \n-test_expect_success '--ignore-submodules=dirty suppresses submodules with untracked content' '\n+test_expect_success NO_GETTEXT_POISON '--ignore-submodules=dirty suppresses submodules with untracked content' '\n \tgit status --ignore-submodules=dirty > output &&\n \ttest_cmp expect output\n '\n \n-test_expect_success '.gitmodules ignore=dirty suppresses submodules with untracked content' '\n+test_expect_success NO_GETTEXT_POISON '.gitmodules ignore=dirty suppresses submodules with untracked content' '\n \tgit config diff.ignoreSubmodules dirty &&\n \tgit status >output &&\n \t! test -s actual &&\n@@ -913,7 +928,7 @@ test_expect_success '.gitmodules ignore=dirty suppresses submodules with untrack\n \tgit config --unset diff.ignoreSubmodules\n '\n \n-test_expect_success '.git/config ignore=dirty suppresses submodules with untracked content' '\n+test_expect_success NO_GETTEXT_POISON '.git/config ignore=dirty suppresses submodules with untracked content' '\n \tgit config --add -f .gitmodules submodule.subname.ignore none &&\n \tgit config --add -f .gitmodules submodule.subname.path sm &&\n \tgit config --add submodule.subname.ignore dirty &&\n@@ -924,13 +939,13 @@ test_expect_success '.git/config ignore=dirty suppresses submodules with untrack\n \tgit config -f .gitmodules  --remove-section submodule.subname\n '\n \n-test_expect_success '--ignore-submodules=dirty suppresses submodules with modified content' '\n+test_expect_success NO_GETTEXT_POISON '--ignore-submodules=dirty suppresses submodules with modified content' '\n \techo modified > sm/foo &&\n \tgit status --ignore-submodules=dirty > output &&\n \ttest_cmp expect output\n '\n \n-test_expect_success '.gitmodules ignore=dirty suppresses submodules with modified content' '\n+test_expect_success NO_GETTEXT_POISON '.gitmodules ignore=dirty suppresses submodules with modified content' '\n \tgit config --add -f .gitmodules submodule.subname.ignore dirty &&\n \tgit config --add -f .gitmodules submodule.subname.path sm &&\n \tgit status > output &&\n@@ -938,7 +953,7 @@ test_expect_success '.gitmodules ignore=dirty suppresses submodules with modifie\n \tgit config -f .gitmodules  --remove-section submodule.subname\n '\n \n-test_expect_success '.git/config ignore=dirty suppresses submodules with modified content' '\n+test_expect_success NO_GETTEXT_POISON '.git/config ignore=dirty suppresses submodules with modified content' '\n \tgit config --add -f .gitmodules submodule.subname.ignore none &&\n \tgit config --add -f .gitmodules submodule.subname.path sm &&\n \tgit config --add submodule.subname.ignore dirty &&\n@@ -981,12 +996,12 @@ cat > expect << EOF\n #\tuntracked\n EOF\n \n-test_expect_success \"--ignore-submodules=untracked doesn't suppress submodules with modified content\" '\n+test_expect_success NO_GETTEXT_POISON \"--ignore-submodules=untracked doesn't suppress submodules with modified content\" '\n \tgit status --ignore-submodules=untracked > output &&\n \ttest_cmp expect output\n '\n \n-test_expect_success \".gitmodules ignore=untracked doesn't suppress submodules with modified content\" '\n+test_expect_success NO_GETTEXT_POISON \".gitmodules ignore=untracked doesn't suppress submodules with modified content\" '\n \tgit config --add -f .gitmodules submodule.subname.ignore untracked &&\n \tgit config --add -f .gitmodules submodule.subname.path sm &&\n \tgit status > output &&\n@@ -994,7 +1009,7 @@ test_expect_success \".gitmodules ignore=untracked doesn't suppress submodules wi\n \tgit config -f .gitmodules  --remove-section submodule.subname\n '\n \n-test_expect_success \".git/config ignore=untracked doesn't suppress submodules with modified content\" '\n+test_expect_success NO_GETTEXT_POISON \".git/config ignore=untracked doesn't suppress submodules with modified content\" '\n \tgit config --add -f .gitmodules submodule.subname.ignore none &&\n \tgit config --add -f .gitmodules submodule.subname.path sm &&\n \tgit config --add submodule.subname.ignore untracked &&\n@@ -1043,12 +1058,12 @@ cat > expect << EOF\n #\tuntracked\n EOF\n \n-test_expect_success \"--ignore-submodules=untracked doesn't suppress submodule summary\" '\n+test_expect_success NO_GETTEXT_POISON \"--ignore-submodules=untracked doesn't suppress submodule summary\" '\n \tgit status --ignore-submodules=untracked > output &&\n \ttest_cmp expect output\n '\n \n-test_expect_success \".gitmodules ignore=untracked doesn't suppress submodule summary\" '\n+test_expect_success NO_GETTEXT_POISON \".gitmodules ignore=untracked doesn't suppress submodule summary\" '\n \tgit config --add -f .gitmodules submodule.subname.ignore untracked &&\n \tgit config --add -f .gitmodules submodule.subname.path sm &&\n \tgit status > output &&\n@@ -1056,7 +1071,7 @@ test_expect_success \".gitmodules ignore=untracked doesn't suppress submodule sum\n \tgit config -f .gitmodules  --remove-section submodule.subname\n '\n \n-test_expect_success \".git/config ignore=untracked doesn't suppress submodule summary\" '\n+test_expect_success NO_GETTEXT_POISON \".git/config ignore=untracked doesn't suppress submodule summary\" '\n \tgit config --add -f .gitmodules submodule.subname.ignore none &&\n \tgit config --add -f .gitmodules submodule.subname.path sm &&\n \tgit config --add submodule.subname.ignore untracked &&\n@@ -1067,11 +1082,11 @@ test_expect_success \".git/config ignore=untracked doesn't suppress submodule sum\n \tgit config -f .gitmodules  --remove-section submodule.subname\n '\n \n-test_expect_success \"--ignore-submodules=dirty doesn't suppress submodule summary\" '\n+test_expect_success NO_GETTEXT_POISON \"--ignore-submodules=dirty doesn't suppress submodule summary\" '\n \tgit status --ignore-submodules=dirty > output &&\n \ttest_cmp expect output\n '\n-test_expect_success \".gitmodules ignore=dirty doesn't suppress submodule summary\" '\n+test_expect_success NO_GETTEXT_POISON \".gitmodules ignore=dirty doesn't suppress submodule summary\" '\n \tgit config --add -f .gitmodules submodule.subname.ignore dirty &&\n \tgit config --add -f .gitmodules submodule.subname.path sm &&\n \tgit status > output &&\n@@ -1079,7 +1094,7 @@ test_expect_success \".gitmodules ignore=dirty doesn't suppress submodule summary\n \tgit config -f .gitmodules  --remove-section submodule.subname\n '\n \n-test_expect_success \".git/config ignore=dirty doesn't suppress submodule summary\" '\n+test_expect_success NO_GETTEXT_POISON \".git/config ignore=dirty doesn't suppress submodule summary\" '\n \tgit config --add -f .gitmodules submodule.subname.ignore none &&\n \tgit config --add -f .gitmodules submodule.subname.path sm &&\n \tgit config --add submodule.subname.ignore dirty &&\n@@ -1111,7 +1126,7 @@ cat > expect << EOF\n no changes added to commit (use \"git add\" and/or \"git commit -a\")\n EOF\n \n-test_expect_success \"--ignore-submodules=all suppresses submodule summary\" '\n+test_expect_success NO_GETTEXT_POISON \"--ignore-submodules=all suppresses submodule summary\" '\n \tgit status --ignore-submodules=all > output &&\n \ttest_cmp expect output\n '\ndiff --git a/wt-status.c b/wt-status.c\nindex 123582b..f369eba 100644\n--- a/wt-status.c\n+++ b/wt-status.c\n@@ -57,16 +57,16 @@ static void wt_status_print_unmerged_header(struct wt_status *s)\n {\n \tconst char *c = color(WT_STATUS_HEADER, s);\n \n-\tcolor_fprintf_ln(s->fp, c, \"# Unmerged paths:\");\n+\tcolor_fprintf_ln(s->fp, c, _(\"# Unmerged paths:\"));\n \tif (!advice_status_hints)\n \t\treturn;\n \tif (s->in_merge)\n \t\t;\n \telse if (!s->is_initial)\n-\t\tcolor_fprintf_ln(s->fp, c, \"#   (use \\\"git reset %s <file>...\\\" to unstage)\", s->reference);\n+\t\tcolor_fprintf_ln(s->fp, c, _(\"#   (use \\\"git reset %s <file>...\\\" to unstage)\"), s->reference);\n \telse\n-\t\tcolor_fprintf_ln(s->fp, c, \"#   (use \\\"git rm --cached <file>...\\\" to unstage)\");\n-\tcolor_fprintf_ln(s->fp, c, \"#   (use \\\"git add/rm <file>...\\\" as appropriate to mark resolution)\");\n+\t\tcolor_fprintf_ln(s->fp, c, _(\"#   (use \\\"git rm --cached <file>...\\\" to unstage)\"));\n+\tcolor_fprintf_ln(s->fp, c, _(\"#   (use \\\"git add/rm <file>...\\\" as appropriate to mark resolution)\"));\n \tcolor_fprintf_ln(s->fp, c, \"#\");\n }\n \n@@ -80,9 +80,9 @@ static void wt_status_print_cached_header(struct wt_status *s)\n \tif (s->in_merge)\n \t\t; /* NEEDSWORK: use \"git reset --unresolve\"??? */\n \telse if (!s->is_initial)\n-\t\tcolor_fprintf_ln(s->fp, c, \"#   (use \\\"git reset %s <file>...\\\" to unstage)\", s->reference);\n+\t\tcolor_fprintf_ln(s->fp, c, _(\"#   (use \\\"git reset %s <file>...\\\" to unstage)\"), s->reference);\n \telse\n-\t\tcolor_fprintf_ln(s->fp, c, \"#   (use \\\"git rm --cached <file>...\\\" to unstage)\");\n+\t\tcolor_fprintf_ln(s->fp, c, _(\"#   (use \\\"git rm --cached <file>...\\\" to unstage)\"));\n \tcolor_fprintf_ln(s->fp, c, \"#\");\n }\n \n@@ -92,16 +92,16 @@ static void wt_status_print_dirty_header(struct wt_status *s,\n {\n \tconst char *c = color(WT_STATUS_HEADER, s);\n \n-\tcolor_fprintf_ln(s->fp, c, \"# Changes not staged for commit:\");\n+\tcolor_fprintf_ln(s->fp, c, _(\"# Changes not staged for commit:\"));\n \tif (!advice_status_hints)\n \t\treturn;\n \tif (!has_deleted)\n-\t\tcolor_fprintf_ln(s->fp, c, \"#   (use \\\"git add <file>...\\\" to update what will be committed)\");\n+\t\tcolor_fprintf_ln(s->fp, c, _(\"#   (use \\\"git add <file>...\\\" to update what will be committed)\"));\n \telse\n-\t\tcolor_fprintf_ln(s->fp, c, \"#   (use \\\"git add/rm <file>...\\\" to update what will be committed)\");\n-\tcolor_fprintf_ln(s->fp, c, \"#   (use \\\"git checkout -- <file>...\\\" to discard changes in working directory)\");\n+\t\tcolor_fprintf_ln(s->fp, c, _(\"#   (use \\\"git add/rm <file>...\\\" to update what will be committed)\"));\n+\tcolor_fprintf_ln(s->fp, c, _(\"#   (use \\\"git checkout -- <file>...\\\" to discard changes in working directory)\"));\n \tif (has_dirty_submodules)\n-\t\tcolor_fprintf_ln(s->fp, c, \"#   (commit or discard the untracked or modified content in submodules)\");\n+\t\tcolor_fprintf_ln(s->fp, c, _(\"#   (commit or discard the untracked or modified content in submodules)\"));\n \tcolor_fprintf_ln(s->fp, c, \"#\");\n }\n \n@@ -110,10 +110,10 @@ static void wt_status_print_other_header(struct wt_status *s,\n \t\t\t\t\t const char *how)\n {\n \tconst char *c = color(WT_STATUS_HEADER, s);\n-\tcolor_fprintf_ln(s->fp, c, \"# %s files:\", what);\n+\tcolor_fprintf_ln(s->fp, c, _(\"# %s files:\"), what);\n \tif (!advice_status_hints)\n \t\treturn;\n-\tcolor_fprintf_ln(s->fp, c, \"#   (use \\\"git %s <file>...\\\" to include in what will be committed)\", how);\n+\tcolor_fprintf_ln(s->fp, c, _(\"#   (use \\\"git %s <file>...\\\" to include in what will be committed)\"), how);\n \tcolor_fprintf_ln(s->fp, c, \"#\");\n }\n \n@@ -130,18 +130,18 @@ static void wt_status_print_unmerged_data(struct wt_status *s,\n \tconst char *c = color(WT_STATUS_UNMERGED, s);\n \tstruct wt_status_change_data *d = it->util;\n \tstruct strbuf onebuf = STRBUF_INIT;\n-\tconst char *one, *how = \"bug\";\n+\tconst char *one, *how = _(\"bug\");\n \n \tone = quote_path(it->string, -1, &onebuf, s->prefix);\n \tcolor_fprintf(s->fp, color(WT_STATUS_HEADER, s), \"#\\t\");\n \tswitch (d->stagemask) {\n-\tcase 1: how = \"both deleted:\"; break;\n-\tcase 2: how = \"added by us:\"; break;\n-\tcase 3: how = \"deleted by them:\"; break;\n-\tcase 4: how = \"added by them:\"; break;\n-\tcase 5: how = \"deleted by us:\"; break;\n-\tcase 6: how = \"both added:\"; break;\n-\tcase 7: how = \"both modified:\"; break;\n+\tcase 1: how = _(\"both deleted:\"); break;\n+\tcase 2: how = _(\"added by us:\"); break;\n+\tcase 3: how = _(\"deleted by them:\"); break;\n+\tcase 4: how = _(\"added by them:\"); break;\n+\tcase 5: how = _(\"deleted by us:\"); break;\n+\tcase 6: how = _(\"both added:\"); break;\n+\tcase 7: how = _(\"both modified:\"); break;\n \t}\n \tcolor_fprintf(s->fp, c, \"%-20s%s\\n\", how, one);\n \tstrbuf_release(&onebuf);\n@@ -171,11 +171,11 @@ static void wt_status_print_change_data(struct wt_status *s,\n \t\tif (d->new_submodule_commits || d->dirty_submodule) {\n \t\t\tstrbuf_addstr(&extra, \" (\");\n \t\t\tif (d->new_submodule_commits)\n-\t\t\t\tstrbuf_addf(&extra, \"new commits, \");\n+\t\t\t\tstrbuf_addf(&extra, _(\"new commits, \"));\n \t\t\tif (d->dirty_submodule & DIRTY_SUBMODULE_MODIFIED)\n-\t\t\t\tstrbuf_addf(&extra, \"modified content, \");\n+\t\t\t\tstrbuf_addf(&extra, _(\"modified content, \"));\n \t\t\tif (d->dirty_submodule & DIRTY_SUBMODULE_UNTRACKED)\n-\t\t\t\tstrbuf_addf(&extra, \"untracked content, \");\n+\t\t\t\tstrbuf_addf(&extra, _(\"untracked content, \"));\n \t\t\tstrbuf_setlen(&extra, extra.len - 2);\n \t\t\tstrbuf_addch(&extra, ')');\n \t\t}\n@@ -189,31 +189,31 @@ static void wt_status_print_change_data(struct wt_status *s,\n \tcolor_fprintf(s->fp, color(WT_STATUS_HEADER, s), \"#\\t\");\n \tswitch (status) {\n \tcase DIFF_STATUS_ADDED:\n-\t\tcolor_fprintf(s->fp, c, \"new file:   %s\", one);\n+\t\tcolor_fprintf(s->fp, c, _(\"new file:   %s\"), one);\n \t\tbreak;\n \tcase DIFF_STATUS_COPIED:\n-\t\tcolor_fprintf(s->fp, c, \"copied:     %s -> %s\", one, two);\n+\t\tcolor_fprintf(s->fp, c, _(\"copied:     %s -> %s\"), one, two);\n \t\tbreak;\n \tcase DIFF_STATUS_DELETED:\n-\t\tcolor_fprintf(s->fp, c, \"deleted:    %s\", one);\n+\t\tcolor_fprintf(s->fp, c, _(\"deleted:    %s\"), one);\n \t\tbreak;\n \tcase DIFF_STATUS_MODIFIED:\n-\t\tcolor_fprintf(s->fp, c, \"modified:   %s\", one);\n+\t\tcolor_fprintf(s->fp, c, _(\"modified:   %s\"), one);\n \t\tbreak;\n \tcase DIFF_STATUS_RENAMED:\n \t\tcolor_fprintf(s->fp, c, \"renamed:    %s -> %s\", one, two);\n \t\tbreak;\n \tcase DIFF_STATUS_TYPE_CHANGED:\n-\t\tcolor_fprintf(s->fp, c, \"typechange: %s\", one);\n+\t\tcolor_fprintf(s->fp, c, _(\"typechange: %s\"), one);\n \t\tbreak;\n \tcase DIFF_STATUS_UNKNOWN:\n-\t\tcolor_fprintf(s->fp, c, \"unknown:    %s\", one);\n+\t\tcolor_fprintf(s->fp, c, _(\"unknown:    %s\"), one);\n \t\tbreak;\n \tcase DIFF_STATUS_UNMERGED:\n-\t\tcolor_fprintf(s->fp, c, \"unmerged:   %s\", one);\n+\t\tcolor_fprintf(s->fp, c, _(\"unmerged:   %s\"), one);\n \t\tbreak;\n \tdefault:\n-\t\tdie(\"bug: unhandled diff status %c\", status);\n+\t\tdie(_(\"bug: unhandled diff status %c\"), status);\n \t}\n \tif (extra.len) {\n \t\tcolor_fprintf(s->fp, color(WT_STATUS_HEADER, s), \"%s\", extra.buf);\n@@ -633,14 +633,14 @@ void wt_status_print(struct wt_status *s)\n \tconst char *branch_status_color = color(WT_STATUS_HEADER, s);\n \n \tif (s->branch) {\n-\t\tconst char *on_what = \"On branch \";\n+\t\tconst char *on_what = _(\"On branch \");\n \t\tconst char *branch_name = s->branch;\n \t\tif (!prefixcmp(branch_name, \"refs/heads/\"))\n \t\t\tbranch_name += 11;\n \t\telse if (!strcmp(branch_name, \"HEAD\")) {\n \t\t\tbranch_name = \"\";\n \t\t\tbranch_status_color = color(WT_STATUS_NOBRANCH, s);\n-\t\t\ton_what = \"Not currently on any branch.\";\n+\t\t\ton_what = _(\"Not currently on any branch.\");\n \t\t}\n \t\tcolor_fprintf(s->fp, color(WT_STATUS_HEADER, s), \"# \");\n \t\tcolor_fprintf(s->fp, branch_status_color, \"%s\", on_what);\n@@ -665,29 +665,29 @@ void wt_status_print(struct wt_status *s)\n \t\twt_status_print_submodule_summary(s, 1);  /* unstaged */\n \t}\n \tif (s->show_untracked_files) {\n-\t\twt_status_print_other(s, &s->untracked, \"Untracked\", \"add\");\n+\t\twt_status_print_other(s, &s->untracked, _(\"Untracked\"), \"add\");\n \t\tif (s->show_ignored_files)\n-\t\t\twt_status_print_other(s, &s->ignored, \"Ignored\", \"add -f\");\n+\t\t\twt_status_print_other(s, &s->ignored, _(\"Ignored\"), \"add -f\");\n \t} else if (s->commitable)\n-\t\tfprintf(s->fp, \"# Untracked files not listed%s\\n\",\n+\t\tfprintf(s->fp, _(\"# Untracked files not listed%s\\n\"),\n \t\t\tadvice_status_hints\n-\t\t\t? \" (use -u option to show untracked files)\" : \"\");\n+\t\t\t? _(\" (use -u option to show untracked files)\") : \"\");\n \n \tif (s->verbose)\n \t\twt_status_print_verbose(s);\n \tif (!s->commitable) {\n \t\tif (s->amend)\n-\t\t\tfprintf(s->fp, \"# No changes\\n\");\n+\t\t\tfprintf(s->fp, _(\"# No changes\\n\"));\n \t\telse if (s->nowarn)\n \t\t\t; /* nothing */\n \t\telse if (s->workdir_dirty)\n-\t\t\tprintf(\"no changes added to commit%s\\n\",\n+\t\t\tprintf(_(\"no changes added to commit%s\\n\"),\n \t\t\t\tadvice_status_hints\n-\t\t\t\t? \" (use \\\"git add\\\" and/or \\\"git commit -a\\\")\" : \"\");\n+\t\t\t\t? _(\" (use \\\"git add\\\" and/or \\\"git commit -a\\\")\") : \"\");\n \t\telse if (s->untracked.nr)\n-\t\t\tprintf(\"nothing added to commit but untracked files present%s\\n\",\n+\t\t\tprintf(_(\"nothing added to commit but untracked files present%s\\n\"),\n \t\t\t\tadvice_status_hints\n-\t\t\t\t? \" (use \\\"git add\\\" to track)\" : \"\");\n+\t\t\t\t? _(\" (use \\\"git add\\\" to track)\") : \"\");\n \t\telse if (s->is_initial)\n \t\t\tprintf(\"nothing to commit%s\\n\", advice_status_hints\n \t\t\t\t? \" (create/copy files and use \\\"git add\\\" to track)\" : \"\");\n-- \n1.7.2.3\n"},{"id":"161697","messageId":"1298143495-3681-55-git-send-email-avarab@gmail.com","threadId":"26561","inReplyTo":"1298143495-3681-1-git-send-email-avarab@gmail.com","subject":"[PATCH 54/72] gettextize: git-status \"nothing to commit\" messages","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2011-02-19T19:24:37Z","receivedAt":"2011-02-19T19:24:37Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"Gettextize the \"nothing to commit\" messages. Many tests explicitly\nchecked for this message. Change them to skip under\nGETTEXT_POISON=YesPlease.\n\nSigned-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n t/t7506-status-submodule.sh |    8 ++++----\n wt-status.c                 |   12 ++++++------\n 2 files changed, 10 insertions(+), 10 deletions(-)\n\ndiff --git a/t/t7506-status-submodule.sh b/t/t7506-status-submodule.sh\nindex 74e0f6f..2347451 100755\n--- a/t/t7506-status-submodule.sh\n+++ b/t/t7506-status-submodule.sh\n@@ -20,12 +20,12 @@ test_expect_success 'setup' '\n \tgit commit -m \"Add submodule sub\"\n '\n \n-test_expect_success 'status clean' '\n+test_expect_success NO_GETTEXT_POISON 'status clean' '\n \tgit status >output &&\n \tgrep \"nothing to commit\" output\n '\n \n-test_expect_success 'commit --dry-run -a clean' '\n+test_expect_success NO_GETTEXT_POISON 'commit --dry-run -a clean' '\n \ttest_must_fail git commit --dry-run -a >output &&\n \tgrep \"nothing to commit\" output\n '\n@@ -177,12 +177,12 @@ test_expect_success 'rm submodule contents' '\n \trm -rf sub/* sub/.git\n '\n \n-test_expect_success 'status clean (empty submodule dir)' '\n+test_expect_success NO_GETTEXT_POISON 'status clean (empty submodule dir)' '\n \tgit status >output &&\n \tgrep \"nothing to commit\" output\n '\n \n-test_expect_success 'status -a clean (empty submodule dir)' '\n+test_expect_success NO_GETTEXT_POISON 'status -a clean (empty submodule dir)' '\n \ttest_must_fail git commit --dry-run -a >output &&\n \tgrep \"nothing to commit\" output\n '\ndiff --git a/wt-status.c b/wt-status.c\nindex f369eba..a975d07 100644\n--- a/wt-status.c\n+++ b/wt-status.c\n@@ -689,14 +689,14 @@ void wt_status_print(struct wt_status *s)\n \t\t\t\tadvice_status_hints\n \t\t\t\t? _(\" (use \\\"git add\\\" to track)\") : \"\");\n \t\telse if (s->is_initial)\n-\t\t\tprintf(\"nothing to commit%s\\n\", advice_status_hints\n-\t\t\t\t? \" (create/copy files and use \\\"git add\\\" to track)\" : \"\");\n+\t\t\tprintf(_(\"nothing to commit%s\\n\"), advice_status_hints\n+\t\t\t\t? _(\" (create/copy files and use \\\"git add\\\" to track)\") : \"\");\n \t\telse if (!s->show_untracked_files)\n-\t\t\tprintf(\"nothing to commit%s\\n\", advice_status_hints\n-\t\t\t\t? \" (use -u to show untracked files)\" : \"\");\n+\t\t\tprintf(_(\"nothing to commit%s\\n\"), advice_status_hints\n+\t\t\t\t? _(\" (use -u to show untracked files)\") : \"\");\n \t\telse\n-\t\t\tprintf(\"nothing to commit%s\\n\", advice_status_hints\n-\t\t\t\t? \" (working directory clean)\" : \"\");\n+\t\t\tprintf(_(\"nothing to commit%s\\n\"), advice_status_hints\n+\t\t\t\t? _(\" (working directory clean)\") : \"\");\n \t}\n }\n \n-- \n1.7.2.3\n"},{"id":"161696","messageId":"1298143495-3681-56-git-send-email-avarab@gmail.com","threadId":"26561","inReplyTo":"1298143495-3681-1-git-send-email-avarab@gmail.com","subject":"[PATCH 55/72] gettextize: git-status shortstatus messages","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2011-02-19T19:24:38Z","receivedAt":"2011-02-19T19:24:38Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"Make the messages added in v1.7.2-rc0~54^2~1 translatable. Some of\nthese could use the to be implemented plural support in the gettext\nlibrary.\n\nSigned-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n wt-status.c |   12 ++++++------\n 1 files changed, 6 insertions(+), 6 deletions(-)\n\ndiff --git a/wt-status.c b/wt-status.c\nindex a975d07..fc38ac2 100644\n--- a/wt-status.c\n+++ b/wt-status.c\n@@ -804,13 +804,13 @@ static void wt_shortstatus_print_tracking(struct wt_status *s)\n \tif (!prefixcmp(branch_name, \"refs/heads/\"))\n \t\tbranch_name += 11;\n \telse if (!strcmp(branch_name, \"HEAD\")) {\n-\t\tbranch_name = \"HEAD (no branch)\";\n+\t\tbranch_name = _(\"HEAD (no branch)\");\n \t\tbranch_color_local = color(WT_STATUS_NOBRANCH, s);\n \t}\n \n \tbranch = branch_get(s->branch + 11);\n \tif (s->is_initial)\n-\t\tcolor_fprintf(s->fp, header_color, \"Initial commit on \");\n+\t\tcolor_fprintf(s->fp, header_color, _(\"Initial commit on \"));\n \tif (!stat_tracking_info(branch, &num_ours, &num_theirs)) {\n \t\tcolor_fprintf_ln(s->fp, branch_color_local,\n \t\t\t\"%s\", branch_name);\n@@ -825,15 +825,15 @@ static void wt_shortstatus_print_tracking(struct wt_status *s)\n \n \tcolor_fprintf(s->fp, header_color, \" [\");\n \tif (!num_ours) {\n-\t\tcolor_fprintf(s->fp, header_color, \"behind \");\n+\t\tcolor_fprintf(s->fp, header_color, _(\"behind \"));\n \t\tcolor_fprintf(s->fp, branch_color_remote, \"%d\", num_theirs);\n \t} else if (!num_theirs) {\n-\t\tcolor_fprintf(s->fp, header_color, \"ahead \");\n+\t\tcolor_fprintf(s->fp, header_color, _(\"ahead \"));\n \t\tcolor_fprintf(s->fp, branch_color_local, \"%d\", num_ours);\n \t} else {\n-\t\tcolor_fprintf(s->fp, header_color, \"ahead \");\n+\t\tcolor_fprintf(s->fp, header_color, _(\"ahead \"));\n \t\tcolor_fprintf(s->fp, branch_color_local, \"%d\", num_ours);\n-\t\tcolor_fprintf(s->fp, header_color, \", behind \");\n+\t\tcolor_fprintf(s->fp, header_color, _(\", behind \"));\n \t\tcolor_fprintf(s->fp, branch_color_remote, \"%d\", num_theirs);\n \t}\n \n-- \n1.7.2.3\n"},{"id":"161695","messageId":"1298143495-3681-57-git-send-email-avarab@gmail.com","threadId":"26561","inReplyTo":"1298143495-3681-1-git-send-email-avarab@gmail.com","subject":"[PATCH 56/72] gettextize: git-status \"Changes to be committed\" message","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2011-02-19T19:24:39Z","receivedAt":"2011-02-19T19:24:39Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"Gettextize the \"# Changes to be committed:\" messages. Several tests\nexplicitly checked for this message. Change them to skip under\nGETTEXT_POISON=YesPlease.\n\nSince these tests didn't check for the rest of the git-status(1)\noutput this change has been split up from the \"git-status basic\nmessages\" patch.\n\nSigned-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n t/t7502-commit.sh |   20 ++++++++++----------\n wt-status.c       |    2 +-\n 2 files changed, 11 insertions(+), 11 deletions(-)\n\ndiff --git a/t/t7502-commit.sh b/t/t7502-commit.sh\nindex 6586355..d7c4280 100755\n--- a/t/t7502-commit.sh\n+++ b/t/t7502-commit.sh\n@@ -384,66 +384,66 @@ try_commit () {\n \n try_commit_status_combo () {\n \n-\ttest_expect_success 'commit' '\n+\ttest_expect_success NO_GETTEXT_POISON 'commit' '\n \t\tclear_config commit.status &&\n \t\ttry_commit \"\" &&\n \t\tgrep \"^# Changes to be committed:\" .git/COMMIT_EDITMSG\n \t'\n \n-\ttest_expect_success 'commit' '\n+\ttest_expect_success NO_GETTEXT_POISON 'commit' '\n \t\tclear_config commit.status &&\n \t\ttry_commit \"\" &&\n \t\tgrep \"^# Changes to be committed:\" .git/COMMIT_EDITMSG\n \t'\n \n-\ttest_expect_success 'commit --status' '\n+\ttest_expect_success NO_GETTEXT_POISON 'commit --status' '\n \t\tclear_config commit.status &&\n \t\ttry_commit --status &&\n \t\tgrep \"^# Changes to be committed:\" .git/COMMIT_EDITMSG\n \t'\n \n-\ttest_expect_success 'commit --no-status' '\n+\ttest_expect_success NO_GETTEXT_POISON 'commit --no-status' '\n \t\tclear_config commit.status &&\n \t\ttry_commit --no-status &&\n \t\t! grep \"^# Changes to be committed:\" .git/COMMIT_EDITMSG\n \t'\n \n-\ttest_expect_success 'commit with commit.status = yes' '\n+\ttest_expect_success NO_GETTEXT_POISON 'commit with commit.status = yes' '\n \t\tclear_config commit.status &&\n \t\tgit config commit.status yes &&\n \t\ttry_commit \"\" &&\n \t\tgrep \"^# Changes to be committed:\" .git/COMMIT_EDITMSG\n \t'\n \n-\ttest_expect_success 'commit with commit.status = no' '\n+\ttest_expect_success NO_GETTEXT_POISON 'commit with commit.status = no' '\n \t\tclear_config commit.status &&\n \t\tgit config commit.status no &&\n \t\ttry_commit \"\" &&\n \t\t! grep \"^# Changes to be committed:\" .git/COMMIT_EDITMSG\n \t'\n \n-\ttest_expect_success 'commit --status with commit.status = yes' '\n+\ttest_expect_success NO_GETTEXT_POISON 'commit --status with commit.status = yes' '\n \t\tclear_config commit.status &&\n \t\tgit config commit.status yes &&\n \t\ttry_commit --status &&\n \t\tgrep \"^# Changes to be committed:\" .git/COMMIT_EDITMSG\n \t'\n \n-\ttest_expect_success 'commit --no-status with commit.status = yes' '\n+\ttest_expect_success NO_GETTEXT_POISON 'commit --no-status with commit.status = yes' '\n \t\tclear_config commit.status &&\n \t\tgit config commit.status yes &&\n \t\ttry_commit --no-status &&\n \t\t! grep \"^# Changes to be committed:\" .git/COMMIT_EDITMSG\n \t'\n \n-\ttest_expect_success 'commit --status with commit.status = no' '\n+\ttest_expect_success NO_GETTEXT_POISON 'commit --status with commit.status = no' '\n \t\tclear_config commit.status &&\n \t\tgit config commit.status no &&\n \t\ttry_commit --status &&\n \t\tgrep \"^# Changes to be committed:\" .git/COMMIT_EDITMSG\n \t'\n \n-\ttest_expect_success 'commit --no-status with commit.status = no' '\n+\ttest_expect_success NO_GETTEXT_POISON 'commit --no-status with commit.status = no' '\n \t\tclear_config commit.status &&\n \t\tgit config commit.status no &&\n \t\ttry_commit --no-status &&\ndiff --git a/wt-status.c b/wt-status.c\nindex fc38ac2..c6295f9 100644\n--- a/wt-status.c\n+++ b/wt-status.c\n@@ -74,7 +74,7 @@ static void wt_status_print_cached_header(struct wt_status *s)\n {\n \tconst char *c = color(WT_STATUS_HEADER, s);\n \n-\tcolor_fprintf_ln(s->fp, c, \"# Changes to be committed:\");\n+\tcolor_fprintf_ln(s->fp, c, _(\"# Changes to be committed:\"));\n \tif (!advice_status_hints)\n \t\treturn;\n \tif (s->in_merge)\n-- \n1.7.2.3\n"},{"id":"161690","messageId":"1298143495-3681-58-git-send-email-avarab@gmail.com","threadId":"26561","inReplyTo":"1298143495-3681-1-git-send-email-avarab@gmail.com","subject":"[PATCH 57/72] gettextize: git-status \"Initial commit\" message","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2011-02-19T19:24:40Z","receivedAt":"2011-02-19T19:24:40Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"Gettextize the \"# Initial commit\" message. A test in t7501-commit.sh\nexplicitly checked for this message. Change it to skip under\nGETTEXT_POISON=YesPlease.\n\nSigned-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n t/t7501-commit.sh |    7 +++++--\n wt-status.c       |    2 +-\n 2 files changed, 6 insertions(+), 3 deletions(-)\n\ndiff --git a/t/t7501-commit.sh b/t/t7501-commit.sh\nindex 8980738..9f6e852 100755\n--- a/t/t7501-commit.sh\n+++ b/t/t7501-commit.sh\n@@ -14,8 +14,11 @@ test_tick\n test_expect_success \\\n \t\"initial status\" \\\n \t\"echo 'bongo bongo' >file &&\n-\t git add file && \\\n-\t git status | grep 'Initial commit'\"\n+\t git add file\"\n+\n+test_expect_success NO_GETTEXT_POISON \\\n+\t\"Constructing initial commit\" \\\n+\t\"git status | grep 'Initial commit'\"\n \n test_expect_success \\\n \t\"fail initial amend\" \\\ndiff --git a/wt-status.c b/wt-status.c\nindex c6295f9..ad6ef7a 100644\n--- a/wt-status.c\n+++ b/wt-status.c\n@@ -651,7 +651,7 @@ void wt_status_print(struct wt_status *s)\n \n \tif (s->is_initial) {\n \t\tcolor_fprintf_ln(s->fp, color(WT_STATUS_HEADER, s), \"#\");\n-\t\tcolor_fprintf_ln(s->fp, color(WT_STATUS_HEADER, s), \"# Initial commit\");\n+\t\tcolor_fprintf_ln(s->fp, color(WT_STATUS_HEADER, s), _(\"# Initial commit\"));\n \t\tcolor_fprintf_ln(s->fp, color(WT_STATUS_HEADER, s), \"#\");\n \t}\n \n-- \n1.7.2.3\n"},{"id":"161687","messageId":"1298143495-3681-59-git-send-email-avarab@gmail.com","threadId":"26561","inReplyTo":"1298143495-3681-1-git-send-email-avarab@gmail.com","subject":"[PATCH 58/72] gettextize: git-status \"renamed: \" message","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2011-02-19T19:24:41Z","receivedAt":"2011-02-19T19:24:41Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"Gettextize the \"renamed: %s -> %s\" message which appears as part of\ngit-status(1) output. Two tests in t4001-diff-rename.sh explicitly\nchecked for this message. Change them to skip under\nGETTEXT_POISON=YesPlease.\n\nSigned-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n t/t4001-diff-rename.sh |    4 ++--\n wt-status.c            |    2 +-\n 2 files changed, 3 insertions(+), 3 deletions(-)\n\ndiff --git a/t/t4001-diff-rename.sh b/t/t4001-diff-rename.sh\nindex 71bac83..d42c077 100755\n--- a/t/t4001-diff-rename.sh\n+++ b/t/t4001-diff-rename.sh\n@@ -64,7 +64,7 @@ test_expect_success \\\n     'validate the output.' \\\n     'compare_diff_patch current expected'\n \n-test_expect_success 'favour same basenames over different ones' '\n+test_expect_success NO_GETTEXT_POISON 'favour same basenames over different ones' '\n \tcp path1 another-path &&\n \tgit add another-path &&\n \tgit commit -m 1 &&\n@@ -73,7 +73,7 @@ test_expect_success 'favour same basenames over different ones' '\n \tgit mv another-path subdir/path1 &&\n \tgit status | grep \"renamed: .*path1 -> subdir/path1\"'\n \n-test_expect_success  'favour same basenames even with minor differences' '\n+test_expect_success NO_GETTEXT_POISON  'favour same basenames even with minor differences' '\n \tgit show HEAD:path1 | sed \"s/15/16/\" > subdir/path1 &&\n \tgit status | grep \"renamed: .*path1 -> subdir/path1\"'\n \ndiff --git a/wt-status.c b/wt-status.c\nindex ad6ef7a..ed6bedd 100644\n--- a/wt-status.c\n+++ b/wt-status.c\n@@ -201,7 +201,7 @@ static void wt_status_print_change_data(struct wt_status *s,\n \t\tcolor_fprintf(s->fp, c, _(\"modified:   %s\"), one);\n \t\tbreak;\n \tcase DIFF_STATUS_RENAMED:\n-\t\tcolor_fprintf(s->fp, c, \"renamed:    %s -> %s\", one, two);\n+\t\tcolor_fprintf(s->fp, c, _(\"renamed:    %s -> %s\"), one, two);\n \t\tbreak;\n \tcase DIFF_STATUS_TYPE_CHANGED:\n \t\tcolor_fprintf(s->fp, c, _(\"typechange: %s\"), one);\n-- \n1.7.2.3\n"},{"id":"161694","messageId":"1298143495-3681-60-git-send-email-avarab@gmail.com","threadId":"26561","inReplyTo":"1298143495-3681-1-git-send-email-avarab@gmail.com","subject":"[PATCH 59/72] gettextize: git-archive basic messages","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2011-02-19T19:24:42Z","receivedAt":"2011-02-19T19:24:42Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n builtin/archive.c |   14 +++++++-------\n 1 files changed, 7 insertions(+), 7 deletions(-)\n\ndiff --git a/builtin/archive.c b/builtin/archive.c\nindex 6a887f5..b14eaba 100644\n--- a/builtin/archive.c\n+++ b/builtin/archive.c\n@@ -14,10 +14,10 @@ static void create_output_file(const char *output_file)\n {\n \tint output_fd = open(output_file, O_CREAT | O_WRONLY | O_TRUNC, 0666);\n \tif (output_fd < 0)\n-\t\tdie_errno(\"could not create archive file '%s'\", output_file);\n+\t\tdie_errno(_(\"could not create archive file '%s'\"), output_file);\n \tif (output_fd != 1) {\n \t\tif (dup2(output_fd, 1) < 0)\n-\t\t\tdie_errno(\"could not redirect output\");\n+\t\t\tdie_errno(_(\"could not redirect output\"));\n \t\telse\n \t\t\tclose(output_fd);\n \t}\n@@ -33,7 +33,7 @@ static int run_remote_archiver(int argc, const char **argv,\n \n \t_remote = remote_get(remote);\n \tif (!_remote->url[0])\n-\t\tdie(\"git archive: Remote with no URL\");\n+\t\tdie(_(\"git archive: Remote with no URL\"));\n \ttransport = transport_get(_remote, _remote->url[0]);\n \ttransport_connect(transport, \"git-upload-archive\", exec, fd);\n \n@@ -43,18 +43,18 @@ static int run_remote_archiver(int argc, const char **argv,\n \n \tlen = packet_read_line(fd[0], buf, sizeof(buf));\n \tif (!len)\n-\t\tdie(\"git archive: expected ACK/NAK, got EOF\");\n+\t\tdie(_(\"git archive: expected ACK/NAK, got EOF\"));\n \tif (buf[len-1] == '\\n')\n \t\tbuf[--len] = 0;\n \tif (strcmp(buf, \"ACK\")) {\n \t\tif (len > 5 && !prefixcmp(buf, \"NACK \"))\n-\t\t\tdie(\"git archive: NACK %s\", buf + 5);\n-\t\tdie(\"git archive: protocol error\");\n+\t\t\tdie(_(\"git archive: NACK %s\"), buf + 5);\n+\t\tdie(_(\"git archive: protocol error\"));\n \t}\n \n \tlen = packet_read_line(fd[0], buf, sizeof(buf));\n \tif (len)\n-\t\tdie(\"git archive: expected a flush\");\n+\t\tdie(_(\"git archive: expected a flush\"));\n \n \t/* Now, start reading from fd[0] and spit it out to stdout */\n \trv = recv_sideband(\"archive\", fd[0], 1);\n-- \n1.7.2.3\n"},{"id":"161688","messageId":"1298143495-3681-61-git-send-email-avarab@gmail.com","threadId":"26561","inReplyTo":"1298143495-3681-1-git-send-email-avarab@gmail.com","subject":"[PATCH 60/72] gettextize: git-bundle basic messages","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2011-02-19T19:24:43Z","receivedAt":"2011-02-19T19:24:43Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n builtin/bundle.c |    6 +++---\n 1 files changed, 3 insertions(+), 3 deletions(-)\n\ndiff --git a/builtin/bundle.c b/builtin/bundle.c\nindex 9b87fb9..81046a9 100644\n--- a/builtin/bundle.c\n+++ b/builtin/bundle.c\n@@ -44,7 +44,7 @@ int cmd_bundle(int argc, const char **argv, const char *prefix)\n \t\tclose(bundle_fd);\n \t\tif (verify_bundle(&header, 1))\n \t\t\treturn 1;\n-\t\tfprintf(stderr, \"%s is okay\\n\", bundle_file);\n+\t\tfprintf(stderr, _(\"%s is okay\\n\"), bundle_file);\n \t\treturn 0;\n \t}\n \tif (!strcmp(cmd, \"list-heads\")) {\n@@ -53,11 +53,11 @@ int cmd_bundle(int argc, const char **argv, const char *prefix)\n \t}\n \tif (!strcmp(cmd, \"create\")) {\n \t\tif (!startup_info->have_repository)\n-\t\t\tdie(\"Need a repository to create a bundle.\");\n+\t\t\tdie(_(\"Need a repository to create a bundle.\"));\n \t\treturn !!create_bundle(&header, bundle_file, argc, argv);\n \t} else if (!strcmp(cmd, \"unbundle\")) {\n \t\tif (!startup_info->have_repository)\n-\t\t\tdie(\"Need a repository to unbundle.\");\n+\t\t\tdie(_(\"Need a repository to unbundle.\"));\n \t\treturn !!unbundle(&header, bundle_fd) ||\n \t\t\tlist_bundle_refs(&header, argc, argv);\n \t} else\n-- \n1.7.2.3\n"},{"id":"161689","messageId":"1298143495-3681-62-git-send-email-avarab@gmail.com","threadId":"26561","inReplyTo":"1298143495-3681-1-git-send-email-avarab@gmail.com","subject":"[PATCH 61/72] gettextize: git-clean basic messages","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2011-02-19T19:24:44Z","receivedAt":"2011-02-19T19:24:44Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n builtin/clean.c                  |   20 ++++++++++----------\n t/t7012-skip-worktree-writing.sh |    4 ++--\n t/t7300-clean.sh                 |    6 +++---\n 3 files changed, 15 insertions(+), 15 deletions(-)\n\ndiff --git a/builtin/clean.c b/builtin/clean.c\nindex 4a312ab..2d0054b 100644\n--- a/builtin/clean.c\n+++ b/builtin/clean.c\n@@ -75,7 +75,7 @@ int cmd_clean(int argc, const char **argv, const char *prefix)\n \t\tdir.flags |= DIR_SHOW_IGNORED;\n \n \tif (ignored && ignored_only)\n-\t\tdie(\"-x and -X cannot be used together\");\n+\t\tdie(_(\"-x and -X cannot be used together\"));\n \n \tif (!show_only && !force)\n \t\tdie(\"clean.requireForce %s to true and neither -n nor -f given; \"\n@@ -87,7 +87,7 @@ int cmd_clean(int argc, const char **argv, const char *prefix)\n \tdir.flags |= DIR_SHOW_OTHER_DIRECTORIES;\n \n \tif (read_cache() < 0)\n-\t\tdie(\"index file corrupt\");\n+\t\tdie(_(\"index file corrupt\"));\n \n \tif (!ignored)\n \t\tsetup_standard_excludes(&dir);\n@@ -146,20 +146,20 @@ int cmd_clean(int argc, const char **argv, const char *prefix)\n \t\t\tqname = quote_path_relative(directory.buf, directory.len, &buf, prefix);\n \t\t\tif (show_only && (remove_directories ||\n \t\t\t    (matches == MATCHED_EXACTLY))) {\n-\t\t\t\tprintf(\"Would remove %s\\n\", qname);\n+\t\t\t\tprintf(_(\"Would remove %s\\n\"), qname);\n \t\t\t} else if (remove_directories ||\n \t\t\t\t   (matches == MATCHED_EXACTLY)) {\n \t\t\t\tif (!quiet)\n-\t\t\t\t\tprintf(\"Removing %s\\n\", qname);\n+\t\t\t\t\tprintf(_(\"Removing %s\\n\"), qname);\n \t\t\t\tif (remove_dir_recursively(&directory,\n \t\t\t\t\t\t\t   rm_flags) != 0) {\n-\t\t\t\t\twarning(\"failed to remove %s\", qname);\n+\t\t\t\t\twarning(_(\"failed to remove %s\"), qname);\n \t\t\t\t\terrors++;\n \t\t\t\t}\n \t\t\t} else if (show_only) {\n-\t\t\t\tprintf(\"Would not remove %s\\n\", qname);\n+\t\t\t\tprintf(_(\"Would not remove %s\\n\"), qname);\n \t\t\t} else {\n-\t\t\t\tprintf(\"Not removing %s\\n\", qname);\n+\t\t\t\tprintf(_(\"Not removing %s\\n\"), qname);\n \t\t\t}\n \t\t\tstrbuf_reset(&directory);\n \t\t} else {\n@@ -167,13 +167,13 @@ int cmd_clean(int argc, const char **argv, const char *prefix)\n \t\t\t\tcontinue;\n \t\t\tqname = quote_path_relative(ent->name, -1, &buf, prefix);\n \t\t\tif (show_only) {\n-\t\t\t\tprintf(\"Would remove %s\\n\", qname);\n+\t\t\t\tprintf(_(\"Would remove %s\\n\"), qname);\n \t\t\t\tcontinue;\n \t\t\t} else if (!quiet) {\n-\t\t\t\tprintf(\"Removing %s\\n\", qname);\n+\t\t\t\tprintf(_(\"Removing %s\\n\"), qname);\n \t\t\t}\n \t\t\tif (unlink(ent->name) != 0) {\n-\t\t\t\twarning(\"failed to remove %s\", qname);\n+\t\t\t\twarning(_(\"failed to remove %s\"), qname);\n \t\t\t\terrors++;\n \t\t\t}\n \t\t}\ndiff --git a/t/t7012-skip-worktree-writing.sh b/t/t7012-skip-worktree-writing.sh\nindex 582d0b5..6fccd91 100755\n--- a/t/t7012-skip-worktree-writing.sh\n+++ b/t/t7012-skip-worktree-writing.sh\n@@ -124,13 +124,13 @@ cat >expected <<EOF\n Would remove expected\n Would remove result\n EOF\n-test_expect_success 'git-clean, absent case' '\n+test_expect_success NO_GETTEXT_POISON 'git-clean, absent case' '\n \tsetup_absent &&\n \tgit clean -n > result &&\n \ttest_cmp expected result\n '\n \n-test_expect_success 'git-clean, dirty case' '\n+test_expect_success NO_GETTEXT_POISON 'git-clean, dirty case' '\n \tsetup_dirty &&\n \tgit clean -n > result &&\n \ttest_cmp expected result\ndiff --git a/t/t7300-clean.sh b/t/t7300-clean.sh\nindex 02f67b7..70d8168 100755\n--- a/t/t7300-clean.sh\n+++ b/t/t7300-clean.sh\n@@ -110,7 +110,7 @@ test_expect_success 'git clean with prefix' '\n \n '\n \n-test_expect_success 'git clean with relative prefix' '\n+test_expect_success NO_GETTEXT_POISON 'git clean with relative prefix' '\n \n \tmkdir -p build docs &&\n \ttouch a.out src/part3.c docs/manual.txt obj.o build/lib.so &&\n@@ -125,7 +125,7 @@ test_expect_success 'git clean with relative prefix' '\n \t}\n '\n \n-test_expect_success 'git clean with absolute path' '\n+test_expect_success NO_GETTEXT_POISON 'git clean with absolute path' '\n \n \tmkdir -p build docs &&\n \ttouch a.out src/part3.c docs/manual.txt obj.o build/lib.so &&\n@@ -377,7 +377,7 @@ test_expect_success 'clean.requireForce and -f' '\n \n '\n \n-test_expect_success 'core.excludesfile' '\n+test_expect_success NO_GETTEXT_POISON 'core.excludesfile' '\n \n \techo excludes >excludes &&\n \techo included >included &&\n-- \n1.7.2.3\n"},{"id":"161679","messageId":"1298143495-3681-63-git-send-email-avarab@gmail.com","threadId":"26561","inReplyTo":"1298143495-3681-1-git-send-email-avarab@gmail.com","subject":"[PATCH 62/72] gettextize: git-clean clean.requireForce messages","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2011-02-19T19:24:45Z","receivedAt":"2011-02-19T19:24:45Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"Split up the \"clean.requireForce set/defaults to true...\" die()\nmessage to make it easier to translate.\n\nSigned-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n builtin/clean.c |   11 ++++++++---\n 1 files changed, 8 insertions(+), 3 deletions(-)\n\ndiff --git a/builtin/clean.c b/builtin/clean.c\nindex 2d0054b..75697f7 100644\n--- a/builtin/clean.c\n+++ b/builtin/clean.c\n@@ -77,9 +77,14 @@ int cmd_clean(int argc, const char **argv, const char *prefix)\n \tif (ignored && ignored_only)\n \t\tdie(_(\"-x and -X cannot be used together\"));\n \n-\tif (!show_only && !force)\n-\t\tdie(\"clean.requireForce %s to true and neither -n nor -f given; \"\n-\t\t    \"refusing to clean\", config_set ? \"set\" : \"defaults\");\n+\tif (!show_only && !force) {\n+\t\tif (config_set)\n+\t\t\tdie(_(\"clean.requireForce set to true and neither -n nor -f given; \"\n+\t\t\t\t  \"refusing to clean\"));\n+\t\telse\n+\t\t\tdie(_(\"clean.requireForce defaults to true and neither -n nor -f given; \"\n+\t\t\t\t  \"refusing to clean\"));\n+\t}\n \n \tif (force > 1)\n \t\trm_flags = 0;\n-- \n1.7.2.3\n"},{"id":"161674","messageId":"1298143495-3681-64-git-send-email-avarab@gmail.com","threadId":"26561","inReplyTo":"1298143495-3681-1-git-send-email-avarab@gmail.com","subject":"[PATCH 63/72] gettextize: git-describe basic messages","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2011-02-19T19:24:46Z","receivedAt":"2011-02-19T19:24:46Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n builtin/describe.c  |   36 ++++++++++++++++++------------------\n t/t6120-describe.sh |    2 +-\n 2 files changed, 19 insertions(+), 19 deletions(-)\n\ndiff --git a/builtin/describe.c b/builtin/describe.c\nindex 342129f..037691e 100644\n--- a/builtin/describe.c\n+++ b/builtin/describe.c\n@@ -231,13 +231,13 @@ static void display_name(struct commit_name *n)\n \tif (n->prio == 2 && !n->tag) {\n \t\tn->tag = lookup_tag(n->sha1);\n \t\tif (!n->tag || parse_tag(n->tag))\n-\t\t\tdie(\"annotated tag %s not available\", n->path);\n+\t\t\tdie(_(\"annotated tag %s not available\"), n->path);\n \t}\n \tif (n->tag && !n->name_checked) {\n \t\tif (!n->tag->tag)\n-\t\t\tdie(\"annotated tag %s has no embedded name\", n->path);\n+\t\t\tdie(_(\"annotated tag %s has no embedded name\"), n->path);\n \t\tif (strcmp(n->tag->tag, all ? n->path + 5 : n->path))\n-\t\t\twarning(\"tag '%s' is really '%s' here\", n->tag->tag, n->path);\n+\t\t\twarning(_(\"tag '%s' is really '%s' here\"), n->tag->tag, n->path);\n \t\tn->name_checked = 1;\n \t}\n \n@@ -264,10 +264,10 @@ static void describe(const char *arg, int last_one)\n \tunsigned int unannotated_cnt = 0;\n \n \tif (get_sha1(arg, sha1))\n-\t\tdie(\"Not a valid object name %s\", arg);\n+\t\tdie(_(\"Not a valid object name %s\"), arg);\n \tcmit = lookup_commit_reference(sha1);\n \tif (!cmit)\n-\t\tdie(\"%s is not a valid '%s' object\", arg, commit_type);\n+\t\tdie(_(\"%s is not a valid '%s' object\"), arg, commit_type);\n \n \tn = find_commit_name(cmit->object.sha1);\n \tif (n && (tags || all || n->prio == 2)) {\n@@ -284,9 +284,9 @@ static void describe(const char *arg, int last_one)\n \t}\n \n \tif (!max_candidates)\n-\t\tdie(\"no tag exactly matches '%s'\", sha1_to_hex(cmit->object.sha1));\n+\t\tdie(_(\"no tag exactly matches '%s'\"), sha1_to_hex(cmit->object.sha1));\n \tif (debug)\n-\t\tfprintf(stderr, \"searching to describe %s\\n\", arg);\n+\t\tfprintf(stderr, _(\"searching to describe %s\\n\"), arg);\n \n \tif (!have_util) {\n \t\tfor_each_hash(&names, set_util);\n@@ -326,7 +326,7 @@ static void describe(const char *arg, int last_one)\n \t\t}\n \t\tif (annotated_cnt && !list) {\n \t\t\tif (debug)\n-\t\t\t\tfprintf(stderr, \"finished search at %s\\n\",\n+\t\t\t\tfprintf(stderr, _(\"finished search at %s\\n\"),\n \t\t\t\t\tsha1_to_hex(c->object.sha1));\n \t\t\tbreak;\n \t\t}\n@@ -350,12 +350,12 @@ static void describe(const char *arg, int last_one)\n \t\t\treturn;\n \t\t}\n \t\tif (unannotated_cnt)\n-\t\t\tdie(\"No annotated tags can describe '%s'.\\n\"\n-\t\t\t    \"However, there were unannotated tags: try --tags.\",\n+\t\t\tdie(_(\"No annotated tags can describe '%s'.\\n\"\n+\t\t\t    \"However, there were unannotated tags: try --tags.\"),\n \t\t\t    sha1_to_hex(sha1));\n \t\telse\n-\t\t\tdie(\"No tags can describe '%s'.\\n\"\n-\t\t\t    \"Try --always, or create some tags.\",\n+\t\t\tdie(_(\"No tags can describe '%s'.\\n\"\n+\t\t\t    \"Try --always, or create some tags.\"),\n \t\t\t    sha1_to_hex(sha1));\n \t}\n \n@@ -375,11 +375,11 @@ static void describe(const char *arg, int last_one)\n \t\t\t\tprio_names[t->name->prio],\n \t\t\t\tt->depth, t->name->path);\n \t\t}\n-\t\tfprintf(stderr, \"traversed %lu commits\\n\", seen_commits);\n+\t\tfprintf(stderr, _(\"traversed %lu commits\\n\"), seen_commits);\n \t\tif (gave_up_on) {\n \t\t\tfprintf(stderr,\n-\t\t\t\t\"more than %i tags found; listed %i most recent\\n\"\n-\t\t\t\t\"gave up search at %s\\n\",\n+\t\t\t\t_(\"more than %i tags found; listed %i most recent\\n\"\n+\t\t\t\t\"gave up search at %s\\n\"),\n \t\t\t\tmax_candidates, max_candidates,\n \t\t\t\tsha1_to_hex(gave_up_on->object.sha1));\n \t\t}\n@@ -429,7 +429,7 @@ int cmd_describe(int argc, const char **argv, const char *prefix)\n \tsave_commit_buffer = 0;\n \n \tif (longformat && abbrev == 0)\n-\t\tdie(\"--long is incompatible with --abbrev=0\");\n+\t\tdie(_(\"--long is incompatible with --abbrev=0\"));\n \n \tif (contains) {\n \t\tconst char **args = xmalloc((7 + argc) * sizeof(char *));\n@@ -455,14 +455,14 @@ int cmd_describe(int argc, const char **argv, const char *prefix)\n \tinit_hash(&names);\n \tfor_each_rawref(get_name, NULL);\n \tif (!names.nr && !always)\n-\t\tdie(\"No names found, cannot describe anything.\");\n+\t\tdie(_(\"No names found, cannot describe anything.\"));\n \n \tif (argc == 0) {\n \t\tif (dirty && !cmd_diff_index(ARRAY_SIZE(diff_index_args) - 1, diff_index_args, prefix))\n \t\t\tdirty = NULL;\n \t\tdescribe(\"HEAD\", 1);\n \t} else if (dirty) {\n-\t\tdie(\"--dirty is incompatible with committishes\");\n+\t\tdie(_(\"--dirty is incompatible with committishes\"));\n \t} else {\n \t\twhile (argc-- > 0) {\n \t\t\tdescribe(*argv++, argc == 0);\ndiff --git a/t/t6120-describe.sh b/t/t6120-describe.sh\nindex 876d1ab..210b9a2 100755\n--- a/t/t6120-describe.sh\n+++ b/t/t6120-describe.sh\n@@ -123,7 +123,7 @@ cat - >err.expect <<EOF\n warning: tag 'A' is really 'Q' here\n EOF\n check_describe A-* HEAD\n-test_expect_success 'warning was displayed for Q' '\n+test_expect_success NO_GETTEXT_POISON 'warning was displayed for Q' '\n \ttest_cmp err.expect err.actual\n '\n test_expect_success 'rename tag Q back to A' '\n-- \n1.7.2.3\n"},{"id":"161680","messageId":"1298143495-3681-65-git-send-email-avarab@gmail.com","threadId":"26561","inReplyTo":"1298143495-3681-1-git-send-email-avarab@gmail.com","subject":"[PATCH 64/72] gettextize: git-gc basic messages","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2011-02-19T19:24:47Z","receivedAt":"2011-02-19T19:24:47Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n builtin/gc.c |   10 +++++-----\n 1 files changed, 5 insertions(+), 5 deletions(-)\n\ndiff --git a/builtin/gc.c b/builtin/gc.c\nindex 1a80702..a2be62a 100644\n--- a/builtin/gc.c\n+++ b/builtin/gc.c\n@@ -60,7 +60,7 @@ static int gc_config(const char *var, const char *value, void *cb)\n \t\tif (value && strcmp(value, \"now\")) {\n \t\t\tunsigned long now = approxidate(\"now\");\n \t\t\tif (approxidate(value) >= now)\n-\t\t\t\treturn error(\"Invalid %s: '%s'\", var, value);\n+\t\t\t\treturn error(_(\"Invalid %s: '%s'\"), var, value);\n \t\t}\n \t\treturn git_config_string(&prune_expire, var, value);\n \t}\n@@ -75,7 +75,7 @@ static void append_option(const char **cmd, const char *opt, int max_length)\n \t\t;\n \n \tif (i + 2 >= max_length)\n-\t\tdie(\"Too many options specified\");\n+\t\tdie(_(\"Too many options specified\"));\n \tcmd[i++] = opt;\n \tcmd[i] = NULL;\n }\n@@ -100,7 +100,7 @@ static int too_many_loose_objects(void)\n \t\treturn 0;\n \n \tif (sizeof(path) <= snprintf(path, sizeof(path), \"%s/17\", objdir)) {\n-\t\twarning(\"insanely long object directory %.*s\", 50, objdir);\n+\t\twarning(_(\"insanely long object directory %.*s\"), 50, objdir);\n \t\treturn 0;\n \t}\n \tdir = opendir(path);\n@@ -251,8 +251,8 @@ int cmd_gc(int argc, const char **argv, const char *prefix)\n \t\treturn error(FAILED_RUN, argv_rerere[0]);\n \n \tif (auto_gc && too_many_loose_objects())\n-\t\twarning(\"There are too many unreachable loose objects; \"\n-\t\t\t\"run 'git prune' to remove them.\");\n+\t\twarning(_(\"There are too many unreachable loose objects; \"\n+\t\t\t\"run 'git prune' to remove them.\"));\n \n \treturn 0;\n }\n-- \n1.7.2.3\n"},{"id":"161681","messageId":"1298143495-3681-66-git-send-email-avarab@gmail.com","threadId":"26561","inReplyTo":"1298143495-3681-1-git-send-email-avarab@gmail.com","subject":"[PATCH 65/72] gettextize: git-gc \"Auto packing the repository\" message","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2011-02-19T19:24:48Z","receivedAt":"2011-02-19T19:24:48Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"Split up the \"Auto packing the repository\" message into quiet and\nverbose variants to make translation easier.\n\nSigned-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n builtin/gc.c |   14 +++++++-------\n 1 files changed, 7 insertions(+), 7 deletions(-)\n\ndiff --git a/builtin/gc.c b/builtin/gc.c\nindex a2be62a..ff5f73b 100644\n--- a/builtin/gc.c\n+++ b/builtin/gc.c\n@@ -219,13 +219,13 @@ int cmd_gc(int argc, const char **argv, const char *prefix)\n \t\t */\n \t\tif (!need_to_gc())\n \t\t\treturn 0;\n-\t\tfprintf(stderr,\n-\t\t\t\"Auto packing the repository for optimum performance.%s\\n\",\n-\t\t\tquiet\n-\t\t\t? \"\"\n-\t\t\t: (\" You may also\\n\"\n-\t\t\t   \"run \\\"git gc\\\" manually. See \"\n-\t\t\t   \"\\\"git help gc\\\" for more information.\"));\n+\t\tif (quiet)\n+\t\t\tfprintf(stderr, _(\"Auto packing the repository for optimum performance.\\n\"));\n+\t\telse\n+\t\t\tfprintf(stderr,\n+\t\t\t\t\t_(\"Auto packing the repository for optimum performance. You may also\\n\"\n+\t\t\t\t\t\"run \\\"git gc\\\" manually. See \"\n+\t\t\t\t\t\"\\\"git help gc\\\" for more information.\"));\n \t} else\n \t\tappend_option(argv_repack,\n \t\t\t      prune_expire && !strcmp(prune_expire, \"now\")\n-- \n1.7.2.3\n"},{"id":"161692","messageId":"1298143495-3681-67-git-send-email-avarab@gmail.com","threadId":"26561","inReplyTo":"1298143495-3681-1-git-send-email-avarab@gmail.com","subject":"[PATCH 66/72] gettextize: git-notes basic commands","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2011-02-19T19:24:49Z","receivedAt":"2011-02-19T19:24:49Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n builtin/notes.c |  106 +++++++++++++++++++++++++++---------------------------\n 1 files changed, 53 insertions(+), 53 deletions(-)\n\ndiff --git a/builtin/notes.c b/builtin/notes.c\nindex 4d5556e..4c6cf85 100644\n--- a/builtin/notes.c\n+++ b/builtin/notes.c\n@@ -146,13 +146,13 @@ static void write_commented_object(int fd, const unsigned char *object)\n \tshow.err = 0;\n \tshow.git_cmd = 1;\n \tif (start_command(&show))\n-\t\tdie(\"unable to start 'show' for object '%s'\",\n+\t\tdie(_(\"unable to start 'show' for object '%s'\"),\n \t\t    sha1_to_hex(object));\n \n \t/* Open the output as FILE* so strbuf_getline() can be used. */\n \tshow_out = xfdopen(show.out, \"r\");\n \tif (show_out == NULL)\n-\t\tdie_errno(\"can't fdopen 'show' output fd\");\n+\t\tdie_errno(_(\"can't fdopen 'show' output fd\"));\n \n \t/* Prepend \"# \" to each output line and write result to 'fd' */\n \twhile (strbuf_getline(&buf, show_out, '\\n') != EOF) {\n@@ -162,10 +162,10 @@ static void write_commented_object(int fd, const unsigned char *object)\n \t}\n \tstrbuf_release(&buf);\n \tif (fclose(show_out))\n-\t\tdie_errno(\"failed to close pipe to 'show' for object '%s'\",\n+\t\tdie_errno(_(\"failed to close pipe to 'show' for object '%s'\"),\n \t\t\t  sha1_to_hex(object));\n \tif (finish_command(&show))\n-\t\tdie(\"failed to finish 'show' for object '%s'\",\n+\t\tdie(_(\"failed to finish 'show' for object '%s'\"),\n \t\t    sha1_to_hex(object));\n }\n \n@@ -182,7 +182,7 @@ static void create_note(const unsigned char *object, struct msg_arg *msg,\n \t\tpath = git_pathdup(\"NOTES_EDITMSG\");\n \t\tfd = open(path, O_CREAT | O_TRUNC | O_WRONLY, 0600);\n \t\tif (fd < 0)\n-\t\t\tdie_errno(\"could not create file '%s'\", path);\n+\t\t\tdie_errno(_(\"could not create file '%s'\"), path);\n \n \t\tif (msg->given)\n \t\t\twrite_or_die(fd, msg->buf.buf, msg->buf.len);\n@@ -196,8 +196,8 @@ static void create_note(const unsigned char *object, struct msg_arg *msg,\n \t\tstrbuf_reset(&(msg->buf));\n \n \t\tif (launch_editor(path, &(msg->buf), NULL)) {\n-\t\t\tdie(\"Please supply the note contents using either -m\" \\\n-\t\t\t    \" or -F option\");\n+\t\t\tdie(_(\"Please supply the note contents using either -m\" \\\n+\t\t\t    \" or -F option\"));\n \t\t}\n \t\tstripspace(&(msg->buf), 1);\n \t}\n@@ -217,14 +217,14 @@ static void create_note(const unsigned char *object, struct msg_arg *msg,\n \t}\n \n \tif (!msg->buf.len) {\n-\t\tfprintf(stderr, \"Removing note for object %s\\n\",\n+\t\tfprintf(stderr, _(\"Removing note for object %s\\n\"),\n \t\t\tsha1_to_hex(object));\n \t\thashclr(result);\n \t} else {\n \t\tif (write_sha1_file(msg->buf.buf, msg->buf.len, blob_type, result)) {\n-\t\t\terror(\"unable to write note object\");\n+\t\t\terror(_(\"unable to write note object\"));\n \t\t\tif (path)\n-\t\t\t\terror(\"The note contents has been left in %s\",\n+\t\t\t\terror(_(\"The note contents has been left in %s\"),\n \t\t\t\t      path);\n \t\t\texit(128);\n \t\t}\n@@ -258,9 +258,9 @@ static int parse_file_arg(const struct option *opt, const char *arg, int unset)\n \t\tstrbuf_addch(&(msg->buf), '\\n');\n \tif (!strcmp(arg, \"-\")) {\n \t\tif (strbuf_read(&(msg->buf), 0, 1024) < 0)\n-\t\t\tdie_errno(\"cannot read '%s'\", arg);\n+\t\t\tdie_errno(_(\"cannot read '%s'\"), arg);\n \t} else if (strbuf_read_file(&(msg->buf), arg, 1024) < 0)\n-\t\tdie_errno(\"could not open or read '%s'\", arg);\n+\t\tdie_errno(_(\"could not open or read '%s'\"), arg);\n \tstripspace(&(msg->buf), 0);\n \n \tmsg->given = 1;\n@@ -279,10 +279,10 @@ static int parse_reuse_arg(const struct option *opt, const char *arg, int unset)\n \t\tstrbuf_addch(&(msg->buf), '\\n');\n \n \tif (get_sha1(arg, object))\n-\t\tdie(\"Failed to resolve '%s' as a valid ref.\", arg);\n+\t\tdie(_(\"Failed to resolve '%s' as a valid ref.\"), arg);\n \tif (!(buf = read_sha1_file(object, &type, &len)) || !len) {\n \t\tfree(buf);\n-\t\tdie(\"Failed to read object '%s'.\", arg);;\n+\t\tdie(_(\"Failed to read object '%s'.\"), arg);;\n \t}\n \tstrbuf_add(&(msg->buf), buf, len);\n \tfree(buf);\n@@ -306,7 +306,7 @@ void commit_notes(struct notes_tree *t, const char *msg)\n \tif (!t)\n \t\tt = &default_notes_tree;\n \tif (!t->initialized || !t->ref || !*t->ref)\n-\t\tdie(\"Cannot commit uninitialized/unreferenced notes tree\");\n+\t\tdie(_(\"Cannot commit uninitialized/unreferenced notes tree\"));\n \tif (!t->dirty)\n \t\treturn; /* don't have to commit an unchanged tree */\n \n@@ -347,7 +347,7 @@ static int notes_rewrite_config(const char *k, const char *v, void *cb)\n \t\t\tconfig_error_nonbool(k);\n \t\tc->combine = parse_combine_notes_fn(v);\n \t\tif (!c->combine) {\n-\t\t\terror(\"Bad notes.rewriteMode value: '%s'\", v);\n+\t\t\terror(_(\"Bad notes.rewriteMode value: '%s'\"), v);\n \t\t\treturn 1;\n \t\t}\n \t\treturn 0;\n@@ -357,8 +357,8 @@ static int notes_rewrite_config(const char *k, const char *v, void *cb)\n \t\tif (!prefixcmp(v, \"refs/notes/\"))\n \t\t\tstring_list_add_refs_by_glob(c->refs, v);\n \t\telse\n-\t\t\twarning(\"Refusing to rewrite notes in %s\"\n-\t\t\t\t\" (outside of refs/notes/)\", v);\n+\t\t\twarning(_(\"Refusing to rewrite notes in %s\"\n+\t\t\t\t\" (outside of refs/notes/)\"), v);\n \t\treturn 0;\n \t}\n \n@@ -446,13 +446,13 @@ int notes_copy_from_stdin(int force, const char *rewrite_cmd)\n \n \t\tsplit = strbuf_split(&buf, ' ');\n \t\tif (!split[0] || !split[1])\n-\t\t\tdie(\"Malformed input line: '%s'.\", buf.buf);\n+\t\t\tdie(_(\"Malformed input line: '%s'.\"), buf.buf);\n \t\tstrbuf_rtrim(split[0]);\n \t\tstrbuf_rtrim(split[1]);\n \t\tif (get_sha1(split[0]->buf, from_obj))\n-\t\t\tdie(\"Failed to resolve '%s' as a valid ref.\", split[0]->buf);\n+\t\t\tdie(_(\"Failed to resolve '%s' as a valid ref.\"), split[0]->buf);\n \t\tif (get_sha1(split[1]->buf, to_obj))\n-\t\t\tdie(\"Failed to resolve '%s' as a valid ref.\", split[1]->buf);\n+\t\t\tdie(_(\"Failed to resolve '%s' as a valid ref.\"), split[1]->buf);\n \n \t\tif (rewrite_cmd)\n \t\t\terr = copy_note_for_rewrite(c, from_obj, to_obj);\n@@ -461,7 +461,7 @@ int notes_copy_from_stdin(int force, const char *rewrite_cmd)\n \t\t\t\t\tcombine_notes_overwrite);\n \n \t\tif (err) {\n-\t\t\terror(\"Failed to copy notes from '%s' to '%s'\",\n+\t\t\terror(_(\"Failed to copy notes from '%s' to '%s'\"),\n \t\t\t      split[0]->buf, split[1]->buf);\n \t\t\tret = 1;\n \t\t}\n@@ -505,20 +505,20 @@ static int list(int argc, const char **argv, const char *prefix)\n \t\t\t\t     git_notes_list_usage, 0);\n \n \tif (1 < argc) {\n-\t\terror(\"too many parameters\");\n+\t\terror(_(\"too many parameters\"));\n \t\tusage_with_options(git_notes_list_usage, options);\n \t}\n \n \tt = init_notes_check(\"list\");\n \tif (argc) {\n \t\tif (get_sha1(argv[0], object))\n-\t\t\tdie(\"Failed to resolve '%s' as a valid ref.\", argv[0]);\n+\t\t\tdie(_(\"Failed to resolve '%s' as a valid ref.\"), argv[0]);\n \t\tnote = get_note(t, object);\n \t\tif (note) {\n \t\t\tputs(sha1_to_hex(note));\n \t\t\tretval = 0;\n \t\t} else\n-\t\t\tretval = error(\"No note found for object %s.\",\n+\t\t\tretval = error(_(\"No note found for object %s.\"),\n \t\t\t\t       sha1_to_hex(object));\n \t} else\n \t\tretval = for_each_note(t, 0, list_each_note, NULL);\n@@ -557,26 +557,26 @@ static int add(int argc, const char **argv, const char *prefix)\n \t\t\t     0);\n \n \tif (1 < argc) {\n-\t\terror(\"too many parameters\");\n+\t\terror(_(\"too many parameters\"));\n \t\tusage_with_options(git_notes_add_usage, options);\n \t}\n \n \tobject_ref = argc ? argv[0] : \"HEAD\";\n \n \tif (get_sha1(object_ref, object))\n-\t\tdie(\"Failed to resolve '%s' as a valid ref.\", object_ref);\n+\t\tdie(_(\"Failed to resolve '%s' as a valid ref.\"), object_ref);\n \n \tt = init_notes_check(\"add\");\n \tnote = get_note(t, object);\n \n \tif (note) {\n \t\tif (!force) {\n-\t\t\tretval = error(\"Cannot add notes. Found existing notes \"\n+\t\t\tretval = error(_(\"Cannot add notes. Found existing notes \"\n \t\t\t\t       \"for object %s. Use '-f' to overwrite \"\n-\t\t\t\t       \"existing notes\", sha1_to_hex(object));\n+\t\t\t\t       \"existing notes\"), sha1_to_hex(object));\n \t\t\tgoto out;\n \t\t}\n-\t\tfprintf(stderr, \"Overwriting existing notes for object %s\\n\",\n+\t\tfprintf(stderr, _(\"Overwriting existing notes for object %s\\n\"),\n \t\t\tsha1_to_hex(object));\n \t}\n \n@@ -618,7 +618,7 @@ static int copy(int argc, const char **argv, const char *prefix)\n \n \tif (from_stdin || rewrite_cmd) {\n \t\tif (argc) {\n-\t\t\terror(\"too many parameters\");\n+\t\t\terror(_(\"too many parameters\"));\n \t\t\tusage_with_options(git_notes_copy_usage, options);\n \t\t} else {\n \t\t\treturn notes_copy_from_stdin(force, rewrite_cmd);\n@@ -626,41 +626,41 @@ static int copy(int argc, const char **argv, const char *prefix)\n \t}\n \n \tif (argc < 2) {\n-\t\terror(\"too few parameters\");\n+\t\terror(_(\"too few parameters\"));\n \t\tusage_with_options(git_notes_copy_usage, options);\n \t}\n \tif (2 < argc) {\n-\t\terror(\"too many parameters\");\n+\t\terror(_(\"too many parameters\"));\n \t\tusage_with_options(git_notes_copy_usage, options);\n \t}\n \n \tif (get_sha1(argv[0], from_obj))\n-\t\tdie(\"Failed to resolve '%s' as a valid ref.\", argv[0]);\n+\t\tdie(_(\"Failed to resolve '%s' as a valid ref.\"), argv[0]);\n \n \tobject_ref = 1 < argc ? argv[1] : \"HEAD\";\n \n \tif (get_sha1(object_ref, object))\n-\t\tdie(\"Failed to resolve '%s' as a valid ref.\", object_ref);\n+\t\tdie(_(\"Failed to resolve '%s' as a valid ref.\"), object_ref);\n \n \tt = init_notes_check(\"copy\");\n \tnote = get_note(t, object);\n \n \tif (note) {\n \t\tif (!force) {\n-\t\t\tretval = error(\"Cannot copy notes. Found existing \"\n+\t\t\tretval = error(_(\"Cannot copy notes. Found existing \"\n \t\t\t\t       \"notes for object %s. Use '-f' to \"\n-\t\t\t\t       \"overwrite existing notes\",\n+\t\t\t\t       \"overwrite existing notes\"),\n \t\t\t\t       sha1_to_hex(object));\n \t\t\tgoto out;\n \t\t}\n-\t\tfprintf(stderr, \"Overwriting existing notes for object %s\\n\",\n+\t\tfprintf(stderr, _(\"Overwriting existing notes for object %s\\n\"),\n \t\t\tsha1_to_hex(object));\n \t}\n \n \tfrom_note = get_note(t, from_obj);\n \tif (!from_note) {\n-\t\tretval = error(\"Missing notes on source object %s. Cannot \"\n-\t\t\t       \"copy.\", sha1_to_hex(from_obj));\n+\t\tretval = error(_(\"Missing notes on source object %s. Cannot \"\n+\t\t\t       \"copy.\"), sha1_to_hex(from_obj));\n \t\tgoto out;\n \t}\n \n@@ -703,19 +703,19 @@ static int append_edit(int argc, const char **argv, const char *prefix)\n \t\t\t     PARSE_OPT_KEEP_ARGV0);\n \n \tif (2 < argc) {\n-\t\terror(\"too many parameters\");\n+\t\terror(_(\"too many parameters\"));\n \t\tusage_with_options(usage, options);\n \t}\n \n \tif (msg.given && edit)\n-\t\tfprintf(stderr, \"The -m/-F/-c/-C options have been deprecated \"\n+\t\tfprintf(stderr, _(\"The -m/-F/-c/-C options have been deprecated \"\n \t\t\t\"for the 'edit' subcommand.\\n\"\n-\t\t\t\"Please use 'git notes add -f -m/-F/-c/-C' instead.\\n\");\n+\t\t\t\"Please use 'git notes add -f -m/-F/-c/-C' instead.\\n\"));\n \n \tobject_ref = 1 < argc ? argv[1] : \"HEAD\";\n \n \tif (get_sha1(object_ref, object))\n-\t\tdie(\"Failed to resolve '%s' as a valid ref.\", object_ref);\n+\t\tdie(_(\"Failed to resolve '%s' as a valid ref.\"), object_ref);\n \n \tt = init_notes_check(argv[0]);\n \tnote = get_note(t, object);\n@@ -750,20 +750,20 @@ static int show(int argc, const char **argv, const char *prefix)\n \t\t\t     0);\n \n \tif (1 < argc) {\n-\t\terror(\"too many parameters\");\n+\t\terror(_(\"too many parameters\"));\n \t\tusage_with_options(git_notes_show_usage, options);\n \t}\n \n \tobject_ref = argc ? argv[0] : \"HEAD\";\n \n \tif (get_sha1(object_ref, object))\n-\t\tdie(\"Failed to resolve '%s' as a valid ref.\", object_ref);\n+\t\tdie(_(\"Failed to resolve '%s' as a valid ref.\"), object_ref);\n \n \tt = init_notes_check(\"show\");\n \tnote = get_note(t, object);\n \n \tif (!note)\n-\t\tretval = error(\"No note found for object %s.\",\n+\t\tretval = error(_(\"No note found for object %s.\"),\n \t\t\t       sha1_to_hex(object));\n \telse {\n \t\tconst char *show_args[3] = {\"show\", sha1_to_hex(note), NULL};\n@@ -961,22 +961,22 @@ static int remove_cmd(int argc, const char **argv, const char *prefix)\n \t\t\t     git_notes_remove_usage, 0);\n \n \tif (1 < argc) {\n-\t\terror(\"too many parameters\");\n+\t\terror(_(\"too many parameters\"));\n \t\tusage_with_options(git_notes_remove_usage, options);\n \t}\n \n \tobject_ref = argc ? argv[0] : \"HEAD\";\n \n \tif (get_sha1(object_ref, object))\n-\t\tdie(\"Failed to resolve '%s' as a valid ref.\", object_ref);\n+\t\tdie(_(\"Failed to resolve '%s' as a valid ref.\"), object_ref);\n \n \tt = init_notes_check(\"remove\");\n \n \tretval = remove_note(t, object);\n \tif (retval)\n-\t\tfprintf(stderr, \"Object %s has no note\\n\", sha1_to_hex(object));\n+\t\tfprintf(stderr, _(\"Object %s has no note\\n\"), sha1_to_hex(object));\n \telse {\n-\t\tfprintf(stderr, \"Removing note for object %s\\n\",\n+\t\tfprintf(stderr, _(\"Removing note for object %s\\n\"),\n \t\t\tsha1_to_hex(object));\n \n \t\tcommit_notes(t, \"Notes removed by 'git notes remove'\");\n@@ -999,7 +999,7 @@ static int prune(int argc, const char **argv, const char *prefix)\n \t\t\t     0);\n \n \tif (argc) {\n-\t\terror(\"too many parameters\");\n+\t\terror(_(\"too many parameters\"));\n \t\tusage_with_options(git_notes_prune_usage, options);\n \t}\n \n@@ -1069,7 +1069,7 @@ int cmd_notes(int argc, const char **argv, const char *prefix)\n \telse if (!strcmp(argv[0], \"get-ref\"))\n \t\tresult = get_ref(argc, argv, prefix);\n \telse {\n-\t\tresult = error(\"Unknown subcommand: %s\", argv[0]);\n+\t\tresult = error(_(\"Unknown subcommand: %s\"), argv[0]);\n \t\tusage_with_options(git_notes_usage, options);\n \t}\n \n-- \n1.7.2.3\n"},{"id":"161685","messageId":"1298143495-3681-68-git-send-email-avarab@gmail.com","threadId":"26561","inReplyTo":"1298143495-3681-1-git-send-email-avarab@gmail.com","subject":"[PATCH 67/72] gettextize: git-notes GIT_NOTES_REWRITE_MODE error message","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2011-02-19T19:24:50Z","receivedAt":"2011-02-19T19:24:50Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"Use sprintf format for the error message that's displayed if\nGIT_NOTES_REWRITE_MODE is invalid, and leave a note in a TRANSLATORS\ncomment indicating what the message means.\n\nSigned-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n builtin/notes.c |    6 ++++--\n 1 files changed, 4 insertions(+), 2 deletions(-)\n\ndiff --git a/builtin/notes.c b/builtin/notes.c\nindex 4c6cf85..a0aa995 100644\n--- a/builtin/notes.c\n+++ b/builtin/notes.c\n@@ -382,8 +382,10 @@ struct notes_rewrite_cfg *init_copy_notes_for_rewrite(const char *cmd)\n \t\tc->mode_from_env = 1;\n \t\tc->combine = parse_combine_notes_fn(rewrite_mode_env);\n \t\tif (!c->combine)\n-\t\t\terror(\"Bad \" GIT_NOTES_REWRITE_MODE_ENVIRONMENT\n-\t\t\t      \" value: '%s'\", rewrite_mode_env);\n+\t\t\t/* TRANSLATORS: The first %s is the name of the\n+\t\t\t   environment variable, the second %s is its value */\n+\t\t\terror(_(\"Bad %s value: '%s'\"), GIT_NOTES_REWRITE_MODE_ENVIRONMENT,\n+\t\t\t\t\trewrite_mode_env);\n \t}\n \tif (rewrite_refs_env) {\n \t\tc->refs_from_env = 1;\n-- \n1.7.2.3\n"},{"id":"161686","messageId":"1298143495-3681-69-git-send-email-avarab@gmail.com","threadId":"26561","inReplyTo":"1298143495-3681-1-git-send-email-avarab@gmail.com","subject":"[PATCH 68/72] gettextize: git-revert basic messages","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2011-02-19T19:24:51Z","receivedAt":"2011-02-19T19:24:51Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n builtin/revert.c |   46 +++++++++++++++++++++++-----------------------\n 1 files changed, 23 insertions(+), 23 deletions(-)\n\ndiff --git a/builtin/revert.c b/builtin/revert.c\nindex dc1b702..1ca08da 100644\n--- a/builtin/revert.c\n+++ b/builtin/revert.c\n@@ -96,7 +96,7 @@ static void parse_args(int argc, const char **argv)\n \t\t\tOPT_END(),\n \t\t};\n \t\tif (parse_options_concat(options, ARRAY_SIZE(options), cp_extra))\n-\t\t\tdie(\"program error\");\n+\t\t\tdie(_(\"program error\"));\n \t}\n \n \tcommit_argc = parse_options(argc, argv, NULL, options, usage_str,\n@@ -168,7 +168,7 @@ static char *get_encoding(const char *message)\n \tconst char *p = message, *eol;\n \n \tif (!p)\n-\t\tdie (\"Could not read commit message of %s\",\n+\t\tdie (_(\"Could not read commit message of %s\"),\n \t\t\t\tsha1_to_hex(commit->object.sha1));\n \twhile (*p && *p != '\\n') {\n \t\tfor (eol = p + 1; *eol && *eol != '\\n'; eol++)\n@@ -202,7 +202,7 @@ static void set_author_ident_env(const char *message)\n {\n \tconst char *p = message;\n \tif (!p)\n-\t\tdie (\"Could not read commit message of %s\",\n+\t\tdie (_(\"Could not read commit message of %s\"),\n \t\t\t\tsha1_to_hex(commit->object.sha1));\n \twhile (*p && *p != '\\n') {\n \t\tconst char *eol;\n@@ -216,7 +216,7 @@ static void set_author_ident_env(const char *message)\n \t\t\tline = xmemdupz(p, eol - p);\n \t\t\temail = strchr(line, '<');\n \t\t\tif (!email)\n-\t\t\t\tdie (\"Could not extract author email from %s\",\n+\t\t\t\tdie (_(\"Could not extract author email from %s\"),\n \t\t\t\t\tsha1_to_hex(commit->object.sha1));\n \t\t\tif (email == line)\n \t\t\t\tpend = line;\n@@ -228,7 +228,7 @@ static void set_author_ident_env(const char *message)\n \t\t\temail++;\n \t\t\ttimestamp = strchr(email, '>');\n \t\t\tif (!timestamp)\n-\t\t\t\tdie (\"Could not extract author time from %s\",\n+\t\t\t\tdie (_(\"Could not extract author time from %s\"),\n \t\t\t\t\tsha1_to_hex(commit->object.sha1));\n \t\t\t*timestamp = '\\0';\n \t\t\tfor (timestamp++; *timestamp && isspace(*timestamp);\n@@ -244,7 +244,7 @@ static void set_author_ident_env(const char *message)\n \t\tif (*p == '\\n')\n \t\t\tp++;\n \t}\n-\tdie (\"No author information found in %s\",\n+\tdie (_(\"No author information found in %s\"),\n \t\t\tsha1_to_hex(commit->object.sha1));\n }\n \n@@ -281,10 +281,10 @@ static void write_message(struct strbuf *msgbuf, const char *filename)\n \tint msg_fd = hold_lock_file_for_update(&msg_file, filename,\n \t\t\t\t\t       LOCK_DIE_ON_ERROR);\n \tif (write_in_full(msg_fd, msgbuf->buf, msgbuf->len) < 0)\n-\t\tdie_errno(\"Could not write to %s.\", filename);\n+\t\tdie_errno(_(\"Could not write to %s.\"), filename);\n \tstrbuf_release(msgbuf);\n \tif (commit_lock_file(&msg_file) < 0)\n-\t\tdie(\"Error wrapping up %s\", filename);\n+\t\tdie(_(\"Error wrapping up %s\"), filename);\n }\n \n static struct tree *empty_tree(void)\n@@ -420,10 +420,10 @@ static int do_pick_commit(void)\n \t\t * to work on.\n \t\t */\n \t\tif (write_cache_as_tree(head, 0, NULL))\n-\t\t\tdie (\"Your index file is unmerged.\");\n+\t\t\tdie (_(\"Your index file is unmerged.\"));\n \t} else {\n \t\tif (get_sha1(\"HEAD\", head))\n-\t\t\tdie (\"You do not have a valid HEAD\");\n+\t\t\tdie (_(\"You do not have a valid HEAD\"));\n \t\tif (index_differs_from(\"HEAD\", 0))\n \t\t\tdie_dirty_index(me);\n \t}\n@@ -431,7 +431,7 @@ static int do_pick_commit(void)\n \n \tif (!commit->parents) {\n \t\tif (action == REVERT)\n-\t\t\tdie (\"Cannot revert a root commit\");\n+\t\t\tdie (_(\"Cannot revert a root commit\"));\n \t\tparent = NULL;\n \t}\n \telse if (commit->parents->next) {\n@@ -440,7 +440,7 @@ static int do_pick_commit(void)\n \t\tstruct commit_list *p;\n \n \t\tif (!mainline)\n-\t\t\tdie(\"Commit %s is a merge but no -m option was given.\",\n+\t\t\tdie(_(\"Commit %s is a merge but no -m option was given.\"),\n \t\t\t    sha1_to_hex(commit->object.sha1));\n \n \t\tfor (cnt = 1, p = commit->parents;\n@@ -448,11 +448,11 @@ static int do_pick_commit(void)\n \t\t     cnt++)\n \t\t\tp = p->next;\n \t\tif (cnt != mainline || !p)\n-\t\t\tdie(\"Commit %s does not have parent %d\",\n+\t\t\tdie(_(\"Commit %s does not have parent %d\"),\n \t\t\t    sha1_to_hex(commit->object.sha1), mainline);\n \t\tparent = p->item;\n \t} else if (0 < mainline)\n-\t\tdie(\"Mainline was specified but commit %s is not a merge.\",\n+\t\tdie(_(\"Mainline was specified but commit %s is not a merge.\"),\n \t\t    sha1_to_hex(commit->object.sha1));\n \telse\n \t\tparent = commit->parents->item;\n@@ -465,7 +465,7 @@ static int do_pick_commit(void)\n \t\t    me, sha1_to_hex(parent->object.sha1));\n \n \tif (get_message(commit->buffer, &msg) != 0)\n-\t\tdie(\"Cannot get commit message for %s\",\n+\t\tdie(_(\"Cannot get commit message for %s\"),\n \t\t\t\tsha1_to_hex(commit->object.sha1));\n \n \t/*\n@@ -556,10 +556,10 @@ static void prepare_revs(struct rev_info *revs)\n \t\tusage(*revert_or_cherry_pick_usage());\n \n \tif (prepare_revision_walk(revs))\n-\t\tdie(\"revision walk setup failed\");\n+\t\tdie(_(\"revision walk setup failed\"));\n \n \tif (!revs->commits)\n-\t\tdie(\"empty commit set passed\");\n+\t\tdie(_(\"empty commit set passed\"));\n }\n \n static void read_and_refresh_cache(const char *me)\n@@ -567,12 +567,12 @@ static void read_and_refresh_cache(const char *me)\n \tstatic struct lock_file index_lock;\n \tint index_fd = hold_locked_index(&index_lock, 0);\n \tif (read_index_preload(&the_index, NULL) < 0)\n-\t\tdie(\"git %s: failed to read the index\", me);\n+\t\tdie(_(\"git %s: failed to read the index\"), me);\n \trefresh_index(&the_index, REFRESH_QUIET|REFRESH_UNMERGED, NULL, NULL, NULL);\n \tif (the_index.cache_changed) {\n \t\tif (write_index(&the_index, index_fd) ||\n \t\t    commit_locked_index(&index_lock))\n-\t\t\tdie(\"git %s: failed to refresh the index\", me);\n+\t\t\tdie(_(\"git %s: failed to refresh the index\"), me);\n \t}\n \trollback_lock_file(&index_lock);\n }\n@@ -588,13 +588,13 @@ static int revert_or_cherry_pick(int argc, const char **argv)\n \n \tif (allow_ff) {\n \t\tif (signoff)\n-\t\t\tdie(\"cherry-pick --ff cannot be used with --signoff\");\n+\t\t\tdie(_(\"cherry-pick --ff cannot be used with --signoff\"));\n \t\tif (no_commit)\n-\t\t\tdie(\"cherry-pick --ff cannot be used with --no-commit\");\n+\t\t\tdie(_(\"cherry-pick --ff cannot be used with --no-commit\"));\n \t\tif (no_replay)\n-\t\t\tdie(\"cherry-pick --ff cannot be used with -x\");\n+\t\t\tdie(_(\"cherry-pick --ff cannot be used with -x\"));\n \t\tif (edit)\n-\t\t\tdie(\"cherry-pick --ff cannot be used with --edit\");\n+\t\t\tdie(_(\"cherry-pick --ff cannot be used with --edit\"));\n \t}\n \n \tread_and_refresh_cache(me);\n-- \n1.7.2.3\n"},{"id":"161683","messageId":"1298143495-3681-70-git-send-email-avarab@gmail.com","threadId":"26561","inReplyTo":"1298143495-3681-1-git-send-email-avarab@gmail.com","subject":"[PATCH 69/72] gettextize: git-revert \"Your local changes\" message","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2011-02-19T19:24:52Z","receivedAt":"2011-02-19T19:24:52Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"Translate the \"Your local changes [...]\" message without using the\n`me' variable, instead split up the two messages so translators can\ntranslate the whole messages as-is.\n\nReported-by: Jonathan Nieder <jrnieder@gmail.com>\nSigned-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n builtin/revert.c              |   18 +++++++++++++-----\n t/t3501-revert-cherry-pick.sh |    2 +-\n 2 files changed, 14 insertions(+), 6 deletions(-)\n\ndiff --git a/builtin/revert.c b/builtin/revert.c\nindex 1ca08da..02c23c9 100644\n--- a/builtin/revert.c\n+++ b/builtin/revert.c\n@@ -302,11 +302,19 @@ static NORETURN void die_dirty_index(const char *me)\n \tif (read_cache_unmerged()) {\n \t\tdie_resolve_conflict(me);\n \t} else {\n-\t\tif (advice_commit_before_merge)\n-\t\t\tdie(\"Your local changes would be overwritten by %s.\\n\"\n-\t\t\t    \"Please, commit your changes or stash them to proceed.\", me);\n-\t\telse\n-\t\t\tdie(\"Your local changes would be overwritten by %s.\\n\", me);\n+\t\tif (advice_commit_before_merge) {\n+\t\t\tif (action == REVERT)\n+\t\t\t\tdie(_(\"Your local changes would be overwritten by revert.\\n\"\n+\t\t\t\t\t  \"Please, commit your changes or stash them to proceed.\"));\n+\t\t\telse\n+\t\t\t\tdie(_(\"Your local changes would be overwritten by cherry-pick.\\n\"\n+\t\t\t\t\t  \"Please, commit your changes or stash them to proceed.\"));\n+\t\t} else {\n+\t\t\tif (action == REVERT)\n+\t\t\t\tdie(_(\"Your local changes would be overwritten by revert.\\n\"));\n+\t\t\telse\n+\t\t\t\tdie(_(\"Your local changes would be overwritten by cherry-pick.\\n\"));\n+\t\t}\n \t}\n }\n \ndiff --git a/t/t3501-revert-cherry-pick.sh b/t/t3501-revert-cherry-pick.sh\nindex 0439544..76d3252 100755\n--- a/t/t3501-revert-cherry-pick.sh\n+++ b/t/t3501-revert-cherry-pick.sh\n@@ -91,7 +91,7 @@ test_expect_success 'cherry-pick on stat-dirty working tree' '\n \t)\n '\n \n-test_expect_success 'revert forbidden on dirty working tree' '\n+test_expect_success NO_GETTEXT_POISON 'revert forbidden on dirty working tree' '\n \n \techo content >extra_file &&\n \tgit add extra_file &&\n-- \n1.7.2.3\n"},{"id":"161684","messageId":"1298143495-3681-71-git-send-email-avarab@gmail.com","threadId":"26561","inReplyTo":"1298143495-3681-1-git-send-email-avarab@gmail.com","subject":"[PATCH 70/72] gettextize: git-revert literal \"me\" messages","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2011-02-19T19:24:53Z","receivedAt":"2011-02-19T19:24:53Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"Translate messages that use the `me' variable. These are all error\nmessages referencing the command name, so the name shouldn't be\ntranslated.\n\nReported-by: Jonathan Nieder <jrnieder@gmail.com>\nSigned-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n builtin/revert.c |    7 +++++--\n 1 files changed, 5 insertions(+), 2 deletions(-)\n\ndiff --git a/builtin/revert.c b/builtin/revert.c\nindex 02c23c9..b0a5ffb 100644\n--- a/builtin/revert.c\n+++ b/builtin/revert.c\n@@ -362,7 +362,8 @@ static int do_recursive_merge(struct commit *base, struct commit *next,\n \tif (active_cache_changed &&\n \t    (write_cache(index_fd, active_cache, active_nr) ||\n \t     commit_locked_index(&index_lock)))\n-\t\tdie(\"%s: Unable to write new index file\", me);\n+\t\t/* TRANSLATORS: %s will be \"revert\" or \"cherry-pick\" */\n+\t\tdie(_(\"%s: Unable to write new index file\"), me);\n \trollback_lock_file(&index_lock);\n \n \tif (!clean) {\n@@ -469,7 +470,9 @@ static int do_pick_commit(void)\n \t\treturn fast_forward_to(commit->object.sha1, head);\n \n \tif (parent && parse_commit(parent) < 0)\n-\t\tdie(\"%s: cannot parse parent commit %s\",\n+\t\t/* TRANSLATORS: The first %s will be \"revert\" or\n+\t\t   \"cherry-pick\", the second %s a SHA1 */\n+\t\tdie(_(\"%s: cannot parse parent commit %s\"),\n \t\t    me, sha1_to_hex(parent->object.sha1));\n \n \tif (get_message(commit->buffer, &msg) != 0)\n-- \n1.7.2.3\n"},{"id":"161691","messageId":"1298143495-3681-72-git-send-email-avarab@gmail.com","threadId":"26561","inReplyTo":"1298143495-3681-1-git-send-email-avarab@gmail.com","subject":"[PATCH 71/72] gettextize: git-revert split up \"could not revert/apply\" message","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2011-02-19T19:24:54Z","receivedAt":"2011-02-19T19:24:54Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"Split up the \"could not %s %s... %s\" message into \"could not revert\n%s... %s\" and \"could not apply %s... %s\". This makes it easier for\ntranslators to understand the message.\n\nSigned-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n builtin/revert.c                |    5 +++--\n t/t3507-cherry-pick-conflict.sh |    2 +-\n 2 files changed, 4 insertions(+), 3 deletions(-)\n\ndiff --git a/builtin/revert.c b/builtin/revert.c\nindex b0a5ffb..98dfd4d 100644\n--- a/builtin/revert.c\n+++ b/builtin/revert.c\n@@ -536,8 +536,9 @@ static int do_pick_commit(void)\n \t}\n \n \tif (res) {\n-\t\terror(\"could not %s %s... %s\",\n-\t\t      action == REVERT ? \"revert\" : \"apply\",\n+\t\terror(action == REVERT\n+\t\t      ? _(\"could not revert %s... %s\")\n+\t\t      : _(\"could not apply %s... %s\"),\n \t\t      find_unique_abbrev(commit->object.sha1, DEFAULT_ABBREV),\n \t\t      msg.subject);\n \t\tprint_advice();\ndiff --git a/t/t3507-cherry-pick-conflict.sh b/t/t3507-cherry-pick-conflict.sh\nindex 607bf25..bf664ec 100755\n--- a/t/t3507-cherry-pick-conflict.sh\n+++ b/t/t3507-cherry-pick-conflict.sh\n@@ -38,7 +38,7 @@ test_expect_success 'failed cherry-pick does not advance HEAD' '\n \ttest \"$head\" = \"$newhead\"\n '\n \n-test_expect_success 'advice from failed cherry-pick' \"\n+test_expect_success NO_GETTEXT_POISON 'advice from failed cherry-pick' \"\n \tgit checkout -f initial^0 &&\n \tgit read-tree -u --reset HEAD &&\n \tgit clean -d -f -f -q -x &&\n-- \n1.7.2.3\n"},{"id":"161682","messageId":"1298143495-3681-73-git-send-email-avarab@gmail.com","threadId":"26561","inReplyTo":"1298143495-3681-1-git-send-email-avarab@gmail.com","subject":"[PATCH 72/72] gettextize: git-shortlog basic messages","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2011-02-19T19:24:55Z","receivedAt":"2011-02-19T19:24:55Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n builtin/shortlog.c |    8 ++++----\n 1 files changed, 4 insertions(+), 4 deletions(-)\n\ndiff --git a/builtin/shortlog.c b/builtin/shortlog.c\nindex 1a21e4b..f5efc67 100644\n--- a/builtin/shortlog.c\n+++ b/builtin/shortlog.c\n@@ -158,7 +158,7 @@ void shortlog_add_commit(struct shortlog *log, struct commit *commit)\n \t\tbuffer = eol;\n \t}\n \tif (!author)\n-\t\tdie(\"Missing author: %s\",\n+\t\tdie(_(\"Missing author: %s\"),\n \t\t    sha1_to_hex(commit->object.sha1));\n \tif (log->user_format) {\n \t\tstruct pretty_print_context ctx = {0};\n@@ -181,7 +181,7 @@ static void get_from_rev(struct rev_info *rev, struct shortlog *log)\n \tstruct commit *commit;\n \n \tif (prepare_revision_walk(rev))\n-\t\tdie(\"revision walk setup failed\");\n+\t\tdie(_(\"revision walk setup failed\"));\n \twhile ((commit = get_revision(rev)) != NULL)\n \t\tshortlog_add_commit(log, commit);\n }\n@@ -284,7 +284,7 @@ parse_done:\n \targc = parse_options_end(&ctx);\n \n \tif (setup_revisions(argc, argv, &rev, NULL) != 1) {\n-\t\terror(\"unrecognized argument: %s\", argv[1]);\n+\t\terror(_(\"unrecognized argument: %s\"), argv[1]);\n \t\tusage_with_options(shortlog_usage, options);\n \t}\n \n@@ -296,7 +296,7 @@ parse_done:\n \t\tadd_head_to_pending(&rev);\n \tif (rev.pending.nr == 0) {\n \t\tif (isatty(0))\n-\t\t\tfprintf(stderr, \"(reading log message from standard input)\\n\");\n+\t\t\tfprintf(stderr, _(\"(reading log message from standard input)\\n\"));\n \t\tread_from_stdin(&log);\n \t}\n \telse\n-- \n1.7.2.3\n"},{"id":"161724","messageId":"20110220020130.GA17225@elie","threadId":"26561","inReplyTo":"1298143495-3681-2-git-send-email-avarab@gmail.com","subject":"Re: [PATCH 01/72] gettext.h: add no-op _() and N_() wrappers","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2011-02-20T02:01:30Z","receivedAt":"2011-02-20T02:01:30Z","isPatch":true,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"Hi Ævar,\n\nÆvar Arnfjörð Bjarmason wrote:\n\n> Add a new header called gettext.h which is currently a no-op.\n\nThanks.  I'd suggest squashing this with patch #2 (#including\ngettext.h in cache.h).\n\n> --- /dev/null\n> +++ b/gettext.h\n> @@ -0,0 +1,9 @@\n> +/*\n> + * Copyright (c) 2010 Ævar Arnfjörð Bjarmason\n\nIs such a simple header file copyrightable?  But I don't mind.\n\n> + *\n> + * This is a skeleton no-op implementation of gettext for Git. It'll\n> + * be replaced by something that uses libintl.h and wraps gettext() in\n> + * a future patch series.\n> + */\n> +#define N_(s) (s)\n\nMight be nice to make this an inline function, for type safety.\n\n> +#define _(s) (s)\n\nThis one can't be a function, though, since it needs to transform\nliterals to literals.\n\nSome possible tweaks:\n\n - protect against double inclusion\n - make _ into a function\n - add a comment vaguely explaining N_\n - avoid confusing errors if some other header has pre-defined _.\n\nSigned-off-by: Jonathan Nieder <jrnieder@gmail.com>\n---\n gettext.h |   19 +++++++++++++++++--\n 1 files changed, 17 insertions(+), 2 deletions(-)\n\ndiff --git a/gettext.h b/gettext.h\nindex c68bbe9..2f806cb 100644\n--- a/gettext.h\n+++ b/gettext.h\n@@ -1,3 +1,10 @@\n+#ifndef GETTEXT_H\n+#define GETTEXT_H\n+\n+#ifdef _\n+#error \"namespace conflict: '_' is pre-defined?\"\n+#endif\n+\n /*\n  * Copyright (c) 2010 Ævar Arnfjörð Bjarmason\n  *\n@@ -5,5 +12,13 @@\n  * be replaced by something that uses libintl.h and wraps gettext() in\n  * a future patch series.\n  */\n-#define N_(s) (s)\n-#define _(s) (s)\n+\n+static inline const char *_(const char *msgid)\n+{\n+\treturn msgid;\n+}\n+\n+/* Mark msgid for translation but do not translate it. */\n+#define N_(msgid) (msgid)\n+\n+#endif\n-- \n1.7.4.1\n"},{"id":"161725","messageId":"20110220021031.GB17305@elie","threadId":"26561","inReplyTo":"1298143495-3681-4-git-send-email-avarab@gmail.com","subject":"Re: [PATCH 03/72] t/test-lib.sh: add always-set NO_GETTEXT_POISON prerequisite","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2011-02-20T02:10:42Z","receivedAt":"2011-02-20T02:10:42Z","isPatch":true,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"Hi Ævar,\n\nÆvar Arnfjörð Bjarmason wrote:\n\n> Add a new test prerequisite called NO_GETTEXT_POISON to t/test-lib.sh\n> that's always set for now.\n\nSuppose I am writing a new family of tests.  Which of them will need\nthe NO_GETTEXT_POISON prerequisite?  The name doesn't make it easy to\nguess.\n\nIf later the testsuite learns to take a --lang= option to test that\ngit works correctly in my native language, I'd think this same\nprerequisite would be relevant for that, too.  So maybe:\n\nSigned-off-by: Jonathan Nieder <jrnieder@gmail.com>\n---\n t/test-lib.sh |    6 ++----\n 1 files changed, 2 insertions(+), 4 deletions(-)\n\ndiff --git a/t/test-lib.sh b/t/test-lib.sh\nindex ffcfa2e..32004c1 100644\n--- a/t/test-lib.sh\n+++ b/t/test-lib.sh\n@@ -1079,10 +1079,8 @@ esac\n test -z \"$NO_PERL\" && test_set_prereq PERL\n test -z \"$NO_PYTHON\" && test_set_prereq PYTHON\n \n-# Always set the NO_GETTEXT_POISON prerequisite while we don't have a\n-# real gettext implementation in Git. This will be replaced by\n-# something that varies in a future patch series.\n-test_set_prereq NO_GETTEXT_POISON\n+# We can rely on output using the C locale.\n+test_set_prereq ENGLISH\n \n # test whether the filesystem supports symbolic links\n ln -s x y 2>/dev/null && test -h y 2>/dev/null && test_set_prereq SYMLINKS\n-- \n1.7.4.1\n"},{"id":"161726","messageId":"20110220022124.GA17547@elie","threadId":"26561","inReplyTo":"1298143495-3681-5-git-send-email-avarab@gmail.com","subject":"Re: [PATCH 04/72] gettextize: git-init basic messages","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2011-02-20T02:21:24Z","receivedAt":"2011-02-20T02:21:24Z","isPatch":true,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"One more comment.  (The gettextization so far looks good to me.)\n\nÆvar Arnfjörð Bjarmason wrote:\n\n> --- a/builtin/init-db.c\n> +++ b/builtin/init-db.c\n> @@ -31,7 +31,7 @@ static void safe_create_dir(const char *dir, int share)\n>  \t\t}\n>  \t}\n>  \telse if (share && adjust_shared_perm(dir))\n> -\t\tdie(\"Could not make %s writable by group\", dir);\n> +\t\tdie(_(\"Could not make %s writable by group\"), dir);\n\nHmm, forgot to include something like the following in the reply to\npatch 1.\n\n> @@ -346,7 +346,7 @@ int init_db(const char *template_dir, unsigned int flags)\n>  \t\telse if (shared_repository == PERM_EVERYBODY)\n>  \t\t\tsprintf(buf, \"%d\", OLD_PERM_EVERYBODY);\n>  \t\telse\n> -\t\t\tdie(\"oops\");\n> +\t\t\tdie(_(\"oops\"));\n\n(Not related to this series, but that seems like a pretty unhelpful\nerror message.)\n---\n gettext.h |    4 +++-\n 1 files changed, 3 insertions(+), 1 deletions(-)\n\ndiff --git a/gettext.h b/gettext.h\nindex 2f806cb..2bd70d4 100644\n--- a/gettext.h\n+++ b/gettext.h\n@@ -5,6 +5,8 @@\n #error \"namespace conflict: _ is pre-defined?\"\n #endif\n \n+#define FORMAT_PRESERVING(n) __attribute__((format_arg(n)))\n+\n /*\n  * Copyright (c) 2010 Ævar Arnfjörð Bjarmason\n  *\n@@ -13,7 +15,7 @@\n  * a future patch series.\n  */\n \n-static inline const char *_(const char *msgid)\n+static inline FORMAT_PRESERVING(1) const char *_(const char *msgid)\n {\n \treturn msgid;\n }\n-- \n1.7.4.1\n"},{"id":"161748","messageId":"AANLkTikkTUD=ih_KHxZ-F2gm_rNTfJ0E3Z6WXSLHBCnd@mail.gmail.com","threadId":"26561","inReplyTo":"20110220020130.GA17225@elie","subject":"Re: [PATCH 01/72] gettext.h: add no-op _() and N_() wrappers","fromName":"Erik Faye-Lund","fromEmail":"kusmabite@gmail.com","sentAt":"2011-02-20T10:13:52Z","receivedAt":"2011-02-20T10:13:52Z","isPatch":true,"sender":{"key":"kusmabite@gmail.com","avatar":"https://avatars.githubusercontent.com/u/47073?v=4"},"body":"On Sun, Feb 20, 2011 at 3:01 AM, Jonathan Nieder <jrnieder@gmail.com> wrote:\n> Ævar Arnfjörð Bjarmason wrote:\n>> +#define N_(s) (s)\n>\n> Might be nice to make this an inline function, for type safety.\n>\n>> +#define _(s) (s)\n>\n> This one can't be a function, though, since it needs to transform\n> literals to literals.\n>\n...\n> -#define N_(s) (s)\n> -#define _(s) (s)\n> +\n> +static inline const char *_(const char *msgid)\n> +{\n> +       return msgid;\n> +}\n> +\n> +/* Mark msgid for translation but do not translate it. */\n> +#define N_(msgid) (msgid)\n\nIsn't this the opposite of what you suggested above?\n"},{"id":"161749","messageId":"20110220103458.GB9340@elie","threadId":"26561","inReplyTo":"AANLkTikkTUD=ih_KHxZ-F2gm_rNTfJ0E3Z6WXSLHBCnd@mail.gmail.com","subject":"Re: [PATCH 01/72] gettext.h: add no-op _() and N_() wrappers","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2011-02-20T10:34:58Z","receivedAt":"2011-02-20T10:34:58Z","isPatch":true,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"Erik Faye-Lund wrote:\n> On Sun, Feb 20, 2011 at 3:01 AM, Jonathan Nieder <jrnieder@gmail.com> wrote:\n>> Ævar Arnfjörð Bjarmason wrote:\n\n>>> +#define N_(s) (s)\n>>\n>> Might be nice to make this an inline function, for type safety.\n>>\n>>> +#define _(s) (s)\n>>\n>> This one can't be a function, though, since it needs to transform\n>> literals to literals.\n[...]\n>> +/* Mark msgid for translation but do not translate it. */\n>> +#define N_(msgid) (msgid)\n>\n> Isn't this the opposite of what you suggested above?\n\nAgh.  I mixed up the snippets from Ævar’s message.\n\nN_ needs to take literals to literals, so even the non-stub version would\nbe defined as\n\n\t#define N_(msgid) (msgid)\n\nfor use in contexts like\n\n\tconst char *unpack_plumbing_errors[NB_UNPACK_TREES_ERROR_TYPES] = {\n\t\t/* ERROR_WOULD_OVERWRITE */\n\t\tN_(\"Entry '%s' would be overwritten by merge. Cannot merge.\"),\n\n\t\t/* ERROR_NOT_UPTODATE_FILE */\n\t\tN_(\"Entry '%s' not uptodate. Cannot merge.\"),\n\t[...]\n\nMeanwhile, in the non-stub version, _ is a synonym for the gettext()\nfunction.\n\nSorry for the noise.\nJonathan\n"},{"id":"161756","messageId":"AANLkTik9ieR=pWLQ9JEabNm2trSsyfFuYgfKMojnbzfb@mail.gmail.com","threadId":"26561","inReplyTo":"20110220021031.GB17305@elie","subject":"Re: [PATCH 03/72] t/test-lib.sh: add always-set NO_GETTEXT_POISON prerequisite","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2011-02-20T12:42:20Z","receivedAt":"2011-02-20T12:42:20Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"On Sun, Feb 20, 2011 at 03:10, Jonathan Nieder <jrnieder@gmail.com> wrote:\n> Hi Ævar,\n>\n> Ævar Arnfjörð Bjarmason wrote:\n>\n>> Add a new test prerequisite called NO_GETTEXT_POISON to t/test-lib.sh\n>> that's always set for now.\n>\n> Suppose I am writing a new family of tests.  Which of them will need\n> the NO_GETTEXT_POISON prerequisite?  The name doesn't make it easy to\n> guess.\n\nYou shouldn't worry about it for now. FWIW NO_GETTEXT_POISON is\ndocumented in po/README in a patch that I plan to submit later.\n\nNO_GETTEXT_POISON is only relevant to people such as myself who are\nadding new translations to the source. I.e. changing \"foo\" to\n_(\"foo\"). It's a sanity check to make sure that by doing so you're not\nchanging some plumbing test, or at least have to realize what it is\nthat you're changing.\n\nIt's not perfect since we don't have tests for everything, but it's\nhelped me a few times.\n\n> If later the testsuite learns to take a --lang= option to test that\n> git works correctly in my native language.\n\nYeah, I plan to add something like --lang later, but for now we have\nPOISON :)\n\n> -# Always set the NO_GETTEXT_POISON prerequisite while we don't have a\n> -# real gettext implementation in Git. This will be replaced by\n> -# something that varies in a future patch series.\n> -test_set_prereq NO_GETTEXT_POISON\n> +# We can rely on output using the C locale.\n> +test_set_prereq ENGLISH\n\nIt's explicitly about tests that can't deal with poison, not\nnon-English. See this comment in patch  28/72:\n\n    gettextize: git-commit \"enter the commit message\" message\n\n    Gettextize the \"# Please enter the commit message for your changes.\"\n    message. Several tests in t7500-commit.sh and t7502-commit.sh assume\n    that this message starts with a newline. Change the tests to to skip\n    under GETTEXT_POISON=YesPlease.\n\n    These fail under GETTEXT_POISON=YesPlease because the poison editor\n    message doesn't do the right thing with comments and line breaks, so\n    these messages will be incorrectly broken up across lines.\n\n    This test should not be skipped under a hypothetical future testing\n    mode that tests Git under language locales, since those messages\n    should all start with a newline like the original.\n"},{"id":"161762","messageId":"AANLkTinZSpz=H9dt6kRDhOtght_YB4qVpw5WENEYmaQZ@mail.gmail.com","threadId":"26561","inReplyTo":"20110220020130.GA17225@elie","subject":"Re: [PATCH 01/72] gettext.h: add no-op _() and N_() wrappers","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2011-02-20T21:11:51Z","receivedAt":"2011-02-20T21:11:51Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"On Sun, Feb 20, 2011 at 03:01, Jonathan Nieder <jrnieder@gmail.com> wrote:\n\n> Ævar Arnfjörð Bjarmason wrote:\n>\n>> Add a new header called gettext.h which is currently a no-op.\n>\n> Thanks.  I'd suggest squashing this with patch #2 (#including\n> gettext.h in cache.h).\n>\n>> --- /dev/null\n>> +++ b/gettext.h\n>> @@ -0,0 +1,9 @@\n>> +/*\n>> + * Copyright (c) 2010 Ævar Arnfjörð Bjarmason\n>\n> Is such a simple header file copyrightable?  But I don't mind.\n>\n>> + *\n>> + * This is a skeleton no-op implementation of gettext for Git. It'll\n>> + * be replaced by something that uses libintl.h and wraps gettext() in\n>> + * a future patch series.\n>> + */\n>> +#define N_(s) (s)\n>\n> Might be nice to make this an inline function, for type safety.\n>\n>> +#define _(s) (s)\n>\n> This one can't be a function, though, since it needs to transform\n> literals to literals.\n>\n> Some possible tweaks:\n>\n>  - protect against double inclusion\n>  - make _ into a function\n>  - add a comment vaguely explaining N_\n>  - avoid confusing errors if some other header has pre-defined _.\n>\n> Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>\n> ---\n>  gettext.h |   19 +++++++++++++++++--\n>  1 files changed, 17 insertions(+), 2 deletions(-)\n>\n> diff --git a/gettext.h b/gettext.h\n> index c68bbe9..2f806cb 100644\n> --- a/gettext.h\n> +++ b/gettext.h\n> @@ -1,3 +1,10 @@\n> +#ifndef GETTEXT_H\n> +#define GETTEXT_H\n> +\n> +#ifdef _\n> +#error \"namespace conflict: '_' is pre-defined?\"\n> +#endif\n> +\n>  /*\n>  * Copyright (c) 2010 Ævar Arnfjörð Bjarmason\n>  *\n> @@ -5,5 +12,13 @@\n>  * be replaced by something that uses libintl.h and wraps gettext() in\n>  * a future patch series.\n>  */\n> -#define N_(s) (s)\n> -#define _(s) (s)\n> +\n> +static inline const char *_(const char *msgid)\n> +{\n> +       return msgid;\n> +}\n> +\n> +/* Mark msgid for translation but do not translate it. */\n> +#define N_(msgid) (msgid)\n> +\n> +#endif\n\nThanks for this. This was raised earlier in the discussion for this\nseries (by you, IIRC). I've considered it, and while I see your point\n(type safety = good) I think I like my way of doing it better.\n\nThe _() macro/function is usually a macro and not a function. The good\nthing about this is that I can prove that it's a no-op on all\ncompilers, whereas if it's an inline function (stupid) compilers will\nactually make it into a function, which'll result in overhead,\nwhich'll mean I can't advertise this series as a \"no-op\" anymore.\n\nCheck out some of the recent work in perl.git for reference. There's\nnow a probe in perl which check is the compiler can *really* handle\ninline functions, and if not perl will fall back on using macros.\n\nI'd rather not use inline functions for every string in Git without\nsuch a probe, especially since it's for a very marginal gain. Using\n_() for non-strings isn't going to make it past the list, and if it's\nused with e.g. multiple arguments compilers will already whine about\nit.\n\nSo that's why I didn't do it. But if everyone else feels strongly\nabout it I'll change my mind, I don't care *that* much about it, but\nI'd prefer a macro.\n"},{"id":"161763","messageId":"20110220215533.GB32142@elie","threadId":"26561","inReplyTo":"AANLkTik9ieR=pWLQ9JEabNm2trSsyfFuYgfKMojnbzfb@mail.gmail.com","subject":"Re: [PATCH 03/72] t/test-lib.sh: add always-set NO_GETTEXT_POISON prerequisite","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2011-02-20T21:55:33Z","receivedAt":"2011-02-20T21:55:33Z","isPatch":true,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"Ævar Arnfjörð Bjarmason wrote:\n\n> It's explicitly about tests that can't deal with poison, not\n> non-English. See this comment in patch  28/72:\n>\n>     gettextize: git-commit \"enter the commit message\" message\n>\n>     Gettextize the \"# Please enter the commit message for your changes.\"\n>     message. Several tests in t7500-commit.sh and t7502-commit.sh assume\n>     that this message starts with a newline. Change the tests to to skip\n>     under GETTEXT_POISON=YesPlease.\n\nShouldn't the functional part (the starting newline, opening # marks)\nbe untranslatable then, to avoid making a trap for translators?  Such\na fix could happen at any time, and until then, we could skip those\ntests in the non-English case.\n\nSince that codepath requires human intervention anyway (which is\ngenerally slow), I can't imagine doing that would hurt runtime\nperformance enough to matter.\n\nBut I do get your point --- perhaps in some other circumstance we have\nto rely on some intelligence by the translator for correct behavior.\nSo maybe it means something along the lines of\n\n\ttest_set_prereq SANE_TRANSLATION\n\n?\n"},{"id":"161764","messageId":"20110220220311.GC32142@elie","threadId":"26561","inReplyTo":"AANLkTinZSpz=H9dt6kRDhOtght_YB4qVpw5WENEYmaQZ@mail.gmail.com","subject":"Re: [PATCH 01/72] gettext.h: add no-op _() and N_() wrappers","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2011-02-20T22:03:11Z","receivedAt":"2011-02-20T22:03:11Z","isPatch":true,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"Ævar Arnfjörð Bjarmason wrote:\n\n> Thanks for this. This was raised earlier in the discussion for this\n> series (by you, IIRC). I've considered it, and while I see your point\n> (type safety = good) I think I like my way of doing it better.\n>\n> The _() macro/function is usually a macro and not a function. The good\n> thing about this is that I can prove that it's a no-op on all\n> compilers, whereas if it's an inline function (stupid) compilers will\n> actually make it into a function, which'll result in overhead,\n> which'll mean I can't advertise this series as a \"no-op\" anymore.\n\nI hope we don't support (meaning \"worry about\") such stupid compilers?\n\nAt least I haven't seen this being a consideration in deciding whether\nto split out inline functions in the past.  Perl is much more portable\nthan git, and that seems perfectly fine to me.\n\n> So that's why I didn't do it. But if everyone else feels strongly\n> about it I'll change my mind, I don't care *that* much about it, but\n> I'd prefer a macro.\n\nI think it's perfectly possible there's some aesthetic or functional\nreason to make this a macro instead of a function, and that would be\nfine with me.  On the other hand, if there's no reason, then I do feel\nstrongly about it, fwiw.  New code should set a good example.\n\nThanks for your thoughtfulness.\nJonathan\n"},{"id":"161765","messageId":"AANLkTikJbwp+-=sgX2RLo-aXA_gmmO2gLsC=+MxEYxXg@mail.gmail.com","threadId":"26561","inReplyTo":"20110220215533.GB32142@elie","subject":"Re: [PATCH 03/72] t/test-lib.sh: add always-set NO_GETTEXT_POISON prerequisite","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2011-02-20T22:05:31Z","receivedAt":"2011-02-20T22:05:31Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"On Sun, Feb 20, 2011 at 22:55, Jonathan Nieder <jrnieder@gmail.com> wrote:\n> Ævar Arnfjörð Bjarmason wrote:\n>\n>> It's explicitly about tests that can't deal with poison, not\n>> non-English. See this comment in patch  28/72:\n>>\n>>     gettextize: git-commit \"enter the commit message\" message\n>>\n>>     Gettextize the \"# Please enter the commit message for your changes.\"\n>>     message. Several tests in t7500-commit.sh and t7502-commit.sh assume\n>>     that this message starts with a newline. Change the tests to to skip\n>>     under GETTEXT_POISON=YesPlease.\n>\n> Shouldn't the functional part (the starting newline, opening # marks)\n> be untranslatable then, to avoid making a trap for translators?  Such\n> a fix could happen at any time, and until then, we could skip those\n> tests in the non-English case.\n\nI'm aiming to make this as minimal as possible, so I'm not going to\nchange the code to start constructing string buffers where we\npreviously had literals in this iteration.\n\nAnd the trap is minimimal, sinc msgfmt --check will warn if the\nstructure of the newlines in the translation is different.\n\n> Since that codepath requires human intervention anyway (which is\n> generally slow), I can't imagine doing that would hurt runtime\n> performance enough to matter.\n>\n> But I do get your point --- perhaps in some other circumstance we have\n> to rely on some intelligence by the translator for correct behavior.\n> So maybe it means something along the lines of\n>\n>        test_set_prereq SANE_TRANSLATION\n\nWell, the feature I have is to inject garbage into the gettext strings\nin an effort to smoke out when I break the plumbing. So I think given\nthat functionality calling it NO_GETTEXT_POISON makes sense.\n\nBut I plan to add something to smoke other languages etc. later. Then\nI might name that other prerequisite something else.\n"},{"id":"161766","messageId":"20110220221033.GD32142@elie","threadId":"26561","inReplyTo":"AANLkTikJbwp+-=sgX2RLo-aXA_gmmO2gLsC=+MxEYxXg@mail.gmail.com","subject":"Re: [PATCH 03/72] t/test-lib.sh: add always-set NO_GETTEXT_POISON prerequisite","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2011-02-20T22:10:33Z","receivedAt":"2011-02-20T22:10:33Z","isPatch":true,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"Ævar Arnfjörð Bjarmason wrote:\n\n> Well, the feature I have is to inject garbage into the gettext strings\n> in an effort to smoke out when I break the plumbing. So I think given\n> that functionality calling it NO_GETTEXT_POISON makes sense.\n>\n> But I plan to add something to smoke other languages etc. later. Then\n> I might name that other prerequisite something else.\n\nOn second thought, another possibility would be _two_ prerequisites,\none NO_GETTEXT_POISON one and one ENGLISH one.  The weird edge cases\ncould require NO_GETTEXT_POISON, causing the reader to look to\nt/README to figure out what is going on.  The others would just use\nENGLISH.\n\nDoes that sound reasonable?\n"},{"id":"161767","messageId":"AANLkTikRv9BGWXrf5u7xptgZ9hajeju-QU7WS9Zj3sYP@mail.gmail.com","threadId":"26561","inReplyTo":"20110220221033.GD32142@elie","subject":"Re: [PATCH 03/72] t/test-lib.sh: add always-set NO_GETTEXT_POISON prerequisite","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2011-02-20T22:31:10Z","receivedAt":"2011-02-20T22:31:10Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"On Sun, Feb 20, 2011 at 23:10, Jonathan Nieder <jrnieder@gmail.com> wrote:\n> Ævar Arnfjörð Bjarmason wrote:\n>\n>> Well, the feature I have is to inject garbage into the gettext strings\n>> in an effort to smoke out when I break the plumbing. So I think given\n>> that functionality calling it NO_GETTEXT_POISON makes sense.\n>>\n>> But I plan to add something to smoke other languages etc. later. Then\n>> I might name that other prerequisite something else.\n>\n> On second thought, another possibility would be _two_ prerequisites,\n> one NO_GETTEXT_POISON one and one ENGLISH one.  The weird edge cases\n> could require NO_GETTEXT_POISON, causing the reader to look to\n> t/README to figure out what is going on.  The others would just use\n> ENGLISH.\n>\n> Does that sound reasonable?\n\nYes, I suggested implementing that in the \"enter the commit message\"\npatch, but since we don't have a 100% translation yet I was going to\nwait until then.\n\nIt's also a very low priority, the point of these tests is to make\nsure I don't make a plumbing message translatable. The things that\nstart failing under a testing mode like ENGLISH are by definition a\nsubset of the things that'll start failing under NO_GETTEXT_POISON. So\nthere's not a lot of incentive for me to implement that.\n\nThe only reason I can think of to have it is to make sure that\nmessages like the \"enter the commit message\" ones have the correct\nnewlines in all languages, but msgfmt --check catches that anyway, or\nto somehow test Git's output in different languages, but I'd rather do\nthat differently (not test output, but behavior).\n\nSo given all of the above I might never get around to implementing it.\n"},{"id":"161768","messageId":"20110220223600.GB32455@elie","threadId":"26561","inReplyTo":"AANLkTikRv9BGWXrf5u7xptgZ9hajeju-QU7WS9Zj3sYP@mail.gmail.com","subject":"Re: [PATCH 03/72] t/test-lib.sh: add always-set NO_GETTEXT_POISON prerequisite","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2011-02-20T22:36:00Z","receivedAt":"2011-02-20T22:36:00Z","isPatch":true,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"Ævar Arnfjörð Bjarmason wrote:\n\n> The only reason I can think of to have it is to make sure that\n> messages like the \"enter the commit message\" ones have the correct\n> newlines in all languages, but msgfmt --check catches that anyway, or\n> to somehow test Git's output in different languages, but I'd rather do\n> that differently (not test output, but behavior).\n>\n> So given all of the above I might never get around to implementing it.\n\nI guess I'm confused.  I've been saying (repeatedly, and probably\nannoyingly) that anyone seeing the NO_GETTEXT_POISON prereq for the\nfirst time isn't going to have any clue what it means.  I think that's\na problem.  Do you not think so?\n"},{"id":"161770","messageId":"20110221040012.GB26968@elie","threadId":"26561","inReplyTo":"1298143495-3681-1-git-send-email-avarab@gmail.com","subject":"[PATCH v2 0/3] No-op C gettext wrappers","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2011-02-21T04:00:23Z","receivedAt":"2011-02-21T04:00:23Z","isPatch":true,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"Hi,\n\nÆvar Arnfjörð Bjarmason wrote:\n\n> As discussed on-list previously I'm remaking the gettext series in a\n> form that'll be easier to swallow.\n\nHere's a reroll of the skeleton gettext.h wrapper as requested.\nI'll send some gettextization patches in a separate series, time\npermitting.\n\nChanges from v1:\n\n - renamed NO_GETTEXT_POISON prereq to C_LOCALE_OUTPUT.  This should\n   make it possible to reuse that prereq is the test suite ever\n   learns a --lang option.  Hopefully this will also make it easier\n   for authors of new tests to tell whether that prereq needs to be\n   set.\n - GETTEXT_POISON can be enabled or disabled at runtime\n - _() is an inline function to catch misuses like\n\n   const char *some_strings[] = { _(\"foo\"), _(\"bar\"), _(\"baz\") };\n - combined some patches, tweaked commit messages\n\nThoughts welcome, as always.\nJonathan Nieder (1):\n  tests: let GETTEXT_POISON be disabled at run time\n\nÆvar Arnfjörð Bjarmason (2):\n  i18n: add no-op _() and N_() wrappers\n  tests: add GETTEXT_POISON to simulate unfriendly translator\n\n Makefile      |    9 +++++++++\n cache.h       |    1 +\n gettext.c     |   14 ++++++++++++++\n gettext.h     |   32 ++++++++++++++++++++++++++++++++\n t/test-lib.sh |    9 +++++++++\n 5 files changed, 65 insertions(+), 0 deletions(-)\n create mode 100644 gettext.c\n create mode 100644 gettext.h\n"},{"id":"161771","messageId":"20110221040205.GC26968@elie","threadId":"26561","inReplyTo":"20110221040012.GB26968@elie","subject":"[PATCH 1/3] i18n: add no-op _() and N_() wrappers","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2011-02-21T04:02:05Z","receivedAt":"2011-02-21T04:02:05Z","isPatch":true,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"From: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n\nThe _ function is meant to be used to translate strings into the\nuser's chosen language.\n\nThe N_ macro is a marker for xgettext to find translatable strings\nin contexts where a function call cannot be used directly, like so:\n\n\tconst char *unpack_plumbing_errors[NB_UNPACK_TREES_ERROR_TYPES] = {\n\t\t/* ERROR_WOULD_OVERWRITE */\n\t\tN_(\"Entry '%s' would be overwritten by merge. Cannot merge.\"),\n\t[...]\n\nIts result is still untranslated and should be fed to _ before it\nis printed.\n\nMaking _ a function and N_ a macro avoids the temptation to use\n_(\"foo\") instead of N_(\"foo\") as a string literal.\n\nDefine these in a new gettext.h and include it in cache.h, so they can\nbe used everywhere.  They just return their argument for now.  To\nsplit up the gettext series I'm first submitting patches to gettextize\nthe source tree before I add any of the Makefile and C changes needed\nto actually use translations.\n\nSigned-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\nSigned-off-by: Jonathan Nieder <jrnieder@gmail.com>\n---\n Makefile  |    1 +\n cache.h   |    1 +\n gettext.h |   26 ++++++++++++++++++++++++++\n 3 files changed, 28 insertions(+), 0 deletions(-)\n create mode 100644 gettext.h\n\ndiff --git a/Makefile b/Makefile\nindex ade7923..c153f45 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -515,6 +515,7 @@ LIB_H += diff.h\n LIB_H += dir.h\n LIB_H += exec_cmd.h\n LIB_H += fsck.h\n+LIB_H += gettext.h\n LIB_H += git-compat-util.h\n LIB_H += graph.h\n LIB_H += grep.h\ndiff --git a/cache.h b/cache.h\nindex 3abf895..a465f38 100644\n--- a/cache.h\n+++ b/cache.h\n@@ -5,6 +5,7 @@\n #include \"strbuf.h\"\n #include \"hash.h\"\n #include \"advice.h\"\n+#include \"gettext.h\"\n \n #include SHA1_HEADER\n #ifndef git_SHA_CTX\ndiff --git a/gettext.h b/gettext.h\nnew file mode 100644\nindex 0000000..dc44825\n--- /dev/null\n+++ b/gettext.h\n@@ -0,0 +1,26 @@\n+#ifndef GETTEXT_H\n+#define GETTEXT_H\n+\n+/*\n+ * Copyright (c) 2010 Ævar Arnfjörð Bjarmason\n+ *\n+ * This is a skeleton no-op implementation of gettext for Git.\n+ * You can replace it with something that uses libintl.h and wraps\n+ * gettext() to try out the translations.\n+ */\n+\n+#ifdef _\n+#error \"namespace conflict: '_' is pre-defined?\"\n+#endif\n+\n+#define FORMAT_PRESERVING(n) __attribute__((format_arg(n)))\n+\n+static inline FORMAT_PRESERVING(1) const char *_(const char *msgid)\n+{\n+\treturn msgid;\n+}\n+\n+/* Mark msgid for translation but do not translate it. */\n+#define N_(msgid) (msgid)\n+\n+#endif\n-- \n1.7.4.1\n"},{"id":"161772","messageId":"20110221040313.GD26968@elie","threadId":"26561","inReplyTo":"20110221040012.GB26968@elie","subject":"[PATCH 2/3] tests: add GETTEXT_POISON to simulate unfriendly translator","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2011-02-21T04:03:13Z","receivedAt":"2011-02-21T04:03:13Z","isPatch":true,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"From: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n\nAdd a new GETTEXT_POISON Makefile parameter.  When it is set, every\ninvocation of _(s) will return a nonsense string instead of 's' or an\nactual translation of 's'.  By setting this parameter, we can make\nsure that none of the strings marked for translation are functionally\nimportant.\n\nWhen tests are checking specific (US English) output from Git, they\nshould add a C_LOCALE_OUTPUT prerequisite.  Running through tests in\nthis way can help to find messages that should not be translated\nbecause they are part of the git plumbing.\n\nThe poison string is \"# GETTEXT POISON #\", so it is still a valid\ncomment that is safe to put at the end of the message shown by 'git\ncommit --amend' and so on.  That simplifies life until git can learn\nto add the \"# \" comment markers itself instead of relying on\ntranslators to remember them.\n\nSigned-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\nSigned-off-by: Jonathan Nieder <jrnieder@gmail.com>\n---\n Makefile      |    7 +++++++\n gettext.h     |    8 +++++++-\n t/test-lib.sh |    3 +++\n 3 files changed, 17 insertions(+), 1 deletions(-)\n\ndiff --git a/Makefile b/Makefile\nindex c153f45..c348bb7 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -216,6 +216,9 @@ all::\n #\n # Define NO_REGEX if you have no or inferior regex support in your C library.\n #\n+# Define GETTEXT_POISON if you are debugging the choice of strings marked\n+# for translation.  This will turn all strings that use gettext into gibberish.\n+#\n # Define JSMIN to point to JavaScript minifier that functions as\n # a filter to have gitweb.js minified.\n #\n@@ -1370,6 +1373,9 @@ endif\n ifdef NO_SYMLINK_HEAD\n \tBASIC_CFLAGS += -DNO_SYMLINK_HEAD\n endif\n+ifdef GETTEXT_POISON\n+\tBASIC_CFLAGS += -DGETTEXT_POISON\n+endif\n ifdef NO_STRCASESTR\n \tCOMPAT_CFLAGS += -DNO_STRCASESTR\n \tCOMPAT_OBJS += compat/strcasestr.o\n@@ -2089,6 +2095,7 @@ endif\n ifdef GIT_TEST_CMP_USE_COPIED_CONTEXT\n \t@echo GIT_TEST_CMP_USE_COPIED_CONTEXT=YesPlease >>$@\n endif\n+\t@echo GETTEXT_POISON=\\''$(subst ','\\'',$(subst ','\\'',$(GETTEXT_POISON)))'\\' >>$@\n \n ### Detect Tck/Tk interpreter path changes\n ifndef NO_TCLTK\ndiff --git a/gettext.h b/gettext.h\nindex dc44825..6daa57c 100644\n--- a/gettext.h\n+++ b/gettext.h\n@@ -15,9 +15,15 @@\n \n #define FORMAT_PRESERVING(n) __attribute__((format_arg(n)))\n \n+#ifdef GETTEXT_POISON\n+#define use_poison() 1\n+#else\n+#define use_poison() 0\n+#endif\n+\n static inline FORMAT_PRESERVING(1) const char *_(const char *msgid)\n {\n-\treturn msgid;\n+\treturn use_poison() ? \"# GETTEXT POISON #\" : msgid;\n }\n \n /* Mark msgid for translation but do not translate it. */\ndiff --git a/t/test-lib.sh b/t/test-lib.sh\nindex 0fdc541..0840e4a 100644\n--- a/t/test-lib.sh\n+++ b/t/test-lib.sh\n@@ -1079,6 +1079,9 @@ esac\n test -z \"$NO_PERL\" && test_set_prereq PERL\n test -z \"$NO_PYTHON\" && test_set_prereq PYTHON\n \n+# Can we rely on git's output in the C locale?\n+test -z \"$GETTEXT_POISON\" && test_set_prereq C_LOCALE_OUTPUT\n+\n # test whether the filesystem supports symbolic links\n ln -s x y 2>/dev/null && test -h y 2>/dev/null && test_set_prereq SYMLINKS\n rm -f y\n-- \n1.7.4.1\n"},{"id":"161773","messageId":"20110221040517.GE26968@elie","threadId":"26561","inReplyTo":"20110221040012.GB26968@elie","subject":"[PATCH 3/3] tests: let GETTEXT_POISON be disabled at run time","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2011-02-21T04:05:17Z","receivedAt":"2011-02-21T04:05:17Z","isPatch":true,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"Do not poison translations unless the GIT_GETTEXT_POISON environment\nvariable is set.  This way, a copy of git with GETTEXT_POISON set is\nstill generally usable and testers can avoid building two copies of\ngit to compare behavior with and without poison.\n\nSigned-off-by: Jonathan Nieder <jrnieder@gmail.com>\n---\nThanks again for your help.  Hopefully that turned out okay.  Please\nfeel free to ack or complain to indicate either way.\n\n Makefile      |    1 +\n gettext.c     |   14 ++++++++++++++\n gettext.h     |    2 +-\n t/test-lib.sh |    8 +++++++-\n 4 files changed, 23 insertions(+), 2 deletions(-)\n create mode 100644 gettext.c\n\ndiff --git a/Makefile b/Makefile\nindex c348bb7..142ed86 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -1374,6 +1374,7 @@ ifdef NO_SYMLINK_HEAD\n \tBASIC_CFLAGS += -DNO_SYMLINK_HEAD\n endif\n ifdef GETTEXT_POISON\n+\tLIB_OBJS += gettext.o\n \tBASIC_CFLAGS += -DGETTEXT_POISON\n endif\n ifdef NO_STRCASESTR\ndiff --git a/gettext.c b/gettext.c\nnew file mode 100644\nindex 0000000..9688c8b\n--- /dev/null\n+++ b/gettext.c\n@@ -0,0 +1,14 @@\n+/*\n+ * Copyright (c) 2010 Ævar Arnfjörð Bjarmason\n+ */\n+\n+#include \"git-compat-util.h\"\n+#include \"gettext.h\"\n+\n+int use_poison(void)\n+{\n+\tstatic int poison_requested = -1;\n+\tif (poison_requested == -1)\n+\t\tpoison_requested = getenv(\"GIT_GETTEXT_POISON\") ? 1 : 0;\n+\treturn poison_requested;\n+}\ndiff --git a/gettext.h b/gettext.h\nindex 6daa57c..051bf11 100644\n--- a/gettext.h\n+++ b/gettext.h\n@@ -16,7 +16,7 @@\n #define FORMAT_PRESERVING(n) __attribute__((format_arg(n)))\n \n #ifdef GETTEXT_POISON\n-#define use_poison() 1\n+extern int use_poison(void);\n #else\n #define use_poison() 0\n #endif\ndiff --git a/t/test-lib.sh b/t/test-lib.sh\nindex 0840e4a..f4c1e04 100644\n--- a/t/test-lib.sh\n+++ b/t/test-lib.sh\n@@ -1080,7 +1080,13 @@ test -z \"$NO_PERL\" && test_set_prereq PERL\n test -z \"$NO_PYTHON\" && test_set_prereq PYTHON\n \n # Can we rely on git's output in the C locale?\n-test -z \"$GETTEXT_POISON\" && test_set_prereq C_LOCALE_OUTPUT\n+if test -n \"$GETTEXT_POISON\"\n+then\n+\tGIT_GETTEXT_POISON=YesPlease\n+\texport GIT_GETTEXT_POISON\n+else\n+\ttest_set_prereq C_LOCALE_OUTPUT\n+fi\n \n # test whether the filesystem supports symbolic links\n ln -s x y 2>/dev/null && test -h y 2>/dev/null && test_set_prereq SYMLINKS\n-- \n1.7.4.1\n"},{"id":"161776","messageId":"7vipwdlvtt.fsf@alter.siamese.dyndns.org","threadId":"26561","inReplyTo":"AANLkTik9ieR=pWLQ9JEabNm2trSsyfFuYgfKMojnbzfb@mail.gmail.com","subject":"Re: [PATCH 03/72] t/test-lib.sh: add always-set NO_GETTEXT_POISON prerequisite","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2011-02-21T06:56:30Z","receivedAt":"2011-02-21T06:56:30Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Ævar Arnfjörð Bjarmason <avarab@gmail.com> writes:\n\n> You shouldn't worry about it for now. FWIW NO_GETTEXT_POISON is\n> documented in po/README in a patch that I plan to submit later.\n>\n> NO_GETTEXT_POISON is only relevant to people such as myself who are\n> adding new translations to the source. I.e. changing \"foo\" to\n> _(\"foo\"). It's a sanity check to make sure that by doing so you're not\n> changing some plumbing test, or at least have to realize what it is\n> that you're changing.\n\nI also had the same reaction to NO_GETTEXT_POISON as Jonathan, and your\nabove argument is not quite right.\n\nGETTEXT_POISON _is_ relevant to people like you who are working on the\ni18n part of the system.  It is a debugging aid to make sure that you are\nnot marking plumbing messages that should never be translated.\n\nBut you cannot say NO_GETTEXT_POISON is not relevant to others; everybody\nelse who is not actively working on i18n needs to be aware of it, and\nneeds to be careful when writing his tests.  When your test depends on\noutput from Porcelain (which is not something we should encourage, but\nthat is a separate matter), you need to mark that test as \"this test will\nbe broken under GETTEXT_POISON build\".\n\n\"This test requires NO_GETTEXT_POISON pre-requisite, which is only true\nwhen git is built without GETTEXT_POISON\" makes logical sense as a\nstatement, but it feels somewhat a roundabout way to explain it.\n\nThis is somewhat a tangent, but I've been wondering if it might be a\nbetter design to make GETTEXT_POISON a runtime thing.  When git is run\nwith GIT_LOCALE=POISON, \"_(msg)\" will all result in gibberish or rot13,\nand instead of building a special test-only binary, always compile i18n\nversion of git that way.\n"},{"id":"161781","messageId":"20110221091921.GB23238@elie","threadId":"26561","inReplyTo":"1298143495-3681-8-git-send-email-avarab@gmail.com","subject":"Re: [PATCH 07/72] gettextize: git-clone \"Cloning into\" message","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2011-02-21T09:19:35Z","receivedAt":"2011-02-21T09:19:35Z","isPatch":true,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"Ævar Arnfjörð Bjarmason wrote:\n\n> --- a/builtin/clone.c\n> +++ b/builtin/clone.c\n> @@ -468,9 +468,12 @@ int cmd_clone(int argc, const char **argv, const char *prefix)\n>  \t\tdie(_(\"could not create leading directories of '%s'\"), git_dir);\n>  \tset_git_dir(make_absolute_path(git_dir));\n>  \n> -\tif (0 <= option_verbosity)\n> -\t\tprintf(\"Cloning into %s%s...\\n\",\n> -\t\t       option_bare ? \"bare repository \" : \"\", dir);\n> +\tif (0 <= option_verbosity) {\n> +\t\tif (option_bare)\n> +\t\t\tprintf(_(\"Cloning into bare repository %s\\n\"), dir);\n> +\t\telse\n> +\t\t\tprintf(_(\"Cloning into %s\\n\"), dir);\n> +\t}\n\nAn ellipsis seems to have been lost.  I wonder if there is some easy\n(automated, ideally) way to check these patches.\n"},{"id":"161788","messageId":"20110221101229.GA32137@elie","threadId":"26561","inReplyTo":"20110221040012.GB26968@elie","subject":"[PATCH v3 00/15] Mark \"init\", \"clone\", and \"add\" output for translation","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2011-02-21T10:12:29Z","receivedAt":"2011-02-21T10:12:29Z","isPatch":true,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"Hi again,\n\nTo make the primitives introduced by v2 more concrete, here's a series\nincluding a few gettextization patches.  I don't plan to send more of\nthese unless there is some agreement that the basic structure is\nright.  Maybe by next time I'll hunker down and write myself a tool to\ncheck that a commit only inserts \"_(\"-\")\" pairs (maybe using diff\n--word-diff?)\n\nThis series still includes the skeleton gettext.h wrapper.\n\nChanges from v1:\n\n - clearer commit messages, hopefully\n - clearer documentation for GETTEXT_POISON in the makefile\n\nPlease feel free to try it out, complain, ack, send patches, and so\non.\n\nJonathan Nieder (2):\n  i18n: do not poison translations unless GIT_GETTEXT_POISON envvar is\n    set\n  update-index --refresh --porcelain: add missing const\n\nÆvar Arnfjörð Bjarmason (13):\n  i18n: add no-op _() and N_() wrappers\n  tests: add GETTEXT_POISON to simulate unfriendly translator\n  Makefile: \"pot\" target to extract messages marked for translation\n  init: mark basic messages for translation\n  init: mark \"Initialized [...] repository\" for translation\n  clone: mark basic messages for translation\n  clone: split \"Cloning into\" message into two\n  clone: mark \"Cloning into\" message for translation\n  add: mark basic messages for translation\n  add: mark \"The following paths are ignored\" for translation\n  add: mark \"did not match any files\" for translation\n  add -u --verbose: mark \"remove '%s'\" for translation\n  add --refresh --verbose: mark \"Unstaged changes\" heading for\n    translation\n\n Makefile               |   27 ++++++++++++++++++++\n builtin/add.c          |   50 +++++++++++++++++++-------------------\n builtin/clone.c        |   63 +++++++++++++++++++++++++----------------------\n builtin/init-db.c      |   58 ++++++++++++++++++++++++-------------------\n cache.h                |    3 +-\n gettext.c              |   14 ++++++++++\n gettext.h              |   32 ++++++++++++++++++++++++\n po/.gitignore          |    1 +\n read-cache.c           |    4 +-\n t/t0001-init.sh        |    2 +-\n t/t2200-add-update.sh  |    2 +-\n t/t2204-add-ignored.sh |   37 +++++++++++++++++++---------\n t/t3700-add.sh         |   13 +++++++--\n t/t5601-clone.sh       |    2 +-\n t/test-lib.sh          |    9 +++++++\n 15 files changed, 215 insertions(+), 102 deletions(-)\n create mode 100644 gettext.c\n create mode 100644 gettext.h\n create mode 100644 po/.gitignore\n"},{"id":"161795","messageId":"20110221101321.GB32137@elie","threadId":"26561","inReplyTo":"20110221101229.GA32137@elie","subject":"[PATCH 01/15] i18n: add no-op _() and N_() wrappers","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2011-02-21T10:13:21Z","receivedAt":"2011-02-21T10:13:21Z","isPatch":true,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"From: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n\nThe _ function is for translating strings into the user's chosen\nlanguage.  The N_ macro just marks translatable strings for the\nxgettext(1) tool without translating them; it is intended for use in\ncontexts where a function call cannot be used.  So, for example:\n\n\tfprintf(stderr, _(\"Expansion of alias '%s' failed; \"\n\t\t\"'%s' is not a git command\\n\"),\n\t\tcmd, argv[0]);\n\nand\n\n\tconst char *unpack_plumbing_errors[NB_UNPACK_TREES_ERROR_TYPES] = {\n\t\t/* ERROR_WOULD_OVERWRITE */\n\t\tN_(\"Entry '%s' would be overwritten by merge. Cannot merge.\"),\n\t[...]\n\nDefine such _ and N_ in a new gettext.h and include it in cache.h, so\nthey can be used everywhere.  Each just returns its argument for now.\n_ is a function rather than a macro like N_ to avoid the temptation to\nuse _(\"foo\") as a string literal (which would be a compile-time error\nonce _(s) expands to an expression for the translation of s).\n\nSigned-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\nSigned-off-by: Jonathan Nieder <jrnieder@gmail.com>\n---\n Makefile  |    1 +\n cache.h   |    1 +\n gettext.h |   26 ++++++++++++++++++++++++++\n 3 files changed, 28 insertions(+), 0 deletions(-)\n create mode 100644 gettext.h\n\ndiff --git a/Makefile b/Makefile\nindex ade7923..c153f45 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -515,6 +515,7 @@ LIB_H += diff.h\n LIB_H += dir.h\n LIB_H += exec_cmd.h\n LIB_H += fsck.h\n+LIB_H += gettext.h\n LIB_H += git-compat-util.h\n LIB_H += graph.h\n LIB_H += grep.h\ndiff --git a/cache.h b/cache.h\nindex 3abf895..a465f38 100644\n--- a/cache.h\n+++ b/cache.h\n@@ -5,6 +5,7 @@\n #include \"strbuf.h\"\n #include \"hash.h\"\n #include \"advice.h\"\n+#include \"gettext.h\"\n \n #include SHA1_HEADER\n #ifndef git_SHA_CTX\ndiff --git a/gettext.h b/gettext.h\nnew file mode 100644\nindex 0000000..dc44825\n--- /dev/null\n+++ b/gettext.h\n@@ -0,0 +1,26 @@\n+#ifndef GETTEXT_H\n+#define GETTEXT_H\n+\n+/*\n+ * Copyright (c) 2010 Ævar Arnfjörð Bjarmason\n+ *\n+ * This is a skeleton no-op implementation of gettext for Git.\n+ * You can replace it with something that uses libintl.h and wraps\n+ * gettext() to try out the translations.\n+ */\n+\n+#ifdef _\n+#error \"namespace conflict: '_' is pre-defined?\"\n+#endif\n+\n+#define FORMAT_PRESERVING(n) __attribute__((format_arg(n)))\n+\n+static inline FORMAT_PRESERVING(1) const char *_(const char *msgid)\n+{\n+\treturn msgid;\n+}\n+\n+/* Mark msgid for translation but do not translate it. */\n+#define N_(msgid) (msgid)\n+\n+#endif\n-- \n1.7.4.1\n"},{"id":"161791","messageId":"20110221101352.GC32137@elie","threadId":"26561","inReplyTo":"20110221101229.GA32137@elie","subject":"[PATCH 02/15] tests: add GETTEXT_POISON to simulate unfriendly translator","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2011-02-21T10:13:52Z","receivedAt":"2011-02-21T10:13:52Z","isPatch":true,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"From: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n\nAdd a new GETTEXT_POISON compile-time parameter to make _(msg) always\nreturn gibberish.  So now you can run\n\n\tmake GETTEXT_POISON=YesPlease\n\nto get a copy of git that functions correctly (one hopes) but produces\noutput that is in nobody's native language at all.\n\nThis is a debugging aid for people who are working on the i18n part of\nthe system, to make sure that they are not marking plumbing messages\nthat should never be translated with _().\n\nAs new strings get marked for translation, naturally a number of tests\nwill be broken in this mode.  Tests that depend on output from\nPorcelain will need to be marked with the new C_LOCALE_OUTPUT test\nprerequisite.  Newly failing tests that do not depend on output from\nPorcelain would be bugs due to messages that should not have been\nmarked for translation.\n\nSigned-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\nSigned-off-by: Jonathan Nieder <jrnieder@gmail.com>\n---\n Makefile      |    7 +++++++\n gettext.h     |    8 +++++++-\n t/test-lib.sh |    3 +++\n 3 files changed, 17 insertions(+), 1 deletions(-)\n\ndiff --git a/Makefile b/Makefile\nindex c153f45..c348bb7 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -216,6 +216,9 @@ all::\n #\n # Define NO_REGEX if you have no or inferior regex support in your C library.\n #\n+# Define GETTEXT_POISON if you are debugging the choice of strings marked\n+# for translation.  This will turn all strings that use gettext into gibberish.\n+#\n # Define JSMIN to point to JavaScript minifier that functions as\n # a filter to have gitweb.js minified.\n #\n@@ -1370,6 +1373,9 @@ endif\n ifdef NO_SYMLINK_HEAD\n \tBASIC_CFLAGS += -DNO_SYMLINK_HEAD\n endif\n+ifdef GETTEXT_POISON\n+\tBASIC_CFLAGS += -DGETTEXT_POISON\n+endif\n ifdef NO_STRCASESTR\n \tCOMPAT_CFLAGS += -DNO_STRCASESTR\n \tCOMPAT_OBJS += compat/strcasestr.o\n@@ -2089,6 +2095,7 @@ endif\n ifdef GIT_TEST_CMP_USE_COPIED_CONTEXT\n \t@echo GIT_TEST_CMP_USE_COPIED_CONTEXT=YesPlease >>$@\n endif\n+\t@echo GETTEXT_POISON=\\''$(subst ','\\'',$(subst ','\\'',$(GETTEXT_POISON)))'\\' >>$@\n \n ### Detect Tck/Tk interpreter path changes\n ifndef NO_TCLTK\ndiff --git a/gettext.h b/gettext.h\nindex dc44825..68e3a19 100644\n--- a/gettext.h\n+++ b/gettext.h\n@@ -15,9 +15,15 @@\n \n #define FORMAT_PRESERVING(n) __attribute__((format_arg(n)))\n \n+#ifdef GETTEXT_POISON\n+#define use_poison() 1\n+#else\n+#define use_poison() 0\n+#endif\n+\n static inline FORMAT_PRESERVING(1) const char *_(const char *msgid)\n {\n-\treturn msgid;\n+\treturn use_poison() ? \"Malkovich\" : msgid;\n }\n \n /* Mark msgid for translation but do not translate it. */\ndiff --git a/t/test-lib.sh b/t/test-lib.sh\nindex 0fdc541..0840e4a 100644\n--- a/t/test-lib.sh\n+++ b/t/test-lib.sh\n@@ -1079,6 +1079,9 @@ esac\n test -z \"$NO_PERL\" && test_set_prereq PERL\n test -z \"$NO_PYTHON\" && test_set_prereq PYTHON\n \n+# Can we rely on git's output in the C locale?\n+test -z \"$GETTEXT_POISON\" && test_set_prereq C_LOCALE_OUTPUT\n+\n # test whether the filesystem supports symbolic links\n ln -s x y 2>/dev/null && test -h y 2>/dev/null && test_set_prereq SYMLINKS\n rm -f y\n-- \n1.7.4.1\n"},{"id":"161792","messageId":"20110221101417.GD32137@elie","threadId":"26561","inReplyTo":"20110221101229.GA32137@elie","subject":"[PATCH 03/15] i18n: do not poison translations unless GIT_GETTEXT_POISON envvar is set","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2011-02-21T10:14:17Z","receivedAt":"2011-02-21T10:14:17Z","isPatch":true,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"Tweak the GETTEXT_POISON facility so it is activated at run time\ninstead of compile time.  If the GIT_GETTEXT_POISON environment\nvariable is set, _(msg) will result in gibberish as before; but if the\nGIT_GETTEXT_POISON variable is not set, it will return the message for\nhuman-readable output.  So the behavior of mistranslated and\nuntranslated git can be compared without rebuilding git in between.\n\nFor simplicity we always set the GIT_GETTEXT_POISON variable in tests.\n\nThis does not affect builds without the GETTEXT_POISON compile-time\noption set, so non-i18n git will not be slowed down.\n\nSigned-off-by: Jonathan Nieder <jrnieder@gmail.com>\n---\n Makefile      |    5 ++++-\n gettext.c     |   14 ++++++++++++++\n gettext.h     |    2 +-\n t/test-lib.sh |    8 +++++++-\n 4 files changed, 26 insertions(+), 3 deletions(-)\n create mode 100644 gettext.c\n\ndiff --git a/Makefile b/Makefile\nindex c348bb7..4e9d935 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -217,7 +217,9 @@ all::\n # Define NO_REGEX if you have no or inferior regex support in your C library.\n #\n # Define GETTEXT_POISON if you are debugging the choice of strings marked\n-# for translation.  This will turn all strings that use gettext into gibberish.\n+# for translation.  In a GETTEXT_POISON build, you can turn all strings marked\n+# for translation into gibberish by setting the GIT_GETTEXT_POISON variable\n+# (to any value) in your environment.\n #\n # Define JSMIN to point to JavaScript minifier that functions as\n # a filter to have gitweb.js minified.\n@@ -1374,6 +1376,7 @@ ifdef NO_SYMLINK_HEAD\n \tBASIC_CFLAGS += -DNO_SYMLINK_HEAD\n endif\n ifdef GETTEXT_POISON\n+\tLIB_OBJS += gettext.o\n \tBASIC_CFLAGS += -DGETTEXT_POISON\n endif\n ifdef NO_STRCASESTR\ndiff --git a/gettext.c b/gettext.c\nnew file mode 100644\nindex 0000000..9688c8b\n--- /dev/null\n+++ b/gettext.c\n@@ -0,0 +1,14 @@\n+/*\n+ * Copyright (c) 2010 Ævar Arnfjörð Bjarmason\n+ */\n+\n+#include \"git-compat-util.h\"\n+#include \"gettext.h\"\n+\n+int use_poison(void)\n+{\n+\tstatic int poison_requested = -1;\n+\tif (poison_requested == -1)\n+\t\tpoison_requested = getenv(\"GIT_GETTEXT_POISON\") ? 1 : 0;\n+\treturn poison_requested;\n+}\ndiff --git a/gettext.h b/gettext.h\nindex 68e3a19..4d2338b 100644\n--- a/gettext.h\n+++ b/gettext.h\n@@ -16,7 +16,7 @@\n #define FORMAT_PRESERVING(n) __attribute__((format_arg(n)))\n \n #ifdef GETTEXT_POISON\n-#define use_poison() 1\n+extern int use_poison(void);\n #else\n #define use_poison() 0\n #endif\ndiff --git a/t/test-lib.sh b/t/test-lib.sh\nindex 0840e4a..f4c1e04 100644\n--- a/t/test-lib.sh\n+++ b/t/test-lib.sh\n@@ -1080,7 +1080,13 @@ test -z \"$NO_PERL\" && test_set_prereq PERL\n test -z \"$NO_PYTHON\" && test_set_prereq PYTHON\n \n # Can we rely on git's output in the C locale?\n-test -z \"$GETTEXT_POISON\" && test_set_prereq C_LOCALE_OUTPUT\n+if test -n \"$GETTEXT_POISON\"\n+then\n+\tGIT_GETTEXT_POISON=YesPlease\n+\texport GIT_GETTEXT_POISON\n+else\n+\ttest_set_prereq C_LOCALE_OUTPUT\n+fi\n \n # test whether the filesystem supports symbolic links\n ln -s x y 2>/dev/null && test -h y 2>/dev/null && test_set_prereq SYMLINKS\n-- \n1.7.4.1\n"},{"id":"161789","messageId":"20110221101530.GE32137@elie","threadId":"26561","inReplyTo":"20110221101229.GA32137@elie","subject":"[PATCH 04/15] Makefile: \"pot\" target to extract messages marked for translation","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2011-02-21T10:15:30Z","receivedAt":"2011-02-21T10:15:30Z","isPatch":true,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"From: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\nDate: Tue, 31 Aug 2010 16:35:16 +0000\n\nAdd rules to generate a template (po/git.pot) listing messages marked\nfor translation in the C portion of git.\n\nTo get started translating, just run \"make pot\".\n\nSigned-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\nSigned-off-by: Jonathan Nieder <jrnieder@gmail.com>\n---\n Makefile      |   16 ++++++++++++++++\n po/.gitignore |    1 +\n 2 files changed, 17 insertions(+), 0 deletions(-)\n create mode 100644 po/.gitignore\n\ndiff --git a/Makefile b/Makefile\nindex 4e9d935..1cc6c60 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -321,6 +321,7 @@ INSTALL = install\n RPMBUILD = rpmbuild\n TCL_PATH = tclsh\n TCLTK_PATH = wish\n+XGETTEXT = xgettext\n PTHREAD_LIBS = -lpthread\n PTHREAD_CFLAGS =\n GCOV = gcov\n@@ -1590,6 +1591,7 @@ ifndef V\n \tQUIET_BUILT_IN = @echo '   ' BUILTIN $@;\n \tQUIET_GEN      = @echo '   ' GEN $@;\n \tQUIET_LNCP     = @echo '   ' LN/CP $@;\n+\tQUIET_XGETTEXT = @echo '   ' XGETTEXT $@;\n \tQUIET_GCOV     = @echo '   ' GCOV $@;\n \tQUIET_SUBDIR0  = +@subdir=\n \tQUIET_SUBDIR1  = ;$(NO_SUBDIR) echo '   ' SUBDIR $$subdir; \\\n@@ -2057,6 +2059,20 @@ info:\n pdf:\n \t$(MAKE) -C Documentation pdf\n \n+XGETTEXT_FLAGS = \\\n+\t--force-po \\\n+\t--add-comments \\\n+\t--msgid-bugs-address=\"Git Mailing List <git@vger.kernel.org>\" \\\n+\t--from-code=UTF-8\n+XGETTEXT_FLAGS_C = $(XGETTEXT_FLAGS) --keyword=_ --keyword=N_ --language=C\n+LOCALIZED_C := $(C_OBJ:o=c)\n+\n+po/git.pot: $(LOCALIZED_C)\n+\t$(QUIET_XGETTEXT)$(XGETTEXT) -o$@+ $(XGETTEXT_FLAGS_C) $(LOCALIZED_C) && \\\n+\tmv $@+ $@\n+\n+pot: po/git.pot\n+\n $(ETAGS_TARGET): FORCE\n \t$(RM) $(ETAGS_TARGET)\n \t$(FIND) . -name '*.[hcS]' -print | xargs etags -a -o $(ETAGS_TARGET)\ndiff --git a/po/.gitignore b/po/.gitignore\nnew file mode 100644\nindex 0000000..a242a86\n--- /dev/null\n+++ b/po/.gitignore\n@@ -0,0 +1 @@\n+/git.pot\n-- \n1.7.4.1\n"},{"id":"161790","messageId":"20110221101600.GF32137@elie","threadId":"26561","inReplyTo":"20110221101229.GA32137@elie","subject":"[PATCH 05/15] init: mark basic messages for translation","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2011-02-21T10:16:00Z","receivedAt":"2011-02-21T10:16:00Z","isPatch":true,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"From: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\nDate: Sat, 28 Aug 2010 15:04:43 +0000\n\nChange the user visible strings in init-db.c to use gettext\nlocalizations. This only converts messages which needed to be changed\nfrom \"foo\" to _(\"foo\"), and didn't need any TRANSLATORS comments.\n\nI haven't marked the messages in init_db_usage or init_db_options for\ntranslation, since that would require additional changes in\nparse-options.c. Those can be done later.\n\nSigned-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\nSigned-off-by: Jonathan Nieder <jrnieder@gmail.com>\n---\n builtin/init-db.c |   46 +++++++++++++++++++++++-----------------------\n 1 files changed, 23 insertions(+), 23 deletions(-)\n\ndiff --git a/builtin/init-db.c b/builtin/init-db.c\nindex 4f5348e..f7ddf5b 100644\n--- a/builtin/init-db.c\n+++ b/builtin/init-db.c\n@@ -31,7 +31,7 @@ static void safe_create_dir(const char *dir, int share)\n \t\t}\n \t}\n \telse if (share && adjust_shared_perm(dir))\n-\t\tdie(\"Could not make %s writable by group\", dir);\n+\t\tdie(_(\"Could not make %s writable by group\"), dir);\n }\n \n static void copy_templates_1(char *path, int baselen,\n@@ -58,25 +58,25 @@ static void copy_templates_1(char *path, int baselen,\n \t\tnamelen = strlen(de->d_name);\n \t\tif ((PATH_MAX <= baselen + namelen) ||\n \t\t    (PATH_MAX <= template_baselen + namelen))\n-\t\t\tdie(\"insanely long template name %s\", de->d_name);\n+\t\t\tdie(_(\"insanely long template name %s\"), de->d_name);\n \t\tmemcpy(path + baselen, de->d_name, namelen+1);\n \t\tmemcpy(template + template_baselen, de->d_name, namelen+1);\n \t\tif (lstat(path, &st_git)) {\n \t\t\tif (errno != ENOENT)\n-\t\t\t\tdie_errno(\"cannot stat '%s'\", path);\n+\t\t\t\tdie_errno(_(\"cannot stat '%s'\"), path);\n \t\t}\n \t\telse\n \t\t\texists = 1;\n \n \t\tif (lstat(template, &st_template))\n-\t\t\tdie_errno(\"cannot stat template '%s'\", template);\n+\t\t\tdie_errno(_(\"cannot stat template '%s'\"), template);\n \n \t\tif (S_ISDIR(st_template.st_mode)) {\n \t\t\tDIR *subdir = opendir(template);\n \t\t\tint baselen_sub = baselen + namelen;\n \t\t\tint template_baselen_sub = template_baselen + namelen;\n \t\t\tif (!subdir)\n-\t\t\t\tdie_errno(\"cannot opendir '%s'\", template);\n+\t\t\t\tdie_errno(_(\"cannot opendir '%s'\"), template);\n \t\t\tpath[baselen_sub++] =\n \t\t\t\ttemplate[template_baselen_sub++] = '/';\n \t\t\tpath[baselen_sub] =\n@@ -93,20 +93,20 @@ static void copy_templates_1(char *path, int baselen,\n \t\t\tint len;\n \t\t\tlen = readlink(template, lnk, sizeof(lnk));\n \t\t\tif (len < 0)\n-\t\t\t\tdie_errno(\"cannot readlink '%s'\", template);\n+\t\t\t\tdie_errno(_(\"cannot readlink '%s'\"), template);\n \t\t\tif (sizeof(lnk) <= len)\n-\t\t\t\tdie(\"insanely long symlink %s\", template);\n+\t\t\t\tdie(_(\"insanely long symlink %s\"), template);\n \t\t\tlnk[len] = 0;\n \t\t\tif (symlink(lnk, path))\n-\t\t\t\tdie_errno(\"cannot symlink '%s' '%s'\", lnk, path);\n+\t\t\t\tdie_errno(_(\"cannot symlink '%s' '%s'\"), lnk, path);\n \t\t}\n \t\telse if (S_ISREG(st_template.st_mode)) {\n \t\t\tif (copy_file(path, template, st_template.st_mode))\n-\t\t\t\tdie_errno(\"cannot copy '%s' to '%s'\", template,\n+\t\t\t\tdie_errno(_(\"cannot copy '%s' to '%s'\"), template,\n \t\t\t\t\t  path);\n \t\t}\n \t\telse\n-\t\t\terror(\"ignoring template %s\", template);\n+\t\t\terror(_(\"ignoring template %s\"), template);\n \t}\n }\n \n@@ -129,7 +129,7 @@ static void copy_templates(const char *template_dir)\n \t\treturn;\n \ttemplate_len = strlen(template_dir);\n \tif (PATH_MAX <= (template_len+strlen(\"/config\")))\n-\t\tdie(\"insanely long template path %s\", template_dir);\n+\t\tdie(_(\"insanely long template path %s\"), template_dir);\n \tstrcpy(template_path, template_dir);\n \tif (template_path[template_len-1] != '/') {\n \t\ttemplate_path[template_len++] = '/';\n@@ -137,7 +137,7 @@ static void copy_templates(const char *template_dir)\n \t}\n \tdir = opendir(template_path);\n \tif (!dir) {\n-\t\twarning(\"templates not found %s\", template_dir);\n+\t\twarning(_(\"templates not found %s\"), template_dir);\n \t\treturn;\n \t}\n \n@@ -150,8 +150,8 @@ static void copy_templates(const char *template_dir)\n \n \tif (repository_format_version &&\n \t    repository_format_version != GIT_REPO_VERSION) {\n-\t\twarning(\"not copying templates of \"\n-\t\t\t\"a wrong format version %d from '%s'\",\n+\t\twarning(_(\"not copying templates of \"\n+\t\t\t\"a wrong format version %d from '%s'\"),\n \t\t\trepository_format_version,\n \t\t\ttemplate_dir);\n \t\tclosedir(dir);\n@@ -188,7 +188,7 @@ static int create_default_files(const char *template_path)\n \tint filemode;\n \n \tif (len > sizeof(path)-50)\n-\t\tdie(\"insane git directory %s\", git_dir);\n+\t\tdie(_(\"insane git directory %s\"), git_dir);\n \tmemcpy(path, git_dir, len);\n \n \tif (len && path[len-1] != '/')\n@@ -375,7 +375,7 @@ static int guess_repository_type(const char *git_dir)\n \tif (!strcmp(\".\", git_dir))\n \t\treturn 1;\n \tif (!getcwd(cwd, sizeof(cwd)))\n-\t\tdie_errno(\"cannot tell cwd\");\n+\t\tdie_errno(_(\"cannot tell cwd\"));\n \tif (!strcmp(git_dir, cwd))\n \t\treturn 1;\n \t/*\n@@ -450,18 +450,18 @@ int cmd_init_db(int argc, const char **argv, const char *prefix)\n \t\t\t\t\terrno = EEXIST;\n \t\t\t\t\t/* fallthru */\n \t\t\t\tcase -1:\n-\t\t\t\t\tdie_errno(\"cannot mkdir %s\", argv[0]);\n+\t\t\t\t\tdie_errno(_(\"cannot mkdir %s\"), argv[0]);\n \t\t\t\t\tbreak;\n \t\t\t\tdefault:\n \t\t\t\t\tbreak;\n \t\t\t\t}\n \t\t\t\tshared_repository = saved;\n \t\t\t\tif (mkdir(argv[0], 0777) < 0)\n-\t\t\t\t\tdie_errno(\"cannot mkdir %s\", argv[0]);\n+\t\t\t\t\tdie_errno(_(\"cannot mkdir %s\"), argv[0]);\n \t\t\t\tmkdir_tried = 1;\n \t\t\t\tgoto retry;\n \t\t\t}\n-\t\t\tdie_errno(\"cannot chdir to %s\", argv[0]);\n+\t\t\tdie_errno(_(\"cannot chdir to %s\"), argv[0]);\n \t\t}\n \t} else if (0 < argc) {\n \t\tusage(init_db_usage[0]);\n@@ -483,8 +483,8 @@ int cmd_init_db(int argc, const char **argv, const char *prefix)\n \tgit_dir = getenv(GIT_DIR_ENVIRONMENT);\n \twork_tree = getenv(GIT_WORK_TREE_ENVIRONMENT);\n \tif ((!git_dir || is_bare_repository_cfg == 1) && work_tree)\n-\t\tdie(\"%s (or --work-tree=<directory>) not allowed without \"\n-\t\t    \"specifying %s (or --git-dir=<directory>)\",\n+\t\tdie(_(\"%s (or --work-tree=<directory>) not allowed without \"\n+\t\t\t  \"specifying %s (or --git-dir=<directory>)\"),\n \t\t    GIT_WORK_TREE_ENVIRONMENT,\n \t\t    GIT_DIR_ENVIRONMENT);\n \n@@ -509,14 +509,14 @@ int cmd_init_db(int argc, const char **argv, const char *prefix)\n \t\tif (!git_work_tree_cfg) {\n \t\t\tgit_work_tree_cfg = xcalloc(PATH_MAX, 1);\n \t\t\tif (!getcwd(git_work_tree_cfg, PATH_MAX))\n-\t\t\t\tdie_errno (\"Cannot access current working directory\");\n+\t\t\t\tdie_errno (_(\"Cannot access current working directory\"));\n \t\t}\n \t\tif (work_tree)\n \t\t\tset_git_work_tree(make_absolute_path(work_tree));\n \t\telse\n \t\t\tset_git_work_tree(git_work_tree_cfg);\n \t\tif (access(get_git_work_tree(), X_OK))\n-\t\t\tdie_errno (\"Cannot access work tree '%s'\",\n+\t\t\tdie_errno (_(\"Cannot access work tree '%s'\"),\n \t\t\t\t   get_git_work_tree());\n \t}\n \telse {\n-- \n1.7.4.1\n"},{"id":"161793","messageId":"20110221101754.GG32137@elie","threadId":"26561","inReplyTo":"20110221101229.GA32137@elie","subject":"[PATCH 06/15] init: mark \"Initialized [...] repository\" for translation","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2011-02-21T10:17:54Z","receivedAt":"2011-02-21T10:17:54Z","isPatch":true,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"From: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\nDate: Sat, 28 Aug 2010 15:32:15 +0000\n\nThese messages could benefit from splitting up.  An earlier version of\nthis patch began like this:\n\n    const char *reinit_shared   = _(\"Reinitialized existing shared Git repository in %s\\n\");\n    const char *init_shared     = _(\"Initialized empty shared Git repository in %s\\n\");\n    const char *reinit_noshared = _(\"Reinitialized existing Git repository in %s\\n\");\n    const char *init_noshared   = _(\"Initialized empty Git repository in %s\\n\");\n\nBut in the first round of gettextization I'm aiming to keep code\nchanges to a minimum for ease of review.  So just add a comment\nexplaining to translators how the sprintf format gets used so they\ncan cope for now if the language's grammar allows.\n\nSigned-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\nSigned-off-by: Jonathan Nieder <jrnieder@gmail.com>\n---\nI heard a rumor that this style of TRANSLATORS comment doesn't pass\nunscathed through xgettext, but when I tried it with \"make pot\" it\nworked okay.  Ideas?\n\n builtin/init-db.c |   12 +++++++++---\n t/t0001-init.sh   |    2 +-\n 2 files changed, 10 insertions(+), 4 deletions(-)\n\ndiff --git a/builtin/init-db.c b/builtin/init-db.c\nindex f7ddf5b..e0e5ce3 100644\n--- a/builtin/init-db.c\n+++ b/builtin/init-db.c\n@@ -354,9 +354,15 @@ int init_db(const char *template_dir, unsigned int flags)\n \tif (!(flags & INIT_DB_QUIET)) {\n \t\tconst char *git_dir = get_git_dir();\n \t\tint len = strlen(git_dir);\n-\t\tprintf(\"%s%s Git repository in %s%s\\n\",\n-\t\t       reinit ? \"Reinitialized existing\" : \"Initialized empty\",\n-\t\t       shared_repository ? \" shared\" : \"\",\n+\n+\t\t/*\n+\t\t * TRANSLATORS: The first '%s' is either \"Reinitialized\n+\t\t * existing\" or \"Initialized empty\", the second \" shared\" or\n+\t\t * \"\", and the last '%s%s' is the verbatim directory name.\n+\t\t */\n+\t\tprintf(_(\"%s%s Git repository in %s%s\\n\"),\n+\t\t       reinit ? _(\"Reinitialized existing\") : _(\"Initialized empty\"),\n+\t\t       shared_repository ? _(\" shared\") : \"\",\n \t\t       git_dir, len && git_dir[len-1] != '/' ? \"/\" : \"\");\n \t}\n \ndiff --git a/t/t0001-init.sh b/t/t0001-init.sh\nindex f684993..dd4c00d 100755\n--- a/t/t0001-init.sh\n+++ b/t/t0001-init.sh\n@@ -180,7 +180,7 @@ test_expect_success 'GIT_DIR & GIT_WORK_TREE (2)' '\n \tfi\n '\n \n-test_expect_success 'reinit' '\n+test_expect_success C_LOCALE_OUTPUT 'reinit' '\n \n \t(\n \t\tsane_unset GIT_CONFIG GIT_WORK_TREE GIT_CONFIG &&\n-- \n1.7.4.1\n"},{"id":"161794","messageId":"20110221101827.GH32137@elie","threadId":"26561","inReplyTo":"20110221101229.GA32137@elie","subject":"[PATCH 07/15] clone: mark basic messages for translation","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2011-02-21T10:18:27Z","receivedAt":"2011-02-21T10:18:27Z","isPatch":true,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"From: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\nDate: Wed, 1 Sep 2010 15:44:13 +0000\n\nSigned-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\nSigned-off-by: Jonathan Nieder <jrnieder@gmail.com>\n---\n builtin/clone.c |   54 +++++++++++++++++++++++++++---------------------------\n 1 files changed, 27 insertions(+), 27 deletions(-)\n\ndiff --git a/builtin/clone.c b/builtin/clone.c\nindex 60d9a64..f46d09b 100644\n--- a/builtin/clone.c\n+++ b/builtin/clone.c\n@@ -208,7 +208,7 @@ static void setup_reference(const char *repo)\n \tif (is_directory(mkpath(\"%s/.git/objects\", ref_git)))\n \t\tref_git = mkpath(\"%s/.git\", ref_git);\n \telse if (!is_directory(mkpath(\"%s/objects\", ref_git)))\n-\t\tdie(\"reference repository '%s' is not a local directory.\",\n+\t\tdie(_(\"reference repository '%s' is not a local directory.\"),\n \t\t    option_reference);\n \n \tref_git_copy = xstrdup(ref_git);\n@@ -235,15 +235,15 @@ static void copy_or_link_directory(struct strbuf *src, struct strbuf *dest)\n \n \tdir = opendir(src->buf);\n \tif (!dir)\n-\t\tdie_errno(\"failed to open '%s'\", src->buf);\n+\t\tdie_errno(_(\"failed to open '%s'\"), src->buf);\n \n \tif (mkdir(dest->buf, 0777)) {\n \t\tif (errno != EEXIST)\n-\t\t\tdie_errno(\"failed to create directory '%s'\", dest->buf);\n+\t\t\tdie_errno(_(\"failed to create directory '%s'\"), dest->buf);\n \t\telse if (stat(dest->buf, &buf))\n-\t\t\tdie_errno(\"failed to stat '%s'\", dest->buf);\n+\t\t\tdie_errno(_(\"failed to stat '%s'\"), dest->buf);\n \t\telse if (!S_ISDIR(buf.st_mode))\n-\t\t\tdie(\"%s exists and is not a directory\", dest->buf);\n+\t\t\tdie(_(\"%s exists and is not a directory\"), dest->buf);\n \t}\n \n \tstrbuf_addch(src, '/');\n@@ -257,7 +257,7 @@ static void copy_or_link_directory(struct strbuf *src, struct strbuf *dest)\n \t\tstrbuf_setlen(dest, dest_len);\n \t\tstrbuf_addstr(dest, de->d_name);\n \t\tif (stat(src->buf, &buf)) {\n-\t\t\twarning (\"failed to stat %s\\n\", src->buf);\n+\t\t\twarning (_(\"failed to stat %s\\n\"), src->buf);\n \t\t\tcontinue;\n \t\t}\n \t\tif (S_ISDIR(buf.st_mode)) {\n@@ -267,16 +267,16 @@ static void copy_or_link_directory(struct strbuf *src, struct strbuf *dest)\n \t\t}\n \n \t\tif (unlink(dest->buf) && errno != ENOENT)\n-\t\t\tdie_errno(\"failed to unlink '%s'\", dest->buf);\n+\t\t\tdie_errno(_(\"failed to unlink '%s'\"), dest->buf);\n \t\tif (!option_no_hardlinks) {\n \t\t\tif (!link(src->buf, dest->buf))\n \t\t\t\tcontinue;\n \t\t\tif (option_local)\n-\t\t\t\tdie_errno(\"failed to create link '%s'\", dest->buf);\n+\t\t\t\tdie_errno(_(\"failed to create link '%s'\"), dest->buf);\n \t\t\toption_no_hardlinks = 1;\n \t\t}\n \t\tif (copy_file_with_time(dest->buf, src->buf, 0666))\n-\t\t\tdie_errno(\"failed to copy file to '%s'\", dest->buf);\n+\t\t\tdie_errno(_(\"failed to copy file to '%s'\"), dest->buf);\n \t}\n \tclosedir(dir);\n }\n@@ -305,7 +305,7 @@ static const struct ref *clone_local(const char *src_repo,\n \tret = transport_get_remote_refs(transport);\n \ttransport_disconnect(transport);\n \tif (0 <= option_verbosity)\n-\t\tprintf(\"done.\\n\");\n+\t\tprintf(_(\"done.\\n\"));\n \treturn ret;\n }\n \n@@ -387,11 +387,11 @@ int cmd_clone(int argc, const char **argv, const char *prefix)\n \t\t\t     builtin_clone_usage, 0);\n \n \tif (argc > 2)\n-\t\tusage_msg_opt(\"Too many arguments.\",\n+\t\tusage_msg_opt(_(\"Too many arguments.\"),\n \t\t\tbuiltin_clone_usage, builtin_clone_options);\n \n \tif (argc == 0)\n-\t\tusage_msg_opt(\"You must specify a repository to clone.\",\n+\t\tusage_msg_opt(_(\"You must specify a repository to clone.\"),\n \t\t\tbuiltin_clone_usage, builtin_clone_options);\n \n \tif (option_mirror)\n@@ -399,7 +399,7 @@ int cmd_clone(int argc, const char **argv, const char *prefix)\n \n \tif (option_bare) {\n \t\tif (option_origin)\n-\t\t\tdie(\"--bare and --origin %s options are incompatible.\",\n+\t\t\tdie(_(\"--bare and --origin %s options are incompatible.\"),\n \t\t\t    option_origin);\n \t\toption_no_checkout = 1;\n \t}\n@@ -418,7 +418,7 @@ int cmd_clone(int argc, const char **argv, const char *prefix)\n \t\trepo = repo_name;\n \tis_local = path && !is_bundle;\n \tif (is_local && option_depth)\n-\t\twarning(\"--depth is ignored in local clones; use file:// instead.\");\n+\t\twarning(_(\"--depth is ignored in local clones; use file:// instead.\"));\n \n \tif (argc == 2)\n \t\tdir = xstrdup(argv[1]);\n@@ -428,8 +428,8 @@ int cmd_clone(int argc, const char **argv, const char *prefix)\n \n \tdest_exists = !stat(dir, &buf);\n \tif (dest_exists && !is_empty_dir(dir))\n-\t\tdie(\"destination path '%s' already exists and is not \"\n-\t\t\t\"an empty directory.\", dir);\n+\t\tdie(_(\"destination path '%s' already exists and is not \"\n+\t\t\t\"an empty directory.\"), dir);\n \n \tstrbuf_addf(&reflog_msg, \"clone: from %s\", repo);\n \n@@ -438,7 +438,7 @@ int cmd_clone(int argc, const char **argv, const char *prefix)\n \telse {\n \t\twork_tree = getenv(\"GIT_WORK_TREE\");\n \t\tif (work_tree && !stat(work_tree, &buf))\n-\t\t\tdie(\"working tree '%s' already exists.\", work_tree);\n+\t\t\tdie(_(\"working tree '%s' already exists.\"), work_tree);\n \t}\n \n \tif (option_bare || work_tree)\n@@ -451,10 +451,10 @@ int cmd_clone(int argc, const char **argv, const char *prefix)\n \tif (!option_bare) {\n \t\tjunk_work_tree = work_tree;\n \t\tif (safe_create_leading_directories_const(work_tree) < 0)\n-\t\t\tdie_errno(\"could not create leading directories of '%s'\",\n+\t\t\tdie_errno(_(\"could not create leading directories of '%s'\"),\n \t\t\t\t  work_tree);\n \t\tif (!dest_exists && mkdir(work_tree, 0755))\n-\t\t\tdie_errno(\"could not create work tree dir '%s'.\",\n+\t\t\tdie_errno(_(\"could not create work tree dir '%s'.\"),\n \t\t\t\t  work_tree);\n \t\tset_git_work_tree(work_tree);\n \t}\n@@ -465,7 +465,7 @@ int cmd_clone(int argc, const char **argv, const char *prefix)\n \tsetenv(CONFIG_ENVIRONMENT, mkpath(\"%s/config\", git_dir), 1);\n \n \tif (safe_create_leading_directories_const(git_dir) < 0)\n-\t\tdie(\"could not create leading directories of '%s'\", git_dir);\n+\t\tdie(_(\"could not create leading directories of '%s'\"), git_dir);\n \tset_git_dir(make_absolute_path(git_dir));\n \n \tif (0 <= option_verbosity)\n@@ -527,7 +527,7 @@ int cmd_clone(int argc, const char **argv, const char *prefix)\n \t\ttransport = transport_get(remote, remote->url[0]);\n \n \t\tif (!transport->get_refs_list || !transport->fetch)\n-\t\t\tdie(\"Don't know how to clone %s\", transport->url);\n+\t\t\tdie(_(\"Don't know how to clone %s\"), transport->url);\n \n \t\ttransport_set_option(transport, TRANS_OPT_KEEP, \"yes\");\n \n@@ -566,8 +566,8 @@ int cmd_clone(int argc, const char **argv, const char *prefix)\n \t\t\tstrbuf_release(&head);\n \n \t\t\tif (!our_head_points_at) {\n-\t\t\t\twarning(\"Remote branch %s not found in \"\n-\t\t\t\t\t\"upstream %s, using HEAD instead\",\n+\t\t\t\twarning(_(\"Remote branch %s not found in \"\n+\t\t\t\t\t\"upstream %s, using HEAD instead\"),\n \t\t\t\t\toption_branch, option_origin);\n \t\t\t\tour_head_points_at = remote_head_points_at;\n \t\t\t}\n@@ -576,7 +576,7 @@ int cmd_clone(int argc, const char **argv, const char *prefix)\n \t\t\tour_head_points_at = remote_head_points_at;\n \t}\n \telse {\n-\t\twarning(\"You appear to have cloned an empty repository.\");\n+\t\twarning(_(\"You appear to have cloned an empty repository.\"));\n \t\tour_head_points_at = NULL;\n \t\tremote_head_points_at = NULL;\n \t\tremote_head = NULL;\n@@ -618,8 +618,8 @@ int cmd_clone(int argc, const char **argv, const char *prefix)\n \t} else {\n \t\t/* Nothing to checkout out */\n \t\tif (!option_no_checkout)\n-\t\t\twarning(\"remote HEAD refers to nonexistent ref, \"\n-\t\t\t\t\"unable to checkout.\\n\");\n+\t\t\twarning(_(\"remote HEAD refers to nonexistent ref, \"\n+\t\t\t\t\"unable to checkout.\\n\"));\n \t\toption_no_checkout = 1;\n \t}\n \n@@ -655,7 +655,7 @@ int cmd_clone(int argc, const char **argv, const char *prefix)\n \n \t\tif (write_cache(fd, active_cache, active_nr) ||\n \t\t    commit_locked_index(lock_file))\n-\t\t\tdie(\"unable to write new index file\");\n+\t\t\tdie(_(\"unable to write new index file\"));\n \n \t\terr |= run_hook(NULL, \"post-checkout\", sha1_to_hex(null_sha1),\n \t\t\t\tsha1_to_hex(our_head_points_at->old_sha1), \"1\",\n-- \n1.7.4.1\n"},{"id":"161796","messageId":"20110221101852.GI32137@elie","threadId":"26561","inReplyTo":"20110221101229.GA32137@elie","subject":"[PATCH 08/15] clone: split \"Cloning into\" message into two","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2011-02-21T10:18:53Z","receivedAt":"2011-02-21T10:18:53Z","isPatch":true,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"From: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\nDate: Wed, 1 Sep 2010 15:54:30 +0000\n\nSeparate the \"Cloning into %s\" and \"Cloning into bare repository %s\"\nmessages to make them easier to translate.  No noticeable change\nintended.\n\nSigned-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\nSigned-off-by: Jonathan Nieder <jrnieder@gmail.com>\n---\n builtin/clone.c |    9 ++++++---\n 1 files changed, 6 insertions(+), 3 deletions(-)\n\ndiff --git a/builtin/clone.c b/builtin/clone.c\nindex f46d09b..db0240d 100644\n--- a/builtin/clone.c\n+++ b/builtin/clone.c\n@@ -468,9 +468,12 @@ int cmd_clone(int argc, const char **argv, const char *prefix)\n \t\tdie(_(\"could not create leading directories of '%s'\"), git_dir);\n \tset_git_dir(make_absolute_path(git_dir));\n \n-\tif (0 <= option_verbosity)\n-\t\tprintf(\"Cloning into %s%s...\\n\",\n-\t\t       option_bare ? \"bare repository \" : \"\", dir);\n+\tif (0 <= option_verbosity) {\n+\t\tif (option_bare)\n+\t\t\tprintf(\"Cloning into bare repository %s...\\n\", dir);\n+\t\telse\n+\t\t\tprintf(\"Cloning into %s...\\n\", dir);\n+\t}\n \tinit_db(option_template, INIT_DB_QUIET);\n \n \t/*\n-- \n1.7.4.1\n"},{"id":"161797","messageId":"20110221101919.GJ32137@elie","threadId":"26561","inReplyTo":"20110221101229.GA32137@elie","subject":"[PATCH 09/15] clone: mark \"Cloning into\" message for translation","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2011-02-21T10:19:19Z","receivedAt":"2011-02-21T10:19:19Z","isPatch":true,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"From: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\nDate: Wed, 1 Sep 2010 15:54:30 +0000\n\nSigned-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\nSigned-off-by: Jonathan Nieder <jrnieder@gmail.com>\n---\n builtin/clone.c  |    4 ++--\n t/t5601-clone.sh |    2 +-\n 2 files changed, 3 insertions(+), 3 deletions(-)\n\ndiff --git a/builtin/clone.c b/builtin/clone.c\nindex db0240d..b9394c4 100644\n--- a/builtin/clone.c\n+++ b/builtin/clone.c\n@@ -470,9 +470,9 @@ int cmd_clone(int argc, const char **argv, const char *prefix)\n \n \tif (0 <= option_verbosity) {\n \t\tif (option_bare)\n-\t\t\tprintf(\"Cloning into bare repository %s...\\n\", dir);\n+\t\t\tprintf(_(\"Cloning into bare repository %s...\\n\"), dir);\n \t\telse\n-\t\t\tprintf(\"Cloning into %s...\\n\", dir);\n+\t\t\tprintf(_(\"Cloning into %s...\\n\"), dir);\n \t}\n \tinit_db(option_template, INIT_DB_QUIET);\n \ndiff --git a/t/t5601-clone.sh b/t/t5601-clone.sh\nindex 987e0c8..9e6fa3b 100755\n--- a/t/t5601-clone.sh\n+++ b/t/t5601-clone.sh\n@@ -31,7 +31,7 @@ test_expect_success 'clone with excess parameters (2)' '\n \n '\n \n-test_expect_success 'output from clone' '\n+test_expect_success C_LOCALE_OUTPUT 'output from clone' '\n \trm -fr dst &&\n \tgit clone -n \"file://$(pwd)/src\" dst >output &&\n \ttest $(grep Clon output | wc -l) = 1\n-- \n1.7.4.1\n"},{"id":"161799","messageId":"20110221102430.GK32137@elie","threadId":"26561","inReplyTo":"20110221101229.GA32137@elie","subject":"[PATCH 10/15] add: mark basic messages for translation","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2011-02-21T10:24:30Z","receivedAt":"2011-02-21T10:24:30Z","isPatch":true,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"From: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\nDate: Wed, 1 Sep 2010 18:40:13 +0000\n\nSigned-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\nSigned-off-by: Jonathan Nieder <jrnieder@gmail.com>\n---\n builtin/add.c |   36 ++++++++++++++++++------------------\n 1 files changed, 18 insertions(+), 18 deletions(-)\n\ndiff --git a/builtin/add.c b/builtin/add.c\nindex 42c906e..a9a78f4 100644\n--- a/builtin/add.c\n+++ b/builtin/add.c\n@@ -38,7 +38,7 @@ static void update_callback(struct diff_queue_struct *q,\n \t\tconst char *path = p->one->path;\n \t\tswitch (p->status) {\n \t\tdefault:\n-\t\t\tdie(\"unexpected diff status %c\", p->status);\n+\t\t\tdie(_(\"unexpected diff status %c\"), p->status);\n \t\tcase DIFF_STATUS_UNMERGED:\n \t\t\t/*\n \t\t\t * ADD_CACHE_IGNORE_REMOVAL is unset if \"git\n@@ -64,7 +64,7 @@ static void update_callback(struct diff_queue_struct *q,\n \t\tcase DIFF_STATUS_TYPE_CHANGED:\n \t\t\tif (add_file_to_index(&the_index, path, data->flags)) {\n \t\t\t\tif (!(data->flags & ADD_CACHE_IGNORE_ERRORS))\n-\t\t\t\t\tdie(\"updating files failed\");\n+\t\t\t\t\tdie(_(\"updating files failed\"));\n \t\t\t\tdata->add_errors++;\n \t\t\t}\n \t\t\tbreak;\n@@ -172,7 +172,7 @@ static void treat_gitlinks(const char **pathspec)\n \t\t\t\t\t/* strip trailing slash */\n \t\t\t\t\tpathspec[j] = xstrndup(ce->name, len);\n \t\t\t\telse\n-\t\t\t\t\tdie (\"Path '%s' is in submodule '%.*s'\",\n+\t\t\t\t\tdie (_(\"Path '%s' is in submodule '%.*s'\"),\n \t\t\t\t\t\tpathspec[j], len, ce->name);\n \t\t\t}\n \t\t}\n@@ -191,7 +191,7 @@ static void refresh(int verbose, const char **pathspec)\n \t\t      pathspec, seen, \"Unstaged changes after refreshing the index:\");\n \tfor (i = 0; i < specs; i++) {\n \t\tif (!seen[i])\n-\t\t\tdie(\"pathspec '%s' did not match any files\", pathspec[i]);\n+\t\t\tdie(_(\"pathspec '%s' did not match any files\"), pathspec[i]);\n \t}\n         free(seen);\n }\n@@ -205,7 +205,7 @@ static const char **validate_pathspec(int argc, const char **argv, const char *p\n \t\tfor (p = pathspec; *p; p++) {\n \t\t\tif (has_symlink_leading_path(*p, strlen(*p))) {\n \t\t\t\tint len = prefix ? strlen(prefix) : 0;\n-\t\t\t\tdie(\"'%s' is beyond a symbolic link\", *p + len);\n+\t\t\t\tdie(_(\"'%s' is beyond a symbolic link\"), *p + len);\n \t\t\t}\n \t\t}\n \t}\n@@ -272,7 +272,7 @@ static int edit_patch(int argc, const char **argv, const char *prefix)\n \tgit_config(git_diff_basic_config, NULL); /* no \"diff\" UI options */\n \n \tif (read_cache() < 0)\n-\t\tdie (\"Could not read the index\");\n+\t\tdie (_(\"Could not read the index\"));\n \n \tinit_revisions(&rev, prefix);\n \trev.diffopt.context = 7;\n@@ -281,24 +281,24 @@ static int edit_patch(int argc, const char **argv, const char *prefix)\n \trev.diffopt.output_format = DIFF_FORMAT_PATCH;\n \tout = open(file, O_CREAT | O_WRONLY, 0644);\n \tif (out < 0)\n-\t\tdie (\"Could not open '%s' for writing.\", file);\n+\t\tdie (_(\"Could not open '%s' for writing.\"), file);\n \trev.diffopt.file = xfdopen(out, \"w\");\n \trev.diffopt.close_file = 1;\n \tif (run_diff_files(&rev, 0))\n-\t\tdie (\"Could not write patch\");\n+\t\tdie (_(\"Could not write patch\"));\n \n \tlaunch_editor(file, NULL, NULL);\n \n \tif (stat(file, &st))\n-\t\tdie_errno(\"Could not stat '%s'\", file);\n+\t\tdie_errno(_(\"Could not stat '%s'\"), file);\n \tif (!st.st_size)\n-\t\tdie(\"Empty patch. Aborted.\");\n+\t\tdie(_(\"Empty patch. Aborted.\"));\n \n \tmemset(&child, 0, sizeof(child));\n \tchild.git_cmd = 1;\n \tchild.argv = apply_argv;\n \tif (run_command(&child))\n-\t\tdie (\"Could not apply '%s'\", file);\n+\t\tdie (_(\"Could not apply '%s'\"), file);\n \n \tunlink(file);\n \treturn 0;\n@@ -354,7 +354,7 @@ static int add_files(struct dir_struct *dir, int flags)\n \tfor (i = 0; i < dir->nr; i++)\n \t\tif (add_file_to_cache(dir->entries[i]->name, flags)) {\n \t\t\tif (!ignore_add_errors)\n-\t\t\t\tdie(\"adding files failed\");\n+\t\t\t\tdie(_(\"adding files failed\"));\n \t\t\texit_status = 1;\n \t\t}\n \treturn exit_status;\n@@ -386,9 +386,9 @@ int cmd_add(int argc, const char **argv, const char *prefix)\n \targv++;\n \n \tif (addremove && take_worktree_changes)\n-\t\tdie(\"-A and -u are mutually incompatible\");\n+\t\tdie(_(\"-A and -u are mutually incompatible\"));\n \tif (!show_only && ignore_missing)\n-\t\tdie(\"Option --ignore-missing can only be used together with --dry-run\");\n+\t\tdie(_(\"Option --ignore-missing can only be used together with --dry-run\"));\n \tif ((addremove || take_worktree_changes) && !argc) {\n \t\tstatic const char *here[2] = { \".\", NULL };\n \t\targc = 1;\n@@ -408,14 +408,14 @@ int cmd_add(int argc, const char **argv, const char *prefix)\n \t\t  ? ADD_CACHE_IGNORE_REMOVAL : 0));\n \n \tif (require_pathspec && argc == 0) {\n-\t\tfprintf(stderr, \"Nothing specified, nothing added.\\n\");\n-\t\tfprintf(stderr, \"Maybe you wanted to say 'git add .'?\\n\");\n+\t\tfprintf(stderr, _(\"Nothing specified, nothing added.\\n\"));\n+\t\tfprintf(stderr, _(\"Maybe you wanted to say 'git add .'?\\n\"));\n \t\treturn 0;\n \t}\n \tpathspec = validate_pathspec(argc, argv, prefix);\n \n \tif (read_cache() < 0)\n-\t\tdie(\"index file corrupt\");\n+\t\tdie(_(\"index file corrupt\"));\n \ttreat_gitlinks(pathspec);\n \n \tif (add_new_files) {\n@@ -467,7 +467,7 @@ int cmd_add(int argc, const char **argv, const char *prefix)\n \tif (active_cache_changed) {\n \t\tif (write_cache(newfd, active_cache, active_nr) ||\n \t\t    commit_locked_index(&lock_file))\n-\t\t\tdie(\"Unable to write new index file\");\n+\t\t\tdie(_(\"Unable to write new index file\"));\n \t}\n \n \treturn exit_status;\n-- \n1.7.4.1\n"},{"id":"161800","messageId":"20110221102530.GL32137@elie","threadId":"26561","inReplyTo":"20110221101229.GA32137@elie","subject":"[PATCH 11/15] add: mark \"The following paths are ignored\" for translation","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2011-02-21T10:25:30Z","receivedAt":"2011-02-21T10:25:30Z","isPatch":true,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"From: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\nDate: Wed, 22 Sep 2010 19:20:25 +0000\n\nt2204 (.gitignore) and t3700 (add) explicitly check this sequence of\nmessages, so while at it, split each relevant test into a part that\njust checks \"git add\"'s exit status and a part that checks porcelain\noutput.\n\nSigned-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\nSigned-off-by: Jonathan Nieder <jrnieder@gmail.com>\n---\n builtin/add.c          |    8 ++++----\n t/t2204-add-ignored.sh |   37 +++++++++++++++++++++++++------------\n t/t3700-add.sh         |    5 ++++-\n 3 files changed, 33 insertions(+), 17 deletions(-)\n\ndiff --git a/builtin/add.c b/builtin/add.c\nindex a9a78f4..21776ac 100644\n--- a/builtin/add.c\n+++ b/builtin/add.c\n@@ -307,7 +307,7 @@ static int edit_patch(int argc, const char **argv, const char *prefix)\n static struct lock_file lock_file;\n \n static const char ignore_error[] =\n-\"The following paths are ignored by one of your .gitignore files:\\n\";\n+N_(\"The following paths are ignored by one of your .gitignore files:\\n\");\n \n static int verbose = 0, show_only = 0, ignored_too = 0, refresh_only = 0;\n static int ignore_add_errors, addremove, intent_to_add, ignore_missing = 0;\n@@ -344,11 +344,11 @@ static int add_files(struct dir_struct *dir, int flags)\n \tint i, exit_status = 0;\n \n \tif (dir->ignored_nr) {\n-\t\tfprintf(stderr, ignore_error);\n+\t\tfprintf(stderr, _(ignore_error));\n \t\tfor (i = 0; i < dir->ignored_nr; i++)\n \t\t\tfprintf(stderr, \"%s\\n\", dir->ignored[i]->name);\n-\t\tfprintf(stderr, \"Use -f if you really want to add them.\\n\");\n-\t\tdie(\"no files added\");\n+\t\tfprintf(stderr, _(\"Use -f if you really want to add them.\\n\"));\n+\t\tdie(_(\"no files added\"));\n \t}\n \n \tfor (i = 0; i < dir->nr; i++)\ndiff --git a/t/t2204-add-ignored.sh b/t/t2204-add-ignored.sh\nindex 24afdab..4975336 100755\n--- a/t/t2204-add-ignored.sh\n+++ b/t/t2204-add-ignored.sh\n@@ -31,18 +31,21 @@ do\n \t\trm -f .git/index &&\n \t\ttest_must_fail git add \"$i\" 2>err &&\n \t\tgit ls-files \"$i\" >out &&\n-\t\t! test -s out &&\n-\t\tgrep -e \"Use -f if\" err &&\n-\t\tcat err\n+\t\t! test -s out\n+\t'\n+\n+\ttest_expect_success C_LOCALE_OUTPUT \"complaints for ignored $i output\" '\n+\t\tgrep -e \"Use -f if\" err\n \t'\n \n \ttest_expect_success \"complaints for ignored $i with unignored file\" '\n \t\trm -f .git/index &&\n \t\ttest_must_fail git add \"$i\" file 2>err &&\n \t\tgit ls-files \"$i\" >out &&\n-\t\t! test -s out &&\n-\t\tgrep -e \"Use -f if\" err &&\n-\t\tcat err\n+\t\t! test -s out\n+\t'\n+\ttest_expect_success C_LOCALE_OUTPUT \"complaints for ignored $i with unignored file output\" '\n+\t\tgrep -e \"Use -f if\" err\n \t'\n done\n \n@@ -54,9 +57,14 @@ do\n \t\t\tcd dir &&\n \t\t\ttest_must_fail git add \"$i\" 2>err &&\n \t\t\tgit ls-files \"$i\" >out &&\n-\t\t\t! test -s out &&\n-\t\t\tgrep -e \"Use -f if\" err &&\n-\t\t\tcat err\n+\t\t\t! test -s out\n+\t\t)\n+\t'\n+\n+\ttest_expect_success C_LOCALE_OUTPUT \"complaints for ignored $i in dir output\" '\n+\t\t(\n+\t\t\tcd dir &&\n+\t\t\tgrep -e \"Use -f if\" err\n \t\t)\n \t'\n done\n@@ -69,9 +77,14 @@ do\n \t\t\tcd sub &&\n \t\t\ttest_must_fail git add \"$i\" 2>err &&\n \t\t\tgit ls-files \"$i\" >out &&\n-\t\t\t! test -s out &&\n-\t\t\tgrep -e \"Use -f if\" err &&\n-\t\t\tcat err\n+\t\t\t! test -s out\n+\t\t)\n+\t'\n+\n+\ttest_expect_success C_LOCALE_OUTPUT \"complaints for ignored $i in sub output\" '\n+\t\t(\n+\t\t\tcd sub &&\n+\t\t\tgrep -e \"Use -f if\" err\n \t\t)\n \t'\n done\ndiff --git a/t/t3700-add.sh b/t/t3700-add.sh\nindex ec71083..ac115ed 100755\n--- a/t/t3700-add.sh\n+++ b/t/t3700-add.sh\n@@ -283,7 +283,10 @@ add 'track-this'\n EOF\n \n test_expect_success 'git add --dry-run --ignore-missing of non-existing file' '\n-\ttest_must_fail git add --dry-run --ignore-missing track-this ignored-file >actual.out 2>actual.err &&\n+\ttest_must_fail git add --dry-run --ignore-missing track-this ignored-file >actual.out 2>actual.err\n+'\n+\n+test_expect_success C_LOCALE_OUTPUT 'git add --dry-run --ignore-missing of non-existing file output' '\n \ttest_cmp expect.out actual.out &&\n \ttest_cmp expect.err actual.err\n '\n-- \n1.7.4.1\n"},{"id":"161801","messageId":"20110221102556.GM32137@elie","threadId":"26561","inReplyTo":"20110221101229.GA32137@elie","subject":"[PATCH 12/15] add: mark \"did not match any files\" for translation","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2011-02-21T10:25:56Z","receivedAt":"2011-02-21T10:25:56Z","isPatch":true,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"From: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\nDate: Sun, 19 Sep 2010 15:48:06 +0000\n\n... and skip the test that checks for it when the C_LOCALE_OUTPUT\nprereq is not present.\n\nSigned-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\nSigned-off-by: Jonathan Nieder <jrnieder@gmail.com>\n---\n builtin/add.c  |    2 +-\n t/t3700-add.sh |    8 ++++++--\n 2 files changed, 7 insertions(+), 3 deletions(-)\n\ndiff --git a/builtin/add.c b/builtin/add.c\nindex 21776ac..ffbd459 100644\n--- a/builtin/add.c\n+++ b/builtin/add.c\n@@ -451,7 +451,7 @@ int cmd_add(int argc, const char **argv, const char *prefix)\n \t\t\t\t\tif (excluded(&dir, pathspec[i], &dtype))\n \t\t\t\t\t\tdir_add_ignored(&dir, pathspec[i], strlen(pathspec[i]));\n \t\t\t\t} else\n-\t\t\t\t\tdie(\"pathspec '%s' did not match any files\",\n+\t\t\t\t\tdie(_(\"pathspec '%s' did not match any files\"),\n \t\t\t\t\t    pathspec[i]);\n \t\t\t}\n \t\t}\ndiff --git a/t/t3700-add.sh b/t/t3700-add.sh\nindex ac115ed..7de42fa 100755\n--- a/t/t3700-add.sh\n+++ b/t/t3700-add.sh\n@@ -268,8 +268,12 @@ test_expect_success 'git add --dry-run of existing changed file' \"\n \n test_expect_success 'git add --dry-run of non-existing file' \"\n \techo ignored-file >>.gitignore &&\n-\ttest_must_fail git add --dry-run track-this ignored-file >actual 2>&1 &&\n-\techo \\\"fatal: pathspec 'ignored-file' did not match any files\\\" | test_cmp - actual\n+\ttest_must_fail git add --dry-run track-this ignored-file >actual 2>&1\n+\"\n+\n+test_expect_success C_LOCALE_OUTPUT 'git add --dry-run of an existing file output' \"\n+\techo \\\"fatal: pathspec 'ignored-file' did not match any files\\\" >expect &&\n+\ttest_cmp expect actual\n \"\n \n cat >expect.err <<\\EOF\n-- \n1.7.4.1\n"},{"id":"161802","messageId":"20110221102625.GN32137@elie","threadId":"26561","inReplyTo":"20110221101229.GA32137@elie","subject":"[PATCH 13/15] add -u --verbose: mark \"remove '%s'\" for translation","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2011-02-21T10:26:25Z","receivedAt":"2011-02-21T10:26:25Z","isPatch":true,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"From: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\nDate: Sun, 19 Sep 2010 14:48:59 +0000\n\n... and skip the corresponding test when output is not in the\nC locale.\n\nSigned-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\nSigned-off-by: Jonathan Nieder <jrnieder@gmail.com>\n---\n builtin/add.c         |    2 +-\n t/t2200-add-update.sh |    2 +-\n 2 files changed, 2 insertions(+), 2 deletions(-)\n\ndiff --git a/builtin/add.c b/builtin/add.c\nindex ffbd459..33b9970 100644\n--- a/builtin/add.c\n+++ b/builtin/add.c\n@@ -74,7 +74,7 @@ static void update_callback(struct diff_queue_struct *q,\n \t\t\tif (!(data->flags & ADD_CACHE_PRETEND))\n \t\t\t\tremove_file_from_index(&the_index, path);\n \t\t\tif (data->flags & (ADD_CACHE_PRETEND|ADD_CACHE_VERBOSE))\n-\t\t\t\tprintf(\"remove '%s'\\n\", path);\n+\t\t\t\tprintf(_(\"remove '%s'\\n\"), path);\n \t\t\tbreak;\n \t\t}\n \t}\ndiff --git a/t/t2200-add-update.sh b/t/t2200-add-update.sh\nindex 0692427..856e7da 100755\n--- a/t/t2200-add-update.sh\n+++ b/t/t2200-add-update.sh\n@@ -111,7 +111,7 @@ test_expect_success 'touch and then add explicitly' '\n \n '\n \n-test_expect_success 'add -n -u should not add but just report' '\n+test_expect_success C_LOCALE_OUTPUT 'add -n -u should not add but just report' '\n \n \t(\n \t\techo \"add '\\''check'\\''\" &&\n-- \n1.7.4.1\n"},{"id":"161803","messageId":"20110221102650.GO32137@elie","threadId":"26561","inReplyTo":"20110221101229.GA32137@elie","subject":"[PATCH 14/15] update-index --refresh --porcelain: add missing const","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2011-02-21T10:26:50Z","receivedAt":"2011-02-21T10:26:50Z","isPatch":true,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>\n---\n cache.h      |    2 +-\n read-cache.c |    4 ++--\n 2 files changed, 3 insertions(+), 3 deletions(-)\n\ndiff --git a/cache.h b/cache.h\nindex a465f38..8188169 100644\n--- a/cache.h\n+++ b/cache.h\n@@ -512,7 +512,7 @@ extern void fill_stat_cache_info(struct cache_entry *ce, struct stat *st);\n #define REFRESH_IGNORE_MISSING\t0x0008\t/* ignore non-existent */\n #define REFRESH_IGNORE_SUBMODULES\t0x0010\t/* ignore submodules */\n #define REFRESH_IN_PORCELAIN\t0x0020\t/* user friendly output, not \"needs update\" */\n-extern int refresh_index(struct index_state *, unsigned int flags, const char **pathspec, char *seen, char *header_msg);\n+extern int refresh_index(struct index_state *, unsigned int flags, const char **pathspec, char *seen, const char *header_msg);\n \n struct lock_file {\n \tstruct lock_file *next;\ndiff --git a/read-cache.c b/read-cache.c\nindex 4f2e890..15b0a73 100644\n--- a/read-cache.c\n+++ b/read-cache.c\n@@ -1104,7 +1104,7 @@ static struct cache_entry *refresh_cache_ent(struct index_state *istate,\n }\n \n static void show_file(const char * fmt, const char * name, int in_porcelain,\n-\t\t      int * first, char *header_msg)\n+\t\t      int * first, const char *header_msg)\n {\n \tif (in_porcelain && *first && header_msg) {\n \t\tprintf(\"%s\\n\", header_msg);\n@@ -1114,7 +1114,7 @@ static void show_file(const char * fmt, const char * name, int in_porcelain,\n }\n \n int refresh_index(struct index_state *istate, unsigned int flags, const char **pathspec,\n-\t\t  char *seen, char *header_msg)\n+\t\t  char *seen, const char *header_msg)\n {\n \tint i;\n \tint has_errors = 0;\n-- \n1.7.4.1\n"},{"id":"161804","messageId":"20110221102917.GP32137@elie","threadId":"26561","inReplyTo":"20110221101229.GA32137@elie","subject":"[PATCH 15/15] add --refresh --verbose: mark \"Unstaged changes\" heading for translation","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2011-02-21T10:29:17Z","receivedAt":"2011-02-21T10:29:17Z","isPatch":true,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"From: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\nDate: Wed, 1 Sep 2010 18:49:22 +0000\n\nSigned-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\nSigned-off-by: Jonathan Nieder <jrnieder@gmail.com>\n---\nThat's the end of the series.  Thanks for reading.\n\nI also should say, to be clear, I will not be sending more series like\nthis (though if there are bugs in this one I'd be happy to fix them).\n\n builtin/add.c |    2 +-\n 1 files changed, 1 insertions(+), 1 deletions(-)\n\ndiff --git a/builtin/add.c b/builtin/add.c\nindex 33b9970..a512597 100644\n--- a/builtin/add.c\n+++ b/builtin/add.c\n@@ -188,7 +188,7 @@ static void refresh(int verbose, const char **pathspec)\n \t\t/* nothing */;\n \tseen = xcalloc(specs, 1);\n \trefresh_index(&the_index, verbose ? REFRESH_IN_PORCELAIN : REFRESH_QUIET,\n-\t\t      pathspec, seen, \"Unstaged changes after refreshing the index:\");\n+\t\t      pathspec, seen, _(\"Unstaged changes after refreshing the index:\"));\n \tfor (i = 0; i < specs; i++) {\n \t\tif (!seen[i])\n \t\t\tdie(_(\"pathspec '%s' did not match any files\"), pathspec[i]);\n-- \n1.7.4.1\n"},{"id":"161810","messageId":"AANLkTi=ewuq=QS=MTyOF95FUBJNoQ=f2CY53GEZOVOAL@mail.gmail.com","threadId":"26561","inReplyTo":"20110221101530.GE32137@elie","subject":"Re: [PATCH 04/15] Makefile: \"pot\" target to extract messages marked for translation","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2011-02-21T12:35:30Z","receivedAt":"2011-02-21T12:35:30Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"On Mon, Feb 21, 2011 at 11:15, Jonathan Nieder <jrnieder@gmail.com> wrote:\n> From: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n> Date: Tue, 31 Aug 2010 16:35:16 +0000\n>\n> Add rules to generate a template (po/git.pot) listing messages marked\n> for translation in the C portion of git.\n\nCan we please not apply this? I have a series of patches for this that\nI'm submitting later, it's easier for me if don't have conflicts with\nstuff like this.\n\nI don't think it's a big deal that we have _() C translations in the\nsource for some time without the capability to generate POT files from\nthem.\n"},{"id":"161811","messageId":"AANLkTikDnfUb6oCP8q7XrAqKan5GcPhyRnag2vW2ZDXW@mail.gmail.com","threadId":"26561","inReplyTo":"20110221101229.GA32137@elie","subject":"Re: [PATCH v3 00/15] Mark \"init\", \"clone\", and \"add\" output for translation","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2011-02-21T12:38:52Z","receivedAt":"2011-02-21T12:38:52Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"On Mon, Feb 21, 2011 at 11:12, Jonathan Nieder <jrnieder@gmail.com> wrote:\n> Please feel free to try it out, complain, ack, send patches, and so\n> on.\n\nThanks a lot for taking this on.\n"},{"id":"161812","messageId":"AANLkTikCvaWOQaE8628RVeAsdizVBr3vHawjwKdVJK5N@mail.gmail.com","threadId":"26561","inReplyTo":"20110221101352.GC32137@elie","subject":"Re: [PATCH 02/15] tests: add GETTEXT_POISON to simulate unfriendly translator","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2011-02-21T12:41:27Z","receivedAt":"2011-02-21T12:41:27Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"On Mon, Feb 21, 2011 at 11:13, Jonathan Nieder <jrnieder@gmail.com> wrote:\n\n>  static inline FORMAT_PRESERVING(1) const char *_(const char *msgid)\n>  {\n> -       return msgid;\n> +       return use_poison() ? \"Malkovich\" : msgid;\n>  }\n\nWhy did you change this from \"# GETTEXT POISON #\" to \"Malkovich\"?\n\nThe reason it started with a \"#\" is because many rebase tests were\nbroken otherwise.\n\nThe reason it was in all caps was so that when I run the tests in\ndebug mode it's really easy to see at a glance if I'm encountering\nthese strings.\n\nDo those tests still pass with this new string, and is there any\nreason to change this?\n"},{"id":"161813","messageId":"20110221125810.GA18427@elie","threadId":"26561","inReplyTo":"AANLkTikCvaWOQaE8628RVeAsdizVBr3vHawjwKdVJK5N@mail.gmail.com","subject":"Re: [PATCH 02/15] tests: add GETTEXT_POISON to simulate unfriendly translator","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2011-02-21T12:58:10Z","receivedAt":"2011-02-21T12:58:10Z","isPatch":true,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"Hi Ævar,\n\nÆvar Arnfjörð Bjarmason wrote:\n\n> Why did you change this from \"# GETTEXT POISON #\" to \"Malkovich\"?\n\nI forgot to mention that change in the cover letter --- thanks for a\nreminder.\n\n> Do those tests still pass with this new string, and is there any\n> reason to change this?\n\nYes, all the tests in this series still pass (on this machine, at\nleast).  Which is why I changed it --- it is a lot easier to explain\nhaving the '#' at the beginning and end of a magic string as part of a\npatch that would break tests without that change.\n\nOf course the specific string is arbitrary.  All caps sounds fine to\nme, too.\n\nHope that helps,\nJonathan\n"},{"id":"161814","messageId":"20110221130525.GB18427@elie","threadId":"26561","inReplyTo":"AANLkTi=ewuq=QS=MTyOF95FUBJNoQ=f2CY53GEZOVOAL@mail.gmail.com","subject":"Re: [PATCH 04/15] Makefile: \"pot\" target to extract messages marked for translation","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2011-02-21T13:05:25Z","receivedAt":"2011-02-21T13:05:25Z","isPatch":true,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"Ævar Arnfjörð Bjarmason wrote:\n> On Mon, Feb 21, 2011 at 11:15, Jonathan Nieder <jrnieder@gmail.com> wrote:\n\n>> Add rules to generate a template (po/git.pot) listing messages marked\n>> for translation in the C portion of git.\n>\n> Can we please not apply this?\n\nI included it in the series because I used it to test, for what it's\nworth.\n\nI also think it could be useful to translators, so they could work\nagainst git.git directly once it has enough translatable strings.\nThat sounds valuable to me.\n\nBut I have no strong preference about what actually gets applied to\ngit.git in this case.\n"},{"id":"161815","messageId":"AANLkTi=1DK8TCMjXXgM4dMiyqcxuoK9Vhc_98AL+RfxO@mail.gmail.com","threadId":"26561","inReplyTo":"20110221130525.GB18427@elie","subject":"Re: [PATCH 04/15] Makefile: \"pot\" target to extract messages marked for translation","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2011-02-21T13:14:44Z","receivedAt":"2011-02-21T13:14:44Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"On Mon, Feb 21, 2011 at 14:05, Jonathan Nieder <jrnieder@gmail.com> wrote:\n> Ævar Arnfjörð Bjarmason wrote:\n>> On Mon, Feb 21, 2011 at 11:15, Jonathan Nieder <jrnieder@gmail.com> wrote:\n>\n>>> Add rules to generate a template (po/git.pot) listing messages marked\n>>> for translation in the C portion of git.\n>>\n>> Can we please not apply this?\n>\n> I included it in the series because I used it to test, for what it's\n> worth.\n>\n> I also think it could be useful to translators, so they could work\n> against git.git directly once it has enough translatable strings.\n> That sounds valuable to me.\n\nYeah it's valuable, but I'm just optimizing this for the time I can\nspent on it, I already have a patch series that has these things. It's\nmuch easier if I can:\n\n 1. Apply C translations\n 2. Apply Shell translations\n 3. Apply Translation documentation / po/* stuff\n\nThen later:\n\n 4. Add actual gettext support\n\nBut not have to deal with bits of #3 while I do #1 and #2. That's all.\n\nSince hopefully we'll get to #3 relatively quickly I think that's OK.\n"},{"id":"161863","messageId":"7v1v30frll.fsf@alter.siamese.dyndns.org","threadId":"26561","inReplyTo":"AANLkTikDnfUb6oCP8q7XrAqKan5GcPhyRnag2vW2ZDXW@mail.gmail.com","subject":"Re: [PATCH v3 00/15] Mark \"init\", \"clone\", and \"add\" output for translation","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2011-02-22T07:36:38Z","receivedAt":"2011-02-22T07:36:38Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Ævar Arnfjörð Bjarmason <avarab@gmail.com> writes:\n\n> On Mon, Feb 21, 2011 at 11:12, Jonathan Nieder <jrnieder@gmail.com> wrote:\n>> Please feel free to try it out, complain, ack, send patches, and so\n>> on.\n>\n> Thanks a lot for taking this on.\n\nI compared this miniseries with the early part of your original.  It seems\nto contain only sane refinements, adding missed markings etc.\n"},{"id":"161872","messageId":"AANLkTimvwKHvPfbUiAmfdAC2KgaRfRBMY7fO+ESywoPD@mail.gmail.com","threadId":"26561","inReplyTo":"7v1v30frll.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH v3 00/15] Mark \"init\", \"clone\", and \"add\" output for translation","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2011-02-22T11:22:08Z","receivedAt":"2011-02-22T11:22:08Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"On Tue, Feb 22, 2011 at 08:36, Junio C Hamano <gitster@pobox.com> wrote:\n> Ævar Arnfjörð Bjarmason <avarab@gmail.com> writes:\n>\n>> On Mon, Feb 21, 2011 at 11:12, Jonathan Nieder <jrnieder@gmail.com> wrote:\n>>> Please feel free to try it out, complain, ack, send patches, and so\n>>> on.\n>>\n>> Thanks a lot for taking this on.\n>\n> I compared this miniseries with the early part of your original.  It seems\n> to contain only sane refinements, adding missed markings etc.\n\nYeah it's looking much better.\n\nI've been coordinating with Jonathan on #git-devel. Some more changes\nwere made yesterday. I'm going to pack them up and re-submit again\n(just minor nits etc). That series should be in a form that's\nacceptable for being applied as-is.\n"},{"id":"161898","messageId":"7vhbbwdjnm.fsf@alter.siamese.dyndns.org","threadId":"26561","inReplyTo":"20110221101229.GA32137@elie","subject":"Re: [PATCH v3 00/15] Mark \"init\", \"clone\", and \"add\" output for translation","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2011-02-22T18:11:09Z","receivedAt":"2011-02-22T18:11:09Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Jonathan Nieder <jrnieder@gmail.com> writes:\n\n> This series still includes the skeleton gettext.h wrapper.\n>\n> Changes from v1:\n>\n>  - clearer commit messages, hopefully\n>  - clearer documentation for GETTEXT_POISON in the makefile\n>\n> Please feel free to try it out, complain, ack, send patches, and so\n> on.\n>\n> Jonathan Nieder (2):\n>   i18n: do not poison translations unless GIT_GETTEXT_POISON envvar is\n>     set\n>   update-index --refresh --porcelain: add missing const\n\nI took this series (minus 4/15), which roughly corresponds to up to 13/72\nof Ævar's original.  A few quick comments:\n\n * 01/15\n   Thanks for guarding the header file from double inclusion.  I have this\n   nagging feeling that the inline _() function might be too clever for\n   some compilers (non gcc and perhaps older versions of gcc), but we can\n   always ifdef it away if it turns problematic.\n\n * 02/15\n   I am not entirely happy that it is a too generic name to contaminate\n   namespace of programs that may want to get i18n support while wanting\n   to catch bugs with their own unrelated poisoning scheme.\n\n   As to Malkovich, I tend to agree with your reasoning that code that\n   emit messages prefixed by \"#\" rebase relies on should be restructured\n   to limit the scope of translation to just the body of these lines, and\n   that should be done in a separate patch.\n\n * 04/15\n   Deferred per request from Ævar.\n"},{"id":"161922","messageId":"1298418152-27789-1-git-send-email-avarab@gmail.com","threadId":"26561","inReplyTo":"7vhbbwdjnm.fsf@alter.siamese.dyndns.org","subject":"[PATCH v4 00/73] No-op gettextize core Git C programs","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2011-02-22T23:41:19Z","receivedAt":"2011-02-22T23:41:19Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"This is an improved version of the no-op gettextize series for core\nGit C programs based on Jonathan Nieder's v3 series. Changes since\nthen.\n\n  * After it's applied Git will no longer fail tests when compiled\n    with GETTEXT_POISON=YesPlease. It did this because Jonathan's\n    series changed the GETTEXT POISON string. See the comment in the\n    \"simulate unfriendly translator\" patch. Regarding Junio's comment:\n    \n      As to Malkovich, I tend to agree with your reasoning that code that\n      emit messages prefixed by \"#\" rebase relies on should be restructured\n      to limit the scope of translation to just the body of these lines, and\n      that should be done in a separate patch.\n\n    I agree. I'll change it to just \"GETTEXT POISON\" in a later\n    patch. But I'd prefer not to break git in any testing mode until\n    then.\n    \n  * Reverted back to using the \"gettextize\" patch subjects I\n    originally used. I'm using these consistetly so I can later git\n    log --grep=gettextize: to find them. I'd like to preserve that\n    attributed.\n\n  * Amended and improved some log messages.\n\nOther than that it's the same. For this to compile without warnings\nyou first need the \"Add missing const to char* declarations\" series\nI've just submitted. But otherwise it's all good to go.\n\nJonathan Nieder (1):\n  gettext: do not poison translations unless GIT_GETTEXT_POISON envvar\n    is set\n\nÆvar Arnfjörð Bjarmason (72):\n  gettext: add no-op _() and N_() wrappers\n  gettext tests: add GETTEXT_POISON to simulate unfriendly translator\n  Makefile: \"pot\" target to extract messages marked for translation\n  gettextize: git-init basic messages\n  gettextize: git-init \"Initialized [...] repository\" message\n  gettextize: git-clone basic messages\n  gettextize: git-clone \"Cloning into\" message\n  gettextize: git-clone \"Cloning into\" message\n  gettextize: git-add basic messages\n  gettextize: git-add \"The following paths are ignored\" message\n  gettextize: git-add \"did not match any files\" message\n  gettextize: git-add \"remove '%s'\" message\n  gettextize: git-add \"Unstaged changes\" message\n  gettextize: git-branch basic messages\n  gettextize: git-branch \"remote branch '%s' not found\" message\n  gettextize: git-branch \"Deleted branch [...]\" message\n  gettextize: git-branch \"git branch -v\" messages\n  gettextize: git-branch \"(no branch)\" message\n  gettextize: git-checkout basic messages\n  gettextize: git-checkout: our/their version message\n  gettextize: git-checkout describe_detached_head messages\n  gettextize: git-checkout \"HEAD is now at\" message\n  gettextize: git-checkout \"Switched to a .. branch\" message\n  gettextize: git-commit basic messages\n  gettextize: git-commit \"middle of a merge\" message\n  gettextize: git-commit formatting messages\n  gettextize: git-commit print_summary messages\n  gettextize: git-commit \"enter the commit message\" message\n  gettextize: git-commit advice messages\n  gettextize: git-diff basic messages\n  gettextize: git-fetch basic messages\n  gettextize: git-fetch formatting messages\n  gettextize: git-fetch update_local_ref messages\n  gettextize: git-fetch split up \"(non-fast-forward)\" message\n  gettextize: git-grep basic messages\n  gettextize: git-grep \"--open-files-in-pager\" message\n  gettextize: git-log basic messages\n  gettextize: git-log \"--OPT does not make sense\" messages\n  gettextize: git-merge basic messages\n  gettextize: git-merge \"Updating %s..%s\" message\n  gettextize: git-merge \"You have not concluded your merge\" messages\n  gettextize: git-merge \"Wonderful\" message\n  gettextize: git-mv basic messages\n  gettextize: git-mv \"bad\" messages\n  gettextize: git-rm basic messages\n  gettextize: git-reset basic messages\n  gettextize: git-reset reset_type_names messages\n  gettextize: git-reset \"Unstaged changes after reset\" message\n  gettextize: git-tag basic messages\n  gettextize: git-tag tag_template message\n  gettextize: git-push basic messages\n  gettextize: git-push \"prevent you from losing\" message\n  gettextize: git-status basic messages\n  gettextize: git-status \"nothing to commit\" messages\n  gettextize: git-status shortstatus messages\n  gettextize: git-status \"Changes to be committed\" message\n  gettextize: git-status \"Initial commit\" message\n  gettextize: git-status \"renamed: \" message\n  gettextize: git-archive basic messages\n  gettextize: git-bundle basic messages\n  gettextize: git-clean basic messages\n  gettextize: git-clean clean.requireForce messages\n  gettextize: git-describe basic messages\n  gettextize: git-gc basic messages\n  gettextize: git-gc \"Auto packing the repository\" message\n  gettextize: git-notes basic commands\n  gettextize: git-notes GIT_NOTES_REWRITE_MODE error message\n  gettextize: git-revert basic messages\n  gettextize: git-revert \"Your local changes\" message\n  gettextize: git-revert literal \"me\" messages\n  gettextize: git-revert split up \"could not revert/apply\" message\n  gettextize: git-shortlog basic messages\n\n Makefile                         |   27 ++++++\n builtin/add.c                    |   50 ++++++------\n builtin/archive.c                |   14 ++--\n builtin/branch.c                 |   69 ++++++++--------\n builtin/bundle.c                 |    6 +-\n builtin/checkout.c               |   93 +++++++++++-----------\n builtin/clean.c                  |   33 +++++---\n builtin/clone.c                  |   63 ++++++++-------\n builtin/commit.c                 |  162 +++++++++++++++++++-------------------\n builtin/describe.c               |   36 ++++----\n builtin/diff.c                   |   18 ++--\n builtin/fetch.c                  |   82 ++++++++++----------\n builtin/gc.c                     |   24 +++---\n builtin/grep.c                   |   34 ++++----\n builtin/init-db.c                |   58 ++++++++------\n builtin/log.c                    |   68 ++++++++--------\n builtin/merge.c                  |  128 +++++++++++++++---------------\n builtin/mv.c                     |   32 ++++----\n builtin/notes.c                  |  112 +++++++++++++-------------\n builtin/push.c                   |   42 +++++-----\n builtin/reset.c                  |   42 +++++-----\n builtin/revert.c                 |   76 ++++++++++--------\n builtin/rm.c                     |   22 +++---\n builtin/shortlog.c               |    8 +-\n builtin/tag.c                    |   66 ++++++++--------\n cache.h                          |    1 +\n gettext.c                        |   14 +++\n gettext.h                        |   32 ++++++++\n po/.gitignore                    |    1 +\n t/lib-httpd.sh                   |    2 +-\n t/t0001-init.sh                  |    2 +-\n t/t1200-tutorial.sh              |    5 +-\n t/t2200-add-update.sh            |    2 +-\n t/t2204-add-ignored.sh           |   37 ++++++---\n t/t3030-merge-recursive.sh       |    2 +-\n t/t3200-branch.sh                |    2 +-\n t/t3203-branch-output.sh         |    2 +-\n t/t3501-revert-cherry-pick.sh    |    2 +-\n t/t3507-cherry-pick-conflict.sh  |    2 +-\n t/t3700-add.sh                   |   13 +++-\n t/t4001-diff-rename.sh           |    4 +-\n t/t4014-format-patch.sh          |    2 +-\n t/t5526-fetch-submodules.sh      |   40 ++++++++--\n t/t5541-http-push.sh             |    7 +-\n t/t5601-clone.sh                 |    2 +-\n t/t6040-tracking-info.sh         |    2 +-\n t/t6120-describe.sh              |    2 +-\n t/t7004-tag.sh                   |    1 +\n t/t7012-skip-worktree-writing.sh |    4 +-\n t/t7060-wtstatus.sh              |    2 +-\n t/t7102-reset.sh                 |    2 +-\n t/t7110-reset-merge.sh           |    6 +-\n t/t7201-co.sh                    |   10 +-\n t/t7300-clean.sh                 |    6 +-\n t/t7500-commit.sh                |    8 +-\n t/t7501-commit.sh                |    7 +-\n t/t7502-commit.sh                |   60 +++++++++------\n t/t7506-status-submodule.sh      |   28 +++---\n t/t7508-status.sh                |  115 +++++++++++++++------------\n t/t7600-merge.sh                 |    2 +-\n t/t7607-merge-overwrite.sh       |   10 ++-\n t/t7611-merge-abort.sh           |   20 ++++-\n t/t7811-grep-open.sh             |    2 +-\n t/test-lib.sh                    |    9 ++\n wt-status.c                      |  116 ++++++++++++++--------------\n 65 files changed, 1084 insertions(+), 867 deletions(-)\n create mode 100644 gettext.c\n create mode 100644 gettext.h\n create mode 100644 po/.gitignore\n\n-- \n1.7.2.3\n"},{"id":"161923","messageId":"1298418152-27789-2-git-send-email-avarab@gmail.com","threadId":"26561","inReplyTo":"7vhbbwdjnm.fsf@alter.siamese.dyndns.org","subject":"[PATCH v4 01/73] gettext: add no-op _() and N_() wrappers","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2011-02-22T23:41:20Z","receivedAt":"2011-02-22T23:41:20Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"The _ function is for translating strings into the user's chosen\nlanguage.  The N_ macro just marks translatable strings for the\nxgettext(1) tool without translating them; it is intended for use in\ncontexts where a function call cannot be used.  So, for example:\n\n\tfprintf(stderr, _(\"Expansion of alias '%s' failed; \"\n\t\t\"'%s' is not a git command\\n\"),\n\t\tcmd, argv[0]);\n\nand\n\n\tconst char *unpack_plumbing_errors[NB_UNPACK_TREES_ERROR_TYPES] = {\n\t\t/* ERROR_WOULD_OVERWRITE */\n\t\tN_(\"Entry '%s' would be overwritten by merge. Cannot merge.\"),\n\t[...]\n\nDefine such _ and N_ in a new gettext.h and include it in cache.h, so\nthey can be used everywhere.  Each just returns its argument for now.\n_ is a function rather than a macro like N_ to avoid the temptation to\nuse _(\"foo\") as a string literal (which would be a compile-time error\nonce _(s) expands to an expression for the translation of s).\n\nSigned-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\nSigned-off-by: Jonathan Nieder <jrnieder@gmail.com>\n---\n Makefile  |    1 +\n cache.h   |    1 +\n gettext.h |   26 ++++++++++++++++++++++++++\n 3 files changed, 28 insertions(+), 0 deletions(-)\n create mode 100644 gettext.h\n\ndiff --git a/Makefile b/Makefile\nindex ade7923..c153f45 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -515,6 +515,7 @@ LIB_H += diff.h\n LIB_H += dir.h\n LIB_H += exec_cmd.h\n LIB_H += fsck.h\n+LIB_H += gettext.h\n LIB_H += git-compat-util.h\n LIB_H += graph.h\n LIB_H += grep.h\ndiff --git a/cache.h b/cache.h\nindex 3abf895..a465f38 100644\n--- a/cache.h\n+++ b/cache.h\n@@ -5,6 +5,7 @@\n #include \"strbuf.h\"\n #include \"hash.h\"\n #include \"advice.h\"\n+#include \"gettext.h\"\n \n #include SHA1_HEADER\n #ifndef git_SHA_CTX\ndiff --git a/gettext.h b/gettext.h\nnew file mode 100644\nindex 0000000..6949d73\n--- /dev/null\n+++ b/gettext.h\n@@ -0,0 +1,26 @@\n+/*\n+ * Copyright (c) 2010-2011 Ævar Arnfjörð Bjarmason\n+ *\n+ * This is a skeleton no-op implementation of gettext for Git.\n+ * You can replace it with something that uses libintl.h and wraps\n+ * gettext() to try out the translations.\n+ */\n+\n+#ifndef GETTEXT_H\n+#define GETTEXT_H\n+\n+#ifdef _\n+#error \"namespace conflict: '_' is pre-defined?\"\n+#endif\n+\n+#define FORMAT_PRESERVING(n) __attribute__((format_arg(n)))\n+\n+static inline FORMAT_PRESERVING(1) const char *_(const char *msgid)\n+{\n+\treturn msgid;\n+}\n+\n+/* Mark msgid for translation but do not translate it. */\n+#define N_(msgid) (msgid)\n+\n+#endif\n-- \n1.7.2.3\n"},{"id":"161992","messageId":"1298418152-27789-3-git-send-email-avarab@gmail.com","threadId":"26561","inReplyTo":"7vhbbwdjnm.fsf@alter.siamese.dyndns.org","subject":"[PATCH v4 02/73] gettext tests: add GETTEXT_POISON to simulate unfriendly translator","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2011-02-22T23:41:21Z","receivedAt":"2011-02-22T23:41:21Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"Add a new GETTEXT_POISON compile-time parameter to make _(msg) always\nreturn gibberish. So now you can run\n\n\tmake GETTEXT_POISON=YesPlease\n\nto get a copy of git that functions correctly (one hopes) but produces\noutput that is in nobody's native language at all.\n\nThis is a debugging aid for people who are working on the i18n part of\nthe system, to make sure that they are not marking plumbing messages\nthat should never be translated with _().\n\nAs new strings get marked for translation, naturally a number of tests\nwill be broken in this mode. Tests that depend on output from\nPorcelain will need to be marked with the new C_LOCALE_OUTPUT test\nprerequisite. Newly failing tests that do not depend on output from\nPorcelain would be bugs due to messages that should not have been\nmarked for translation.\n\nNote that the string we're using (\"# GETTEXT POISON #\") intentionally\nstarts the pound sign. Some of Git's tests such as\nt3404-rebase-interactive.sh rely on interactive editing with a fake\neditor, and will needlessly break if the message doesn't start with\nsomething the interactive editor considers a comment.\n\nA future patch will fix fix the underlying cause of that issue by\nadding \"#\" characters to the commit advice automatically.\n\nSigned-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\nSigned-off-by: Jonathan Nieder <jrnieder@gmail.com>\n---\n Makefile      |    7 +++++++\n gettext.h     |    8 +++++++-\n t/test-lib.sh |    3 +++\n 3 files changed, 17 insertions(+), 1 deletions(-)\n\ndiff --git a/Makefile b/Makefile\nindex c153f45..c348bb7 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -216,6 +216,9 @@ all::\n #\n # Define NO_REGEX if you have no or inferior regex support in your C library.\n #\n+# Define GETTEXT_POISON if you are debugging the choice of strings marked\n+# for translation.  This will turn all strings that use gettext into gibberish.\n+#\n # Define JSMIN to point to JavaScript minifier that functions as\n # a filter to have gitweb.js minified.\n #\n@@ -1370,6 +1373,9 @@ endif\n ifdef NO_SYMLINK_HEAD\n \tBASIC_CFLAGS += -DNO_SYMLINK_HEAD\n endif\n+ifdef GETTEXT_POISON\n+\tBASIC_CFLAGS += -DGETTEXT_POISON\n+endif\n ifdef NO_STRCASESTR\n \tCOMPAT_CFLAGS += -DNO_STRCASESTR\n \tCOMPAT_OBJS += compat/strcasestr.o\n@@ -2089,6 +2095,7 @@ endif\n ifdef GIT_TEST_CMP_USE_COPIED_CONTEXT\n \t@echo GIT_TEST_CMP_USE_COPIED_CONTEXT=YesPlease >>$@\n endif\n+\t@echo GETTEXT_POISON=\\''$(subst ','\\'',$(subst ','\\'',$(GETTEXT_POISON)))'\\' >>$@\n \n ### Detect Tck/Tk interpreter path changes\n ifndef NO_TCLTK\ndiff --git a/gettext.h b/gettext.h\nindex 6949d73..3d7cf44 100644\n--- a/gettext.h\n+++ b/gettext.h\n@@ -15,9 +15,15 @@\n \n #define FORMAT_PRESERVING(n) __attribute__((format_arg(n)))\n \n+#ifdef GETTEXT_POISON\n+#define use_poison() 1\n+#else\n+#define use_poison() 0\n+#endif\n+\n static inline FORMAT_PRESERVING(1) const char *_(const char *msgid)\n {\n-\treturn msgid;\n+\treturn use_poison() ? \"# GETTEXT POISON #\" : msgid;\n }\n \n /* Mark msgid for translation but do not translate it. */\ndiff --git a/t/test-lib.sh b/t/test-lib.sh\nindex 0fdc541..0840e4a 100644\n--- a/t/test-lib.sh\n+++ b/t/test-lib.sh\n@@ -1079,6 +1079,9 @@ esac\n test -z \"$NO_PERL\" && test_set_prereq PERL\n test -z \"$NO_PYTHON\" && test_set_prereq PYTHON\n \n+# Can we rely on git's output in the C locale?\n+test -z \"$GETTEXT_POISON\" && test_set_prereq C_LOCALE_OUTPUT\n+\n # test whether the filesystem supports symbolic links\n ln -s x y 2>/dev/null && test -h y 2>/dev/null && test_set_prereq SYMLINKS\n rm -f y\n-- \n1.7.2.3\n"},{"id":"161921","messageId":"1298418152-27789-4-git-send-email-avarab@gmail.com","threadId":"26561","inReplyTo":"7vhbbwdjnm.fsf@alter.siamese.dyndns.org","subject":"[PATCH v4 03/73] gettext: do not poison translations unless GIT_GETTEXT_POISON envvar is set","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2011-02-22T23:41:22Z","receivedAt":"2011-02-22T23:41:22Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"From: Jonathan Nieder <jrnieder@gmail.com>\n\nTweak the GETTEXT_POISON facility so it is activated at run time\ninstead of compile time.  If the GIT_GETTEXT_POISON environment\nvariable is set, _(msg) will result in gibberish as before; but if the\nGIT_GETTEXT_POISON variable is not set, it will return the message for\nhuman-readable output.  So the behavior of mistranslated and\nuntranslated git can be compared without rebuilding git in between.\n\nFor simplicity we always set the GIT_GETTEXT_POISON variable in tests.\n\nThis does not affect builds without the GETTEXT_POISON compile-time\noption set, so non-i18n git will not be slowed down.\n\nSigned-off-by: Jonathan Nieder <jrnieder@gmail.com>\n---\n Makefile      |    5 ++++-\n gettext.c     |   14 ++++++++++++++\n gettext.h     |    2 +-\n t/test-lib.sh |    8 +++++++-\n 4 files changed, 26 insertions(+), 3 deletions(-)\n create mode 100644 gettext.c\n\ndiff --git a/Makefile b/Makefile\nindex c348bb7..4e9d935 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -217,7 +217,9 @@ all::\n # Define NO_REGEX if you have no or inferior regex support in your C library.\n #\n # Define GETTEXT_POISON if you are debugging the choice of strings marked\n-# for translation.  This will turn all strings that use gettext into gibberish.\n+# for translation.  In a GETTEXT_POISON build, you can turn all strings marked\n+# for translation into gibberish by setting the GIT_GETTEXT_POISON variable\n+# (to any value) in your environment.\n #\n # Define JSMIN to point to JavaScript minifier that functions as\n # a filter to have gitweb.js minified.\n@@ -1374,6 +1376,7 @@ ifdef NO_SYMLINK_HEAD\n \tBASIC_CFLAGS += -DNO_SYMLINK_HEAD\n endif\n ifdef GETTEXT_POISON\n+\tLIB_OBJS += gettext.o\n \tBASIC_CFLAGS += -DGETTEXT_POISON\n endif\n ifdef NO_STRCASESTR\ndiff --git a/gettext.c b/gettext.c\nnew file mode 100644\nindex 0000000..9688c8b\n--- /dev/null\n+++ b/gettext.c\n@@ -0,0 +1,14 @@\n+/*\n+ * Copyright (c) 2010 Ævar Arnfjörð Bjarmason\n+ */\n+\n+#include \"git-compat-util.h\"\n+#include \"gettext.h\"\n+\n+int use_poison(void)\n+{\n+\tstatic int poison_requested = -1;\n+\tif (poison_requested == -1)\n+\t\tpoison_requested = getenv(\"GIT_GETTEXT_POISON\") ? 1 : 0;\n+\treturn poison_requested;\n+}\ndiff --git a/gettext.h b/gettext.h\nindex 3d7cf44..ee7d41d 100644\n--- a/gettext.h\n+++ b/gettext.h\n@@ -16,7 +16,7 @@\n #define FORMAT_PRESERVING(n) __attribute__((format_arg(n)))\n \n #ifdef GETTEXT_POISON\n-#define use_poison() 1\n+extern int use_poison(void);\n #else\n #define use_poison() 0\n #endif\ndiff --git a/t/test-lib.sh b/t/test-lib.sh\nindex 0840e4a..f4c1e04 100644\n--- a/t/test-lib.sh\n+++ b/t/test-lib.sh\n@@ -1080,7 +1080,13 @@ test -z \"$NO_PERL\" && test_set_prereq PERL\n test -z \"$NO_PYTHON\" && test_set_prereq PYTHON\n \n # Can we rely on git's output in the C locale?\n-test -z \"$GETTEXT_POISON\" && test_set_prereq C_LOCALE_OUTPUT\n+if test -n \"$GETTEXT_POISON\"\n+then\n+\tGIT_GETTEXT_POISON=YesPlease\n+\texport GIT_GETTEXT_POISON\n+else\n+\ttest_set_prereq C_LOCALE_OUTPUT\n+fi\n \n # test whether the filesystem supports symbolic links\n ln -s x y 2>/dev/null && test -h y 2>/dev/null && test_set_prereq SYMLINKS\n-- \n1.7.2.3\n"},{"id":"161986","messageId":"1298418152-27789-5-git-send-email-avarab@gmail.com","threadId":"26561","inReplyTo":"7vhbbwdjnm.fsf@alter.siamese.dyndns.org","subject":"[PATCH v4 04/73] Makefile: \"pot\" target to extract messages marked for translation","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2011-02-22T23:41:23Z","receivedAt":"2011-02-22T23:41:23Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"Add rules to generate a template (po/git.pot) listing messages marked\nfor translation in the C portion of git.\n\nTo get started translating, just run \"make pot\".\n\nSigned-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\nSigned-off-by: Jonathan Nieder <jrnieder@gmail.com>\n---\n Makefile      |   16 ++++++++++++++++\n po/.gitignore |    1 +\n 2 files changed, 17 insertions(+), 0 deletions(-)\n create mode 100644 po/.gitignore\n\ndiff --git a/Makefile b/Makefile\nindex 4e9d935..1cc6c60 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -321,6 +321,7 @@ INSTALL = install\n RPMBUILD = rpmbuild\n TCL_PATH = tclsh\n TCLTK_PATH = wish\n+XGETTEXT = xgettext\n PTHREAD_LIBS = -lpthread\n PTHREAD_CFLAGS =\n GCOV = gcov\n@@ -1590,6 +1591,7 @@ ifndef V\n \tQUIET_BUILT_IN = @echo '   ' BUILTIN $@;\n \tQUIET_GEN      = @echo '   ' GEN $@;\n \tQUIET_LNCP     = @echo '   ' LN/CP $@;\n+\tQUIET_XGETTEXT = @echo '   ' XGETTEXT $@;\n \tQUIET_GCOV     = @echo '   ' GCOV $@;\n \tQUIET_SUBDIR0  = +@subdir=\n \tQUIET_SUBDIR1  = ;$(NO_SUBDIR) echo '   ' SUBDIR $$subdir; \\\n@@ -2057,6 +2059,20 @@ info:\n pdf:\n \t$(MAKE) -C Documentation pdf\n \n+XGETTEXT_FLAGS = \\\n+\t--force-po \\\n+\t--add-comments \\\n+\t--msgid-bugs-address=\"Git Mailing List <git@vger.kernel.org>\" \\\n+\t--from-code=UTF-8\n+XGETTEXT_FLAGS_C = $(XGETTEXT_FLAGS) --keyword=_ --keyword=N_ --language=C\n+LOCALIZED_C := $(C_OBJ:o=c)\n+\n+po/git.pot: $(LOCALIZED_C)\n+\t$(QUIET_XGETTEXT)$(XGETTEXT) -o$@+ $(XGETTEXT_FLAGS_C) $(LOCALIZED_C) && \\\n+\tmv $@+ $@\n+\n+pot: po/git.pot\n+\n $(ETAGS_TARGET): FORCE\n \t$(RM) $(ETAGS_TARGET)\n \t$(FIND) . -name '*.[hcS]' -print | xargs etags -a -o $(ETAGS_TARGET)\ndiff --git a/po/.gitignore b/po/.gitignore\nnew file mode 100644\nindex 0000000..a242a86\n--- /dev/null\n+++ b/po/.gitignore\n@@ -0,0 +1 @@\n+/git.pot\n-- \n1.7.2.3\n"},{"id":"161972","messageId":"1298418152-27789-6-git-send-email-avarab@gmail.com","threadId":"26561","inReplyTo":"7vhbbwdjnm.fsf@alter.siamese.dyndns.org","subject":"[PATCH v4 05/73] gettextize: git-init basic messages","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2011-02-22T23:41:24Z","receivedAt":"2011-02-22T23:41:24Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"Change the user visible strings in init-db.c to use gettext\nlocalizations. This only converts messages which needed to be changed\nfrom \"foo\" to _(\"foo\"), and didn't need any TRANSLATORS comments.\n\nI haven't marked the messages in init_db_usage or init_db_options for\ntranslation, since that would require additional changes in\nparse-options.c. Those can be done later.\n\nSigned-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\nSigned-off-by: Jonathan Nieder <jrnieder@gmail.com>\n---\n builtin/init-db.c |   46 +++++++++++++++++++++++-----------------------\n 1 files changed, 23 insertions(+), 23 deletions(-)\n\ndiff --git a/builtin/init-db.c b/builtin/init-db.c\nindex 4f5348e..f7ddf5b 100644\n--- a/builtin/init-db.c\n+++ b/builtin/init-db.c\n@@ -31,7 +31,7 @@ static void safe_create_dir(const char *dir, int share)\n \t\t}\n \t}\n \telse if (share && adjust_shared_perm(dir))\n-\t\tdie(\"Could not make %s writable by group\", dir);\n+\t\tdie(_(\"Could not make %s writable by group\"), dir);\n }\n \n static void copy_templates_1(char *path, int baselen,\n@@ -58,25 +58,25 @@ static void copy_templates_1(char *path, int baselen,\n \t\tnamelen = strlen(de->d_name);\n \t\tif ((PATH_MAX <= baselen + namelen) ||\n \t\t    (PATH_MAX <= template_baselen + namelen))\n-\t\t\tdie(\"insanely long template name %s\", de->d_name);\n+\t\t\tdie(_(\"insanely long template name %s\"), de->d_name);\n \t\tmemcpy(path + baselen, de->d_name, namelen+1);\n \t\tmemcpy(template + template_baselen, de->d_name, namelen+1);\n \t\tif (lstat(path, &st_git)) {\n \t\t\tif (errno != ENOENT)\n-\t\t\t\tdie_errno(\"cannot stat '%s'\", path);\n+\t\t\t\tdie_errno(_(\"cannot stat '%s'\"), path);\n \t\t}\n \t\telse\n \t\t\texists = 1;\n \n \t\tif (lstat(template, &st_template))\n-\t\t\tdie_errno(\"cannot stat template '%s'\", template);\n+\t\t\tdie_errno(_(\"cannot stat template '%s'\"), template);\n \n \t\tif (S_ISDIR(st_template.st_mode)) {\n \t\t\tDIR *subdir = opendir(template);\n \t\t\tint baselen_sub = baselen + namelen;\n \t\t\tint template_baselen_sub = template_baselen + namelen;\n \t\t\tif (!subdir)\n-\t\t\t\tdie_errno(\"cannot opendir '%s'\", template);\n+\t\t\t\tdie_errno(_(\"cannot opendir '%s'\"), template);\n \t\t\tpath[baselen_sub++] =\n \t\t\t\ttemplate[template_baselen_sub++] = '/';\n \t\t\tpath[baselen_sub] =\n@@ -93,20 +93,20 @@ static void copy_templates_1(char *path, int baselen,\n \t\t\tint len;\n \t\t\tlen = readlink(template, lnk, sizeof(lnk));\n \t\t\tif (len < 0)\n-\t\t\t\tdie_errno(\"cannot readlink '%s'\", template);\n+\t\t\t\tdie_errno(_(\"cannot readlink '%s'\"), template);\n \t\t\tif (sizeof(lnk) <= len)\n-\t\t\t\tdie(\"insanely long symlink %s\", template);\n+\t\t\t\tdie(_(\"insanely long symlink %s\"), template);\n \t\t\tlnk[len] = 0;\n \t\t\tif (symlink(lnk, path))\n-\t\t\t\tdie_errno(\"cannot symlink '%s' '%s'\", lnk, path);\n+\t\t\t\tdie_errno(_(\"cannot symlink '%s' '%s'\"), lnk, path);\n \t\t}\n \t\telse if (S_ISREG(st_template.st_mode)) {\n \t\t\tif (copy_file(path, template, st_template.st_mode))\n-\t\t\t\tdie_errno(\"cannot copy '%s' to '%s'\", template,\n+\t\t\t\tdie_errno(_(\"cannot copy '%s' to '%s'\"), template,\n \t\t\t\t\t  path);\n \t\t}\n \t\telse\n-\t\t\terror(\"ignoring template %s\", template);\n+\t\t\terror(_(\"ignoring template %s\"), template);\n \t}\n }\n \n@@ -129,7 +129,7 @@ static void copy_templates(const char *template_dir)\n \t\treturn;\n \ttemplate_len = strlen(template_dir);\n \tif (PATH_MAX <= (template_len+strlen(\"/config\")))\n-\t\tdie(\"insanely long template path %s\", template_dir);\n+\t\tdie(_(\"insanely long template path %s\"), template_dir);\n \tstrcpy(template_path, template_dir);\n \tif (template_path[template_len-1] != '/') {\n \t\ttemplate_path[template_len++] = '/';\n@@ -137,7 +137,7 @@ static void copy_templates(const char *template_dir)\n \t}\n \tdir = opendir(template_path);\n \tif (!dir) {\n-\t\twarning(\"templates not found %s\", template_dir);\n+\t\twarning(_(\"templates not found %s\"), template_dir);\n \t\treturn;\n \t}\n \n@@ -150,8 +150,8 @@ static void copy_templates(const char *template_dir)\n \n \tif (repository_format_version &&\n \t    repository_format_version != GIT_REPO_VERSION) {\n-\t\twarning(\"not copying templates of \"\n-\t\t\t\"a wrong format version %d from '%s'\",\n+\t\twarning(_(\"not copying templates of \"\n+\t\t\t\"a wrong format version %d from '%s'\"),\n \t\t\trepository_format_version,\n \t\t\ttemplate_dir);\n \t\tclosedir(dir);\n@@ -188,7 +188,7 @@ static int create_default_files(const char *template_path)\n \tint filemode;\n \n \tif (len > sizeof(path)-50)\n-\t\tdie(\"insane git directory %s\", git_dir);\n+\t\tdie(_(\"insane git directory %s\"), git_dir);\n \tmemcpy(path, git_dir, len);\n \n \tif (len && path[len-1] != '/')\n@@ -375,7 +375,7 @@ static int guess_repository_type(const char *git_dir)\n \tif (!strcmp(\".\", git_dir))\n \t\treturn 1;\n \tif (!getcwd(cwd, sizeof(cwd)))\n-\t\tdie_errno(\"cannot tell cwd\");\n+\t\tdie_errno(_(\"cannot tell cwd\"));\n \tif (!strcmp(git_dir, cwd))\n \t\treturn 1;\n \t/*\n@@ -450,18 +450,18 @@ int cmd_init_db(int argc, const char **argv, const char *prefix)\n \t\t\t\t\terrno = EEXIST;\n \t\t\t\t\t/* fallthru */\n \t\t\t\tcase -1:\n-\t\t\t\t\tdie_errno(\"cannot mkdir %s\", argv[0]);\n+\t\t\t\t\tdie_errno(_(\"cannot mkdir %s\"), argv[0]);\n \t\t\t\t\tbreak;\n \t\t\t\tdefault:\n \t\t\t\t\tbreak;\n \t\t\t\t}\n \t\t\t\tshared_repository = saved;\n \t\t\t\tif (mkdir(argv[0], 0777) < 0)\n-\t\t\t\t\tdie_errno(\"cannot mkdir %s\", argv[0]);\n+\t\t\t\t\tdie_errno(_(\"cannot mkdir %s\"), argv[0]);\n \t\t\t\tmkdir_tried = 1;\n \t\t\t\tgoto retry;\n \t\t\t}\n-\t\t\tdie_errno(\"cannot chdir to %s\", argv[0]);\n+\t\t\tdie_errno(_(\"cannot chdir to %s\"), argv[0]);\n \t\t}\n \t} else if (0 < argc) {\n \t\tusage(init_db_usage[0]);\n@@ -483,8 +483,8 @@ int cmd_init_db(int argc, const char **argv, const char *prefix)\n \tgit_dir = getenv(GIT_DIR_ENVIRONMENT);\n \twork_tree = getenv(GIT_WORK_TREE_ENVIRONMENT);\n \tif ((!git_dir || is_bare_repository_cfg == 1) && work_tree)\n-\t\tdie(\"%s (or --work-tree=<directory>) not allowed without \"\n-\t\t    \"specifying %s (or --git-dir=<directory>)\",\n+\t\tdie(_(\"%s (or --work-tree=<directory>) not allowed without \"\n+\t\t\t  \"specifying %s (or --git-dir=<directory>)\"),\n \t\t    GIT_WORK_TREE_ENVIRONMENT,\n \t\t    GIT_DIR_ENVIRONMENT);\n \n@@ -509,14 +509,14 @@ int cmd_init_db(int argc, const char **argv, const char *prefix)\n \t\tif (!git_work_tree_cfg) {\n \t\t\tgit_work_tree_cfg = xcalloc(PATH_MAX, 1);\n \t\t\tif (!getcwd(git_work_tree_cfg, PATH_MAX))\n-\t\t\t\tdie_errno (\"Cannot access current working directory\");\n+\t\t\t\tdie_errno (_(\"Cannot access current working directory\"));\n \t\t}\n \t\tif (work_tree)\n \t\t\tset_git_work_tree(make_absolute_path(work_tree));\n \t\telse\n \t\t\tset_git_work_tree(git_work_tree_cfg);\n \t\tif (access(get_git_work_tree(), X_OK))\n-\t\t\tdie_errno (\"Cannot access work tree '%s'\",\n+\t\t\tdie_errno (_(\"Cannot access work tree '%s'\"),\n \t\t\t\t   get_git_work_tree());\n \t}\n \telse {\n-- \n1.7.2.3\n"},{"id":"161927","messageId":"1298418152-27789-7-git-send-email-avarab@gmail.com","threadId":"26561","inReplyTo":"7vhbbwdjnm.fsf@alter.siamese.dyndns.org","subject":"[PATCH v4 06/73] gettextize: git-init \"Initialized [...] repository\" message","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2011-02-22T23:41:25Z","receivedAt":"2011-02-22T23:41:25Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"These messages could benefit from splitting up.  An earlier version of\nthis patch began like this:\n\n    const char *reinit_shared   = _(\"Reinitialized existing shared Git repository in %s\\n\");\n    const char *init_shared     = _(\"Initialized empty shared Git repository in %s\\n\");\n    const char *reinit_noshared = _(\"Reinitialized existing Git repository in %s\\n\");\n    const char *init_noshared   = _(\"Initialized empty Git repository in %s\\n\");\n\nBut in the first round of gettextization I'm aiming to keep code\nchanges to a minimum for ease of review.  So just add a comment\nexplaining to translators how the sprintf format gets used so they\ncan cope for now if the language's grammar allows.\n\nSigned-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\nSigned-off-by: Jonathan Nieder <jrnieder@gmail.com>\n---\n builtin/init-db.c |   12 +++++++++---\n t/t0001-init.sh   |    2 +-\n 2 files changed, 10 insertions(+), 4 deletions(-)\n\ndiff --git a/builtin/init-db.c b/builtin/init-db.c\nindex f7ddf5b..e0e5ce3 100644\n--- a/builtin/init-db.c\n+++ b/builtin/init-db.c\n@@ -354,9 +354,15 @@ int init_db(const char *template_dir, unsigned int flags)\n \tif (!(flags & INIT_DB_QUIET)) {\n \t\tconst char *git_dir = get_git_dir();\n \t\tint len = strlen(git_dir);\n-\t\tprintf(\"%s%s Git repository in %s%s\\n\",\n-\t\t       reinit ? \"Reinitialized existing\" : \"Initialized empty\",\n-\t\t       shared_repository ? \" shared\" : \"\",\n+\n+\t\t/*\n+\t\t * TRANSLATORS: The first '%s' is either \"Reinitialized\n+\t\t * existing\" or \"Initialized empty\", the second \" shared\" or\n+\t\t * \"\", and the last '%s%s' is the verbatim directory name.\n+\t\t */\n+\t\tprintf(_(\"%s%s Git repository in %s%s\\n\"),\n+\t\t       reinit ? _(\"Reinitialized existing\") : _(\"Initialized empty\"),\n+\t\t       shared_repository ? _(\" shared\") : \"\",\n \t\t       git_dir, len && git_dir[len-1] != '/' ? \"/\" : \"\");\n \t}\n \ndiff --git a/t/t0001-init.sh b/t/t0001-init.sh\nindex f684993..dd4c00d 100755\n--- a/t/t0001-init.sh\n+++ b/t/t0001-init.sh\n@@ -180,7 +180,7 @@ test_expect_success 'GIT_DIR & GIT_WORK_TREE (2)' '\n \tfi\n '\n \n-test_expect_success 'reinit' '\n+test_expect_success C_LOCALE_OUTPUT 'reinit' '\n \n \t(\n \t\tsane_unset GIT_CONFIG GIT_WORK_TREE GIT_CONFIG &&\n-- \n1.7.2.3\n"},{"id":"161982","messageId":"1298418152-27789-8-git-send-email-avarab@gmail.com","threadId":"26561","inReplyTo":"7vhbbwdjnm.fsf@alter.siamese.dyndns.org","subject":"[PATCH v4 07/73] gettextize: git-clone basic messages","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2011-02-22T23:41:26Z","receivedAt":"2011-02-22T23:41:26Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n builtin/clone.c |   54 +++++++++++++++++++++++++++---------------------------\n 1 files changed, 27 insertions(+), 27 deletions(-)\n\ndiff --git a/builtin/clone.c b/builtin/clone.c\nindex 60d9a64..f46d09b 100644\n--- a/builtin/clone.c\n+++ b/builtin/clone.c\n@@ -208,7 +208,7 @@ static void setup_reference(const char *repo)\n \tif (is_directory(mkpath(\"%s/.git/objects\", ref_git)))\n \t\tref_git = mkpath(\"%s/.git\", ref_git);\n \telse if (!is_directory(mkpath(\"%s/objects\", ref_git)))\n-\t\tdie(\"reference repository '%s' is not a local directory.\",\n+\t\tdie(_(\"reference repository '%s' is not a local directory.\"),\n \t\t    option_reference);\n \n \tref_git_copy = xstrdup(ref_git);\n@@ -235,15 +235,15 @@ static void copy_or_link_directory(struct strbuf *src, struct strbuf *dest)\n \n \tdir = opendir(src->buf);\n \tif (!dir)\n-\t\tdie_errno(\"failed to open '%s'\", src->buf);\n+\t\tdie_errno(_(\"failed to open '%s'\"), src->buf);\n \n \tif (mkdir(dest->buf, 0777)) {\n \t\tif (errno != EEXIST)\n-\t\t\tdie_errno(\"failed to create directory '%s'\", dest->buf);\n+\t\t\tdie_errno(_(\"failed to create directory '%s'\"), dest->buf);\n \t\telse if (stat(dest->buf, &buf))\n-\t\t\tdie_errno(\"failed to stat '%s'\", dest->buf);\n+\t\t\tdie_errno(_(\"failed to stat '%s'\"), dest->buf);\n \t\telse if (!S_ISDIR(buf.st_mode))\n-\t\t\tdie(\"%s exists and is not a directory\", dest->buf);\n+\t\t\tdie(_(\"%s exists and is not a directory\"), dest->buf);\n \t}\n \n \tstrbuf_addch(src, '/');\n@@ -257,7 +257,7 @@ static void copy_or_link_directory(struct strbuf *src, struct strbuf *dest)\n \t\tstrbuf_setlen(dest, dest_len);\n \t\tstrbuf_addstr(dest, de->d_name);\n \t\tif (stat(src->buf, &buf)) {\n-\t\t\twarning (\"failed to stat %s\\n\", src->buf);\n+\t\t\twarning (_(\"failed to stat %s\\n\"), src->buf);\n \t\t\tcontinue;\n \t\t}\n \t\tif (S_ISDIR(buf.st_mode)) {\n@@ -267,16 +267,16 @@ static void copy_or_link_directory(struct strbuf *src, struct strbuf *dest)\n \t\t}\n \n \t\tif (unlink(dest->buf) && errno != ENOENT)\n-\t\t\tdie_errno(\"failed to unlink '%s'\", dest->buf);\n+\t\t\tdie_errno(_(\"failed to unlink '%s'\"), dest->buf);\n \t\tif (!option_no_hardlinks) {\n \t\t\tif (!link(src->buf, dest->buf))\n \t\t\t\tcontinue;\n \t\t\tif (option_local)\n-\t\t\t\tdie_errno(\"failed to create link '%s'\", dest->buf);\n+\t\t\t\tdie_errno(_(\"failed to create link '%s'\"), dest->buf);\n \t\t\toption_no_hardlinks = 1;\n \t\t}\n \t\tif (copy_file_with_time(dest->buf, src->buf, 0666))\n-\t\t\tdie_errno(\"failed to copy file to '%s'\", dest->buf);\n+\t\t\tdie_errno(_(\"failed to copy file to '%s'\"), dest->buf);\n \t}\n \tclosedir(dir);\n }\n@@ -305,7 +305,7 @@ static const struct ref *clone_local(const char *src_repo,\n \tret = transport_get_remote_refs(transport);\n \ttransport_disconnect(transport);\n \tif (0 <= option_verbosity)\n-\t\tprintf(\"done.\\n\");\n+\t\tprintf(_(\"done.\\n\"));\n \treturn ret;\n }\n \n@@ -387,11 +387,11 @@ int cmd_clone(int argc, const char **argv, const char *prefix)\n \t\t\t     builtin_clone_usage, 0);\n \n \tif (argc > 2)\n-\t\tusage_msg_opt(\"Too many arguments.\",\n+\t\tusage_msg_opt(_(\"Too many arguments.\"),\n \t\t\tbuiltin_clone_usage, builtin_clone_options);\n \n \tif (argc == 0)\n-\t\tusage_msg_opt(\"You must specify a repository to clone.\",\n+\t\tusage_msg_opt(_(\"You must specify a repository to clone.\"),\n \t\t\tbuiltin_clone_usage, builtin_clone_options);\n \n \tif (option_mirror)\n@@ -399,7 +399,7 @@ int cmd_clone(int argc, const char **argv, const char *prefix)\n \n \tif (option_bare) {\n \t\tif (option_origin)\n-\t\t\tdie(\"--bare and --origin %s options are incompatible.\",\n+\t\t\tdie(_(\"--bare and --origin %s options are incompatible.\"),\n \t\t\t    option_origin);\n \t\toption_no_checkout = 1;\n \t}\n@@ -418,7 +418,7 @@ int cmd_clone(int argc, const char **argv, const char *prefix)\n \t\trepo = repo_name;\n \tis_local = path && !is_bundle;\n \tif (is_local && option_depth)\n-\t\twarning(\"--depth is ignored in local clones; use file:// instead.\");\n+\t\twarning(_(\"--depth is ignored in local clones; use file:// instead.\"));\n \n \tif (argc == 2)\n \t\tdir = xstrdup(argv[1]);\n@@ -428,8 +428,8 @@ int cmd_clone(int argc, const char **argv, const char *prefix)\n \n \tdest_exists = !stat(dir, &buf);\n \tif (dest_exists && !is_empty_dir(dir))\n-\t\tdie(\"destination path '%s' already exists and is not \"\n-\t\t\t\"an empty directory.\", dir);\n+\t\tdie(_(\"destination path '%s' already exists and is not \"\n+\t\t\t\"an empty directory.\"), dir);\n \n \tstrbuf_addf(&reflog_msg, \"clone: from %s\", repo);\n \n@@ -438,7 +438,7 @@ int cmd_clone(int argc, const char **argv, const char *prefix)\n \telse {\n \t\twork_tree = getenv(\"GIT_WORK_TREE\");\n \t\tif (work_tree && !stat(work_tree, &buf))\n-\t\t\tdie(\"working tree '%s' already exists.\", work_tree);\n+\t\t\tdie(_(\"working tree '%s' already exists.\"), work_tree);\n \t}\n \n \tif (option_bare || work_tree)\n@@ -451,10 +451,10 @@ int cmd_clone(int argc, const char **argv, const char *prefix)\n \tif (!option_bare) {\n \t\tjunk_work_tree = work_tree;\n \t\tif (safe_create_leading_directories_const(work_tree) < 0)\n-\t\t\tdie_errno(\"could not create leading directories of '%s'\",\n+\t\t\tdie_errno(_(\"could not create leading directories of '%s'\"),\n \t\t\t\t  work_tree);\n \t\tif (!dest_exists && mkdir(work_tree, 0755))\n-\t\t\tdie_errno(\"could not create work tree dir '%s'.\",\n+\t\t\tdie_errno(_(\"could not create work tree dir '%s'.\"),\n \t\t\t\t  work_tree);\n \t\tset_git_work_tree(work_tree);\n \t}\n@@ -465,7 +465,7 @@ int cmd_clone(int argc, const char **argv, const char *prefix)\n \tsetenv(CONFIG_ENVIRONMENT, mkpath(\"%s/config\", git_dir), 1);\n \n \tif (safe_create_leading_directories_const(git_dir) < 0)\n-\t\tdie(\"could not create leading directories of '%s'\", git_dir);\n+\t\tdie(_(\"could not create leading directories of '%s'\"), git_dir);\n \tset_git_dir(make_absolute_path(git_dir));\n \n \tif (0 <= option_verbosity)\n@@ -527,7 +527,7 @@ int cmd_clone(int argc, const char **argv, const char *prefix)\n \t\ttransport = transport_get(remote, remote->url[0]);\n \n \t\tif (!transport->get_refs_list || !transport->fetch)\n-\t\t\tdie(\"Don't know how to clone %s\", transport->url);\n+\t\t\tdie(_(\"Don't know how to clone %s\"), transport->url);\n \n \t\ttransport_set_option(transport, TRANS_OPT_KEEP, \"yes\");\n \n@@ -566,8 +566,8 @@ int cmd_clone(int argc, const char **argv, const char *prefix)\n \t\t\tstrbuf_release(&head);\n \n \t\t\tif (!our_head_points_at) {\n-\t\t\t\twarning(\"Remote branch %s not found in \"\n-\t\t\t\t\t\"upstream %s, using HEAD instead\",\n+\t\t\t\twarning(_(\"Remote branch %s not found in \"\n+\t\t\t\t\t\"upstream %s, using HEAD instead\"),\n \t\t\t\t\toption_branch, option_origin);\n \t\t\t\tour_head_points_at = remote_head_points_at;\n \t\t\t}\n@@ -576,7 +576,7 @@ int cmd_clone(int argc, const char **argv, const char *prefix)\n \t\t\tour_head_points_at = remote_head_points_at;\n \t}\n \telse {\n-\t\twarning(\"You appear to have cloned an empty repository.\");\n+\t\twarning(_(\"You appear to have cloned an empty repository.\"));\n \t\tour_head_points_at = NULL;\n \t\tremote_head_points_at = NULL;\n \t\tremote_head = NULL;\n@@ -618,8 +618,8 @@ int cmd_clone(int argc, const char **argv, const char *prefix)\n \t} else {\n \t\t/* Nothing to checkout out */\n \t\tif (!option_no_checkout)\n-\t\t\twarning(\"remote HEAD refers to nonexistent ref, \"\n-\t\t\t\t\"unable to checkout.\\n\");\n+\t\t\twarning(_(\"remote HEAD refers to nonexistent ref, \"\n+\t\t\t\t\"unable to checkout.\\n\"));\n \t\toption_no_checkout = 1;\n \t}\n \n@@ -655,7 +655,7 @@ int cmd_clone(int argc, const char **argv, const char *prefix)\n \n \t\tif (write_cache(fd, active_cache, active_nr) ||\n \t\t    commit_locked_index(lock_file))\n-\t\t\tdie(\"unable to write new index file\");\n+\t\t\tdie(_(\"unable to write new index file\"));\n \n \t\terr |= run_hook(NULL, \"post-checkout\", sha1_to_hex(null_sha1),\n \t\t\t\tsha1_to_hex(our_head_points_at->old_sha1), \"1\",\n-- \n1.7.2.3\n"},{"id":"161973","messageId":"1298418152-27789-9-git-send-email-avarab@gmail.com","threadId":"26561","inReplyTo":"7vhbbwdjnm.fsf@alter.siamese.dyndns.org","subject":"[PATCH v4 08/73] gettextize: git-clone \"Cloning into\" message","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2011-02-22T23:41:27Z","receivedAt":"2011-02-22T23:41:27Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"Separate the \"Cloning into %s\" and \"Cloning into bare repository %s\"\nmessages to make them easier to translate. No noticeable change\nintended.\n\nSigned-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\nSigned-off-by: Jonathan Nieder <jrnieder@gmail.com>\n---\n builtin/clone.c |    9 ++++++---\n 1 files changed, 6 insertions(+), 3 deletions(-)\n\ndiff --git a/builtin/clone.c b/builtin/clone.c\nindex f46d09b..db0240d 100644\n--- a/builtin/clone.c\n+++ b/builtin/clone.c\n@@ -468,9 +468,12 @@ int cmd_clone(int argc, const char **argv, const char *prefix)\n \t\tdie(_(\"could not create leading directories of '%s'\"), git_dir);\n \tset_git_dir(make_absolute_path(git_dir));\n \n-\tif (0 <= option_verbosity)\n-\t\tprintf(\"Cloning into %s%s...\\n\",\n-\t\t       option_bare ? \"bare repository \" : \"\", dir);\n+\tif (0 <= option_verbosity) {\n+\t\tif (option_bare)\n+\t\t\tprintf(\"Cloning into bare repository %s...\\n\", dir);\n+\t\telse\n+\t\t\tprintf(\"Cloning into %s...\\n\", dir);\n+\t}\n \tinit_db(option_template, INIT_DB_QUIET);\n \n \t/*\n-- \n1.7.2.3\n"},{"id":"161975","messageId":"1298418152-27789-10-git-send-email-avarab@gmail.com","threadId":"26561","inReplyTo":"7vhbbwdjnm.fsf@alter.siamese.dyndns.org","subject":"[PATCH v4 09/73] gettextize: git-clone \"Cloning into\" message","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2011-02-22T23:41:28Z","receivedAt":"2011-02-22T23:41:28Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\nSigned-off-by: Jonathan Nieder <jrnieder@gmail.com>\n---\n builtin/clone.c  |    4 ++--\n t/t5601-clone.sh |    2 +-\n 2 files changed, 3 insertions(+), 3 deletions(-)\n\ndiff --git a/builtin/clone.c b/builtin/clone.c\nindex db0240d..b9394c4 100644\n--- a/builtin/clone.c\n+++ b/builtin/clone.c\n@@ -470,9 +470,9 @@ int cmd_clone(int argc, const char **argv, const char *prefix)\n \n \tif (0 <= option_verbosity) {\n \t\tif (option_bare)\n-\t\t\tprintf(\"Cloning into bare repository %s...\\n\", dir);\n+\t\t\tprintf(_(\"Cloning into bare repository %s...\\n\"), dir);\n \t\telse\n-\t\t\tprintf(\"Cloning into %s...\\n\", dir);\n+\t\t\tprintf(_(\"Cloning into %s...\\n\"), dir);\n \t}\n \tinit_db(option_template, INIT_DB_QUIET);\n \ndiff --git a/t/t5601-clone.sh b/t/t5601-clone.sh\nindex 987e0c8..9e6fa3b 100755\n--- a/t/t5601-clone.sh\n+++ b/t/t5601-clone.sh\n@@ -31,7 +31,7 @@ test_expect_success 'clone with excess parameters (2)' '\n \n '\n \n-test_expect_success 'output from clone' '\n+test_expect_success C_LOCALE_OUTPUT 'output from clone' '\n \trm -fr dst &&\n \tgit clone -n \"file://$(pwd)/src\" dst >output &&\n \ttest $(grep Clon output | wc -l) = 1\n-- \n1.7.2.3\n"},{"id":"161993","messageId":"1298418152-27789-11-git-send-email-avarab@gmail.com","threadId":"26561","inReplyTo":"7vhbbwdjnm.fsf@alter.siamese.dyndns.org","subject":"[PATCH v4 10/73] gettextize: git-add basic messages","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2011-02-22T23:41:29Z","receivedAt":"2011-02-22T23:41:29Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\nSigned-off-by: Jonathan Nieder <jrnieder@gmail.com>\n---\n builtin/add.c |   36 ++++++++++++++++++------------------\n 1 files changed, 18 insertions(+), 18 deletions(-)\n\ndiff --git a/builtin/add.c b/builtin/add.c\nindex 42c906e..a9a78f4 100644\n--- a/builtin/add.c\n+++ b/builtin/add.c\n@@ -38,7 +38,7 @@ static void update_callback(struct diff_queue_struct *q,\n \t\tconst char *path = p->one->path;\n \t\tswitch (p->status) {\n \t\tdefault:\n-\t\t\tdie(\"unexpected diff status %c\", p->status);\n+\t\t\tdie(_(\"unexpected diff status %c\"), p->status);\n \t\tcase DIFF_STATUS_UNMERGED:\n \t\t\t/*\n \t\t\t * ADD_CACHE_IGNORE_REMOVAL is unset if \"git\n@@ -64,7 +64,7 @@ static void update_callback(struct diff_queue_struct *q,\n \t\tcase DIFF_STATUS_TYPE_CHANGED:\n \t\t\tif (add_file_to_index(&the_index, path, data->flags)) {\n \t\t\t\tif (!(data->flags & ADD_CACHE_IGNORE_ERRORS))\n-\t\t\t\t\tdie(\"updating files failed\");\n+\t\t\t\t\tdie(_(\"updating files failed\"));\n \t\t\t\tdata->add_errors++;\n \t\t\t}\n \t\t\tbreak;\n@@ -172,7 +172,7 @@ static void treat_gitlinks(const char **pathspec)\n \t\t\t\t\t/* strip trailing slash */\n \t\t\t\t\tpathspec[j] = xstrndup(ce->name, len);\n \t\t\t\telse\n-\t\t\t\t\tdie (\"Path '%s' is in submodule '%.*s'\",\n+\t\t\t\t\tdie (_(\"Path '%s' is in submodule '%.*s'\"),\n \t\t\t\t\t\tpathspec[j], len, ce->name);\n \t\t\t}\n \t\t}\n@@ -191,7 +191,7 @@ static void refresh(int verbose, const char **pathspec)\n \t\t      pathspec, seen, \"Unstaged changes after refreshing the index:\");\n \tfor (i = 0; i < specs; i++) {\n \t\tif (!seen[i])\n-\t\t\tdie(\"pathspec '%s' did not match any files\", pathspec[i]);\n+\t\t\tdie(_(\"pathspec '%s' did not match any files\"), pathspec[i]);\n \t}\n         free(seen);\n }\n@@ -205,7 +205,7 @@ static const char **validate_pathspec(int argc, const char **argv, const char *p\n \t\tfor (p = pathspec; *p; p++) {\n \t\t\tif (has_symlink_leading_path(*p, strlen(*p))) {\n \t\t\t\tint len = prefix ? strlen(prefix) : 0;\n-\t\t\t\tdie(\"'%s' is beyond a symbolic link\", *p + len);\n+\t\t\t\tdie(_(\"'%s' is beyond a symbolic link\"), *p + len);\n \t\t\t}\n \t\t}\n \t}\n@@ -272,7 +272,7 @@ static int edit_patch(int argc, const char **argv, const char *prefix)\n \tgit_config(git_diff_basic_config, NULL); /* no \"diff\" UI options */\n \n \tif (read_cache() < 0)\n-\t\tdie (\"Could not read the index\");\n+\t\tdie (_(\"Could not read the index\"));\n \n \tinit_revisions(&rev, prefix);\n \trev.diffopt.context = 7;\n@@ -281,24 +281,24 @@ static int edit_patch(int argc, const char **argv, const char *prefix)\n \trev.diffopt.output_format = DIFF_FORMAT_PATCH;\n \tout = open(file, O_CREAT | O_WRONLY, 0644);\n \tif (out < 0)\n-\t\tdie (\"Could not open '%s' for writing.\", file);\n+\t\tdie (_(\"Could not open '%s' for writing.\"), file);\n \trev.diffopt.file = xfdopen(out, \"w\");\n \trev.diffopt.close_file = 1;\n \tif (run_diff_files(&rev, 0))\n-\t\tdie (\"Could not write patch\");\n+\t\tdie (_(\"Could not write patch\"));\n \n \tlaunch_editor(file, NULL, NULL);\n \n \tif (stat(file, &st))\n-\t\tdie_errno(\"Could not stat '%s'\", file);\n+\t\tdie_errno(_(\"Could not stat '%s'\"), file);\n \tif (!st.st_size)\n-\t\tdie(\"Empty patch. Aborted.\");\n+\t\tdie(_(\"Empty patch. Aborted.\"));\n \n \tmemset(&child, 0, sizeof(child));\n \tchild.git_cmd = 1;\n \tchild.argv = apply_argv;\n \tif (run_command(&child))\n-\t\tdie (\"Could not apply '%s'\", file);\n+\t\tdie (_(\"Could not apply '%s'\"), file);\n \n \tunlink(file);\n \treturn 0;\n@@ -354,7 +354,7 @@ static int add_files(struct dir_struct *dir, int flags)\n \tfor (i = 0; i < dir->nr; i++)\n \t\tif (add_file_to_cache(dir->entries[i]->name, flags)) {\n \t\t\tif (!ignore_add_errors)\n-\t\t\t\tdie(\"adding files failed\");\n+\t\t\t\tdie(_(\"adding files failed\"));\n \t\t\texit_status = 1;\n \t\t}\n \treturn exit_status;\n@@ -386,9 +386,9 @@ int cmd_add(int argc, const char **argv, const char *prefix)\n \targv++;\n \n \tif (addremove && take_worktree_changes)\n-\t\tdie(\"-A and -u are mutually incompatible\");\n+\t\tdie(_(\"-A and -u are mutually incompatible\"));\n \tif (!show_only && ignore_missing)\n-\t\tdie(\"Option --ignore-missing can only be used together with --dry-run\");\n+\t\tdie(_(\"Option --ignore-missing can only be used together with --dry-run\"));\n \tif ((addremove || take_worktree_changes) && !argc) {\n \t\tstatic const char *here[2] = { \".\", NULL };\n \t\targc = 1;\n@@ -408,14 +408,14 @@ int cmd_add(int argc, const char **argv, const char *prefix)\n \t\t  ? ADD_CACHE_IGNORE_REMOVAL : 0));\n \n \tif (require_pathspec && argc == 0) {\n-\t\tfprintf(stderr, \"Nothing specified, nothing added.\\n\");\n-\t\tfprintf(stderr, \"Maybe you wanted to say 'git add .'?\\n\");\n+\t\tfprintf(stderr, _(\"Nothing specified, nothing added.\\n\"));\n+\t\tfprintf(stderr, _(\"Maybe you wanted to say 'git add .'?\\n\"));\n \t\treturn 0;\n \t}\n \tpathspec = validate_pathspec(argc, argv, prefix);\n \n \tif (read_cache() < 0)\n-\t\tdie(\"index file corrupt\");\n+\t\tdie(_(\"index file corrupt\"));\n \ttreat_gitlinks(pathspec);\n \n \tif (add_new_files) {\n@@ -467,7 +467,7 @@ int cmd_add(int argc, const char **argv, const char *prefix)\n \tif (active_cache_changed) {\n \t\tif (write_cache(newfd, active_cache, active_nr) ||\n \t\t    commit_locked_index(&lock_file))\n-\t\t\tdie(\"Unable to write new index file\");\n+\t\t\tdie(_(\"Unable to write new index file\"));\n \t}\n \n \treturn exit_status;\n-- \n1.7.2.3\n"},{"id":"161989","messageId":"1298418152-27789-12-git-send-email-avarab@gmail.com","threadId":"26561","inReplyTo":"7vhbbwdjnm.fsf@alter.siamese.dyndns.org","subject":"[PATCH v4 11/73] gettextize: git-add \"The following paths are ignored\" message","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2011-02-22T23:41:30Z","receivedAt":"2011-02-22T23:41:30Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"The tests t2204 (.gitignore) and t3700 (add) explicitly check for\nthese messages, so while at it, split each relevant test into a part\nthat just checks \"git add\"'s exit status and a part that checks\nporcelain output.\n\nSigned-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\nSigned-off-by: Jonathan Nieder <jrnieder@gmail.com>\n---\n builtin/add.c          |    8 ++++----\n t/t2204-add-ignored.sh |   37 +++++++++++++++++++++++++------------\n t/t3700-add.sh         |    5 ++++-\n 3 files changed, 33 insertions(+), 17 deletions(-)\n\ndiff --git a/builtin/add.c b/builtin/add.c\nindex a9a78f4..21776ac 100644\n--- a/builtin/add.c\n+++ b/builtin/add.c\n@@ -307,7 +307,7 @@ static int edit_patch(int argc, const char **argv, const char *prefix)\n static struct lock_file lock_file;\n \n static const char ignore_error[] =\n-\"The following paths are ignored by one of your .gitignore files:\\n\";\n+N_(\"The following paths are ignored by one of your .gitignore files:\\n\");\n \n static int verbose = 0, show_only = 0, ignored_too = 0, refresh_only = 0;\n static int ignore_add_errors, addremove, intent_to_add, ignore_missing = 0;\n@@ -344,11 +344,11 @@ static int add_files(struct dir_struct *dir, int flags)\n \tint i, exit_status = 0;\n \n \tif (dir->ignored_nr) {\n-\t\tfprintf(stderr, ignore_error);\n+\t\tfprintf(stderr, _(ignore_error));\n \t\tfor (i = 0; i < dir->ignored_nr; i++)\n \t\t\tfprintf(stderr, \"%s\\n\", dir->ignored[i]->name);\n-\t\tfprintf(stderr, \"Use -f if you really want to add them.\\n\");\n-\t\tdie(\"no files added\");\n+\t\tfprintf(stderr, _(\"Use -f if you really want to add them.\\n\"));\n+\t\tdie(_(\"no files added\"));\n \t}\n \n \tfor (i = 0; i < dir->nr; i++)\ndiff --git a/t/t2204-add-ignored.sh b/t/t2204-add-ignored.sh\nindex 24afdab..4975336 100755\n--- a/t/t2204-add-ignored.sh\n+++ b/t/t2204-add-ignored.sh\n@@ -31,18 +31,21 @@ do\n \t\trm -f .git/index &&\n \t\ttest_must_fail git add \"$i\" 2>err &&\n \t\tgit ls-files \"$i\" >out &&\n-\t\t! test -s out &&\n-\t\tgrep -e \"Use -f if\" err &&\n-\t\tcat err\n+\t\t! test -s out\n+\t'\n+\n+\ttest_expect_success C_LOCALE_OUTPUT \"complaints for ignored $i output\" '\n+\t\tgrep -e \"Use -f if\" err\n \t'\n \n \ttest_expect_success \"complaints for ignored $i with unignored file\" '\n \t\trm -f .git/index &&\n \t\ttest_must_fail git add \"$i\" file 2>err &&\n \t\tgit ls-files \"$i\" >out &&\n-\t\t! test -s out &&\n-\t\tgrep -e \"Use -f if\" err &&\n-\t\tcat err\n+\t\t! test -s out\n+\t'\n+\ttest_expect_success C_LOCALE_OUTPUT \"complaints for ignored $i with unignored file output\" '\n+\t\tgrep -e \"Use -f if\" err\n \t'\n done\n \n@@ -54,9 +57,14 @@ do\n \t\t\tcd dir &&\n \t\t\ttest_must_fail git add \"$i\" 2>err &&\n \t\t\tgit ls-files \"$i\" >out &&\n-\t\t\t! test -s out &&\n-\t\t\tgrep -e \"Use -f if\" err &&\n-\t\t\tcat err\n+\t\t\t! test -s out\n+\t\t)\n+\t'\n+\n+\ttest_expect_success C_LOCALE_OUTPUT \"complaints for ignored $i in dir output\" '\n+\t\t(\n+\t\t\tcd dir &&\n+\t\t\tgrep -e \"Use -f if\" err\n \t\t)\n \t'\n done\n@@ -69,9 +77,14 @@ do\n \t\t\tcd sub &&\n \t\t\ttest_must_fail git add \"$i\" 2>err &&\n \t\t\tgit ls-files \"$i\" >out &&\n-\t\t\t! test -s out &&\n-\t\t\tgrep -e \"Use -f if\" err &&\n-\t\t\tcat err\n+\t\t\t! test -s out\n+\t\t)\n+\t'\n+\n+\ttest_expect_success C_LOCALE_OUTPUT \"complaints for ignored $i in sub output\" '\n+\t\t(\n+\t\t\tcd sub &&\n+\t\t\tgrep -e \"Use -f if\" err\n \t\t)\n \t'\n done\ndiff --git a/t/t3700-add.sh b/t/t3700-add.sh\nindex ec71083..ac115ed 100755\n--- a/t/t3700-add.sh\n+++ b/t/t3700-add.sh\n@@ -283,7 +283,10 @@ add 'track-this'\n EOF\n \n test_expect_success 'git add --dry-run --ignore-missing of non-existing file' '\n-\ttest_must_fail git add --dry-run --ignore-missing track-this ignored-file >actual.out 2>actual.err &&\n+\ttest_must_fail git add --dry-run --ignore-missing track-this ignored-file >actual.out 2>actual.err\n+'\n+\n+test_expect_success C_LOCALE_OUTPUT 'git add --dry-run --ignore-missing of non-existing file output' '\n \ttest_cmp expect.out actual.out &&\n \ttest_cmp expect.err actual.err\n '\n-- \n1.7.2.3\n"},{"id":"161990","messageId":"1298418152-27789-13-git-send-email-avarab@gmail.com","threadId":"26561","inReplyTo":"7vhbbwdjnm.fsf@alter.siamese.dyndns.org","subject":"[PATCH v4 12/73] gettextize: git-add \"did not match any files\" message","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2011-02-22T23:41:31Z","receivedAt":"2011-02-22T23:41:31Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"Make the \"did not match any files\" message translatable, and skip the\ntest that checks for it when the C_LOCALE_OUTPUT prereq is not\npresent.\n\nSigned-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\nSigned-off-by: Jonathan Nieder <jrnieder@gmail.com>\n---\n builtin/add.c  |    2 +-\n t/t3700-add.sh |    8 ++++++--\n 2 files changed, 7 insertions(+), 3 deletions(-)\n\ndiff --git a/builtin/add.c b/builtin/add.c\nindex 21776ac..ffbd459 100644\n--- a/builtin/add.c\n+++ b/builtin/add.c\n@@ -451,7 +451,7 @@ int cmd_add(int argc, const char **argv, const char *prefix)\n \t\t\t\t\tif (excluded(&dir, pathspec[i], &dtype))\n \t\t\t\t\t\tdir_add_ignored(&dir, pathspec[i], strlen(pathspec[i]));\n \t\t\t\t} else\n-\t\t\t\t\tdie(\"pathspec '%s' did not match any files\",\n+\t\t\t\t\tdie(_(\"pathspec '%s' did not match any files\"),\n \t\t\t\t\t    pathspec[i]);\n \t\t\t}\n \t\t}\ndiff --git a/t/t3700-add.sh b/t/t3700-add.sh\nindex ac115ed..7de42fa 100755\n--- a/t/t3700-add.sh\n+++ b/t/t3700-add.sh\n@@ -268,8 +268,12 @@ test_expect_success 'git add --dry-run of existing changed file' \"\n \n test_expect_success 'git add --dry-run of non-existing file' \"\n \techo ignored-file >>.gitignore &&\n-\ttest_must_fail git add --dry-run track-this ignored-file >actual 2>&1 &&\n-\techo \\\"fatal: pathspec 'ignored-file' did not match any files\\\" | test_cmp - actual\n+\ttest_must_fail git add --dry-run track-this ignored-file >actual 2>&1\n+\"\n+\n+test_expect_success C_LOCALE_OUTPUT 'git add --dry-run of an existing file output' \"\n+\techo \\\"fatal: pathspec 'ignored-file' did not match any files\\\" >expect &&\n+\ttest_cmp expect actual\n \"\n \n cat >expect.err <<\\EOF\n-- \n1.7.2.3\n"},{"id":"161991","messageId":"1298418152-27789-14-git-send-email-avarab@gmail.com","threadId":"26561","inReplyTo":"7vhbbwdjnm.fsf@alter.siamese.dyndns.org","subject":"[PATCH v4 13/73] gettextize: git-add \"remove '%s'\" message","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2011-02-22T23:41:32Z","receivedAt":"2011-02-22T23:41:32Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"Make the \"remove '%s'\" message translatable. It's displayed under `git\nadd -u --verbose`. Also skip the corresponding test when output is not\nin the C locale.\n\nSigned-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\nSigned-off-by: Jonathan Nieder <jrnieder@gmail.com>\n---\n builtin/add.c         |    2 +-\n t/t2200-add-update.sh |    2 +-\n 2 files changed, 2 insertions(+), 2 deletions(-)\n\ndiff --git a/builtin/add.c b/builtin/add.c\nindex ffbd459..33b9970 100644\n--- a/builtin/add.c\n+++ b/builtin/add.c\n@@ -74,7 +74,7 @@ static void update_callback(struct diff_queue_struct *q,\n \t\t\tif (!(data->flags & ADD_CACHE_PRETEND))\n \t\t\t\tremove_file_from_index(&the_index, path);\n \t\t\tif (data->flags & (ADD_CACHE_PRETEND|ADD_CACHE_VERBOSE))\n-\t\t\t\tprintf(\"remove '%s'\\n\", path);\n+\t\t\t\tprintf(_(\"remove '%s'\\n\"), path);\n \t\t\tbreak;\n \t\t}\n \t}\ndiff --git a/t/t2200-add-update.sh b/t/t2200-add-update.sh\nindex 0692427..856e7da 100755\n--- a/t/t2200-add-update.sh\n+++ b/t/t2200-add-update.sh\n@@ -111,7 +111,7 @@ test_expect_success 'touch and then add explicitly' '\n \n '\n \n-test_expect_success 'add -n -u should not add but just report' '\n+test_expect_success C_LOCALE_OUTPUT 'add -n -u should not add but just report' '\n \n \t(\n \t\techo \"add '\\''check'\\''\" &&\n-- \n1.7.2.3\n"},{"id":"161984","messageId":"1298418152-27789-15-git-send-email-avarab@gmail.com","threadId":"26561","inReplyTo":"7vhbbwdjnm.fsf@alter.siamese.dyndns.org","subject":"[PATCH v4 14/73] gettextize: git-add \"Unstaged changes\" message","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2011-02-22T23:41:33Z","receivedAt":"2011-02-22T23:41:33Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"Make the \"Unstaged changes after refreshing the index:\"\ntranslatable. It's displayed under `git add --refresh --verbose`.\n\nSigned-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\nSigned-off-by: Jonathan Nieder <jrnieder@gmail.com>\n---\n builtin/add.c |    2 +-\n 1 files changed, 1 insertions(+), 1 deletions(-)\n\ndiff --git a/builtin/add.c b/builtin/add.c\nindex 33b9970..a512597 100644\n--- a/builtin/add.c\n+++ b/builtin/add.c\n@@ -188,7 +188,7 @@ static void refresh(int verbose, const char **pathspec)\n \t\t/* nothing */;\n \tseen = xcalloc(specs, 1);\n \trefresh_index(&the_index, verbose ? REFRESH_IN_PORCELAIN : REFRESH_QUIET,\n-\t\t      pathspec, seen, \"Unstaged changes after refreshing the index:\");\n+\t\t      pathspec, seen, _(\"Unstaged changes after refreshing the index:\"));\n \tfor (i = 0; i < specs; i++) {\n \t\tif (!seen[i])\n \t\t\tdie(_(\"pathspec '%s' did not match any files\"), pathspec[i]);\n-- \n1.7.2.3\n"},{"id":"161987","messageId":"1298418152-27789-16-git-send-email-avarab@gmail.com","threadId":"26561","inReplyTo":"7vhbbwdjnm.fsf@alter.siamese.dyndns.org","subject":"[PATCH v4 15/73] gettextize: git-branch basic messages","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2011-02-22T23:41:34Z","receivedAt":"2011-02-22T23:41:34Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n builtin/branch.c |   56 +++++++++++++++++++++++++++---------------------------\n 1 files changed, 28 insertions(+), 28 deletions(-)\n\ndiff --git a/builtin/branch.c b/builtin/branch.c\nindex 9e546e4..6695db4 100644\n--- a/builtin/branch.c\n+++ b/builtin/branch.c\n@@ -133,12 +133,12 @@ static int branch_merged(int kind, const char *name,\n \tif ((head_rev != reference_rev) &&\n \t    in_merge_bases(rev, &head_rev, 1) != merged) {\n \t\tif (merged)\n-\t\t\twarning(\"deleting branch '%s' that has been merged to\\n\"\n-\t\t\t\t\"         '%s', but it is not yet merged to HEAD.\",\n+\t\t\twarning(_(\"deleting branch '%s' that has been merged to\\n\"\n+\t\t\t\t\"         '%s', but it is not yet merged to HEAD.\"),\n \t\t\t\tname, reference_name);\n \t\telse\n-\t\t\twarning(\"not deleting branch '%s' that is not yet merged to\\n\"\n-\t\t\t\t\"         '%s', even though it is merged to HEAD.\",\n+\t\t\twarning(_(\"not deleting branch '%s' that is not yet merged to\\n\"\n+\t\t\t\t\"         '%s', even though it is merged to HEAD.\"),\n \t\t\t\tname, reference_name);\n \t}\n \treturn merged;\n@@ -165,19 +165,19 @@ static int delete_branches(int argc, const char **argv, int force, int kinds)\n \t\tremote = \"\";\n \t\tbreak;\n \tdefault:\n-\t\tdie(\"cannot use -a with -d\");\n+\t\tdie(_(\"cannot use -a with -d\"));\n \t}\n \n \tif (!force) {\n \t\thead_rev = lookup_commit_reference(head_sha1);\n \t\tif (!head_rev)\n-\t\t\tdie(\"Couldn't look up commit object for HEAD\");\n+\t\t\tdie(_(\"Couldn't look up commit object for HEAD\"));\n \t}\n \tfor (i = 0; i < argc; i++, strbuf_release(&bname)) {\n \t\tstrbuf_branchname(&bname, argv[i]);\n \t\tif (kinds == REF_LOCAL_BRANCH && !strcmp(head, bname.buf)) {\n-\t\t\terror(\"Cannot delete the branch '%s' \"\n-\t\t\t      \"which you are currently on.\", bname.buf);\n+\t\t\terror(_(\"Cannot delete the branch '%s' \"\n+\t\t\t      \"which you are currently on.\"), bname.buf);\n \t\t\tret = 1;\n \t\t\tcontinue;\n \t\t}\n@@ -186,7 +186,7 @@ static int delete_branches(int argc, const char **argv, int force, int kinds)\n \n \t\tname = xstrdup(mkpath(fmt, bname.buf));\n \t\tif (!resolve_ref(name, sha1, 1, NULL)) {\n-\t\t\terror(\"%sbranch '%s' not found.\",\n+\t\t\terror(_(\"%sbranch '%s' not found.\"),\n \t\t\t\t\tremote, bname.buf);\n \t\t\tret = 1;\n \t\t\tcontinue;\n@@ -194,21 +194,21 @@ static int delete_branches(int argc, const char **argv, int force, int kinds)\n \n \t\trev = lookup_commit_reference(sha1);\n \t\tif (!rev) {\n-\t\t\terror(\"Couldn't look up commit object for '%s'\", name);\n+\t\t\terror(_(\"Couldn't look up commit object for '%s'\"), name);\n \t\t\tret = 1;\n \t\t\tcontinue;\n \t\t}\n \n \t\tif (!force && !branch_merged(kinds, bname.buf, rev, head_rev)) {\n-\t\t\terror(\"The branch '%s' is not fully merged.\\n\"\n+\t\t\terror(_(\"The branch '%s' is not fully merged.\\n\"\n \t\t\t      \"If you are sure you want to delete it, \"\n-\t\t\t      \"run 'git branch -D %s'.\", bname.buf, bname.buf);\n+\t\t\t      \"run 'git branch -D %s'.\"), bname.buf, bname.buf);\n \t\t\tret = 1;\n \t\t\tcontinue;\n \t\t}\n \n \t\tif (delete_ref(name, sha1, 0)) {\n-\t\t\terror(\"Error deleting %sbranch '%s'\", remote,\n+\t\t\terror(_(\"Error deleting %sbranch '%s'\"), remote,\n \t\t\t      bname.buf);\n \t\t\tret = 1;\n \t\t} else {\n@@ -218,7 +218,7 @@ static int delete_branches(int argc, const char **argv, int force, int kinds)\n \t\t\t       find_unique_abbrev(sha1, DEFAULT_ABBREV));\n \t\t\tstrbuf_addf(&buf, \"branch.%s\", bname.buf);\n \t\t\tif (git_config_rename_section(buf.buf, NULL) < 0)\n-\t\t\t\twarning(\"Update of config-file failed\");\n+\t\t\t\twarning(_(\"Update of config-file failed\"));\n \t\t\tstrbuf_release(&buf);\n \t\t}\n \t}\n@@ -300,7 +300,7 @@ static int append_ref(const char *refname, const unsigned char *sha1, int flags,\n \tif (ref_list->verbose || ref_list->with_commit || merge_filter != NO_FILTER) {\n \t\tcommit = lookup_commit_reference_gently(sha1, 1);\n \t\tif (!commit) {\n-\t\t\tcb->ret = error(\"branch '%s' does not point at a commit\", refname);\n+\t\t\tcb->ret = error(_(\"branch '%s' does not point at a commit\"), refname);\n \t\t\treturn 0;\n \t\t}\n \n@@ -535,7 +535,7 @@ static int print_ref_list(int kinds, int detached, int verbose, int abbrev, stru\n \tfree_ref_list(&ref_list);\n \n \tif (cb.ret)\n-\t\terror(\"some refs could not be read\");\n+\t\terror(_(\"some refs could not be read\"));\n \n \treturn cb.ret;\n }\n@@ -548,7 +548,7 @@ static void rename_branch(const char *oldname, const char *newname, int force)\n \tint recovery = 0;\n \n \tif (!oldname)\n-\t\tdie(\"cannot rename the current branch while not on any.\");\n+\t\tdie(_(\"cannot rename the current branch while not on any.\"));\n \n \tif (strbuf_check_branch_ref(&oldref, oldname)) {\n \t\t/*\n@@ -558,35 +558,35 @@ static void rename_branch(const char *oldname, const char *newname, int force)\n \t\tif (resolve_ref(oldref.buf, sha1, 1, NULL))\n \t\t\trecovery = 1;\n \t\telse\n-\t\t\tdie(\"Invalid branch name: '%s'\", oldname);\n+\t\t\tdie(_(\"Invalid branch name: '%s'\"), oldname);\n \t}\n \n \tif (strbuf_check_branch_ref(&newref, newname))\n-\t\tdie(\"Invalid branch name: '%s'\", newname);\n+\t\tdie(_(\"Invalid branch name: '%s'\"), newname);\n \n \tif (resolve_ref(newref.buf, sha1, 1, NULL) && !force)\n-\t\tdie(\"A branch named '%s' already exists.\", newref.buf + 11);\n+\t\tdie(_(\"A branch named '%s' already exists.\"), newref.buf + 11);\n \n \tstrbuf_addf(&logmsg, \"Branch: renamed %s to %s\",\n \t\t oldref.buf, newref.buf);\n \n \tif (rename_ref(oldref.buf, newref.buf, logmsg.buf))\n-\t\tdie(\"Branch rename failed\");\n+\t\tdie(_(\"Branch rename failed\"));\n \tstrbuf_release(&logmsg);\n \n \tif (recovery)\n-\t\twarning(\"Renamed a misnamed branch '%s' away\", oldref.buf + 11);\n+\t\twarning(_(\"Renamed a misnamed branch '%s' away\"), oldref.buf + 11);\n \n \t/* no need to pass logmsg here as HEAD didn't really move */\n \tif (!strcmp(oldname, head) && create_symref(\"HEAD\", newref.buf, NULL))\n-\t\tdie(\"Branch renamed to %s, but HEAD is not updated!\", newname);\n+\t\tdie(_(\"Branch renamed to %s, but HEAD is not updated!\"), newname);\n \n \tstrbuf_addf(&oldsection, \"branch.%s\", oldref.buf + 11);\n \tstrbuf_release(&oldref);\n \tstrbuf_addf(&newsection, \"branch.%s\", newref.buf + 11);\n \tstrbuf_release(&newref);\n \tif (git_config_rename_section(oldsection.buf, newsection.buf) < 0)\n-\t\tdie(\"Branch is renamed, but update of config-file failed\");\n+\t\tdie(_(\"Branch is renamed, but update of config-file failed\"));\n \tstrbuf_release(&oldsection);\n \tstrbuf_release(&newsection);\n }\n@@ -601,7 +601,7 @@ static int opt_parse_merge_filter(const struct option *opt, const char *arg, int\n \tif (!arg)\n \t\targ = \"HEAD\";\n \tif (get_sha1(arg, merge_filter_ref))\n-\t\tdie(\"malformed object name %s\", arg);\n+\t\tdie(_(\"malformed object name %s\"), arg);\n \treturn 0;\n }\n \n@@ -675,13 +675,13 @@ int cmd_branch(int argc, const char **argv, const char *prefix)\n \n \thead = resolve_ref(\"HEAD\", head_sha1, 0, NULL);\n \tif (!head)\n-\t\tdie(\"Failed to resolve HEAD as a valid ref.\");\n+\t\tdie(_(\"Failed to resolve HEAD as a valid ref.\"));\n \thead = xstrdup(head);\n \tif (!strcmp(head, \"HEAD\")) {\n \t\tdetached = 1;\n \t} else {\n \t\tif (prefixcmp(head, \"refs/heads/\"))\n-\t\t\tdie(\"HEAD not found below refs/heads!\");\n+\t\t\tdie(_(\"HEAD not found below refs/heads!\"));\n \t\thead += 11;\n \t}\n \thashcpy(merge_filter_ref, head_sha1);\n@@ -701,7 +701,7 @@ int cmd_branch(int argc, const char **argv, const char *prefix)\n \t\trename_branch(argv[0], argv[1], rename > 1);\n \telse if (argc <= 2) {\n \t\tif (kinds != REF_LOCAL_BRANCH)\n-\t\t\tdie(\"-a and -r options to 'git branch' do not make sense with a branch name\");\n+\t\t\tdie(_(\"-a and -r options to 'git branch' do not make sense with a branch name\"));\n \t\tcreate_branch(head, argv[0], (argc == 2) ? argv[1] : head,\n \t\t\t      force_create, reflog, track);\n \t} else\n-- \n1.7.2.3\n"},{"id":"161924","messageId":"1298418152-27789-17-git-send-email-avarab@gmail.com","threadId":"26561","inReplyTo":"7vhbbwdjnm.fsf@alter.siamese.dyndns.org","subject":"[PATCH v4 16/73] gettextize: git-branch \"remote branch '%s' not found\" message","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2011-02-22T23:41:35Z","receivedAt":"2011-02-22T23:41:35Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"This could be done better by splitting it up, but it would change too\nmuch code, which I'm trying to avoid at this point. Instead add a\nTRANSLATORS comment to explain what \"remote \" does.\n\nSigned-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n builtin/branch.c |    3 ++-\n 1 files changed, 2 insertions(+), 1 deletions(-)\n\ndiff --git a/builtin/branch.c b/builtin/branch.c\nindex 6695db4..e9d8a5a 100644\n--- a/builtin/branch.c\n+++ b/builtin/branch.c\n@@ -157,7 +157,8 @@ static int delete_branches(int argc, const char **argv, int force, int kinds)\n \tswitch (kinds) {\n \tcase REF_REMOTE_BRANCH:\n \t\tfmt = \"refs/remotes/%s\";\n-\t\tremote = \"remote \";\n+\t\t/* TRANSLATORS: This is \"remote \" in \"remote branch '%s' not found\" */\n+\t\tremote = _(\"remote \");\n \t\tforce = 1;\n \t\tbreak;\n \tcase REF_LOCAL_BRANCH:\n-- \n1.7.2.3\n"},{"id":"161925","messageId":"1298418152-27789-18-git-send-email-avarab@gmail.com","threadId":"26561","inReplyTo":"7vhbbwdjnm.fsf@alter.siamese.dyndns.org","subject":"[PATCH v4 17/73] gettextize: git-branch \"Deleted branch [...]\" message","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2011-02-22T23:41:36Z","receivedAt":"2011-02-22T23:41:36Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"Gettextize the \"Deleted %sbranch %s (was %s).\\n\" messages. test in\nt3200-branch.sh explicitly checked for this message. Change it to skip\nunder GETTEXT_POISON=YesPlease.\n\nSigned-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n builtin/branch.c  |    2 +-\n t/t3200-branch.sh |    2 +-\n 2 files changed, 2 insertions(+), 2 deletions(-)\n\ndiff --git a/builtin/branch.c b/builtin/branch.c\nindex e9d8a5a..d276681 100644\n--- a/builtin/branch.c\n+++ b/builtin/branch.c\n@@ -214,7 +214,7 @@ static int delete_branches(int argc, const char **argv, int force, int kinds)\n \t\t\tret = 1;\n \t\t} else {\n \t\t\tstruct strbuf buf = STRBUF_INIT;\n-\t\t\tprintf(\"Deleted %sbranch %s (was %s).\\n\", remote,\n+\t\t\tprintf(_(\"Deleted %sbranch %s (was %s).\\n\"), remote,\n \t\t\t       bname.buf,\n \t\t\t       find_unique_abbrev(sha1, DEFAULT_ABBREV));\n \t\t\tstrbuf_addf(&buf, \"branch.%s\", bname.buf);\ndiff --git a/t/t3200-branch.sh b/t/t3200-branch.sh\nindex f308235..940d7ae 100755\n--- a/t/t3200-branch.sh\n+++ b/t/t3200-branch.sh\n@@ -203,7 +203,7 @@ test_expect_success 'test deleting branch deletes branch config' \\\n      test -z \"$(git config branch.my7.remote)\" &&\n      test -z \"$(git config branch.my7.merge)\"'\n \n-test_expect_success 'test deleting branch without config' \\\n+test_expect_success C_LOCALE_OUTPUT 'test deleting branch without config' \\\n     'git branch my7 s &&\n      sha1=$(git rev-parse my7 | cut -c 1-7) &&\n      test \"$(git branch -d my7 2>&1)\" = \"Deleted branch my7 (was $sha1).\"'\n-- \n1.7.2.3\n"},{"id":"161985","messageId":"1298418152-27789-19-git-send-email-avarab@gmail.com","threadId":"26561","inReplyTo":"7vhbbwdjnm.fsf@alter.siamese.dyndns.org","subject":"[PATCH v4 18/73] gettextize: git-branch \"git branch -v\" messages","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2011-02-22T23:41:37Z","receivedAt":"2011-02-22T23:41:37Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"Make the \"git branch -v\" messages translatable, e.g.:\n\n    5054b57 [ahead 8] branch error fixup\n\nThis is possibly a plumbing message.\n\nSigned-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n builtin/branch.c         |    6 +++---\n t/t6040-tracking-info.sh |    2 +-\n 2 files changed, 4 insertions(+), 4 deletions(-)\n\ndiff --git a/builtin/branch.c b/builtin/branch.c\nindex d276681..4c1a256 100644\n--- a/builtin/branch.c\n+++ b/builtin/branch.c\n@@ -373,11 +373,11 @@ static void fill_tracking_info(struct strbuf *stat, const char *branch_name,\n \t\tstrbuf_addf(stat, \"%s: \",\n \t\t\tshorten_unambiguous_ref(branch->merge[0]->dst, 0));\n \tif (!ours)\n-\t\tstrbuf_addf(stat, \"behind %d] \", theirs);\n+\t\tstrbuf_addf(stat, _(\"behind %d] \"), theirs);\n \telse if (!theirs)\n-\t\tstrbuf_addf(stat, \"ahead %d] \", ours);\n+\t\tstrbuf_addf(stat, _(\"ahead %d] \"), ours);\n \telse\n-\t\tstrbuf_addf(stat, \"ahead %d, behind %d] \", ours, theirs);\n+\t\tstrbuf_addf(stat, _(\"ahead %d, behind %d] \"), ours, theirs);\n }\n \n static int matches_merge_filter(struct commit *commit)\ndiff --git a/t/t6040-tracking-info.sh b/t/t6040-tracking-info.sh\nindex 1e0447f..6cad643 100755\n--- a/t/t6040-tracking-info.sh\n+++ b/t/t6040-tracking-info.sh\n@@ -42,7 +42,7 @@ b3 behind 1\n b4 ahead 2\n EOF\n \n-test_expect_success 'branch -v' '\n+test_expect_success C_LOCALE_OUTPUT 'branch -v' '\n \t(\n \t\tcd test &&\n \t\tgit branch -v\n-- \n1.7.2.3\n"},{"id":"161977","messageId":"1298418152-27789-20-git-send-email-avarab@gmail.com","threadId":"26561","inReplyTo":"7vhbbwdjnm.fsf@alter.siamese.dyndns.org","subject":"[PATCH v4 19/73] gettextize: git-branch \"(no branch)\" message","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2011-02-22T23:41:38Z","receivedAt":"2011-02-22T23:41:38Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"Gettextize the \"(no branch)\" message that's shown by \"git branch\" when\nyou're in a detached HEAD.\n\nSigned-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n builtin/branch.c         |    2 +-\n t/t3203-branch-output.sh |    2 +-\n 2 files changed, 2 insertions(+), 2 deletions(-)\n\ndiff --git a/builtin/branch.c b/builtin/branch.c\nindex 4c1a256..244589e 100644\n--- a/builtin/branch.c\n+++ b/builtin/branch.c\n@@ -476,7 +476,7 @@ static void show_detached(struct ref_list *ref_list)\n \n \tif (head_commit && is_descendant_of(head_commit, ref_list->with_commit)) {\n \t\tstruct ref_item item;\n-\t\titem.name = xstrdup(\"(no branch)\");\n+\t\titem.name = xstrdup(_(\"(no branch)\"));\n \t\titem.len = strlen(item.name);\n \t\titem.kind = REF_LOCAL_BRANCH;\n \t\titem.dest = NULL;\ndiff --git a/t/t3203-branch-output.sh b/t/t3203-branch-output.sh\nindex 6028748..4ef7d09 100755\n--- a/t/t3203-branch-output.sh\n+++ b/t/t3203-branch-output.sh\n@@ -72,7 +72,7 @@ cat >expect <<'EOF'\n   branch-two\n   master\n EOF\n-test_expect_success 'git branch shows detached HEAD properly' '\n+test_expect_success C_LOCALE_OUTPUT 'git branch shows detached HEAD properly' '\n \tgit checkout HEAD^0 &&\n \tgit branch >actual &&\n \ttest_cmp expect actual\n-- \n1.7.2.3\n"},{"id":"161976","messageId":"1298418152-27789-21-git-send-email-avarab@gmail.com","threadId":"26561","inReplyTo":"7vhbbwdjnm.fsf@alter.siamese.dyndns.org","subject":"[PATCH v4 20/73] gettextize: git-checkout basic messages","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2011-02-22T23:41:39Z","receivedAt":"2011-02-22T23:41:39Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n builtin/checkout.c |   68 ++++++++++++++++++++++++++--------------------------\n 1 files changed, 34 insertions(+), 34 deletions(-)\n\ndiff --git a/builtin/checkout.c b/builtin/checkout.c\nindex cd7f56e..b5060ab 100644\n--- a/builtin/checkout.c\n+++ b/builtin/checkout.c\n@@ -116,7 +116,7 @@ static int check_all_stages(struct cache_entry *ce, int pos)\n \t    ce_stage(active_cache[pos+1]) != 2 ||\n \t    strcmp(active_cache[pos+2]->name, ce->name) ||\n \t    ce_stage(active_cache[pos+2]) != 3)\n-\t\treturn error(\"path '%s' does not have all three versions\",\n+\t\treturn error(_(\"path '%s' does not have all three versions\"),\n \t\t\t     ce->name);\n \treturn 0;\n }\n@@ -150,7 +150,7 @@ static int checkout_merged(int pos, struct checkout *state)\n \t    ce_stage(active_cache[pos+1]) != 2 ||\n \t    strcmp(active_cache[pos+2]->name, path) ||\n \t    ce_stage(active_cache[pos+2]) != 3)\n-\t\treturn error(\"path '%s' does not have all 3 versions\", path);\n+\t\treturn error(_(\"path '%s' does not have all 3 versions\"), path);\n \n \tread_mmblob(&ancestor, active_cache[pos]->sha1);\n \tread_mmblob(&ours, active_cache[pos+1]->sha1);\n@@ -167,7 +167,7 @@ static int checkout_merged(int pos, struct checkout *state)\n \tfree(theirs.ptr);\n \tif (status < 0 || !result_buf.ptr) {\n \t\tfree(result_buf.ptr);\n-\t\treturn error(\"path '%s': cannot merge\", path);\n+\t\treturn error(_(\"path '%s': cannot merge\"), path);\n \t}\n \n \t/*\n@@ -184,12 +184,12 @@ static int checkout_merged(int pos, struct checkout *state)\n \t */\n \tif (write_sha1_file(result_buf.ptr, result_buf.size,\n \t\t\t    blob_type, sha1))\n-\t\tdie(\"Unable to add merge result for '%s'\", path);\n+\t\tdie(_(\"Unable to add merge result for '%s'\"), path);\n \tce = make_cache_entry(create_ce_mode(active_cache[pos+1]->ce_mode),\n \t\t\t      sha1,\n \t\t\t      path, 2, 0);\n \tif (!ce)\n-\t\tdie(\"make_cache_entry failed for path '%s'\", path);\n+\t\tdie(_(\"make_cache_entry failed for path '%s'\"), path);\n \tstatus = checkout_entry(ce, state, NULL);\n \treturn status;\n }\n@@ -211,7 +211,7 @@ static int checkout_paths(struct tree *source_tree, const char **pathspec,\n \n \tnewfd = hold_locked_index(lock_file, 1);\n \tif (read_cache_preload(pathspec) < 0)\n-\t\treturn error(\"corrupt index file\");\n+\t\treturn error(_(\"corrupt index file\"));\n \n \tif (source_tree)\n \t\tread_tree_some(source_tree, pathspec);\n@@ -239,14 +239,14 @@ static int checkout_paths(struct tree *source_tree, const char **pathspec,\n \t\t\tif (!ce_stage(ce))\n \t\t\t\tcontinue;\n \t\t\tif (opts->force) {\n-\t\t\t\twarning(\"path '%s' is unmerged\", ce->name);\n+\t\t\t\twarning(_(\"path '%s' is unmerged\"), ce->name);\n \t\t\t} else if (stage) {\n \t\t\t\terrs |= check_stage(stage, ce, pos);\n \t\t\t} else if (opts->merge) {\n \t\t\t\terrs |= check_all_stages(ce, pos);\n \t\t\t} else {\n \t\t\t\terrs = 1;\n-\t\t\t\terror(\"path '%s' is unmerged\", ce->name);\n+\t\t\t\terror(_(\"path '%s' is unmerged\"), ce->name);\n \t\t\t}\n \t\t\tpos = skip_same_name(ce, pos) - 1;\n \t\t}\n@@ -275,7 +275,7 @@ static int checkout_paths(struct tree *source_tree, const char **pathspec,\n \n \tif (write_cache(newfd, active_cache, active_nr) ||\n \t    commit_locked_index(lock_file))\n-\t\tdie(\"unable to write new index file\");\n+\t\tdie(_(\"unable to write new index file\"));\n \n \tresolve_ref(\"HEAD\", rev, 0, &flag);\n \thead = lookup_commit_reference_gently(rev, 1);\n@@ -292,7 +292,7 @@ static void show_local_changes(struct object *head, struct diff_options *opts)\n \trev.diffopt.flags = opts->flags;\n \trev.diffopt.output_format |= DIFF_FORMAT_NAME_STATUS;\n \tif (diff_setup_done(&rev.diffopt) < 0)\n-\t\tdie(\"diff_setup_done failed\");\n+\t\tdie(_(\"diff_setup_done failed\"));\n \tadd_pending_object(&rev, head, NULL);\n \trun_diff_index(&rev, 0);\n }\n@@ -366,7 +366,7 @@ static int merge_working_tree(struct checkout_opts *opts,\n \tint newfd = hold_locked_index(lock_file, 1);\n \n \tif (read_cache_preload(NULL) < 0)\n-\t\treturn error(\"corrupt index file\");\n+\t\treturn error(_(\"corrupt index file\"));\n \n \tresolve_undo_clear();\n \tif (opts->force) {\n@@ -388,7 +388,7 @@ static int merge_working_tree(struct checkout_opts *opts,\n \t\trefresh_cache(REFRESH_QUIET);\n \n \t\tif (unmerged_cache()) {\n-\t\t\terror(\"you need to resolve your current index first\");\n+\t\t\terror(_(\"you need to resolve your current index first\"));\n \t\t\treturn 1;\n \t\t}\n \n@@ -470,7 +470,7 @@ static int merge_working_tree(struct checkout_opts *opts,\n \n \tif (write_cache(newfd, active_cache, active_nr) ||\n \t    commit_locked_index(lock_file))\n-\t\tdie(\"unable to write new index file\");\n+\t\tdie(_(\"unable to write new index file\"));\n \n \tif (!opts->force && !opts->quiet)\n \t\tshow_local_changes(&new->commit->object, &opts->diff_options);\n@@ -519,7 +519,7 @@ static void update_refs_for_switch(struct checkout_opts *opts,\n \t\t\t\ttemp = log_all_ref_updates;\n \t\t\t\tlog_all_ref_updates = 1;\n \t\t\t\tif (log_ref_setup(ref_name, log_file, sizeof(log_file))) {\n-\t\t\t\t\tfprintf(stderr, \"Can not do reflog for '%s'\\n\",\n+\t\t\t\t\tfprintf(stderr, _(\"Can not do reflog for '%s'\\n\"),\n \t\t\t\t\t    opts->new_orphan_branch);\n \t\t\t\t\tlog_all_ref_updates = temp;\n \t\t\t\t\treturn;\n@@ -545,14 +545,14 @@ static void update_refs_for_switch(struct checkout_opts *opts,\n \t\tcreate_symref(\"HEAD\", new->path, msg.buf);\n \t\tif (!opts->quiet) {\n \t\t\tif (old->path && !strcmp(new->path, old->path))\n-\t\t\t\tfprintf(stderr, \"Already on '%s'\\n\",\n+\t\t\t\tfprintf(stderr, _(\"Already on '%s'\\n\"),\n \t\t\t\t\tnew->name);\n \t\t\telse if (opts->new_branch)\n \t\t\t\tfprintf(stderr, \"Switched to%s branch '%s'\\n\",\n \t\t\t\t\topts->branch_exists ? \" and reset\" : \" a new\",\n \t\t\t\t\tnew->name);\n \t\t\telse\n-\t\t\t\tfprintf(stderr, \"Switched to branch '%s'\\n\",\n+\t\t\t\tfprintf(stderr, _(\"Switched to branch '%s'\\n\"),\n \t\t\t\t\tnew->name);\n \t\t}\n \t\tif (old->path && old->name) {\n@@ -597,7 +597,7 @@ static int switch_branches(struct checkout_opts *opts, struct branch_info *new)\n \t\tnew->name = \"HEAD\";\n \t\tnew->commit = old.commit;\n \t\tif (!new->commit)\n-\t\t\tdie(\"You are on a branch yet to be born\");\n+\t\t\tdie(_(\"You are on a branch yet to be born\"));\n \t\tparse_commit(new->commit);\n \t}\n \n@@ -724,7 +724,7 @@ int cmd_checkout(int argc, const char **argv, const char *prefix)\n \n \t/* we can assume from now on new_branch = !new_branch_force */\n \tif (opts.new_branch && opts.new_branch_force)\n-\t\tdie(\"-B cannot be used with -b\");\n+\t\tdie(_(\"-B cannot be used with -b\"));\n \n \t/* copy -B over to -b, so that we can just check the latter */\n \tif (opts.new_branch_force)\n@@ -732,28 +732,28 @@ int cmd_checkout(int argc, const char **argv, const char *prefix)\n \n \tif (patch_mode && (opts.track > 0 || opts.new_branch\n \t\t\t   || opts.new_branch_log || opts.merge || opts.force))\n-\t\tdie (\"--patch is incompatible with all other options\");\n+\t\tdie (_(\"--patch is incompatible with all other options\"));\n \n \t/* --track without -b should DWIM */\n \tif (0 < opts.track && !opts.new_branch) {\n \t\tconst char *argv0 = argv[0];\n \t\tif (!argc || !strcmp(argv0, \"--\"))\n-\t\t\tdie (\"--track needs a branch name\");\n+\t\t\tdie (_(\"--track needs a branch name\"));\n \t\tif (!prefixcmp(argv0, \"refs/\"))\n \t\t\targv0 += 5;\n \t\tif (!prefixcmp(argv0, \"remotes/\"))\n \t\t\targv0 += 8;\n \t\targv0 = strchr(argv0, '/');\n \t\tif (!argv0 || !argv0[1])\n-\t\t\tdie (\"Missing branch name; try -b\");\n+\t\t\tdie (_(\"Missing branch name; try -b\"));\n \t\topts.new_branch = argv0 + 1;\n \t}\n \n \tif (opts.new_orphan_branch) {\n \t\tif (opts.new_branch)\n-\t\t\tdie(\"--orphan and -b|-B are mutually exclusive\");\n+\t\t\tdie(_(\"--orphan and -b|-B are mutually exclusive\"));\n \t\tif (opts.track > 0)\n-\t\t\tdie(\"--orphan cannot be used with -t\");\n+\t\t\tdie(_(\"--orphan cannot be used with -t\"));\n \t\topts.new_branch = opts.new_orphan_branch;\n \t}\n \n@@ -763,7 +763,7 @@ int cmd_checkout(int argc, const char **argv, const char *prefix)\n \t}\n \n \tif (opts.force && opts.merge)\n-\t\tdie(\"git checkout: -f and -m are incompatible\");\n+\t\tdie(_(\"git checkout: -f and -m are incompatible\"));\n \n \t/*\n \t * case 1: git checkout <ref> -- [<paths>]\n@@ -809,7 +809,7 @@ int cmd_checkout(int argc, const char **argv, const char *prefix)\n \n \t\tif (get_sha1_mb(arg, rev)) {\n \t\t\tif (has_dash_dash)          /* case (1) */\n-\t\t\t\tdie(\"invalid reference: %s\", arg);\n+\t\t\t\tdie(_(\"invalid reference: %s\"), arg);\n \t\t\tif (!patch_mode &&\n \t\t\t    dwim_new_local_branch &&\n \t\t\t    opts.track == BRANCH_TRACK_UNSPECIFIED &&\n@@ -846,7 +846,7 @@ int cmd_checkout(int argc, const char **argv, const char *prefix)\n \t\t\tsource_tree = parse_tree_indirect(rev);\n \n \t\tif (!source_tree)                   /* case (1): want a tree */\n-\t\t\tdie(\"reference is not a tree: %s\", arg);\n+\t\t\tdie(_(\"reference is not a tree: %s\"), arg);\n \t\tif (!has_dash_dash) {/* case (3 -> 1) */\n \t\t\t/*\n \t\t\t * Do not complain the most common case\n@@ -872,7 +872,7 @@ no_reference:\n \t\tconst char **pathspec = get_pathspec(prefix, argv);\n \n \t\tif (!pathspec)\n-\t\t\tdie(\"invalid path specification\");\n+\t\t\tdie(_(\"invalid path specification\"));\n \n \t\tif (patch_mode)\n \t\t\treturn interactive_checkout(new.name, pathspec, &opts);\n@@ -880,14 +880,14 @@ no_reference:\n \t\t/* Checkout paths */\n \t\tif (opts.new_branch) {\n \t\t\tif (argc == 1) {\n-\t\t\t\tdie(\"git checkout: updating paths is incompatible with switching branches.\\nDid you intend to checkout '%s' which can not be resolved as commit?\", argv[0]);\n+\t\t\t\tdie(_(\"git checkout: updating paths is incompatible with switching branches.\\nDid you intend to checkout '%s' which can not be resolved as commit?\"), argv[0]);\n \t\t\t} else {\n-\t\t\t\tdie(\"git checkout: updating paths is incompatible with switching branches.\");\n+\t\t\t\tdie(_(\"git checkout: updating paths is incompatible with switching branches.\"));\n \t\t\t}\n \t\t}\n \n \t\tif (1 < !!opts.writeout_stage + !!opts.force + !!opts.merge)\n-\t\t\tdie(\"git checkout: --ours/--theirs, --force and --merge are incompatible when\\nchecking out of the index.\");\n+\t\t\tdie(_(\"git checkout: --ours/--theirs, --force and --merge are incompatible when\\nchecking out of the index.\"));\n \n \t\treturn checkout_paths(source_tree, pathspec, &opts);\n \t}\n@@ -898,22 +898,22 @@ no_reference:\n \tif (opts.new_branch) {\n \t\tstruct strbuf buf = STRBUF_INIT;\n \t\tif (strbuf_check_branch_ref(&buf, opts.new_branch))\n-\t\t\tdie(\"git checkout: we do not like '%s' as a branch name.\",\n+\t\t\tdie(_(\"git checkout: we do not like '%s' as a branch name.\"),\n \t\t\t    opts.new_branch);\n \t\tif (!get_sha1(buf.buf, rev)) {\n \t\t\topts.branch_exists = 1;\n \t\t\tif (!opts.new_branch_force)\n-\t\t\t\tdie(\"git checkout: branch %s already exists\",\n+\t\t\t\tdie(_(\"git checkout: branch %s already exists\"),\n \t\t\t\t    opts.new_branch);\n \t\t}\n \t\tstrbuf_release(&buf);\n \t}\n \n \tif (new.name && !new.commit) {\n-\t\tdie(\"Cannot switch branch to a non-commit.\");\n+\t\tdie(_(\"Cannot switch branch to a non-commit.\"));\n \t}\n \tif (opts.writeout_stage)\n-\t\tdie(\"--ours/--theirs is incompatible with switching branches.\");\n+\t\tdie(_(\"--ours/--theirs is incompatible with switching branches.\"));\n \n \treturn switch_branches(&opts, &new);\n }\n-- \n1.7.2.3\n"},{"id":"161974","messageId":"1298418152-27789-22-git-send-email-avarab@gmail.com","threadId":"26561","inReplyTo":"7vhbbwdjnm.fsf@alter.siamese.dyndns.org","subject":"[PATCH v4 21/73] gettextize: git-checkout: our/their version message","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2011-02-22T23:41:40Z","receivedAt":"2011-02-22T23:41:40Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"Split up the \"does not have our/their version\" message to make it\neasier to translate.\n\nSigned-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n builtin/checkout.c |   14 ++++++++------\n 1 files changed, 8 insertions(+), 6 deletions(-)\n\ndiff --git a/builtin/checkout.c b/builtin/checkout.c\nindex b5060ab..7ba0788 100644\n--- a/builtin/checkout.c\n+++ b/builtin/checkout.c\n@@ -103,9 +103,10 @@ static int check_stage(int stage, struct cache_entry *ce, int pos)\n \t\t\treturn 0;\n \t\tpos++;\n \t}\n-\treturn error(\"path '%s' does not have %s version\",\n-\t\t     ce->name,\n-\t\t     (stage == 2) ? \"our\" : \"their\");\n+\tif (stage == 2)\n+\t\treturn error(_(\"path '%s' does not have our version\"), ce->name);\n+\telse\n+\t\treturn error(_(\"path '%s' does not have their version\"), ce->name);\n }\n \n static int check_all_stages(struct cache_entry *ce, int pos)\n@@ -130,9 +131,10 @@ static int checkout_stage(int stage, struct cache_entry *ce, int pos,\n \t\t\treturn checkout_entry(active_cache[pos], state, NULL);\n \t\tpos++;\n \t}\n-\treturn error(\"path '%s' does not have %s version\",\n-\t\t     ce->name,\n-\t\t     (stage == 2) ? \"our\" : \"their\");\n+\tif (stage == 2)\n+\t\treturn error(_(\"path '%s' does not have our version\"), ce->name);\n+\telse\n+\t\treturn error(_(\"path '%s' does not have their version\"), ce->name);\n }\n \n static int checkout_merged(int pos, struct checkout *state)\n-- \n1.7.2.3\n"},{"id":"161988","messageId":"1298418152-27789-23-git-send-email-avarab@gmail.com","threadId":"26561","inReplyTo":"7vhbbwdjnm.fsf@alter.siamese.dyndns.org","subject":"[PATCH v4 22/73] gettextize: git-checkout describe_detached_head messages","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2011-02-22T23:41:41Z","receivedAt":"2011-02-22T23:41:41Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n builtin/checkout.c |    2 +-\n 1 files changed, 1 insertions(+), 1 deletions(-)\n\ndiff --git a/builtin/checkout.c b/builtin/checkout.c\nindex 7ba0788..698ac63 100644\n--- a/builtin/checkout.c\n+++ b/builtin/checkout.c\n@@ -613,7 +613,7 @@ static int switch_branches(struct checkout_opts *opts, struct branch_info *new)\n \t * to remind the user that it might be lost.\n \t */\n \tif (!opts->quiet && !old.path && old.commit && new->commit != old.commit)\n-\t\tdescribe_detached_head(\"Previous HEAD position was\", old.commit);\n+\t\tdescribe_detached_head(_(\"Previous HEAD position was\"), old.commit);\n \n \tupdate_refs_for_switch(opts, &old, new);\n \n-- \n1.7.2.3\n"},{"id":"161983","messageId":"1298418152-27789-24-git-send-email-avarab@gmail.com","threadId":"26561","inReplyTo":"7vhbbwdjnm.fsf@alter.siamese.dyndns.org","subject":"[PATCH v4 23/73] gettextize: git-checkout \"HEAD is now at\" message","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2011-02-22T23:41:42Z","receivedAt":"2011-02-22T23:41:42Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"Gettextize the \"HEAD is now at\" messages. Several tests in t7201-co.sh\nexplicitly checked for this message. Change them to skip under\nGETTEXT_POISON=YesPlease.\n\nSigned-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n builtin/checkout.c |    2 +-\n t/t7201-co.sh      |   10 +++++-----\n 2 files changed, 6 insertions(+), 6 deletions(-)\n\ndiff --git a/builtin/checkout.c b/builtin/checkout.c\nindex 698ac63..f833330 100644\n--- a/builtin/checkout.c\n+++ b/builtin/checkout.c\n@@ -571,7 +571,7 @@ static void update_refs_for_switch(struct checkout_opts *opts,\n \t\tif (!opts->quiet) {\n \t\t\tif (old->path && advice_detached_head)\n \t\t\t\tdetach_advice(old->path, new->name);\n-\t\t\tdescribe_detached_head(\"HEAD is now at\", new->commit);\n+\t\t\tdescribe_detached_head(_(\"HEAD is now at\"), new->commit);\n \t\t}\n \t}\n \tremove_branch_state();\ndiff --git a/t/t7201-co.sh b/t/t7201-co.sh\nindex 1337fa5..fb1fe68 100755\n--- a/t/t7201-co.sh\n+++ b/t/t7201-co.sh\n@@ -223,7 +223,7 @@ test_expect_success 'checkout --merge --conflict=diff3 <branch>' '\n \ttest_cmp two expect\n '\n \n-test_expect_success 'checkout to detach HEAD (with advice declined)' '\n+test_expect_success C_LOCALE_OUTPUT 'checkout to detach HEAD (with advice declined)' '\n \n \tgit config advice.detachedHead false &&\n \tgit checkout -f renamer && git clean -f &&\n@@ -242,7 +242,7 @@ test_expect_success 'checkout to detach HEAD (with advice declined)' '\n \tfi\n '\n \n-test_expect_success 'checkout to detach HEAD' '\n+test_expect_success C_LOCALE_OUTPUT 'checkout to detach HEAD' '\n \tgit config advice.detachedHead true &&\n \tgit checkout -f renamer && git clean -f &&\n \tgit checkout renamer^ 2>messages &&\n@@ -260,7 +260,7 @@ test_expect_success 'checkout to detach HEAD' '\n \tfi\n '\n \n-test_expect_success 'checkout to detach HEAD with branchname^' '\n+test_expect_success C_LOCALE_OUTPUT 'checkout to detach HEAD with branchname^' '\n \n \tgit checkout -f master && git clean -f &&\n \tgit checkout renamer^ &&\n@@ -276,7 +276,7 @@ test_expect_success 'checkout to detach HEAD with branchname^' '\n \tfi\n '\n \n-test_expect_success 'checkout to detach HEAD with :/message' '\n+test_expect_success C_LOCALE_OUTPUT 'checkout to detach HEAD with :/message' '\n \n \tgit checkout -f master && git clean -f &&\n \tgit checkout \":/Initial\" &&\n@@ -292,7 +292,7 @@ test_expect_success 'checkout to detach HEAD with :/message' '\n \tfi\n '\n \n-test_expect_success 'checkout to detach HEAD with HEAD^0' '\n+test_expect_success C_LOCALE_OUTPUT 'checkout to detach HEAD with HEAD^0' '\n \n \tgit checkout -f master && git clean -f &&\n \tgit checkout HEAD^0 &&\n-- \n1.7.2.3\n"},{"id":"161928","messageId":"1298418152-27789-25-git-send-email-avarab@gmail.com","threadId":"26561","inReplyTo":"7vhbbwdjnm.fsf@alter.siamese.dyndns.org","subject":"[PATCH v4 24/73] gettextize: git-checkout \"Switched to a .. branch\" message","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2011-02-22T23:41:43Z","receivedAt":"2011-02-22T23:41:43Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"Split up the \"Switched to and reset branch\" and \"Switched to a new\nbranch\" messages to make them easier to translate.\n\nSigned-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n builtin/checkout.c |    7 ++++---\n 1 files changed, 4 insertions(+), 3 deletions(-)\n\ndiff --git a/builtin/checkout.c b/builtin/checkout.c\nindex f833330..2bb7759 100644\n--- a/builtin/checkout.c\n+++ b/builtin/checkout.c\n@@ -550,9 +550,10 @@ static void update_refs_for_switch(struct checkout_opts *opts,\n \t\t\t\tfprintf(stderr, _(\"Already on '%s'\\n\"),\n \t\t\t\t\tnew->name);\n \t\t\telse if (opts->new_branch)\n-\t\t\t\tfprintf(stderr, \"Switched to%s branch '%s'\\n\",\n-\t\t\t\t\topts->branch_exists ? \" and reset\" : \" a new\",\n-\t\t\t\t\tnew->name);\n+\t\t\t\tif (opts->branch_exists)\n+\t\t\t\t\tfprintf(stderr, _(\"Switched to and reset branch '%s'\\n\"), new->name);\n+\t\t\t\telse\n+\t\t\t\t\tfprintf(stderr, _(\"Switched to a new branch '%s'\\n\"), new->name);\n \t\t\telse\n \t\t\t\tfprintf(stderr, _(\"Switched to branch '%s'\\n\"),\n \t\t\t\t\tnew->name);\n-- \n1.7.2.3\n"},{"id":"161929","messageId":"1298418152-27789-26-git-send-email-avarab@gmail.com","threadId":"26561","inReplyTo":"7vhbbwdjnm.fsf@alter.siamese.dyndns.org","subject":"[PATCH v4 25/73] gettextize: git-commit basic messages","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2011-02-22T23:41:44Z","receivedAt":"2011-02-22T23:41:44Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n builtin/commit.c |  118 +++++++++++++++++++++++++++---------------------------\n 1 files changed, 59 insertions(+), 59 deletions(-)\n\ndiff --git a/builtin/commit.c b/builtin/commit.c\nindex d7f55e3..c57f603 100644\n--- a/builtin/commit.c\n+++ b/builtin/commit.c\n@@ -243,7 +243,7 @@ static void add_remove_files(struct string_list *list)\n \n \t\tif (!lstat(p->string, &st)) {\n \t\t\tif (add_to_cache(p->string, &st, 0))\n-\t\t\t\tdie(\"updating files failed\");\n+\t\t\t\tdie(_(\"updating files failed\"));\n \t\t} else\n \t\t\tremove_file_from_cache(p->string);\n \t}\n@@ -270,7 +270,7 @@ static void create_base_index(void)\n \topts.fn = oneway_merge;\n \ttree = parse_tree_indirect(head_sha1);\n \tif (!tree)\n-\t\tdie(\"failed to unpack HEAD tree object\");\n+\t\tdie(_(\"failed to unpack HEAD tree object\"));\n \tparse_tree(tree);\n \tinit_tree_desc(&t, tree->buffer, tree->size);\n \tif (unpack_trees(1, &t, &opts))\n@@ -298,9 +298,9 @@ static char *prepare_index(int argc, const char **argv, const char *prefix, int\n \t\trefresh_flags |= REFRESH_UNMERGED;\n \tif (interactive) {\n \t\tif (interactive_add(argc, argv, prefix) != 0)\n-\t\t\tdie(\"interactive add failed\");\n+\t\t\tdie(_(\"interactive add failed\"));\n \t\tif (read_cache_preload(NULL) < 0)\n-\t\t\tdie(\"index file corrupt\");\n+\t\t\tdie(_(\"index file corrupt\"));\n \t\tcommit_style = COMMIT_AS_IS;\n \t\treturn get_index_file();\n \t}\n@@ -309,7 +309,7 @@ static char *prepare_index(int argc, const char **argv, const char *prefix, int\n \t\tpathspec = get_pathspec(prefix, argv);\n \n \tif (read_cache_preload(pathspec) < 0)\n-\t\tdie(\"index file corrupt\");\n+\t\tdie(_(\"index file corrupt\"));\n \n \t/*\n \t * Non partial, non as-is commit.\n@@ -329,7 +329,7 @@ static char *prepare_index(int argc, const char **argv, const char *prefix, int\n \t\trefresh_cache_or_die(refresh_flags);\n \t\tif (write_cache(fd, active_cache, active_nr) ||\n \t\t    close_lock_file(&index_lock))\n-\t\t\tdie(\"unable to write new_index file\");\n+\t\t\tdie(_(\"unable to write new_index file\"));\n \t\tcommit_style = COMMIT_NORMAL;\n \t\treturn index_lock.filename;\n \t}\n@@ -349,7 +349,7 @@ static char *prepare_index(int argc, const char **argv, const char *prefix, int\n \t\tif (active_cache_changed) {\n \t\t\tif (write_cache(fd, active_cache, active_nr) ||\n \t\t\t    commit_locked_index(&index_lock))\n-\t\t\t\tdie(\"unable to write new_index file\");\n+\t\t\t\tdie(_(\"unable to write new_index file\"));\n \t\t} else {\n \t\t\trollback_lock_file(&index_lock);\n \t\t}\n@@ -379,7 +379,7 @@ static char *prepare_index(int argc, const char **argv, const char *prefix, int\n \tcommit_style = COMMIT_PARTIAL;\n \n \tif (in_merge)\n-\t\tdie(\"cannot do a partial commit during a merge.\");\n+\t\tdie(_(\"cannot do a partial commit during a merge.\"));\n \n \tmemset(&partial, 0, sizeof(partial));\n \tpartial.strdup_strings = 1;\n@@ -388,14 +388,14 @@ static char *prepare_index(int argc, const char **argv, const char *prefix, int\n \n \tdiscard_cache();\n \tif (read_cache() < 0)\n-\t\tdie(\"cannot read the index\");\n+\t\tdie(_(\"cannot read the index\"));\n \n \tfd = hold_locked_index(&index_lock, 1);\n \tadd_remove_files(&partial);\n \trefresh_cache(REFRESH_QUIET);\n \tif (write_cache(fd, active_cache, active_nr) ||\n \t    close_lock_file(&index_lock))\n-\t\tdie(\"unable to write new_index file\");\n+\t\tdie(_(\"unable to write new_index file\"));\n \n \tfd = hold_lock_file_for_update(&false_lock,\n \t\t\t\t       git_path(\"next-index-%\"PRIuMAX,\n@@ -408,7 +408,7 @@ static char *prepare_index(int argc, const char **argv, const char *prefix, int\n \n \tif (write_cache(fd, active_cache, active_nr) ||\n \t    close_lock_file(&false_lock))\n-\t\tdie(\"unable to write temporary index file\");\n+\t\tdie(_(\"unable to write temporary index file\"));\n \n \tdiscard_cache();\n \tread_cache_from(false_lock.filename);\n@@ -455,7 +455,7 @@ static int is_a_merge(const unsigned char *sha1)\n {\n \tstruct commit *commit = lookup_commit(sha1);\n \tif (!commit || parse_commit(commit))\n-\t\tdie(\"could not parse HEAD commit\");\n+\t\tdie(_(\"could not parse HEAD commit\"));\n \treturn !!(commit->parents && commit->parents->next);\n }\n \n@@ -474,13 +474,13 @@ static void determine_author_info(struct strbuf *author_ident)\n \n \t\ta = strstr(use_message_buffer, \"\\nauthor \");\n \t\tif (!a)\n-\t\t\tdie(\"invalid commit: %s\", use_message);\n+\t\t\tdie(_(\"invalid commit: %s\"), use_message);\n \n \t\tlb = strchrnul(a + strlen(\"\\nauthor \"), '<');\n \t\trb = strchrnul(lb, '>');\n \t\teol = strchrnul(rb, '\\n');\n \t\tif (!*lb || !*rb || !*eol)\n-\t\t\tdie(\"invalid commit: %s\", use_message);\n+\t\t\tdie(_(\"invalid commit: %s\"), use_message);\n \n \t\tif (lb == a + strlen(\"\\nauthor \"))\n \t\t\t/* \\nauthor <foo@example.com> */\n@@ -498,7 +498,7 @@ static void determine_author_info(struct strbuf *author_ident)\n \t\tconst char *rb = strchr(force_author, '>');\n \n \t\tif (!lb || !rb)\n-\t\t\tdie(\"malformed --author parameter\");\n+\t\t\tdie(_(\"malformed --author parameter\"));\n \t\tname = xstrndup(force_author, lb - force_author);\n \t\temail = xstrndup(lb + 2, rb - (lb + 2));\n \t}\n@@ -554,7 +554,7 @@ static char *cut_ident_timestamp_part(char *string)\n {\n \tchar *ket = strrchr(string, '>');\n \tif (!ket || ket[1] != ' ')\n-\t\tdie(\"Malformed ident string: '%s'\", string);\n+\t\tdie(_(\"Malformed ident string: '%s'\"), string);\n \t*++ket = '\\0';\n \treturn ket;\n }\n@@ -588,7 +588,7 @@ static int prepare_to_commit(const char *index_file, const char *prefix,\n \t\t\tstruct commit *c;\n \t\t\tc = lookup_commit_reference_by_name(squash_message);\n \t\t\tif (!c)\n-\t\t\t\tdie(\"could not lookup commit %s\", squash_message);\n+\t\t\t\tdie(_(\"could not lookup commit %s\"), squash_message);\n \t\t\tctx.output_encoding = get_commit_output_encoding();\n \t\t\tformat_commit_message(c, \"squash! %s\\n\\n\", &sb,\n \t\t\t\t\t      &ctx);\n@@ -600,19 +600,19 @@ static int prepare_to_commit(const char *index_file, const char *prefix,\n \t\thook_arg1 = \"message\";\n \t} else if (logfile && !strcmp(logfile, \"-\")) {\n \t\tif (isatty(0))\n-\t\t\tfprintf(stderr, \"(reading log message from standard input)\\n\");\n+\t\t\tfprintf(stderr, _(\"(reading log message from standard input)\\n\"));\n \t\tif (strbuf_read(&sb, 0, 0) < 0)\n-\t\t\tdie_errno(\"could not read log from standard input\");\n+\t\t\tdie_errno(_(\"could not read log from standard input\"));\n \t\thook_arg1 = \"message\";\n \t} else if (logfile) {\n \t\tif (strbuf_read_file(&sb, logfile, 0) < 0)\n-\t\t\tdie_errno(\"could not read log file '%s'\",\n+\t\t\tdie_errno(_(\"could not read log file '%s'\"),\n \t\t\t\t  logfile);\n \t\thook_arg1 = \"message\";\n \t} else if (use_message) {\n \t\tbuffer = strstr(use_message_buffer, \"\\n\\n\");\n \t\tif (!buffer || buffer[2] == '\\0')\n-\t\t\tdie(\"commit has empty message\");\n+\t\t\tdie(_(\"commit has empty message\"));\n \t\tstrbuf_add(&sb, buffer + 2, strlen(buffer + 2));\n \t\thook_arg1 = \"commit\";\n \t\thook_arg2 = use_message;\n@@ -621,22 +621,22 @@ static int prepare_to_commit(const char *index_file, const char *prefix,\n \t\tstruct commit *commit;\n \t\tcommit = lookup_commit_reference_by_name(fixup_message);\n \t\tif (!commit)\n-\t\t\tdie(\"could not lookup commit %s\", fixup_message);\n+\t\t\tdie(_(\"could not lookup commit %s\"), fixup_message);\n \t\tctx.output_encoding = get_commit_output_encoding();\n \t\tformat_commit_message(commit, \"fixup! %s\\n\\n\",\n \t\t\t\t      &sb, &ctx);\n \t\thook_arg1 = \"message\";\n \t} else if (!stat(git_path(\"MERGE_MSG\"), &statbuf)) {\n \t\tif (strbuf_read_file(&sb, git_path(\"MERGE_MSG\"), 0) < 0)\n-\t\t\tdie_errno(\"could not read MERGE_MSG\");\n+\t\t\tdie_errno(_(\"could not read MERGE_MSG\"));\n \t\thook_arg1 = \"merge\";\n \t} else if (!stat(git_path(\"SQUASH_MSG\"), &statbuf)) {\n \t\tif (strbuf_read_file(&sb, git_path(\"SQUASH_MSG\"), 0) < 0)\n-\t\t\tdie_errno(\"could not read SQUASH_MSG\");\n+\t\t\tdie_errno(_(\"could not read SQUASH_MSG\"));\n \t\thook_arg1 = \"squash\";\n \t} else if (template_file && !stat(template_file, &statbuf)) {\n \t\tif (strbuf_read_file(&sb, template_file, 0) < 0)\n-\t\t\tdie_errno(\"could not read '%s'\", template_file);\n+\t\t\tdie_errno(_(\"could not read '%s'\"), template_file);\n \t\thook_arg1 = \"template\";\n \t}\n \n@@ -659,7 +659,7 @@ static int prepare_to_commit(const char *index_file, const char *prefix,\n \n \tfp = fopen(git_path(commit_editmsg), \"w\");\n \tif (fp == NULL)\n-\t\tdie_errno(\"could not open '%s'\", git_path(commit_editmsg));\n+\t\tdie_errno(_(\"could not open '%s'\"), git_path(commit_editmsg));\n \n \tif (cleanup_mode != CLEANUP_NONE)\n \t\tstripspace(&sb, 0);\n@@ -683,7 +683,7 @@ static int prepare_to_commit(const char *index_file, const char *prefix,\n \t}\n \n \tif (fwrite(sb.buf, 1, sb.len, fp) < sb.len)\n-\t\tdie_errno(\"could not write commit template\");\n+\t\tdie_errno(_(\"could not write commit template\"));\n \n \tstrbuf_release(&sb);\n \n@@ -752,7 +752,7 @@ static int prepare_to_commit(const char *index_file, const char *prefix,\n \t\tconst char *parent = \"HEAD\";\n \n \t\tif (!active_nr && read_cache() < 0)\n-\t\t\tdie(\"Cannot read index\");\n+\t\t\tdie(_(\"Cannot read index\"));\n \n \t\tif (amend)\n \t\t\tparent = \"HEAD^1\";\n@@ -785,7 +785,7 @@ static int prepare_to_commit(const char *index_file, const char *prefix,\n \t\tactive_cache_tree = cache_tree();\n \tif (cache_tree_update(active_cache_tree,\n \t\t\t      active_cache, active_nr, 0, 0) < 0) {\n-\t\terror(\"Error building trees\");\n+\t\terror(_(\"Error building trees\"));\n \t\treturn 0;\n \t}\n \n@@ -800,7 +800,7 @@ static int prepare_to_commit(const char *index_file, const char *prefix,\n \t\tsnprintf(index, sizeof(index), \"GIT_INDEX_FILE=%s\", index_file);\n \t\tif (launch_editor(git_path(commit_editmsg), NULL, env)) {\n \t\t\tfprintf(stderr,\n-\t\t\t\"Please supply the message using either -m or -F option.\\n\");\n+\t\t\t_(\"Please supply the message using either -m or -F option.\\n\"));\n \t\t\texit(1);\n \t\t}\n \t}\n@@ -880,7 +880,7 @@ static const char *find_author_by_nickname(const char *name)\n \t\tformat_commit_message(commit, \"%an <%ae>\", &buf, &ctx);\n \t\treturn strbuf_detach(&buf, NULL);\n \t}\n-\tdie(\"No existing author found with '%s'\", name);\n+\tdie(_(\"No existing author found with '%s'\"), name);\n }\n \n \n@@ -895,7 +895,7 @@ static void handle_untracked_files_arg(struct wt_status *s)\n \telse if (!strcmp(untracked_files_arg, \"all\"))\n \t\ts->show_untracked_files = SHOW_ALL_UNTRACKED_FILES;\n \telse\n-\t\tdie(\"Invalid untracked files mode '%s'\", untracked_files_arg);\n+\t\tdie(_(\"Invalid untracked files mode '%s'\"), untracked_files_arg);\n }\n \n static int parse_and_validate_options(int argc, const char *argv[],\n@@ -912,7 +912,7 @@ static int parse_and_validate_options(int argc, const char *argv[],\n \t\tforce_author = find_author_by_nickname(force_author);\n \n \tif (force_author && renew_authorship)\n-\t\tdie(\"Using both --reset-author and --author does not make sense\");\n+\t\tdie(_(\"Using both --reset-author and --author does not make sense\"));\n \n \tif (logfile || message.len || use_message || fixup_message)\n \t\tuse_editor = 0;\n@@ -926,7 +926,7 @@ static int parse_and_validate_options(int argc, const char *argv[],\n \n \t/* Sanity check options */\n \tif (amend && initial_commit)\n-\t\tdie(\"You have nothing to amend.\");\n+\t\tdie(_(\"You have nothing to amend.\"));\n \tif (amend && in_merge)\n \t\tdie(\"You are in the middle of a merge -- cannot amend.\");\n \tif (fixup_message && squash_message)\n@@ -940,22 +940,22 @@ static int parse_and_validate_options(int argc, const char *argv[],\n \tif (logfile)\n \t\tf++;\n \tif (f > 1)\n-\t\tdie(\"Only one of -c/-C/-F/--fixup can be used.\");\n+\t\tdie(_(\"Only one of -c/-C/-F/--fixup can be used.\"));\n \tif (message.len && f > 0)\n-\t\tdie(\"Option -m cannot be combined with -c/-C/-F/--fixup.\");\n+\t\tdie((_(\"Option -m cannot be combined with -c/-C/-F/--fixup.\")));\n \tif (edit_message)\n \t\tuse_message = edit_message;\n \tif (amend && !use_message && !fixup_message)\n \t\tuse_message = \"HEAD\";\n \tif (!use_message && renew_authorship)\n-\t\tdie(\"--reset-author can be used only with -C, -c or --amend.\");\n+\t\tdie(_(\"--reset-author can be used only with -C, -c or --amend.\"));\n \tif (use_message) {\n \t\tconst char *out_enc;\n \t\tstruct commit *commit;\n \n \t\tcommit = lookup_commit_reference_by_name(use_message);\n \t\tif (!commit)\n-\t\t\tdie(\"could not lookup commit %s\", use_message);\n+\t\t\tdie(_(\"could not lookup commit %s\"), use_message);\n \t\tout_enc = get_commit_output_encoding();\n \t\tuse_message_buffer = logmsg_reencode(commit, out_enc);\n \n@@ -970,13 +970,13 @@ static int parse_and_validate_options(int argc, const char *argv[],\n \t}\n \n \tif (!!also + !!only + !!all + !!interactive > 1)\n-\t\tdie(\"Only one of --include/--only/--all/--interactive can be used.\");\n+\t\tdie(_(\"Only one of --include/--only/--all/--interactive can be used.\"));\n \tif (argc == 0 && (also || (only && !amend)))\n-\t\tdie(\"No paths with --include/--only does not make sense.\");\n+\t\tdie(_(\"No paths with --include/--only does not make sense.\"));\n \tif (argc == 0 && only && amend)\n-\t\tonly_include_assumed = \"Clever... amending the last one with dirty index.\";\n+\t\tonly_include_assumed = _(\"Clever... amending the last one with dirty index.\");\n \tif (argc > 0 && !also && !only)\n-\t\tonly_include_assumed = \"Explicit paths specified without -i nor -o; assuming --only paths...\";\n+\t\tonly_include_assumed = _(\"Explicit paths specified without -i nor -o; assuming --only paths...\");\n \tif (!cleanup_arg || !strcmp(cleanup_arg, \"default\"))\n \t\tcleanup_mode = use_editor ? CLEANUP_ALL : CLEANUP_SPACE;\n \telse if (!strcmp(cleanup_arg, \"verbatim\"))\n@@ -986,14 +986,14 @@ static int parse_and_validate_options(int argc, const char *argv[],\n \telse if (!strcmp(cleanup_arg, \"strip\"))\n \t\tcleanup_mode = CLEANUP_ALL;\n \telse\n-\t\tdie(\"Invalid cleanup mode %s\", cleanup_arg);\n+\t\tdie(_(\"Invalid cleanup mode %s\"), cleanup_arg);\n \n \thandle_untracked_files_arg(s);\n \n \tif (all && argc > 0)\n-\t\tdie(\"Paths with -a does not make sense.\");\n+\t\tdie(_(\"Paths with -a does not make sense.\"));\n \telse if (interactive && argc > 0)\n-\t\tdie(\"Paths with --interactive does not make sense.\");\n+\t\tdie(_(\"Paths with --interactive does not make sense.\"));\n \n \tif (null_termination && status_format == STATUS_FORMAT_LONG)\n \t\tstatus_format = STATUS_FORMAT_PORCELAIN;\n@@ -1074,7 +1074,7 @@ static int git_status_config(const char *k, const char *v, void *cb)\n \t\telse if (!strcmp(v, \"all\"))\n \t\t\ts->show_untracked_files = SHOW_ALL_UNTRACKED_FILES;\n \t\telse\n-\t\t\treturn error(\"Invalid untracked files mode '%s'\", v);\n+\t\t\treturn error(_(\"Invalid untracked files mode '%s'\"), v);\n \t\treturn 0;\n \t}\n \treturn git_diff_ui_config(k, v, NULL);\n@@ -1180,9 +1180,9 @@ static void print_summary(const char *prefix, const unsigned char *sha1)\n \n \tcommit = lookup_commit(sha1);\n \tif (!commit)\n-\t\tdie(\"couldn't look up newly created commit\");\n+\t\tdie(_(\"couldn't look up newly created commit\"));\n \tif (!commit || parse_commit(commit))\n-\t\tdie(\"could not parse newly created commit\");\n+\t\tdie(_(\"could not parse newly created commit\"));\n \n \tstrbuf_addstr(&format, \"format:%h] %s\");\n \n@@ -1336,7 +1336,7 @@ int cmd_commit(int argc, const char **argv, const char *prefix)\n \t\t\treflog_msg = \"commit (amend)\";\n \t\tcommit = lookup_commit(head_sha1);\n \t\tif (!commit || parse_commit(commit))\n-\t\t\tdie(\"could not parse HEAD commit\");\n+\t\t\tdie(_(\"could not parse HEAD commit\"));\n \n \t\tfor (c = commit->parents; c; c = c->next)\n \t\t\tpptr = &commit_list_insert(c->item, pptr)->next;\n@@ -1349,19 +1349,19 @@ int cmd_commit(int argc, const char **argv, const char *prefix)\n \t\tpptr = &commit_list_insert(lookup_commit(head_sha1), pptr)->next;\n \t\tfp = fopen(git_path(\"MERGE_HEAD\"), \"r\");\n \t\tif (fp == NULL)\n-\t\t\tdie_errno(\"could not open '%s' for reading\",\n+\t\t\tdie_errno(_(\"could not open '%s' for reading\"),\n \t\t\t\t  git_path(\"MERGE_HEAD\"));\n \t\twhile (strbuf_getline(&m, fp, '\\n') != EOF) {\n \t\t\tunsigned char sha1[20];\n \t\t\tif (get_sha1_hex(m.buf, sha1) < 0)\n-\t\t\t\tdie(\"Corrupt MERGE_HEAD file (%s)\", m.buf);\n+\t\t\t\tdie(_(\"Corrupt MERGE_HEAD file (%s)\"), m.buf);\n \t\t\tpptr = &commit_list_insert(lookup_commit(sha1), pptr)->next;\n \t\t}\n \t\tfclose(fp);\n \t\tstrbuf_release(&m);\n \t\tif (!stat(git_path(\"MERGE_MODE\"), &statbuf)) {\n \t\t\tif (strbuf_read_file(&sb, git_path(\"MERGE_MODE\"), 0) < 0)\n-\t\t\t\tdie_errno(\"could not read MERGE_MODE\");\n+\t\t\t\tdie_errno(_(\"could not read MERGE_MODE\"));\n \t\t\tif (!strcmp(sb.buf, \"no-ff\"))\n \t\t\t\tallow_fast_forward = 0;\n \t\t}\n@@ -1378,7 +1378,7 @@ int cmd_commit(int argc, const char **argv, const char *prefix)\n \tif (strbuf_read_file(&sb, git_path(commit_editmsg), 0) < 0) {\n \t\tint saved_errno = errno;\n \t\trollback_index_files();\n-\t\tdie(\"could not read commit message: %s\", strerror(saved_errno));\n+\t\tdie(_(\"could not read commit message: %s\"), strerror(saved_errno));\n \t}\n \n \t/* Truncate the message just before the diff, if any. */\n@@ -1392,14 +1392,14 @@ int cmd_commit(int argc, const char **argv, const char *prefix)\n \t\tstripspace(&sb, cleanup_mode == CLEANUP_ALL);\n \tif (message_is_empty(&sb) && !allow_empty_message) {\n \t\trollback_index_files();\n-\t\tfprintf(stderr, \"Aborting commit due to empty commit message.\\n\");\n+\t\tfprintf(stderr, _(\"Aborting commit due to empty commit message.\\n\"));\n \t\texit(1);\n \t}\n \n \tif (commit_tree(sb.buf, active_cache_tree->sha1, parents, commit_sha1,\n \t\t\tauthor_ident.buf)) {\n \t\trollback_index_files();\n-\t\tdie(\"failed to write commit object\");\n+\t\tdie(_(\"failed to write commit object\"));\n \t}\n \tstrbuf_release(&author_ident);\n \n@@ -1417,11 +1417,11 @@ int cmd_commit(int argc, const char **argv, const char *prefix)\n \n \tif (!ref_lock) {\n \t\trollback_index_files();\n-\t\tdie(\"cannot lock HEAD ref\");\n+\t\tdie(_(\"cannot lock HEAD ref\"));\n \t}\n \tif (write_ref_sha1(ref_lock, commit_sha1, sb.buf) < 0) {\n \t\trollback_index_files();\n-\t\tdie(\"cannot update HEAD ref\");\n+\t\tdie(_(\"cannot update HEAD ref\"));\n \t}\n \n \tunlink(git_path(\"MERGE_HEAD\"));\n@@ -1430,9 +1430,9 @@ int cmd_commit(int argc, const char **argv, const char *prefix)\n \tunlink(git_path(\"SQUASH_MSG\"));\n \n \tif (commit_index_files())\n-\t\tdie (\"Repository has been updated, but unable to write\\n\"\n+\t\tdie (_(\"Repository has been updated, but unable to write\\n\"\n \t\t     \"new_index file. Check that disk is not full or quota is\\n\"\n-\t\t     \"not exceeded, and then \\\"git reset HEAD\\\" to recover.\");\n+\t\t     \"not exceeded, and then \\\"git reset HEAD\\\" to recover.\"));\n \n \trerere(0);\n \trun_hook(get_index_file(), \"post-commit\", NULL);\n-- \n1.7.2.3\n"},{"id":"161926","messageId":"1298418152-27789-27-git-send-email-avarab@gmail.com","threadId":"26561","inReplyTo":"7vhbbwdjnm.fsf@alter.siamese.dyndns.org","subject":"[PATCH v4 26/73] gettextize: git-commit \"middle of a merge\" message","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2011-02-22T23:41:45Z","receivedAt":"2011-02-22T23:41:45Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"Gettextize the \"You are in the middle of a merge -- cannot amend.\"\nmessage. Several tests in t7110-reset-merge.sh explicitly checked for\nthis message. Change them to skip under GETTEXT_POISON=YesPlease.\n\nSigned-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n builtin/commit.c       |    4 ++--\n t/t7110-reset-merge.sh |    6 +++---\n 2 files changed, 5 insertions(+), 5 deletions(-)\n\ndiff --git a/builtin/commit.c b/builtin/commit.c\nindex c57f603..0198e90 100644\n--- a/builtin/commit.c\n+++ b/builtin/commit.c\n@@ -928,9 +928,9 @@ static int parse_and_validate_options(int argc, const char *argv[],\n \tif (amend && initial_commit)\n \t\tdie(_(\"You have nothing to amend.\"));\n \tif (amend && in_merge)\n-\t\tdie(\"You are in the middle of a merge -- cannot amend.\");\n+\t\tdie(_(\"You are in the middle of a merge -- cannot amend.\"));\n \tif (fixup_message && squash_message)\n-\t\tdie(\"Options --squash and --fixup cannot be used together\");\n+\t\tdie(_(\"Options --squash and --fixup cannot be used together\"));\n \tif (use_message)\n \t\tf++;\n \tif (edit_message)\ndiff --git a/t/t7110-reset-merge.sh b/t/t7110-reset-merge.sh\nindex 70cdd8e..b42820a 100755\n--- a/t/t7110-reset-merge.sh\n+++ b/t/t7110-reset-merge.sh\n@@ -233,7 +233,7 @@ test_expect_success '\"reset --merge HEAD^\" is ok with pending merge' '\n #           working index HEAD target         working index HEAD\n #           ----------------------------------------------------\n # file1:     X       U     B    C     --keep   (disallowed)\n-test_expect_success '\"reset --keep HEAD^\" fails with pending merge' '\n+test_expect_success C_LOCALE_OUTPUT '\"reset --keep HEAD^\" fails with pending merge' '\n     git reset --hard third &&\n     test_must_fail git merge branch1 &&\n     test_must_fail git reset --keep HEAD^ 2>err.log &&\n@@ -259,7 +259,7 @@ test_expect_success '\"reset --merge HEAD\" is ok with pending merge' '\n #           working index HEAD target         working index HEAD\n #           ----------------------------------------------------\n # file1:     X       U     B    B     --keep   (disallowed)\n-test_expect_success '\"reset --keep HEAD\" fails with pending merge' '\n+test_expect_success C_LOCALE_OUTPUT '\"reset --keep HEAD\" fails with pending merge' '\n     git reset --hard third &&\n     test_must_fail git merge branch1 &&\n     test_must_fail git reset --keep HEAD 2>err.log &&\n@@ -280,7 +280,7 @@ test_expect_success '--merge is ok with added/deleted merge' '\n     git diff --exit-code --cached\n '\n \n-test_expect_success '--keep fails with added/deleted merge' '\n+test_expect_success C_LOCALE_OUTPUT '--keep fails with added/deleted merge' '\n     git reset --hard third &&\n     rm -f file2 &&\n     test_must_fail git merge branch3 &&\n-- \n1.7.2.3\n"},{"id":"161980","messageId":"1298418152-27789-28-git-send-email-avarab@gmail.com","threadId":"26561","inReplyTo":"7vhbbwdjnm.fsf@alter.siamese.dyndns.org","subject":"[PATCH v4 27/73] gettextize: git-commit formatting messages","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2011-02-22T23:41:46Z","receivedAt":"2011-02-22T23:41:46Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n builtin/commit.c  |   12 ++++++------\n t/t7502-commit.sh |    4 ++--\n 2 files changed, 8 insertions(+), 8 deletions(-)\n\ndiff --git a/builtin/commit.c b/builtin/commit.c\nindex 0198e90..c7c6c59 100644\n--- a/builtin/commit.c\n+++ b/builtin/commit.c\n@@ -696,12 +696,12 @@ static int prepare_to_commit(const char *index_file, const char *prefix,\n \t\tchar *ai_tmp, *ci_tmp;\n \t\tif (in_merge)\n \t\t\tfprintf(fp,\n-\t\t\t\t\"#\\n\"\n+\t\t\t\t_(\"#\\n\"\n \t\t\t\t\"# It looks like you may be committing a MERGE.\\n\"\n \t\t\t\t\"# If this is not correct, please remove the file\\n\"\n \t\t\t\t\"#\t%s\\n\"\n \t\t\t\t\"# and try again.\\n\"\n-\t\t\t\t\"#\\n\",\n+\t\t\t\t\"#\\n\"),\n \t\t\t\tgit_path(\"MERGE_HEAD\"));\n \n \t\tfprintf(fp,\n@@ -725,15 +725,15 @@ static int prepare_to_commit(const char *index_file, const char *prefix,\n \t\tci_tmp = cut_ident_timestamp_part(committer_ident.buf);\n \t\tif (strcmp(author_ident->buf, committer_ident.buf))\n \t\t\tfprintf(fp,\n-\t\t\t\t\"%s\"\n-\t\t\t\t\"# Author:    %s\\n\",\n+\t\t\t\t_(\"%s\"\n+\t\t\t\t\"# Author:    %s\\n\"),\n \t\t\t\tident_shown++ ? \"\" : \"#\\n\",\n \t\t\t\tauthor_ident->buf);\n \n \t\tif (!user_ident_sufficiently_given())\n \t\t\tfprintf(fp,\n-\t\t\t\t\"%s\"\n-\t\t\t\t\"# Committer: %s\\n\",\n+\t\t\t\t_(\"%s\"\n+\t\t\t\t\"# Committer: %s\\n\"),\n \t\t\t\tident_shown++ ? \"\" : \"#\\n\",\n \t\t\t\tcommitter_ident.buf);\n \ndiff --git a/t/t7502-commit.sh b/t/t7502-commit.sh\nindex 50da034..034b9c3 100755\n--- a/t/t7502-commit.sh\n+++ b/t/t7502-commit.sh\n@@ -234,7 +234,7 @@ echo \"#\n # Author:    $GIT_AUTHOR_NAME <$GIT_AUTHOR_EMAIL>\n #\" >> expect\n \n-test_expect_success 'author different from committer' '\n+test_expect_success C_LOCALE_OUTPUT 'author different from committer' '\n \n \techo >>negative &&\n \tgit commit -e -m \"sample\"\n@@ -248,7 +248,7 @@ rm -f expect.tmp\n echo \"# Committer:\n #\" >> expect\n \n-test_expect_success 'committer is automatic' '\n+test_expect_success C_LOCALE_OUTPUT 'committer is automatic' '\n \n \techo >>negative &&\n \t(\n-- \n1.7.2.3\n"},{"id":"161930","messageId":"1298418152-27789-29-git-send-email-avarab@gmail.com","threadId":"26561","inReplyTo":"7vhbbwdjnm.fsf@alter.siamese.dyndns.org","subject":"[PATCH v4 28/73] gettextize: git-commit print_summary messages","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2011-02-22T23:41:47Z","receivedAt":"2011-02-22T23:41:47Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"Gettextize the \"(root-commit)\" and \"detached HEAD\" fragments that\nappear when you commit either the root commit, or a commit in a\ndetached head translatable.\n\nSigned-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n builtin/commit.c  |    4 ++--\n t/t7502-commit.sh |   10 ++++++++--\n 2 files changed, 10 insertions(+), 4 deletions(-)\n\ndiff --git a/builtin/commit.c b/builtin/commit.c\nindex c7c6c59..c90a8cf 100644\n--- a/builtin/commit.c\n+++ b/builtin/commit.c\n@@ -1223,9 +1223,9 @@ static void print_summary(const char *prefix, const unsigned char *sha1)\n \t\t!prefixcmp(head, \"refs/heads/\") ?\n \t\t\thead + 11 :\n \t\t\t!strcmp(head, \"HEAD\") ?\n-\t\t\t\t\"detached HEAD\" :\n+\t\t\t\t_(\"detached HEAD\") :\n \t\t\t\thead,\n-\t\tinitial_commit ? \" (root-commit)\" : \"\");\n+\t\tinitial_commit ? _(\" (root-commit)\") : \"\");\n \n \tif (!log_tree_commit(&rev, commit)) {\n \t\trev.always_show_header = 1;\ndiff --git a/t/t7502-commit.sh b/t/t7502-commit.sh\nindex 034b9c3..dad1b2b 100755\n--- a/t/t7502-commit.sh\n+++ b/t/t7502-commit.sh\n@@ -22,7 +22,10 @@ check_summary_oneline() {\n \tSUMMARY_POSTFIX=\"$(git log -1 --pretty='format:%h')\"\n \techo \"[$SUMMARY_PREFIX $SUMMARY_POSTFIX] $2\" >exp &&\n \n-\ttest_cmp exp act\n+\tif test_have_prereq C_LOCALE_OUTPUT\n+\tthen\n+\t\ttest_cmp exp act\n+\tfi\n }\n \n test_expect_success 'output summary format' '\n@@ -32,7 +35,10 @@ test_expect_success 'output summary format' '\n \tcheck_summary_oneline \"root-commit\" \"initial\" &&\n \n \techo change >>file1 &&\n-\tgit add file1 &&\n+\tgit add file1\n+'\n+\n+test_expect_success 'output summary format: root-commit' '\n \tcheck_summary_oneline \"\" \"a change\"\n '\n \n-- \n1.7.2.3\n"},{"id":"161970","messageId":"1298418152-27789-30-git-send-email-avarab@gmail.com","threadId":"26561","inReplyTo":"7vhbbwdjnm.fsf@alter.siamese.dyndns.org","subject":"[PATCH v4 29/73] gettextize: git-commit \"enter the commit message\" message","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2011-02-22T23:41:48Z","receivedAt":"2011-02-22T23:41:48Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"Gettextize the \"# Please enter the commit message for your changes.\"\nmessage. Several tests in t7500-commit.sh and t7502-commit.sh assume\nthat this message starts with a newline. Change the tests to to skip\nunder GETTEXT_POISON=YesPlease.\n\nThese fail under GETTEXT_POISON=YesPlease because the poison editor\nmessage doesn't do the right thing with comments and line breaks, so\nthese messages will be incorrectly broken up across lines.\n\nThis test should not be skipped under a hypothetical future testing\nmode that tests Git under language locales, since those messages\nshould all start with a newline like the original.\n\nSigned-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n builtin/commit.c  |   12 ++++++------\n t/t7500-commit.sh |    8 ++++----\n t/t7502-commit.sh |   26 +++++++++++++++++---------\n 3 files changed, 27 insertions(+), 19 deletions(-)\n\ndiff --git a/builtin/commit.c b/builtin/commit.c\nindex c90a8cf..ac8da45 100644\n--- a/builtin/commit.c\n+++ b/builtin/commit.c\n@@ -705,19 +705,19 @@ static int prepare_to_commit(const char *index_file, const char *prefix,\n \t\t\t\tgit_path(\"MERGE_HEAD\"));\n \n \t\tfprintf(fp,\n-\t\t\t\"\\n\"\n-\t\t\t\"# Please enter the commit message for your changes.\");\n+\t\t\t_(\"\\n\"\n+\t\t\t\"# Please enter the commit message for your changes.\"));\n \t\tif (cleanup_mode == CLEANUP_ALL)\n \t\t\tfprintf(fp,\n-\t\t\t\t\" Lines starting\\n\"\n+\t\t\t\t_(\" Lines starting\\n\"\n \t\t\t\t\"# with '#' will be ignored, and an empty\"\n-\t\t\t\t\" message aborts the commit.\\n\");\n+\t\t\t\t\" message aborts the commit.\\n\"));\n \t\telse /* CLEANUP_SPACE, that is. */\n \t\t\tfprintf(fp,\n-\t\t\t\t\" Lines starting\\n\"\n+\t\t\t\t_(\" Lines starting\\n\"\n \t\t\t\t\"# with '#' will be kept; you may remove them\"\n \t\t\t\t\" yourself if you want to.\\n\"\n-\t\t\t\t\"# An empty message aborts the commit.\\n\");\n+\t\t\t\t\"# An empty message aborts the commit.\\n\"));\n \t\tif (only_include_assumed)\n \t\t\tfprintf(fp, \"# %s\\n\", only_include_assumed);\n \ndiff --git a/t/t7500-commit.sh b/t/t7500-commit.sh\nindex 162527c..92cd3f5 100755\n--- a/t/t7500-commit.sh\n+++ b/t/t7500-commit.sh\n@@ -59,7 +59,7 @@ test_expect_success 'adding comments to a template should not commit' '\n \t)\n '\n \n-test_expect_success 'adding real content to a template should commit' '\n+test_expect_success C_LOCALE_OUTPUT 'adding real content to a template should commit' '\n \t(\n \t\ttest_set_editor \"$TEST_DIRECTORY\"/t7500/add-content &&\n \t\tgit commit --template \"$TEMPLATE\"\n@@ -67,7 +67,7 @@ test_expect_success 'adding real content to a template should commit' '\n \tcommit_msg_is \"template linecommit message\"\n '\n \n-test_expect_success '-t option should be short for --template' '\n+test_expect_success C_LOCALE_OUTPUT '-t option should be short for --template' '\n \techo \"short template\" > \"$TEMPLATE\" &&\n \techo \"new content\" >> foo &&\n \tgit add foo &&\n@@ -78,7 +78,7 @@ test_expect_success '-t option should be short for --template' '\n \tcommit_msg_is \"short templatecommit message\"\n '\n \n-test_expect_success 'config-specified template should commit' '\n+test_expect_success C_LOCALE_OUTPUT 'config-specified template should commit' '\n \techo \"new template\" > \"$TEMPLATE\" &&\n \tgit config commit.template \"$TEMPLATE\" &&\n \techo \"more content\" >> foo &&\n@@ -277,7 +277,7 @@ test_expect_success 'commit --squash works with -c for same commit' '\n \tcommit_msg_is \"squash! edited commit\"\n '\n \n-test_expect_success 'commit --squash works with editor' '\n+test_expect_success C_LOCALE_OUTPUT 'commit --squash works with editor' '\n \tcommit_for_rebase_autosquash_setup &&\n \ttest_set_editor \"$TEST_DIRECTORY\"/t7500/add-content &&\n \tgit commit --squash HEAD~1 &&\ndiff --git a/t/t7502-commit.sh b/t/t7502-commit.sh\nindex dad1b2b..1f29b5c 100755\n--- a/t/t7502-commit.sh\n+++ b/t/t7502-commit.sh\n@@ -221,19 +221,21 @@ test_expect_success 'cleanup commit messages (strip,-F)' '\n \n '\n \n-echo \"sample\n-\n-# Please enter the commit message for your changes. Lines starting\n-# with '#' will be ignored, and an empty message aborts the commit.\" >expect\n-\n test_expect_success 'cleanup commit messages (strip,-F,-e)' '\n \n \techo >>negative &&\n \t{ echo;echo sample;echo; } >text &&\n \tgit commit -e -F text -a &&\n-\thead -n 4 .git/COMMIT_EDITMSG >actual &&\n-\ttest_cmp expect actual\n+\thead -n 4 .git/COMMIT_EDITMSG >actual\n+'\n+\n+echo \"sample\n \n+# Please enter the commit message for your changes. Lines starting\n+# with '#' will be ignored, and an empty message aborts the commit.\" >expect\n+\n+test_expect_success C_LOCALE_OUTPUT 'cleanup commit messages (strip,-F,-e): output' '\n+\ttest_cmp expect actual\n '\n \n echo \"#\n@@ -244,7 +246,10 @@ test_expect_success C_LOCALE_OUTPUT 'author different from committer' '\n \n \techo >>negative &&\n \tgit commit -e -m \"sample\"\n-\thead -n 7 .git/COMMIT_EDITMSG >actual &&\n+\thead -n 7 .git/COMMIT_EDITMSG >actual\n+'\n+\n+test_expect_success C_LOCALE_OUTPUT 'author different from committer: output' '\n \ttest_cmp expect actual\n '\n \n@@ -264,7 +269,10 @@ test_expect_success C_LOCALE_OUTPUT 'committer is automatic' '\n \t\ttest_must_fail git commit -e -m \"sample\"\n \t) &&\n \thead -n 8 .git/COMMIT_EDITMSG |\t\\\n-\tsed \"s/^# Committer: .*/# Committer:/\" >actual &&\n+\tsed \"s/^# Committer: .*/# Committer:/\" >actual\n+'\n+\n+test_expect_success C_LOCALE_OUTPUT 'committer is automatic: output' '\n \ttest_cmp expect actual\n '\n \n-- \n1.7.2.3\n"},{"id":"161931","messageId":"1298418152-27789-31-git-send-email-avarab@gmail.com","threadId":"26561","inReplyTo":"7vhbbwdjnm.fsf@alter.siamese.dyndns.org","subject":"[PATCH v4 30/73] gettextize: git-commit advice messages","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2011-02-22T23:41:49Z","receivedAt":"2011-02-22T23:41:49Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n builtin/commit.c |   12 ++++++------\n 1 files changed, 6 insertions(+), 6 deletions(-)\n\ndiff --git a/builtin/commit.c b/builtin/commit.c\nindex ac8da45..df881d5 100644\n--- a/builtin/commit.c\n+++ b/builtin/commit.c\n@@ -38,7 +38,7 @@ static const char * const builtin_status_usage[] = {\n };\n \n static const char implicit_ident_advice[] =\n-\"Your name and email address were configured automatically based\\n\"\n+N_(\"Your name and email address were configured automatically based\\n\"\n \"on your username and hostname. Please check that they are accurate.\\n\"\n \"You can suppress this message by setting them explicitly:\\n\"\n \"\\n\"\n@@ -47,12 +47,12 @@ static const char implicit_ident_advice[] =\n \"\\n\"\n \"After doing this, you may fix the identity used for this commit with:\\n\"\n \"\\n\"\n-\"    git commit --amend --reset-author\\n\";\n+\"    git commit --amend --reset-author\\n\");\n \n static const char empty_amend_advice[] =\n-\"You asked to amend the most recent commit, but doing so would make\\n\"\n+N_(\"You asked to amend the most recent commit, but doing so would make\\n\"\n \"it empty. You can repeat your command with --allow-empty, or you can\\n\"\n-\"remove the commit entirely with \\\"git reset HEAD^\\\".\\n\";\n+\"remove the commit entirely with \\\"git reset HEAD^\\\".\\n\");\n \n static unsigned char head_sha1[20];\n \n@@ -770,7 +770,7 @@ static int prepare_to_commit(const char *index_file, const char *prefix,\n \t    !(amend && is_a_merge(head_sha1))) {\n \t\trun_status(stdout, index_file, prefix, 0, s);\n \t\tif (amend)\n-\t\t\tfputs(empty_amend_advice, stderr);\n+\t\t\tfputs(_(empty_amend_advice), stderr);\n \t\treturn 0;\n \t}\n \n@@ -1197,7 +1197,7 @@ static void print_summary(const char *prefix, const unsigned char *sha1)\n \t\tstrbuf_addbuf_percentquote(&format, &committer_ident);\n \t\tif (advice_implicit_identity) {\n \t\t\tstrbuf_addch(&format, '\\n');\n-\t\t\tstrbuf_addstr(&format, implicit_ident_advice);\n+\t\t\tstrbuf_addstr(&format, _(implicit_ident_advice));\n \t\t}\n \t}\n \tstrbuf_release(&author_ident);\n-- \n1.7.2.3\n"},{"id":"161968","messageId":"1298418152-27789-32-git-send-email-avarab@gmail.com","threadId":"26561","inReplyTo":"7vhbbwdjnm.fsf@alter.siamese.dyndns.org","subject":"[PATCH v4 31/73] gettextize: git-diff basic messages","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2011-02-22T23:41:50Z","receivedAt":"2011-02-22T23:41:50Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n builtin/diff.c |   18 +++++++++---------\n 1 files changed, 9 insertions(+), 9 deletions(-)\n\ndiff --git a/builtin/diff.c b/builtin/diff.c\nindex 42822cd..0034273 100644\n--- a/builtin/diff.c\n+++ b/builtin/diff.c\n@@ -71,9 +71,9 @@ static int builtin_diff_b_f(struct rev_info *revs,\n \t\tusage(builtin_diff_usage);\n \n \tif (lstat(path, &st))\n-\t\tdie_errno(\"failed to stat '%s'\", path);\n+\t\tdie_errno(_(\"failed to stat '%s'\"), path);\n \tif (!(S_ISREG(st.st_mode) || S_ISLNK(st.st_mode)))\n-\t\tdie(\"'%s': not a regular file or symlink\", path);\n+\t\tdie(_(\"'%s': not a regular file or symlink\"), path);\n \n \tdiff_set_mnemonic_prefix(&revs->diffopt, \"o/\", \"w/\");\n \n@@ -222,7 +222,7 @@ static int builtin_diff_files(struct rev_info *revs, int argc, const char **argv\n \t\telse if (!strcmp(argv[1], \"-h\"))\n \t\t\tusage(builtin_diff_usage);\n \t\telse\n-\t\t\treturn error(\"invalid option: %s\", argv[1]);\n+\t\t\treturn error(_(\"invalid option: %s\"), argv[1]);\n \t\targv++; argc--;\n \t}\n \n@@ -299,12 +299,12 @@ int cmd_diff(int argc, const char **argv, const char *prefix)\n \tDIFF_OPT_SET(&rev.diffopt, ALLOW_TEXTCONV);\n \n \tif (nongit)\n-\t\tdie(\"Not a git repository\");\n+\t\tdie(_(\"Not a git repository\"));\n \targc = setup_revisions(argc, argv, &rev, NULL);\n \tif (!rev.diffopt.output_format) {\n \t\trev.diffopt.output_format = DIFF_FORMAT_PATCH;\n \t\tif (diff_setup_done(&rev.diffopt) < 0)\n-\t\t\tdie(\"diff_setup_done failed\");\n+\t\t\tdie(_(\"diff_setup_done failed\"));\n \t}\n \n \tDIFF_OPT_SET(&rev.diffopt, RECURSIVE);\n@@ -349,12 +349,12 @@ int cmd_diff(int argc, const char **argv, const char *prefix)\n \t\t\tobj = parse_object(obj->sha1);\n \t\tobj = deref_tag(obj, NULL, 0);\n \t\tif (!obj)\n-\t\t\tdie(\"invalid object '%s' given.\", name);\n+\t\t\tdie(_(\"invalid object '%s' given.\"), name);\n \t\tif (obj->type == OBJ_COMMIT)\n \t\t\tobj = &((struct commit *)obj)->tree->object;\n \t\tif (obj->type == OBJ_TREE) {\n \t\t\tif (ARRAY_SIZE(ent) <= ents)\n-\t\t\t\tdie(\"more than %d trees given: '%s'\",\n+\t\t\t\tdie(_(\"more than %d trees given: '%s'\"),\n \t\t\t\t    (int) ARRAY_SIZE(ent), name);\n \t\t\tobj->flags |= flags;\n \t\t\tent[ents].item = obj;\n@@ -364,7 +364,7 @@ int cmd_diff(int argc, const char **argv, const char *prefix)\n \t\t}\n \t\tif (obj->type == OBJ_BLOB) {\n \t\t\tif (2 <= blobs)\n-\t\t\t\tdie(\"more than two blobs given: '%s'\", name);\n+\t\t\t\tdie(_(\"more than two blobs given: '%s'\"), name);\n \t\t\thashcpy(blob[blobs].sha1, obj->sha1);\n \t\t\tblob[blobs].name = name;\n \t\t\tblob[blobs].mode = list->mode;\n@@ -372,7 +372,7 @@ int cmd_diff(int argc, const char **argv, const char *prefix)\n \t\t\tcontinue;\n \n \t\t}\n-\t\tdie(\"unhandled object '%s' given.\", name);\n+\t\tdie(_(\"unhandled object '%s' given.\"), name);\n \t}\n \tif (rev.prune_data) {\n \t\tconst char **pathspec = rev.prune_data;\n-- \n1.7.2.3\n"},{"id":"161932","messageId":"1298418152-27789-33-git-send-email-avarab@gmail.com","threadId":"26561","inReplyTo":"7vhbbwdjnm.fsf@alter.siamese.dyndns.org","subject":"[PATCH v4 32/73] gettextize: git-fetch basic messages","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2011-02-22T23:41:51Z","receivedAt":"2011-02-22T23:41:51Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n builtin/fetch.c |   46 +++++++++++++++++++++++-----------------------\n 1 files changed, 23 insertions(+), 23 deletions(-)\n\ndiff --git a/builtin/fetch.c b/builtin/fetch.c\nindex 357f3cd..c27c3e9 100644\n--- a/builtin/fetch.c\n+++ b/builtin/fetch.c\n@@ -184,7 +184,7 @@ static struct ref *get_ref_map(struct transport *transport,\n \t\t} else {\n \t\t\tref_map = get_remote_ref(remote_refs, \"HEAD\");\n \t\t\tif (!ref_map)\n-\t\t\t\tdie(\"Couldn't find remote ref HEAD\");\n+\t\t\t\tdie(_(\"Couldn't find remote ref HEAD\"));\n \t\t\tref_map->merge = 1;\n \t\t\ttail = &ref_map->next;\n \t\t}\n@@ -237,7 +237,7 @@ static int update_local_ref(struct ref *ref,\n \t*display = 0;\n \ttype = sha1_object_info(ref->new_sha1, NULL);\n \tif (type < 0)\n-\t\tdie(\"object %s not found\", sha1_to_hex(ref->new_sha1));\n+\t\tdie(_(\"object %s not found\"), sha1_to_hex(ref->new_sha1));\n \n \tif (!hashcmp(ref->old_sha1, ref->new_sha1)) {\n \t\tif (verbosity > 0)\n@@ -337,7 +337,7 @@ static int store_updated_refs(const char *raw_url, const char *remote_name,\n \n \tfp = fopen(filename, \"a\");\n \tif (!fp)\n-\t\treturn error(\"cannot open %s: %s\\n\", filename, strerror(errno));\n+\t\treturn error(_(\"cannot open %s: %s\\n\"), filename, strerror(errno));\n \n \tif (raw_url)\n \t\turl = transport_anonymize_url(raw_url);\n@@ -426,9 +426,9 @@ static int store_updated_refs(const char *raw_url, const char *remote_name,\n \tfree(url);\n \tfclose(fp);\n \tif (rc & STORE_REF_ERROR_DF_CONFLICT)\n-\t\terror(\"some local refs could not be updated; try running\\n\"\n+\t\terror(_(\"some local refs could not be updated; try running\\n\"\n \t\t      \" 'git remote prune %s' to remove any old, conflicting \"\n-\t\t      \"branches\", remote_name);\n+\t\t      \"branches\"), remote_name);\n \treturn rc;\n }\n \n@@ -476,7 +476,7 @@ static int quickfetch(struct ref *ref_map)\n \n \terr = start_command(&revlist);\n \tif (err) {\n-\t\terror(\"could not run rev-list\");\n+\t\terror(_(\"could not run rev-list\"));\n \t\treturn err;\n \t}\n \n@@ -490,14 +490,14 @@ static int quickfetch(struct ref *ref_map)\n \t\tif (write_in_full(revlist.in, sha1_to_hex(ref->old_sha1), 40) < 0 ||\n \t\t    write_str_in_full(revlist.in, \"\\n\") < 0) {\n \t\t\tif (errno != EPIPE && errno != EINVAL)\n-\t\t\t\terror(\"failed write to rev-list: %s\", strerror(errno));\n+\t\t\t\terror(_(\"failed write to rev-list: %s\"), strerror(errno));\n \t\t\terr = -1;\n \t\t\tbreak;\n \t\t}\n \t}\n \n \tif (close(revlist.in)) {\n-\t\terror(\"failed to close rev-list's stdin: %s\", strerror(errno));\n+\t\terror(_(\"failed to close rev-list's stdin: %s\"), strerror(errno));\n \t\terr = -1;\n \t}\n \n@@ -650,8 +650,8 @@ static void check_not_current_branch(struct ref *ref_map)\n \tfor (; ref_map; ref_map = ref_map->next)\n \t\tif (ref_map->peer_ref && !strcmp(current_branch->refname,\n \t\t\t\t\tref_map->peer_ref->name))\n-\t\t\tdie(\"Refusing to fetch into current branch %s \"\n-\t\t\t    \"of non-bare repository\", current_branch->refname);\n+\t\t\tdie(_(\"Refusing to fetch into current branch %s \"\n+\t\t\t    \"of non-bare repository\"), current_branch->refname);\n }\n \n static int truncate_fetch_head(void)\n@@ -660,7 +660,7 @@ static int truncate_fetch_head(void)\n \tFILE *fp = fopen(filename, \"w\");\n \n \tif (!fp)\n-\t\treturn error(\"cannot open %s: %s\\n\", filename, strerror(errno));\n+\t\treturn error(_(\"cannot open %s: %s\\n\"), filename, strerror(errno));\n \tfclose(fp);\n \treturn 0;\n }\n@@ -684,7 +684,7 @@ static int do_fetch(struct transport *transport,\n \t}\n \n \tif (!transport->get_refs_list || !transport->fetch)\n-\t\tdie(\"Don't know how to fetch from %s\", transport->url);\n+\t\tdie(_(\"Don't know how to fetch from %s\"), transport->url);\n \n \t/* if not appending, truncate FETCH_HEAD */\n \tif (!append && !dry_run) {\n@@ -738,10 +738,10 @@ static void set_option(const char *name, const char *value)\n {\n \tint r = transport_set_option(transport, name, value);\n \tif (r < 0)\n-\t\tdie(\"Option \\\"%s\\\" value \\\"%s\\\" is not valid for %s\",\n+\t\tdie(_(\"Option \\\"%s\\\" value \\\"%s\\\" is not valid for %s\"),\n \t\t\tname, value, transport->url);\n \tif (r > 0)\n-\t\twarning(\"Option \\\"%s\\\" is ignored for %s\\n\",\n+\t\twarning(_(\"Option \\\"%s\\\" is ignored for %s\\n\"),\n \t\t\tname, transport->url);\n }\n \n@@ -838,9 +838,9 @@ static int fetch_multiple(struct string_list *list)\n \t\targv[argc] = name;\n \t\targv[argc + 1] = NULL;\n \t\tif (verbosity >= 0)\n-\t\t\tprintf(\"Fetching %s\\n\", name);\n+\t\t\tprintf(_(\"Fetching %s\\n\"), name);\n \t\tif (run_command_v_opt(argv, RUN_GIT_CMD)) {\n-\t\t\terror(\"Could not fetch %s\", name);\n+\t\t\terror(_(\"Could not fetch %s\"), name);\n \t\t\tresult = 1;\n \t\t}\n \t}\n@@ -856,8 +856,8 @@ static int fetch_one(struct remote *remote, int argc, const char **argv)\n \tint exit_code;\n \n \tif (!remote)\n-\t\tdie(\"No remote repository specified.  Please, specify either a URL or a\\n\"\n-\t\t    \"remote name from which new revisions should be fetched.\");\n+\t\tdie(_(\"No remote repository specified.  Please, specify either a URL or a\\n\"\n+\t\t    \"remote name from which new revisions should be fetched.\"));\n \n \ttransport = transport_get(remote, NULL);\n \ttransport_set_verbosity(transport, verbosity, progress);\n@@ -876,7 +876,7 @@ static int fetch_one(struct remote *remote, int argc, const char **argv)\n \t\t\t\tchar *ref;\n \t\t\t\ti++;\n \t\t\t\tif (i >= argc)\n-\t\t\t\t\tdie(\"You need to specify a tag name.\");\n+\t\t\t\t\tdie(_(\"You need to specify a tag name.\"));\n \t\t\t\tref = xmalloc(strlen(argv[i]) * 2 + 22);\n \t\t\t\tstrcpy(ref, \"refs/tags/\");\n \t\t\t\tstrcat(ref, argv[i]);\n@@ -916,9 +916,9 @@ int cmd_fetch(int argc, const char **argv, const char *prefix)\n \n \tif (all) {\n \t\tif (argc == 1)\n-\t\t\tdie(\"fetch --all does not take a repository argument\");\n+\t\t\tdie(_(\"fetch --all does not take a repository argument\"));\n \t\telse if (argc > 1)\n-\t\t\tdie(\"fetch --all does not make sense with refspecs\");\n+\t\t\tdie(_(\"fetch --all does not make sense with refspecs\"));\n \t\t(void) for_each_remote(get_one_remote_for_fetch, &list);\n \t\tresult = fetch_multiple(&list);\n \t} else if (argc == 0) {\n@@ -929,7 +929,7 @@ int cmd_fetch(int argc, const char **argv, const char *prefix)\n \t\t/* All arguments are assumed to be remotes or groups */\n \t\tfor (i = 0; i < argc; i++)\n \t\t\tif (!add_remote_or_group(argv[i], &list))\n-\t\t\t\tdie(\"No such remote or remote group: %s\", argv[i]);\n+\t\t\t\tdie(_(\"No such remote or remote group: %s\"), argv[i]);\n \t\tresult = fetch_multiple(&list);\n \t} else {\n \t\t/* Single remote or group */\n@@ -937,7 +937,7 @@ int cmd_fetch(int argc, const char **argv, const char *prefix)\n \t\tif (list.nr > 1) {\n \t\t\t/* More than one remote */\n \t\t\tif (argc > 1)\n-\t\t\t\tdie(\"Fetching a group and specifying refspecs does not make sense\");\n+\t\t\t\tdie(_(\"Fetching a group and specifying refspecs does not make sense\"));\n \t\t\tresult = fetch_multiple(&list);\n \t\t} else {\n \t\t\t/* Zero or one remotes */\n-- \n1.7.2.3\n"},{"id":"161960","messageId":"1298418152-27789-34-git-send-email-avarab@gmail.com","threadId":"26561","inReplyTo":"7vhbbwdjnm.fsf@alter.siamese.dyndns.org","subject":"[PATCH v4 33/73] gettextize: git-fetch formatting messages","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2011-02-22T23:41:52Z","receivedAt":"2011-02-22T23:41:52Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"Translate some of the formatting messages that appear on git-fetch\nshowing how branches/tags etc. were updated.\n\nSigned-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n builtin/fetch.c             |   20 ++++++++++----------\n t/t5526-fetch-submodules.sh |   40 ++++++++++++++++++++++++++++++++--------\n 2 files changed, 42 insertions(+), 18 deletions(-)\n\ndiff --git a/builtin/fetch.c b/builtin/fetch.c\nindex c27c3e9..0a73dff 100644\n--- a/builtin/fetch.c\n+++ b/builtin/fetch.c\n@@ -242,7 +242,7 @@ static int update_local_ref(struct ref *ref,\n \tif (!hashcmp(ref->old_sha1, ref->new_sha1)) {\n \t\tif (verbosity > 0)\n \t\t\tsprintf(display, \"= %-*s %-*s -> %s\", TRANSPORT_SUMMARY_WIDTH,\n-\t\t\t\t\"[up to date]\", REFCOL_WIDTH, remote,\n+\t\t\t\t_(\"[up to date]\"), REFCOL_WIDTH, remote,\n \t\t\t\tpretty_ref);\n \t\treturn 0;\n \t}\n@@ -255,8 +255,8 @@ static int update_local_ref(struct ref *ref,\n \t\t * If this is the head, and it's not okay to update\n \t\t * the head, and the old value of the head isn't empty...\n \t\t */\n-\t\tsprintf(display, \"! %-*s %-*s -> %s  (can't fetch in current branch)\",\n-\t\t\tTRANSPORT_SUMMARY_WIDTH, \"[rejected]\", REFCOL_WIDTH, remote,\n+\t\tsprintf(display, _(\"! %-*s %-*s -> %s  (can't fetch in current branch)\"),\n+\t\t\tTRANSPORT_SUMMARY_WIDTH, _(\"[rejected]\"), REFCOL_WIDTH, remote,\n \t\t\tpretty_ref);\n \t\treturn 1;\n \t}\n@@ -266,8 +266,8 @@ static int update_local_ref(struct ref *ref,\n \t\tint r;\n \t\tr = s_update_ref(\"updating tag\", ref, 0);\n \t\tsprintf(display, \"%c %-*s %-*s -> %s%s\", r ? '!' : '-',\n-\t\t\tTRANSPORT_SUMMARY_WIDTH, \"[tag update]\", REFCOL_WIDTH, remote,\n-\t\t\tpretty_ref, r ? \"  (unable to update local ref)\" : \"\");\n+\t\t\tTRANSPORT_SUMMARY_WIDTH, _(\"[tag update]\"), REFCOL_WIDTH, remote,\n+\t\t\tpretty_ref, r ? _(\"  (unable to update local ref)\") : \"\");\n \t\treturn r;\n \t}\n \n@@ -415,7 +415,7 @@ static int store_updated_refs(const char *raw_url, const char *remote_name,\n \t\t\t\t REFCOL_WIDTH, *what ? what : \"HEAD\");\n \t\tif (*note) {\n \t\t\tif (verbosity >= 0 && !shown_url) {\n-\t\t\t\tfprintf(stderr, \"From %.*s\\n\",\n+\t\t\t\tfprintf(stderr, _(\"From %.*s\\n\"),\n \t\t\t\t\t\turl_len, url);\n \t\t\t\tshown_url = 1;\n \t\t\t}\n@@ -524,16 +524,16 @@ static int prune_refs(struct transport *transport, struct ref *ref_map)\n \tint result = 0;\n \tstruct ref *ref, *stale_refs = get_stale_heads(transport->remote, ref_map);\n \tconst char *dangling_msg = dry_run\n-\t\t? \"   (%s will become dangling)\\n\"\n-\t\t: \"   (%s has become dangling)\\n\";\n+\t\t? _(\"   (%s will become dangling)\\n\")\n+\t\t: _(\"   (%s has become dangling)\\n\");\n \n \tfor (ref = stale_refs; ref; ref = ref->next) {\n \t\tif (!dry_run)\n \t\t\tresult |= delete_ref(ref->name, NULL, 0);\n \t\tif (verbosity >= 0) {\n \t\t\tfprintf(stderr, \" x %-*s %-*s -> %s\\n\",\n-\t\t\t\tTRANSPORT_SUMMARY_WIDTH, \"[deleted]\",\n-\t\t\t\tREFCOL_WIDTH, \"(none)\", prettify_refname(ref->name));\n+\t\t\t\tTRANSPORT_SUMMARY_WIDTH, _(\"[deleted]\"),\n+\t\t\t\tREFCOL_WIDTH, _(\"(none)\"), prettify_refname(ref->name));\n \t\t\twarn_dangling_symref(stderr, dangling_msg, ref->name);\n \t\t}\n \t}\ndiff --git a/t/t5526-fetch-submodules.sh b/t/t5526-fetch-submodules.sh\nindex a5f4585..8f12379 100755\n--- a/t/t5526-fetch-submodules.sh\n+++ b/t/t5526-fetch-submodules.sh\n@@ -66,7 +66,10 @@ test_expect_success \"fetch --recurse-submodules recurses into submodules\" '\n \t(\n \t\tcd downstream &&\n \t\tgit fetch --recurse-submodules >../actual.out 2>../actual.err\n-\t) &&\n+\t)\n+'\n+\n+test_expect_success C_LOCALE_OUTPUT \"fetch --recurse-submodules recurses into submodules: output\" '\n \ttest_cmp expect.out actual.out &&\n \ttest_cmp expect.err actual.err\n '\n@@ -95,7 +98,10 @@ test_expect_success \"using fetchRecurseSubmodules=true in .gitmodules recurses i\n \t\tcd downstream &&\n \t\tgit config -f .gitmodules submodule.submodule.fetchRecurseSubmodules true &&\n \t\tgit fetch >../actual.out 2>../actual.err\n-\t) &&\n+\t)\n+'\n+\n+test_expect_success C_LOCALE_OUTPUT \"using fetchRecurseSubmodules=true in .gitmodules recurses into submodules\" '\n \ttest_cmp expect.out actual.out &&\n \ttest_cmp expect.err actual.err\n '\n@@ -126,7 +132,10 @@ test_expect_success \"--recurse-submodules overrides fetchRecurseSubmodules setti\n \t\tgit fetch --recurse-submodules >../actual.out 2>../actual.err &&\n \t\tgit config --unset -f .gitmodules submodule.submodule.fetchRecurseSubmodules &&\n \t\tgit config --unset submodule.submodule.fetchRecurseSubmodules\n-\t) &&\n+\t)\n+'\n+\n+test_expect_success C_LOCALE_OUTPUT \"--recurse-submodules overrides fetchRecurseSubmodules setting from .git/config: output\" '\n \ttest_cmp expect.out actual.out &&\n \ttest_cmp expect.err actual.err\n '\n@@ -145,13 +154,22 @@ test_expect_success \"--dry-run propagates to submodules\" '\n \t(\n \t\tcd downstream &&\n \t\tgit fetch --recurse-submodules --dry-run >../actual.out 2>../actual.err\n-\t) &&\n+\t)\n+'\n+\n+test_expect_success C_LOCALE_OUTPUT \"--dry-run propagates to submodules: output\" '\n \ttest_cmp expect.out actual.out &&\n-\ttest_cmp expect.err actual.err &&\n+\ttest_cmp expect.err actual.err\n+'\n+\n+test_expect_success \"Without --dry-run propagates to submodules\" '\n \t(\n \t\tcd downstream &&\n \t\tgit fetch --recurse-submodules >../actual.out 2>../actual.err\n-\t) &&\n+\t)\n+'\n+\n+test_expect_success C_LOCALE_OUTPUT \"Without --dry-run propagates to submodules: output\" '\n \ttest_cmp expect.out actual.out &&\n \ttest_cmp expect.err actual.err\n '\n@@ -162,7 +180,10 @@ test_expect_success \"recurseSubmodules=true propagates into submodules\" '\n \t\tcd downstream &&\n \t\tgit config fetch.recurseSubmodules true\n \t\tgit fetch >../actual.out 2>../actual.err\n-\t) &&\n+\t)\n+'\n+\n+test_expect_success C_LOCALE_OUTPUT \"recurseSubmodules=true propagates into submodules: output\" '\n \ttest_cmp expect.out actual.out &&\n \ttest_cmp expect.err actual.err\n '\n@@ -176,7 +197,10 @@ test_expect_success \"--recurse-submodules overrides config in submodule\" '\n \t\t\tgit config fetch.recurseSubmodules false\n \t\t) &&\n \t\tgit fetch --recurse-submodules >../actual.out 2>../actual.err\n-\t) &&\n+\t)\n+'\n+\n+test_expect_success C_LOCALE_OUTPUT \"--recurse-submodules overrides config in submodule: output\" '\n \ttest_cmp expect.out actual.out &&\n \ttest_cmp expect.err actual.err\n '\n-- \n1.7.2.3\n"},{"id":"161963","messageId":"1298418152-27789-35-git-send-email-avarab@gmail.com","threadId":"26561","inReplyTo":"7vhbbwdjnm.fsf@alter.siamese.dyndns.org","subject":"[PATCH v4 34/73] gettextize: git-fetch update_local_ref messages","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2011-02-22T23:41:53Z","receivedAt":"2011-02-22T23:41:53Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"Translate a \"[rejected]\" message spotted by Jeff King, and other\nthings in update_local_ref along with it.\n\nReported-by: Jeff King <peff@peff.net>\nSigned-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n builtin/fetch.c |   10 +++++-----\n 1 files changed, 5 insertions(+), 5 deletions(-)\n\ndiff --git a/builtin/fetch.c b/builtin/fetch.c\nindex 0a73dff..4f622fd 100644\n--- a/builtin/fetch.c\n+++ b/builtin/fetch.c\n@@ -279,17 +279,17 @@ static int update_local_ref(struct ref *ref,\n \t\tint r;\n \t\tif (!strncmp(ref->name, \"refs/tags/\", 10)) {\n \t\t\tmsg = \"storing tag\";\n-\t\t\twhat = \"[new tag]\";\n+\t\t\twhat = _(\"[new tag]\");\n \t\t}\n \t\telse {\n \t\t\tmsg = \"storing head\";\n-\t\t\twhat = \"[new branch]\";\n+\t\t\twhat = _(\"[new branch]\");\n \t\t}\n \n \t\tr = s_update_ref(msg, ref, 0);\n \t\tsprintf(display, \"%c %-*s %-*s -> %s%s\", r ? '!' : '*',\n \t\t\tTRANSPORT_SUMMARY_WIDTH, what, REFCOL_WIDTH, remote, pretty_ref,\n-\t\t\tr ? \"  (unable to update local ref)\" : \"\");\n+\t\t\tr ? _(\"  (unable to update local ref)\") : \"\");\n \t\treturn r;\n \t}\n \n@@ -302,7 +302,7 @@ static int update_local_ref(struct ref *ref,\n \t\tr = s_update_ref(\"fast-forward\", ref, 1);\n \t\tsprintf(display, \"%c %-*s %-*s -> %s%s\", r ? '!' : ' ',\n \t\t\tTRANSPORT_SUMMARY_WIDTH, quickref, REFCOL_WIDTH, remote,\n-\t\t\tpretty_ref, r ? \"  (unable to update local ref)\" : \"\");\n+\t\t\tpretty_ref, r ? _(\"  (unable to update local ref)\") : \"\");\n \t\treturn r;\n \t} else if (force || ref->force) {\n \t\tchar quickref[84];\n@@ -314,7 +314,7 @@ static int update_local_ref(struct ref *ref,\n \t\tsprintf(display, \"%c %-*s %-*s -> %s  (%s)\", r ? '!' : '+',\n \t\t\tTRANSPORT_SUMMARY_WIDTH, quickref, REFCOL_WIDTH, remote,\n \t\t\tpretty_ref,\n-\t\t\tr ? \"unable to update local ref\" : \"forced update\");\n+\t\t\tr ? _(\"unable to update local ref\") : _(\"forced update\"));\n \t\treturn r;\n \t} else {\n \t\tsprintf(display, \"! %-*s %-*s -> %s  (non-fast-forward)\",\n-- \n1.7.2.3\n"},{"id":"161969","messageId":"1298418152-27789-36-git-send-email-avarab@gmail.com","threadId":"26561","inReplyTo":"7vhbbwdjnm.fsf@alter.siamese.dyndns.org","subject":"[PATCH v4 35/73] gettextize: git-fetch split up \"(non-fast-forward)\" message","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2011-02-22T23:41:54Z","receivedAt":"2011-02-22T23:41:54Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"Split up the \"(non-fast-forward)\" message from printf directives and\nmake it translatable.\n\nSigned-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n builtin/fetch.c |    6 +++---\n 1 files changed, 3 insertions(+), 3 deletions(-)\n\ndiff --git a/builtin/fetch.c b/builtin/fetch.c\nindex 4f622fd..ee2c5f5 100644\n--- a/builtin/fetch.c\n+++ b/builtin/fetch.c\n@@ -317,9 +317,9 @@ static int update_local_ref(struct ref *ref,\n \t\t\tr ? _(\"unable to update local ref\") : _(\"forced update\"));\n \t\treturn r;\n \t} else {\n-\t\tsprintf(display, \"! %-*s %-*s -> %s  (non-fast-forward)\",\n-\t\t\tTRANSPORT_SUMMARY_WIDTH, \"[rejected]\", REFCOL_WIDTH, remote,\n-\t\t\tpretty_ref);\n+\t\tsprintf(display, \"! %-*s %-*s -> %s  %s\",\n+\t\t\tTRANSPORT_SUMMARY_WIDTH, _(\"[rejected]\"), REFCOL_WIDTH, remote,\n+\t\t\tpretty_ref, _(\"(non-fast-forward)\"));\n \t\treturn 1;\n \t}\n }\n-- \n1.7.2.3\n"},{"id":"161979","messageId":"1298418152-27789-37-git-send-email-avarab@gmail.com","threadId":"26561","inReplyTo":"7vhbbwdjnm.fsf@alter.siamese.dyndns.org","subject":"[PATCH v4 36/73] gettextize: git-grep basic messages","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2011-02-22T23:41:55Z","receivedAt":"2011-02-22T23:41:55Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n builtin/grep.c |   32 ++++++++++++++++----------------\n 1 files changed, 16 insertions(+), 16 deletions(-)\n\ndiff --git a/builtin/grep.c b/builtin/grep.c\nindex fdf7131..d35b76c 100644\n--- a/builtin/grep.c\n+++ b/builtin/grep.c\n@@ -245,7 +245,7 @@ static void start_threads(struct grep_opt *opt)\n \t\terr = pthread_create(&threads[i], NULL, run, o);\n \n \t\tif (err)\n-\t\t\tdie(\"grep: failed to create thread: %s\",\n+\t\t\tdie(_(\"grep: failed to create thread: %s\"),\n \t\t\t    strerror(err));\n \t}\n }\n@@ -450,7 +450,7 @@ static void *load_sha1(const unsigned char *sha1, unsigned long *size,\n \tvoid *data = lock_and_read_sha1_file(sha1, &type, size);\n \n \tif (!data)\n-\t\terror(\"'%s': unable to read %s\", name, sha1_to_hex(sha1));\n+\t\terror(_(\"'%s': unable to read %s\"), name, sha1_to_hex(sha1));\n \n \treturn data;\n }\n@@ -501,7 +501,7 @@ static void *load_file(const char *filename, size_t *sz)\n \tif (lstat(filename, &st) < 0) {\n \terr_ret:\n \t\tif (errno != ENOENT)\n-\t\t\terror(\"'%s': %s\", filename, strerror(errno));\n+\t\t\terror(_(\"'%s': %s\"), filename, strerror(errno));\n \t\treturn 0;\n \t}\n \tif (!S_ISREG(st.st_mode))\n@@ -512,7 +512,7 @@ static void *load_file(const char *filename, size_t *sz)\n \t\tgoto err_ret;\n \tdata = xmalloc(*sz + 1);\n \tif (st.st_size != read_in_full(i, data, *sz)) {\n-\t\terror(\"'%s': short read %s\", filename, strerror(errno));\n+\t\terror(_(\"'%s': short read %s\"), filename, strerror(errno));\n \t\tclose(i);\n \t\tfree(data);\n \t\treturn 0;\n@@ -574,7 +574,7 @@ static void run_pager(struct grep_opt *opt, const char *prefix)\n \targv[path_list->nr] = NULL;\n \n \tif (prefix && chdir(prefix))\n-\t\tdie(\"Failed to chdir: %s\", prefix);\n+\t\tdie(_(\"Failed to chdir: %s\"), prefix);\n \tstatus = run_command_v_opt(argv, RUN_USING_SHELL);\n \tif (status)\n \t\texit(status);\n@@ -664,7 +664,7 @@ static int grep_tree(struct grep_opt *opt, const char **paths,\n \n \t\t\tdata = lock_and_read_sha1_file(entry.sha1, &type, &size);\n \t\t\tif (!data)\n-\t\t\t\tdie(\"unable to read tree (%s)\",\n+\t\t\t\tdie(_(\"unable to read tree (%s)\"),\n \t\t\t\t    sha1_to_hex(entry.sha1));\n \t\t\tinit_tree_desc(&sub, data, size);\n \t\t\thit |= grep_tree(opt, paths, &sub, tree_name, down);\n@@ -690,13 +690,13 @@ static int grep_object(struct grep_opt *opt, const char **paths,\n \t\tdata = read_object_with_reference(obj->sha1, tree_type,\n \t\t\t\t\t\t  &size, NULL);\n \t\tif (!data)\n-\t\t\tdie(\"unable to read tree (%s)\", sha1_to_hex(obj->sha1));\n+\t\t\tdie(_(\"unable to read tree (%s)\"), sha1_to_hex(obj->sha1));\n \t\tinit_tree_desc(&tree, data, size);\n \t\thit = grep_tree(opt, paths, &tree, name, \"\");\n \t\tfree(data);\n \t\treturn hit;\n \t}\n-\tdie(\"unable to grep from object of type %s\", typename(obj->type));\n+\tdie(_(\"unable to grep from object of type %s\"), typename(obj->type));\n }\n \n static int grep_objects(struct grep_opt *opt, const char **paths,\n@@ -748,7 +748,7 @@ static int context_callback(const struct option *opt, const char *arg,\n \t}\n \tvalue = strtol(arg, (char **)&endp, 10);\n \tif (*endp) {\n-\t\treturn error(\"switch `%c' expects a numerical value\",\n+\t\treturn error(_(\"switch `%c' expects a numerical value\"),\n \t\t\t     opt->short_name);\n \t}\n \tgrep_opt->pre_context = grep_opt->post_context = value;\n@@ -764,7 +764,7 @@ static int file_callback(const struct option *opt, const char *arg, int unset)\n \n \tpatterns = fopen(arg, \"r\");\n \tif (!patterns)\n-\t\tdie_errno(\"cannot open '%s'\", arg);\n+\t\tdie_errno(_(\"cannot open '%s'\"), arg);\n \twhile (strbuf_getline(&sb, patterns, '\\n') == 0) {\n \t\tchar *s;\n \t\tsize_t len;\n@@ -1005,11 +1005,11 @@ int cmd_grep(int argc, const char **argv, const char *prefix)\n \t}\n \n \tif (!opt.pattern_list)\n-\t\tdie(\"no pattern given.\");\n+\t\tdie(_(\"no pattern given.\"));\n \tif (!opt.fixed && opt.ignore_case)\n \t\topt.regflags |= REG_ICASE;\n \tif ((opt.regflags != REG_NEWLINE) && opt.fixed)\n-\t\tdie(\"cannot mix --fixed-strings and regexp\");\n+\t\tdie(_(\"cannot mix --fixed-strings and regexp\"));\n \n #ifndef NO_PTHREADS\n \tif (online_cpus() == 1 || !grep_threads_ok(&opt))\n@@ -1034,7 +1034,7 @@ int cmd_grep(int argc, const char **argv, const char *prefix)\n \t\tif (!get_sha1(arg, sha1)) {\n \t\t\tstruct object *object = parse_object(sha1);\n \t\t\tif (!object)\n-\t\t\t\tdie(\"bad object %s\", arg);\n+\t\t\t\tdie(_(\"bad object %s\"), arg);\n \t\t\tadd_object_array(object, arg, &list);\n \t\t\tcontinue;\n \t\t}\n@@ -1086,9 +1086,9 @@ int cmd_grep(int argc, const char **argv, const char *prefix)\n \n \tif (!use_index) {\n \t\tif (cached)\n-\t\t\tdie(\"--cached cannot be used with --no-index.\");\n+\t\t\tdie(_(\"--cached cannot be used with --no-index.\"));\n \t\tif (list.nr)\n-\t\t\tdie(\"--no-index cannot be used with revs.\");\n+\t\t\tdie(_(\"--no-index cannot be used with revs.\"));\n \t\thit = grep_directory(&opt, paths);\n \t} else if (!list.nr) {\n \t\tif (!cached)\n@@ -1097,7 +1097,7 @@ int cmd_grep(int argc, const char **argv, const char *prefix)\n \t\thit = grep_cache(&opt, paths, cached);\n \t} else {\n \t\tif (cached)\n-\t\t\tdie(\"both --cached and trees are given.\");\n+\t\t\tdie(_(\"both --cached and trees are given.\"));\n \t\thit = grep_objects(&opt, paths, &list);\n \t}\n \n-- \n1.7.2.3\n"},{"id":"161978","messageId":"1298418152-27789-38-git-send-email-avarab@gmail.com","threadId":"26561","inReplyTo":"7vhbbwdjnm.fsf@alter.siamese.dyndns.org","subject":"[PATCH v4 37/73] gettextize: git-grep \"--open-files-in-pager\" message","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2011-02-22T23:41:56Z","receivedAt":"2011-02-22T23:41:56Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"Gettextize the \"--open-files-in-pager only works on the worktree\"\nmessage. A test in t7811-grep-open.sh explicitly checked for this\nmessage. Change it to skip under GETTEXT_POISON=YesPlease.\n\nSigned-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n builtin/grep.c       |    2 +-\n t/t7811-grep-open.sh |    2 +-\n 2 files changed, 2 insertions(+), 2 deletions(-)\n\ndiff --git a/builtin/grep.c b/builtin/grep.c\nindex d35b76c..dfc32fb 100644\n--- a/builtin/grep.c\n+++ b/builtin/grep.c\n@@ -1061,7 +1061,7 @@ int cmd_grep(int argc, const char **argv, const char *prefix)\n \t}\n \n \tif (show_in_pager && (cached || list.nr))\n-\t\tdie(\"--open-files-in-pager only works on the worktree\");\n+\t\tdie(_(\"--open-files-in-pager only works on the worktree\"));\n \n \tif (show_in_pager && opt.pattern_list && !opt.pattern_list->next) {\n \t\tconst char *pager = path_list.items[0].string;\ndiff --git a/t/t7811-grep-open.sh b/t/t7811-grep-open.sh\nindex 568a6f2..aedf484 100755\n--- a/t/t7811-grep-open.sh\n+++ b/t/t7811-grep-open.sh\n@@ -61,7 +61,7 @@ test_expect_success SIMPLEPAGER 'git grep -O' '\n \ttest_cmp empty out\n '\n \n-test_expect_success 'git grep -O --cached' '\n+test_expect_success C_LOCALE_OUTPUT 'git grep -O --cached' '\n \ttest_must_fail git grep --cached -O GREP_PATTERN >out 2>msg &&\n \tgrep open-files-in-pager msg\n '\n-- \n1.7.2.3\n"},{"id":"161936","messageId":"1298418152-27789-39-git-send-email-avarab@gmail.com","threadId":"26561","inReplyTo":"7vhbbwdjnm.fsf@alter.siamese.dyndns.org","subject":"[PATCH v4 38/73] gettextize: git-log basic messages","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2011-02-22T23:41:57Z","receivedAt":"2011-02-22T23:41:57Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n builtin/log.c |   62 ++++++++++++++++++++++++++++----------------------------\n 1 files changed, 31 insertions(+), 31 deletions(-)\n\ndiff --git a/builtin/log.c b/builtin/log.c\nindex d8c6c28..b36a01e 100644\n--- a/builtin/log.c\n+++ b/builtin/log.c\n@@ -101,7 +101,7 @@ static void cmd_log_init(int argc, const char **argv, const char *prefix,\n \t\t\tconst char *v = skip_prefix(arg, \"--decorate=\");\n \t\t\tdecoration_style = parse_decoration_style(arg, v);\n \t\t\tif (decoration_style < 0)\n-\t\t\t\tdie(\"invalid --decorate option: %s\", arg);\n+\t\t\t\tdie(_(\"invalid --decorate option: %s\"), arg);\n \t\t\tdecoration_given = 1;\n \t\t} else if (!strcmp(arg, \"--no-decorate\")) {\n \t\t\tdecoration_style = 0;\n@@ -110,7 +110,7 @@ static void cmd_log_init(int argc, const char **argv, const char *prefix,\n \t\t} else if (!strcmp(arg, \"-h\")) {\n \t\t\tusage(builtin_log_usage);\n \t\t} else\n-\t\t\tdie(\"unrecognized argument: %s\", arg);\n+\t\t\tdie(_(\"unrecognized argument: %s\"), arg);\n \t}\n \n \t/*\n@@ -153,7 +153,7 @@ static void show_early_header(struct rev_info *rev, const char *stage, int nr)\n \t\tif (rev->commit_format != CMIT_FMT_ONELINE)\n \t\t\tputchar(rev->diffopt.line_termination);\n \t}\n-\tprintf(\"Final output: %d %s\\n\", nr, stage);\n+\tprintf(_(\"Final output: %d %s\\n\"), nr, stage);\n }\n \n static struct itimerval early_output_timer;\n@@ -252,7 +252,7 @@ static int cmd_log_walk(struct rev_info *rev)\n \t\tsetup_early_output(rev);\n \n \tif (prepare_revision_walk(rev))\n-\t\tdie(\"revision walk setup failed\");\n+\t\tdie(_(\"revision walk setup failed\"));\n \n \tif (rev->early_output)\n \t\tfinish_early_output(rev);\n@@ -343,7 +343,7 @@ static int show_object(const unsigned char *sha1, int show_tag_object,\n \tint offset = 0;\n \n \tif (!buf)\n-\t\treturn error(\"Could not read object %s\", sha1_to_hex(sha1));\n+\t\treturn error(_(\"Could not read object %s\"), sha1_to_hex(sha1));\n \n \tif (show_tag_object)\n \t\twhile (offset < size && buf[offset] != '\\n') {\n@@ -430,7 +430,7 @@ int cmd_show(int argc, const char **argv, const char *prefix)\n \t\t\t\tbreak;\n \t\t\to = parse_object(t->tagged->sha1);\n \t\t\tif (!o)\n-\t\t\t\tret = error(\"Could not read object %s\",\n+\t\t\t\tret = error(_(\"Could not read object %s\"),\n \t\t\t\t\t    sha1_to_hex(t->tagged->sha1));\n \t\t\tobjects[i].item = o;\n \t\t\ti--;\n@@ -454,7 +454,7 @@ int cmd_show(int argc, const char **argv, const char *prefix)\n \t\t\tret = cmd_log_walk(&rev);\n \t\t\tbreak;\n \t\tdefault:\n-\t\t\tret = error(\"Unknown type: %d\", o->type);\n+\t\t\tret = error(_(\"Unknown type: %d\"), o->type);\n \t\t}\n \t}\n \tfree(objects);\n@@ -554,7 +554,7 @@ static int git_format_config(const char *var, const char *value, void *cb)\n {\n \tif (!strcmp(var, \"format.headers\")) {\n \t\tif (!value)\n-\t\t\tdie(\"format.headers without value\");\n+\t\t\tdie(_(\"format.headers without value\"));\n \t\tadd_header(value);\n \t\treturn 0;\n \t}\n@@ -626,7 +626,7 @@ static int reopen_stdout(struct commit *commit, struct rev_info *rev)\n \t\tstrbuf_addstr(&filename, output_directory);\n \t\tif (filename.len >=\n \t\t    PATH_MAX - FORMAT_PATCH_NAME_MAX - suffix_len)\n-\t\t\treturn error(\"name of output directory is too long\");\n+\t\t\treturn error(_(\"name of output directory is too long\"));\n \t\tif (filename.buf[filename.len - 1] != '/')\n \t\t\tstrbuf_addch(&filename, '/');\n \t}\n@@ -637,7 +637,7 @@ static int reopen_stdout(struct commit *commit, struct rev_info *rev)\n \t\tfprintf(realstdout, \"%s\\n\", filename.buf + outdir_offset);\n \n \tif (freopen(filename.buf, \"w\", stdout) == NULL)\n-\t\treturn error(\"Cannot open patch file %s\", filename.buf);\n+\t\treturn error(_(\"Cannot open patch file %s\"), filename.buf);\n \n \tstrbuf_release(&filename);\n \treturn 0;\n@@ -651,7 +651,7 @@ static void get_patch_ids(struct rev_info *rev, struct patch_ids *ids, const cha\n \tunsigned flags1, flags2;\n \n \tif (rev->pending.nr != 2)\n-\t\tdie(\"Need exactly one range.\");\n+\t\tdie(_(\"Need exactly one range.\"));\n \n \to1 = rev->pending.objects[0].item;\n \tflags1 = o1->flags;\n@@ -659,7 +659,7 @@ static void get_patch_ids(struct rev_info *rev, struct patch_ids *ids, const cha\n \tflags2 = o2->flags;\n \n \tif ((flags1 & UNINTERESTING) == (flags2 & UNINTERESTING))\n-\t\tdie(\"Not a range.\");\n+\t\tdie(_(\"Not a range.\"));\n \n \tinit_patch_ids(ids);\n \n@@ -670,7 +670,7 @@ static void get_patch_ids(struct rev_info *rev, struct patch_ids *ids, const cha\n \tadd_pending_object(&check_rev, o1, \"o1\");\n \tadd_pending_object(&check_rev, o2, \"o2\");\n \tif (prepare_revision_walk(&check_rev))\n-\t\tdie(\"revision walk setup failed\");\n+\t\tdie(_(\"revision walk setup failed\"));\n \n \twhile ((commit = get_revision(&check_rev)) != NULL) {\n \t\t/* ignore merges */\n@@ -696,7 +696,7 @@ static void gen_message_id(struct rev_info *info, char *base)\n \tconst char *email_end = strrchr(committer, '>');\n \tstruct strbuf buf = STRBUF_INIT;\n \tif (!email_start || !email_end || email_start > email_end - 1)\n-\t\tdie(\"Could not extract email from committer identity.\");\n+\t\tdie(_(\"Could not extract email from committer identity.\"));\n \tstrbuf_addf(&buf, \"%s.%lu.git.%.*s\", base,\n \t\t    (unsigned long) time(NULL),\n \t\t    (int)(email_end - email_start - 1), email_start + 1);\n@@ -728,7 +728,7 @@ static void make_cover_letter(struct rev_info *rev, int use_stdout,\n \tstruct commit *commit = NULL;\n \n \tif (rev->commit_format != CMIT_FMT_EMAIL)\n-\t\tdie(\"Cover letter needs email format\");\n+\t\tdie(_(\"Cover letter needs email format\"));\n \n \tcommitter = git_committer_info(0);\n \n@@ -821,7 +821,7 @@ static const char *clean_message_id(const char *msg_id)\n \t\tm++;\n \t}\n \tif (!z)\n-\t\tdie(\"insane in-reply-to: %s\", msg_id);\n+\t\tdie(_(\"insane in-reply-to: %s\"), msg_id);\n \tif (++z == m)\n \t\treturn a;\n \treturn xmemdupz(a, z - a);\n@@ -894,7 +894,7 @@ static int output_directory_callback(const struct option *opt, const char *arg,\n {\n \tconst char **dir = (const char **)opt->value;\n \tif (*dir)\n-\t\tdie(\"Two output directories?\");\n+\t\tdie(_(\"Two output directories?\"));\n \t*dir = arg;\n \treturn 0;\n }\n@@ -1082,7 +1082,7 @@ int cmd_format_patch(int argc, const char **argv, const char *prefix)\n \t\tcommitter = git_committer_info(IDENT_ERROR_ON_NO_NAME);\n \t\tendpos = strchr(committer, '>');\n \t\tif (!endpos)\n-\t\t\tdie(\"bogus committer info %s\", committer);\n+\t\t\tdie(_(\"bogus committer info %s\"), committer);\n \t\tadd_signoff = xmemdupz(committer, endpos - committer + 1);\n \t}\n \n@@ -1127,13 +1127,13 @@ int cmd_format_patch(int argc, const char **argv, const char *prefix)\n \t\tnumbered = 0;\n \n \tif (numbered && keep_subject)\n-\t\tdie (\"-n and -k are mutually exclusive.\");\n+\t\tdie (_(\"-n and -k are mutually exclusive.\"));\n \tif (keep_subject && subject_prefix)\n-\t\tdie (\"--subject-prefix and -k are mutually exclusive.\");\n+\t\tdie (_(\"--subject-prefix and -k are mutually exclusive.\"));\n \n \targc = setup_revisions(argc, argv, &rev, &s_r_opt);\n \tif (argc > 1)\n-\t\tdie (\"unrecognized argument: %s\", argv[1]);\n+\t\tdie (_(\"unrecognized argument: %s\"), argv[1]);\n \n \tif (rev.diffopt.output_format & DIFF_FORMAT_NAME)\n \t\tdie(\"--name-only does not make sense\");\n@@ -1163,9 +1163,9 @@ int cmd_format_patch(int argc, const char **argv, const char *prefix)\n \n \tif (output_directory) {\n \t\tif (use_stdout)\n-\t\t\tdie(\"standard output, or directory, which one?\");\n+\t\t\tdie(_(\"standard output, or directory, which one?\"));\n \t\tif (mkdir(output_directory, 0777) < 0 && errno != EEXIST)\n-\t\t\tdie_errno(\"Could not create directory '%s'\",\n+\t\t\tdie_errno(_(\"Could not create directory '%s'\"),\n \t\t\t\t  output_directory);\n \t}\n \n@@ -1219,7 +1219,7 @@ int cmd_format_patch(int argc, const char **argv, const char *prefix)\n \t\trealstdout = xfdopen(xdup(1), \"w\");\n \n \tif (prepare_revision_walk(&rev))\n-\t\tdie(\"revision walk setup failed\");\n+\t\tdie(_(\"revision walk setup failed\"));\n \trev.boundary = 1;\n \twhile ((commit = get_revision(&rev)) != NULL) {\n \t\tif (commit->object.flags & BOUNDARY) {\n@@ -1300,7 +1300,7 @@ int cmd_format_patch(int argc, const char **argv, const char *prefix)\n \n \t\tif (!use_stdout && reopen_stdout(numbered_files ? NULL : commit,\n \t\t\t\t\t\t &rev))\n-\t\t\tdie(\"Failed to create output files\");\n+\t\t\tdie(_(\"Failed to create output files\"));\n \t\tshown = log_tree_commit(&rev, commit);\n \t\tfree(commit->buffer);\n \t\tcommit->buffer = NULL;\n@@ -1387,9 +1387,9 @@ int cmd_cherry(int argc, const char **argv, const char *prefix)\n \t\tif (!current_branch || !current_branch->merge\n \t\t\t\t\t|| !current_branch->merge[0]\n \t\t\t\t\t|| !current_branch->merge[0]->dst) {\n-\t\t\tfprintf(stderr, \"Could not find a tracked\"\n+\t\t\tfprintf(stderr, _(\"Could not find a tracked\"\n \t\t\t\t\t\" remote branch, please\"\n-\t\t\t\t\t\" specify <upstream> manually.\\n\");\n+\t\t\t\t\t\" specify <upstream> manually.\\n\"));\n \t\t\tusage_with_options(cherry_usage, options);\n \t\t}\n \n@@ -1403,9 +1403,9 @@ int cmd_cherry(int argc, const char **argv, const char *prefix)\n \tDIFF_OPT_SET(&revs.diffopt, RECURSIVE);\n \n \tif (add_pending_commit(head, &revs, 0))\n-\t\tdie(\"Unknown commit %s\", head);\n+\t\tdie(_(\"Unknown commit %s\"), head);\n \tif (add_pending_commit(upstream, &revs, UNINTERESTING))\n-\t\tdie(\"Unknown commit %s\", upstream);\n+\t\tdie(_(\"Unknown commit %s\"), upstream);\n \n \t/* Don't say anything if head and upstream are the same. */\n \tif (revs.pending.nr == 2) {\n@@ -1417,11 +1417,11 @@ int cmd_cherry(int argc, const char **argv, const char *prefix)\n \tget_patch_ids(&revs, &ids, prefix);\n \n \tif (limit && add_pending_commit(limit, &revs, UNINTERESTING))\n-\t\tdie(\"Unknown commit %s\", limit);\n+\t\tdie(_(\"Unknown commit %s\"), limit);\n \n \t/* reverse the list of commits */\n \tif (prepare_revision_walk(&revs))\n-\t\tdie(\"revision walk setup failed\");\n+\t\tdie(_(\"revision walk setup failed\"));\n \twhile ((commit = get_revision(&revs)) != NULL) {\n \t\t/* ignore merges */\n \t\tif (commit->parents && commit->parents->next)\n-- \n1.7.2.3\n"},{"id":"161933","messageId":"1298418152-27789-40-git-send-email-avarab@gmail.com","threadId":"26561","inReplyTo":"7vhbbwdjnm.fsf@alter.siamese.dyndns.org","subject":"[PATCH v4 39/73] gettextize: git-log \"--OPT does not make sense\" messages","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2011-02-22T23:41:58Z","receivedAt":"2011-02-22T23:41:58Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"Gettextize the \"--name-only/--name-status/--check does not make sense\"\nmessages. A test in t4014-format-patch.sh explicitly checked for these\nmessages. Change them to skip under GETTEXT_POISON=YesPlease.\n\nSigned-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n builtin/log.c           |    6 +++---\n t/t4014-format-patch.sh |    2 +-\n 2 files changed, 4 insertions(+), 4 deletions(-)\n\ndiff --git a/builtin/log.c b/builtin/log.c\nindex b36a01e..853f5d0 100644\n--- a/builtin/log.c\n+++ b/builtin/log.c\n@@ -1136,11 +1136,11 @@ int cmd_format_patch(int argc, const char **argv, const char *prefix)\n \t\tdie (_(\"unrecognized argument: %s\"), argv[1]);\n \n \tif (rev.diffopt.output_format & DIFF_FORMAT_NAME)\n-\t\tdie(\"--name-only does not make sense\");\n+\t\tdie(_(\"--name-only does not make sense\"));\n \tif (rev.diffopt.output_format & DIFF_FORMAT_NAME_STATUS)\n-\t\tdie(\"--name-status does not make sense\");\n+\t\tdie(_(\"--name-status does not make sense\"));\n \tif (rev.diffopt.output_format & DIFF_FORMAT_CHECKDIFF)\n-\t\tdie(\"--check does not make sense\");\n+\t\tdie(_(\"--check does not make sense\"));\n \n \tif (!use_patch_format &&\n \t\t(!rev.diffopt.output_format ||\ndiff --git a/t/t4014-format-patch.sh b/t/t4014-format-patch.sh\nindex 027c13d..a46d888 100755\n--- a/t/t4014-format-patch.sh\n+++ b/t/t4014-format-patch.sh\n@@ -614,7 +614,7 @@ echo \"fatal: --name-only does not make sense\" > expect.name-only\n echo \"fatal: --name-status does not make sense\" > expect.name-status\n echo \"fatal: --check does not make sense\" > expect.check\n \n-test_expect_success 'options no longer allowed for format-patch' '\n+test_expect_success C_LOCALE_OUTPUT 'options no longer allowed for format-patch' '\n \ttest_must_fail git format-patch --name-only 2> output &&\n \ttest_cmp expect.name-only output &&\n \ttest_must_fail git format-patch --name-status 2> output &&\n-- \n1.7.2.3\n"},{"id":"161935","messageId":"1298418152-27789-41-git-send-email-avarab@gmail.com","threadId":"26561","inReplyTo":"7vhbbwdjnm.fsf@alter.siamese.dyndns.org","subject":"[PATCH v4 40/73] gettextize: git-merge basic messages","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2011-02-22T23:41:59Z","receivedAt":"2011-02-22T23:41:59Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n builtin/merge.c            |  124 ++++++++++++++++++++++----------------------\n t/t7607-merge-overwrite.sh |   10 +++-\n t/t7611-merge-abort.sh     |   20 ++++++--\n 3 files changed, 86 insertions(+), 68 deletions(-)\n\ndiff --git a/builtin/merge.c b/builtin/merge.c\nindex 8c58c3c..0be4dfa 100644\n--- a/builtin/merge.c\n+++ b/builtin/merge.c\n@@ -80,7 +80,7 @@ static int option_parse_message(const struct option *opt,\n \t\tstrbuf_addf(buf, \"%s%s\", buf->len ? \"\\n\\n\" : \"\", arg);\n \t\thave_message = 1;\n \t} else\n-\t\treturn error(\"switch `m' requires a value\");\n+\t\treturn error(_(\"switch `m' requires a value\"));\n \treturn 0;\n }\n \n@@ -117,13 +117,13 @@ static struct strategy *get_strategy(const char *name)\n \t\texclude_cmds(&main_cmds, &not_strategies);\n \t}\n \tif (!is_in_cmdlist(&main_cmds, name) && !is_in_cmdlist(&other_cmds, name)) {\n-\t\tfprintf(stderr, \"Could not find merge strategy '%s'.\\n\", name);\n-\t\tfprintf(stderr, \"Available strategies are:\");\n+\t\tfprintf(stderr, _(\"Could not find merge strategy '%s'.\\n\"), name);\n+\t\tfprintf(stderr, _(\"Available strategies are:\"));\n \t\tfor (i = 0; i < main_cmds.cnt; i++)\n \t\t\tfprintf(stderr, \" %s\", main_cmds.names[i]->name);\n \t\tfprintf(stderr, \".\\n\");\n \t\tif (other_cmds.cnt) {\n-\t\t\tfprintf(stderr, \"Available custom strategies are:\");\n+\t\t\tfprintf(stderr, _(\"Available custom strategies are:\"));\n \t\t\tfor (i = 0; i < other_cmds.cnt; i++)\n \t\t\t\tfprintf(stderr, \" %s\", other_cmds.names[i]->name);\n \t\t\tfprintf(stderr, \".\\n\");\n@@ -224,17 +224,17 @@ static void save_state(void)\n \tcp.git_cmd = 1;\n \n \tif (start_command(&cp))\n-\t\tdie(\"could not run stash.\");\n+\t\tdie(_(\"could not run stash.\"));\n \tlen = strbuf_read(&buffer, cp.out, 1024);\n \tclose(cp.out);\n \n \tif (finish_command(&cp) || len < 0)\n-\t\tdie(\"stash failed\");\n+\t\tdie(_(\"stash failed\"));\n \telse if (!len)\n \t\treturn;\n \tstrbuf_setlen(&buffer, buffer.len-1);\n \tif (get_sha1(buffer.buf, stash))\n-\t\tdie(\"not a valid object: %s\", buffer.buf);\n+\t\tdie(_(\"not a valid object: %s\"), buffer.buf);\n }\n \n static void read_empty(unsigned const char *sha1, int verbose)\n@@ -252,7 +252,7 @@ static void read_empty(unsigned const char *sha1, int verbose)\n \targs[i] = NULL;\n \n \tif (run_command_v_opt(args, RUN_GIT_CMD))\n-\t\tdie(\"read-tree failed\");\n+\t\tdie(_(\"read-tree failed\"));\n }\n \n static void reset_hard(unsigned const char *sha1, int verbose)\n@@ -269,7 +269,7 @@ static void reset_hard(unsigned const char *sha1, int verbose)\n \targs[i] = NULL;\n \n \tif (run_command_v_opt(args, RUN_GIT_CMD))\n-\t\tdie(\"read-tree failed\");\n+\t\tdie(_(\"read-tree failed\"));\n }\n \n static void restore_state(void)\n@@ -298,7 +298,7 @@ static void restore_state(void)\n static void finish_up_to_date(const char *msg)\n {\n \tif (verbosity >= 0)\n-\t\tprintf(\"%s%s\\n\", squash ? \" (nothing to squash)\" : \"\", msg);\n+\t\tprintf(\"%s%s\\n\", squash ? _(\" (nothing to squash)\") : \"\", msg);\n \tdrop_save();\n }\n \n@@ -311,10 +311,10 @@ static void squash_message(void)\n \tint fd;\n \tstruct pretty_print_context ctx = {0};\n \n-\tprintf(\"Squash commit -- not updating HEAD\\n\");\n+\tprintf(_(\"Squash commit -- not updating HEAD\\n\"));\n \tfd = open(git_path(\"SQUASH_MSG\"), O_WRONLY | O_CREAT, 0666);\n \tif (fd < 0)\n-\t\tdie_errno(\"Could not write to '%s'\", git_path(\"SQUASH_MSG\"));\n+\t\tdie_errno(_(\"Could not write to '%s'\"), git_path(\"SQUASH_MSG\"));\n \n \tinit_revisions(&rev, NULL);\n \trev.ignore_merges = 1;\n@@ -329,7 +329,7 @@ static void squash_message(void)\n \n \tsetup_revisions(0, NULL, &rev, NULL);\n \tif (prepare_revision_walk(&rev))\n-\t\tdie(\"revision walk setup failed\");\n+\t\tdie(_(\"revision walk setup failed\"));\n \n \tctx.abbrev = rev.abbrev;\n \tctx.date_mode = rev.date_mode;\n@@ -342,9 +342,9 @@ static void squash_message(void)\n \t\tpretty_print_commit(rev.commit_format, commit, &out, &ctx);\n \t}\n \tif (write(fd, out.buf, out.len) < 0)\n-\t\tdie_errno(\"Writing SQUASH_MSG\");\n+\t\tdie_errno(_(\"Writing SQUASH_MSG\"));\n \tif (close(fd))\n-\t\tdie_errno(\"Finishing SQUASH_MSG\");\n+\t\tdie_errno(_(\"Finishing SQUASH_MSG\"));\n \tstrbuf_release(&out);\n }\n \n@@ -364,7 +364,7 @@ static void finish(const unsigned char *new_head, const char *msg)\n \t\tsquash_message();\n \t} else {\n \t\tif (verbosity >= 0 && !merge_msg.len)\n-\t\t\tprintf(\"No merge message -- not updating HEAD\\n\");\n+\t\t\tprintf(_(\"No merge message -- not updating HEAD\\n\"));\n \t\telse {\n \t\t\tconst char *argv_gc_auto[] = { \"gc\", \"--auto\", NULL };\n \t\t\tupdate_ref(reflog_message.buf, \"HEAD\",\n@@ -386,7 +386,7 @@ static void finish(const unsigned char *new_head, const char *msg)\n \t\tif (diff_use_color_default > 0)\n \t\t\tDIFF_OPT_SET(&opts, COLOR_DIFF);\n \t\tif (diff_setup_done(&opts) < 0)\n-\t\t\tdie(\"diff_setup_done failed\");\n+\t\t\tdie(_(\"diff_setup_done failed\"));\n \t\tdiff_tree_sha1(head, new_head, \"\", &opts);\n \t\tdiffcore_std(&opts);\n \t\tdiff_flush(&opts);\n@@ -415,7 +415,7 @@ static void merge_name(const char *remote, struct strbuf *msg)\n \tmemset(branch_head, 0, sizeof(branch_head));\n \tremote_head = peel_to_type(remote, 0, NULL, OBJ_COMMIT);\n \tif (!remote_head)\n-\t\tdie(\"'%s' does not point to a commit\", remote);\n+\t\tdie(_(\"'%s' does not point to a commit\"), remote);\n \n \tif (dwim_ref(remote, strlen(remote), branch_head, &found_ref) > 0) {\n \t\tif (!prefixcmp(found_ref, \"refs/heads/\")) {\n@@ -480,7 +480,7 @@ static void merge_name(const char *remote, struct strbuf *msg)\n \n \t\tfp = fopen(git_path(\"FETCH_HEAD\"), \"r\");\n \t\tif (!fp)\n-\t\t\tdie_errno(\"could not open '%s' for reading\",\n+\t\t\tdie_errno(_(\"could not open '%s' for reading\"),\n \t\t\t\t  git_path(\"FETCH_HEAD\"));\n \t\tstrbuf_getline(&line, fp, '\\n');\n \t\tfclose(fp);\n@@ -510,7 +510,7 @@ static int git_merge_config(const char *k, const char *v, void *cb)\n \t\tbuf = xstrdup(v);\n \t\targc = split_cmdline(buf, &argv);\n \t\tif (argc < 0)\n-\t\t\tdie(\"Bad branch.%s.mergeoptions string: %s\", branch,\n+\t\t\tdie(_(\"Bad branch.%s.mergeoptions string: %s\"), branch,\n \t\t\t    split_cmdline_strerror(argc));\n \t\targv = xrealloc(argv, sizeof(*argv) * (argc + 2));\n \t\tmemmove(argv + 1, argv, sizeof(*argv) * (argc + 1));\n@@ -532,7 +532,7 @@ static int git_merge_config(const char *k, const char *v, void *cb)\n \t\tint is_bool;\n \t\tshortlog_len = git_config_bool_or_int(k, v, &is_bool);\n \t\tif (!is_bool && shortlog_len < 0)\n-\t\t\treturn error(\"%s: negative length %s\", k, v);\n+\t\t\treturn error(_(\"%s: negative length %s\"), k, v);\n \t\tif (is_bool && shortlog_len)\n \t\t\tshortlog_len = DEFAULT_MERGE_LOG_LEN;\n \t\treturn 0;\n@@ -579,7 +579,7 @@ static int read_tree_trivial(unsigned char *common, unsigned char *head,\n static void write_tree_trivial(unsigned char *sha1)\n {\n \tif (write_cache_as_tree(sha1, 0, NULL))\n-\t\tdie(\"git write-tree failed to write a tree\");\n+\t\tdie(_(\"git write-tree failed to write a tree\"));\n }\n \n int try_merge_command(const char *strategy, size_t xopts_nr,\n@@ -621,7 +621,7 @@ int try_merge_command(const char *strategy, size_t xopts_nr,\n \tfree(args);\n \tdiscard_cache();\n \tif (read_cache() < 0)\n-\t\tdie(\"failed to read the cache\");\n+\t\tdie(_(\"failed to read the cache\"));\n \tresolve_undo_clear();\n \n \treturn ret;\n@@ -638,7 +638,7 @@ static int try_merge_strategy(const char *strategy, struct commit_list *common,\n \tif (active_cache_changed &&\n \t\t\t(write_cache(index_fd, active_cache, active_nr) ||\n \t\t\t commit_locked_index(lock)))\n-\t\treturn error(\"Unable to write index.\");\n+\t\treturn error(_(\"Unable to write index.\"));\n \trollback_lock_file(lock);\n \n \tif (!strcmp(strategy, \"recursive\") || !strcmp(strategy, \"subtree\")) {\n@@ -651,7 +651,7 @@ static int try_merge_strategy(const char *strategy, struct commit_list *common,\n \t\tstruct commit_list *j;\n \n \t\tif (remoteheads->next) {\n-\t\t\terror(\"Not handling anything other than two heads merge.\");\n+\t\t\terror(_(\"Not handling anything other than two heads merge.\"));\n \t\t\treturn 2;\n \t\t}\n \n@@ -663,7 +663,7 @@ static int try_merge_strategy(const char *strategy, struct commit_list *common,\n \n \t\tfor (x = 0; x < xopts_nr; x++)\n \t\t\tif (parse_merge_opt(&o, xopts[x]))\n-\t\t\t\tdie(\"Unknown option for merge-recursive: -X%s\", xopts[x]);\n+\t\t\t\tdie(_(\"Unknown option for merge-recursive: -X%s\"), xopts[x]);\n \n \t\to.branch1 = head_arg;\n \t\to.branch2 = remoteheads->item->util;\n@@ -677,7 +677,7 @@ static int try_merge_strategy(const char *strategy, struct commit_list *common,\n \t\tif (active_cache_changed &&\n \t\t\t\t(write_cache(index_fd, active_cache, active_nr) ||\n \t\t\t\t commit_locked_index(lock)))\n-\t\t\tdie (\"unable to write %s\", get_index_file());\n+\t\t\tdie (_(\"unable to write %s\"), get_index_file());\n \t\trollback_lock_file(lock);\n \t\treturn clean ? 0 : 1;\n \t} else {\n@@ -749,7 +749,7 @@ int checkout_fast_forward(const unsigned char *head, const unsigned char *remote\n \t\treturn -1;\n \tif (write_cache(fd, active_cache, active_nr) ||\n \t\tcommit_locked_index(lock_file))\n-\t\tdie(\"unable to write new index file\");\n+\t\tdie(_(\"unable to write new index file\"));\n \treturn 0;\n }\n \n@@ -852,7 +852,7 @@ static int suggest_conflicts(int renormalizing)\n \n \tfp = fopen(git_path(\"MERGE_MSG\"), \"a\");\n \tif (!fp)\n-\t\tdie_errno(\"Could not open '%s' for writing\",\n+\t\tdie_errno(_(\"Could not open '%s' for writing\"),\n \t\t\t  git_path(\"MERGE_MSG\"));\n \tfprintf(fp, \"\\nConflicts:\\n\");\n \tfor (pos = 0; pos < active_nr; pos++) {\n@@ -868,8 +868,8 @@ static int suggest_conflicts(int renormalizing)\n \t}\n \tfclose(fp);\n \trerere(allow_rerere_auto);\n-\tprintf(\"Automatic merge failed; \"\n-\t\t\t\"fix conflicts and then commit the result.\\n\");\n+\tprintf(_(\"Automatic merge failed; \"\n+\t\t\t\"fix conflicts and then commit the result.\\n\"));\n \treturn 1;\n }\n \n@@ -883,7 +883,7 @@ static struct commit *is_old_style_invocation(int argc, const char **argv)\n \t\t\treturn NULL;\n \t\tsecond_token = lookup_commit_reference_gently(second_sha1, 0);\n \t\tif (!second_token)\n-\t\t\tdie(\"'%s' is not a commit\", argv[1]);\n+\t\t\tdie(_(\"'%s' is not a commit\"), argv[1]);\n \t\tif (hashcmp(second_token->object.sha1, head))\n \t\t\treturn NULL;\n \t}\n@@ -951,7 +951,7 @@ int cmd_merge(int argc, const char **argv, const char *prefix)\n \t\tconst char *nargv[] = {\"reset\", \"--merge\", NULL};\n \n \t\tif (!file_exists(git_path(\"MERGE_HEAD\")))\n-\t\t\tdie(\"There is no merge to abort (MERGE_HEAD missing).\");\n+\t\t\tdie(_(\"There is no merge to abort (MERGE_HEAD missing).\"));\n \n \t\t/* Invoke 'git reset --merge' */\n \t\treturn cmd_reset(nargc, nargv, prefix);\n@@ -966,10 +966,10 @@ int cmd_merge(int argc, const char **argv, const char *prefix)\n \t\t * add/rm <file>', just 'git commit'.\n \t\t */\n \t\tif (advice_resolve_conflict)\n-\t\t\tdie(\"You have not concluded your merge (MERGE_HEAD exists).\\n\"\n-\t\t\t    \"Please, commit your changes before you can merge.\");\n+\t\t\tdie(_(\"You have not concluded your merge (MERGE_HEAD exists).\\n\"\n+\t\t\t\t  \"Please, commit your changes before you can merge.\"));\n \t\telse\n-\t\t\tdie(\"You have not concluded your merge (MERGE_HEAD exists).\");\n+\t\t\tdie(_(\"You have not concluded your merge (MERGE_HEAD exists).\"));\n \t}\n \tresolve_undo_clear();\n \n@@ -978,12 +978,12 @@ int cmd_merge(int argc, const char **argv, const char *prefix)\n \n \tif (squash) {\n \t\tif (!allow_fast_forward)\n-\t\t\tdie(\"You cannot combine --squash with --no-ff.\");\n+\t\t\tdie(_(\"You cannot combine --squash with --no-ff.\"));\n \t\toption_commit = 0;\n \t}\n \n \tif (!allow_fast_forward && fast_forward_only)\n-\t\tdie(\"You cannot combine --no-ff with --ff-only.\");\n+\t\tdie(_(\"You cannot combine --no-ff with --ff-only.\"));\n \n \tif (!argc)\n \t\tusage_with_options(builtin_merge_usage,\n@@ -1011,16 +1011,16 @@ int cmd_merge(int argc, const char **argv, const char *prefix)\n \t\t * We do the same for \"git pull\".\n \t\t */\n \t\tif (argc != 1)\n-\t\t\tdie(\"Can merge only exactly one commit into \"\n-\t\t\t\t\"empty head\");\n+\t\t\tdie(_(\"Can merge only exactly one commit into \"\n+\t\t\t\t\"empty head\"));\n \t\tif (squash)\n-\t\t\tdie(\"Squash commit into empty head not supported yet\");\n+\t\t\tdie(_(\"Squash commit into empty head not supported yet\"));\n \t\tif (!allow_fast_forward)\n-\t\t\tdie(\"Non-fast-forward commit does not make sense into \"\n-\t\t\t    \"an empty head\");\n+\t\t\tdie(_(\"Non-fast-forward commit does not make sense into \"\n+\t\t\t    \"an empty head\"));\n \t\tremote_head = peel_to_type(argv[0], 0, NULL, OBJ_COMMIT);\n \t\tif (!remote_head)\n-\t\t\tdie(\"%s - not something we can merge\", argv[0]);\n+\t\t\tdie(_(\"%s - not something we can merge\"), argv[0]);\n \t\tupdate_ref(\"initial pull\", \"HEAD\", remote_head->sha1, NULL, 0,\n \t\t\t\tDIE_ON_ERR);\n \t\tread_empty(remote_head->sha1, 0);\n@@ -1066,7 +1066,7 @@ int cmd_merge(int argc, const char **argv, const char *prefix)\n \n \t\to = peel_to_type(argv[i], 0, NULL, OBJ_COMMIT);\n \t\tif (!o)\n-\t\t\tdie(\"%s - not something we can merge\", argv[i]);\n+\t\t\tdie(_(\"%s - not something we can merge\"), argv[i]);\n \t\tcommit = lookup_commit(o->sha1);\n \t\tcommit->util = (void *)argv[i];\n \t\tremotes = &commit_list_insert(commit, remotes)->next;\n@@ -1158,11 +1158,11 @@ int cmd_merge(int argc, const char **argv, const char *prefix)\n \t\tif (allow_trivial && !fast_forward_only) {\n \t\t\t/* See if it is really trivial. */\n \t\t\tgit_committer_info(IDENT_ERROR_ON_NO_NAME);\n-\t\t\tprintf(\"Trying really trivial in-index merge...\\n\");\n+\t\t\tprintf(_(\"Trying really trivial in-index merge...\\n\"));\n \t\t\tif (!read_tree_trivial(common->item->object.sha1,\n \t\t\t\t\thead, remoteheads->item->object.sha1))\n \t\t\t\treturn merge_trivial();\n-\t\t\tprintf(\"Nope.\\n\");\n+\t\t\tprintf(_(\"Nope.\\n\"));\n \t\t}\n \t} else {\n \t\t/*\n@@ -1195,7 +1195,7 @@ int cmd_merge(int argc, const char **argv, const char *prefix)\n \t}\n \n \tif (fast_forward_only)\n-\t\tdie(\"Not possible to fast-forward, aborting.\");\n+\t\tdie(_(\"Not possible to fast-forward, aborting.\"));\n \n \t/* We are going to make a new commit. */\n \tgit_committer_info(IDENT_ERROR_ON_NO_NAME);\n@@ -1221,11 +1221,11 @@ int cmd_merge(int argc, const char **argv, const char *prefix)\n \tfor (i = 0; i < use_strategies_nr; i++) {\n \t\tint ret;\n \t\tif (i) {\n-\t\t\tprintf(\"Rewinding the tree to pristine...\\n\");\n+\t\t\tprintf(_(\"Rewinding the tree to pristine...\\n\"));\n \t\t\trestore_state();\n \t\t}\n \t\tif (use_strategies_nr != 1)\n-\t\t\tprintf(\"Trying merge strategy %s...\\n\",\n+\t\t\tprintf(_(\"Trying merge strategy %s...\\n\"),\n \t\t\t\tuse_strategies[i]->name);\n \t\t/*\n \t\t * Remember which strategy left the state in the working\n@@ -1286,17 +1286,17 @@ int cmd_merge(int argc, const char **argv, const char *prefix)\n \t\trestore_state();\n \t\tif (use_strategies_nr > 1)\n \t\t\tfprintf(stderr,\n-\t\t\t\t\"No merge strategy handled the merge.\\n\");\n+\t\t\t\t_(\"No merge strategy handled the merge.\\n\"));\n \t\telse\n-\t\t\tfprintf(stderr, \"Merge with strategy %s failed.\\n\",\n+\t\t\tfprintf(stderr, _(\"Merge with strategy %s failed.\\n\"),\n \t\t\t\tuse_strategies[0]->name);\n \t\treturn 2;\n \t} else if (best_strategy == wt_strategy)\n \t\t; /* We already have its result in the working tree. */\n \telse {\n-\t\tprintf(\"Rewinding the tree to pristine...\\n\");\n+\t\tprintf(_(\"Rewinding the tree to pristine...\\n\"));\n \t\trestore_state();\n-\t\tprintf(\"Using the %s to prepare resolving by hand.\\n\",\n+\t\tprintf(_(\"Using the %s to prepare resolving by hand.\\n\"),\n \t\t\tbest_strategy);\n \t\ttry_merge_strategy(best_strategy, common, head_arg);\n \t}\n@@ -1312,35 +1312,35 @@ int cmd_merge(int argc, const char **argv, const char *prefix)\n \t\t\t\tsha1_to_hex(j->item->object.sha1));\n \t\tfd = open(git_path(\"MERGE_HEAD\"), O_WRONLY | O_CREAT, 0666);\n \t\tif (fd < 0)\n-\t\t\tdie_errno(\"Could not open '%s' for writing\",\n+\t\t\tdie_errno(_(\"Could not open '%s' for writing\"),\n \t\t\t\t  git_path(\"MERGE_HEAD\"));\n \t\tif (write_in_full(fd, buf.buf, buf.len) != buf.len)\n-\t\t\tdie_errno(\"Could not write to '%s'\", git_path(\"MERGE_HEAD\"));\n+\t\t\tdie_errno(_(\"Could not write to '%s'\"), git_path(\"MERGE_HEAD\"));\n \t\tclose(fd);\n \t\tstrbuf_addch(&merge_msg, '\\n');\n \t\tfd = open(git_path(\"MERGE_MSG\"), O_WRONLY | O_CREAT, 0666);\n \t\tif (fd < 0)\n-\t\t\tdie_errno(\"Could not open '%s' for writing\",\n+\t\t\tdie_errno(_(\"Could not open '%s' for writing\"),\n \t\t\t\t  git_path(\"MERGE_MSG\"));\n \t\tif (write_in_full(fd, merge_msg.buf, merge_msg.len) !=\n \t\t\tmerge_msg.len)\n-\t\t\tdie_errno(\"Could not write to '%s'\", git_path(\"MERGE_MSG\"));\n+\t\t\tdie_errno(_(\"Could not write to '%s'\"), git_path(\"MERGE_MSG\"));\n \t\tclose(fd);\n \t\tfd = open(git_path(\"MERGE_MODE\"), O_WRONLY | O_CREAT | O_TRUNC, 0666);\n \t\tif (fd < 0)\n-\t\t\tdie_errno(\"Could not open '%s' for writing\",\n+\t\t\tdie_errno(_(\"Could not open '%s' for writing\"),\n \t\t\t\t  git_path(\"MERGE_MODE\"));\n \t\tstrbuf_reset(&buf);\n \t\tif (!allow_fast_forward)\n \t\t\tstrbuf_addf(&buf, \"no-ff\");\n \t\tif (write_in_full(fd, buf.buf, buf.len) != buf.len)\n-\t\t\tdie_errno(\"Could not write to '%s'\", git_path(\"MERGE_MODE\"));\n+\t\t\tdie_errno(_(\"Could not write to '%s'\"), git_path(\"MERGE_MODE\"));\n \t\tclose(fd);\n \t}\n \n \tif (merge_was_ok) {\n-\t\tfprintf(stderr, \"Automatic merge went well; \"\n-\t\t\t\"stopped before committing as requested\\n\");\n+\t\tfprintf(stderr, _(\"Automatic merge went well; \"\n+\t\t\t\"stopped before committing as requested\\n\"));\n \t\treturn 0;\n \t} else\n \t\treturn suggest_conflicts(option_renormalize);\ndiff --git a/t/t7607-merge-overwrite.sh b/t/t7607-merge-overwrite.sh\nindex 5f731a1..0a9b90b 100755\n--- a/t/t7607-merge-overwrite.sh\n+++ b/t/t7607-merge-overwrite.sh\n@@ -150,8 +150,14 @@ test_expect_success 'will not overwrite untracked file on unborn branch' '\n \tgit rm -fr . &&\n \tgit checkout --orphan new &&\n \tcp important c0.c &&\n-\ttest_must_fail git merge c0 2>out &&\n-\ttest_cmp out expect &&\n+\ttest_must_fail git merge c0 2>out\n+'\n+\n+test_expect_success C_LOCALE_OUTPUT 'will not overwrite untracked file on unborn branch: output' '\n+\ttest_cmp out expect\n+'\n+\n+test_expect_success 'will not overwrite untracked file on unborn branch .git/MERGE_HEAD sanity etc.' '\n \ttest_path_is_missing .git/MERGE_HEAD &&\n \ttest_cmp important c0.c\n '\ndiff --git a/t/t7611-merge-abort.sh b/t/t7611-merge-abort.sh\nindex 61890bc..cdb3f44 100755\n--- a/t/t7611-merge-abort.sh\n+++ b/t/t7611-merge-abort.sh\n@@ -46,8 +46,14 @@ test_expect_success 'setup' '\n pre_merge_head=\"$(git rev-parse HEAD)\"\n \n test_expect_success 'fails without MERGE_HEAD (unstarted merge)' '\n-\ttest_must_fail git merge --abort 2>output &&\n-\tgrep -q MERGE_HEAD output &&\n+\ttest_must_fail git merge --abort 2>output\n+'\n+\n+test_expect_success C_LOCALE_OUTPUT 'fails without MERGE_HEAD (unstarted merge): fatal output' '\n+\tgrep -q MERGE_HEAD output\n+'\n+\n+test_expect_success 'fails without MERGE_HEAD (unstarted merge): .git/MERGE_HEAD sanity' '\n \ttest ! -f .git/MERGE_HEAD &&\n \ttest \"$pre_merge_head\" = \"$(git rev-parse HEAD)\"\n '\n@@ -57,8 +63,14 @@ test_expect_success 'fails without MERGE_HEAD (completed merge)' '\n \ttest ! -f .git/MERGE_HEAD &&\n \t# Merge successfully completed\n \tpost_merge_head=\"$(git rev-parse HEAD)\" &&\n-\ttest_must_fail git merge --abort 2>output &&\n-\tgrep -q MERGE_HEAD output &&\n+\ttest_must_fail git merge --abort 2>output\n+'\n+\n+test_expect_success C_LOCALE_OUTPUT 'fails without MERGE_HEAD (completed merge): output' '\n+\tgrep -q MERGE_HEAD output\n+'\n+\n+test_expect_success 'fails without MERGE_HEAD (completed merge): .git/MERGE_HEAD sanity' '\n \ttest ! -f .git/MERGE_HEAD &&\n \ttest \"$post_merge_head\" = \"$(git rev-parse HEAD)\"\n '\n-- \n1.7.2.3\n"},{"id":"161958","messageId":"1298418152-27789-42-git-send-email-avarab@gmail.com","threadId":"26561","inReplyTo":"7vhbbwdjnm.fsf@alter.siamese.dyndns.org","subject":"[PATCH v4 41/73] gettextize: git-merge \"Updating %s..%s\" message","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2011-02-22T23:42:00Z","receivedAt":"2011-02-22T23:42:00Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"Gettextize the \"Updating %s..%s\\n\" message. A test in\nt1200-tutorial.sh explicitly checked for this message. Split it into\ntwo tests to skip the test_cmp test under GETTEXT_POISON=YesPlease.\n\nSigned-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n builtin/merge.c     |    2 +-\n t/t1200-tutorial.sh |    5 ++++-\n 2 files changed, 5 insertions(+), 2 deletions(-)\n\ndiff --git a/builtin/merge.c b/builtin/merge.c\nindex 0be4dfa..4f6b34f 100644\n--- a/builtin/merge.c\n+++ b/builtin/merge.c\n@@ -1124,7 +1124,7 @@ int cmd_merge(int argc, const char **argv, const char *prefix)\n \t\tstrcpy(hex, find_unique_abbrev(head, DEFAULT_ABBREV));\n \n \t\tif (verbosity >= 0)\n-\t\t\tprintf(\"Updating %s..%s\\n\",\n+\t\t\tprintf(_(\"Updating %s..%s\\n\"),\n \t\t\t\thex,\n \t\t\t\tfind_unique_abbrev(remoteheads->item->object.sha1,\n \t\t\t\tDEFAULT_ABBREV));\ndiff --git a/t/t1200-tutorial.sh b/t/t1200-tutorial.sh\nindex bfa2c21..3264fef 100755\n--- a/t/t1200-tutorial.sh\n+++ b/t/t1200-tutorial.sh\n@@ -163,7 +163,10 @@ test_expect_success 'git resolve' '\n \tgit checkout mybranch &&\n \tgit merge -m \"Merge upstream changes.\" master |\n \t\tsed -e \"1s/[0-9a-f]\\{7\\}/VARIABLE/g\" \\\n-\t\t-e \"s/^Fast[- ]forward /FASTFORWARD /\" >resolve.output &&\n+\t\t-e \"s/^Fast[- ]forward /FASTFORWARD /\" >resolve.output\n+'\n+\n+test_expect_success C_LOCALE_OUTPUT 'git resolve output' '\n \ttest_cmp resolve.expect resolve.output\n '\n \n-- \n1.7.2.3\n"},{"id":"161981","messageId":"1298418152-27789-43-git-send-email-avarab@gmail.com","threadId":"26561","inReplyTo":"7vhbbwdjnm.fsf@alter.siamese.dyndns.org","subject":"[PATCH v4 42/73] gettextize: git-merge \"You have not concluded your merge\" messages","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2011-02-22T23:42:01Z","receivedAt":"2011-02-22T23:42:01Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"Gettextize the \"You have not concluded your merge messages. A test in\nt3030-merge-recursive.sh explicitly checked for this message. Change\nit to skip the test under GETTEXT_POISON=YesPlease.\n\nSigned-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n t/t3030-merge-recursive.sh |    2 +-\n 1 files changed, 1 insertions(+), 1 deletions(-)\n\ndiff --git a/t/t3030-merge-recursive.sh b/t/t3030-merge-recursive.sh\nindex 34794f8..806fdcc 100755\n--- a/t/t3030-merge-recursive.sh\n+++ b/t/t3030-merge-recursive.sh\n@@ -312,7 +312,7 @@ test_expect_success 'merge-recursive result' '\n \n '\n \n-test_expect_success 'fail if the index has unresolved entries' '\n+test_expect_success C_LOCALE_OUTPUT 'fail if the index has unresolved entries' '\n \n \trm -fr [abcd] &&\n \tgit checkout -f \"$c1\" &&\n-- \n1.7.2.3\n"},{"id":"161964","messageId":"1298418152-27789-44-git-send-email-avarab@gmail.com","threadId":"26561","inReplyTo":"7vhbbwdjnm.fsf@alter.siamese.dyndns.org","subject":"[PATCH v4 43/73] gettextize: git-merge \"Wonderful\" message","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2011-02-22T23:42:02Z","receivedAt":"2011-02-22T23:42:02Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"Gettextize the \"Wonderful\" message. A test in t7600-merge.sh\nexplicitly checked for this message. Change it to skip under\nGETTEXT_POISON=YesPlease.\n\nSigned-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n builtin/merge.c  |    2 +-\n t/t7600-merge.sh |    2 +-\n 2 files changed, 2 insertions(+), 2 deletions(-)\n\ndiff --git a/builtin/merge.c b/builtin/merge.c\nindex 4f6b34f..f998206 100644\n--- a/builtin/merge.c\n+++ b/builtin/merge.c\n@@ -803,7 +803,7 @@ static int merge_trivial(void)\n \tstruct commit_list *parent = xmalloc(sizeof(*parent));\n \n \twrite_tree_trivial(result_tree);\n-\tprintf(\"Wonderful.\\n\");\n+\tprintf(_(\"Wonderful.\\n\"));\n \tparent->item = lookup_commit(head);\n \tparent->next = xmalloc(sizeof(*parent->next));\n \tparent->next->item = remoteheads->item;\ndiff --git a/t/t7600-merge.sh b/t/t7600-merge.sh\nindex b147a1b..87d5d78 100755\n--- a/t/t7600-merge.sh\n+++ b/t/t7600-merge.sh\n@@ -495,7 +495,7 @@ test_expect_success 'merge fast-forward in a dirty tree' '\n \n test_debug 'git log --graph --decorate --oneline --all'\n \n-test_expect_success 'in-index merge' '\n+test_expect_success C_LOCALE_OUTPUT 'in-index merge' '\n \tgit reset --hard c0 &&\n \tgit merge --no-ff -s resolve c1 >out &&\n \tgrep \"Wonderful.\" out &&\n-- \n1.7.2.3\n"},{"id":"161961","messageId":"1298418152-27789-45-git-send-email-avarab@gmail.com","threadId":"26561","inReplyTo":"7vhbbwdjnm.fsf@alter.siamese.dyndns.org","subject":"[PATCH v4 44/73] gettextize: git-mv basic messages","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2011-02-22T23:42:03Z","receivedAt":"2011-02-22T23:42:03Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n builtin/mv.c |   16 ++++++++--------\n 1 files changed, 8 insertions(+), 8 deletions(-)\n\ndiff --git a/builtin/mv.c b/builtin/mv.c\nindex 93e8995..18a2218 100644\n--- a/builtin/mv.c\n+++ b/builtin/mv.c\n@@ -74,7 +74,7 @@ int cmd_mv(int argc, const char **argv, const char *prefix)\n \n \tnewfd = hold_locked_index(&lock_file, 1);\n \tif (read_cache() < 0)\n-\t\tdie(\"index file corrupt\");\n+\t\tdie(_(\"index file corrupt\"));\n \n \tsource = copy_pathspec(prefix, argv, argc, 0);\n \tmodes = xcalloc(argc, sizeof(enum update_mode));\n@@ -100,7 +100,7 @@ int cmd_mv(int argc, const char **argv, const char *prefix)\n \t\tconst char *bad = NULL;\n \n \t\tif (show_only)\n-\t\t\tprintf(\"Checking rename of '%s' to '%s'\\n\", src, dst);\n+\t\t\tprintf(_(\"Checking rename of '%s' to '%s'\\n\"), src, dst);\n \n \t\tlength = strlen(src);\n \t\tif (lstat(src, &st) < 0)\n@@ -120,7 +120,7 @@ int cmd_mv(int argc, const char **argv, const char *prefix)\n \n \t\t\tfirst = cache_name_pos(src_w_slash, len_w_slash);\n \t\t\tif (first >= 0)\n-\t\t\t\tdie (\"Huh? %.*s is in index?\",\n+\t\t\t\tdie (_(\"Huh? %.*s is in index?\"),\n \t\t\t\t\t\tlen_w_slash, src_w_slash);\n \n \t\t\tfirst = -1 - first;\n@@ -172,7 +172,7 @@ int cmd_mv(int argc, const char **argv, const char *prefix)\n \t\t\t\t * check both source and destination\n \t\t\t\t */\n \t\t\t\tif (S_ISREG(st.st_mode) || S_ISLNK(st.st_mode)) {\n-\t\t\t\t\twarning(\"%s; will overwrite!\", bad);\n+\t\t\t\t\twarning(_(\"%s; will overwrite!\"), bad);\n \t\t\t\t\tbad = NULL;\n \t\t\t\t} else\n \t\t\t\t\tbad = \"Cannot overwrite\";\n@@ -193,7 +193,7 @@ int cmd_mv(int argc, const char **argv, const char *prefix)\n \t\t\t\t\ti--;\n \t\t\t\t}\n \t\t\t} else\n-\t\t\t\tdie (\"%s, source=%s, destination=%s\",\n+\t\t\t\tdie (_(\"%s, source=%s, destination=%s\"),\n \t\t\t\t     bad, src, dst);\n \t\t}\n \t}\n@@ -203,10 +203,10 @@ int cmd_mv(int argc, const char **argv, const char *prefix)\n \t\tenum update_mode mode = modes[i];\n \t\tint pos;\n \t\tif (show_only || verbose)\n-\t\t\tprintf(\"Renaming %s to %s\\n\", src, dst);\n+\t\t\tprintf(_(\"Renaming %s to %s\\n\"), src, dst);\n \t\tif (!show_only && mode != INDEX &&\n \t\t\t\trename(src, dst) < 0 && !ignore_errors)\n-\t\t\tdie_errno (\"renaming '%s' failed\", src);\n+\t\t\tdie_errno (_(\"renaming '%s' failed\"), src);\n \n \t\tif (mode == WORKING_DIRECTORY)\n \t\t\tcontinue;\n@@ -220,7 +220,7 @@ int cmd_mv(int argc, const char **argv, const char *prefix)\n \tif (active_cache_changed) {\n \t\tif (write_cache(newfd, active_cache, active_nr) ||\n \t\t    commit_locked_index(&lock_file))\n-\t\t\tdie(\"Unable to write new index file\");\n+\t\t\tdie(_(\"Unable to write new index file\"));\n \t}\n \n \treturn 0;\n-- \n1.7.2.3\n"},{"id":"161934","messageId":"1298418152-27789-46-git-send-email-avarab@gmail.com","threadId":"26561","inReplyTo":"7vhbbwdjnm.fsf@alter.siamese.dyndns.org","subject":"[PATCH v4 45/73] gettextize: git-mv \"bad\" messages","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2011-02-22T23:42:04Z","receivedAt":"2011-02-22T23:42:04Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"Gettextize messages made by assigning to the \"bad\" char* variable.\n\nSigned-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n builtin/mv.c |   16 ++++++++--------\n 1 files changed, 8 insertions(+), 8 deletions(-)\n\ndiff --git a/builtin/mv.c b/builtin/mv.c\nindex 18a2218..40f33ca 100644\n--- a/builtin/mv.c\n+++ b/builtin/mv.c\n@@ -104,13 +104,13 @@ int cmd_mv(int argc, const char **argv, const char *prefix)\n \n \t\tlength = strlen(src);\n \t\tif (lstat(src, &st) < 0)\n-\t\t\tbad = \"bad source\";\n+\t\t\tbad = _(\"bad source\");\n \t\telse if (!strncmp(src, dst, length) &&\n \t\t\t\t(dst[length] == 0 || dst[length] == '/')) {\n-\t\t\tbad = \"can not move directory into itself\";\n+\t\t\tbad = _(\"can not move directory into itself\");\n \t\t} else if ((src_is_dir = S_ISDIR(st.st_mode))\n \t\t\t\t&& lstat(dst, &st) == 0)\n-\t\t\tbad = \"cannot move directory over file\";\n+\t\t\tbad = _(\"cannot move directory over file\");\n \t\telse if (src_is_dir) {\n \t\t\tconst char *src_w_slash = add_slash(src);\n \t\t\tint len_w_slash = length + 1;\n@@ -132,7 +132,7 @@ int cmd_mv(int argc, const char **argv, const char *prefix)\n \t\t\tfree((char *)src_w_slash);\n \n \t\t\tif (last - first < 1)\n-\t\t\t\tbad = \"source directory is empty\";\n+\t\t\t\tbad = _(\"source directory is empty\");\n \t\t\telse {\n \t\t\t\tint j, dst_len;\n \n@@ -163,9 +163,9 @@ int cmd_mv(int argc, const char **argv, const char *prefix)\n \t\t\t\targc += last - first;\n \t\t\t}\n \t\t} else if (cache_name_pos(src, length) < 0)\n-\t\t\tbad = \"not under version control\";\n+\t\t\tbad = _(\"not under version control\");\n \t\telse if (lstat(dst, &st) == 0) {\n-\t\t\tbad = \"destination exists\";\n+\t\t\tbad = _(\"destination exists\");\n \t\t\tif (force) {\n \t\t\t\t/*\n \t\t\t\t * only files can overwrite each other:\n@@ -175,10 +175,10 @@ int cmd_mv(int argc, const char **argv, const char *prefix)\n \t\t\t\t\twarning(_(\"%s; will overwrite!\"), bad);\n \t\t\t\t\tbad = NULL;\n \t\t\t\t} else\n-\t\t\t\t\tbad = \"Cannot overwrite\";\n+\t\t\t\t\tbad = _(\"Cannot overwrite\");\n \t\t\t}\n \t\t} else if (string_list_has_string(&src_for_dst, dst))\n-\t\t\tbad = \"multiple sources for the same target\";\n+\t\t\tbad = _(\"multiple sources for the same target\");\n \t\telse\n \t\t\tstring_list_insert(&src_for_dst, dst);\n \n-- \n1.7.2.3\n"},{"id":"161965","messageId":"1298418152-27789-47-git-send-email-avarab@gmail.com","threadId":"26561","inReplyTo":"7vhbbwdjnm.fsf@alter.siamese.dyndns.org","subject":"[PATCH v4 46/73] gettextize: git-rm basic messages","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2011-02-22T23:42:05Z","receivedAt":"2011-02-22T23:42:05Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"Make the basic git-mv messages translatable, but skip things like \"rm\n'%s'\\n\" and \"git rm '%s'\\n\" for now.\n\nSigned-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n builtin/rm.c |   22 +++++++++++-----------\n 1 files changed, 11 insertions(+), 11 deletions(-)\n\ndiff --git a/builtin/rm.c b/builtin/rm.c\nindex ff491d7..90c8a50 100644\n--- a/builtin/rm.c\n+++ b/builtin/rm.c\n@@ -106,19 +106,19 @@ static int check_local_mod(unsigned char *head, int index_only)\n \t\t */\n \t\tif (local_changes && staged_changes) {\n \t\t\tif (!index_only || !(ce->ce_flags & CE_INTENT_TO_ADD))\n-\t\t\t\terrs = error(\"'%s' has staged content different \"\n+\t\t\t\terrs = error(_(\"'%s' has staged content different \"\n \t\t\t\t\t     \"from both the file and the HEAD\\n\"\n-\t\t\t\t\t     \"(use -f to force removal)\", name);\n+\t\t\t\t\t     \"(use -f to force removal)\"), name);\n \t\t}\n \t\telse if (!index_only) {\n \t\t\tif (staged_changes)\n-\t\t\t\terrs = error(\"'%s' has changes staged in the index\\n\"\n+\t\t\t\terrs = error(_(\"'%s' has changes staged in the index\\n\"\n \t\t\t\t\t     \"(use --cached to keep the file, \"\n-\t\t\t\t\t     \"or -f to force removal)\", name);\n+\t\t\t\t\t     \"or -f to force removal)\"), name);\n \t\t\tif (local_changes)\n-\t\t\t\terrs = error(\"'%s' has local modifications\\n\"\n+\t\t\t\terrs = error(_(\"'%s' has local modifications\\n\"\n \t\t\t\t\t     \"(use --cached to keep the file, \"\n-\t\t\t\t\t     \"or -f to force removal)\", name);\n+\t\t\t\t\t     \"or -f to force removal)\"), name);\n \t\t}\n \t}\n \treturn errs;\n@@ -159,7 +159,7 @@ int cmd_rm(int argc, const char **argv, const char *prefix)\n \tnewfd = hold_locked_index(&lock_file, 1);\n \n \tif (read_cache() < 0)\n-\t\tdie(\"index file corrupt\");\n+\t\tdie(_(\"index file corrupt\"));\n \n \tpathspec = get_pathspec(prefix, argv);\n \trefresh_index(&the_index, REFRESH_QUIET, pathspec, NULL, NULL);\n@@ -183,7 +183,7 @@ int cmd_rm(int argc, const char **argv, const char *prefix)\n \t\tfor (i = 0; (match = pathspec[i]) != NULL ; i++) {\n \t\t\tif (!seen[i]) {\n \t\t\t\tif (!ignore_unmatch) {\n-\t\t\t\t\tdie(\"pathspec '%s' did not match any files\",\n+\t\t\t\t\tdie(_(\"pathspec '%s' did not match any files\"),\n \t\t\t\t\t    match);\n \t\t\t\t}\n \t\t\t}\n@@ -191,7 +191,7 @@ int cmd_rm(int argc, const char **argv, const char *prefix)\n \t\t\t\tseen_any = 1;\n \t\t\t}\n \t\t\tif (!recursive && seen[i] == MATCHED_RECURSIVELY)\n-\t\t\t\tdie(\"not removing '%s' recursively without -r\",\n+\t\t\t\tdie(_(\"not removing '%s' recursively without -r\"),\n \t\t\t\t    *match ? match : \".\");\n \t\t}\n \n@@ -227,7 +227,7 @@ int cmd_rm(int argc, const char **argv, const char *prefix)\n \t\t\tprintf(\"rm '%s'\\n\", path);\n \n \t\tif (remove_file_from_cache(path))\n-\t\t\tdie(\"git rm: unable to remove %s\", path);\n+\t\t\tdie(_(\"git rm: unable to remove %s\"), path);\n \t}\n \n \tif (show_only)\n@@ -257,7 +257,7 @@ int cmd_rm(int argc, const char **argv, const char *prefix)\n \tif (active_cache_changed) {\n \t\tif (write_cache(newfd, active_cache, active_nr) ||\n \t\t    commit_locked_index(&lock_file))\n-\t\t\tdie(\"Unable to write new index file\");\n+\t\t\tdie(_(\"Unable to write new index file\"));\n \t}\n \n \treturn 0;\n-- \n1.7.2.3\n"},{"id":"161940","messageId":"1298418152-27789-48-git-send-email-avarab@gmail.com","threadId":"26561","inReplyTo":"7vhbbwdjnm.fsf@alter.siamese.dyndns.org","subject":"[PATCH v4 47/73] gettextize: git-reset basic messages","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2011-02-22T23:42:06Z","receivedAt":"2011-02-22T23:42:06Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n builtin/reset.c |   26 +++++++++++++-------------\n 1 files changed, 13 insertions(+), 13 deletions(-)\n\ndiff --git a/builtin/reset.c b/builtin/reset.c\nindex 5de2bce..0823955 100644\n--- a/builtin/reset.c\n+++ b/builtin/reset.c\n@@ -92,20 +92,20 @@ static int reset_index_file(const unsigned char *sha1, int reset_type, int quiet\n \tif (reset_type == KEEP) {\n \t\tunsigned char head_sha1[20];\n \t\tif (get_sha1(\"HEAD\", head_sha1))\n-\t\t\treturn error(\"You do not have a valid HEAD.\");\n+\t\t\treturn error(_(\"You do not have a valid HEAD.\"));\n \t\tif (!fill_tree_descriptor(desc, head_sha1))\n-\t\t\treturn error(\"Failed to find tree of HEAD.\");\n+\t\t\treturn error(_(\"Failed to find tree of HEAD.\"));\n \t\tnr++;\n \t\topts.fn = twoway_merge;\n \t}\n \n \tif (!fill_tree_descriptor(desc + nr - 1, sha1))\n-\t\treturn error(\"Failed to find tree of %s.\", sha1_to_hex(sha1));\n+\t\treturn error(_(\"Failed to find tree of %s.\"), sha1_to_hex(sha1));\n \tif (unpack_trees(nr, desc, &opts))\n \t\treturn -1;\n \tif (write_cache(newfd, active_cache, active_nr) ||\n \t    commit_locked_index(lock))\n-\t\treturn error(\"Could not write new index file.\");\n+\t\treturn error(_(\"Could not write new index file.\"));\n \n \treturn 0;\n }\n@@ -115,7 +115,7 @@ static void print_new_head_line(struct commit *commit)\n \tconst char *hex, *body;\n \n \thex = find_unique_abbrev(commit->object.sha1, DEFAULT_ABBREV);\n-\tprintf(\"HEAD is now at %s\", hex);\n+\tprintf(_(\"HEAD is now at %s\"), hex);\n \tbody = strstr(commit->buffer, \"\\n\\n\");\n \tif (body) {\n \t\tconst char *eol;\n@@ -139,7 +139,7 @@ static int update_index_refresh(int fd, struct lock_file *index_lock, int flags)\n \t}\n \n \tif (read_cache() < 0)\n-\t\treturn error(\"Could not read index\");\n+\t\treturn error(_(\"Could not read index\"));\n \n \tresult = refresh_index(&the_index, (flags), NULL, NULL,\n \t\t\t       \"Unstaged changes after reset:\") ? 1 : 0;\n@@ -167,7 +167,7 @@ static void update_index_from_diff(struct diff_queue_struct *q,\n \t\t\tce = make_cache_entry(one->mode, one->sha1, one->path,\n \t\t\t\t0, 0);\n \t\t\tif (!ce)\n-\t\t\t\tdie(\"make_cache_entry failed for path '%s'\",\n+\t\t\t\tdie(_(\"make_cache_entry failed for path '%s'\"),\n \t\t\t\t    one->path);\n \t\t\tadd_cache_entry(ce, ADD_CACHE_OK_TO_ADD |\n \t\t\t\tADD_CACHE_OK_TO_REPLACE);\n@@ -222,7 +222,7 @@ static void prepend_reflog_action(const char *action, char *buf, size_t size)\n \tif (!rla)\n \t\trla = sep = \"\";\n \tif (snprintf(buf, size, \"%s%s%s\", rla, sep, action) >= size)\n-\t\twarning(\"Reflog action message too long: %.*s...\", 50, buf);\n+\t\twarning(_(\"Reflog action message too long: %.*s...\"), 50, buf);\n }\n \n static void die_if_unmerged_cache(int reset_type)\n@@ -300,16 +300,16 @@ int cmd_reset(int argc, const char **argv, const char *prefix)\n \t}\n \n \tif (get_sha1(rev, sha1))\n-\t\tdie(\"Failed to resolve '%s' as a valid ref.\", rev);\n+\t\tdie(_(\"Failed to resolve '%s' as a valid ref.\"), rev);\n \n \tcommit = lookup_commit_reference(sha1);\n \tif (!commit)\n-\t\tdie(\"Could not parse object '%s'.\", rev);\n+\t\tdie(_(\"Could not parse object '%s'.\"), rev);\n \thashcpy(sha1, commit->object.sha1);\n \n \tif (patch_mode) {\n \t\tif (reset_type != NONE)\n-\t\t\tdie(\"--patch is incompatible with --{hard,mixed,soft}\");\n+\t\t\tdie(_(\"--patch is incompatible with --{hard,mixed,soft}\"));\n \t\treturn interactive_reset(rev, argv + i, prefix);\n \t}\n \n@@ -318,7 +318,7 @@ int cmd_reset(int argc, const char **argv, const char *prefix)\n \t * affecting the working tree nor HEAD. */\n \tif (i < argc) {\n \t\tif (reset_type == MIXED)\n-\t\t\twarning(\"--mixed with paths is deprecated; use 'git reset -- <paths>' instead.\");\n+\t\t\twarning(_(\"--mixed with paths is deprecated; use 'git reset -- <paths>' instead.\"));\n \t\telse if (reset_type != NONE)\n \t\t\tdie(\"Cannot do %s reset with paths.\",\n \t\t\t\t\treset_type_names[reset_type]);\n@@ -348,7 +348,7 @@ int cmd_reset(int argc, const char **argv, const char *prefix)\n \t\tif (reset_type == KEEP)\n \t\t\terr = err || reset_index_file(sha1, MIXED, quiet);\n \t\tif (err)\n-\t\t\tdie(\"Could not reset index file to revision '%s'.\", rev);\n+\t\t\tdie(_(\"Could not reset index file to revision '%s'.\"), rev);\n \t}\n \n \t/* Any resets update HEAD to the head being switched to,\n-- \n1.7.2.3\n"},{"id":"161943","messageId":"1298418152-27789-49-git-send-email-avarab@gmail.com","threadId":"26561","inReplyTo":"7vhbbwdjnm.fsf@alter.siamese.dyndns.org","subject":"[PATCH v4 48/73] gettextize: git-reset reset_type_names messages","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2011-02-22T23:42:07Z","receivedAt":"2011-02-22T23:42:07Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"Make the messages in git-reset that use the reset_type_names static\narray to be translatable by marking the array items with N_() and\nusing _() later.\n\nSigned-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n builtin/reset.c |   14 +++++++-------\n 1 files changed, 7 insertions(+), 7 deletions(-)\n\ndiff --git a/builtin/reset.c b/builtin/reset.c\nindex 0823955..1465174 100644\n--- a/builtin/reset.c\n+++ b/builtin/reset.c\n@@ -30,7 +30,7 @@ static const char * const git_reset_usage[] = {\n \n enum reset_type { MIXED, SOFT, HARD, MERGE, KEEP, NONE };\n static const char *reset_type_names[] = {\n-\t\"mixed\", \"soft\", \"hard\", \"merge\", \"keep\", NULL\n+\tN_(\"mixed\"), N_(\"soft\"), N_(\"hard\"), N_(\"merge\"), N_(\"keep\"), NULL\n };\n \n static char *args_to_str(const char **argv)\n@@ -228,8 +228,8 @@ static void prepend_reflog_action(const char *action, char *buf, size_t size)\n static void die_if_unmerged_cache(int reset_type)\n {\n \tif (is_merge() || read_cache() < 0 || unmerged_cache())\n-\t\tdie(\"Cannot do a %s reset in the middle of a merge.\",\n-\t\t    reset_type_names[reset_type]);\n+\t\tdie(_(\"Cannot do a %s reset in the middle of a merge.\"),\n+\t\t    _(reset_type_names[reset_type]));\n \n }\n \n@@ -320,8 +320,8 @@ int cmd_reset(int argc, const char **argv, const char *prefix)\n \t\tif (reset_type == MIXED)\n \t\t\twarning(_(\"--mixed with paths is deprecated; use 'git reset -- <paths>' instead.\"));\n \t\telse if (reset_type != NONE)\n-\t\t\tdie(\"Cannot do %s reset with paths.\",\n-\t\t\t\t\treset_type_names[reset_type]);\n+\t\t\tdie(_(\"Cannot do %s reset with paths.\"),\n+\t\t\t\t\t_(reset_type_names[reset_type]));\n \t\treturn read_from_tree(prefix, argv + i, sha1,\n \t\t\t\tquiet ? REFRESH_QUIET : REFRESH_IN_PORCELAIN);\n \t}\n@@ -332,8 +332,8 @@ int cmd_reset(int argc, const char **argv, const char *prefix)\n \t\tsetup_work_tree();\n \n \tif (reset_type == MIXED && is_bare_repository())\n-\t\tdie(\"%s reset is not allowed in a bare repository\",\n-\t\t    reset_type_names[reset_type]);\n+\t\tdie(_(\"%s reset is not allowed in a bare repository\"),\n+\t\t    _(reset_type_names[reset_type]));\n \n \t/* Soft reset does not touch the index file nor the working tree\n \t * at all, but requires them in a good order.  Other resets reset\n-- \n1.7.2.3\n"},{"id":"161939","messageId":"1298418152-27789-50-git-send-email-avarab@gmail.com","threadId":"26561","inReplyTo":"7vhbbwdjnm.fsf@alter.siamese.dyndns.org","subject":"[PATCH v4 49/73] gettextize: git-reset \"Unstaged changes after reset\" message","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2011-02-22T23:42:08Z","receivedAt":"2011-02-22T23:42:08Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"Gettextize the \"\"Unstaged changes after reset:\" message. A test in\nt7102-reset.sh explicitly checked for this message. Change it to skip\nunder GETTEXT_POISON=YesPlease.\n\nSigned-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n builtin/reset.c  |    2 +-\n t/t7102-reset.sh |    2 +-\n 2 files changed, 2 insertions(+), 2 deletions(-)\n\ndiff --git a/builtin/reset.c b/builtin/reset.c\nindex 1465174..1fe5b0f 100644\n--- a/builtin/reset.c\n+++ b/builtin/reset.c\n@@ -142,7 +142,7 @@ static int update_index_refresh(int fd, struct lock_file *index_lock, int flags)\n \t\treturn error(_(\"Could not read index\"));\n \n \tresult = refresh_index(&the_index, (flags), NULL, NULL,\n-\t\t\t       \"Unstaged changes after reset:\") ? 1 : 0;\n+\t\t\t       _(\"Unstaged changes after reset:\")) ? 1 : 0;\n \tif (write_cache(fd, active_cache, active_nr) ||\n \t\t\tcommit_locked_index(index_lock))\n \t\treturn error (\"Could not refresh index\");\ndiff --git a/t/t7102-reset.sh b/t/t7102-reset.sh\nindex b8cf260..7be2ff3 100755\n--- a/t/t7102-reset.sh\n+++ b/t/t7102-reset.sh\n@@ -423,7 +423,7 @@ Unstaged changes after reset:\n M\tfile2\n EOF\n \n-test_expect_success '--mixed refreshes the index' '\n+test_expect_success C_LOCALE_OUTPUT '--mixed refreshes the index' '\n \techo 123 >> file2 &&\n \tgit reset --mixed HEAD > output &&\n \ttest_cmp expect output\n-- \n1.7.2.3\n"},{"id":"161938","messageId":"1298418152-27789-51-git-send-email-avarab@gmail.com","threadId":"26561","inReplyTo":"7vhbbwdjnm.fsf@alter.siamese.dyndns.org","subject":"[PATCH v4 50/73] gettextize: git-tag basic messages","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2011-02-22T23:42:09Z","receivedAt":"2011-02-22T23:42:09Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n builtin/tag.c |   60 ++++++++++++++++++++++++++++----------------------------\n 1 files changed, 30 insertions(+), 30 deletions(-)\n\ndiff --git a/builtin/tag.c b/builtin/tag.c\nindex 246a2bc..4bed7c2 100644\n--- a/builtin/tag.c\n+++ b/builtin/tag.c\n@@ -118,12 +118,12 @@ static int for_each_tag_name(const char **argv, each_tag_name_fn fn)\n \tfor (p = argv; *p; p++) {\n \t\tif (snprintf(ref, sizeof(ref), \"refs/tags/%s\", *p)\n \t\t\t\t\t>= sizeof(ref)) {\n-\t\t\terror(\"tag name too long: %.*s...\", 50, *p);\n+\t\t\terror(_(\"tag name too long: %.*s...\"), 50, *p);\n \t\t\thad_error = 1;\n \t\t\tcontinue;\n \t\t}\n \t\tif (!resolve_ref(ref, sha1, 1, NULL)) {\n-\t\t\terror(\"tag '%s' not found.\", *p);\n+\t\t\terror(_(\"tag '%s' not found.\"), *p);\n \t\t\thad_error = 1;\n \t\t\tcontinue;\n \t\t}\n@@ -138,7 +138,7 @@ static int delete_tag(const char *name, const char *ref,\n {\n \tif (delete_ref(ref, sha1, 0))\n \t\treturn 1;\n-\tprintf(\"Deleted tag '%s' (was %s)\\n\", name, find_unique_abbrev(sha1, DEFAULT_ABBREV));\n+\tprintf(_(\"Deleted tag '%s' (was %s)\\n\"), name, find_unique_abbrev(sha1, DEFAULT_ABBREV));\n \treturn 0;\n }\n \n@@ -150,7 +150,7 @@ static int verify_tag(const char *name, const char *ref,\n \targv_verify_tag[2] = sha1_to_hex(sha1);\n \n \tif (run_command_v_opt(argv_verify_tag, RUN_GIT_CMD))\n-\t\treturn error(\"could not verify the tag '%s'\", name);\n+\t\treturn error(_(\"could not verify the tag '%s'\"), name);\n \treturn 0;\n }\n \n@@ -165,7 +165,7 @@ static int do_sign(struct strbuf *buffer)\n \tif (!*signingkey) {\n \t\tif (strlcpy(signingkey, git_committer_info(IDENT_ERROR_ON_NO_NAME),\n \t\t\t\tsizeof(signingkey)) > sizeof(signingkey) - 1)\n-\t\t\treturn error(\"committer info too long.\");\n+\t\t\treturn error(_(\"committer info too long.\"));\n \t\tbracket = strchr(signingkey, '>');\n \t\tif (bracket)\n \t\t\tbracket[1] = '\\0';\n@@ -185,20 +185,20 @@ static int do_sign(struct strbuf *buffer)\n \targs[3] = NULL;\n \n \tif (start_command(&gpg))\n-\t\treturn error(\"could not run gpg.\");\n+\t\treturn error(_(\"could not run gpg.\"));\n \n \tif (write_in_full(gpg.in, buffer->buf, buffer->len) != buffer->len) {\n \t\tclose(gpg.in);\n \t\tclose(gpg.out);\n \t\tfinish_command(&gpg);\n-\t\treturn error(\"gpg did not accept the tag data\");\n+\t\treturn error(_(\"gpg did not accept the tag data\"));\n \t}\n \tclose(gpg.in);\n \tlen = strbuf_read(buffer, gpg.out, 1024);\n \tclose(gpg.out);\n \n \tif (finish_command(&gpg) || !len || len < 0)\n-\t\treturn error(\"gpg failed to sign the tag\");\n+\t\treturn error(_(\"gpg failed to sign the tag\"));\n \n \t/* Strip CR from the line endings, in case we are on Windows. */\n \tfor (i = j = 0; i < buffer->len; i++)\n@@ -221,7 +221,7 @@ static const char tag_template[] =\n static void set_signingkey(const char *value)\n {\n \tif (strlcpy(signingkey, value, sizeof(signingkey)) >= sizeof(signingkey))\n-\t\tdie(\"signing key value too long (%.10s...)\", value);\n+\t\tdie(_(\"signing key value too long (%.10s...)\"), value);\n }\n \n static int git_tag_config(const char *var, const char *value, void *cb)\n@@ -261,9 +261,9 @@ static void write_tag_body(int fd, const unsigned char *sha1)\n static int build_tag_object(struct strbuf *buf, int sign, unsigned char *result)\n {\n \tif (sign && do_sign(buf) < 0)\n-\t\treturn error(\"unable to sign the tag\");\n+\t\treturn error(_(\"unable to sign the tag\"));\n \tif (write_sha1_file(buf->buf, buf->len, tag_type, result) < 0)\n-\t\treturn error(\"unable to write tag file\");\n+\t\treturn error(_(\"unable to write tag file\"));\n \treturn 0;\n }\n \n@@ -278,7 +278,7 @@ static void create_tag(const unsigned char *object, const char *tag,\n \n \ttype = sha1_object_info(object, NULL);\n \tif (type <= OBJ_NONE)\n-\t    die(\"bad object type.\");\n+\t    die(_(\"bad object type.\"));\n \n \theader_len = snprintf(header_buf, sizeof(header_buf),\n \t\t\t  \"object %s\\n\"\n@@ -291,7 +291,7 @@ static void create_tag(const unsigned char *object, const char *tag,\n \t\t\t  git_committer_info(IDENT_ERROR_ON_NO_NAME));\n \n \tif (header_len > sizeof(header_buf) - 1)\n-\t\tdie(\"tag header too big.\");\n+\t\tdie(_(\"tag header too big.\"));\n \n \tif (!message) {\n \t\tint fd;\n@@ -300,7 +300,7 @@ static void create_tag(const unsigned char *object, const char *tag,\n \t\tpath = git_pathdup(\"TAG_EDITMSG\");\n \t\tfd = open(path, O_CREAT | O_TRUNC | O_WRONLY, 0600);\n \t\tif (fd < 0)\n-\t\t\tdie_errno(\"could not create file '%s'\", path);\n+\t\t\tdie_errno(_(\"could not create file '%s'\"), path);\n \n \t\tif (!is_null_sha1(prev))\n \t\t\twrite_tag_body(fd, prev);\n@@ -310,7 +310,7 @@ static void create_tag(const unsigned char *object, const char *tag,\n \n \t\tif (launch_editor(path, buf, NULL)) {\n \t\t\tfprintf(stderr,\n-\t\t\t\"Please supply the message using either -m or -F option.\\n\");\n+\t\t\t_(\"Please supply the message using either -m or -F option.\\n\"));\n \t\t\texit(1);\n \t\t}\n \t}\n@@ -318,13 +318,13 @@ static void create_tag(const unsigned char *object, const char *tag,\n \tstripspace(buf, 1);\n \n \tif (!message && !buf->len)\n-\t\tdie(\"no tag message?\");\n+\t\tdie(_(\"no tag message?\"));\n \n \tstrbuf_insert(buf, 0, header_buf, header_len);\n \n \tif (build_tag_object(buf, sign, result) < 0) {\n \t\tif (path)\n-\t\t\tfprintf(stderr, \"The tag message has been left in %s\\n\",\n+\t\t\tfprintf(stderr, _(\"The tag message has been left in %s\\n\"),\n \t\t\t\tpath);\n \t\texit(128);\n \t}\n@@ -417,9 +417,9 @@ int cmd_tag(int argc, const char **argv, const char *prefix)\n \t\treturn list_tags(argv[0], lines == -1 ? 0 : lines,\n \t\t\t\t with_commit);\n \tif (lines != -1)\n-\t\tdie(\"-n option is only allowed with -l.\");\n+\t\tdie(_(\"-n option is only allowed with -l.\"));\n \tif (with_commit)\n-\t\tdie(\"--contains option is only allowed with -l.\");\n+\t\tdie(_(\"--contains option is only allowed with -l.\"));\n \tif (delete)\n \t\treturn for_each_tag_name(argv, delete_tag);\n \tif (verify)\n@@ -427,17 +427,17 @@ int cmd_tag(int argc, const char **argv, const char *prefix)\n \n \tif (msg.given || msgfile) {\n \t\tif (msg.given && msgfile)\n-\t\t\tdie(\"only one -F or -m option is allowed.\");\n+\t\t\tdie(_(\"only one -F or -m option is allowed.\"));\n \t\tannotate = 1;\n \t\tif (msg.given)\n \t\t\tstrbuf_addbuf(&buf, &(msg.buf));\n \t\telse {\n \t\t\tif (!strcmp(msgfile, \"-\")) {\n \t\t\t\tif (strbuf_read(&buf, 0, 1024) < 0)\n-\t\t\t\t\tdie_errno(\"cannot read '%s'\", msgfile);\n+\t\t\t\t\tdie_errno(_(\"cannot read '%s'\"), msgfile);\n \t\t\t} else {\n \t\t\t\tif (strbuf_read_file(&buf, msgfile, 1024) < 0)\n-\t\t\t\t\tdie_errno(\"could not open or read '%s'\",\n+\t\t\t\t\tdie_errno(_(\"could not open or read '%s'\"),\n \t\t\t\t\t\tmsgfile);\n \t\t\t}\n \t\t}\n@@ -447,20 +447,20 @@ int cmd_tag(int argc, const char **argv, const char *prefix)\n \n \tobject_ref = argc == 2 ? argv[1] : \"HEAD\";\n \tif (argc > 2)\n-\t\tdie(\"too many params\");\n+\t\tdie(_(\"too many params\"));\n \n \tif (get_sha1(object_ref, object))\n-\t\tdie(\"Failed to resolve '%s' as a valid ref.\", object_ref);\n+\t\tdie(_(\"Failed to resolve '%s' as a valid ref.\"), object_ref);\n \n \tif (snprintf(ref, sizeof(ref), \"refs/tags/%s\", tag) > sizeof(ref) - 1)\n-\t\tdie(\"tag name too long: %.*s...\", 50, tag);\n+\t\tdie(_(\"tag name too long: %.*s...\"), 50, tag);\n \tif (check_ref_format(ref))\n-\t\tdie(\"'%s' is not a valid tag name.\", tag);\n+\t\tdie(_(\"'%s' is not a valid tag name.\"), tag);\n \n \tif (!resolve_ref(ref, prev, 1, NULL))\n \t\thashclr(prev);\n \telse if (!force)\n-\t\tdie(\"tag '%s' already exists\", tag);\n+\t\tdie(_(\"tag '%s' already exists\"), tag);\n \n \tif (annotate)\n \t\tcreate_tag(object, tag, &buf, msg.given || msgfile,\n@@ -468,11 +468,11 @@ int cmd_tag(int argc, const char **argv, const char *prefix)\n \n \tlock = lock_any_ref_for_update(ref, prev, 0);\n \tif (!lock)\n-\t\tdie(\"%s: cannot lock the ref\", ref);\n+\t\tdie(_(\"%s: cannot lock the ref\"), ref);\n \tif (write_ref_sha1(lock, object, NULL) < 0)\n-\t\tdie(\"%s: cannot update the ref\", ref);\n+\t\tdie(_(\"%s: cannot update the ref\"), ref);\n \tif (force && hashcmp(prev, object))\n-\t\tprintf(\"Updated tag '%s' (was %s)\\n\", tag, find_unique_abbrev(prev, DEFAULT_ABBREV));\n+\t\tprintf(_(\"Updated tag '%s' (was %s)\\n\"), tag, find_unique_abbrev(prev, DEFAULT_ABBREV));\n \n \tstrbuf_release(&buf);\n \treturn 0;\n-- \n1.7.2.3\n"},{"id":"161967","messageId":"1298418152-27789-52-git-send-email-avarab@gmail.com","threadId":"26561","inReplyTo":"7vhbbwdjnm.fsf@alter.siamese.dyndns.org","subject":"[PATCH v4 51/73] gettextize: git-tag tag_template message","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2011-02-22T23:42:10Z","receivedAt":"2011-02-22T23:42:10Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"Mark the tag_template message as translatable with N_() and then use\nit later with _(). We need to skip a test under GETTEXT_POISON that\nrelies on the output having a leading newline.\n\nSigned-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n builtin/tag.c  |    6 +++---\n t/t7004-tag.sh |    1 +\n 2 files changed, 4 insertions(+), 3 deletions(-)\n\ndiff --git a/builtin/tag.c b/builtin/tag.c\nindex 4bed7c2..4242e27 100644\n--- a/builtin/tag.c\n+++ b/builtin/tag.c\n@@ -213,10 +213,10 @@ static int do_sign(struct strbuf *buffer)\n }\n \n static const char tag_template[] =\n-\t\"\\n\"\n+\tN_(\"\\n\"\n \t\"#\\n\"\n \t\"# Write a tag message\\n\"\n-\t\"#\\n\";\n+\t\"#\\n\");\n \n static void set_signingkey(const char *value)\n {\n@@ -305,7 +305,7 @@ static void create_tag(const unsigned char *object, const char *tag,\n \t\tif (!is_null_sha1(prev))\n \t\t\twrite_tag_body(fd, prev);\n \t\telse\n-\t\t\twrite_or_die(fd, tag_template, strlen(tag_template));\n+\t\t\twrite_or_die(fd, _(tag_template), strlen(_(tag_template)));\n \t\tclose(fd);\n \n \t\tif (launch_editor(path, buf, NULL)) {\ndiff --git a/t/t7004-tag.sh b/t/t7004-tag.sh\nindex 3e7baaf..1dedfd0 100755\n--- a/t/t7004-tag.sh\n+++ b/t/t7004-tag.sh\n@@ -1121,6 +1121,7 @@ test_expect_success \\\n '\n \n test_expect_success \\\n+\tC_LOCALE_OUTPUT \\\n \t'message in editor has initial comment: first line' '\n \t# check the first line --- should be empty\n \techo >first.expect &&\n-- \n1.7.2.3\n"},{"id":"161971","messageId":"1298418152-27789-53-git-send-email-avarab@gmail.com","threadId":"26561","inReplyTo":"7vhbbwdjnm.fsf@alter.siamese.dyndns.org","subject":"[PATCH v4 52/73] gettextize: git-push basic messages","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2011-02-22T23:42:11Z","receivedAt":"2011-02-22T23:42:11Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n builtin/push.c |   38 +++++++++++++++++++-------------------\n 1 files changed, 19 insertions(+), 19 deletions(-)\n\ndiff --git a/builtin/push.c b/builtin/push.c\nindex e655eb7..513bc57 100644\n--- a/builtin/push.c\n+++ b/builtin/push.c\n@@ -40,7 +40,7 @@ static void set_refspecs(const char **refs, int nr)\n \t\t\tchar *tag;\n \t\t\tint len;\n \t\t\tif (nr <= ++i)\n-\t\t\t\tdie(\"tag shorthand without <tag>\");\n+\t\t\t\tdie(_(\"tag shorthand without <tag>\"));\n \t\t\tlen = strlen(refs[i]) + 11;\n \t\t\tif (deleterefs) {\n \t\t\t\ttag = xmalloc(len+1);\n@@ -59,7 +59,7 @@ static void set_refspecs(const char **refs, int nr)\n \t\t\tstrcat(delref, ref);\n \t\t\tref = delref;\n \t\t} else if (deleterefs)\n-\t\t\tdie(\"--delete only accepts plain target ref names\");\n+\t\t\tdie(_(\"--delete only accepts plain target ref names\"));\n \t\tadd_refspec(ref);\n \t}\n }\n@@ -69,13 +69,13 @@ static void setup_push_tracking(void)\n \tstruct strbuf refspec = STRBUF_INIT;\n \tstruct branch *branch = branch_get(NULL);\n \tif (!branch)\n-\t\tdie(\"You are not currently on a branch.\");\n+\t\tdie(_(\"You are not currently on a branch.\"));\n \tif (!branch->merge_nr || !branch->merge)\n-\t\tdie(\"The current branch %s is not tracking anything.\",\n+\t\tdie(_(\"The current branch %s is not tracking anything.\"),\n \t\t    branch->name);\n \tif (branch->merge_nr != 1)\n-\t\tdie(\"The current branch %s is tracking multiple branches, \"\n-\t\t    \"refusing to push.\", branch->name);\n+\t\tdie(_(\"The current branch %s is tracking multiple branches, \"\n+\t\t    \"refusing to push.\"), branch->name);\n \tstrbuf_addf(&refspec, \"%s:%s\", branch->name, branch->merge[0]->src);\n \tadd_refspec(refspec.buf);\n }\n@@ -97,8 +97,8 @@ static void setup_default_push_refspecs(void)\n \t\tbreak;\n \n \tcase PUSH_DEFAULT_NOTHING:\n-\t\tdie(\"You didn't specify any refspecs to push, and \"\n-\t\t    \"push.default is \\\"nothing\\\".\");\n+\t\tdie(_(\"You didn't specify any refspecs to push, and \"\n+\t\t    \"push.default is \\\"nothing\\\".\"));\n \t\tbreak;\n \t}\n }\n@@ -117,11 +117,11 @@ static int push_with_options(struct transport *transport, int flags)\n \t\ttransport_set_option(transport, TRANS_OPT_THIN, \"yes\");\n \n \tif (verbosity > 0)\n-\t\tfprintf(stderr, \"Pushing to %s\\n\", transport->url);\n+\t\tfprintf(stderr, _(\"Pushing to %s\\n\"), transport->url);\n \terr = transport_push(transport, refspec_nr, refspec, flags,\n \t\t\t     &nonfastforward);\n \tif (err != 0)\n-\t\terror(\"failed to push some refs to '%s'\", transport->url);\n+\t\terror(_(\"failed to push some refs to '%s'\"), transport->url);\n \n \terr |= transport_disconnect(transport);\n \n@@ -146,8 +146,8 @@ static int do_push(const char *repo, int flags)\n \n \tif (!remote) {\n \t\tif (repo)\n-\t\t\tdie(\"bad repository '%s'\", repo);\n-\t\tdie(\"No destination configured to push to.\");\n+\t\t\tdie(_(\"bad repository '%s'\"), repo);\n+\t\tdie(_(\"No destination configured to push to.\"));\n \t}\n \n \tif (remote->mirror)\n@@ -155,19 +155,19 @@ static int do_push(const char *repo, int flags)\n \n \tif ((flags & TRANSPORT_PUSH_ALL) && refspec) {\n \t\tif (!strcmp(*refspec, \"refs/tags/*\"))\n-\t\t\treturn error(\"--all and --tags are incompatible\");\n-\t\treturn error(\"--all can't be combined with refspecs\");\n+\t\t\treturn error(_(\"--all and --tags are incompatible\"));\n+\t\treturn error(_(\"--all can't be combined with refspecs\"));\n \t}\n \n \tif ((flags & TRANSPORT_PUSH_MIRROR) && refspec) {\n \t\tif (!strcmp(*refspec, \"refs/tags/*\"))\n-\t\t\treturn error(\"--mirror and --tags are incompatible\");\n-\t\treturn error(\"--mirror can't be combined with refspecs\");\n+\t\t\treturn error(_(\"--mirror and --tags are incompatible\"));\n+\t\treturn error(_(\"--mirror can't be combined with refspecs\"));\n \t}\n \n \tif ((flags & (TRANSPORT_PUSH_ALL|TRANSPORT_PUSH_MIRROR)) ==\n \t\t\t\t(TRANSPORT_PUSH_ALL|TRANSPORT_PUSH_MIRROR)) {\n-\t\treturn error(\"--all and --mirror are incompatible\");\n+\t\treturn error(_(\"--all and --mirror are incompatible\"));\n \t}\n \n \tif (!refspec && !(flags & TRANSPORT_PUSH_ALL)) {\n@@ -232,9 +232,9 @@ int cmd_push(int argc, const char **argv, const char *prefix)\n \targc = parse_options(argc, argv, prefix, options, push_usage, 0);\n \n \tif (deleterefs && (tags || (flags & (TRANSPORT_PUSH_ALL | TRANSPORT_PUSH_MIRROR))))\n-\t\tdie(\"--delete is incompatible with --all, --mirror and --tags\");\n+\t\tdie(_(\"--delete is incompatible with --all, --mirror and --tags\"));\n \tif (deleterefs && argc < 2)\n-\t\tdie(\"--delete doesn't make sense without any refs\");\n+\t\tdie(_(\"--delete doesn't make sense without any refs\"));\n \n \tif (tags)\n \t\tadd_refspec(\"refs/tags/*\");\n-- \n1.7.2.3\n"},{"id":"161962","messageId":"1298418152-27789-54-git-send-email-avarab@gmail.com","threadId":"26561","inReplyTo":"7vhbbwdjnm.fsf@alter.siamese.dyndns.org","subject":"[PATCH v4 53/73] gettextize: git-push \"prevent you from losing\" message","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2011-02-22T23:42:12Z","receivedAt":"2011-02-22T23:42:12Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"Gettextize the \"To prevent you from losing history\" message. A test in\nlib-httpd.sh and another in t5541-http-push.sh explicitly checked for\nthis message. Change them to skip under GETTEXT_POISON=YesPlease.\n\nSigned-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n builtin/push.c       |    4 ++--\n t/lib-httpd.sh       |    2 +-\n t/t5541-http-push.sh |    7 +++++--\n 3 files changed, 8 insertions(+), 5 deletions(-)\n\ndiff --git a/builtin/push.c b/builtin/push.c\nindex 513bc57..8c8d8c7 100644\n--- a/builtin/push.c\n+++ b/builtin/push.c\n@@ -129,9 +129,9 @@ static int push_with_options(struct transport *transport, int flags)\n \t\treturn 0;\n \n \tif (nonfastforward && advice_push_nonfastforward) {\n-\t\tfprintf(stderr, \"To prevent you from losing history, non-fast-forward updates were rejected\\n\"\n+\t\tfprintf(stderr, _(\"To prevent you from losing history, non-fast-forward updates were rejected\\n\"\n \t\t\t\t\"Merge the remote changes (e.g. 'git pull') before pushing again.  See the\\n\"\n-\t\t\t\t\"'Note about fast-forwards' section of 'git push --help' for details.\\n\");\n+\t\t\t\t\"'Note about fast-forwards' section of 'git push --help' for details.\\n\"));\n \t}\n \n \treturn 1;\ndiff --git a/t/lib-httpd.sh b/t/lib-httpd.sh\nindex 3f24384..d3829b8 100644\n--- a/t/lib-httpd.sh\n+++ b/t/lib-httpd.sh\n@@ -157,7 +157,7 @@ test_http_push_nonff() {\n \t\tgrep \"^ ! \\[rejected\\][ ]*$BRANCH -> $BRANCH (non-fast-forward)$\" output\n \t'\n \n-\ttest_expect_success 'non-fast-forward push shows help message' '\n+\ttest_expect_success C_LOCALE_OUTPUT 'non-fast-forward push shows help message' '\n \t\tgrep \"To prevent you from losing history, non-fast-forward updates were rejected\" \\\n \t\t\toutput\n \t'\ndiff --git a/t/t5541-http-push.sh b/t/t5541-http-push.sh\nindex b0c2a2c..0492877 100755\n--- a/t/t5541-http-push.sh\n+++ b/t/t5541-http-push.sh\n@@ -128,11 +128,14 @@ test_expect_success 'push fails for non-fast-forward refs unmatched by remote he\n \n \t# push master too; this ensures there is at least one '\"'push'\"' command to\n \t# the remote helper and triggers interaction with the helper.\n-\ttest_must_fail git push -v origin +master master:retsam >output 2>&1 &&\n+\ttest_must_fail git push -v origin +master master:retsam >output 2>&1'\n \n+test_expect_success 'push fails for non-fast-forward refs unmatched by remote helper: remote output' '\n \tgrep \"^ + [a-f0-9]*\\.\\.\\.[a-f0-9]* *master -> master (forced update)$\" output &&\n-\tgrep \"^ ! \\[rejected\\] *master -> retsam (non-fast-forward)$\" output &&\n+\tgrep \"^ ! \\[rejected\\] *master -> retsam (non-fast-forward)$\" output\n+'\n \n+test_expect_success C_LOCALE_OUTPUT 'push fails for non-fast-forward refs unmatched by remote helper: our output' '\n \tgrep \"To prevent you from losing history, non-fast-forward updates were rejected\" \\\n \t\toutput\n '\n-- \n1.7.2.3\n"},{"id":"161957","messageId":"1298418152-27789-55-git-send-email-avarab@gmail.com","threadId":"26561","inReplyTo":"7vhbbwdjnm.fsf@alter.siamese.dyndns.org","subject":"[PATCH v4 54/73] gettextize: git-status basic messages","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2011-02-22T23:42:13Z","receivedAt":"2011-02-22T23:42:13Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"Gettextize the most common git-status messages. Many tests checked for\nthese explicitly. Change them to skip under GETTEXT_POISON=YesPlease.\n\nSome of the tests in t7508-status.sh needed to be split up when I\nadded C_LOCALE_OUTPUT to them, since parts of them affected later\ntests (some of which aren't being skipped) indirectly.\n\nSigned-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n t/t7060-wtstatus.sh         |    2 +-\n t/t7506-status-submodule.sh |   20 ++++----\n t/t7508-status.sh           |  115 ++++++++++++++++++++++++-------------------\n wt-status.c                 |   86 ++++++++++++++++----------------\n 4 files changed, 119 insertions(+), 104 deletions(-)\n\ndiff --git a/t/t7060-wtstatus.sh b/t/t7060-wtstatus.sh\nindex fcac472..b4fcc86 100755\n--- a/t/t7060-wtstatus.sh\n+++ b/t/t7060-wtstatus.sh\n@@ -38,7 +38,7 @@ cat >expect <<EOF\n no changes added to commit (use \"git add\" and/or \"git commit -a\")\n EOF\n \n-test_expect_success 'M/D conflict does not segfault' '\n+test_expect_success C_LOCALE_OUTPUT 'M/D conflict does not segfault' '\n \tmkdir mdconflict &&\n \t(\n \t\tcd mdconflict &&\ndiff --git a/t/t7506-status-submodule.sh b/t/t7506-status-submodule.sh\nindex 3d4f85d..fa473a0 100755\n--- a/t/t7506-status-submodule.sh\n+++ b/t/t7506-status-submodule.sh\n@@ -30,7 +30,7 @@ test_expect_success 'commit --dry-run -a clean' '\n \tgrep \"nothing to commit\" output\n '\n \n-test_expect_success 'status with modified file in submodule' '\n+test_expect_success C_LOCALE_OUTPUT 'status with modified file in submodule' '\n \t(cd sub && git reset --hard) &&\n \techo \"changed\" >sub/foo &&\n \tgit status >output &&\n@@ -46,7 +46,7 @@ test_expect_success 'status with modified file in submodule (porcelain)' '\n \tEOF\n '\n \n-test_expect_success 'status with added file in submodule' '\n+test_expect_success C_LOCALE_OUTPUT 'status with added file in submodule' '\n \t(cd sub && git reset --hard && echo >foo && git add foo) &&\n \tgit status >output &&\n \tgrep \"modified:   sub (modified content)\" output\n@@ -60,14 +60,14 @@ test_expect_success 'status with added file in submodule (porcelain)' '\n \tEOF\n '\n \n-test_expect_success 'status with untracked file in submodule' '\n+test_expect_success C_LOCALE_OUTPUT 'status with untracked file in submodule' '\n \t(cd sub && git reset --hard) &&\n \techo \"content\" >sub/new-file &&\n \tgit status >output &&\n \tgrep \"modified:   sub (untracked content)\" output\n '\n \n-test_expect_success 'status -uno with untracked file in submodule' '\n+test_expect_success C_LOCALE_OUTPUT 'status -uno with untracked file in submodule' '\n \tgit status -uno >output &&\n \tgrep \"^nothing to commit\" output\n '\n@@ -79,7 +79,7 @@ test_expect_success 'status with untracked file in submodule (porcelain)' '\n \tEOF\n '\n \n-test_expect_success 'status with added and untracked file in submodule' '\n+test_expect_success C_LOCALE_OUTPUT 'status with added and untracked file in submodule' '\n \t(cd sub && git reset --hard && echo >foo && git add foo) &&\n \techo \"content\" >sub/new-file &&\n \tgit status >output &&\n@@ -95,7 +95,7 @@ test_expect_success 'status with added and untracked file in submodule (porcelai\n \tEOF\n '\n \n-test_expect_success 'status with modified file in modified submodule' '\n+test_expect_success C_LOCALE_OUTPUT 'status with modified file in modified submodule' '\n \t(cd sub && git reset --hard) &&\n \trm sub/new-file &&\n \t(cd sub && echo \"next change\" >foo && git commit -m \"next change\" foo) &&\n@@ -113,7 +113,7 @@ test_expect_success 'status with modified file in modified submodule (porcelain)\n \tEOF\n '\n \n-test_expect_success 'status with added file in modified submodule' '\n+test_expect_success C_LOCALE_OUTPUT 'status with added file in modified submodule' '\n \t(cd sub && git reset --hard && echo >foo && git add foo) &&\n \tgit status >output &&\n \tgrep \"modified:   sub (new commits, modified content)\" output\n@@ -127,7 +127,7 @@ test_expect_success 'status with added file in modified submodule (porcelain)' '\n \tEOF\n '\n \n-test_expect_success 'status with untracked file in modified submodule' '\n+test_expect_success C_LOCALE_OUTPUT 'status with untracked file in modified submodule' '\n \t(cd sub && git reset --hard) &&\n \techo \"content\" >sub/new-file &&\n \tgit status >output &&\n@@ -141,7 +141,7 @@ test_expect_success 'status with untracked file in modified submodule (porcelain\n \tEOF\n '\n \n-test_expect_success 'status with added and untracked file in modified submodule' '\n+test_expect_success C_LOCALE_OUTPUT 'status with added and untracked file in modified submodule' '\n \t(cd sub && git reset --hard && echo >foo && git add foo) &&\n \techo \"content\" >sub/new-file &&\n \tgit status >output &&\n@@ -167,7 +167,7 @@ test_expect_success 'setup .git file for sub' '\n \t git commit -m \"added .real to .gitignore\" .gitignore\n '\n \n-test_expect_success 'status with added file in modified submodule with .git file' '\n+test_expect_success C_LOCALE_OUTPUT 'status with added file in modified submodule with .git file' '\n \t(cd sub && git reset --hard && echo >foo && git add foo) &&\n \tgit status >output &&\n \tgrep \"modified:   sub (new commits, modified content)\" output\ndiff --git a/t/t7508-status.sh b/t/t7508-status.sh\nindex f1dc5c3..a93e70f 100755\n--- a/t/t7508-status.sh\n+++ b/t/t7508-status.sh\n@@ -55,7 +55,7 @@ test_expect_success 'setup' '\n \tgit add dir2/added\n '\n \n-test_expect_success 'status (1)' '\n+test_expect_success C_LOCALE_OUTPUT 'status (1)' '\n \n \tgrep \"use \\\"git rm --cached <file>\\.\\.\\.\\\" to unstage\" output\n \n@@ -85,7 +85,7 @@ cat >expect <<\\EOF\n #\tuntracked\n EOF\n \n-test_expect_success 'status (2)' '\n+test_expect_success C_LOCALE_OUTPUT 'status (2)' '\n \n \tgit status >output &&\n \ttest_cmp expect output\n@@ -111,7 +111,7 @@ EOF\n \n git config advice.statusHints false\n \n-test_expect_success 'status (advice.statusHints false)' '\n+test_expect_success C_LOCALE_OUTPUT 'status (advice.statusHints false)' '\n \n \tgit status >output &&\n \ttest_cmp expect output\n@@ -157,6 +157,12 @@ test_expect_success 'status -s -b' '\n \n '\n \n+test_expect_success 'setup dir3' '\n+\tmkdir dir3 &&\n+\t: >dir3/untracked1 &&\n+\t: >dir3/untracked2\n+'\n+\n cat >expect <<EOF\n # On branch master\n # Changes to be committed:\n@@ -172,16 +178,14 @@ cat >expect <<EOF\n #\n # Untracked files not listed (use -u option to show untracked files)\n EOF\n-test_expect_success 'status -uno' '\n-\tmkdir dir3 &&\n-\t: >dir3/untracked1 &&\n-\t: >dir3/untracked2 &&\n+test_expect_success C_LOCALE_OUTPUT 'status -uno' '\n \tgit status -uno >output &&\n \ttest_cmp expect output\n '\n \n-test_expect_success 'status (status.showUntrackedFiles no)' '\n+test_expect_success C_LOCALE_OUTPUT 'status (status.showUntrackedFiles no)' '\n \tgit config status.showuntrackedfiles no\n+\ttest_when_finished \"git config --unset status.showuntrackedfiles\" &&\n \tgit status >output &&\n \ttest_cmp expect output\n '\n@@ -197,7 +201,7 @@ cat >expect <<EOF\n # Untracked files not listed\n EOF\n git config advice.statusHints false\n-test_expect_success 'status -uno (advice.statusHints false)' '\n+test_expect_success C_LOCALE_OUTPUT 'status -uno (advice.statusHints false)' '\n \tgit status -uno >output &&\n \ttest_cmp expect output\n '\n@@ -208,7 +212,6 @@ cat >expect << EOF\n A  dir2/added\n EOF\n test_expect_success 'status -s -uno' '\n-\tgit config --unset status.showuntrackedfiles\n \tgit status -s -uno >output &&\n \ttest_cmp expect output\n '\n@@ -243,13 +246,14 @@ cat >expect <<EOF\n #\toutput\n #\tuntracked\n EOF\n-test_expect_success 'status -unormal' '\n+test_expect_success C_LOCALE_OUTPUT 'status -unormal' '\n \tgit status -unormal >output &&\n \ttest_cmp expect output\n '\n \n-test_expect_success 'status (status.showUntrackedFiles normal)' '\n+test_expect_success C_LOCALE_OUTPUT 'status (status.showUntrackedFiles normal)' '\n \tgit config status.showuntrackedfiles normal\n+\ttest_when_finished \"git config --unset status.showuntrackedfiles\" &&\n \tgit status >output &&\n \ttest_cmp expect output\n '\n@@ -266,7 +270,6 @@ A  dir2/added\n ?? untracked\n EOF\n test_expect_success 'status -s -unormal' '\n-\tgit config --unset status.showuntrackedfiles\n \tgit status -s -unormal >output &&\n \ttest_cmp expect output\n '\n@@ -302,18 +305,21 @@ cat >expect <<EOF\n #\toutput\n #\tuntracked\n EOF\n-test_expect_success 'status -uall' '\n+test_expect_success C_LOCALE_OUTPUT 'status -uall' '\n \tgit status -uall >output &&\n \ttest_cmp expect output\n '\n-test_expect_success 'status (status.showUntrackedFiles all)' '\n+test_expect_success C_LOCALE_OUTPUT 'status (status.showUntrackedFiles all)' '\n \tgit config status.showuntrackedfiles all\n+\ttest_when_finished \"git config --unset status.showuntrackedfiles\" &&\n \tgit status >output &&\n-\trm -rf dir3 &&\n-\tgit config --unset status.showuntrackedfiles &&\n \ttest_cmp expect output\n '\n \n+test_expect_success 'teardown dir3' '\n+\trm -rf dir3\n+'\n+\n cat >expect <<EOF\n  M dir1/modified\n A  dir2/added\n@@ -361,7 +367,7 @@ cat >expect <<\\EOF\n #\t../untracked\n EOF\n \n-test_expect_success 'status with relative paths' '\n+test_expect_success C_LOCALE_OUTPUT 'status with relative paths' '\n \n \t(cd dir1 && git status) >output &&\n \ttest_cmp expect output\n@@ -434,18 +440,19 @@ cat >expect <<\\EOF\n #\t<BLUE>untracked<RESET>\n EOF\n \n-test_expect_success 'status with color.ui' '\n+test_expect_success C_LOCALE_OUTPUT 'status with color.ui' '\n \n \tgit config color.ui always &&\n+\ttest_when_finished \"git config --unset color.ui\" &&\n \tgit status | test_decode_color >output &&\n \ttest_cmp expect output\n \n '\n \n-test_expect_success 'status with color.status' '\n+test_expect_success C_LOCALE_OUTPUT 'status with color.status' '\n \n-\tgit config --unset color.ui &&\n \tgit config color.status always &&\n+\ttest_when_finished \"git config --unset color.status\" &&\n \tgit status | test_decode_color >output &&\n \ttest_cmp expect output\n \n@@ -464,7 +471,6 @@ EOF\n \n test_expect_success 'status -s with color.ui' '\n \n-\tgit config --unset color.status &&\n \tgit config color.ui always &&\n \tgit status -s | test_decode_color >output &&\n \ttest_cmp expect output\n@@ -564,9 +570,10 @@ cat >expect <<\\EOF\n EOF\n \n \n-test_expect_success 'status without relative paths' '\n+test_expect_success C_LOCALE_OUTPUT 'status without relative paths' '\n \n-\tgit config status.relativePaths false\n+\tgit config status.relativePaths false &&\n+\ttest_when_finished \"git config --unset status.relativePaths\" &&\n \t(cd dir1 && git status) >output &&\n \ttest_cmp expect output\n \n@@ -585,6 +592,8 @@ EOF\n \n test_expect_success 'status -s without relative paths' '\n \n+\tgit config status.relativePaths false &&\n+\ttest_when_finished \"git config --unset status.relativePaths\" &&\n \t(cd dir1 && git status -s) >output &&\n \ttest_cmp expect output\n \n@@ -607,7 +616,10 @@ cat <<EOF >expect\n #\tuntracked\n EOF\n test_expect_success 'dry-run of partial commit excluding new file in index' '\n-\tgit commit --dry-run dir1/modified >output &&\n+\tgit commit --dry-run dir1/modified >output\n+'\n+\n+test_expect_success C_LOCALE_OUTPUT 'dry-run of partial commit excluding new file in index: output' '\n \ttest_cmp expect output\n '\n \n@@ -655,13 +667,13 @@ cat >expect <<EOF\n #\toutput\n #\tuntracked\n EOF\n-test_expect_success 'status submodule summary is disabled by default' '\n+test_expect_success C_LOCALE_OUTPUT 'status submodule summary is disabled by default' '\n \tgit status >output &&\n \ttest_cmp expect output\n '\n \n # we expect the same as the previous test\n-test_expect_success 'status --untracked-files=all does not show submodule' '\n+test_expect_success C_LOCALE_OUTPUT 'status --untracked-files=all does not show submodule' '\n \tgit status --untracked-files=all >output &&\n \ttest_cmp expect output\n '\n@@ -719,7 +731,7 @@ cat >expect <<EOF\n #\toutput\n #\tuntracked\n EOF\n-test_expect_success 'status submodule summary' '\n+test_expect_success C_LOCALE_OUTPUT 'status submodule summary' '\n \tgit config status.submodulesummary 10 &&\n \tgit status >output &&\n \ttest_cmp expect output\n@@ -760,8 +772,11 @@ cat >expect <<EOF\n #\tuntracked\n no changes added to commit (use \"git add\" and/or \"git commit -a\")\n EOF\n-test_expect_success 'status submodule summary (clean submodule)' '\n-\tgit commit -m \"commit submodule\" &&\n+test_expect_success 'status submodule summary (clean submodule): commit' '\n+\tgit commit -m \"commit submodule\"\n+'\n+\n+test_expect_success C_LOCALE_OUTPUT 'status submodule summary (clean submodule): output' '\n \tgit config status.submodulesummary 10 &&\n \ttest_must_fail git commit --dry-run >output &&\n \ttest_cmp expect output &&\n@@ -812,7 +827,7 @@ cat >expect <<EOF\n #\toutput\n #\tuntracked\n EOF\n-test_expect_success 'commit --dry-run submodule summary (--amend)' '\n+test_expect_success C_LOCALE_OUTPUT 'commit --dry-run submodule summary (--amend)' '\n \tgit config status.submodulesummary 10 &&\n \tgit commit --dry-run --amend >output &&\n \ttest_cmp expect output\n@@ -867,13 +882,13 @@ cat > expect << EOF\n #\tuntracked\n EOF\n \n-test_expect_success '--ignore-submodules=untracked suppresses submodules with untracked content' '\n+test_expect_success C_LOCALE_OUTPUT '--ignore-submodules=untracked suppresses submodules with untracked content' '\n \techo modified > sm/untracked &&\n \tgit status --ignore-submodules=untracked > output &&\n \ttest_cmp expect output\n '\n \n-test_expect_success '.gitmodules ignore=untracked suppresses submodules with untracked content' '\n+test_expect_success C_LOCALE_OUTPUT '.gitmodules ignore=untracked suppresses submodules with untracked content' '\n \tgit config diff.ignoreSubmodules dirty &&\n \tgit status >output &&\n \ttest_cmp expect output &&\n@@ -885,7 +900,7 @@ test_expect_success '.gitmodules ignore=untracked suppresses submodules with unt\n \tgit config --unset diff.ignoreSubmodules\n '\n \n-test_expect_success '.git/config ignore=untracked suppresses submodules with untracked content' '\n+test_expect_success C_LOCALE_OUTPUT '.git/config ignore=untracked suppresses submodules with untracked content' '\n \tgit config --add -f .gitmodules submodule.subname.ignore none &&\n \tgit config --add -f .gitmodules submodule.subname.path sm &&\n \tgit config --add submodule.subname.ignore untracked &&\n@@ -896,12 +911,12 @@ test_expect_success '.git/config ignore=untracked suppresses submodules with unt\n \tgit config --remove-section -f .gitmodules submodule.subname\n '\n \n-test_expect_success '--ignore-submodules=dirty suppresses submodules with untracked content' '\n+test_expect_success C_LOCALE_OUTPUT '--ignore-submodules=dirty suppresses submodules with untracked content' '\n \tgit status --ignore-submodules=dirty > output &&\n \ttest_cmp expect output\n '\n \n-test_expect_success '.gitmodules ignore=dirty suppresses submodules with untracked content' '\n+test_expect_success C_LOCALE_OUTPUT '.gitmodules ignore=dirty suppresses submodules with untracked content' '\n \tgit config diff.ignoreSubmodules dirty &&\n \tgit status >output &&\n \t! test -s actual &&\n@@ -913,7 +928,7 @@ test_expect_success '.gitmodules ignore=dirty suppresses submodules with untrack\n \tgit config --unset diff.ignoreSubmodules\n '\n \n-test_expect_success '.git/config ignore=dirty suppresses submodules with untracked content' '\n+test_expect_success C_LOCALE_OUTPUT '.git/config ignore=dirty suppresses submodules with untracked content' '\n \tgit config --add -f .gitmodules submodule.subname.ignore none &&\n \tgit config --add -f .gitmodules submodule.subname.path sm &&\n \tgit config --add submodule.subname.ignore dirty &&\n@@ -924,13 +939,13 @@ test_expect_success '.git/config ignore=dirty suppresses submodules with untrack\n \tgit config -f .gitmodules  --remove-section submodule.subname\n '\n \n-test_expect_success '--ignore-submodules=dirty suppresses submodules with modified content' '\n+test_expect_success C_LOCALE_OUTPUT '--ignore-submodules=dirty suppresses submodules with modified content' '\n \techo modified > sm/foo &&\n \tgit status --ignore-submodules=dirty > output &&\n \ttest_cmp expect output\n '\n \n-test_expect_success '.gitmodules ignore=dirty suppresses submodules with modified content' '\n+test_expect_success C_LOCALE_OUTPUT '.gitmodules ignore=dirty suppresses submodules with modified content' '\n \tgit config --add -f .gitmodules submodule.subname.ignore dirty &&\n \tgit config --add -f .gitmodules submodule.subname.path sm &&\n \tgit status > output &&\n@@ -938,7 +953,7 @@ test_expect_success '.gitmodules ignore=dirty suppresses submodules with modifie\n \tgit config -f .gitmodules  --remove-section submodule.subname\n '\n \n-test_expect_success '.git/config ignore=dirty suppresses submodules with modified content' '\n+test_expect_success C_LOCALE_OUTPUT '.git/config ignore=dirty suppresses submodules with modified content' '\n \tgit config --add -f .gitmodules submodule.subname.ignore none &&\n \tgit config --add -f .gitmodules submodule.subname.path sm &&\n \tgit config --add submodule.subname.ignore dirty &&\n@@ -981,12 +996,12 @@ cat > expect << EOF\n #\tuntracked\n EOF\n \n-test_expect_success \"--ignore-submodules=untracked doesn't suppress submodules with modified content\" '\n+test_expect_success C_LOCALE_OUTPUT \"--ignore-submodules=untracked doesn't suppress submodules with modified content\" '\n \tgit status --ignore-submodules=untracked > output &&\n \ttest_cmp expect output\n '\n \n-test_expect_success \".gitmodules ignore=untracked doesn't suppress submodules with modified content\" '\n+test_expect_success C_LOCALE_OUTPUT \".gitmodules ignore=untracked doesn't suppress submodules with modified content\" '\n \tgit config --add -f .gitmodules submodule.subname.ignore untracked &&\n \tgit config --add -f .gitmodules submodule.subname.path sm &&\n \tgit status > output &&\n@@ -994,7 +1009,7 @@ test_expect_success \".gitmodules ignore=untracked doesn't suppress submodules wi\n \tgit config -f .gitmodules  --remove-section submodule.subname\n '\n \n-test_expect_success \".git/config ignore=untracked doesn't suppress submodules with modified content\" '\n+test_expect_success C_LOCALE_OUTPUT \".git/config ignore=untracked doesn't suppress submodules with modified content\" '\n \tgit config --add -f .gitmodules submodule.subname.ignore none &&\n \tgit config --add -f .gitmodules submodule.subname.path sm &&\n \tgit config --add submodule.subname.ignore untracked &&\n@@ -1043,12 +1058,12 @@ cat > expect << EOF\n #\tuntracked\n EOF\n \n-test_expect_success \"--ignore-submodules=untracked doesn't suppress submodule summary\" '\n+test_expect_success C_LOCALE_OUTPUT \"--ignore-submodules=untracked doesn't suppress submodule summary\" '\n \tgit status --ignore-submodules=untracked > output &&\n \ttest_cmp expect output\n '\n \n-test_expect_success \".gitmodules ignore=untracked doesn't suppress submodule summary\" '\n+test_expect_success C_LOCALE_OUTPUT \".gitmodules ignore=untracked doesn't suppress submodule summary\" '\n \tgit config --add -f .gitmodules submodule.subname.ignore untracked &&\n \tgit config --add -f .gitmodules submodule.subname.path sm &&\n \tgit status > output &&\n@@ -1056,7 +1071,7 @@ test_expect_success \".gitmodules ignore=untracked doesn't suppress submodule sum\n \tgit config -f .gitmodules  --remove-section submodule.subname\n '\n \n-test_expect_success \".git/config ignore=untracked doesn't suppress submodule summary\" '\n+test_expect_success C_LOCALE_OUTPUT \".git/config ignore=untracked doesn't suppress submodule summary\" '\n \tgit config --add -f .gitmodules submodule.subname.ignore none &&\n \tgit config --add -f .gitmodules submodule.subname.path sm &&\n \tgit config --add submodule.subname.ignore untracked &&\n@@ -1067,11 +1082,11 @@ test_expect_success \".git/config ignore=untracked doesn't suppress submodule sum\n \tgit config -f .gitmodules  --remove-section submodule.subname\n '\n \n-test_expect_success \"--ignore-submodules=dirty doesn't suppress submodule summary\" '\n+test_expect_success C_LOCALE_OUTPUT \"--ignore-submodules=dirty doesn't suppress submodule summary\" '\n \tgit status --ignore-submodules=dirty > output &&\n \ttest_cmp expect output\n '\n-test_expect_success \".gitmodules ignore=dirty doesn't suppress submodule summary\" '\n+test_expect_success C_LOCALE_OUTPUT \".gitmodules ignore=dirty doesn't suppress submodule summary\" '\n \tgit config --add -f .gitmodules submodule.subname.ignore dirty &&\n \tgit config --add -f .gitmodules submodule.subname.path sm &&\n \tgit status > output &&\n@@ -1079,7 +1094,7 @@ test_expect_success \".gitmodules ignore=dirty doesn't suppress submodule summary\n \tgit config -f .gitmodules  --remove-section submodule.subname\n '\n \n-test_expect_success \".git/config ignore=dirty doesn't suppress submodule summary\" '\n+test_expect_success C_LOCALE_OUTPUT \".git/config ignore=dirty doesn't suppress submodule summary\" '\n \tgit config --add -f .gitmodules submodule.subname.ignore none &&\n \tgit config --add -f .gitmodules submodule.subname.path sm &&\n \tgit config --add submodule.subname.ignore dirty &&\n@@ -1111,7 +1126,7 @@ cat > expect << EOF\n no changes added to commit (use \"git add\" and/or \"git commit -a\")\n EOF\n \n-test_expect_success \"--ignore-submodules=all suppresses submodule summary\" '\n+test_expect_success C_LOCALE_OUTPUT \"--ignore-submodules=all suppresses submodule summary\" '\n \tgit status --ignore-submodules=all > output &&\n \ttest_cmp expect output\n '\ndiff --git a/wt-status.c b/wt-status.c\nindex 123582b..f369eba 100644\n--- a/wt-status.c\n+++ b/wt-status.c\n@@ -57,16 +57,16 @@ static void wt_status_print_unmerged_header(struct wt_status *s)\n {\n \tconst char *c = color(WT_STATUS_HEADER, s);\n \n-\tcolor_fprintf_ln(s->fp, c, \"# Unmerged paths:\");\n+\tcolor_fprintf_ln(s->fp, c, _(\"# Unmerged paths:\"));\n \tif (!advice_status_hints)\n \t\treturn;\n \tif (s->in_merge)\n \t\t;\n \telse if (!s->is_initial)\n-\t\tcolor_fprintf_ln(s->fp, c, \"#   (use \\\"git reset %s <file>...\\\" to unstage)\", s->reference);\n+\t\tcolor_fprintf_ln(s->fp, c, _(\"#   (use \\\"git reset %s <file>...\\\" to unstage)\"), s->reference);\n \telse\n-\t\tcolor_fprintf_ln(s->fp, c, \"#   (use \\\"git rm --cached <file>...\\\" to unstage)\");\n-\tcolor_fprintf_ln(s->fp, c, \"#   (use \\\"git add/rm <file>...\\\" as appropriate to mark resolution)\");\n+\t\tcolor_fprintf_ln(s->fp, c, _(\"#   (use \\\"git rm --cached <file>...\\\" to unstage)\"));\n+\tcolor_fprintf_ln(s->fp, c, _(\"#   (use \\\"git add/rm <file>...\\\" as appropriate to mark resolution)\"));\n \tcolor_fprintf_ln(s->fp, c, \"#\");\n }\n \n@@ -80,9 +80,9 @@ static void wt_status_print_cached_header(struct wt_status *s)\n \tif (s->in_merge)\n \t\t; /* NEEDSWORK: use \"git reset --unresolve\"??? */\n \telse if (!s->is_initial)\n-\t\tcolor_fprintf_ln(s->fp, c, \"#   (use \\\"git reset %s <file>...\\\" to unstage)\", s->reference);\n+\t\tcolor_fprintf_ln(s->fp, c, _(\"#   (use \\\"git reset %s <file>...\\\" to unstage)\"), s->reference);\n \telse\n-\t\tcolor_fprintf_ln(s->fp, c, \"#   (use \\\"git rm --cached <file>...\\\" to unstage)\");\n+\t\tcolor_fprintf_ln(s->fp, c, _(\"#   (use \\\"git rm --cached <file>...\\\" to unstage)\"));\n \tcolor_fprintf_ln(s->fp, c, \"#\");\n }\n \n@@ -92,16 +92,16 @@ static void wt_status_print_dirty_header(struct wt_status *s,\n {\n \tconst char *c = color(WT_STATUS_HEADER, s);\n \n-\tcolor_fprintf_ln(s->fp, c, \"# Changes not staged for commit:\");\n+\tcolor_fprintf_ln(s->fp, c, _(\"# Changes not staged for commit:\"));\n \tif (!advice_status_hints)\n \t\treturn;\n \tif (!has_deleted)\n-\t\tcolor_fprintf_ln(s->fp, c, \"#   (use \\\"git add <file>...\\\" to update what will be committed)\");\n+\t\tcolor_fprintf_ln(s->fp, c, _(\"#   (use \\\"git add <file>...\\\" to update what will be committed)\"));\n \telse\n-\t\tcolor_fprintf_ln(s->fp, c, \"#   (use \\\"git add/rm <file>...\\\" to update what will be committed)\");\n-\tcolor_fprintf_ln(s->fp, c, \"#   (use \\\"git checkout -- <file>...\\\" to discard changes in working directory)\");\n+\t\tcolor_fprintf_ln(s->fp, c, _(\"#   (use \\\"git add/rm <file>...\\\" to update what will be committed)\"));\n+\tcolor_fprintf_ln(s->fp, c, _(\"#   (use \\\"git checkout -- <file>...\\\" to discard changes in working directory)\"));\n \tif (has_dirty_submodules)\n-\t\tcolor_fprintf_ln(s->fp, c, \"#   (commit or discard the untracked or modified content in submodules)\");\n+\t\tcolor_fprintf_ln(s->fp, c, _(\"#   (commit or discard the untracked or modified content in submodules)\"));\n \tcolor_fprintf_ln(s->fp, c, \"#\");\n }\n \n@@ -110,10 +110,10 @@ static void wt_status_print_other_header(struct wt_status *s,\n \t\t\t\t\t const char *how)\n {\n \tconst char *c = color(WT_STATUS_HEADER, s);\n-\tcolor_fprintf_ln(s->fp, c, \"# %s files:\", what);\n+\tcolor_fprintf_ln(s->fp, c, _(\"# %s files:\"), what);\n \tif (!advice_status_hints)\n \t\treturn;\n-\tcolor_fprintf_ln(s->fp, c, \"#   (use \\\"git %s <file>...\\\" to include in what will be committed)\", how);\n+\tcolor_fprintf_ln(s->fp, c, _(\"#   (use \\\"git %s <file>...\\\" to include in what will be committed)\"), how);\n \tcolor_fprintf_ln(s->fp, c, \"#\");\n }\n \n@@ -130,18 +130,18 @@ static void wt_status_print_unmerged_data(struct wt_status *s,\n \tconst char *c = color(WT_STATUS_UNMERGED, s);\n \tstruct wt_status_change_data *d = it->util;\n \tstruct strbuf onebuf = STRBUF_INIT;\n-\tconst char *one, *how = \"bug\";\n+\tconst char *one, *how = _(\"bug\");\n \n \tone = quote_path(it->string, -1, &onebuf, s->prefix);\n \tcolor_fprintf(s->fp, color(WT_STATUS_HEADER, s), \"#\\t\");\n \tswitch (d->stagemask) {\n-\tcase 1: how = \"both deleted:\"; break;\n-\tcase 2: how = \"added by us:\"; break;\n-\tcase 3: how = \"deleted by them:\"; break;\n-\tcase 4: how = \"added by them:\"; break;\n-\tcase 5: how = \"deleted by us:\"; break;\n-\tcase 6: how = \"both added:\"; break;\n-\tcase 7: how = \"both modified:\"; break;\n+\tcase 1: how = _(\"both deleted:\"); break;\n+\tcase 2: how = _(\"added by us:\"); break;\n+\tcase 3: how = _(\"deleted by them:\"); break;\n+\tcase 4: how = _(\"added by them:\"); break;\n+\tcase 5: how = _(\"deleted by us:\"); break;\n+\tcase 6: how = _(\"both added:\"); break;\n+\tcase 7: how = _(\"both modified:\"); break;\n \t}\n \tcolor_fprintf(s->fp, c, \"%-20s%s\\n\", how, one);\n \tstrbuf_release(&onebuf);\n@@ -171,11 +171,11 @@ static void wt_status_print_change_data(struct wt_status *s,\n \t\tif (d->new_submodule_commits || d->dirty_submodule) {\n \t\t\tstrbuf_addstr(&extra, \" (\");\n \t\t\tif (d->new_submodule_commits)\n-\t\t\t\tstrbuf_addf(&extra, \"new commits, \");\n+\t\t\t\tstrbuf_addf(&extra, _(\"new commits, \"));\n \t\t\tif (d->dirty_submodule & DIRTY_SUBMODULE_MODIFIED)\n-\t\t\t\tstrbuf_addf(&extra, \"modified content, \");\n+\t\t\t\tstrbuf_addf(&extra, _(\"modified content, \"));\n \t\t\tif (d->dirty_submodule & DIRTY_SUBMODULE_UNTRACKED)\n-\t\t\t\tstrbuf_addf(&extra, \"untracked content, \");\n+\t\t\t\tstrbuf_addf(&extra, _(\"untracked content, \"));\n \t\t\tstrbuf_setlen(&extra, extra.len - 2);\n \t\t\tstrbuf_addch(&extra, ')');\n \t\t}\n@@ -189,31 +189,31 @@ static void wt_status_print_change_data(struct wt_status *s,\n \tcolor_fprintf(s->fp, color(WT_STATUS_HEADER, s), \"#\\t\");\n \tswitch (status) {\n \tcase DIFF_STATUS_ADDED:\n-\t\tcolor_fprintf(s->fp, c, \"new file:   %s\", one);\n+\t\tcolor_fprintf(s->fp, c, _(\"new file:   %s\"), one);\n \t\tbreak;\n \tcase DIFF_STATUS_COPIED:\n-\t\tcolor_fprintf(s->fp, c, \"copied:     %s -> %s\", one, two);\n+\t\tcolor_fprintf(s->fp, c, _(\"copied:     %s -> %s\"), one, two);\n \t\tbreak;\n \tcase DIFF_STATUS_DELETED:\n-\t\tcolor_fprintf(s->fp, c, \"deleted:    %s\", one);\n+\t\tcolor_fprintf(s->fp, c, _(\"deleted:    %s\"), one);\n \t\tbreak;\n \tcase DIFF_STATUS_MODIFIED:\n-\t\tcolor_fprintf(s->fp, c, \"modified:   %s\", one);\n+\t\tcolor_fprintf(s->fp, c, _(\"modified:   %s\"), one);\n \t\tbreak;\n \tcase DIFF_STATUS_RENAMED:\n \t\tcolor_fprintf(s->fp, c, \"renamed:    %s -> %s\", one, two);\n \t\tbreak;\n \tcase DIFF_STATUS_TYPE_CHANGED:\n-\t\tcolor_fprintf(s->fp, c, \"typechange: %s\", one);\n+\t\tcolor_fprintf(s->fp, c, _(\"typechange: %s\"), one);\n \t\tbreak;\n \tcase DIFF_STATUS_UNKNOWN:\n-\t\tcolor_fprintf(s->fp, c, \"unknown:    %s\", one);\n+\t\tcolor_fprintf(s->fp, c, _(\"unknown:    %s\"), one);\n \t\tbreak;\n \tcase DIFF_STATUS_UNMERGED:\n-\t\tcolor_fprintf(s->fp, c, \"unmerged:   %s\", one);\n+\t\tcolor_fprintf(s->fp, c, _(\"unmerged:   %s\"), one);\n \t\tbreak;\n \tdefault:\n-\t\tdie(\"bug: unhandled diff status %c\", status);\n+\t\tdie(_(\"bug: unhandled diff status %c\"), status);\n \t}\n \tif (extra.len) {\n \t\tcolor_fprintf(s->fp, color(WT_STATUS_HEADER, s), \"%s\", extra.buf);\n@@ -633,14 +633,14 @@ void wt_status_print(struct wt_status *s)\n \tconst char *branch_status_color = color(WT_STATUS_HEADER, s);\n \n \tif (s->branch) {\n-\t\tconst char *on_what = \"On branch \";\n+\t\tconst char *on_what = _(\"On branch \");\n \t\tconst char *branch_name = s->branch;\n \t\tif (!prefixcmp(branch_name, \"refs/heads/\"))\n \t\t\tbranch_name += 11;\n \t\telse if (!strcmp(branch_name, \"HEAD\")) {\n \t\t\tbranch_name = \"\";\n \t\t\tbranch_status_color = color(WT_STATUS_NOBRANCH, s);\n-\t\t\ton_what = \"Not currently on any branch.\";\n+\t\t\ton_what = _(\"Not currently on any branch.\");\n \t\t}\n \t\tcolor_fprintf(s->fp, color(WT_STATUS_HEADER, s), \"# \");\n \t\tcolor_fprintf(s->fp, branch_status_color, \"%s\", on_what);\n@@ -665,29 +665,29 @@ void wt_status_print(struct wt_status *s)\n \t\twt_status_print_submodule_summary(s, 1);  /* unstaged */\n \t}\n \tif (s->show_untracked_files) {\n-\t\twt_status_print_other(s, &s->untracked, \"Untracked\", \"add\");\n+\t\twt_status_print_other(s, &s->untracked, _(\"Untracked\"), \"add\");\n \t\tif (s->show_ignored_files)\n-\t\t\twt_status_print_other(s, &s->ignored, \"Ignored\", \"add -f\");\n+\t\t\twt_status_print_other(s, &s->ignored, _(\"Ignored\"), \"add -f\");\n \t} else if (s->commitable)\n-\t\tfprintf(s->fp, \"# Untracked files not listed%s\\n\",\n+\t\tfprintf(s->fp, _(\"# Untracked files not listed%s\\n\"),\n \t\t\tadvice_status_hints\n-\t\t\t? \" (use -u option to show untracked files)\" : \"\");\n+\t\t\t? _(\" (use -u option to show untracked files)\") : \"\");\n \n \tif (s->verbose)\n \t\twt_status_print_verbose(s);\n \tif (!s->commitable) {\n \t\tif (s->amend)\n-\t\t\tfprintf(s->fp, \"# No changes\\n\");\n+\t\t\tfprintf(s->fp, _(\"# No changes\\n\"));\n \t\telse if (s->nowarn)\n \t\t\t; /* nothing */\n \t\telse if (s->workdir_dirty)\n-\t\t\tprintf(\"no changes added to commit%s\\n\",\n+\t\t\tprintf(_(\"no changes added to commit%s\\n\"),\n \t\t\t\tadvice_status_hints\n-\t\t\t\t? \" (use \\\"git add\\\" and/or \\\"git commit -a\\\")\" : \"\");\n+\t\t\t\t? _(\" (use \\\"git add\\\" and/or \\\"git commit -a\\\")\") : \"\");\n \t\telse if (s->untracked.nr)\n-\t\t\tprintf(\"nothing added to commit but untracked files present%s\\n\",\n+\t\t\tprintf(_(\"nothing added to commit but untracked files present%s\\n\"),\n \t\t\t\tadvice_status_hints\n-\t\t\t\t? \" (use \\\"git add\\\" to track)\" : \"\");\n+\t\t\t\t? _(\" (use \\\"git add\\\" to track)\") : \"\");\n \t\telse if (s->is_initial)\n \t\t\tprintf(\"nothing to commit%s\\n\", advice_status_hints\n \t\t\t\t? \" (create/copy files and use \\\"git add\\\" to track)\" : \"\");\n-- \n1.7.2.3\n"},{"id":"161966","messageId":"1298418152-27789-56-git-send-email-avarab@gmail.com","threadId":"26561","inReplyTo":"7vhbbwdjnm.fsf@alter.siamese.dyndns.org","subject":"[PATCH v4 55/73] gettextize: git-status \"nothing to commit\" messages","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2011-02-22T23:42:14Z","receivedAt":"2011-02-22T23:42:14Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"Gettextize the \"nothing to commit\" messages. Many tests explicitly\nchecked for this message. Change them to skip under\nGETTEXT_POISON=YesPlease.\n\nSigned-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n t/t7506-status-submodule.sh |    8 ++++----\n wt-status.c                 |   12 ++++++------\n 2 files changed, 10 insertions(+), 10 deletions(-)\n\ndiff --git a/t/t7506-status-submodule.sh b/t/t7506-status-submodule.sh\nindex fa473a0..c567332 100755\n--- a/t/t7506-status-submodule.sh\n+++ b/t/t7506-status-submodule.sh\n@@ -20,12 +20,12 @@ test_expect_success 'setup' '\n \tgit commit -m \"Add submodule sub\"\n '\n \n-test_expect_success 'status clean' '\n+test_expect_success C_LOCALE_OUTPUT 'status clean' '\n \tgit status >output &&\n \tgrep \"nothing to commit\" output\n '\n \n-test_expect_success 'commit --dry-run -a clean' '\n+test_expect_success C_LOCALE_OUTPUT 'commit --dry-run -a clean' '\n \ttest_must_fail git commit --dry-run -a >output &&\n \tgrep \"nothing to commit\" output\n '\n@@ -177,12 +177,12 @@ test_expect_success 'rm submodule contents' '\n \trm -rf sub/* sub/.git\n '\n \n-test_expect_success 'status clean (empty submodule dir)' '\n+test_expect_success C_LOCALE_OUTPUT 'status clean (empty submodule dir)' '\n \tgit status >output &&\n \tgrep \"nothing to commit\" output\n '\n \n-test_expect_success 'status -a clean (empty submodule dir)' '\n+test_expect_success C_LOCALE_OUTPUT 'status -a clean (empty submodule dir)' '\n \ttest_must_fail git commit --dry-run -a >output &&\n \tgrep \"nothing to commit\" output\n '\ndiff --git a/wt-status.c b/wt-status.c\nindex f369eba..a975d07 100644\n--- a/wt-status.c\n+++ b/wt-status.c\n@@ -689,14 +689,14 @@ void wt_status_print(struct wt_status *s)\n \t\t\t\tadvice_status_hints\n \t\t\t\t? _(\" (use \\\"git add\\\" to track)\") : \"\");\n \t\telse if (s->is_initial)\n-\t\t\tprintf(\"nothing to commit%s\\n\", advice_status_hints\n-\t\t\t\t? \" (create/copy files and use \\\"git add\\\" to track)\" : \"\");\n+\t\t\tprintf(_(\"nothing to commit%s\\n\"), advice_status_hints\n+\t\t\t\t? _(\" (create/copy files and use \\\"git add\\\" to track)\") : \"\");\n \t\telse if (!s->show_untracked_files)\n-\t\t\tprintf(\"nothing to commit%s\\n\", advice_status_hints\n-\t\t\t\t? \" (use -u to show untracked files)\" : \"\");\n+\t\t\tprintf(_(\"nothing to commit%s\\n\"), advice_status_hints\n+\t\t\t\t? _(\" (use -u to show untracked files)\") : \"\");\n \t\telse\n-\t\t\tprintf(\"nothing to commit%s\\n\", advice_status_hints\n-\t\t\t\t? \" (working directory clean)\" : \"\");\n+\t\t\tprintf(_(\"nothing to commit%s\\n\"), advice_status_hints\n+\t\t\t\t? _(\" (working directory clean)\") : \"\");\n \t}\n }\n \n-- \n1.7.2.3\n"},{"id":"161959","messageId":"1298418152-27789-57-git-send-email-avarab@gmail.com","threadId":"26561","inReplyTo":"7vhbbwdjnm.fsf@alter.siamese.dyndns.org","subject":"[PATCH v4 56/73] gettextize: git-status shortstatus messages","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2011-02-22T23:42:15Z","receivedAt":"2011-02-22T23:42:15Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"Make the messages added in v1.7.2-rc0~54^2~1 translatable. Some of\nthese could use the to be implemented plural support in the gettext\nlibrary.\n\nSigned-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n wt-status.c |   12 ++++++------\n 1 files changed, 6 insertions(+), 6 deletions(-)\n\ndiff --git a/wt-status.c b/wt-status.c\nindex a975d07..fc38ac2 100644\n--- a/wt-status.c\n+++ b/wt-status.c\n@@ -804,13 +804,13 @@ static void wt_shortstatus_print_tracking(struct wt_status *s)\n \tif (!prefixcmp(branch_name, \"refs/heads/\"))\n \t\tbranch_name += 11;\n \telse if (!strcmp(branch_name, \"HEAD\")) {\n-\t\tbranch_name = \"HEAD (no branch)\";\n+\t\tbranch_name = _(\"HEAD (no branch)\");\n \t\tbranch_color_local = color(WT_STATUS_NOBRANCH, s);\n \t}\n \n \tbranch = branch_get(s->branch + 11);\n \tif (s->is_initial)\n-\t\tcolor_fprintf(s->fp, header_color, \"Initial commit on \");\n+\t\tcolor_fprintf(s->fp, header_color, _(\"Initial commit on \"));\n \tif (!stat_tracking_info(branch, &num_ours, &num_theirs)) {\n \t\tcolor_fprintf_ln(s->fp, branch_color_local,\n \t\t\t\"%s\", branch_name);\n@@ -825,15 +825,15 @@ static void wt_shortstatus_print_tracking(struct wt_status *s)\n \n \tcolor_fprintf(s->fp, header_color, \" [\");\n \tif (!num_ours) {\n-\t\tcolor_fprintf(s->fp, header_color, \"behind \");\n+\t\tcolor_fprintf(s->fp, header_color, _(\"behind \"));\n \t\tcolor_fprintf(s->fp, branch_color_remote, \"%d\", num_theirs);\n \t} else if (!num_theirs) {\n-\t\tcolor_fprintf(s->fp, header_color, \"ahead \");\n+\t\tcolor_fprintf(s->fp, header_color, _(\"ahead \"));\n \t\tcolor_fprintf(s->fp, branch_color_local, \"%d\", num_ours);\n \t} else {\n-\t\tcolor_fprintf(s->fp, header_color, \"ahead \");\n+\t\tcolor_fprintf(s->fp, header_color, _(\"ahead \"));\n \t\tcolor_fprintf(s->fp, branch_color_local, \"%d\", num_ours);\n-\t\tcolor_fprintf(s->fp, header_color, \", behind \");\n+\t\tcolor_fprintf(s->fp, header_color, _(\", behind \"));\n \t\tcolor_fprintf(s->fp, branch_color_remote, \"%d\", num_theirs);\n \t}\n \n-- \n1.7.2.3\n"},{"id":"161956","messageId":"1298418152-27789-58-git-send-email-avarab@gmail.com","threadId":"26561","inReplyTo":"7vhbbwdjnm.fsf@alter.siamese.dyndns.org","subject":"[PATCH v4 57/73] gettextize: git-status \"Changes to be committed\" message","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2011-02-22T23:42:16Z","receivedAt":"2011-02-22T23:42:16Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"Gettextize the \"# Changes to be committed:\" messages. Several tests\nexplicitly checked for this message. Change them to skip under\nGETTEXT_POISON=YesPlease.\n\nSince these tests didn't check for the rest of the git-status(1)\noutput this change has been split up from the \"git-status basic\nmessages\" patch.\n\nSigned-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n t/t7502-commit.sh |   20 ++++++++++----------\n wt-status.c       |    2 +-\n 2 files changed, 11 insertions(+), 11 deletions(-)\n\ndiff --git a/t/t7502-commit.sh b/t/t7502-commit.sh\nindex 1f29b5c..cfb569e 100755\n--- a/t/t7502-commit.sh\n+++ b/t/t7502-commit.sh\n@@ -384,66 +384,66 @@ try_commit () {\n \n try_commit_status_combo () {\n \n-\ttest_expect_success 'commit' '\n+\ttest_expect_success C_LOCALE_OUTPUT 'commit' '\n \t\tclear_config commit.status &&\n \t\ttry_commit \"\" &&\n \t\tgrep \"^# Changes to be committed:\" .git/COMMIT_EDITMSG\n \t'\n \n-\ttest_expect_success 'commit' '\n+\ttest_expect_success C_LOCALE_OUTPUT 'commit' '\n \t\tclear_config commit.status &&\n \t\ttry_commit \"\" &&\n \t\tgrep \"^# Changes to be committed:\" .git/COMMIT_EDITMSG\n \t'\n \n-\ttest_expect_success 'commit --status' '\n+\ttest_expect_success C_LOCALE_OUTPUT 'commit --status' '\n \t\tclear_config commit.status &&\n \t\ttry_commit --status &&\n \t\tgrep \"^# Changes to be committed:\" .git/COMMIT_EDITMSG\n \t'\n \n-\ttest_expect_success 'commit --no-status' '\n+\ttest_expect_success C_LOCALE_OUTPUT 'commit --no-status' '\n \t\tclear_config commit.status &&\n \t\ttry_commit --no-status &&\n \t\t! grep \"^# Changes to be committed:\" .git/COMMIT_EDITMSG\n \t'\n \n-\ttest_expect_success 'commit with commit.status = yes' '\n+\ttest_expect_success C_LOCALE_OUTPUT 'commit with commit.status = yes' '\n \t\tclear_config commit.status &&\n \t\tgit config commit.status yes &&\n \t\ttry_commit \"\" &&\n \t\tgrep \"^# Changes to be committed:\" .git/COMMIT_EDITMSG\n \t'\n \n-\ttest_expect_success 'commit with commit.status = no' '\n+\ttest_expect_success C_LOCALE_OUTPUT 'commit with commit.status = no' '\n \t\tclear_config commit.status &&\n \t\tgit config commit.status no &&\n \t\ttry_commit \"\" &&\n \t\t! grep \"^# Changes to be committed:\" .git/COMMIT_EDITMSG\n \t'\n \n-\ttest_expect_success 'commit --status with commit.status = yes' '\n+\ttest_expect_success C_LOCALE_OUTPUT 'commit --status with commit.status = yes' '\n \t\tclear_config commit.status &&\n \t\tgit config commit.status yes &&\n \t\ttry_commit --status &&\n \t\tgrep \"^# Changes to be committed:\" .git/COMMIT_EDITMSG\n \t'\n \n-\ttest_expect_success 'commit --no-status with commit.status = yes' '\n+\ttest_expect_success C_LOCALE_OUTPUT 'commit --no-status with commit.status = yes' '\n \t\tclear_config commit.status &&\n \t\tgit config commit.status yes &&\n \t\ttry_commit --no-status &&\n \t\t! grep \"^# Changes to be committed:\" .git/COMMIT_EDITMSG\n \t'\n \n-\ttest_expect_success 'commit --status with commit.status = no' '\n+\ttest_expect_success C_LOCALE_OUTPUT 'commit --status with commit.status = no' '\n \t\tclear_config commit.status &&\n \t\tgit config commit.status no &&\n \t\ttry_commit --status &&\n \t\tgrep \"^# Changes to be committed:\" .git/COMMIT_EDITMSG\n \t'\n \n-\ttest_expect_success 'commit --no-status with commit.status = no' '\n+\ttest_expect_success C_LOCALE_OUTPUT 'commit --no-status with commit.status = no' '\n \t\tclear_config commit.status &&\n \t\tgit config commit.status no &&\n \t\ttry_commit --no-status &&\ndiff --git a/wt-status.c b/wt-status.c\nindex fc38ac2..c6295f9 100644\n--- a/wt-status.c\n+++ b/wt-status.c\n@@ -74,7 +74,7 @@ static void wt_status_print_cached_header(struct wt_status *s)\n {\n \tconst char *c = color(WT_STATUS_HEADER, s);\n \n-\tcolor_fprintf_ln(s->fp, c, \"# Changes to be committed:\");\n+\tcolor_fprintf_ln(s->fp, c, _(\"# Changes to be committed:\"));\n \tif (!advice_status_hints)\n \t\treturn;\n \tif (s->in_merge)\n-- \n1.7.2.3\n"},{"id":"161951","messageId":"1298418152-27789-59-git-send-email-avarab@gmail.com","threadId":"26561","inReplyTo":"7vhbbwdjnm.fsf@alter.siamese.dyndns.org","subject":"[PATCH v4 58/73] gettextize: git-status \"Initial commit\" message","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2011-02-22T23:42:17Z","receivedAt":"2011-02-22T23:42:17Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"Gettextize the \"# Initial commit\" message. A test in t7501-commit.sh\nexplicitly checked for this message. Change it to skip under\nGETTEXT_POISON=YesPlease.\n\nSigned-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n t/t7501-commit.sh |    7 +++++--\n wt-status.c       |    2 +-\n 2 files changed, 6 insertions(+), 3 deletions(-)\n\ndiff --git a/t/t7501-commit.sh b/t/t7501-commit.sh\nindex 8980738..a76c474 100755\n--- a/t/t7501-commit.sh\n+++ b/t/t7501-commit.sh\n@@ -14,8 +14,11 @@ test_tick\n test_expect_success \\\n \t\"initial status\" \\\n \t\"echo 'bongo bongo' >file &&\n-\t git add file && \\\n-\t git status | grep 'Initial commit'\"\n+\t git add file\"\n+\n+test_expect_success C_LOCALE_OUTPUT \\\n+\t\"Constructing initial commit\" \\\n+\t\"git status | grep 'Initial commit'\"\n \n test_expect_success \\\n \t\"fail initial amend\" \\\ndiff --git a/wt-status.c b/wt-status.c\nindex c6295f9..ad6ef7a 100644\n--- a/wt-status.c\n+++ b/wt-status.c\n@@ -651,7 +651,7 @@ void wt_status_print(struct wt_status *s)\n \n \tif (s->is_initial) {\n \t\tcolor_fprintf_ln(s->fp, color(WT_STATUS_HEADER, s), \"#\");\n-\t\tcolor_fprintf_ln(s->fp, color(WT_STATUS_HEADER, s), \"# Initial commit\");\n+\t\tcolor_fprintf_ln(s->fp, color(WT_STATUS_HEADER, s), _(\"# Initial commit\"));\n \t\tcolor_fprintf_ln(s->fp, color(WT_STATUS_HEADER, s), \"#\");\n \t}\n \n-- \n1.7.2.3\n"},{"id":"161937","messageId":"1298418152-27789-60-git-send-email-avarab@gmail.com","threadId":"26561","inReplyTo":"7vhbbwdjnm.fsf@alter.siamese.dyndns.org","subject":"[PATCH v4 59/73] gettextize: git-status \"renamed: \" message","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2011-02-22T23:42:18Z","receivedAt":"2011-02-22T23:42:18Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"Gettextize the \"renamed: %s -> %s\" message which appears as part of\ngit-status(1) output. Two tests in t4001-diff-rename.sh explicitly\nchecked for this message. Change them to skip under\nGETTEXT_POISON=YesPlease.\n\nSigned-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n t/t4001-diff-rename.sh |    4 ++--\n wt-status.c            |    2 +-\n 2 files changed, 3 insertions(+), 3 deletions(-)\n\ndiff --git a/t/t4001-diff-rename.sh b/t/t4001-diff-rename.sh\nindex 71bac83..cad8545 100755\n--- a/t/t4001-diff-rename.sh\n+++ b/t/t4001-diff-rename.sh\n@@ -64,7 +64,7 @@ test_expect_success \\\n     'validate the output.' \\\n     'compare_diff_patch current expected'\n \n-test_expect_success 'favour same basenames over different ones' '\n+test_expect_success C_LOCALE_OUTPUT 'favour same basenames over different ones' '\n \tcp path1 another-path &&\n \tgit add another-path &&\n \tgit commit -m 1 &&\n@@ -73,7 +73,7 @@ test_expect_success 'favour same basenames over different ones' '\n \tgit mv another-path subdir/path1 &&\n \tgit status | grep \"renamed: .*path1 -> subdir/path1\"'\n \n-test_expect_success  'favour same basenames even with minor differences' '\n+test_expect_success C_LOCALE_OUTPUT  'favour same basenames even with minor differences' '\n \tgit show HEAD:path1 | sed \"s/15/16/\" > subdir/path1 &&\n \tgit status | grep \"renamed: .*path1 -> subdir/path1\"'\n \ndiff --git a/wt-status.c b/wt-status.c\nindex ad6ef7a..ed6bedd 100644\n--- a/wt-status.c\n+++ b/wt-status.c\n@@ -201,7 +201,7 @@ static void wt_status_print_change_data(struct wt_status *s,\n \t\tcolor_fprintf(s->fp, c, _(\"modified:   %s\"), one);\n \t\tbreak;\n \tcase DIFF_STATUS_RENAMED:\n-\t\tcolor_fprintf(s->fp, c, \"renamed:    %s -> %s\", one, two);\n+\t\tcolor_fprintf(s->fp, c, _(\"renamed:    %s -> %s\"), one, two);\n \t\tbreak;\n \tcase DIFF_STATUS_TYPE_CHANGED:\n \t\tcolor_fprintf(s->fp, c, _(\"typechange: %s\"), one);\n-- \n1.7.2.3\n"},{"id":"161941","messageId":"1298418152-27789-61-git-send-email-avarab@gmail.com","threadId":"26561","inReplyTo":"7vhbbwdjnm.fsf@alter.siamese.dyndns.org","subject":"[PATCH v4 60/73] gettextize: git-archive basic messages","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2011-02-22T23:42:19Z","receivedAt":"2011-02-22T23:42:19Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n builtin/archive.c |   14 +++++++-------\n 1 files changed, 7 insertions(+), 7 deletions(-)\n\ndiff --git a/builtin/archive.c b/builtin/archive.c\nindex 6a887f5..b14eaba 100644\n--- a/builtin/archive.c\n+++ b/builtin/archive.c\n@@ -14,10 +14,10 @@ static void create_output_file(const char *output_file)\n {\n \tint output_fd = open(output_file, O_CREAT | O_WRONLY | O_TRUNC, 0666);\n \tif (output_fd < 0)\n-\t\tdie_errno(\"could not create archive file '%s'\", output_file);\n+\t\tdie_errno(_(\"could not create archive file '%s'\"), output_file);\n \tif (output_fd != 1) {\n \t\tif (dup2(output_fd, 1) < 0)\n-\t\t\tdie_errno(\"could not redirect output\");\n+\t\t\tdie_errno(_(\"could not redirect output\"));\n \t\telse\n \t\t\tclose(output_fd);\n \t}\n@@ -33,7 +33,7 @@ static int run_remote_archiver(int argc, const char **argv,\n \n \t_remote = remote_get(remote);\n \tif (!_remote->url[0])\n-\t\tdie(\"git archive: Remote with no URL\");\n+\t\tdie(_(\"git archive: Remote with no URL\"));\n \ttransport = transport_get(_remote, _remote->url[0]);\n \ttransport_connect(transport, \"git-upload-archive\", exec, fd);\n \n@@ -43,18 +43,18 @@ static int run_remote_archiver(int argc, const char **argv,\n \n \tlen = packet_read_line(fd[0], buf, sizeof(buf));\n \tif (!len)\n-\t\tdie(\"git archive: expected ACK/NAK, got EOF\");\n+\t\tdie(_(\"git archive: expected ACK/NAK, got EOF\"));\n \tif (buf[len-1] == '\\n')\n \t\tbuf[--len] = 0;\n \tif (strcmp(buf, \"ACK\")) {\n \t\tif (len > 5 && !prefixcmp(buf, \"NACK \"))\n-\t\t\tdie(\"git archive: NACK %s\", buf + 5);\n-\t\tdie(\"git archive: protocol error\");\n+\t\t\tdie(_(\"git archive: NACK %s\"), buf + 5);\n+\t\tdie(_(\"git archive: protocol error\"));\n \t}\n \n \tlen = packet_read_line(fd[0], buf, sizeof(buf));\n \tif (len)\n-\t\tdie(\"git archive: expected a flush\");\n+\t\tdie(_(\"git archive: expected a flush\"));\n \n \t/* Now, start reading from fd[0] and spit it out to stdout */\n \trv = recv_sideband(\"archive\", fd[0], 1);\n-- \n1.7.2.3\n"},{"id":"161945","messageId":"1298418152-27789-62-git-send-email-avarab@gmail.com","threadId":"26561","inReplyTo":"7vhbbwdjnm.fsf@alter.siamese.dyndns.org","subject":"[PATCH v4 61/73] gettextize: git-bundle basic messages","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2011-02-22T23:42:20Z","receivedAt":"2011-02-22T23:42:20Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n builtin/bundle.c |    6 +++---\n 1 files changed, 3 insertions(+), 3 deletions(-)\n\ndiff --git a/builtin/bundle.c b/builtin/bundle.c\nindex 9b87fb9..81046a9 100644\n--- a/builtin/bundle.c\n+++ b/builtin/bundle.c\n@@ -44,7 +44,7 @@ int cmd_bundle(int argc, const char **argv, const char *prefix)\n \t\tclose(bundle_fd);\n \t\tif (verify_bundle(&header, 1))\n \t\t\treturn 1;\n-\t\tfprintf(stderr, \"%s is okay\\n\", bundle_file);\n+\t\tfprintf(stderr, _(\"%s is okay\\n\"), bundle_file);\n \t\treturn 0;\n \t}\n \tif (!strcmp(cmd, \"list-heads\")) {\n@@ -53,11 +53,11 @@ int cmd_bundle(int argc, const char **argv, const char *prefix)\n \t}\n \tif (!strcmp(cmd, \"create\")) {\n \t\tif (!startup_info->have_repository)\n-\t\t\tdie(\"Need a repository to create a bundle.\");\n+\t\t\tdie(_(\"Need a repository to create a bundle.\"));\n \t\treturn !!create_bundle(&header, bundle_file, argc, argv);\n \t} else if (!strcmp(cmd, \"unbundle\")) {\n \t\tif (!startup_info->have_repository)\n-\t\t\tdie(\"Need a repository to unbundle.\");\n+\t\t\tdie(_(\"Need a repository to unbundle.\"));\n \t\treturn !!unbundle(&header, bundle_fd) ||\n \t\t\tlist_bundle_refs(&header, argc, argv);\n \t} else\n-- \n1.7.2.3\n"},{"id":"161944","messageId":"1298418152-27789-63-git-send-email-avarab@gmail.com","threadId":"26561","inReplyTo":"7vhbbwdjnm.fsf@alter.siamese.dyndns.org","subject":"[PATCH v4 62/73] gettextize: git-clean basic messages","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2011-02-22T23:42:21Z","receivedAt":"2011-02-22T23:42:21Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n builtin/clean.c                  |   20 ++++++++++----------\n t/t7012-skip-worktree-writing.sh |    4 ++--\n t/t7300-clean.sh                 |    6 +++---\n 3 files changed, 15 insertions(+), 15 deletions(-)\n\ndiff --git a/builtin/clean.c b/builtin/clean.c\nindex 4a312ab..2d0054b 100644\n--- a/builtin/clean.c\n+++ b/builtin/clean.c\n@@ -75,7 +75,7 @@ int cmd_clean(int argc, const char **argv, const char *prefix)\n \t\tdir.flags |= DIR_SHOW_IGNORED;\n \n \tif (ignored && ignored_only)\n-\t\tdie(\"-x and -X cannot be used together\");\n+\t\tdie(_(\"-x and -X cannot be used together\"));\n \n \tif (!show_only && !force)\n \t\tdie(\"clean.requireForce %s to true and neither -n nor -f given; \"\n@@ -87,7 +87,7 @@ int cmd_clean(int argc, const char **argv, const char *prefix)\n \tdir.flags |= DIR_SHOW_OTHER_DIRECTORIES;\n \n \tif (read_cache() < 0)\n-\t\tdie(\"index file corrupt\");\n+\t\tdie(_(\"index file corrupt\"));\n \n \tif (!ignored)\n \t\tsetup_standard_excludes(&dir);\n@@ -146,20 +146,20 @@ int cmd_clean(int argc, const char **argv, const char *prefix)\n \t\t\tqname = quote_path_relative(directory.buf, directory.len, &buf, prefix);\n \t\t\tif (show_only && (remove_directories ||\n \t\t\t    (matches == MATCHED_EXACTLY))) {\n-\t\t\t\tprintf(\"Would remove %s\\n\", qname);\n+\t\t\t\tprintf(_(\"Would remove %s\\n\"), qname);\n \t\t\t} else if (remove_directories ||\n \t\t\t\t   (matches == MATCHED_EXACTLY)) {\n \t\t\t\tif (!quiet)\n-\t\t\t\t\tprintf(\"Removing %s\\n\", qname);\n+\t\t\t\t\tprintf(_(\"Removing %s\\n\"), qname);\n \t\t\t\tif (remove_dir_recursively(&directory,\n \t\t\t\t\t\t\t   rm_flags) != 0) {\n-\t\t\t\t\twarning(\"failed to remove %s\", qname);\n+\t\t\t\t\twarning(_(\"failed to remove %s\"), qname);\n \t\t\t\t\terrors++;\n \t\t\t\t}\n \t\t\t} else if (show_only) {\n-\t\t\t\tprintf(\"Would not remove %s\\n\", qname);\n+\t\t\t\tprintf(_(\"Would not remove %s\\n\"), qname);\n \t\t\t} else {\n-\t\t\t\tprintf(\"Not removing %s\\n\", qname);\n+\t\t\t\tprintf(_(\"Not removing %s\\n\"), qname);\n \t\t\t}\n \t\t\tstrbuf_reset(&directory);\n \t\t} else {\n@@ -167,13 +167,13 @@ int cmd_clean(int argc, const char **argv, const char *prefix)\n \t\t\t\tcontinue;\n \t\t\tqname = quote_path_relative(ent->name, -1, &buf, prefix);\n \t\t\tif (show_only) {\n-\t\t\t\tprintf(\"Would remove %s\\n\", qname);\n+\t\t\t\tprintf(_(\"Would remove %s\\n\"), qname);\n \t\t\t\tcontinue;\n \t\t\t} else if (!quiet) {\n-\t\t\t\tprintf(\"Removing %s\\n\", qname);\n+\t\t\t\tprintf(_(\"Removing %s\\n\"), qname);\n \t\t\t}\n \t\t\tif (unlink(ent->name) != 0) {\n-\t\t\t\twarning(\"failed to remove %s\", qname);\n+\t\t\t\twarning(_(\"failed to remove %s\"), qname);\n \t\t\t\terrors++;\n \t\t\t}\n \t\t}\ndiff --git a/t/t7012-skip-worktree-writing.sh b/t/t7012-skip-worktree-writing.sh\nindex 582d0b5..14fcb1c 100755\n--- a/t/t7012-skip-worktree-writing.sh\n+++ b/t/t7012-skip-worktree-writing.sh\n@@ -124,13 +124,13 @@ cat >expected <<EOF\n Would remove expected\n Would remove result\n EOF\n-test_expect_success 'git-clean, absent case' '\n+test_expect_success C_LOCALE_OUTPUT 'git-clean, absent case' '\n \tsetup_absent &&\n \tgit clean -n > result &&\n \ttest_cmp expected result\n '\n \n-test_expect_success 'git-clean, dirty case' '\n+test_expect_success C_LOCALE_OUTPUT 'git-clean, dirty case' '\n \tsetup_dirty &&\n \tgit clean -n > result &&\n \ttest_cmp expected result\ndiff --git a/t/t7300-clean.sh b/t/t7300-clean.sh\nindex 02f67b7..7e1be44 100755\n--- a/t/t7300-clean.sh\n+++ b/t/t7300-clean.sh\n@@ -110,7 +110,7 @@ test_expect_success 'git clean with prefix' '\n \n '\n \n-test_expect_success 'git clean with relative prefix' '\n+test_expect_success C_LOCALE_OUTPUT 'git clean with relative prefix' '\n \n \tmkdir -p build docs &&\n \ttouch a.out src/part3.c docs/manual.txt obj.o build/lib.so &&\n@@ -125,7 +125,7 @@ test_expect_success 'git clean with relative prefix' '\n \t}\n '\n \n-test_expect_success 'git clean with absolute path' '\n+test_expect_success C_LOCALE_OUTPUT 'git clean with absolute path' '\n \n \tmkdir -p build docs &&\n \ttouch a.out src/part3.c docs/manual.txt obj.o build/lib.so &&\n@@ -377,7 +377,7 @@ test_expect_success 'clean.requireForce and -f' '\n \n '\n \n-test_expect_success 'core.excludesfile' '\n+test_expect_success C_LOCALE_OUTPUT 'core.excludesfile' '\n \n \techo excludes >excludes &&\n \techo included >included &&\n-- \n1.7.2.3\n"},{"id":"161942","messageId":"1298418152-27789-64-git-send-email-avarab@gmail.com","threadId":"26561","inReplyTo":"7vhbbwdjnm.fsf@alter.siamese.dyndns.org","subject":"[PATCH v4 63/73] gettextize: git-clean clean.requireForce messages","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2011-02-22T23:42:22Z","receivedAt":"2011-02-22T23:42:22Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"Split up the \"clean.requireForce set/defaults to true...\" die()\nmessage to make it easier to translate.\n\nSigned-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n builtin/clean.c |   11 ++++++++---\n 1 files changed, 8 insertions(+), 3 deletions(-)\n\ndiff --git a/builtin/clean.c b/builtin/clean.c\nindex 2d0054b..75697f7 100644\n--- a/builtin/clean.c\n+++ b/builtin/clean.c\n@@ -77,9 +77,14 @@ int cmd_clean(int argc, const char **argv, const char *prefix)\n \tif (ignored && ignored_only)\n \t\tdie(_(\"-x and -X cannot be used together\"));\n \n-\tif (!show_only && !force)\n-\t\tdie(\"clean.requireForce %s to true and neither -n nor -f given; \"\n-\t\t    \"refusing to clean\", config_set ? \"set\" : \"defaults\");\n+\tif (!show_only && !force) {\n+\t\tif (config_set)\n+\t\t\tdie(_(\"clean.requireForce set to true and neither -n nor -f given; \"\n+\t\t\t\t  \"refusing to clean\"));\n+\t\telse\n+\t\t\tdie(_(\"clean.requireForce defaults to true and neither -n nor -f given; \"\n+\t\t\t\t  \"refusing to clean\"));\n+\t}\n \n \tif (force > 1)\n \t\trm_flags = 0;\n-- \n1.7.2.3\n"},{"id":"161996","messageId":"1298418152-27789-65-git-send-email-avarab@gmail.com","threadId":"26561","inReplyTo":"7vhbbwdjnm.fsf@alter.siamese.dyndns.org","subject":"[PATCH v4 64/73] gettextize: git-describe basic messages","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2011-02-22T23:42:23Z","receivedAt":"2011-02-22T23:42:23Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n builtin/describe.c  |   36 ++++++++++++++++++------------------\n t/t6120-describe.sh |    2 +-\n 2 files changed, 19 insertions(+), 19 deletions(-)\n\ndiff --git a/builtin/describe.c b/builtin/describe.c\nindex 342129f..037691e 100644\n--- a/builtin/describe.c\n+++ b/builtin/describe.c\n@@ -231,13 +231,13 @@ static void display_name(struct commit_name *n)\n \tif (n->prio == 2 && !n->tag) {\n \t\tn->tag = lookup_tag(n->sha1);\n \t\tif (!n->tag || parse_tag(n->tag))\n-\t\t\tdie(\"annotated tag %s not available\", n->path);\n+\t\t\tdie(_(\"annotated tag %s not available\"), n->path);\n \t}\n \tif (n->tag && !n->name_checked) {\n \t\tif (!n->tag->tag)\n-\t\t\tdie(\"annotated tag %s has no embedded name\", n->path);\n+\t\t\tdie(_(\"annotated tag %s has no embedded name\"), n->path);\n \t\tif (strcmp(n->tag->tag, all ? n->path + 5 : n->path))\n-\t\t\twarning(\"tag '%s' is really '%s' here\", n->tag->tag, n->path);\n+\t\t\twarning(_(\"tag '%s' is really '%s' here\"), n->tag->tag, n->path);\n \t\tn->name_checked = 1;\n \t}\n \n@@ -264,10 +264,10 @@ static void describe(const char *arg, int last_one)\n \tunsigned int unannotated_cnt = 0;\n \n \tif (get_sha1(arg, sha1))\n-\t\tdie(\"Not a valid object name %s\", arg);\n+\t\tdie(_(\"Not a valid object name %s\"), arg);\n \tcmit = lookup_commit_reference(sha1);\n \tif (!cmit)\n-\t\tdie(\"%s is not a valid '%s' object\", arg, commit_type);\n+\t\tdie(_(\"%s is not a valid '%s' object\"), arg, commit_type);\n \n \tn = find_commit_name(cmit->object.sha1);\n \tif (n && (tags || all || n->prio == 2)) {\n@@ -284,9 +284,9 @@ static void describe(const char *arg, int last_one)\n \t}\n \n \tif (!max_candidates)\n-\t\tdie(\"no tag exactly matches '%s'\", sha1_to_hex(cmit->object.sha1));\n+\t\tdie(_(\"no tag exactly matches '%s'\"), sha1_to_hex(cmit->object.sha1));\n \tif (debug)\n-\t\tfprintf(stderr, \"searching to describe %s\\n\", arg);\n+\t\tfprintf(stderr, _(\"searching to describe %s\\n\"), arg);\n \n \tif (!have_util) {\n \t\tfor_each_hash(&names, set_util);\n@@ -326,7 +326,7 @@ static void describe(const char *arg, int last_one)\n \t\t}\n \t\tif (annotated_cnt && !list) {\n \t\t\tif (debug)\n-\t\t\t\tfprintf(stderr, \"finished search at %s\\n\",\n+\t\t\t\tfprintf(stderr, _(\"finished search at %s\\n\"),\n \t\t\t\t\tsha1_to_hex(c->object.sha1));\n \t\t\tbreak;\n \t\t}\n@@ -350,12 +350,12 @@ static void describe(const char *arg, int last_one)\n \t\t\treturn;\n \t\t}\n \t\tif (unannotated_cnt)\n-\t\t\tdie(\"No annotated tags can describe '%s'.\\n\"\n-\t\t\t    \"However, there were unannotated tags: try --tags.\",\n+\t\t\tdie(_(\"No annotated tags can describe '%s'.\\n\"\n+\t\t\t    \"However, there were unannotated tags: try --tags.\"),\n \t\t\t    sha1_to_hex(sha1));\n \t\telse\n-\t\t\tdie(\"No tags can describe '%s'.\\n\"\n-\t\t\t    \"Try --always, or create some tags.\",\n+\t\t\tdie(_(\"No tags can describe '%s'.\\n\"\n+\t\t\t    \"Try --always, or create some tags.\"),\n \t\t\t    sha1_to_hex(sha1));\n \t}\n \n@@ -375,11 +375,11 @@ static void describe(const char *arg, int last_one)\n \t\t\t\tprio_names[t->name->prio],\n \t\t\t\tt->depth, t->name->path);\n \t\t}\n-\t\tfprintf(stderr, \"traversed %lu commits\\n\", seen_commits);\n+\t\tfprintf(stderr, _(\"traversed %lu commits\\n\"), seen_commits);\n \t\tif (gave_up_on) {\n \t\t\tfprintf(stderr,\n-\t\t\t\t\"more than %i tags found; listed %i most recent\\n\"\n-\t\t\t\t\"gave up search at %s\\n\",\n+\t\t\t\t_(\"more than %i tags found; listed %i most recent\\n\"\n+\t\t\t\t\"gave up search at %s\\n\"),\n \t\t\t\tmax_candidates, max_candidates,\n \t\t\t\tsha1_to_hex(gave_up_on->object.sha1));\n \t\t}\n@@ -429,7 +429,7 @@ int cmd_describe(int argc, const char **argv, const char *prefix)\n \tsave_commit_buffer = 0;\n \n \tif (longformat && abbrev == 0)\n-\t\tdie(\"--long is incompatible with --abbrev=0\");\n+\t\tdie(_(\"--long is incompatible with --abbrev=0\"));\n \n \tif (contains) {\n \t\tconst char **args = xmalloc((7 + argc) * sizeof(char *));\n@@ -455,14 +455,14 @@ int cmd_describe(int argc, const char **argv, const char *prefix)\n \tinit_hash(&names);\n \tfor_each_rawref(get_name, NULL);\n \tif (!names.nr && !always)\n-\t\tdie(\"No names found, cannot describe anything.\");\n+\t\tdie(_(\"No names found, cannot describe anything.\"));\n \n \tif (argc == 0) {\n \t\tif (dirty && !cmd_diff_index(ARRAY_SIZE(diff_index_args) - 1, diff_index_args, prefix))\n \t\t\tdirty = NULL;\n \t\tdescribe(\"HEAD\", 1);\n \t} else if (dirty) {\n-\t\tdie(\"--dirty is incompatible with committishes\");\n+\t\tdie(_(\"--dirty is incompatible with committishes\"));\n \t} else {\n \t\twhile (argc-- > 0) {\n \t\t\tdescribe(*argv++, argc == 0);\ndiff --git a/t/t6120-describe.sh b/t/t6120-describe.sh\nindex 876d1ab..1826996 100755\n--- a/t/t6120-describe.sh\n+++ b/t/t6120-describe.sh\n@@ -123,7 +123,7 @@ cat - >err.expect <<EOF\n warning: tag 'A' is really 'Q' here\n EOF\n check_describe A-* HEAD\n-test_expect_success 'warning was displayed for Q' '\n+test_expect_success C_LOCALE_OUTPUT 'warning was displayed for Q' '\n \ttest_cmp err.expect err.actual\n '\n test_expect_success 'rename tag Q back to A' '\n-- \n1.7.2.3\n"},{"id":"161946","messageId":"1298418152-27789-66-git-send-email-avarab@gmail.com","threadId":"26561","inReplyTo":"7vhbbwdjnm.fsf@alter.siamese.dyndns.org","subject":"[PATCH v4 65/73] gettextize: git-gc basic messages","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2011-02-22T23:42:24Z","receivedAt":"2011-02-22T23:42:24Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n builtin/gc.c |   10 +++++-----\n 1 files changed, 5 insertions(+), 5 deletions(-)\n\ndiff --git a/builtin/gc.c b/builtin/gc.c\nindex 1a80702..a2be62a 100644\n--- a/builtin/gc.c\n+++ b/builtin/gc.c\n@@ -60,7 +60,7 @@ static int gc_config(const char *var, const char *value, void *cb)\n \t\tif (value && strcmp(value, \"now\")) {\n \t\t\tunsigned long now = approxidate(\"now\");\n \t\t\tif (approxidate(value) >= now)\n-\t\t\t\treturn error(\"Invalid %s: '%s'\", var, value);\n+\t\t\t\treturn error(_(\"Invalid %s: '%s'\"), var, value);\n \t\t}\n \t\treturn git_config_string(&prune_expire, var, value);\n \t}\n@@ -75,7 +75,7 @@ static void append_option(const char **cmd, const char *opt, int max_length)\n \t\t;\n \n \tif (i + 2 >= max_length)\n-\t\tdie(\"Too many options specified\");\n+\t\tdie(_(\"Too many options specified\"));\n \tcmd[i++] = opt;\n \tcmd[i] = NULL;\n }\n@@ -100,7 +100,7 @@ static int too_many_loose_objects(void)\n \t\treturn 0;\n \n \tif (sizeof(path) <= snprintf(path, sizeof(path), \"%s/17\", objdir)) {\n-\t\twarning(\"insanely long object directory %.*s\", 50, objdir);\n+\t\twarning(_(\"insanely long object directory %.*s\"), 50, objdir);\n \t\treturn 0;\n \t}\n \tdir = opendir(path);\n@@ -251,8 +251,8 @@ int cmd_gc(int argc, const char **argv, const char *prefix)\n \t\treturn error(FAILED_RUN, argv_rerere[0]);\n \n \tif (auto_gc && too_many_loose_objects())\n-\t\twarning(\"There are too many unreachable loose objects; \"\n-\t\t\t\"run 'git prune' to remove them.\");\n+\t\twarning(_(\"There are too many unreachable loose objects; \"\n+\t\t\t\"run 'git prune' to remove them.\"));\n \n \treturn 0;\n }\n-- \n1.7.2.3\n"},{"id":"161955","messageId":"1298418152-27789-67-git-send-email-avarab@gmail.com","threadId":"26561","inReplyTo":"7vhbbwdjnm.fsf@alter.siamese.dyndns.org","subject":"[PATCH v4 66/73] gettextize: git-gc \"Auto packing the repository\" message","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2011-02-22T23:42:25Z","receivedAt":"2011-02-22T23:42:25Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"Split up the \"Auto packing the repository\" message into quiet and\nverbose variants to make translation easier.\n\nSigned-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n builtin/gc.c |   14 +++++++-------\n 1 files changed, 7 insertions(+), 7 deletions(-)\n\ndiff --git a/builtin/gc.c b/builtin/gc.c\nindex a2be62a..ff5f73b 100644\n--- a/builtin/gc.c\n+++ b/builtin/gc.c\n@@ -219,13 +219,13 @@ int cmd_gc(int argc, const char **argv, const char *prefix)\n \t\t */\n \t\tif (!need_to_gc())\n \t\t\treturn 0;\n-\t\tfprintf(stderr,\n-\t\t\t\"Auto packing the repository for optimum performance.%s\\n\",\n-\t\t\tquiet\n-\t\t\t? \"\"\n-\t\t\t: (\" You may also\\n\"\n-\t\t\t   \"run \\\"git gc\\\" manually. See \"\n-\t\t\t   \"\\\"git help gc\\\" for more information.\"));\n+\t\tif (quiet)\n+\t\t\tfprintf(stderr, _(\"Auto packing the repository for optimum performance.\\n\"));\n+\t\telse\n+\t\t\tfprintf(stderr,\n+\t\t\t\t\t_(\"Auto packing the repository for optimum performance. You may also\\n\"\n+\t\t\t\t\t\"run \\\"git gc\\\" manually. See \"\n+\t\t\t\t\t\"\\\"git help gc\\\" for more information.\"));\n \t} else\n \t\tappend_option(argv_repack,\n \t\t\t      prune_expire && !strcmp(prune_expire, \"now\")\n-- \n1.7.2.3\n"},{"id":"161950","messageId":"1298418152-27789-68-git-send-email-avarab@gmail.com","threadId":"26561","inReplyTo":"7vhbbwdjnm.fsf@alter.siamese.dyndns.org","subject":"[PATCH v4 67/73] gettextize: git-notes basic commands","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2011-02-22T23:42:26Z","receivedAt":"2011-02-22T23:42:26Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n builtin/notes.c |  106 +++++++++++++++++++++++++++---------------------------\n 1 files changed, 53 insertions(+), 53 deletions(-)\n\ndiff --git a/builtin/notes.c b/builtin/notes.c\nindex 4d5556e..4c6cf85 100644\n--- a/builtin/notes.c\n+++ b/builtin/notes.c\n@@ -146,13 +146,13 @@ static void write_commented_object(int fd, const unsigned char *object)\n \tshow.err = 0;\n \tshow.git_cmd = 1;\n \tif (start_command(&show))\n-\t\tdie(\"unable to start 'show' for object '%s'\",\n+\t\tdie(_(\"unable to start 'show' for object '%s'\"),\n \t\t    sha1_to_hex(object));\n \n \t/* Open the output as FILE* so strbuf_getline() can be used. */\n \tshow_out = xfdopen(show.out, \"r\");\n \tif (show_out == NULL)\n-\t\tdie_errno(\"can't fdopen 'show' output fd\");\n+\t\tdie_errno(_(\"can't fdopen 'show' output fd\"));\n \n \t/* Prepend \"# \" to each output line and write result to 'fd' */\n \twhile (strbuf_getline(&buf, show_out, '\\n') != EOF) {\n@@ -162,10 +162,10 @@ static void write_commented_object(int fd, const unsigned char *object)\n \t}\n \tstrbuf_release(&buf);\n \tif (fclose(show_out))\n-\t\tdie_errno(\"failed to close pipe to 'show' for object '%s'\",\n+\t\tdie_errno(_(\"failed to close pipe to 'show' for object '%s'\"),\n \t\t\t  sha1_to_hex(object));\n \tif (finish_command(&show))\n-\t\tdie(\"failed to finish 'show' for object '%s'\",\n+\t\tdie(_(\"failed to finish 'show' for object '%s'\"),\n \t\t    sha1_to_hex(object));\n }\n \n@@ -182,7 +182,7 @@ static void create_note(const unsigned char *object, struct msg_arg *msg,\n \t\tpath = git_pathdup(\"NOTES_EDITMSG\");\n \t\tfd = open(path, O_CREAT | O_TRUNC | O_WRONLY, 0600);\n \t\tif (fd < 0)\n-\t\t\tdie_errno(\"could not create file '%s'\", path);\n+\t\t\tdie_errno(_(\"could not create file '%s'\"), path);\n \n \t\tif (msg->given)\n \t\t\twrite_or_die(fd, msg->buf.buf, msg->buf.len);\n@@ -196,8 +196,8 @@ static void create_note(const unsigned char *object, struct msg_arg *msg,\n \t\tstrbuf_reset(&(msg->buf));\n \n \t\tif (launch_editor(path, &(msg->buf), NULL)) {\n-\t\t\tdie(\"Please supply the note contents using either -m\" \\\n-\t\t\t    \" or -F option\");\n+\t\t\tdie(_(\"Please supply the note contents using either -m\" \\\n+\t\t\t    \" or -F option\"));\n \t\t}\n \t\tstripspace(&(msg->buf), 1);\n \t}\n@@ -217,14 +217,14 @@ static void create_note(const unsigned char *object, struct msg_arg *msg,\n \t}\n \n \tif (!msg->buf.len) {\n-\t\tfprintf(stderr, \"Removing note for object %s\\n\",\n+\t\tfprintf(stderr, _(\"Removing note for object %s\\n\"),\n \t\t\tsha1_to_hex(object));\n \t\thashclr(result);\n \t} else {\n \t\tif (write_sha1_file(msg->buf.buf, msg->buf.len, blob_type, result)) {\n-\t\t\terror(\"unable to write note object\");\n+\t\t\terror(_(\"unable to write note object\"));\n \t\t\tif (path)\n-\t\t\t\terror(\"The note contents has been left in %s\",\n+\t\t\t\terror(_(\"The note contents has been left in %s\"),\n \t\t\t\t      path);\n \t\t\texit(128);\n \t\t}\n@@ -258,9 +258,9 @@ static int parse_file_arg(const struct option *opt, const char *arg, int unset)\n \t\tstrbuf_addch(&(msg->buf), '\\n');\n \tif (!strcmp(arg, \"-\")) {\n \t\tif (strbuf_read(&(msg->buf), 0, 1024) < 0)\n-\t\t\tdie_errno(\"cannot read '%s'\", arg);\n+\t\t\tdie_errno(_(\"cannot read '%s'\"), arg);\n \t} else if (strbuf_read_file(&(msg->buf), arg, 1024) < 0)\n-\t\tdie_errno(\"could not open or read '%s'\", arg);\n+\t\tdie_errno(_(\"could not open or read '%s'\"), arg);\n \tstripspace(&(msg->buf), 0);\n \n \tmsg->given = 1;\n@@ -279,10 +279,10 @@ static int parse_reuse_arg(const struct option *opt, const char *arg, int unset)\n \t\tstrbuf_addch(&(msg->buf), '\\n');\n \n \tif (get_sha1(arg, object))\n-\t\tdie(\"Failed to resolve '%s' as a valid ref.\", arg);\n+\t\tdie(_(\"Failed to resolve '%s' as a valid ref.\"), arg);\n \tif (!(buf = read_sha1_file(object, &type, &len)) || !len) {\n \t\tfree(buf);\n-\t\tdie(\"Failed to read object '%s'.\", arg);;\n+\t\tdie(_(\"Failed to read object '%s'.\"), arg);;\n \t}\n \tstrbuf_add(&(msg->buf), buf, len);\n \tfree(buf);\n@@ -306,7 +306,7 @@ void commit_notes(struct notes_tree *t, const char *msg)\n \tif (!t)\n \t\tt = &default_notes_tree;\n \tif (!t->initialized || !t->ref || !*t->ref)\n-\t\tdie(\"Cannot commit uninitialized/unreferenced notes tree\");\n+\t\tdie(_(\"Cannot commit uninitialized/unreferenced notes tree\"));\n \tif (!t->dirty)\n \t\treturn; /* don't have to commit an unchanged tree */\n \n@@ -347,7 +347,7 @@ static int notes_rewrite_config(const char *k, const char *v, void *cb)\n \t\t\tconfig_error_nonbool(k);\n \t\tc->combine = parse_combine_notes_fn(v);\n \t\tif (!c->combine) {\n-\t\t\terror(\"Bad notes.rewriteMode value: '%s'\", v);\n+\t\t\terror(_(\"Bad notes.rewriteMode value: '%s'\"), v);\n \t\t\treturn 1;\n \t\t}\n \t\treturn 0;\n@@ -357,8 +357,8 @@ static int notes_rewrite_config(const char *k, const char *v, void *cb)\n \t\tif (!prefixcmp(v, \"refs/notes/\"))\n \t\t\tstring_list_add_refs_by_glob(c->refs, v);\n \t\telse\n-\t\t\twarning(\"Refusing to rewrite notes in %s\"\n-\t\t\t\t\" (outside of refs/notes/)\", v);\n+\t\t\twarning(_(\"Refusing to rewrite notes in %s\"\n+\t\t\t\t\" (outside of refs/notes/)\"), v);\n \t\treturn 0;\n \t}\n \n@@ -446,13 +446,13 @@ int notes_copy_from_stdin(int force, const char *rewrite_cmd)\n \n \t\tsplit = strbuf_split(&buf, ' ');\n \t\tif (!split[0] || !split[1])\n-\t\t\tdie(\"Malformed input line: '%s'.\", buf.buf);\n+\t\t\tdie(_(\"Malformed input line: '%s'.\"), buf.buf);\n \t\tstrbuf_rtrim(split[0]);\n \t\tstrbuf_rtrim(split[1]);\n \t\tif (get_sha1(split[0]->buf, from_obj))\n-\t\t\tdie(\"Failed to resolve '%s' as a valid ref.\", split[0]->buf);\n+\t\t\tdie(_(\"Failed to resolve '%s' as a valid ref.\"), split[0]->buf);\n \t\tif (get_sha1(split[1]->buf, to_obj))\n-\t\t\tdie(\"Failed to resolve '%s' as a valid ref.\", split[1]->buf);\n+\t\t\tdie(_(\"Failed to resolve '%s' as a valid ref.\"), split[1]->buf);\n \n \t\tif (rewrite_cmd)\n \t\t\terr = copy_note_for_rewrite(c, from_obj, to_obj);\n@@ -461,7 +461,7 @@ int notes_copy_from_stdin(int force, const char *rewrite_cmd)\n \t\t\t\t\tcombine_notes_overwrite);\n \n \t\tif (err) {\n-\t\t\terror(\"Failed to copy notes from '%s' to '%s'\",\n+\t\t\terror(_(\"Failed to copy notes from '%s' to '%s'\"),\n \t\t\t      split[0]->buf, split[1]->buf);\n \t\t\tret = 1;\n \t\t}\n@@ -505,20 +505,20 @@ static int list(int argc, const char **argv, const char *prefix)\n \t\t\t\t     git_notes_list_usage, 0);\n \n \tif (1 < argc) {\n-\t\terror(\"too many parameters\");\n+\t\terror(_(\"too many parameters\"));\n \t\tusage_with_options(git_notes_list_usage, options);\n \t}\n \n \tt = init_notes_check(\"list\");\n \tif (argc) {\n \t\tif (get_sha1(argv[0], object))\n-\t\t\tdie(\"Failed to resolve '%s' as a valid ref.\", argv[0]);\n+\t\t\tdie(_(\"Failed to resolve '%s' as a valid ref.\"), argv[0]);\n \t\tnote = get_note(t, object);\n \t\tif (note) {\n \t\t\tputs(sha1_to_hex(note));\n \t\t\tretval = 0;\n \t\t} else\n-\t\t\tretval = error(\"No note found for object %s.\",\n+\t\t\tretval = error(_(\"No note found for object %s.\"),\n \t\t\t\t       sha1_to_hex(object));\n \t} else\n \t\tretval = for_each_note(t, 0, list_each_note, NULL);\n@@ -557,26 +557,26 @@ static int add(int argc, const char **argv, const char *prefix)\n \t\t\t     0);\n \n \tif (1 < argc) {\n-\t\terror(\"too many parameters\");\n+\t\terror(_(\"too many parameters\"));\n \t\tusage_with_options(git_notes_add_usage, options);\n \t}\n \n \tobject_ref = argc ? argv[0] : \"HEAD\";\n \n \tif (get_sha1(object_ref, object))\n-\t\tdie(\"Failed to resolve '%s' as a valid ref.\", object_ref);\n+\t\tdie(_(\"Failed to resolve '%s' as a valid ref.\"), object_ref);\n \n \tt = init_notes_check(\"add\");\n \tnote = get_note(t, object);\n \n \tif (note) {\n \t\tif (!force) {\n-\t\t\tretval = error(\"Cannot add notes. Found existing notes \"\n+\t\t\tretval = error(_(\"Cannot add notes. Found existing notes \"\n \t\t\t\t       \"for object %s. Use '-f' to overwrite \"\n-\t\t\t\t       \"existing notes\", sha1_to_hex(object));\n+\t\t\t\t       \"existing notes\"), sha1_to_hex(object));\n \t\t\tgoto out;\n \t\t}\n-\t\tfprintf(stderr, \"Overwriting existing notes for object %s\\n\",\n+\t\tfprintf(stderr, _(\"Overwriting existing notes for object %s\\n\"),\n \t\t\tsha1_to_hex(object));\n \t}\n \n@@ -618,7 +618,7 @@ static int copy(int argc, const char **argv, const char *prefix)\n \n \tif (from_stdin || rewrite_cmd) {\n \t\tif (argc) {\n-\t\t\terror(\"too many parameters\");\n+\t\t\terror(_(\"too many parameters\"));\n \t\t\tusage_with_options(git_notes_copy_usage, options);\n \t\t} else {\n \t\t\treturn notes_copy_from_stdin(force, rewrite_cmd);\n@@ -626,41 +626,41 @@ static int copy(int argc, const char **argv, const char *prefix)\n \t}\n \n \tif (argc < 2) {\n-\t\terror(\"too few parameters\");\n+\t\terror(_(\"too few parameters\"));\n \t\tusage_with_options(git_notes_copy_usage, options);\n \t}\n \tif (2 < argc) {\n-\t\terror(\"too many parameters\");\n+\t\terror(_(\"too many parameters\"));\n \t\tusage_with_options(git_notes_copy_usage, options);\n \t}\n \n \tif (get_sha1(argv[0], from_obj))\n-\t\tdie(\"Failed to resolve '%s' as a valid ref.\", argv[0]);\n+\t\tdie(_(\"Failed to resolve '%s' as a valid ref.\"), argv[0]);\n \n \tobject_ref = 1 < argc ? argv[1] : \"HEAD\";\n \n \tif (get_sha1(object_ref, object))\n-\t\tdie(\"Failed to resolve '%s' as a valid ref.\", object_ref);\n+\t\tdie(_(\"Failed to resolve '%s' as a valid ref.\"), object_ref);\n \n \tt = init_notes_check(\"copy\");\n \tnote = get_note(t, object);\n \n \tif (note) {\n \t\tif (!force) {\n-\t\t\tretval = error(\"Cannot copy notes. Found existing \"\n+\t\t\tretval = error(_(\"Cannot copy notes. Found existing \"\n \t\t\t\t       \"notes for object %s. Use '-f' to \"\n-\t\t\t\t       \"overwrite existing notes\",\n+\t\t\t\t       \"overwrite existing notes\"),\n \t\t\t\t       sha1_to_hex(object));\n \t\t\tgoto out;\n \t\t}\n-\t\tfprintf(stderr, \"Overwriting existing notes for object %s\\n\",\n+\t\tfprintf(stderr, _(\"Overwriting existing notes for object %s\\n\"),\n \t\t\tsha1_to_hex(object));\n \t}\n \n \tfrom_note = get_note(t, from_obj);\n \tif (!from_note) {\n-\t\tretval = error(\"Missing notes on source object %s. Cannot \"\n-\t\t\t       \"copy.\", sha1_to_hex(from_obj));\n+\t\tretval = error(_(\"Missing notes on source object %s. Cannot \"\n+\t\t\t       \"copy.\"), sha1_to_hex(from_obj));\n \t\tgoto out;\n \t}\n \n@@ -703,19 +703,19 @@ static int append_edit(int argc, const char **argv, const char *prefix)\n \t\t\t     PARSE_OPT_KEEP_ARGV0);\n \n \tif (2 < argc) {\n-\t\terror(\"too many parameters\");\n+\t\terror(_(\"too many parameters\"));\n \t\tusage_with_options(usage, options);\n \t}\n \n \tif (msg.given && edit)\n-\t\tfprintf(stderr, \"The -m/-F/-c/-C options have been deprecated \"\n+\t\tfprintf(stderr, _(\"The -m/-F/-c/-C options have been deprecated \"\n \t\t\t\"for the 'edit' subcommand.\\n\"\n-\t\t\t\"Please use 'git notes add -f -m/-F/-c/-C' instead.\\n\");\n+\t\t\t\"Please use 'git notes add -f -m/-F/-c/-C' instead.\\n\"));\n \n \tobject_ref = 1 < argc ? argv[1] : \"HEAD\";\n \n \tif (get_sha1(object_ref, object))\n-\t\tdie(\"Failed to resolve '%s' as a valid ref.\", object_ref);\n+\t\tdie(_(\"Failed to resolve '%s' as a valid ref.\"), object_ref);\n \n \tt = init_notes_check(argv[0]);\n \tnote = get_note(t, object);\n@@ -750,20 +750,20 @@ static int show(int argc, const char **argv, const char *prefix)\n \t\t\t     0);\n \n \tif (1 < argc) {\n-\t\terror(\"too many parameters\");\n+\t\terror(_(\"too many parameters\"));\n \t\tusage_with_options(git_notes_show_usage, options);\n \t}\n \n \tobject_ref = argc ? argv[0] : \"HEAD\";\n \n \tif (get_sha1(object_ref, object))\n-\t\tdie(\"Failed to resolve '%s' as a valid ref.\", object_ref);\n+\t\tdie(_(\"Failed to resolve '%s' as a valid ref.\"), object_ref);\n \n \tt = init_notes_check(\"show\");\n \tnote = get_note(t, object);\n \n \tif (!note)\n-\t\tretval = error(\"No note found for object %s.\",\n+\t\tretval = error(_(\"No note found for object %s.\"),\n \t\t\t       sha1_to_hex(object));\n \telse {\n \t\tconst char *show_args[3] = {\"show\", sha1_to_hex(note), NULL};\n@@ -961,22 +961,22 @@ static int remove_cmd(int argc, const char **argv, const char *prefix)\n \t\t\t     git_notes_remove_usage, 0);\n \n \tif (1 < argc) {\n-\t\terror(\"too many parameters\");\n+\t\terror(_(\"too many parameters\"));\n \t\tusage_with_options(git_notes_remove_usage, options);\n \t}\n \n \tobject_ref = argc ? argv[0] : \"HEAD\";\n \n \tif (get_sha1(object_ref, object))\n-\t\tdie(\"Failed to resolve '%s' as a valid ref.\", object_ref);\n+\t\tdie(_(\"Failed to resolve '%s' as a valid ref.\"), object_ref);\n \n \tt = init_notes_check(\"remove\");\n \n \tretval = remove_note(t, object);\n \tif (retval)\n-\t\tfprintf(stderr, \"Object %s has no note\\n\", sha1_to_hex(object));\n+\t\tfprintf(stderr, _(\"Object %s has no note\\n\"), sha1_to_hex(object));\n \telse {\n-\t\tfprintf(stderr, \"Removing note for object %s\\n\",\n+\t\tfprintf(stderr, _(\"Removing note for object %s\\n\"),\n \t\t\tsha1_to_hex(object));\n \n \t\tcommit_notes(t, \"Notes removed by 'git notes remove'\");\n@@ -999,7 +999,7 @@ static int prune(int argc, const char **argv, const char *prefix)\n \t\t\t     0);\n \n \tif (argc) {\n-\t\terror(\"too many parameters\");\n+\t\terror(_(\"too many parameters\"));\n \t\tusage_with_options(git_notes_prune_usage, options);\n \t}\n \n@@ -1069,7 +1069,7 @@ int cmd_notes(int argc, const char **argv, const char *prefix)\n \telse if (!strcmp(argv[0], \"get-ref\"))\n \t\tresult = get_ref(argc, argv, prefix);\n \telse {\n-\t\tresult = error(\"Unknown subcommand: %s\", argv[0]);\n+\t\tresult = error(_(\"Unknown subcommand: %s\"), argv[0]);\n \t\tusage_with_options(git_notes_usage, options);\n \t}\n \n-- \n1.7.2.3\n"},{"id":"161949","messageId":"1298418152-27789-69-git-send-email-avarab@gmail.com","threadId":"26561","inReplyTo":"7vhbbwdjnm.fsf@alter.siamese.dyndns.org","subject":"[PATCH v4 68/73] gettextize: git-notes GIT_NOTES_REWRITE_MODE error message","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2011-02-22T23:42:27Z","receivedAt":"2011-02-22T23:42:27Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"Use sprintf format for the error message that's displayed if\nGIT_NOTES_REWRITE_MODE is invalid, and leave a note in a TRANSLATORS\ncomment indicating what the message means.\n\nSigned-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n builtin/notes.c |    6 ++++--\n 1 files changed, 4 insertions(+), 2 deletions(-)\n\ndiff --git a/builtin/notes.c b/builtin/notes.c\nindex 4c6cf85..a0aa995 100644\n--- a/builtin/notes.c\n+++ b/builtin/notes.c\n@@ -382,8 +382,10 @@ struct notes_rewrite_cfg *init_copy_notes_for_rewrite(const char *cmd)\n \t\tc->mode_from_env = 1;\n \t\tc->combine = parse_combine_notes_fn(rewrite_mode_env);\n \t\tif (!c->combine)\n-\t\t\terror(\"Bad \" GIT_NOTES_REWRITE_MODE_ENVIRONMENT\n-\t\t\t      \" value: '%s'\", rewrite_mode_env);\n+\t\t\t/* TRANSLATORS: The first %s is the name of the\n+\t\t\t   environment variable, the second %s is its value */\n+\t\t\terror(_(\"Bad %s value: '%s'\"), GIT_NOTES_REWRITE_MODE_ENVIRONMENT,\n+\t\t\t\t\trewrite_mode_env);\n \t}\n \tif (rewrite_refs_env) {\n \t\tc->refs_from_env = 1;\n-- \n1.7.2.3\n"},{"id":"161954","messageId":"1298418152-27789-70-git-send-email-avarab@gmail.com","threadId":"26561","inReplyTo":"7vhbbwdjnm.fsf@alter.siamese.dyndns.org","subject":"[PATCH v4 69/73] gettextize: git-revert basic messages","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2011-02-22T23:42:28Z","receivedAt":"2011-02-22T23:42:28Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n builtin/revert.c |   46 +++++++++++++++++++++++-----------------------\n 1 files changed, 23 insertions(+), 23 deletions(-)\n\ndiff --git a/builtin/revert.c b/builtin/revert.c\nindex dc1b702..1ca08da 100644\n--- a/builtin/revert.c\n+++ b/builtin/revert.c\n@@ -96,7 +96,7 @@ static void parse_args(int argc, const char **argv)\n \t\t\tOPT_END(),\n \t\t};\n \t\tif (parse_options_concat(options, ARRAY_SIZE(options), cp_extra))\n-\t\t\tdie(\"program error\");\n+\t\t\tdie(_(\"program error\"));\n \t}\n \n \tcommit_argc = parse_options(argc, argv, NULL, options, usage_str,\n@@ -168,7 +168,7 @@ static char *get_encoding(const char *message)\n \tconst char *p = message, *eol;\n \n \tif (!p)\n-\t\tdie (\"Could not read commit message of %s\",\n+\t\tdie (_(\"Could not read commit message of %s\"),\n \t\t\t\tsha1_to_hex(commit->object.sha1));\n \twhile (*p && *p != '\\n') {\n \t\tfor (eol = p + 1; *eol && *eol != '\\n'; eol++)\n@@ -202,7 +202,7 @@ static void set_author_ident_env(const char *message)\n {\n \tconst char *p = message;\n \tif (!p)\n-\t\tdie (\"Could not read commit message of %s\",\n+\t\tdie (_(\"Could not read commit message of %s\"),\n \t\t\t\tsha1_to_hex(commit->object.sha1));\n \twhile (*p && *p != '\\n') {\n \t\tconst char *eol;\n@@ -216,7 +216,7 @@ static void set_author_ident_env(const char *message)\n \t\t\tline = xmemdupz(p, eol - p);\n \t\t\temail = strchr(line, '<');\n \t\t\tif (!email)\n-\t\t\t\tdie (\"Could not extract author email from %s\",\n+\t\t\t\tdie (_(\"Could not extract author email from %s\"),\n \t\t\t\t\tsha1_to_hex(commit->object.sha1));\n \t\t\tif (email == line)\n \t\t\t\tpend = line;\n@@ -228,7 +228,7 @@ static void set_author_ident_env(const char *message)\n \t\t\temail++;\n \t\t\ttimestamp = strchr(email, '>');\n \t\t\tif (!timestamp)\n-\t\t\t\tdie (\"Could not extract author time from %s\",\n+\t\t\t\tdie (_(\"Could not extract author time from %s\"),\n \t\t\t\t\tsha1_to_hex(commit->object.sha1));\n \t\t\t*timestamp = '\\0';\n \t\t\tfor (timestamp++; *timestamp && isspace(*timestamp);\n@@ -244,7 +244,7 @@ static void set_author_ident_env(const char *message)\n \t\tif (*p == '\\n')\n \t\t\tp++;\n \t}\n-\tdie (\"No author information found in %s\",\n+\tdie (_(\"No author information found in %s\"),\n \t\t\tsha1_to_hex(commit->object.sha1));\n }\n \n@@ -281,10 +281,10 @@ static void write_message(struct strbuf *msgbuf, const char *filename)\n \tint msg_fd = hold_lock_file_for_update(&msg_file, filename,\n \t\t\t\t\t       LOCK_DIE_ON_ERROR);\n \tif (write_in_full(msg_fd, msgbuf->buf, msgbuf->len) < 0)\n-\t\tdie_errno(\"Could not write to %s.\", filename);\n+\t\tdie_errno(_(\"Could not write to %s.\"), filename);\n \tstrbuf_release(msgbuf);\n \tif (commit_lock_file(&msg_file) < 0)\n-\t\tdie(\"Error wrapping up %s\", filename);\n+\t\tdie(_(\"Error wrapping up %s\"), filename);\n }\n \n static struct tree *empty_tree(void)\n@@ -420,10 +420,10 @@ static int do_pick_commit(void)\n \t\t * to work on.\n \t\t */\n \t\tif (write_cache_as_tree(head, 0, NULL))\n-\t\t\tdie (\"Your index file is unmerged.\");\n+\t\t\tdie (_(\"Your index file is unmerged.\"));\n \t} else {\n \t\tif (get_sha1(\"HEAD\", head))\n-\t\t\tdie (\"You do not have a valid HEAD\");\n+\t\t\tdie (_(\"You do not have a valid HEAD\"));\n \t\tif (index_differs_from(\"HEAD\", 0))\n \t\t\tdie_dirty_index(me);\n \t}\n@@ -431,7 +431,7 @@ static int do_pick_commit(void)\n \n \tif (!commit->parents) {\n \t\tif (action == REVERT)\n-\t\t\tdie (\"Cannot revert a root commit\");\n+\t\t\tdie (_(\"Cannot revert a root commit\"));\n \t\tparent = NULL;\n \t}\n \telse if (commit->parents->next) {\n@@ -440,7 +440,7 @@ static int do_pick_commit(void)\n \t\tstruct commit_list *p;\n \n \t\tif (!mainline)\n-\t\t\tdie(\"Commit %s is a merge but no -m option was given.\",\n+\t\t\tdie(_(\"Commit %s is a merge but no -m option was given.\"),\n \t\t\t    sha1_to_hex(commit->object.sha1));\n \n \t\tfor (cnt = 1, p = commit->parents;\n@@ -448,11 +448,11 @@ static int do_pick_commit(void)\n \t\t     cnt++)\n \t\t\tp = p->next;\n \t\tif (cnt != mainline || !p)\n-\t\t\tdie(\"Commit %s does not have parent %d\",\n+\t\t\tdie(_(\"Commit %s does not have parent %d\"),\n \t\t\t    sha1_to_hex(commit->object.sha1), mainline);\n \t\tparent = p->item;\n \t} else if (0 < mainline)\n-\t\tdie(\"Mainline was specified but commit %s is not a merge.\",\n+\t\tdie(_(\"Mainline was specified but commit %s is not a merge.\"),\n \t\t    sha1_to_hex(commit->object.sha1));\n \telse\n \t\tparent = commit->parents->item;\n@@ -465,7 +465,7 @@ static int do_pick_commit(void)\n \t\t    me, sha1_to_hex(parent->object.sha1));\n \n \tif (get_message(commit->buffer, &msg) != 0)\n-\t\tdie(\"Cannot get commit message for %s\",\n+\t\tdie(_(\"Cannot get commit message for %s\"),\n \t\t\t\tsha1_to_hex(commit->object.sha1));\n \n \t/*\n@@ -556,10 +556,10 @@ static void prepare_revs(struct rev_info *revs)\n \t\tusage(*revert_or_cherry_pick_usage());\n \n \tif (prepare_revision_walk(revs))\n-\t\tdie(\"revision walk setup failed\");\n+\t\tdie(_(\"revision walk setup failed\"));\n \n \tif (!revs->commits)\n-\t\tdie(\"empty commit set passed\");\n+\t\tdie(_(\"empty commit set passed\"));\n }\n \n static void read_and_refresh_cache(const char *me)\n@@ -567,12 +567,12 @@ static void read_and_refresh_cache(const char *me)\n \tstatic struct lock_file index_lock;\n \tint index_fd = hold_locked_index(&index_lock, 0);\n \tif (read_index_preload(&the_index, NULL) < 0)\n-\t\tdie(\"git %s: failed to read the index\", me);\n+\t\tdie(_(\"git %s: failed to read the index\"), me);\n \trefresh_index(&the_index, REFRESH_QUIET|REFRESH_UNMERGED, NULL, NULL, NULL);\n \tif (the_index.cache_changed) {\n \t\tif (write_index(&the_index, index_fd) ||\n \t\t    commit_locked_index(&index_lock))\n-\t\t\tdie(\"git %s: failed to refresh the index\", me);\n+\t\t\tdie(_(\"git %s: failed to refresh the index\"), me);\n \t}\n \trollback_lock_file(&index_lock);\n }\n@@ -588,13 +588,13 @@ static int revert_or_cherry_pick(int argc, const char **argv)\n \n \tif (allow_ff) {\n \t\tif (signoff)\n-\t\t\tdie(\"cherry-pick --ff cannot be used with --signoff\");\n+\t\t\tdie(_(\"cherry-pick --ff cannot be used with --signoff\"));\n \t\tif (no_commit)\n-\t\t\tdie(\"cherry-pick --ff cannot be used with --no-commit\");\n+\t\t\tdie(_(\"cherry-pick --ff cannot be used with --no-commit\"));\n \t\tif (no_replay)\n-\t\t\tdie(\"cherry-pick --ff cannot be used with -x\");\n+\t\t\tdie(_(\"cherry-pick --ff cannot be used with -x\"));\n \t\tif (edit)\n-\t\t\tdie(\"cherry-pick --ff cannot be used with --edit\");\n+\t\t\tdie(_(\"cherry-pick --ff cannot be used with --edit\"));\n \t}\n \n \tread_and_refresh_cache(me);\n-- \n1.7.2.3\n"},{"id":"161952","messageId":"1298418152-27789-71-git-send-email-avarab@gmail.com","threadId":"26561","inReplyTo":"7vhbbwdjnm.fsf@alter.siamese.dyndns.org","subject":"[PATCH v4 70/73] gettextize: git-revert \"Your local changes\" message","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2011-02-22T23:42:29Z","receivedAt":"2011-02-22T23:42:29Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"Translate the \"Your local changes [...]\" message without using the\n`me' variable, instead split up the two messages so translators can\ntranslate the whole messages as-is.\n\nReported-by: Jonathan Nieder <jrnieder@gmail.com>\nSigned-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n builtin/revert.c              |   18 +++++++++++++-----\n t/t3501-revert-cherry-pick.sh |    2 +-\n 2 files changed, 14 insertions(+), 6 deletions(-)\n\ndiff --git a/builtin/revert.c b/builtin/revert.c\nindex 1ca08da..02c23c9 100644\n--- a/builtin/revert.c\n+++ b/builtin/revert.c\n@@ -302,11 +302,19 @@ static NORETURN void die_dirty_index(const char *me)\n \tif (read_cache_unmerged()) {\n \t\tdie_resolve_conflict(me);\n \t} else {\n-\t\tif (advice_commit_before_merge)\n-\t\t\tdie(\"Your local changes would be overwritten by %s.\\n\"\n-\t\t\t    \"Please, commit your changes or stash them to proceed.\", me);\n-\t\telse\n-\t\t\tdie(\"Your local changes would be overwritten by %s.\\n\", me);\n+\t\tif (advice_commit_before_merge) {\n+\t\t\tif (action == REVERT)\n+\t\t\t\tdie(_(\"Your local changes would be overwritten by revert.\\n\"\n+\t\t\t\t\t  \"Please, commit your changes or stash them to proceed.\"));\n+\t\t\telse\n+\t\t\t\tdie(_(\"Your local changes would be overwritten by cherry-pick.\\n\"\n+\t\t\t\t\t  \"Please, commit your changes or stash them to proceed.\"));\n+\t\t} else {\n+\t\t\tif (action == REVERT)\n+\t\t\t\tdie(_(\"Your local changes would be overwritten by revert.\\n\"));\n+\t\t\telse\n+\t\t\t\tdie(_(\"Your local changes would be overwritten by cherry-pick.\\n\"));\n+\t\t}\n \t}\n }\n \ndiff --git a/t/t3501-revert-cherry-pick.sh b/t/t3501-revert-cherry-pick.sh\nindex 0439544..753a6c9 100755\n--- a/t/t3501-revert-cherry-pick.sh\n+++ b/t/t3501-revert-cherry-pick.sh\n@@ -91,7 +91,7 @@ test_expect_success 'cherry-pick on stat-dirty working tree' '\n \t)\n '\n \n-test_expect_success 'revert forbidden on dirty working tree' '\n+test_expect_success C_LOCALE_OUTPUT 'revert forbidden on dirty working tree' '\n \n \techo content >extra_file &&\n \tgit add extra_file &&\n-- \n1.7.2.3\n"},{"id":"161947","messageId":"1298418152-27789-72-git-send-email-avarab@gmail.com","threadId":"26561","inReplyTo":"7vhbbwdjnm.fsf@alter.siamese.dyndns.org","subject":"[PATCH v4 71/73] gettextize: git-revert literal \"me\" messages","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2011-02-22T23:42:30Z","receivedAt":"2011-02-22T23:42:30Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"Translate messages that use the `me' variable. These are all error\nmessages referencing the command name, so the name shouldn't be\ntranslated.\n\nReported-by: Jonathan Nieder <jrnieder@gmail.com>\nSigned-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n builtin/revert.c |    7 +++++--\n 1 files changed, 5 insertions(+), 2 deletions(-)\n\ndiff --git a/builtin/revert.c b/builtin/revert.c\nindex 02c23c9..b0a5ffb 100644\n--- a/builtin/revert.c\n+++ b/builtin/revert.c\n@@ -362,7 +362,8 @@ static int do_recursive_merge(struct commit *base, struct commit *next,\n \tif (active_cache_changed &&\n \t    (write_cache(index_fd, active_cache, active_nr) ||\n \t     commit_locked_index(&index_lock)))\n-\t\tdie(\"%s: Unable to write new index file\", me);\n+\t\t/* TRANSLATORS: %s will be \"revert\" or \"cherry-pick\" */\n+\t\tdie(_(\"%s: Unable to write new index file\"), me);\n \trollback_lock_file(&index_lock);\n \n \tif (!clean) {\n@@ -469,7 +470,9 @@ static int do_pick_commit(void)\n \t\treturn fast_forward_to(commit->object.sha1, head);\n \n \tif (parent && parse_commit(parent) < 0)\n-\t\tdie(\"%s: cannot parse parent commit %s\",\n+\t\t/* TRANSLATORS: The first %s will be \"revert\" or\n+\t\t   \"cherry-pick\", the second %s a SHA1 */\n+\t\tdie(_(\"%s: cannot parse parent commit %s\"),\n \t\t    me, sha1_to_hex(parent->object.sha1));\n \n \tif (get_message(commit->buffer, &msg) != 0)\n-- \n1.7.2.3\n"},{"id":"161953","messageId":"1298418152-27789-73-git-send-email-avarab@gmail.com","threadId":"26561","inReplyTo":"7vhbbwdjnm.fsf@alter.siamese.dyndns.org","subject":"[PATCH v4 72/73] gettextize: git-revert split up \"could not revert/apply\" message","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2011-02-22T23:42:31Z","receivedAt":"2011-02-22T23:42:31Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"Split up the \"could not %s %s... %s\" message into \"could not revert\n%s... %s\" and \"could not apply %s... %s\". This makes it easier for\ntranslators to understand the message.\n\nSigned-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n builtin/revert.c                |    5 +++--\n t/t3507-cherry-pick-conflict.sh |    2 +-\n 2 files changed, 4 insertions(+), 3 deletions(-)\n\ndiff --git a/builtin/revert.c b/builtin/revert.c\nindex b0a5ffb..98dfd4d 100644\n--- a/builtin/revert.c\n+++ b/builtin/revert.c\n@@ -536,8 +536,9 @@ static int do_pick_commit(void)\n \t}\n \n \tif (res) {\n-\t\terror(\"could not %s %s... %s\",\n-\t\t      action == REVERT ? \"revert\" : \"apply\",\n+\t\terror(action == REVERT\n+\t\t      ? _(\"could not revert %s... %s\")\n+\t\t      : _(\"could not apply %s... %s\"),\n \t\t      find_unique_abbrev(commit->object.sha1, DEFAULT_ABBREV),\n \t\t      msg.subject);\n \t\tprint_advice();\ndiff --git a/t/t3507-cherry-pick-conflict.sh b/t/t3507-cherry-pick-conflict.sh\nindex 607bf25..f7e4072 100755\n--- a/t/t3507-cherry-pick-conflict.sh\n+++ b/t/t3507-cherry-pick-conflict.sh\n@@ -38,7 +38,7 @@ test_expect_success 'failed cherry-pick does not advance HEAD' '\n \ttest \"$head\" = \"$newhead\"\n '\n \n-test_expect_success 'advice from failed cherry-pick' \"\n+test_expect_success C_LOCALE_OUTPUT 'advice from failed cherry-pick' \"\n \tgit checkout -f initial^0 &&\n \tgit read-tree -u --reset HEAD &&\n \tgit clean -d -f -f -q -x &&\n-- \n1.7.2.3\n"},{"id":"161948","messageId":"1298418152-27789-74-git-send-email-avarab@gmail.com","threadId":"26561","inReplyTo":"7vhbbwdjnm.fsf@alter.siamese.dyndns.org","subject":"[PATCH v4 73/73] gettextize: git-shortlog basic messages","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2011-02-22T23:42:32Z","receivedAt":"2011-02-22T23:42:32Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n builtin/shortlog.c |    8 ++++----\n 1 files changed, 4 insertions(+), 4 deletions(-)\n\ndiff --git a/builtin/shortlog.c b/builtin/shortlog.c\nindex 1a21e4b..f5efc67 100644\n--- a/builtin/shortlog.c\n+++ b/builtin/shortlog.c\n@@ -158,7 +158,7 @@ void shortlog_add_commit(struct shortlog *log, struct commit *commit)\n \t\tbuffer = eol;\n \t}\n \tif (!author)\n-\t\tdie(\"Missing author: %s\",\n+\t\tdie(_(\"Missing author: %s\"),\n \t\t    sha1_to_hex(commit->object.sha1));\n \tif (log->user_format) {\n \t\tstruct pretty_print_context ctx = {0};\n@@ -181,7 +181,7 @@ static void get_from_rev(struct rev_info *rev, struct shortlog *log)\n \tstruct commit *commit;\n \n \tif (prepare_revision_walk(rev))\n-\t\tdie(\"revision walk setup failed\");\n+\t\tdie(_(\"revision walk setup failed\"));\n \twhile ((commit = get_revision(rev)) != NULL)\n \t\tshortlog_add_commit(log, commit);\n }\n@@ -284,7 +284,7 @@ parse_done:\n \targc = parse_options_end(&ctx);\n \n \tif (setup_revisions(argc, argv, &rev, NULL) != 1) {\n-\t\terror(\"unrecognized argument: %s\", argv[1]);\n+\t\terror(_(\"unrecognized argument: %s\"), argv[1]);\n \t\tusage_with_options(shortlog_usage, options);\n \t}\n \n@@ -296,7 +296,7 @@ parse_done:\n \t\tadd_head_to_pending(&rev);\n \tif (rev.pending.nr == 0) {\n \t\tif (isatty(0))\n-\t\t\tfprintf(stderr, \"(reading log message from standard input)\\n\");\n+\t\t\tfprintf(stderr, _(\"(reading log message from standard input)\\n\"));\n \t\tread_from_stdin(&log);\n \t}\n \telse\n-- \n1.7.2.3\n"},{"id":"162000","messageId":"7v1v2zbmn9.fsf@alter.siamese.dyndns.org","threadId":"26561","inReplyTo":"1298418152-27789-1-git-send-email-avarab@gmail.com","subject":"Re: [PATCH v4 00/73] No-op gettextize core Git C programs","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2011-02-23T00:49:30Z","receivedAt":"2011-02-23T00:49:30Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Ævar Arnfjörð Bjarmason <avarab@gmail.com> writes:\n\n>   * Reverted back to using the \"gettextize\" patch subjects I\n>     originally used. I'm using these consistetly so I can later git\n>     log --grep=gettextize: to find them. I'd like to preserve that\n>     attributed.\n\nCan we make that shorter, perhaps just \"i18n:\"?  In this series, your\nfirst three and Jonathan's are oddballs that do not have \"gettexize:\"\nanyway.\n\nWill give it a whirl.  Thanks.\n"},{"id":"162002","messageId":"7vwrkra5un.fsf@alter.siamese.dyndns.org","threadId":"26561","inReplyTo":"7v1v2zbmn9.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH v4 00/73] No-op gettextize core Git C programs","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2011-02-23T01:37:36Z","receivedAt":"2011-02-23T01:37:36Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Junio C Hamano <gitster@pobox.com> writes:\n\n> Ævar Arnfjörð Bjarmason <avarab@gmail.com> writes:\n>\n>>   * Reverted back to using the \"gettextize\" patch subjects I\n>>     originally used. I'm using these consistetly so I can later git\n>>     log --grep=gettextize: to find them. I'd like to preserve that\n>>     attributed.\n>\n> Can we make that shorter, perhaps just \"i18n:\"?  In this series, your\n> first three and Jonathan's are oddballs that do not have \"gettexize:\"\n> anyway.\n>\n> Will give it a whirl.  Thanks.\n\nIt was a slightly unpleasant experience to merge this round to 'pu' (after\nexcluding the earlier round from it, of course), as a few topics in flight\nthat reorganized existing functions into smaller helpers had to conflict\nwith this patch.  I tried to be careful but please double check the result,\nperhaps with:\n\n    $ git show --first-parent origin/pu\n\nwhen it is propagated to mirrors.\n\nThanks.\n"},{"id":"162040","messageId":"AANLkTinRfACQuCki=QJh4dczoMK8+8bdwLjg6atL4UBT@mail.gmail.com","threadId":"26561","inReplyTo":"7vwrkra5un.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH v4 00/73] No-op gettextize core Git C programs","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2011-02-23T18:30:01Z","receivedAt":"2011-02-23T18:30:01Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"On Wed, Feb 23, 2011 at 02:37, Junio C Hamano <gitster@pobox.com> wrote:\n> Junio C Hamano <gitster@pobox.com> writes:\n>\n>> Ævar Arnfjörð Bjarmason <avarab@gmail.com> writes:\n>>\n>>>   * Reverted back to using the \"gettextize\" patch subjects I\n>>>     originally used. I'm using these consistetly so I can later git\n>>>     log --grep=gettextize: to find them. I'd like to preserve that\n>>>     attributed.\n>>\n>> Can we make that shorter, perhaps just \"i18n:\"?  In this series, your\n>> first three and Jonathan's are oddballs that do not have \"gettexize:\"\n>> anyway.\n>>\n>> Will give it a whirl.  Thanks.\n>\n> It was a slightly unpleasant experience to merge this round to 'pu' (after\n> excluding the earlier round from it, of course), as a few topics in flight\n> that reorganized existing functions into smaller helpers had to conflict\n> with this patch.  I tried to be careful but please double check the result,\n> perhaps with:\n>\n>    $ git show --first-parent origin/pu\n>\n> when it is propagated to mirrors.\n\nI've gone over the version in pu. It looks good to me.\n"},{"id":"162209","messageId":"20110225070834.GB23037@elie","threadId":"26561","inReplyTo":"1298418152-27789-3-git-send-email-avarab@gmail.com","subject":"Re: [PATCH v4 02/73] gettext tests: add GETTEXT_POISON to simulate unfriendly translator","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2011-02-25T07:08:35Z","receivedAt":"2011-02-25T07:08:35Z","isPatch":true,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"Hi again,\n\nÆvar Arnfjörð Bjarmason wrote:\n\n> Note that the string we're using (\"# GETTEXT POISON #\") intentionally\n> starts the pound sign.\n\nI think I've caused more grief than it's worth complaining about that.\nBut here's what a fixup (against 77bc5af, i18n: add GETTEXT_POISON to\nsimulate unfriendly translator, 2011-02-22) would look like, in case\nit's wanted.\n\nIf this fixup is applied, the last two paragraphs of the change\ndescription (starting with \"Note that the string we're using\") could\nbe removed.\n\nWill comment on how later patches in the series would be affected in\nseparate messages as I apply them.  Patch 1 (i18n: add no-op _() and\nN_() wrappers) and patch 2 (gettext_poison) look good to me, for\nwhat it's worth, with or without this fixup.\n\n-- 8< --\nSubject: i18n: make the string used by GETTEXT_POISON less meaningful\n\nThe idea of the GETTEXT_POISON facility is to simulate a worst-case\ntranslation, so that strings marked for translation that cause trouble\ncan be noticed and dealt with.\n\nA string starting with \"#\" does not seem particularly well suited\nfor that purpose, since it makes '#' characters that mark a comment\nand that translators must be careful not to remove harder to find.\nPlus it muddles the issue --- is the poisonous string meant to be a\nrandom worst case or not?\n\nThe affected strings with a \"# \" are in wt-status.c, builtin/commit.c,\nand builtin/tag.c.  A proof-of-concept patch moving the # signs\noutside the translated strings exists and works well.  If we want to\nmark those strings for translation without something like that patch,\nwe can skip the relevant tests or start returning a string starting\nwith a hash then.\n\nSigned-off-by: Jonathan Nieder <jrnieder@gmail.com>\n---\n gettext.h |    2 +-\n 1 files changed, 1 insertions(+), 1 deletions(-)\n\ndiff --git a/gettext.h b/gettext.h\nindex 11d82b0..361962e 100644\n--- a/gettext.h\n+++ b/gettext.h\n@@ -23,7 +23,7 @@\n \n static inline FORMAT_PRESERVING(1) const char *_(const char *msgid)\n {\n-\treturn use_gettext_poison() ? \"# GETTEXT POISON #\" : msgid;\n+\treturn use_gettext_poison() ? \" GETTEXT POISON \" : msgid;\n }\n \n /* Mark msgid for translation but do not translate it. */\n-- \n1.7.4.1\n"},{"id":"162210","messageId":"20110225072212.GC23037@elie","threadId":"26561","inReplyTo":"1298418152-27789-5-git-send-email-avarab@gmail.com","subject":"Re: [PATCH v4 04/73] Makefile: \"pot\" target to extract messages marked for translation","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2011-02-25T07:22:12Z","receivedAt":"2011-02-25T07:22:12Z","isPatch":true,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"Ævar Arnfjörð Bjarmason wrote:\n\n> Add rules to generate a template (po/git.pot) listing messages marked\n> for translation in the C portion of git.\n\nA forgotten piece.  Not urgent at all.\n\n-- 8< --\nSubject: i18n: \"make distclean\" should clean up after \"make pot\"\n\nThis is in \"make distclean\" and not \"make clean\" to avoid needlessly\nchanging the POT-Creation-Date in the following scenario:\n\n\tmake clean;\t# cleaning up after an old build\n\tgit pull\n\tmake pot;\t# regenerate po template if necessary\n\tmsgmerge po/my_language.po po/git.pot\n\nSigned-off-by: Jonathan Nieder <jrnieder@gmail.com>\n---\n Makefile |    1 +\n 1 files changed, 1 insertions(+), 0 deletions(-)\n\ndiff --git a/Makefile b/Makefile\nindex 1cc6c60..7497835 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -2340,6 +2340,7 @@ dist-doc:\n \n distclean: clean\n \t$(RM) configure\n+\t$(RM) po/git.pot\n \n clean:\n \t$(RM) *.o block-sha1/*.o ppc/*.o compat/*.o compat/*/*.o xdiff/*.o vcs-svn/*.o \\\n-- \n1.7.4.1\n"},{"id":"162211","messageId":"20110225075218.GE23037@elie","threadId":"26561","inReplyTo":"1298418152-27789-19-git-send-email-avarab@gmail.com","subject":"Re: [PATCH v4 18/73] gettextize: git-branch \"git branch -v\" messages","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2011-02-25T07:52:18Z","receivedAt":"2011-02-25T07:52:18Z","isPatch":true,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"Ævar Arnfjörð Bjarmason wrote:\n\n> This is possibly a plumbing message.\n\nLuckily it is not one.\n\nEverything up to here looks good still.\n"},{"id":"162212","messageId":"20110225075429.GF23037@elie","threadId":"26561","inReplyTo":"1298418152-27789-18-git-send-email-avarab@gmail.com","subject":"Re: [PATCH v4 17/73] gettextize: git-branch \"Deleted branch [...]\" message","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2011-02-25T07:54:29Z","receivedAt":"2011-02-25T07:54:29Z","isPatch":true,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"Ævar Arnfjörð Bjarmason wrote:\n\n> --- a/builtin/branch.c\n> +++ b/builtin/branch.c\n> @@ -214,7 +214,7 @@ static int delete_branches(int argc, const char **argv, int force, int kinds)\n>  \t\t\tret = 1;\n>  \t\t} else {\n>  \t\t\tstruct strbuf buf = STRBUF_INIT;\n> -\t\t\tprintf(\"Deleted %sbranch %s (was %s).\\n\", remote,\n> +\t\t\tprintf(_(\"Deleted %sbranch %s (was %s).\\n\"), remote,\n\nThis patch might be might easier to read squashed with the previous\none (both for the sake of providing context to reviewers and avoiding\nmixed-language output :)).\n"},{"id":"162213","messageId":"20110225080428.GG23037@elie","threadId":"26561","inReplyTo":"1298418152-27789-24-git-send-email-avarab@gmail.com","subject":"Re: [PATCH v4 23/73] gettextize: git-checkout \"HEAD is now at\" message","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2011-02-25T08:04:28Z","receivedAt":"2011-02-25T08:04:28Z","isPatch":true,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"Ævar Arnfjörð Bjarmason wrote:\n\n> --- a/builtin/checkout.c\n> +++ b/builtin/checkout.c\n> @@ -571,7 +571,7 @@ static void update_refs_for_switch(struct checkout_opts *opts,\n>  \t\tif (!opts->quiet) {\n>  \t\t\tif (old->path && advice_detached_head)\n>  \t\t\t\tdetach_advice(old->path, new->name);\n> -\t\t\tdescribe_detached_head(\"HEAD is now at\", new->commit);\n> +\t\t\tdescribe_detached_head(_(\"HEAD is now at\"), new->commit);\n\nIt might make sense to squash patches 22 and 23 with the following.\n\nSigned-off-by: Jonathan Nieder <jrnieder@gmail.com>\n---\n builtin/checkout.c |    9 ++++++++-\n 1 files changed, 8 insertions(+), 1 deletions(-)\n\ndiff --git a/builtin/checkout.c b/builtin/checkout.c\nindex fb93d63..dca0935 100644\n--- a/builtin/checkout.c\n+++ b/builtin/checkout.c\n@@ -305,7 +305,14 @@ static void describe_detached_head(const char *msg, struct commit *commit)\n \tstruct pretty_print_context ctx = {0};\n \tparse_commit(commit);\n \tpretty_print_commit(CMIT_FMT_ONELINE, commit, &sb, &ctx);\n-\tfprintf(stderr, \"%s %s... %s\\n\", msg,\n+\n+\t/*\n+\t * TRANSLATORS: The first '%s' is either \"Previous HEAD position was\"\n+\t * or \"HEAD is now at\".  The second '%s' is an abbreviated hexadecimal\n+\t * commit id for HEAD and the third '%s' is the first line of its\n+\t * commit message.\n+\t */\n+\tfprintf(stderr, _(\"%s %s... %s\\n\"), msg,\n \t\tfind_unique_abbrev(commit->object.sha1, DEFAULT_ABBREV), sb.buf);\n \tstrbuf_release(&sb);\n }\n-- \n1.7.4.1\n"},{"id":"162214","messageId":"20110225081048.GH23037@elie","threadId":"26561","inReplyTo":"1298418152-27789-25-git-send-email-avarab@gmail.com","subject":"Re: [PATCH v4 24/73] gettextize: git-checkout \"Switched to a .. branch\" message","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2011-02-25T08:10:48Z","receivedAt":"2011-02-25T08:10:48Z","isPatch":true,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"Ævar Arnfjörð Bjarmason wrote:\n\n> --- a/builtin/checkout.c\n> +++ b/builtin/checkout.c\n> @@ -550,9 +550,10 @@ static void update_refs_for_switch(struct checkout_opts *opts,\n>  \t\t\t\tfprintf(stderr, _(\"Already on '%s'\\n\"),\n>  \t\t\t\t\tnew->name);\n>  \t\t\telse if (opts->new_branch)\n> -\t\t\t\tfprintf(stderr, \"Switched to%s branch '%s'\\n\",\n> -\t\t\t\t\topts->branch_exists ? \" and reset\" : \" a new\",\n> -\t\t\t\t\tnew->name);\n> +\t\t\t\tif (opts->branch_exists)\n> +\t\t\t\t\tfprintf(stderr, _(\"Switched to and reset branch '%s'\\n\"), new->name);\n> +\t\t\t\telse\n> +\t\t\t\t\tfprintf(stderr, _(\"Switched to a new branch '%s'\\n\"), new->name);\n>  \t\t\telse\n\nC grammar is on your side, but the following seems worthwhile for\nthe sanity of readers and those who might modify the code in the\nfuture.\n---\n builtin/checkout.c |    7 ++++---\n 1 files changed, 4 insertions(+), 3 deletions(-)\n\ndiff --git a/builtin/checkout.c b/builtin/checkout.c\nindex 92049cb..fc727ce 100644\n--- a/builtin/checkout.c\n+++ b/builtin/checkout.c\n@@ -553,17 +553,18 @@ static void update_refs_for_switch(struct checkout_opts *opts,\n \tif (new->path) {\n \t\tcreate_symref(\"HEAD\", new->path, msg.buf);\n \t\tif (!opts->quiet) {\n-\t\t\tif (old->path && !strcmp(new->path, old->path))\n+\t\t\tif (old->path && !strcmp(new->path, old->path)) {\n \t\t\t\tfprintf(stderr, _(\"Already on '%s'\\n\"),\n \t\t\t\t\tnew->name);\n-\t\t\telse if (opts->new_branch)\n+\t\t\t} else if (opts->new_branch) {\n \t\t\t\tif (opts->branch_exists)\n \t\t\t\t\tfprintf(stderr, _(\"Switched to and reset branch '%s'\\n\"), new->name);\n \t\t\t\telse\n \t\t\t\t\tfprintf(stderr, _(\"Switched to a new branch '%s'\\n\"), new->name);\n-\t\t\telse\n+\t\t\t} else {\n \t\t\t\tfprintf(stderr, _(\"Switched to branch '%s'\\n\"),\n \t\t\t\t\tnew->name);\n+\t\t\t}\n \t\t}\n \t\tif (old->path && old->name) {\n \t\t\tchar log_file[PATH_MAX], ref_file[PATH_MAX];\n-- \n1.7.4.1\n"},{"id":"162220","messageId":"20110225090756.GI23037@elie","threadId":"26561","inReplyTo":"1298418152-27789-28-git-send-email-avarab@gmail.com","subject":"[PATCH] commit: error out for missing commit message template","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2011-02-25T09:07:57Z","receivedAt":"2011-02-25T09:07:57Z","isPatch":true,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"When \"git commit\" was rewritten in C (v1.5.4-rc0~78^2~30,\n2007-11-08), a subtle bug in --template was introduced.  If the\nfile named by a --template parameter is missing, previously git\nwould error out with a message:\n\n\tCommit template file does not exist.\n\nbut in the C version the --template parameter gets ignored and\nthe default template is used.\n\nt7500 has two tests for this case which would have caught it, except\nthat with the default $EDITOR, the commit message template is left\nunmodified, causing 'git commit' to error out and the test to\nsucceed.\n\nSigned-off-by: Jonathan Nieder <jrnieder@gmail.com>\n---\nÆvar Arnfjörð Bjarmason wrote:\n\n> --- a/builtin/commit.c\n> +++ b/builtin/commit.c\n> @@ -725,15 +725,15 @@ static int prepare_to_commit(const char *index_file, const char *prefix,\n[...]\n> -\t\t\t\t\"%s\"\n> -\t\t\t\t\"# Author:    %s\\n\",\n> +\t\t\t\t_(\"%s\"\n> +\t\t\t\t\"# Author:    %s\\n\"),\n\nThe above change causes the commit message template to be nonempty,\nexcluding comments, so bare \"git commit\" succeeds, exposing this\nlongstanding bug.\n\n builtin/commit.c  |    2 +-\n t/t7500-commit.sh |   14 +++++++++++---\n 2 files changed, 12 insertions(+), 4 deletions(-)\n\ndiff --git a/builtin/commit.c b/builtin/commit.c\nindex d7f55e3..1a1fb73 100644\n--- a/builtin/commit.c\n+++ b/builtin/commit.c\n@@ -634,7 +634,7 @@ static int prepare_to_commit(const char *index_file, const char *prefix,\n \t\tif (strbuf_read_file(&sb, git_path(\"SQUASH_MSG\"), 0) < 0)\n \t\t\tdie_errno(\"could not read SQUASH_MSG\");\n \t\thook_arg1 = \"squash\";\n-\t} else if (template_file && !stat(template_file, &statbuf)) {\n+\t} else if (template_file) {\n \t\tif (strbuf_read_file(&sb, template_file, 0) < 0)\n \t\t\tdie_errno(\"could not read '%s'\", template_file);\n \t\thook_arg1 = \"template\";\ndiff --git a/t/t7500-commit.sh b/t/t7500-commit.sh\nindex d551b77..5976f59 100755\n--- a/t/t7500-commit.sh\n+++ b/t/t7500-commit.sh\n@@ -28,13 +28,21 @@ test_expect_success 'a basic commit in an empty tree should succeed' '\n test_expect_success 'nonexistent template file should return error' '\n \techo changes >> foo &&\n \tgit add foo &&\n-\ttest_must_fail git commit --template \"$PWD\"/notexist\n+\t(\n+\t\tGIT_EDITOR=\"echo hello >\\\"\\$1\\\"\" &&\n+\t\texport GIT_EDITOR &&\n+\t\ttest_must_fail git commit --template \"$PWD\"/notexist\n+\t)\n '\n \n test_expect_success 'nonexistent template file in config should return error' '\n \tgit config commit.template \"$PWD\"/notexist &&\n-\ttest_must_fail git commit &&\n-\tgit config --unset commit.template\n+\ttest_when_finished \"git config --unset commit.template\" &&\n+\t(\n+\t\tGIT_EDITOR=\"echo hello >\\\"\\$1\\\"\" &&\n+\t\texport GIT_EDITOR &&\n+\t\ttest_must_fail git commit\n+\t)\n '\n \n # From now on we'll use a template file that exists.\n-- \n1.7.4.1\n"},{"id":"162225","messageId":"20110225094342.GJ23037@elie","threadId":"26561","inReplyTo":"1298418152-27789-28-git-send-email-avarab@gmail.com","subject":"Re: [PATCH v4 27/73] gettextize: git-commit formatting messages","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2011-02-25T09:43:43Z","receivedAt":"2011-02-25T09:43:43Z","isPatch":true,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"Ævar Arnfjörð Bjarmason wrote:\n\n> --- a/builtin/commit.c\n> +++ b/builtin/commit.c\n> @@ -696,12 +696,12 @@ static int prepare_to_commit(const char *index_file, const char *prefix,\n>  \t\tchar *ai_tmp, *ci_tmp;\n>  \t\tif (in_merge)\n>  \t\t\tfprintf(fp,\n> -\t\t\t\t\"#\\n\"\n> +\t\t\t\t_(\"#\\n\"\n[...]\n\n(Everything up to and including patch 26 still looks good.)\n\nHere's a weatherballoon patch to mark the tests affected by patch 27\nas \"expect failure\", in case we want to go that route.  Combined with\n\"commit: error out for missing commit message template\", it passes all\ntests.\n\n-- 8< --\nSubject: i18n: update expected test results for git-commit formatting messages\n\nSigned-off-by: Jonathan Nieder <jrnieder@gmail.com>\n---\n t/lib-commit-template.sh           |   19 ++++++++\n t/t3404-rebase-interactive.sh      |    3 +-\n t/t4013-diff-various.sh            |   82 +++++++++++++++++++++++-------------\n t/t7500-commit.sh                  |   19 ++++----\n t/t7501-commit.sh                  |    9 ++--\n t/t7505-prepare-commit-msg-hook.sh |    7 ++-\n t/t7507-commit-verbose.sh          |    5 +-\n t/t7509-commit.sh                  |    3 +-\n 8 files changed, 97 insertions(+), 50 deletions(-)\n create mode 100644 t/lib-commit-template.sh\n\ndiff --git a/t/lib-commit-template.sh b/t/lib-commit-template.sh\nnew file mode 100644\nindex 0000000..80ec50c\n--- /dev/null\n+++ b/t/lib-commit-template.sh\n@@ -0,0 +1,19 @@\n+#!/bin/sh\n+\n+# Messages such as\n+#\n+#      # It looks like you may be committing a MERGE.\\n\"\n+#\n+# are now translatable, even though the \"# \" part probably ought not\n+# to be.  Expect some tests to fail when GETTEXT_POISON is enabled.\n+\n+if test_have_prereq C_LOCALE_OUTPUT\n+then\n+\ttest_log_messages_expect_success () {\n+\t\ttest_expect_success \"$@\"\n+\t}\n+else\n+\ttest_log_messages_expect_success () {\n+\t\ttest_expect_failure \"$@\"\n+\t}\n+fi\ndiff --git a/t/t3404-rebase-interactive.sh b/t/t3404-rebase-interactive.sh\nindex 7d8147b..84630e3 100755\n--- a/t/t3404-rebase-interactive.sh\n+++ b/t/t3404-rebase-interactive.sh\n@@ -28,6 +28,7 @@ Initial setup:\n . ./test-lib.sh\n \n . \"$TEST_DIRECTORY\"/lib-rebase.sh\n+. \"$TEST_DIRECTORY\"/lib-commit-template.sh\n \n test_cmp_rev () {\n \tgit rev-parse --verify \"$1\" >expect.rev &&\n@@ -390,7 +391,7 @@ D\n ONCE\n EOF\n \n-test_expect_success 'squash and fixup generate correct log messages' '\n+test_log_messages_expect_success 'squash and fixup generate correct log messages' '\n \tgit checkout -b squash-fixup E &&\n \tbase=$(git rev-parse HEAD~4) &&\n \tFAKE_COMMIT_AMEND=\"ONCE\" FAKE_LINES=\"1 fixup 2 squash 3 fixup 4\" \\\ndiff --git a/t/t4013-diff-various.sh b/t/t4013-diff-various.sh\nindex b8f81d0..872c37c 100755\n--- a/t/t4013-diff-various.sh\n+++ b/t/t4013-diff-various.sh\n@@ -6,6 +6,7 @@\n test_description='Various diff formatting options'\n \n . ./test-lib.sh\n+. \"$TEST_DIRECTORY\"/lib-commit-template.sh\n \n LF='\n '\n@@ -95,35 +96,42 @@ test_expect_success setup '\n EOF\n \n V=`git version | sed -e 's/^git version //' -e 's/\\./\\\\./g'`\n-while read cmd\n-do\n-\tcase \"$cmd\" in\n-\t'' | '#'*) continue ;;\n-\tesac\n-\ttest=`echo \"$cmd\" | sed -e 's|[/ ][/ ]*|_|g'`\n-\tpfx=`printf \"%04d\" $test_count`\n-\texpect=\"$TEST_DIRECTORY/t4013/diff.$test\"\n-\tactual=\"$pfx-diff.$test\"\n \n-\ttest_expect_success \"git $cmd\" '\n-\t\t{\n-\t\t\techo \"\\$ git $cmd\"\n-\t\t\tgit $cmd |\n-\t\t\tsed -e \"s/^\\\\(-*\\\\)$V\\\\(-*\\\\)\\$/\\\\1g-i-t--v-e-r-s-i-o-n\\2/\" \\\n-\t\t\t    -e \"s/^\\\\(.*mixed; boundary=\\\"-*\\\\)$V\\\\(-*\\\\)\\\"\\$/\\\\1g-i-t--v-e-r-s-i-o-n\\2\\\"/\"\n-\t\t\techo \"\\$\"\n-\t\t} >\"$actual\" &&\n-\t\tif test -f \"$expect\"\n-\t\tthen\n-\t\t\ttest_cmp \"$expect\" \"$actual\" &&\n-\t\t\trm -f \"$actual\"\n-\t\telse\n-\t\t\t# this is to help developing new tests.\n-\t\t\tcp \"$actual\" \"$expect\"\n-\t\t\tfalse\n-\t\tfi\n-\t'\n-done <<\\EOF\n+try_cmds () {\n+\ttest_expect_expectation=${1:-test_expect_success}\n+\n+\twhile read cmd\n+\tdo\n+\t\tcase \"$cmd\" in\n+\t\t'' | '#'*) continue ;;\n+\t\tesac\n+\t\ttest=`echo \"$cmd\" | sed -e 's|[/ ][/ ]*|_|g'`\n+\t\tpfx=`printf \"%04d\" $test_count`\n+\t\texpect=\"$TEST_DIRECTORY/t4013/diff.$test\"\n+\t\tactual=\"$pfx-diff.$test\"\n+\n+\t\t$test_expect_expectation \"git $cmd\" '\n+\t\t\t{\n+\t\t\t\techo \"\\$ git $cmd\"\n+\t\t\t\tgit $cmd |\n+\t\t\t\tsed -e \"s/^\\\\(-*\\\\)$V\\\\(-*\\\\)\\$/\\\\1g-i-t--v-e-r-s-i-o-n\\2/\" \\\n+\t\t\t\t    -e \"s/^\\\\(.*mixed; boundary=\\\"-*\\\\)$V\\\\(-*\\\\)\\\"\\$/\\\\1g-i-t--v-e-r-s-i-o-n\\2\\\"/\"\n+\t\t\t\techo \"\\$\"\n+\t\t\t} >\"$actual\" &&\n+\t\t\tif test -f \"$expect\"\n+\t\t\tthen\n+\t\t\t\ttest_cmp \"$expect\" \"$actual\" &&\n+\t\t\t\trm -f \"$actual\"\n+\t\t\telse\n+\t\t\t\t# this is to help developing new tests.\n+\t\t\t\tcp \"$actual\" \"$expect\"\n+\t\t\t\tfalse\n+\t\t\tfi\n+\t\t'\n+\tdone\n+}\n+\n+try_cmds <<\\EOF\n diff-tree initial\n diff-tree -r initial\n diff-tree -r --abbrev initial\n@@ -174,25 +182,33 @@ diff-tree --pretty --patch-with-stat side\n \n diff-tree master\n diff-tree -p master\n+EOF\n+try_cmds test_log_messages_expect_success <<\\EOF\n diff-tree -p -m master\n diff-tree -c master\n diff-tree -c --abbrev master\n-diff-tree --cc master\n # stat only should show the diffstat with the first parent\n diff-tree -c --stat master\n diff-tree --cc --stat master\n diff-tree -c --stat --summary master\n diff-tree --cc --stat --summary master\n+EOF\n+try_cmds <<\\EOF\n # stat summary should show the diffstat and summary with the first parent\n diff-tree -c --stat --summary side\n diff-tree --cc --stat --summary side\n+EOF\n+try_cmds test_log_messages_expect_success <<\\EOF\n # improved by Timo's patch\n diff-tree --cc --patch-with-stat master\n # improved by Timo's patch\n diff-tree --cc --patch-with-stat --summary master\n+EOF\n+try_cmds <<\\EOF\n # this is correct\n diff-tree --cc --patch-with-stat --summary side\n-\n+EOF\n+try_cmds test_log_messages_expect_success <<\\EOF\n log master\n log -p master\n log --root master\n@@ -237,14 +253,20 @@ log --patch-with-stat master -- dir/\n whatchanged --patch-with-stat master -- dir/\n log --patch-with-stat --summary master -- dir/\n whatchanged --patch-with-stat --summary master -- dir/\n+EOF\n+try_cmds <<\\EOF\n \n show initial\n show --root initial\n show side\n+EOF\n+try_cmds test_log_messages_expect_success <<\\EOF\n show master\n show -c master\n show -m master\n show --first-parent master\n+EOF\n+try_cmds <<\\EOF\n show --stat side\n show --stat --summary side\n show --patch-with-stat side\ndiff --git a/t/t7500-commit.sh b/t/t7500-commit.sh\nindex 5976f59..614d31b 100755\n--- a/t/t7500-commit.sh\n+++ b/t/t7500-commit.sh\n@@ -8,6 +8,7 @@ test_description='git commit\n Tests for selected commit options.'\n \n . ./test-lib.sh\n+. \"$TEST_DIRECTORY/lib-commit-template.sh\"\n \n commit_msg_is () {\n \texpect=commit_msg_is.expect\n@@ -48,7 +49,7 @@ test_expect_success 'nonexistent template file in config should return error' '\n # From now on we'll use a template file that exists.\n TEMPLATE=\"$PWD\"/template\n \n-test_expect_success 'unedited template should not commit' '\n+test_log_messages_expect_success 'unedited template should not commit' '\n \techo \"template line\" > \"$TEMPLATE\" &&\n \ttest_must_fail git commit --template \"$TEMPLATE\"\n '\n@@ -72,7 +73,7 @@ test_expect_success 'adding comments to a template should not commit' '\n \t)\n '\n \n-test_expect_success 'adding real content to a template should commit' '\n+test_log_messages_expect_success 'adding real content to a template should commit' '\n \t(\n \t\ttest_set_editor \"$TEST_DIRECTORY\"/t7500/add-content &&\n \t\tgit commit --template \"$TEMPLATE\"\n@@ -80,7 +81,7 @@ test_expect_success 'adding real content to a template should commit' '\n \tcommit_msg_is \"template linecommit message\"\n '\n \n-test_expect_success '-t option should be short for --template' '\n+test_log_messages_expect_success '-t option should be short for --template' '\n \techo \"short template\" > \"$TEMPLATE\" &&\n \techo \"new content\" >> foo &&\n \tgit add foo &&\n@@ -91,7 +92,7 @@ test_expect_success '-t option should be short for --template' '\n \tcommit_msg_is \"short templatecommit message\"\n '\n \n-test_expect_success 'config-specified template should commit' '\n+test_log_messages_expect_success 'config-specified template should commit' '\n \techo \"new template\" > \"$TEMPLATE\" &&\n \tgit config commit.template \"$TEMPLATE\" &&\n \techo \"more content\" >> foo &&\n@@ -206,7 +207,7 @@ test_expect_success 'commit -F overrides -t' '\n \tcommit_msg_is \"-F log\"\n '\n \n-test_expect_success 'Commit without message is allowed with --allow-empty-message' '\n+test_log_messages_expect_success 'Commit without message is allowed with --allow-empty-message' '\n \techo \"more content\" >>foo &&\n \tgit add foo &&\n \t>empty &&\n@@ -214,7 +215,7 @@ test_expect_success 'Commit without message is allowed with --allow-empty-messag\n \tcommit_msg_is \"\"\n '\n \n-test_expect_success 'Commit without message is no-no without --allow-empty-message' '\n+test_log_messages_expect_success 'Commit without message is no-no without --allow-empty-message' '\n \techo \"more content\" >>foo &&\n \tgit add foo &&\n \t>empty &&\n@@ -270,7 +271,7 @@ test_expect_success 'commit --squash works with -C' '\n \tcommit_msg_is \"squash! target message subject lineintermediate commit\"\n '\n \n-test_expect_success 'commit --squash works with -c' '\n+test_log_messages_expect_success 'commit --squash works with -c' '\n \tcommit_for_rebase_autosquash_setup &&\n \ttest_set_editor \"$TEST_DIRECTORY\"/t7500/edit-content &&\n \tgit commit --squash HEAD~1 -c HEAD &&\n@@ -283,14 +284,14 @@ test_expect_success 'commit --squash works with -C for same commit' '\n \tcommit_msg_is \"squash! intermediate commit\"\n '\n \n-test_expect_success 'commit --squash works with -c for same commit' '\n+test_log_messages_expect_success 'commit --squash works with -c for same commit' '\n \tcommit_for_rebase_autosquash_setup &&\n \ttest_set_editor \"$TEST_DIRECTORY\"/t7500/edit-content &&\n \tgit commit --squash HEAD -c HEAD &&\n \tcommit_msg_is \"squash! edited commit\"\n '\n \n-test_expect_success 'commit --squash works with editor' '\n+test_log_messages_expect_success 'commit --squash works with editor' '\n \tcommit_for_rebase_autosquash_setup &&\n \ttest_set_editor \"$TEST_DIRECTORY\"/t7500/add-content &&\n \tgit commit --squash HEAD~1 &&\ndiff --git a/t/t7501-commit.sh b/t/t7501-commit.sh\nindex 8980738..af6a829 100755\n--- a/t/t7501-commit.sh\n+++ b/t/t7501-commit.sh\n@@ -8,6 +8,7 @@\n \n test_description='git commit'\n . ./test-lib.sh\n+. \"$TEST_DIRECTORY\"/lib-commit-template.sh\n \n test_tick\n \n@@ -163,7 +164,7 @@ d381ac431806e53f3dd7ac2f1ae0534f36d738b9\n 402702b49136e7587daa9280e91e4bb7cb2179f7\n EOF\n \n-test_expect_success \\\n+test_log_messages_expect_success \\\n     'validate git rev-list output.' \\\n     'test_cmp expected current'\n \n@@ -200,7 +201,7 @@ test_expect_success 'partial commit that involves removal (3)' '\n '\n \n author=\"The Real Author <someguy@his.email.org>\"\n-test_expect_success 'amend commit to fix author' '\n+test_log_messages_expect_success 'amend commit to fix author' '\n \n \toldtick=$GIT_AUTHOR_DATE &&\n \ttest_tick &&\n@@ -215,7 +216,7 @@ test_expect_success 'amend commit to fix author' '\n \n '\n \n-test_expect_success 'amend commit to fix date' '\n+test_log_messages_expect_success 'amend commit to fix date' '\n \n \ttest_tick &&\n \tnewtick=$GIT_AUTHOR_DATE &&\n@@ -329,7 +330,7 @@ test_expect_success 'multiple -m' '\n '\n \n author=\"The Real Author <someguy@his.email.org>\"\n-test_expect_success 'amend commit to fix author' '\n+test_log_messages_expect_success 'amend commit to fix author' '\n \n \toldtick=$GIT_AUTHOR_DATE &&\n \ttest_tick &&\ndiff --git a/t/t7505-prepare-commit-msg-hook.sh b/t/t7505-prepare-commit-msg-hook.sh\nindex ff18962..2d7ec32 100755\n--- a/t/t7505-prepare-commit-msg-hook.sh\n+++ b/t/t7505-prepare-commit-msg-hook.sh\n@@ -3,6 +3,7 @@\n test_description='prepare-commit-msg hook'\n \n . ./test-lib.sh\n+. \"$TEST_DIRECTORY\"/lib-commit-template.sh\n \n test_expect_success 'with no hook' '\n \n@@ -103,7 +104,7 @@ test_expect_success 'with hook (-C)' '\n \n '\n \n-test_expect_success 'with hook (editor)' '\n+test_log_messages_expect_success 'with hook (editor)' '\n \n \techo \"more more\" >> file &&\n \tgit add file &&\n@@ -112,7 +113,7 @@ test_expect_success 'with hook (editor)' '\n \n '\n \n-test_expect_success 'with hook (--amend)' '\n+test_log_messages_expect_success 'with hook (--amend)' '\n \n \thead=`git rev-parse HEAD` &&\n \techo \"more\" >> file &&\n@@ -122,7 +123,7 @@ test_expect_success 'with hook (--amend)' '\n \n '\n \n-test_expect_success 'with hook (-c)' '\n+test_log_messages_expect_success 'with hook (-c)' '\n \n \thead=`git rev-parse HEAD` &&\n \techo \"more\" >> file &&\ndiff --git a/t/t7507-commit-verbose.sh b/t/t7507-commit-verbose.sh\nindex da5bd3b..62c42b3 100755\n--- a/t/t7507-commit-verbose.sh\n+++ b/t/t7507-commit-verbose.sh\n@@ -2,6 +2,7 @@\n \n test_description='verbose commit template'\n . ./test-lib.sh\n+. \"$TEST_DIRECTORY\"/lib-commit-template.sh\n \n cat >check-for-diff <<EOF\n #!$SHELL_PATH\n@@ -37,12 +38,12 @@ check_message() {\n \ttest_cmp \"$1\" actual\n }\n \n-test_expect_success 'verbose diff is stripped out' '\n+test_log_messages_expect_success 'verbose diff is stripped out' '\n \tgit commit --amend -v &&\n \tcheck_message message\n '\n \n-test_expect_success 'verbose diff is stripped out (mnemonicprefix)' '\n+test_log_messages_expect_success 'verbose diff is stripped out (mnemonicprefix)' '\n \tgit config diff.mnemonicprefix true &&\n \tgit commit --amend -v &&\n \tcheck_message message\ndiff --git a/t/t7509-commit.sh b/t/t7509-commit.sh\nindex 77b6920..2820b89 100755\n--- a/t/t7509-commit.sh\n+++ b/t/t7509-commit.sh\n@@ -6,6 +6,7 @@\n test_description='git commit --reset-author'\n \n . ./test-lib.sh\n+. \"$TEST_DIRECTORY\"/lib-commit-template.sh\n \n author_header () {\n \tgit cat-file commit \"$1\" |\n@@ -57,7 +58,7 @@ test_expect_success '-c option copies authorship and message' '\n \ttest_cmp expect actual\n '\n \n-test_expect_success '-c option copies only the message with --reset-author' '\n+test_log_messages_expect_success '-c option copies only the message with --reset-author' '\n \techo \"Test 4\" >>foo &&\n \ttest_tick &&\n \tEDITOR=: VISUAL=: git commit -a -c Initial --reset-author &&\n-- \n1.7.4.1\n"},{"id":"162246","messageId":"7vvd08atnu.fsf@alter.siamese.dyndns.org","threadId":"26561","inReplyTo":"20110225070834.GB23037@elie","subject":"Re: [PATCH v4 02/73] gettext tests: add GETTEXT_POISON to simulate unfriendly translator","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2011-02-25T17:52:21Z","receivedAt":"2011-02-25T17:52:21Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Jonathan Nieder <jrnieder@gmail.com> writes:\n\n[offtopic: why is Jakub on the CC list? -- I don't recall him saying much\non this topic yet...]\n\n> The idea of the GETTEXT_POISON facility is to simulate a worst-case\n> translation, so that strings marked for translation that cause trouble\n> can be noticed and dealt with.\n\nI've never thought this was about a \"worst-case translation\".\n\nIsn't this about emitting all the strings marked for translation in a form\nsignificantly different from the original, in the hope that such an output\nwould help us find messages that should never be marked for translation by\ntriggering test failures?  I do not see any \"worst-case\", just different\nenough for the plumbing tests to break.\n\nIOW, I don't think this is about helping translators in l10n, but about\nhelping coders in i18n department.\n\n> A string starting with \"#\" does not seem particularly well suited\n> for that purpose, since it makes '#' characters that mark a comment\n> and that translators must be careful not to remove harder to find.\n\nHence, I would suggest an alternative phrasing of the above part (and\nalternative way of thinking): '... since it easily hides a mistaken\nmarking of a line that _has_ to always start with \"#\" followed by a\ntranslatable string.'\n"},{"id":"162247","messageId":"7vd3mgar5g.fsf@alter.siamese.dyndns.org","threadId":"26561","inReplyTo":"20110225094342.GJ23037@elie","subject":"Re: [PATCH v4 27/73] gettextize: git-commit formatting messages","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2011-02-25T18:46:35Z","receivedAt":"2011-02-25T18:46:35Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Jonathan Nieder <jrnieder@gmail.com> writes:\n\n> diff --git a/t/lib-commit-template.sh b/t/lib-commit-template.sh\n> new file mode 100644\n> index 0000000..80ec50c\n> --- /dev/null\n> +++ b/t/lib-commit-template.sh\n> @@ -0,0 +1,19 @@\n> +#!/bin/sh\n> +\n> +# Messages such as\n> +#\n> +#      # It looks like you may be committing a MERGE.\\n\"\n> +#\n> +# are now translatable, even though the \"# \" part probably ought not\n> +# to be.  Expect some tests to fail when GETTEXT_POISON is enabled.\n\nWe shouldn't mark \"# \" part as translatable to begin with.  Perhaps the\nunderlying code in wt-status.c needs to be changed even before we merge\nthe i18n _() patches to make it easier?\n\nIt might be a good idea to introduce status_print{,_ln,_more} wrapper\nfunctions around color_vfprintf(), and change the existing callers to look\nlike this:\n\n                const char *c = color(WT_STATUS_HEADER, s);\n\n        -       color_fprintf_ln(s->fp, c, \"# Unmerged paths:\");\n        +       status_printf_ln(s, c, \"Unmerged paths:\");\n                if (!advice_status_hints)\n                        return;\n                if (s->in_merge)\n                        ;\n        ...\n\n        -       color_fprintf(s->fp, color(WT_STATUS_HEADER, s), \"#\\t\");\n        +       status_printf(s, color(WT_STATUS_HEADER, s), \"\\t\");\n                switch (status) {\n                case DIFF_STATUS_ADDED:\n        -               color_fprintf(s->fp, c, \"new file:   %s\", one);\n        +               status_printf_more(s, c, \"new file:   %s\", one);\n                        break;\n\nPossible semantics for the three wrappers are:\n\n * status_printf_ln() takes all the parameters necessary to produce a\n   single line; it works just like color_fprintf_ln() but adds the \"# \"\n   prefix itself.\n\n * status_printf_more() is just a synonym for color_fprintf_ln() in the\n   above but is not necessary.\n\n * status_printf() would be like color_printf() but adds the \"# \" prefix\n   itself.\n\nI am Ok with naming \"status-printf-more\" to just \"status-printf\" and\nrenaming \"status-printf\" to \"status-printf-bol\", as long as we have two\nfunctions, one that adds \"# \" and the other that does not.\n\nThe adding of \"# \" done by status_printf() and status_printf_ln() can and\nprobably should have a bit of twist to adjust to the _real_ contents that\nare fed to them.\n\nIdeally, status_printf_ln(s, color, \"\") should omit the trailing SP and\ngive \"<COLOR>#</COLOR>\\n\", and status_printf(s, color, \"\\t\") should should\ngive \"<COLOR>#\\t</COLOR>\" to avoid SP-HT.\n\nDoing this would have two advantages over the current code:\n\n - The obvious one is to force separation of the \"#\" from the translatable\n   part of the message, which is the topic of this thread.\n\n - Another advantage is that this makes it easier for us to drop \"#\"\n   prefix in \"git status\" output in later versions of git if we wanted to.\n\nIn \"git commit\" template, these lines need to be made into comments, but\nthere is no reason, other than that we are sooooo used to seeing these\nlines prefixed with \"# \", in \"git status\" output.\n"},{"id":"162254","messageId":"7vmxljaozi.fsf@alter.siamese.dyndns.org","threadId":"26561","inReplyTo":"20110225081048.GH23037@elie","subject":"Re: [PATCH v4 24/73] gettextize: git-checkout \"Switched to a .. branch\" message","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2011-02-25T19:33:21Z","receivedAt":"2011-02-25T19:33:21Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Jonathan Nieder <jrnieder@gmail.com> writes:\n\n> C grammar is on your side, but the following seems worthwhile for\n> the sanity of readers and those who might modify the code in the\n> future.\n\nGood point.  Thanks.\n"},{"id":"162257","messageId":"AANLkTikGZL--hn-BTPmPK-9oDi0p1h6o7EZ47jeEF0iY@mail.gmail.com","threadId":"26561","inReplyTo":"20110225081048.GH23037@elie","subject":"Re: [PATCH v4 24/73] gettextize: git-checkout \"Switched to a .. branch\" message","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2011-02-25T19:47:15Z","receivedAt":"2011-02-25T19:47:15Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"On Fri, Feb 25, 2011 at 09:10, Jonathan Nieder <jrnieder@gmail.com> wrote:\n\n> C grammar is on your side, but the following seems worthwhile for\n> the sanity of readers and those who might modify the code in the\n> future.\n\nAgreed, and IIRC GCC and others will warn about nested if's without\n{}, even if they're unambiguous[1].\n\n1. IIRC GCC will warn about them being \"ambiguous\", but they're not\n   according to the standard. I think some GCC programmer confused\n   \"ambiguous\" and \"potentially misleading\".\n"},{"id":"162262","messageId":"AANLkTimdNXFjDLhKqGidLeqgeRnKCcYcnfMwgcAkwP0m@mail.gmail.com","threadId":"26561","inReplyTo":"7vvd08atnu.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH v4 02/73] gettext tests: add GETTEXT_POISON to simulate unfriendly translator","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2011-02-25T19:50:05Z","receivedAt":"2011-02-25T19:50:05Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"On Fri, Feb 25, 2011 at 18:52, Junio C Hamano <gitster@pobox.com> wrote:\n> Jonathan Nieder <jrnieder@gmail.com> writes:\n>\n> [offtopic: why is Jakub on the CC list? -- I don't recall him saying much\n> on this topic yet...]\n\nI see that I screwed up my J-completion. I meant to include Jonathan,\nnot Jakub. Oops. Sorry for the spam Jakub.\n\n>> The idea of the GETTEXT_POISON facility is to simulate a worst-case\n>> translation, so that strings marked for translation that cause trouble\n>> can be noticed and dealt with.\n>\n> I've never thought this was about a \"worst-case translation\".\n>\n> Isn't this about emitting all the strings marked for translation in a form\n> significantly different from the original, in the hope that such an output\n> would help us find messages that should never be marked for translation by\n> triggering test failures?  I do not see any \"worst-case\", just different\n> enough for the plumbing tests to break.\n>\n> IOW, I don't think this is about helping translators in l10n, but about\n> helping coders in i18n department.\n\nYes, exactly.\n"},{"id":"162260","messageId":"AANLkTim72p3H5zrELsApN8EM1CAU1H=FdjaoL+s=cJzH@mail.gmail.com","threadId":"26561","inReplyTo":"20110225072212.GC23037@elie","subject":"Re: [PATCH v4 04/73] Makefile: \"pot\" target to extract messages marked for translation","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2011-02-25T19:53:21Z","receivedAt":"2011-02-25T19:53:21Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"On Fri, Feb 25, 2011 at 08:22, Jonathan Nieder <jrnieder@gmail.com> wrote:\n\n> A forgotten piece.  Not urgent at all.\n\nYeah, noticed this. Meant to sent a fixup for it. Thanks for beating\nme to it.\n\nThere's also one other (future) issue your `mv $i+ $i` trick confuses\nxgettext, which complains about invalid CHARSET in a later patch when\nthere's more than one xgettext call. I.e. it doesn't like to append to\nfiles that don't end in *.pot for some reason.\n\nThe output is still the same though, so the warning doesn't have any\nreal effect.\n\nJust thought I'd mention it.\n"},{"id":"162259","messageId":"7vaahjanx8.fsf@alter.siamese.dyndns.org","threadId":"26561","inReplyTo":"AANLkTikGZL--hn-BTPmPK-9oDi0p1h6o7EZ47jeEF0iY@mail.gmail.com","subject":"Re: [PATCH v4 24/73] gettextize: git-checkout \"Switched to a .. branch\" message","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2011-02-25T19:56:19Z","receivedAt":"2011-02-25T19:56:19Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"I've locally amended this, and inserted the distclean-pot, in the series,\nso no need to resend only for these two.\n\nIf you are re-rolling the series, please don't forget to include them, as\nI'd be wholesale replacing in that case.\n\nThanks.\n"},{"id":"162261","messageId":"AANLkTi=Ua=2zm3GhHJVfECJ5VcZaMnRf9MYjSONoWcP4@mail.gmail.com","threadId":"26561","inReplyTo":"20110225075429.GF23037@elie","subject":"Re: [PATCH v4 17/73] gettextize: git-branch \"Deleted branch [...]\" message","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2011-02-25T19:58:50Z","receivedAt":"2011-02-25T19:58:50Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"On Fri, Feb 25, 2011 at 08:54, Jonathan Nieder <jrnieder@gmail.com> wrote:\n> Ævar Arnfjörð Bjarmason wrote:\n>\n>> --- a/builtin/branch.c\n>> +++ b/builtin/branch.c\n>> @@ -214,7 +214,7 @@ static int delete_branches(int argc, const char **argv, int force, int kinds)\n>>                       ret = 1;\n>>               } else {\n>>                       struct strbuf buf = STRBUF_INIT;\n>> -                     printf(\"Deleted %sbranch %s (was %s).\\n\", remote,\n>> +                     printf(_(\"Deleted %sbranch %s (was %s).\\n\"), remote,\n>\n> This patch might be might easier to read squashed with the previous\n> one (both for the sake of providing context to reviewers and avoiding\n> mixed-language output :)).\n\nI split it up from the rest because I always tried to group\ntranslations with the tests they broke, and only the tests they broke\nand vice versa.\n\nIt was often a lot of work figuring out what translation broke what\ntests. IIRC splitting this all took me around half a day at the time.\n\nSo while it's easy to find out what message is the relevant one in\nthis case, this is an attribute of the series I'd really like to keep\nfor future bookkeeping. It's nice to be able to annotate a line in the\ntest suite and see a patch that changes *just* that message and\nrelated tests, not a lot of other unrelated messages.\n"},{"id":"162265","messageId":"AANLkTi=J3C9SUm1HpnXwjOpJjQG7nCQuPkNhenyN0ZtD@mail.gmail.com","threadId":"26561","inReplyTo":"7vd3mgar5g.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH v4 27/73] gettextize: git-commit formatting messages","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2011-02-25T20:01:53Z","receivedAt":"2011-02-25T20:01:53Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"On Fri, Feb 25, 2011 at 19:46, Junio C Hamano <gitster@pobox.com> wrote:\n> Jonathan Nieder <jrnieder@gmail.com> writes:\n>\n>> diff --git a/t/lib-commit-template.sh b/t/lib-commit-template.sh\n>> new file mode 100644\n>> index 0000000..80ec50c\n>> --- /dev/null\n>> +++ b/t/lib-commit-template.sh\n>> @@ -0,0 +1,19 @@\n>> +#!/bin/sh\n>> +\n>> +# Messages such as\n>> +#\n>> +#      # It looks like you may be committing a MERGE.\\n\"\n>> +#\n>> +# are now translatable, even though the \"# \" part probably ought not\n>> +# to be.  Expect some tests to fail when GETTEXT_POISON is enabled.\n>\n> We shouldn't mark \"# \" part as translatable to begin with.  Perhaps the\n> underlying code in wt-status.c needs to be changed even before we merge\n> the i18n _() patches to make it easier?\n\nAgreed, and Jonathan already implemented this:\n\n    https://github.com/avar/git/commit/394a9d1\n    https://github.com/avar/git/commit/da15d84\n\nPerhaps it would be better to modify that patch so it goes in ahead of\nthe i18n series. It would simplify this going back and forth within\ni18n itself.\n"},{"id":"162266","messageId":"7v1v2van3e.fsf@alter.siamese.dyndns.org","threadId":"26561","inReplyTo":"20110225090756.GI23037@elie","subject":"Re: [PATCH] commit: error out for missing commit message template","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2011-02-25T20:14:13Z","receivedAt":"2011-02-25T20:14:13Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Jonathan Nieder <jrnieder@gmail.com> writes:\n\n>> --- a/builtin/commit.c\n>> +++ b/builtin/commit.c\n>> @@ -725,15 +725,15 @@ static int prepare_to_commit(const char *index_file, const char *prefix,\n> [...]\n>> -\t\t\t\t\"%s\"\n>> -\t\t\t\t\"# Author:    %s\\n\",\n>> +\t\t\t\t_(\"%s\"\n>> +\t\t\t\t\"# Author:    %s\\n\"),\n>\n> The above change causes the commit message template to be nonempty,\n> excluding comments, so bare \"git commit\" succeeds, exposing this\n> longstanding bug.\n\nThanks; using \"#\" at the beginning of poison message sometimes has its\nuses ;-)\n\nWill queue.\n"},{"id":"162272","messageId":"20110225211638.GB4580@elie","threadId":"26561","inReplyTo":"AANLkTi=Ua=2zm3GhHJVfECJ5VcZaMnRf9MYjSONoWcP4@mail.gmail.com","subject":"Re: [PATCH v4 17/73] gettextize: git-branch \"Deleted branch [...]\" message","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2011-02-25T21:16:38Z","receivedAt":"2011-02-25T21:16:38Z","isPatch":true,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"(-cc: Jakub)\n\nÆvar Arnfjörð Bjarmason wrote:\n\n> I split it up from the rest because I always tried to group\n> translations with the tests they broke, and only the tests they broke\n> and vice versa.\n>\n> It was often a lot of work figuring out what translation broke what\n> tests. IIRC splitting this all took me around half a day at the time.\n>\n> So while it's easy to find out what message is the relevant one in\n> this case, this is an attribute of the series I'd really like to keep\n> for future bookkeeping. It's nice to be able to annotate a line in the\n> test suite and see a patch that changes *just* that message and\n> related tests, not a lot of other unrelated messages.\n\nMakes sense, and thanks for doing that.  It is nice to see the mass of\nmessages for each command that don't produce complications separate\nfrom the harder ones.\n\nCheers,\nJonathan\n"},{"id":"162273","messageId":"20110225212010.GC4580@elie","threadId":"26561","inReplyTo":"AANLkTim72p3H5zrELsApN8EM1CAU1H=FdjaoL+s=cJzH@mail.gmail.com","subject":"Re: [PATCH v4 04/73] Makefile: \"pot\" target to extract messages marked for translation","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2011-02-25T21:20:10Z","receivedAt":"2011-02-25T21:20:10Z","isPatch":true,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"(-cc: Jakub)\nÆvar Arnfjörð Bjarmason wrote:\n\n> There's also one other (future) issue your `mv $i+ $i` trick confuses\n> xgettext, which complains about invalid CHARSET in a later patch when\n> there's more than one xgettext call. I.e. it doesn't like to append to\n> files that don't end in *.pot for some reason.\n\nHmm, I had been wondering where that message came from.  Maybe the\nfollowing would help?\n\nSigned-off-by: Jonathan Nieder <jrnieder@gmail.com>\n---\n Makefile      |    4 ++--\n po/.gitignore |    2 +-\n 2 files changed, 3 insertions(+), 3 deletions(-)\n\ndiff --git a/Makefile b/Makefile\nindex 7497835..781af23 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -2068,8 +2068,8 @@ XGETTEXT_FLAGS_C = $(XGETTEXT_FLAGS) --keyword=_ --keyword=N_ --language=C\n LOCALIZED_C := $(C_OBJ:o=c)\n \n po/git.pot: $(LOCALIZED_C)\n-\t$(QUIET_XGETTEXT)$(XGETTEXT) -o$@+ $(XGETTEXT_FLAGS_C) $(LOCALIZED_C) && \\\n-\tmv $@+ $@\n+\t$(QUIET_XGETTEXT)$(XGETTEXT) -ogit-tmp.pot $(XGETTEXT_FLAGS_C) $(LOCALIZED_C) && \\\n+\tmv git-tmp.pot $@\n \n pot: po/git.pot\n \ndiff --git a/po/.gitignore b/po/.gitignore\nindex a242a86..e3a8c5d 100644\n--- a/po/.gitignore\n+++ b/po/.gitignore\n@@ -1 +1 @@\n-/git.pot\n+*.pot\n-- \n1.7.4.1\n"},{"id":"162274","messageId":"20110225213505.GD4580@elie","threadId":"26561","inReplyTo":"7vd3mgar5g.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH v4 27/73] gettextize: git-commit formatting messages","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2011-02-25T21:35:05Z","receivedAt":"2011-02-25T21:35:05Z","isPatch":true,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"Junio C Hamano wrote:\n\n> It might be a good idea to introduce status_print{,_ln,_more} wrapper\n> functions around color_vfprintf()\n\nMy main obstacle to sending this was lack of good names for the\nrelevant functions. :)\n\n>  - Another advantage is that this makes it easier for us to drop \"#\"\n>    prefix in \"git status\" output in later versions of git if we wanted to.\n>\n> In \"git commit\" template, these lines need to be made into comments, but\n> there is no reason, other than that we are sooooo used to seeing these\n> lines prefixed with \"# \", in \"git status\" output.\n\nGood point.  Expect patches soon (for the status_print*, not \"#\" removal\nfrom output).\n"},{"id":"162275","messageId":"7vsjvb94p6.fsf@alter.siamese.dyndns.org","threadId":"26561","inReplyTo":"20110225212010.GC4580@elie","subject":"Re: [PATCH v4 04/73] Makefile: \"pot\" target to extract messages marked for translation","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2011-02-25T21:36:53Z","receivedAt":"2011-02-25T21:36:53Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Jonathan Nieder <jrnieder@gmail.com> writes:\n\n> Hmm, I had been wondering where that message came from.  Maybe the\n> following would help?\n> ...\n>  po/git.pot: $(LOCALIZED_C)\n> -\t$(QUIET_XGETTEXT)$(XGETTEXT) -o$@+ $(XGETTEXT_FLAGS_C) $(LOCALIZED_C) && \\\n> -\tmv $@+ $@\n> +\t$(QUIET_XGETTEXT)$(XGETTEXT) -ogit-tmp.pot $(XGETTEXT_FLAGS_C) $(LOCALIZED_C) && \\\n> +\tmv git-tmp.pot $@\n\nYeah, or \"tmp-$@\".\n\nIn either case, I'd prefer to see the above removed the temporary and the\ntarget before running the command, following the idiom:\n\n\trm -f $@+ $@ && \\\n        $(command that does not remove its output when killed) -o $@+ && \\\n        mv $@+ $@\n\nDoes xgettext leave output file specified with -o when it gets killed?  If\nnot, we don't have to use a temporary.  Makefiles in gitk and git-gui do\nnot seem to protect against it either.\n"},{"id":"162278","messageId":"20110225221139.GE4580@elie","threadId":"26561","inReplyTo":"7vsjvb94p6.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH v4 04/73] Makefile: \"pot\" target to extract messages marked for translation","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2011-02-25T22:11:39Z","receivedAt":"2011-02-25T22:11:39Z","isPatch":true,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"Junio C Hamano wrote:\n\n> Does xgettext leave output file specified with -o when it gets killed?\n\nI don't think so.  But xgettext collects output and then writes it all\nin one swoop, so it's hard to provoke problems that way in practice.\n\nThe possibility that had me worried is what hat happens when we start\ntranslating shell scripts:\n\n\txgettext -o$@ $(XGETTEXT_FLAGS_C) $(LOCALIZED_C)\n\txgettext -o$@ --add-missing $(XGETTEXT_FLAGS_SH) $(LOCALIZED_SH)\n\txgettext -o$@ --add-missing $(XGETTEXT_FLAGS_PERL) $(LOCALIZED_PERL)\n\nIf the build is interrupted partway through, the output from the\ncommands that succeeded will remain and leave out the messages that\nwould have been added later out of the template.\n"},{"id":"162295","messageId":"201102261055.58539.jnareb@gmail.com","threadId":"26561","inReplyTo":"1298418152-27789-65-git-send-email-avarab@gmail.com","subject":"Re: [PATCH v4 64/73] gettextize: git-describe basic messages","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2011-02-26T09:55:55Z","receivedAt":"2011-02-26T09:55:55Z","isPatch":true,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"On Wed, 23 Feb 2011, Ævar Arnfjörð Bjarmason wrote:\n\n>                 if (strcmp(n->tag->tag, all ? n->path + 5 : n->path))\n> -                       warning(\"tag '%s' is really '%s' here\", n->tag->tag, n->path);\n> +                       warning(_(\"tag '%s' is really '%s' here\"), n->tag->tag, n->path);\n>                 n->name_checked = 1;\n>         }\n\nDon't we need to use order notation to be able to change order of those\ntwo parameters, i.e. use\n\n  +                       warning(_(\"tag '%1$s' is really '%2$s' here\"), n->tag->tag, n->path);\n\nPerhaps also some comment for translators describing placeholders?\n\n-- \nJakub Narebski\nPoland\n"},{"id":"162296","messageId":"7v1v2v868w.fsf@alter.siamese.dyndns.org","threadId":"26561","inReplyTo":"7vaahjanx8.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH v4 24/73] gettextize: git-checkout \"Switched to a .. branch\" message","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2011-02-26T10:01:03Z","receivedAt":"2011-02-26T10:01:03Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Junio C Hamano <gitster@pobox.com> writes:\n\n> I've locally amended this, and inserted the distclean-pot, in the series,\n> so no need to resend only for these two.\n\nTonight's quick status update, just to save everybody's time to avoid\nduplicated work:\n\n - I queued Jonathan's reroll of Jeff's strbuf_vaddf() on jk/strbuf-vaddf\n   topic (on top of the 'master');\n\n - Jonathan's status_color_* work is queued on jn/status-translatable,\n   which is forked from (i.e. builds on top of) jk/strbuf-vaddf;\n\n - Jeff's GIT_TRACE_FROTZ work is on jk/trace-sifter, also building on top\n   of jk/strbuf-vaddf; and\n\n - Ævar's ab/i18n was rebased on jn/status-translatable.\n\nI've merged all of the above to 'pu' and pushed the results out.  It\nhopefully will mirror out shortly.\n"},{"id":"162297","messageId":"7vwrkn6rks.fsf@alter.siamese.dyndns.org","threadId":"26561","inReplyTo":"201102261055.58539.jnareb@gmail.com","subject":"Re: [PATCH v4 64/73] gettextize: git-describe basic messages","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2011-02-26T10:03:15Z","receivedAt":"2011-02-26T10:03:15Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Jakub Narebski <jnareb@gmail.com> writes:\n\n> Don't we need to use order notation to be able to change order of those\n> two parameters, i.e. use\n>\n>   +                       warning(_(\"tag '%1$s' is really '%2$s' here\"), n->tag->tag, n->path);\n\nYes, translators to languages that want to swap orders would need to know\nabout the placeholder notation; the canonical C locale messages you see in\nthese patches do not have to have them, though.\n"},{"id":"162312","messageId":"AANLkTimui6T5b8w1wXgVsNu5y0OA9S_UMofs2K=Tx-ZW@mail.gmail.com","threadId":"26561","inReplyTo":"201102261055.58539.jnareb@gmail.com","subject":"Re: [PATCH v4 64/73] gettextize: git-describe basic messages","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2011-02-26T13:16:36Z","receivedAt":"2011-02-26T13:16:36Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"On Sat, Feb 26, 2011 at 10:55, Jakub Narebski <jnareb@gmail.com> wrote:\n> On Wed, 23 Feb 2011, Ævar Arnfjörð Bjarmason wrote:\n>\n>>                 if (strcmp(n->tag->tag, all ? n->path + 5 : n->path))\n>> -                       warning(\"tag '%s' is really '%s' here\", n->tag->tag, n->path);\n>> +                       warning(_(\"tag '%s' is really '%s' here\"), n->tag->tag, n->path);\n>>                 n->name_checked = 1;\n>>         }\n>\n> Don't we need to use order notation to be able to change order of those\n> two parameters, i.e. use\n>\n>  +                       warning(_(\"tag '%1$s' is really '%2$s' here\"), n->tag->tag, n->path);\n>\n> Perhaps also some comment for translators describing placeholders?\n\nNo, the original string doesn't need those. But the translators can\ninsert them in their PO file if they want.\n"},{"id":"162378","messageId":"4D6AA283.6010102@gmail.com","threadId":"26561","inReplyTo":"1298418152-27789-17-git-send-email-avarab@gmail.com","subject":"Re: [PATCH v4 16/73] gettextize: git-branch \"remote branch '%s' not found\" message","fromName":"Piotr Krukowiecki","fromEmail":"piotr.krukowiecki@gmail.com","sentAt":"2011-02-27T19:14:11Z","receivedAt":"2011-02-27T19:14:11Z","isPatch":true,"sender":{"key":"piotr.krukowiecki@gmail.com","avatar":"https://avatars.githubusercontent.com/u/3259959?v=4"},"body":"W dniu 23.02.2011 00:41, Ævar Arnfjörð Bjarmason pisze:\n> This could be done better by splitting it up, but it would change too\n> much code, which I'm trying to avoid at this point. Instead add a\n> TRANSLATORS comment to explain what \"remote \" does.\n\nNot sure what you meant by splitting it up. Hopefully not splitting the\ntext even more?\n\nIMO all such code will have to be rewritten to allow better translation.\nExample patch at the bottom.\n\nI remember at least one more such case - it was sth like \"%s %s %s\" where\nfirst part was translatable but defined somewhere else.\n\nThis can be done before or after applying the i18n patches, but if it's going\nto be done after, then I think it'd be better to mark such places as \"to be\nrewritten\" instead of just simply marking them for translation.\n\n> \n> Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n> ---\n>  builtin/branch.c |    3 ++-\n>  1 files changed, 2 insertions(+), 1 deletions(-)\n> \n> diff --git a/builtin/branch.c b/builtin/branch.c\n> index 6695db4..e9d8a5a 100644\n> --- a/builtin/branch.c\n> +++ b/builtin/branch.c\n> @@ -157,7 +157,8 @@ static int delete_branches(int argc, const char **argv, int force, int kinds)\n>  \tswitch (kinds) {\n>  \tcase REF_REMOTE_BRANCH:\n>  \t\tfmt = \"refs/remotes/%s\";\n> -\t\tremote = \"remote \";\n> +\t\t/* TRANSLATORS: This is \"remote \" in \"remote branch '%s' not found\" */\n> +\t\tremote = _(\"remote \");\n>  \t\tforce = 1;\n>  \t\tbreak;\n>  \tcase REF_LOCAL_BRANCH:\n\n\n--->8---\nFrom a82add2f0562839e60611e7c3f3409d6cea87ad1 Mon Sep 17 00:00:00 2001\nFrom: Piotr Krukowiecki <piotr.krukowiecki@gmail.com>\nDate: Sun, 27 Feb 2011 19:55:48 +0100\nSubject: [PATCH] Change how error message is created for easier translation\n\nWhen a text is split or stiched together from several\ntexts it's very hard/impossible to do a good translation.\n\nSigned-off-by: Piotr Krukowiecki <piotr.krukowiecki@gmail.com>\n---\n builtin/branch.c |   20 ++++++++++++--------\n 1 files changed, 12 insertions(+), 8 deletions(-)\n\ndiff --git a/builtin/branch.c b/builtin/branch.c\nindex fe8f2fc..e4adc34 100644\n--- a/builtin/branch.c\n+++ b/builtin/branch.c\n@@ -149,20 +149,20 @@ static int delete_branches(int argc, const char **argv, int force, int kinds)\n \tstruct commit *rev, *head_rev = NULL;\n \tunsigned char sha1[20];\n \tchar *name = NULL;\n-\tconst char *fmt, *remote;\n+\tconst char *fmt;\n \tint i;\n \tint ret = 0;\n \tstruct strbuf bname = STRBUF_INIT;\n+\tint is_remote = 0;\n \n \tswitch (kinds) {\n \tcase REF_REMOTE_BRANCH:\n \t\tfmt = \"refs/remotes/%s\";\n-\t\tremote = \"remote \";\n+\t\tis_remote = 1;\n \t\tforce = 1;\n \t\tbreak;\n \tcase REF_LOCAL_BRANCH:\n \t\tfmt = \"refs/heads/%s\";\n-\t\tremote = \"\";\n \t\tbreak;\n \tdefault:\n \t\tdie(\"cannot use -a with -d\");\n@@ -186,8 +186,9 @@ static int delete_branches(int argc, const char **argv, int force, int kinds)\n \n \t\tname = xstrdup(mkpath(fmt, bname.buf));\n \t\tif (!resolve_ref(name, sha1, 1, NULL)) {\n-\t\t\terror(\"%sbranch '%s' not found.\",\n-\t\t\t\t\tremote, bname.buf);\n+\t\t\tconst char *error_str = is_remote ? \"Remote branch '%s' not found.\" :\n+\t\t\t\t\"Branch '%s' not found.\";\n+\t\t\terror(error_str, bname.buf);\n \t\t\tret = 1;\n \t\t\tcontinue;\n \t\t}\n@@ -208,12 +209,15 @@ static int delete_branches(int argc, const char **argv, int force, int kinds)\n \t\t}\n \n \t\tif (delete_ref(name, sha1, 0)) {\n-\t\t\terror(\"Error deleting %sbranch '%s'\", remote,\n-\t\t\t      bname.buf);\n+\t\t\tconst char *error_str = is_remote ? \"Error deleting remote branch '%s'\" :\n+\t\t\t\t\"Error deleting branch '%s'\";\n+\t\t\terror(error_str, bname.buf);\n \t\t\tret = 1;\n \t\t} else {\n \t\t\tstruct strbuf buf = STRBUF_INIT;\n-\t\t\tprintf(\"Deleted %sbranch %s (was %s).\\n\", remote,\n+\t\t\tconst char *error_str = is_remote ? \"Deleted remote branch %s (was %s).\\n\" :\n+\t\t\t\t\"Deleted branch %s (was %s).\\n\";\n+\t\t\tprintf(error_str,\n \t\t\t       bname.buf,\n \t\t\t       find_unique_abbrev(sha1, DEFAULT_ABBREV));\n \t\t\tstrbuf_addf(&buf, \"branch.%s\", bname.buf);\n-- \n1.7.1\n\n\n-- \nPiotr Krukowiecki\n"}]}