{"thread":{"id":"24977","subject":"[PATCH 00/63] [REDO] Add gettext support to Git","startedAt":"2010-09-04T22:10:20Z","lastAt":"2010-09-10T00:26:12Z","messageCount":39,"participants":["Ævar Arnfjörð Bjarmason","Jonathan Nieder","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":63},"messages":[{"id":"149881","messageId":"1283638229-14199-1-git-send-email-avarab@gmail.com","threadId":"24977","inReplyTo":null,"subject":"[PATCH 00/63] [REDO] Add gettext support to Git","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2010-09-04T22:10:20Z","receivedAt":"2010-09-04T22:10:20Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"The previous nested pull requests were a mess, and I needed to fix\nsome bugs. So here's a total re-do of the ab/i18n series. Everything\nthat's already in pu from ab/i18n can be ejected in favor of this.\n\nMost of these 63 patches have been seen here before. So I'll only be\nsending the stuff that's changed or interesting along with this\nseries. To get the full thing go to:\n\n    git://github.com/avar/git.git ab/i18n-all\n    http://github.com/avar/git/compare/master...ab/i18n-all\n    http://github.com/avar/git/compare/master...ab/i18n-all.patch\n\nThe last of which is a patch file suitable for git-am(1).\n\nSince last time I've rebased this on the new upstream master branch,\nwhich now has my ab/test-2 series.\n\nSee comments by the patches below for other changes in this\nseries since last time.\n\nJan Krüger (1):\n  po/de.po: add German translation\n\nMarcin Cieślak (1):\n  po/pl.po: add Polish translation\n\nSam Reed (1):\n  po/en_GB.po: add British English Translation\n\n    I minimized this so it now only contains 3 msgid/msgstr pairs,\n    instead of containing *all* of them just to translate those three.\n\n    As an aside I really need to patch the upstream gettext tools to\n    make this easy. I have to manually edit the file now to do this.\n\nThomas Rast (1):\n  tests: locate i18n lib&data correctly under --valgrind\n\n    The 2e75a8c that's in pu right now solves the merge conflict\n    between ab/i18n and ab/test incorrectly. Since ab/test has been\n    merged this needs no changes to test-lib.sh at all (GIT_BUILD_DIR\n    is now already defined there).\n\nÆvar Arnfjörð Bjarmason (59):\n  builtin: use builtin.h for all builtin commands\n\n    These changes for builtin.h are now part of this series for\n    convenience. But Junio might want to split them up away from the\n    ab/i18n topic.\n\n  Add infrastructure for translating Git with gettext\n\n    Updated to solve merge conflicts with the new master. No other\n    changes.\n\n  tests: rename test to work around GNU gettext bug\n  gettext: setlocale(LC_CTYPE, \"\") breaks Git's C function assumptions\n  Makefile: A variable for options used by xgettext(1) calls\n  Makefile: provide a --msgid-bugs-address to xgettext(1)\n  Makefile: tell xgettext(1) that our source is in UTF-8\n  Makefile: use variables and shorter lines for xgettext\n  builtin.h: Include gettext.h\n  gettext: make the simple parts of git-init localizable\n  gettext: localize the main git-init message\n  gettext.c: work around us not using setlocale(LC_CTYPE, \"\")\n  gettext tests: test if $VERSION exists before using it\n  gettext tests: update test/is.po to match t/t0200/test.c\n  gettext tests: add detection for is_IS.ISO-8859-1 locale\n  gettext tests: test message re-encoding under Shell\n  gettext tests: test re-encoding with a UTF-8 msgid under Shell\n  gettext tests: mark a test message as not needing translation\n\n  po/is.po: msgmerge and add Language: header\n  po/is.po: add Icelandic translation\n\n    I've rewritten these and all other changes to po/*.po files to not\n    have the autogenerated line numbers. So with this new topic these\n    *never* apprear in the po/*.po history.\n\n  gettext tests: test message re-encoding under C\n  gettext tests: remove old sanity test under NO_GETTEXT\n  gettext docs: add po/README file documenting Git's gettext\n  gettext tests: add GETTEXT_POISON=YesPlease Makefile parameter\n\n  gettext tests: skip lib-gettext.sh tests under GETTEXT_POISON\n\n    Split up from the below. Easier to review this way.\n\n  gettext tests: skip breaking tests under GETTEXT_POISON\n\n    Ejected changes to t7602-merge-octopus-many.sh from this. Those\n    tests tested for a plumbing message (see below)\n\n    This is still the part of this series that needs the most\n    review. I *think* I got this right, but more eyes are needed on\n    it.\n\n  gettextize: git-clone basic messages\n  gettextize: git-clone \"Cloning into\" message\n  gettextize: git-add basic messages\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 \"git branch -v\" messages\n  gettextize: git-branch \"(no branch)\" message\n  gettextize: git-checkout: our/their version message\n  gettextize: git-checkout basic messages\n  gettextize: git-checkout describe_detached_head messages\n  gettextize: git-checkout \"Switched to a .. branch\" message\n  gettextize: git-commit basic messages\n  gettextize: git-commit formatting messages\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-log basic messages\n  gettextize: git-merge basic messages\n\n    The finish() command ends up writing to the reflog, not only to\n    stdout. So I needed drop all these patches:\n    \n        gettextize: git-merge remaining cmd_merge messages\n        gettextize: git-merge \"Merge made by %s.\" message\n        gettextize: git-merge \"In-index merge\" message\n\n    Now git-merge only makes the basic output/die messages\n    translatable.\n    \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-tag basic messages\n  gettextize: git-tag tag_template message\n  gettextize: git-push basic messages\n  gettextize: git-status basic messages\n  gettextize: git-status shortstatus messages\n\n .gitignore                          |    2 +\n INSTALL                             |   12 +\n Makefile                            |   92 ++-\n builtin.h                           |    1 +\n builtin/add.c                       |   46 +-\n builtin/branch.c                    |   69 +-\n builtin/checkout.c                  |   93 +-\n builtin/clone.c                     |   61 +-\n builtin/commit.c                    |  156 ++--\n builtin/diff.c                      |   20 +-\n builtin/fetch-pack.c                |    2 +-\n builtin/fetch.c                     |   82 +-\n builtin/grep.c                      |   34 +-\n builtin/hash-object.c               |    2 +-\n builtin/index-pack.c                |    2 +-\n builtin/init-db.c                   |   56 +-\n builtin/log.c                       |   68 +-\n builtin/merge-index.c               |    2 +-\n builtin/merge-recursive.c           |    2 +-\n builtin/merge-tree.c                |    2 +-\n builtin/merge.c                     |  122 ++--\n builtin/mktag.c                     |    2 +-\n builtin/mv.c                        |   32 +-\n builtin/pack-redundant.c            |    2 +-\n builtin/pack-refs.c                 |    2 +-\n builtin/patch-id.c                  |    2 +-\n builtin/push.c                      |   42 +-\n builtin/receive-pack.c              |    2 +-\n builtin/remote.c                    |    3 +-\n builtin/reset.c                     |   44 +-\n builtin/rm.c                        |   22 +-\n builtin/send-pack.c                 |    2 +-\n builtin/tag.c                       |   66 +-\n builtin/unpack-file.c               |    2 +-\n builtin/var.c                       |    2 +-\n config.mak.in                       |    2 +\n configure.ac                        |   12 +\n daemon.c                            |    3 +\n fast-import.c                       |    3 +\n gettext.c                           |   27 +\n gettext.h                           |   22 +\n git-sh-i18n.sh                      |   71 ++\n git.c                               |    3 +\n http-backend.c                      |    3 +\n http-fetch.c                        |    3 +\n http-push.c                         |    3 +\n imap-send.c                         |    3 +\n perl/Git/I18N.pm                    |   91 ++\n perl/Makefile                       |    3 +-\n perl/Makefile.PL                    |   14 +-\n po/.gitignore                       |    1 +\n po/README                           |   68 ++\n po/de.po                            | 1888 +++++++++++++++++++++++++++++++++++\n po/en_GB.po                         |   22 +\n po/is.po                            |  152 +++\n po/pl.po                            |  153 +++\n shell.c                             |    3 +\n show-index.c                        |    3 +\n t/lib-gettext.sh                    |   68 ++\n t/lib-httpd.sh                      |    2 +-\n t/t0001-init.sh                     |    2 +-\n t/t0200-gettext-basic.sh            |  108 ++\n t/t0200/test.c                      |   23 +\n t/t0200/test.perl                   |   14 +\n t/t0200/test.sh                     |   14 +\n t/t0201-gettext-fallbacks.sh        |   49 +\n t/t0202-gettext-perl.sh             |   27 +\n t/t0202/test.pl                     |  109 ++\n t/t0203-gettext-setlocale-sanity.sh |   26 +\n t/t0204-gettext-reencode-sanity.sh  |   78 ++\n t/t1200-tutorial.sh                 |    4 +-\n t/t2200-add-update.sh               |    2 +-\n t/t2204-add-ignored.sh              |    8 +-\n t/t3030-merge-recursive.sh          |    2 +-\n t/t3200-branch.sh                   |    2 +-\n t/t3203-branch-output.sh            |    2 +-\n t/t3700-add.sh                      |    4 +-\n t/t4001-diff-rename.sh              |    4 +-\n t/t4014-format-patch.sh             |    2 +-\n t/t5541-http-push.sh                |    2 +-\n t/t5601-clone.sh                    |    2 +-\n t/t6040-tracking-info.sh            |    2 +-\n t/t7004-tag.sh                      |    6 +-\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/t7500-commit.sh                   |    9 +-\n t/t7501-commit.sh                   |   14 +-\n t/t7502-commit.sh                   |   46 +-\n t/t7506-status-submodule.sh         |   28 +-\n t/t7508-status.sh                   |   98 +-\n t/t7600-merge.sh                    |    2 +-\n t/t7811-grep-open.sh                |    2 +-\n t/test-lib.sh                       |    3 +\n upload-pack.c                       |    3 +\n wt-status.c                         |  116 ++--\n 97 files changed, 3901 insertions(+), 706 deletions(-)\n create mode 100644 gettext.c\n create mode 100644 gettext.h\n create mode 100644 git-sh-i18n.sh\n create mode 100644 perl/Git/I18N.pm\n create mode 100644 po/.gitignore\n create mode 100644 po/README\n create mode 100644 po/de.po\n create mode 100644 po/en_GB.po\n create mode 100644 po/is.po\n create mode 100644 po/pl.po\n create mode 100644 t/lib-gettext.sh\n create mode 100755 t/t0200-gettext-basic.sh\n create mode 100644 t/t0200/test.c\n create mode 100644 t/t0200/test.perl\n create mode 100644 t/t0200/test.sh\n create mode 100755 t/t0201-gettext-fallbacks.sh\n create mode 100755 t/t0202-gettext-perl.sh\n create mode 100644 t/t0202/test.pl\n create mode 100755 t/t0203-gettext-setlocale-sanity.sh\n create mode 100755 t/t0204-gettext-reencode-sanity.sh\n\n-- \n1.7.2.3.313.gcd15\n"},{"id":"149886","messageId":"1283638229-14199-2-git-send-email-avarab@gmail.com","threadId":"24977","inReplyTo":"1283638229-14199-1-git-send-email-avarab@gmail.com","subject":"[PATCH 01/63] builtin: use builtin.h for all builtin commands","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2010-09-04T22:10:21Z","receivedAt":"2010-09-04T22:10:21Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"Change the builtin/*.c files and wt-status.c files which weren't using\nbuiltin.h to use it, also remove any git-compat-util.h, strbuf.h and\ncache.h from those files. We can trust on builtin.h including them.\n\nbuiltin.h also includes commit.h and notes.h. But I haven't removed\nthese includes. They're redundant now, but we may want to remove them\nfrom builtin.h in the future.\n\nThis impeded my efforts to gettextize git, since I'd otherwise have to\nadd gettext.h to all of these. Using builtin.h is a good idea in any\ncase, since it's defining the prototypes for the cmd_* functions that\nthese files define.\n\nSigned-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n builtin/clone.c           |    3 +--\n builtin/fetch-pack.c      |    2 +-\n builtin/hash-object.c     |    2 +-\n builtin/index-pack.c      |    2 +-\n builtin/merge-index.c     |    2 +-\n builtin/merge-recursive.c |    2 +-\n builtin/merge-tree.c      |    2 +-\n builtin/mktag.c           |    2 +-\n builtin/pack-redundant.c  |    2 +-\n builtin/pack-refs.c       |    2 +-\n builtin/patch-id.c        |    2 +-\n builtin/receive-pack.c    |    2 +-\n builtin/remote.c          |    3 +--\n builtin/reset.c           |    2 +-\n builtin/send-pack.c       |    2 +-\n builtin/unpack-file.c     |    2 +-\n builtin/var.c             |    2 +-\n wt-status.c               |    2 +-\n 18 files changed, 18 insertions(+), 20 deletions(-)\n\ndiff --git a/builtin/clone.c b/builtin/clone.c\nindex 19ed640..994d527 100644\n--- a/builtin/clone.c\n+++ b/builtin/clone.c\n@@ -8,7 +8,7 @@\n  * Clone a repository into a different directory that does not yet exist.\n  */\n \n-#include \"cache.h\"\n+#include \"builtin.h\"\n #include \"parse-options.h\"\n #include \"fetch-pack.h\"\n #include \"refs.h\"\n@@ -16,7 +16,6 @@\n #include \"tree-walk.h\"\n #include \"unpack-trees.h\"\n #include \"transport.h\"\n-#include \"strbuf.h\"\n #include \"dir.h\"\n #include \"pack-refs.h\"\n #include \"sigchain.h\"\ndiff --git a/builtin/fetch-pack.c b/builtin/fetch-pack.c\nindex dbd8b7b..fd70b4c 100644\n--- a/builtin/fetch-pack.c\n+++ b/builtin/fetch-pack.c\n@@ -1,4 +1,4 @@\n-#include \"cache.h\"\n+#include \"builtin.h\"\n #include \"refs.h\"\n #include \"pkt-line.h\"\n #include \"commit.h\"\ndiff --git a/builtin/hash-object.c b/builtin/hash-object.c\nindex 080af1a..8a5670f 100644\n--- a/builtin/hash-object.c\n+++ b/builtin/hash-object.c\n@@ -4,7 +4,7 @@\n  * Copyright (C) Linus Torvalds, 2005\n  * Copyright (C) Junio C Hamano, 2005\n  */\n-#include \"cache.h\"\n+#include \"builtin.h\"\n #include \"blob.h\"\n #include \"quote.h\"\n #include \"parse-options.h\"\ndiff --git a/builtin/index-pack.c b/builtin/index-pack.c\nindex 2e680d7..9c5c9d6 100644\n--- a/builtin/index-pack.c\n+++ b/builtin/index-pack.c\n@@ -1,4 +1,4 @@\n-#include \"cache.h\"\n+#include \"builtin.h\"\n #include \"delta.h\"\n #include \"pack.h\"\n #include \"csum-file.h\"\ndiff --git a/builtin/merge-index.c b/builtin/merge-index.c\nindex 2c4cf5e..adc2a6d 100644\n--- a/builtin/merge-index.c\n+++ b/builtin/merge-index.c\n@@ -1,4 +1,4 @@\n-#include \"cache.h\"\n+#include \"builtin.h\"\n #include \"run-command.h\"\n #include \"exec_cmd.h\"\n \ndiff --git a/builtin/merge-recursive.c b/builtin/merge-recursive.c\nindex 78b9db7..ad2d77d 100644\n--- a/builtin/merge-recursive.c\n+++ b/builtin/merge-recursive.c\n@@ -1,4 +1,4 @@\n-#include \"cache.h\"\n+#include \"builtin.h\"\n #include \"commit.h\"\n #include \"tag.h\"\n #include \"merge-recursive.h\"\ndiff --git a/builtin/merge-tree.c b/builtin/merge-tree.c\nindex 9b25ddc..1991742 100644\n--- a/builtin/merge-tree.c\n+++ b/builtin/merge-tree.c\n@@ -1,4 +1,4 @@\n-#include \"cache.h\"\n+#include \"builtin.h\"\n #include \"tree-walk.h\"\n #include \"xdiff-interface.h\"\n #include \"blob.h\"\ndiff --git a/builtin/mktag.c b/builtin/mktag.c\nindex 1cb0f3f..9148cc0 100644\n--- a/builtin/mktag.c\n+++ b/builtin/mktag.c\n@@ -1,4 +1,4 @@\n-#include \"cache.h\"\n+#include \"builtin.h\"\n #include \"tag.h\"\n #include \"exec_cmd.h\"\n \ndiff --git a/builtin/pack-redundant.c b/builtin/pack-redundant.c\nindex 41e1615..a15e366 100644\n--- a/builtin/pack-redundant.c\n+++ b/builtin/pack-redundant.c\n@@ -6,7 +6,7 @@\n *\n */\n \n-#include \"cache.h\"\n+#include \"builtin.h\"\n #include \"exec_cmd.h\"\n \n #define BLKSIZE 512\ndiff --git a/builtin/pack-refs.c b/builtin/pack-refs.c\nindex 091860b..39a9d89 100644\n--- a/builtin/pack-refs.c\n+++ b/builtin/pack-refs.c\n@@ -1,4 +1,4 @@\n-#include \"cache.h\"\n+#include \"builtin.h\"\n #include \"parse-options.h\"\n #include \"pack-refs.h\"\n \ndiff --git a/builtin/patch-id.c b/builtin/patch-id.c\nindex 5125300..33e9725 100644\n--- a/builtin/patch-id.c\n+++ b/builtin/patch-id.c\n@@ -1,4 +1,4 @@\n-#include \"cache.h\"\n+#include \"builtin.h\"\n #include \"exec_cmd.h\"\n \n static void flush_current_id(int patchlen, unsigned char *id, git_SHA_CTX *c)\ndiff --git a/builtin/receive-pack.c b/builtin/receive-pack.c\nindex 760817d..f64b79c 100644\n--- a/builtin/receive-pack.c\n+++ b/builtin/receive-pack.c\n@@ -1,4 +1,4 @@\n-#include \"cache.h\"\n+#include \"builtin.h\"\n #include \"pack.h\"\n #include \"refs.h\"\n #include \"pkt-line.h\"\ndiff --git a/builtin/remote.c b/builtin/remote.c\nindex 48e0a6b..3cf3c6b 100644\n--- a/builtin/remote.c\n+++ b/builtin/remote.c\n@@ -1,9 +1,8 @@\n-#include \"cache.h\"\n+#include \"builtin.h\"\n #include \"parse-options.h\"\n #include \"transport.h\"\n #include \"remote.h\"\n #include \"string-list.h\"\n-#include \"strbuf.h\"\n #include \"run-command.h\"\n #include \"refs.h\"\n \ndiff --git a/builtin/reset.c b/builtin/reset.c\nindex 0037be4..c198b8e 100644\n--- a/builtin/reset.c\n+++ b/builtin/reset.c\n@@ -7,7 +7,7 @@\n  *\n  * Copyright (c) 2005, 2006 Linus Torvalds and Junio C Hamano\n  */\n-#include \"cache.h\"\n+#include \"builtin.h\"\n #include \"tag.h\"\n #include \"object.h\"\n #include \"commit.h\"\ndiff --git a/builtin/send-pack.c b/builtin/send-pack.c\nindex 481602d..a55a517 100644\n--- a/builtin/send-pack.c\n+++ b/builtin/send-pack.c\n@@ -1,4 +1,4 @@\n-#include \"cache.h\"\n+#include \"builtin.h\"\n #include \"commit.h\"\n #include \"refs.h\"\n #include \"pkt-line.h\"\ndiff --git a/builtin/unpack-file.c b/builtin/unpack-file.c\nindex 608590a..c905d80 100644\n--- a/builtin/unpack-file.c\n+++ b/builtin/unpack-file.c\n@@ -1,4 +1,4 @@\n-#include \"cache.h\"\n+#include \"builtin.h\"\n #include \"blob.h\"\n #include \"exec_cmd.h\"\n \ndiff --git a/builtin/var.c b/builtin/var.c\nindex 0744bb8..1787771 100644\n--- a/builtin/var.c\n+++ b/builtin/var.c\n@@ -3,7 +3,7 @@\n  *\n  * Copyright (C) Eric Biederman, 2005\n  */\n-#include \"cache.h\"\n+#include \"builtin.h\"\n #include \"exec_cmd.h\"\n \n static const char var_usage[] = \"git var (-l | <variable>)\";\ndiff --git a/wt-status.c b/wt-status.c\nindex 54b6b03..b05c6db 100644\n--- a/wt-status.c\n+++ b/wt-status.c\n@@ -1,4 +1,4 @@\n-#include \"cache.h\"\n+#include \"builtin.h\"\n #include \"wt-status.h\"\n #include \"object.h\"\n #include \"dir.h\"\n-- \n1.7.2.3.313.gcd15\n"},{"id":"149888","messageId":"1283638229-14199-3-git-send-email-avarab@gmail.com","threadId":"24977","inReplyTo":"1283638229-14199-1-git-send-email-avarab@gmail.com","subject":"[PATCH 02/63] Add infrastructure for translating Git with gettext","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2010-09-04T22:10:22Z","receivedAt":"2010-09-04T22:10:22Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"All of the interface messages in Git core are currently hardcoded in\nEnglish. Change that by optionally enabling translation of the core C,\nShell and Perl programs via GNU or SunOS gettext. If you set the\nappropriate LC_* variables Git will speak your language, provided that\nsomeone has submitted a translation.\n\nIf gettext isn't available, or if Git is compiled with\nNO_GETTEXT=YesPlease, then Git fall back on its previous behavior of\nonly speaking English. When using ./configure the autoconf script will\nauto-detect if the gettext libraries are installed and act\nappropriately.\n\nWith NO_GETTEXT=YesPlease gettext support will be #defined away for C\nprograms. For Shell and Perl programs we rely on the git message\ncatalog not being available. That's a reasonable assumption since then\nthe message catalog won't be installed on the system during make\ninstall.\n\nThe gettext wrappers that are provided in the patch are only the bare\nminimum required to begin translation work. In particular I haven't\nadded wrappers for the gettext functions that enable plural support,\nor those that provide message context (msgctxt).\n\nThose can be added later. The intent is to start with a small subset\nand see what we need later, not to start with something that's\nunnecessarily large right away.\n\nImplementation and usage notes:\n\n * General:\n\n   Gettext .mo files will be installed and looked for in the standard\n   $(prefix)/share/locale path. GIT_TEXTDOMAINDIR can also be set to\n   override that, but that's only intended to be used to test Git\n   itself.\n\n * Perl:\n\n   Perl code that wants to be localized should use the new Git::I18n\n   module. It imports a __ function into the caller's package by\n   default.\n\n   Instead of using the high level Locale::TextDomain interface I've\n   opted to use the low-level (equivalent to the C interface)\n   Locale::Messages module, which Locale::TextDomain itself uses.\n\n   Locale::TextDomain does a lot of redundant work we don't need, and\n   some of it would potentially introduce bugs. It tries to set the\n   $TEXTDOMAIN based on package of the caller, and has its own\n   hardcoded paths where it'll search for messages.\n\n   I found it easier just to completely avoid it rather than try to\n   circumvent its behavior. In any case, this is an issue wholly\n   internal Git::I18N. Its guts can be changed later if that's deemed\n   necessary.\n\n   See <AANLkTilYD_NyIZMyj9dHtVk-ylVBfvyxpCC7982LWnVd@mail.gmail.com>\n   for a further elaboration on this topic.\n\n * Shell:\n\n   Shell code that's to be localized should use the new git-sh-i18n\n   library. It's just a wrapper for the system's gettext.sh.\n\n   If gettext.sh isn't available we'll fall back gettext(1) if it's\n   available. The latter is available without the former on Solaris,\n   which has its own non-GNU gettext implementation. We also need to\n   emulate eval_gettext() there.\n\n   If neither are present we'll use a dumb printf(1) fall-through\n   wrapper.\n\n   I originally tried to detect if the system supported `echo -n' but\n   I found this to be a waste of time. My benchmarks on Linux, Solaris\n   and FreeBSD reveal that printf(1) is fast enough, especially since\n   we aren't calling gettext() from within any tight loops, and\n   unlikely to ever do so.\n\nThis series has been tested by me on Ubuntu 10.04, Debian testing,\nFreeBSD 8.1 and SunOS 5.10, and by others on Mac OS X 10.6.3 (with\nXcode 3.2.2) and openSUSE Factory (11.3, milestone 7).\n\nSunOS has its own non-GNU gettext implementation which this patch\nsupports, although that may change in the future if it turns out that\nwe need some GNU libintl features that SunOS doesn't provide.\n\nThis patch is based on work by Jeff Epler <jepler@unpythonic.net> who\ndid the initial Makefile / C work, and a lot of comments from the Git\nmailing list, including Jonathan Nieder, Jakub Narebski, Johannes\nSixt, Peter Krefting, Junio C Hamano, Thomas Rast and others.\n\nSigned-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\nTested-By: John Wiegley <johnw@newartisans.com>\nTested-by: Graham Anderson <graham.anderson@gmail.com>\nSigned-off-by: Junio C Hamano <gitster@pobox.com>\n---\n .gitignore                   |    2 +\n INSTALL                      |   12 +++++\n Makefile                     |   69 +++++++++++++++++++++++++-\n config.mak.in                |    2 +\n configure.ac                 |   12 +++++\n daemon.c                     |    3 +\n fast-import.c                |    3 +\n gettext.c                    |   22 ++++++++\n gettext.h                    |   18 +++++++\n git-sh-i18n.sh               |   71 ++++++++++++++++++++++++++\n git.c                        |    3 +\n http-backend.c               |    3 +\n http-fetch.c                 |    3 +\n http-push.c                  |    3 +\n imap-send.c                  |    3 +\n perl/Git/I18N.pm             |   91 +++++++++++++++++++++++++++++++++\n perl/Makefile                |    3 +-\n perl/Makefile.PL             |   14 +++++-\n po/.gitignore                |    1 +\n po/is.po                     |   40 +++++++++++++++\n shell.c                      |    3 +\n show-index.c                 |    3 +\n t/lib-gettext.sh             |   42 ++++++++++++++++\n t/t0200-gettext.sh           |  113 ++++++++++++++++++++++++++++++++++++++++++\n t/t0200/test.c               |   13 +++++\n t/t0200/test.perl            |   14 +++++\n t/t0200/test.sh              |   14 +++++\n t/t0201-gettext-fallbacks.sh |   49 ++++++++++++++++++\n t/t0202-gettext-perl.sh      |   27 ++++++++++\n t/t0202/test.pl              |  107 +++++++++++++++++++++++++++++++++++++++\n t/test-lib.sh                |    2 +\n upload-pack.c                |    3 +\n 32 files changed, 764 insertions(+), 4 deletions(-)\n create mode 100644 gettext.c\n create mode 100644 gettext.h\n create mode 100644 git-sh-i18n.sh\n create mode 100644 perl/Git/I18N.pm\n create mode 100644 po/.gitignore\n create mode 100644 po/is.po\n create mode 100644 t/lib-gettext.sh\n create mode 100755 t/t0200-gettext.sh\n create mode 100644 t/t0200/test.c\n create mode 100644 t/t0200/test.perl\n create mode 100644 t/t0200/test.sh\n create mode 100755 t/t0201-gettext-fallbacks.sh\n create mode 100755 t/t0202-gettext-perl.sh\n create mode 100644 t/t0202/test.pl\n\ndiff --git a/.gitignore b/.gitignore\nindex 20560b8..80ca718 100644\n--- a/.gitignore\n+++ b/.gitignore\n@@ -125,6 +125,7 @@\n /git-rm\n /git-send-email\n /git-send-pack\n+/git-sh-i18n\n /git-sh-setup\n /git-shell\n /git-shortlog\n@@ -215,3 +216,4 @@\n *.pdb\n /Debug/\n /Release/\n+/share/\ndiff --git a/INSTALL b/INSTALL\nindex 59200b7..e4e7506 100644\n--- a/INSTALL\n+++ b/INSTALL\n@@ -93,6 +93,18 @@ Issues of note:\n \t  history graphically, and in git-gui.  If you don't want gitk or\n \t  git-gui, you can use NO_TCLTK.\n \n+\t- A gettext library is used by default for localizing Git. The\n+\t  primary target is GNU libintl, but the Solaris gettext\n+\t  implementation also works.\n+\n+\t  We need a gettext.h on the system for C code, gettext.sh (or\n+\t  Solaris gettext(1)) for shell scripts, and libintl-perl for Perl\n+\t  programs.\n+\n+\t  Set NO_GETTEXT to disable localization support and make Git only\n+\t  use English. Under autoconf the configure script will do this\n+\t  automatically if it can't find libintl on the system.\n+\n  - Some platform specific issues are dealt with Makefile rules,\n    but depending on your specific installation, you may not\n    have all the libraries/tools needed, or you may have\ndiff --git a/Makefile b/Makefile\nindex 8b7c243..b834b50 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -34,6 +34,15 @@ all::\n # Define NO_EXPAT if you do not have expat installed.  git-http-push is\n # not built, and you cannot push using http:// and https:// transports.\n #\n+# Define NO_GETTEXT if you don't want to build with Git with gettext\n+# support. Building it requires GNU libintl or another gettext\n+# implementation, and additionally libintl-perl at runtime.\n+#\n+# Define NEEDS_LIBINTL if you haven't set NO_GETTEXT and your system\n+# needs to be explicitly linked to -lintl. It's defined automatically\n+# on platforms where we don't expect glibc (Linux, Hurd,\n+# GNU/kFreeBSD), which includes libintl.\n+#\n # Define EXPATDIR=/foo/bar if your expat header and library files are in\n # /foo/bar/include and /foo/bar/lib directories.\n #\n@@ -283,6 +292,7 @@ infodir = share/info\n gitexecdir = libexec/git-core\n sharedir = $(prefix)/share\n gitwebdir = $(sharedir)/gitweb\n+localedir = $(sharedir)/locale\n template_dir = share/git-core/templates\n htmldir = share/doc/git-doc\n ifeq ($(prefix),/usr)\n@@ -296,7 +306,7 @@ lib = lib\n # DESTDIR=\n pathsep = :\n \n-export prefix bindir sharedir sysconfdir gitwebdir\n+export prefix bindir sharedir sysconfdir gitwebdir localedir\n \n CC = gcc\n AR = ar\n@@ -311,6 +321,8 @@ TCLTK_PATH = wish\n PTHREAD_LIBS = -lpthread\n PTHREAD_CFLAGS =\n GCOV = gcov\n+XGETTEXT = xgettext\n+MSGFMT = msgfmt\n \n export TCL_PATH TCLTK_PATH\n \n@@ -372,6 +384,7 @@ SCRIPT_SH += git-web--browse.sh\n SCRIPT_LIB += git-mergetool--lib\n SCRIPT_LIB += git-parse-remote\n SCRIPT_LIB += git-sh-setup\n+SCRIPT_LIB += git-sh-i18n\n \n SCRIPT_PERL += git-add--interactive.perl\n SCRIPT_PERL += git-difftool.perl\n@@ -543,6 +556,7 @@ LIB_H += userdiff.h\n LIB_H += utf8.h\n LIB_H += xdiff-interface.h\n LIB_H += xdiff/xdiff.h\n+LIB_H += gettext.h\n \n LIB_OBJS += abspath.o\n LIB_OBJS += advice.o\n@@ -584,6 +598,9 @@ LIB_OBJS += entry.o\n LIB_OBJS += environment.o\n LIB_OBJS += exec_cmd.o\n LIB_OBJS += fsck.o\n+ifndef NO_GETTEXT\n+LIB_OBJS += gettext.o\n+endif\n LIB_OBJS += graph.o\n LIB_OBJS += grep.o\n LIB_OBJS += hash.o\n@@ -756,6 +773,14 @@ EXTLIBS =\n # Platform specific tweaks\n #\n \n+# Platform specific defaults. Where we'd only like some feature on the\n+# minority of systems, e.g. if linking to a library isn't needed\n+# because its features are included in the GNU C library.\n+ifndef NO_GETTEXT\n+\t# Systems that use GNU gettext and glibc are the exception\n+\tNEEDS_LIBINTL = YesPlease\n+endif\n+\n # We choose to avoid \"if .. else if .. else .. endif endif\"\n # because maintaining the nesting to match is a pain.  If\n # we had \"elif\" things would have been much nicer...\n@@ -771,11 +796,13 @@ ifeq ($(uname_S),Linux)\n \tNO_STRLCPY = YesPlease\n \tNO_MKSTEMPS = YesPlease\n \tHAVE_PATHS_H = YesPlease\n+\tNEEDS_LIBINTL =\n endif\n ifeq ($(uname_S),GNU/kFreeBSD)\n \tNO_STRLCPY = YesPlease\n \tNO_MKSTEMPS = YesPlease\n \tHAVE_PATHS_H = YesPlease\n+\tNEEDS_LIBINTL =\n endif\n ifeq ($(uname_S),UnixWare)\n \tCC = cc\n@@ -967,6 +994,7 @@ ifeq ($(uname_S),GNU)\n \tNO_STRLCPY=YesPlease\n \tNO_MKSTEMPS = YesPlease\n \tHAVE_PATHS_H = YesPlease\n+\tNEEDS_LIBINTL =\n endif\n ifeq ($(uname_S),IRIX)\n \tNO_SETENV = YesPlease\n@@ -1471,6 +1499,14 @@ ifdef GIT_TEST_CMP_USE_COPIED_CONTEXT\n \texport GIT_TEST_CMP_USE_COPIED_CONTEXT\n endif\n \n+ifdef NO_GETTEXT\n+\tCOMPAT_CFLAGS += -DNO_GETTEXT\n+endif\n+\n+ifdef NEEDS_LIBINTL\n+\tEXTLIBS += -lintl\n+endif\n+\n ifeq ($(TCLTK_PATH),)\n NO_TCLTK=NoThanks\n endif\n@@ -1501,6 +1537,7 @@ ifndef V\n \tQUIET_GEN      = @echo '   ' GEN $@;\n \tQUIET_LNCP     = @echo '   ' LN/CP $@;\n \tQUIET_GCOV     = @echo '   ' GCOV $@;\n+\tQUIET_MSGFMT   = @echo '   ' MSGFMT $@;\n \tQUIET_SUBDIR0  = +@subdir=\n \tQUIET_SUBDIR1  = ;$(NO_SUBDIR) echo '   ' SUBDIR $$subdir; \\\n \t\t\t $(MAKE) $(PRINT_DIR) -C $$subdir\n@@ -1529,7 +1566,9 @@ template_dir_SQ = $(subst ','\\'',$(template_dir))\n htmldir_SQ = $(subst ','\\'',$(htmldir))\n prefix_SQ = $(subst ','\\'',$(prefix))\n gitwebdir_SQ = $(subst ','\\'',$(gitwebdir))\n+sharedir_SQ = $(subst ','\\'',$(sharedir))\n \n+LOCALEDIR_SQ = $(subst ','\\'',$(localedir))\n SHELL_PATH_SQ = $(subst ','\\'',$(SHELL_PATH))\n PERL_PATH_SQ = $(subst ','\\'',$(PERL_PATH))\n PYTHON_PATH_SQ = $(subst ','\\'',$(PYTHON_PATH))\n@@ -1579,7 +1618,7 @@ ifndef NO_TCLTK\n \t$(QUIET_SUBDIR0)gitk-git $(QUIET_SUBDIR1) all\n endif\n ifndef NO_PERL\n-\t$(QUIET_SUBDIR0)perl $(QUIET_SUBDIR1) PERL_PATH='$(PERL_PATH_SQ)' prefix='$(prefix_SQ)' all\n+\t$(QUIET_SUBDIR0)perl $(QUIET_SUBDIR1) PERL_PATH='$(PERL_PATH_SQ)' prefix='$(prefix_SQ)' localedir='$(localedir_SQ)' all\n endif\n ifndef NO_PYTHON\n \t$(QUIET_SUBDIR0)git_remote_helpers $(QUIET_SUBDIR1) PYTHON_PATH='$(PYTHON_PATH_SQ)' prefix='$(prefix_SQ)' all\n@@ -1625,6 +1664,7 @@ sed -e '1s|#!.*/sh|#!$(SHELL_PATH_SQ)|' \\\n     -e 's|@SHELL_PATH@|$(SHELL_PATH_SQ)|' \\\n     -e 's|@@DIFF@@|$(DIFF_SQ)|' \\\n     -e 's/@@GIT_VERSION@@/$(GIT_VERSION)/g' \\\n+    -e 's|@@LOCALEDIR@@|$(LOCALEDIR_SQ)|g' \\\n     -e 's/@@NO_CURL@@/$(NO_CURL)/g' \\\n     -e $(BROKEN_PATH_FIX) \\\n     $@.sh >$@+\n@@ -1966,6 +2006,21 @@ cscope:\n \t$(RM) cscope*\n \t$(FIND) . -name '*.[hcS]' -print | xargs cscope -b\n \n+pot:\n+\t$(XGETTEXT) --add-comments --keyword=_ --keyword=N_ --output=po/git.pot --language=C $(C_OBJ:o=c) t/t0200/test.c\n+\t$(XGETTEXT) --add-comments --join-existing --output=po/git.pot --language=Shell $(SCRIPT_SH) t/t0200/test.sh\n+\t$(XGETTEXT) --add-comments --join-existing --keyword=__ --output=po/git.pot --language=Perl $(SCRIPT_PERL) t/t0200/test.perl\n+\n+POFILES := $(wildcard po/*.po)\n+MOFILES := $(patsubst po/%.po,share/locale/%/LC_MESSAGES/git.mo,$(POFILES))\n+MODIRS := $(patsubst po/%.po,share/locale/%/LC_MESSAGES/,$(POFILES))\n+ifndef NO_GETTEXT\n+all:: $(MOFILES)\n+endif\n+share/locale/%/LC_MESSAGES/git.mo: po/%.po\n+\t@mkdir -p $(dir $@)\n+\t$(QUIET_MSGFMT)$(MSGFMT) -o $@ $<\n+\n ### Detect prefix changes\n TRACK_CFLAGS = $(subst ','\\'',$(ALL_CFLAGS)):\\\n              $(bindir_SQ):$(gitexecdir_SQ):$(template_dir_SQ):$(prefix_SQ)\n@@ -1995,6 +2050,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 NO_GETTEXT=\\''$(subst ','\\'',$(subst ','\\'',$(NO_GETTEXT)))'\\' >>$@\n \n ### Detect Tck/Tk interpreter path changes\n ifndef NO_TCLTK\n@@ -2092,6 +2148,11 @@ install: all\n \t$(INSTALL) $(ALL_PROGRAMS) '$(DESTDIR_SQ)$(gitexec_instdir_SQ)'\n \t$(INSTALL) -m 644 $(SCRIPT_LIB) '$(DESTDIR_SQ)$(gitexec_instdir_SQ)'\n \t$(INSTALL) $(install_bindir_programs) '$(DESTDIR_SQ)$(bindir_SQ)'\n+ifndef NO_GETTEXT\n+\t$(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(sharedir_SQ)/locale'\n+\t(cd share && tar cf - locale) | \\\n+\t\t(cd '$(DESTDIR_SQ)$(sharedir_SQ)' && umask 022 && tar xof -)\n+endif\n \t$(MAKE) -C templates DESTDIR='$(DESTDIR_SQ)' install\n ifndef NO_PERL\n \t$(MAKE) -C perl prefix='$(prefix_SQ)' DESTDIR='$(DESTDIR_SQ)' install\n@@ -2249,6 +2310,10 @@ ifndef NO_TCLTK\n \t$(MAKE) -C git-gui clean\n endif\n \t$(RM) GIT-VERSION-FILE GIT-CFLAGS GIT-GUI-VARS GIT-BUILD-OPTIONS\n+ifndef NO_GETTEXT\n+\t$(RM) po/git.pot\n+\t$(RM) -r share/\n+endif\n \n .PHONY: all install clean strip\n .PHONY: shell_compatibility_test please_set_SHELL_PATH_to_a_more_modern_shell\ndiff --git a/config.mak.in b/config.mak.in\nindex a0c34ee..9f47aa5 100644\n--- a/config.mak.in\n+++ b/config.mak.in\n@@ -34,9 +34,11 @@ NO_CURL=@NO_CURL@\n NO_EXPAT=@NO_EXPAT@\n NO_LIBGEN_H=@NO_LIBGEN_H@\n HAVE_PATHS_H=@HAVE_PATHS_H@\n+NO_GETTEXT=@NO_GETTEXT@\n NEEDS_LIBICONV=@NEEDS_LIBICONV@\n NEEDS_SOCKET=@NEEDS_SOCKET@\n NEEDS_RESOLV=@NEEDS_RESOLV@\n+NEEDS_LIBINTL=@NEEDS_LIBINTL@\n NEEDS_LIBGEN=@NEEDS_LIBGEN@\n NO_SYS_SELECT_H=@NO_SYS_SELECT_H@\n NO_D_INO_IN_DIRENT=@NO_D_INO_IN_DIRENT@\ndiff --git a/configure.ac b/configure.ac\nindex 56731c3..1821d89 100644\n--- a/configure.ac\n+++ b/configure.ac\n@@ -600,6 +600,12 @@ AC_CHECK_LIB([c], [basename],\n AC_SUBST(NEEDS_LIBGEN)\n test -n \"$NEEDS_LIBGEN\" && LIBS=\"$LIBS -lgen\"\n \n+AC_CHECK_LIB([c], [gettext],\n+[NEEDS_LIBINTL=],\n+[NEEDS_LIBINTL=YesPlease])\n+AC_SUBST(NEEDS_LIBINTL)\n+test -n \"$NEEDS_LIBINTL\" && LIBS=\"$LIBS -lintl\"\n+\n ## Checks for header files.\n AC_MSG_NOTICE([CHECKS for header files])\n #\n@@ -798,6 +804,12 @@ AC_CHECK_HEADER([paths.h],\n [HAVE_PATHS_H=])\n AC_SUBST(HAVE_PATHS_H)\n #\n+# Define NO_GETTEXT if you don't have libintl.h\n+AC_CHECK_HEADER([libintl.h],\n+[NO_GETTEXT=],\n+[NO_GETTEXT=YesPlease])\n+AC_SUBST(NO_GETTEXT)\n+#\n # Define NO_STRCASESTR if you don't have strcasestr.\n GIT_CHECK_FUNC(strcasestr,\n [NO_STRCASESTR=],\ndiff --git a/daemon.c b/daemon.c\nindex e22a2b7..784f897 100644\n--- a/daemon.c\n+++ b/daemon.c\n@@ -3,6 +3,7 @@\n #include \"exec_cmd.h\"\n #include \"run-command.h\"\n #include \"strbuf.h\"\n+#include \"gettext.h\"\n \n #include <syslog.h>\n \n@@ -975,6 +976,8 @@ int main(int argc, char **argv)\n \tgid_t gid = 0;\n \tint i;\n \n+\tgit_setup_gettext();\n+\n \tgit_extract_argv0_path(argv[0]);\n \n \tfor (i = 1; i < argc; i++) {\ndiff --git a/fast-import.c b/fast-import.c\nindex 2317b0f..7fb2a86 100644\n--- a/fast-import.c\n+++ b/fast-import.c\n@@ -156,6 +156,7 @@ Format of STDIN stream:\n #include \"csum-file.h\"\n #include \"quote.h\"\n #include \"exec_cmd.h\"\n+#include \"gettext.h\"\n \n #define PACK_ID_BITS 16\n #define MAX_PACK_ID ((1<<PACK_ID_BITS)-1)\n@@ -2918,6 +2919,8 @@ int main(int argc, const char **argv)\n \n \tgit_extract_argv0_path(argv[0]);\n \n+\tgit_setup_gettext();\n+\n \tif (argc == 2 && !strcmp(argv[1], \"-h\"))\n \t\tusage(fast_import_usage);\n \ndiff --git a/gettext.c b/gettext.c\nnew file mode 100644\nindex 0000000..7ae5cae\n--- /dev/null\n+++ b/gettext.c\n@@ -0,0 +1,22 @@\n+#include \"exec_cmd.h\"\n+#include <locale.h>\n+#include <libintl.h>\n+#include <stdlib.h>\n+\n+extern void git_setup_gettext(void) {\n+\tchar *podir;\n+\tchar *envdir = getenv(\"GIT_TEXTDOMAINDIR\");\n+\n+\tif (envdir) {\n+\t\t(void)bindtextdomain(\"git\", envdir);\n+\t} else {\n+\t\tpodir = (char *)system_path(\"share/locale\");\n+\t\tif (!podir) return;\n+\t\t(void)bindtextdomain(\"git\", podir);\n+\t\tfree(podir);\n+\t}\n+\n+\t(void)setlocale(LC_MESSAGES, \"\");\n+\t(void)setlocale(LC_CTYPE, \"\");\n+\t(void)textdomain(\"git\");\n+}\ndiff --git a/gettext.h b/gettext.h\nnew file mode 100644\nindex 0000000..e02939a\n--- /dev/null\n+++ b/gettext.h\n@@ -0,0 +1,18 @@\n+#ifndef GETTEXT_H\n+#define GETTEXT_H\n+\n+#ifdef NO_GETTEXT\n+static inline void git_setup_gettext(void) {}\n+#else\n+extern void git_setup_gettext(void);\n+#endif\n+\n+#define N_(s) (s)\n+#ifdef NO_GETTEXT\n+#define _(s) (s)\n+#else\n+#include <libintl.h>\n+#define _(s) gettext(s)\n+#endif\n+\n+#endif\ndiff --git a/git-sh-i18n.sh b/git-sh-i18n.sh\nnew file mode 100644\nindex 0000000..698a000\n--- /dev/null\n+++ b/git-sh-i18n.sh\n@@ -0,0 +1,71 @@\n+#!/bin/sh\n+#\n+# Copyright (c) 2010 Ævar Arnfjörð Bjarmason\n+#\n+# This is Git's interface to gettext.sh. Use it right after\n+# git-sh-setup as:\n+#\n+#   . git-sh-setup\n+#   . git-sh-i18n\n+#\n+#   # For constant interface messages:\n+#   gettext \"A message for the user\"; echo\n+#\n+#   # To interpolate variables:\n+#   details=\"oh noes\"\n+#   eval_gettext \"An error occured: \\$details\"; echo\n+#\n+# See \"info '(gettext)sh'\" for the full manual.\n+\n+# Export the TEXTDOMAIN* data that we need for Git\n+TEXTDOMAIN=git\n+export TEXTDOMAIN\n+if [ -z \"$GIT_TEXTDOMAINDIR\" ]\n+then\n+\tTEXTDOMAINDIR=\"@@LOCALEDIR@@\"\n+else\n+\tTEXTDOMAINDIR=\"$GIT_TEXTDOMAINDIR\"\n+fi\n+export TEXTDOMAINDIR\n+\n+if test -z \"$GIT_INTERNAL_GETTEXT_TEST_FALLBACKS\" && type gettext.sh >/dev/null 2>&1\n+then\n+\t# This is GNU libintl's gettext.sh, we don't need to do anything\n+\t# else than setting up the environment and loading gettext.sh\n+\tGIT_INTERNAL_GETTEXT_SH_SCHEME=gnu\n+\texport GIT_INTERNAL_GETTEXT_SH_SCHEME\n+\n+\t# Try to use libintl's gettext.sh, or fall back to English if we\n+\t# can't.\n+\t. gettext.sh\n+elif test -z \"$GIT_INTERNAL_GETTEXT_TEST_FALLBACKS\" && test \"$(gettext -h 2>&1)\" = \"-h\"\n+then\n+\t# We don't have gettext.sh, but there's a gettext binary in our\n+\t# path. This is probably Solaris or something like it which has a\n+\t# gettext implementation that isn't GNU libintl.\n+\tGIT_INTERNAL_GETTEXT_SH_SCHEME=solaris\n+\texport GIT_INTERNAL_GETTEXT_SH_SCHEME\n+\n+\t# Solaris has a gettext(1) but no eval_gettext(1)\n+\teval_gettext () {\n+\t\tgettext_out=$(gettext \"$1\")\n+\t\tgettext_eval=\"printf '%s' \\\"$gettext_out\\\"\"\n+\t\tprintf \"%s\" \"`eval \\\"$gettext_eval\\\"`\"\n+\t}\n+else\n+\t# Since gettext.sh isn't available we'll have to define our own\n+\t# dummy pass-through functions.\n+\n+\t# Tell our tests that we don't have the real gettext.sh\n+\tGIT_INTERNAL_GETTEXT_SH_SCHEME=fallthrough\n+\texport GIT_INTERNAL_GETTEXT_SH_SCHEME\n+\n+\tgettext () {\n+\t\tprintf \"%s\" \"$1\"\n+\t}\n+\n+\teval_gettext () {\n+\t\tgettext_eval=\"printf '%s' \\\"$1\\\"\"\n+\t\tprintf \"%s\" \"`eval \\\"$gettext_eval\\\"`\"\n+\t}\n+fi\ndiff --git a/git.c b/git.c\nindex 8de4810..f154852 100644\n--- a/git.c\n+++ b/git.c\n@@ -3,6 +3,7 @@\n #include \"cache.h\"\n #include \"quote.h\"\n #include \"run-command.h\"\n+#include \"gettext.h\"\n \n const char git_usage_string[] =\n \t\"git [--version] [--exec-path[=GIT_EXEC_PATH]] [--html-path]\\n\"\n@@ -502,6 +503,8 @@ int main(int argc, const char **argv)\n \tif (!cmd)\n \t\tcmd = \"git-help\";\n \n+\tgit_setup_gettext();\n+\n \t/*\n \t * \"git-xxxx\" is the same as \"git xxxx\", but we obviously:\n \t *\ndiff --git a/http-backend.c b/http-backend.c\nindex 14c90c2..502103d 100644\n--- a/http-backend.c\n+++ b/http-backend.c\n@@ -7,6 +7,7 @@\n #include \"run-command.h\"\n #include \"string-list.h\"\n #include \"url.h\"\n+#include \"gettext.h\"\n \n static const char content_type[] = \"Content-Type\";\n static const char content_length[] = \"Content-Length\";\n@@ -550,6 +551,8 @@ int main(int argc, char **argv)\n \tchar *cmd_arg = NULL;\n \tint i;\n \n+\tgit_setup_gettext();\n+\n \tgit_extract_argv0_path(argv[0]);\n \tset_die_routine(die_webcgi);\n \ndiff --git a/http-fetch.c b/http-fetch.c\nindex 762c750..b889c36 100644\n--- a/http-fetch.c\n+++ b/http-fetch.c\n@@ -2,6 +2,7 @@\n #include \"exec_cmd.h\"\n #include \"http.h\"\n #include \"walker.h\"\n+#include \"gettext.h\"\n \n static const char http_fetch_usage[] = \"git http-fetch \"\n \"[-c] [-t] [-a] [-v] [--recover] [-w ref] [--stdin] commit-id url\";\n@@ -24,6 +25,8 @@ int main(int argc, const char **argv)\n \tint get_verbosely = 0;\n \tint get_recover = 0;\n \n+\tgit_setup_gettext();\n+\n \tgit_extract_argv0_path(argv[0]);\n \n \twhile (arg < argc && argv[arg][0] == '-') {\ndiff --git a/http-push.c b/http-push.c\nindex c9bcd11..fc2c5f7 100644\n--- a/http-push.c\n+++ b/http-push.c\n@@ -10,6 +10,7 @@\n #include \"remote.h\"\n #include \"list-objects.h\"\n #include \"sigchain.h\"\n+#include \"gettext.h\"\n \n #include <expat.h>\n \n@@ -1791,6 +1792,8 @@ int main(int argc, char **argv)\n \tstruct remote *remote;\n \tchar *rewritten_url = NULL;\n \n+\tgit_setup_gettext();\n+\n \tgit_extract_argv0_path(argv[0]);\n \n \trepo = xcalloc(sizeof(*repo), 1);\ndiff --git a/imap-send.c b/imap-send.c\nindex 71506a8..c9dc7ec 100644\n--- a/imap-send.c\n+++ b/imap-send.c\n@@ -25,6 +25,7 @@\n #include \"cache.h\"\n #include \"exec_cmd.h\"\n #include \"run-command.h\"\n+#include \"gettext.h\"\n #ifdef NO_OPENSSL\n typedef void *SSL;\n #else\n@@ -1539,6 +1540,8 @@ int main(int argc, char **argv)\n \n \tgit_extract_argv0_path(argv[0]);\n \n+\tgit_setup_gettext();\n+\n \tif (argc != 1)\n \t\tusage(imap_send_usage);\n \ndiff --git a/perl/Git/I18N.pm b/perl/Git/I18N.pm\nnew file mode 100644\nindex 0000000..5918d68\n--- /dev/null\n+++ b/perl/Git/I18N.pm\n@@ -0,0 +1,91 @@\n+package Git::I18N;\n+use 5.006002;\n+use strict;\n+use warnings;\n+use Exporter;\n+use base 'Exporter';\n+\n+our $VERSION = '0.01';\n+\n+our @EXPORT = qw(__);\n+our @EXPORT_OK = @EXPORT;\n+\n+sub __bootstrap_locale_messages {\n+\tour $TEXTDOMAIN = 'git';\n+\tour $TEXTDOMAINDIR = $ENV{GIT_TEXTDOMAINDIR} || '++LOCALEDIR++';\n+\n+\trequire POSIX;\n+\tPOSIX->import(qw(setlocale));\n+\t# Non-core prerequisite module\n+\trequire Locale::Messages;\n+\tLocale::Messages->import(qw(:locale_h :libintl_h));\n+\n+\tsetlocale(LC_MESSAGES(), '');\n+\tsetlocale(LC_CTYPE(), '');\n+\ttextdomain($TEXTDOMAIN);\n+\tbindtextdomain($TEXTDOMAIN => $TEXTDOMAINDIR);\n+\n+\treturn;\n+}\n+\n+BEGIN\n+{\n+\t# Used by our test script to see if it should test fallbacks or\n+\t# not.\n+\tour $__HAS_LIBRARY = 1;\n+\n+\tlocal $@;\n+\teval { __bootstrap_locale_messages() };\n+\tif ($@) {\n+\t\t# Tell test.pl that we couldn't load the gettext library.\n+\t\t$Git::I18N::__HAS_LIBRARY = 0;\n+\n+\t\t# Just a fall-through no-op\n+\t\t*__ = sub ($) { $_[0] };\n+\t} else {\n+\t\t*__ = \\&Locale::Messages::gettext;\n+\t}\n+}\n+\n+1;\n+\n+__END__\n+\n+=head1 NAME\n+\n+Git::I18N - Perl interface to Git's Gettext localizations\n+\n+=head1 SYNOPSIS\n+\n+\tuse Git::I18N;\n+\n+\tprint __(\"Welcome to Git!\\n\");\n+\n+\tprintf __(\"The following error occured: %s\\n\"), $error;\n+\n+=head1 DESCRIPTION\n+\n+Git's internal Perl interface to gettext via L<Locale::Messages>. If\n+L<Locale::Messages> can't be loaded (it's not a core module) we\n+provide stub passthrough fallbacks.\n+\n+This is a distilled interface to gettext, see C<info '(gettext)Perl'>\n+for the full interface. This module implements only a small part of\n+it.\n+\n+=head1 FUNCTIONS\n+\n+=head2 __($)\n+\n+L<Locale::Messages>'s gettext function if all goes well, otherwise our\n+passthrough fallback function.\n+\n+=head1 AUTHOR\n+\n+E<AElig>var ArnfjE<ouml>rE<eth> Bjarmason <avarab@gmail.com>\n+\n+=head1 COPYRIGHT\n+\n+Copyright 2010 E<AElig>var ArnfjE<ouml>rE<eth> Bjarmason <avarab@gmail.com>\n+\n+=cut\ndiff --git a/perl/Makefile b/perl/Makefile\nindex a2ffb64..b2977cd 100644\n--- a/perl/Makefile\n+++ b/perl/Makefile\n@@ -5,6 +5,7 @@ makfile:=perl.mak\n \n PERL_PATH_SQ = $(subst ','\\'',$(PERL_PATH))\n prefix_SQ = $(subst ','\\'',$(prefix))\n+localedir_SQ = $(subst ','\\'',$(localedir))\n \n ifndef V\n \tQUIET = @\n@@ -38,7 +39,7 @@ $(makfile): ../GIT-CFLAGS Makefile\n \techo '\techo $(instdir_SQ)' >> $@\n else\n $(makfile): Makefile.PL ../GIT-CFLAGS\n-\t$(PERL_PATH) $< PREFIX='$(prefix_SQ)' INSTALL_BASE=''\n+\t$(PERL_PATH) $< PREFIX='$(prefix_SQ)' INSTALL_BASE='' --localedir='$(localedir_SQ)'\n endif\n \n # this is just added comfort for calling make directly in perl dir\ndiff --git a/perl/Makefile.PL b/perl/Makefile.PL\nindex 0b9deca..456d45b 100644\n--- a/perl/Makefile.PL\n+++ b/perl/Makefile.PL\n@@ -1,4 +1,12 @@\n+use strict;\n+use warnings;\n use ExtUtils::MakeMaker;\n+use Getopt::Long;\n+\n+# Sanity: die at first unknown option\n+Getopt::Long::Configure qw/ pass_through /;\n+\n+GetOptions(\"localedir=s\" => \\my $localedir);\n \n sub MY::postamble {\n \treturn <<'MAKE_FRAG';\n@@ -16,7 +24,10 @@ endif\n MAKE_FRAG\n }\n \n-my %pm = ('Git.pm' => '$(INST_LIBDIR)/Git.pm');\n+my %pm = (\n+\t'Git.pm' => '$(INST_LIBDIR)/Git.pm',\n+\t'Git/I18N.pm' => '$(INST_LIBDIR)/Git/I18N.pm',\n+);\n \n # We come with our own bundled Error.pm. It's not in the set of default\n # Perl modules so install it if it's not available on the system yet.\n@@ -33,6 +44,7 @@ WriteMakefile(\n \tNAME            => 'Git',\n \tVERSION_FROM    => 'Git.pm',\n \tPM\t\t=> \\%pm,\n+\tPM_FILTER\t=> qq[\\$(PERL) -pe \"s<\\\\Q++LOCALEDIR++\\\\E><$localedir>\"],\n \tMAKEFILE\t=> 'perl.mak',\n \tINSTALLSITEMAN3DIR => '$(SITEPREFIX)/share/man/man3'\n );\ndiff --git a/po/.gitignore b/po/.gitignore\nnew file mode 100644\nindex 0000000..221000e\n--- /dev/null\n+++ b/po/.gitignore\n@@ -0,0 +1 @@\n+/*.pot\ndiff --git a/po/is.po b/po/is.po\nnew file mode 100644\nindex 0000000..03ca199\n--- /dev/null\n+++ b/po/is.po\n@@ -0,0 +1,40 @@\n+msgid \"\"\n+msgstr \"\"\n+\"Project-Id-Version: Git\\n\"\n+\"PO-Revision-Date: 2010-06-05 19:06 +0000\\n\"\n+\"Language-Team: Git Mailing List <git@vger.kernel.org>\\n\"\n+\"Report-Msgid-Bugs-To: Git Mailing List <git@vger.kernel.org>\\n\"\n+\"Last-Translator: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\\n\"\n+\"MIME-Version: 1.0\\n\"\n+\"Content-Type: text/plain; charset=UTF-8\\n\"\n+\"Content-Transfer-Encoding: 8bit\\n\"\n+\n+msgid \"See git help COMMAND for more information on a specific command.\"\n+msgstr \"Sjá git help SKIPUN til að sjá hjálp fyrir tiltekna skipun.\"\n+\n+#. TRANSLATORS: This is a test. You don't need to translate it.\n+msgid \"TEST: A C test string\"\n+msgstr \"TILRAUN: C tilraunastrengur\"\n+\n+#. TRANSLATORS: This is a test. You don't need to translate it.\n+#, c-format\n+msgid \"TEST: A C test string %s\"\n+msgstr \"TILRAUN: C tilraunastrengur %s\"\n+\n+#. TRANSLATORS: This is a test. You don't need to translate it.\n+msgid \"TEST: A Shell test string\"\n+msgstr \"TILRAUN: Skeljartilraunastrengur\"\n+\n+#. TRANSLATORS: This is a test. You don't need to translate it.\n+#, sh-format\n+msgid \"TEST: A Shell test $variable\"\n+msgstr \"TILRAUN: Skeljartilraunastrengur með breytunni $variable\"\n+\n+#. TRANSLATORS: This is a test. You don't need to translate it.\n+msgid \"TEST: A Perl test string\"\n+msgstr \"TILRAUN: Perl tilraunastrengur\"\n+\n+#. TRANSLATORS: This is a test. You don't need to translate it.\n+#, perl-format\n+msgid \"TEST: A Perl test variable %s\"\n+msgstr \"TILRAUN: Perl tilraunastrengur með breytunni %s\"\ndiff --git a/shell.c b/shell.c\nindex e4864e0..ba27c6b 100644\n--- a/shell.c\n+++ b/shell.c\n@@ -2,6 +2,7 @@\n #include \"quote.h\"\n #include \"exec_cmd.h\"\n #include \"strbuf.h\"\n+#include \"gettext.h\"\n \n static int do_generic_cmd(const char *me, char *arg)\n {\n@@ -51,6 +52,8 @@ int main(int argc, char **argv)\n \tstruct commands *cmd;\n \tint devnull_fd;\n \n+\tgit_setup_gettext();\n+\n \t/*\n \t * Always open file descriptors 0/1/2 to avoid clobbering files\n \t * in die().  It also avoids not messing up when the pipes are\ndiff --git a/show-index.c b/show-index.c\nindex 4c0ac13..c2f5448 100644\n--- a/show-index.c\n+++ b/show-index.c\n@@ -1,5 +1,6 @@\n #include \"cache.h\"\n #include \"pack.h\"\n+#include \"gettext.h\"\n \n static const char show_index_usage[] =\n \"git show-index < <packed archive index>\";\n@@ -11,6 +12,8 @@ int main(int argc, char **argv)\n \tunsigned int version;\n \tstatic unsigned int top_index[256];\n \n+\tgit_setup_gettext();\n+\n \tif (argc != 1)\n \t\tusage(show_index_usage);\n \tif (fread(top_index, 2 * 4, 1, stdin) != 1)\ndiff --git a/t/lib-gettext.sh b/t/lib-gettext.sh\nnew file mode 100644\nindex 0000000..831ee38\n--- /dev/null\n+++ b/t/lib-gettext.sh\n@@ -0,0 +1,42 @@\n+#!/bin/sh\n+#\n+# Copyright (c) 2010 Ævar Arnfjörð Bjarmason\n+#\n+\n+. ./test-lib.sh\n+\n+GIT_TEXTDOMAINDIR=\"$GIT_EXEC_PATH/share/locale\"\n+GIT_PO_PATH=\"$GIT_EXEC_PATH/po\"\n+export GIT_TEXTDOMAINDIR GIT_PO_PATH\n+\n+. \"$GIT_EXEC_PATH\"/git-sh-i18n\n+\n+if test_have_prereq GETTEXT\n+then\n+\t# is_IS.UTF-8 on Solaris and FreeBSD, is_IS.utf8 on Debian\n+\tis_IS_locale=$(locale -a | sed -n '/^is_IS\\.[uU][tT][fF]-*8$/{\n+\t\tp\n+\t\tq\n+\t}')\n+\t# Export it as an environmental variable so the t0202/test.pl Perl\n+\t# test can use it too\n+\texport is_IS_locale\n+\n+\tif test -n \"$is_IS_locale\" &&\n+\t\ttest $GIT_INTERNAL_GETTEXT_SH_SCHEME != \"fallthrough\"\n+\tthen\n+\t\t# Some of the tests need the reference Icelandic locale\n+\t\ttest_set_prereq GETTEXT_LOCALE\n+\n+\t\t# Exporting for t0202/test.pl\n+\t\tGETTEXT_LOCALE=1\n+\t\texport GETTEXT_LOCALE\n+\t\tsay \"# lib-gettext: Found '$is_IS_locale' as a is_IS UTF-8 locale\"\n+\telse\n+\t\tsay \"# lib-gettext: No is_IS UTF-8 locale available\"\n+\tfi\n+else\n+\t# Only run some tests when we don't have gettext support\n+\ttest_set_prereq NO_GETTEXT\n+\tsay \"# lib-gettext: No GETTEXT support available\"\n+fi\ndiff --git a/t/t0200-gettext.sh b/t/t0200-gettext.sh\nnew file mode 100755\nindex 0000000..522338d\n--- /dev/null\n+++ b/t/t0200-gettext.sh\n@@ -0,0 +1,113 @@\n+#!/bin/sh\n+#\n+# Copyright (c) 2010 Ævar Arnfjörð Bjarmason\n+#\n+\n+test_description='Gettext support for Git'\n+\n+. ./lib-gettext.sh\n+\n+test_expect_success \"sanity: \\$GIT_INTERNAL_GETTEXT_SH_SCHEME is set (to $GIT_INTERNAL_GETTEXT_SH_SCHEME)\" '\n+    test -n \"$GIT_INTERNAL_GETTEXT_SH_SCHEME\"\n+'\n+\n+test_expect_success 'sanity: $TEXTDOMAIN is git' '\n+    test $TEXTDOMAIN = \"git\"\n+'\n+\n+test_expect_success 'xgettext sanity: Perl _() strings are not extracted' '\n+    ! grep \"A Perl string xgettext will not get\" \"$GIT_PO_PATH\"/is.po\n+'\n+\n+test_expect_success 'xgettext sanity: Comment extraction with --add-comments' '\n+    grep \"TRANSLATORS: This is a test\" \"$TEST_DIRECTORY\"/t0200/* | wc -l >expect &&\n+    grep \"TRANSLATORS: This is a test\" \"$GIT_PO_PATH\"/is.po  | wc -l >actual &&\n+    test_cmp expect actual\n+'\n+\n+test_expect_success 'xgettext sanity: Comment extraction with --add-comments stops at statements' '\n+    ! grep \"This is a phony\" \"$GIT_PO_PATH\"/is.po &&\n+    ! grep \"the above comment\" \"$GIT_PO_PATH\"/is.po\n+'\n+\n+test_expect_success GETTEXT 'sanity: $TEXTDOMAINDIR exists without NO_GETTEXT=YesPlease' '\n+    test -d \"$TEXTDOMAINDIR\" &&\n+    test \"$TEXTDOMAINDIR\" = \"$GIT_TEXTDOMAINDIR\"\n+'\n+\n+test_expect_success GETTEXT 'sanity: Icelandic locale was compiled' '\n+    test -f \"$TEXTDOMAINDIR/is/LC_MESSAGES/git.mo\"\n+'\n+\n+test_expect_success NO_GETTEXT \"sanity: \\$TEXTDOMAINDIR doesn't exists with NO_GETTEXT=YesPlease\" '\n+    ! test -d \"$TEXTDOMAINDIR\" &&\n+    test \"$TEXTDOMAINDIR\" = \"$GIT_TEXTDOMAINDIR\"\n+'\n+\n+# TODO: When we have more locales, generalize this to test them\n+# all. Maybe we'll need a dir->locale map for that.\n+test_expect_success GETTEXT_LOCALE 'sanity: gettext(\"\") metadata is OK' '\n+    # Return value may be non-zero\n+    LANGUAGE=is LC_ALL=\"$is_IS_locale\" gettext \"\" >zero-expect &&\n+    grep \"Project-Id-Version: Git\" zero-expect &&\n+    grep \"Git Mailing List <git@vger.kernel.org>\" zero-expect &&\n+    grep \"Content-Type: text/plain; charset=UTF-8\" zero-expect &&\n+    grep \"Content-Transfer-Encoding: 8bit\" zero-expect\n+'\n+\n+test_expect_success GETTEXT_LOCALE 'sanity: gettext(unknown) is passed through' '\n+    printf \"This is not a translation string\"  >expect &&\n+    gettext \"This is not a translation string\" >actual &&\n+    eval_gettext \"This is not a translation string\" >actual &&\n+    test_cmp expect actual\n+'\n+\n+# xgettext from C\n+test_expect_success GETTEXT_LOCALE 'xgettext: C extraction of _() and N_() strings' '\n+    printf \"TILRAUN: C tilraunastrengur\" >expect &&\n+    printf \"\\n\" >>expect &&\n+    printf \"Sjá git help SKIPUN til að sjá hjálp fyrir tiltekna skipun.\" >>expect &&\n+    LANGUAGE=is LC_ALL=\"$is_IS_locale\" gettext \"TEST: A C test string\" >actual &&\n+    printf \"\\n\" >>actual &&\n+    LANGUAGE=is LC_ALL=\"$is_IS_locale\" gettext \"See git help COMMAND for more information on a specific command.\" >>actual &&\n+    test_cmp expect actual\n+'\n+\n+test_expect_success GETTEXT_LOCALE 'xgettext: C extraction with %s' '\n+    printf \"TILRAUN: C tilraunastrengur %%s\" >expect &&\n+    LANGUAGE=is LC_ALL=\"$is_IS_locale\" gettext \"TEST: A C test string %s\" >actual &&\n+    test_cmp expect actual\n+'\n+\n+# xgettext from Shell\n+test_expect_success GETTEXT_LOCALE 'xgettext: Shell extraction' '\n+    printf \"TILRAUN: Skeljartilraunastrengur\" >expect &&\n+    LANGUAGE=is LC_ALL=\"$is_IS_locale\" gettext \"TEST: A Shell test string\" >actual &&\n+    test_cmp expect actual\n+'\n+\n+test_expect_success GETTEXT_LOCALE 'xgettext: Shell extraction with $variable' '\n+    printf \"TILRAUN: Skeljartilraunastrengur með breytunni a var i able\" >x-expect &&\n+    LANGUAGE=is LC_ALL=\"$is_IS_locale\" variable=\"a var i able\" eval_gettext \"TEST: A Shell test \\$variable\" >x-actual &&\n+    test_cmp x-expect x-actual\n+'\n+\n+# xgettext from Perl\n+test_expect_success GETTEXT_LOCALE 'xgettext: Perl extraction' '\n+    printf \"TILRAUN: Perl tilraunastrengur\" >expect &&\n+    LANGUAGE=is LC_ALL=\"$is_IS_locale\" gettext \"TEST: A Perl test string\" >actual &&\n+    test_cmp expect actual\n+'\n+\n+test_expect_success GETTEXT_LOCALE 'xgettext: Perl extraction with %s' '\n+    printf \"TILRAUN: Perl tilraunastrengur með breytunni %%s\" >expect &&\n+    LANGUAGE=is LC_ALL=\"$is_IS_locale\" gettext \"TEST: A Perl test variable %s\" >actual &&\n+    test_cmp expect actual\n+'\n+\n+test_expect_success GETTEXT_LOCALE 'sanity: Some gettext(\"\") data for real locale' '\n+    LANGUAGE=is LC_ALL=\"$is_IS_locale\" gettext \"\" >real-locale &&\n+    test -s real-locale\n+'\n+\n+test_done\ndiff --git a/t/t0200/test.c b/t/t0200/test.c\nnew file mode 100644\nindex 0000000..93373b3\n--- /dev/null\n+++ b/t/t0200/test.c\n@@ -0,0 +1,13 @@\n+/* This is a phony C program that's only here to test xgettext message extraction */\n+\n+const char help[] =\n+\tN_(\"See 'git help COMMAND' for more information on a specific command.\");\n+\n+int main(void)\n+{\n+\t/* TRANSLATORS: This is a test. You don't need to translate it. */\n+\tputs(_(\"TEST: A C test string\"));\n+\n+\t/* TRANSLATORS: This is a test. You don't need to translate it. */\n+\tprintf(_(\"TEST: A C test string %s\"), \"variable\");\n+}\ndiff --git a/t/t0200/test.perl b/t/t0200/test.perl\nnew file mode 100644\nindex 0000000..36fba34\n--- /dev/null\n+++ b/t/t0200/test.perl\n@@ -0,0 +1,14 @@\n+# This is a phony Perl program that's only here to test xgettext\n+# message extraction\n+\n+# so the above comment won't be folded into the next one by xgettext\n+1;\n+\n+# TRANSLATORS: This is a test. You don't need to translate it.\n+print __(\"TEST: A Perl test string\");\n+\n+# TRANSLATORS: This is a test. You don't need to translate it.\n+printf __(\"TEST: A Perl test variable %s\"), \"moo\";\n+\n+# TRANSLATORS: If you see this, Git has a bug\n+print _\"TEST: A Perl string xgettext will not get\";\ndiff --git a/t/t0200/test.sh b/t/t0200/test.sh\nnew file mode 100644\nindex 0000000..022d607\n--- /dev/null\n+++ b/t/t0200/test.sh\n@@ -0,0 +1,14 @@\n+# This is a phony Shell program that's only here to test xgettext\n+# message extraction\n+\n+# so the above comment won't be folded into the next one by xgettext\n+echo\n+\n+# TRANSLATORS: This is a test. You don't need to translate it.\n+gettext \"TEST: A Shell test string\"\n+\n+# TRANSLATORS: This is a test. You don't need to translate it.\n+eval_gettext \"TEST: A Shell test \\$variable\"\n+\n+# TRANSLATORS: If you see this, Git has a bug\n+_(\"TEST: A Shell string xgettext won't get\")\ndiff --git a/t/t0201-gettext-fallbacks.sh b/t/t0201-gettext-fallbacks.sh\nnew file mode 100755\nindex 0000000..47ce4f6\n--- /dev/null\n+++ b/t/t0201-gettext-fallbacks.sh\n@@ -0,0 +1,49 @@\n+#!/bin/sh\n+#\n+# Copyright (c) 2010 Ævar Arnfjörð Bjarmason\n+#\n+\n+test_description='Gettext Shell fallbacks'\n+\n+GIT_INTERNAL_GETTEXT_TEST_FALLBACKS=YesPlease\n+export GIT_INTERNAL_GETTEXT_TEST_FALLBACKS\n+\n+. ./lib-gettext.sh\n+\n+test_expect_success \"sanity: \\$GIT_INTERNAL_GETTEXT_SH_SCHEME is set (to $GIT_INTERNAL_GETTEXT_SH_SCHEME)\" '\n+    test -n \"$GIT_INTERNAL_GETTEXT_SH_SCHEME\"\n+'\n+\n+test_expect_success 'sanity: $GIT_INTERNAL_GETTEXT_TEST_FALLBACKS is set' '\n+    test -n \"$GIT_INTERNAL_GETTEXT_TEST_FALLBACKS\"\n+'\n+\n+test_expect_success 'sanity: $GIT_INTERNAL_GETTEXT_SH_SCHEME\" is fallthrough' '\n+    test \"$GIT_INTERNAL_GETTEXT_SH_SCHEME\" = \"fallthrough\"\n+'\n+\n+test_expect_success 'gettext: our gettext() fallback has pass-through semantics' '\n+    printf \"test\" >expect &&\n+    gettext \"test\" >actual &&\n+    test_cmp expect actual &&\n+    printf \"test more words\" >expect &&\n+    gettext \"test more words\" >actual &&\n+    test_cmp expect actual\n+'\n+\n+test_expect_success 'eval_gettext: our eval_gettext() fallback has pass-through semantics' '\n+    printf \"test\" >expect &&\n+    eval_gettext \"test\" >actual &&\n+    test_cmp expect actual &&\n+    printf \"test more words\" >expect &&\n+    eval_gettext \"test more words\" >actual &&\n+    test_cmp expect actual\n+'\n+\n+test_expect_success 'eval_gettext: our eval_gettext() fallback can interpolate variables' '\n+    printf \"test YesPlease\" >expect &&\n+    eval_gettext \"test \\$GIT_INTERNAL_GETTEXT_TEST_FALLBACKS\" >actual &&\n+    test_cmp expect actual\n+'\n+\n+test_done\ndiff --git a/t/t0202-gettext-perl.sh b/t/t0202-gettext-perl.sh\nnew file mode 100755\nindex 0000000..428ebb0\n--- /dev/null\n+++ b/t/t0202-gettext-perl.sh\n@@ -0,0 +1,27 @@\n+#!/bin/sh\n+#\n+# Copyright (c) 2010 Ævar Arnfjörð Bjarmason\n+#\n+\n+test_description='Perl gettext interface (Git::I18N)'\n+\n+. ./lib-gettext.sh\n+\n+if ! test_have_prereq PERL; then\n+\tskip_all='skipping perl interface tests, perl not available'\n+\ttest_done\n+fi\n+\n+\"$PERL_PATH\" -MTest::More -e 0 2>/dev/null || {\n+\tskip_all=\"Perl Test::More unavailable, skipping test\"\n+\ttest_done\n+}\n+\n+# The external test will outputs its own plan\n+test_external_has_tap=1\n+\n+test_external_without_stderr \\\n+    'Perl Git::I18N API' \\\n+    \"$PERL_PATH\" \"$TEST_DIRECTORY\"/t0202/test.pl\n+\n+test_done\ndiff --git a/t/t0202/test.pl b/t/t0202/test.pl\nnew file mode 100644\nindex 0000000..c2055fa\n--- /dev/null\n+++ b/t/t0202/test.pl\n@@ -0,0 +1,107 @@\n+#!/usr/bin/perl\n+use 5.006002;\n+use lib (split(/:/, $ENV{GITPERLLIB}));\n+use warnings;\n+use strict;\n+use Test::More tests => 9;\n+use Git::I18N;\n+use POSIX qw(:locale_h);\n+\n+my $has_gettext_library = $Git::I18N::__HAS_LIBRARY;\n+\n+ok(1, \"Testing Git::I18N version $Git::I18N::VERSION with \" .\n+\t ($has_gettext_library\n+\t  ? \"Locale::Messages version $Locale::Messages::VERSION\"\n+\t  : \"NO Perl gettext library\"));\n+ok(1, \"Git::I18N is located at $INC{'Git/I18N.pm'}\");\n+\n+ok($Git::I18N::VERSION, 'sanity: Git::I18N defines a $VERSION');\n+{\n+\tmy $exports = @Git::I18N::EXPORT;\n+\tok($exports, \"sanity: Git::I18N has $exports export(s)\");\n+}\n+is_deeply(\\@Git::I18N::EXPORT, \\@Git::I18N::EXPORT_OK, \"sanity: Git::I18N exports everything by default\");\n+\n+# prototypes\n+{\n+\t# Add prototypes here when modifying the public interface to add\n+\t# more gettext wrapper functions.\n+\tmy %prototypes = (qw(\n+\t\t__\t$\n+    ));\n+\twhile (my ($sub, $proto) = each %prototypes) {\n+\t\tis(prototype(\\&{\"Git::I18N::$sub\"}), $proto, \"sanity: $sub has a $proto prototype\");\n+\t}\n+}\n+\n+# Test basic passthrough in the C locale\n+{\n+\tlocal $ENV{LANGUAGE} = 'C';\n+\tlocal $ENV{LC_ALL}   = 'C';\n+\tlocal $ENV{LANG} = 'C';\n+\n+\tmy ($got, $expect) = (('TEST: A Perl test string') x 2);\n+\n+\tis(__($got), $expect, \"Passing a string through __() in the C locale works\");\n+}\n+\n+# Test a basic message on different locales\n+SKIP: {\n+\tunless ($ENV{GETTEXT_LOCALE}) {\n+\t\t# Can't reliably test __() with a non-C locales because the\n+\t\t# required locales may not be installed on the system.\n+\t\t#\n+\t\t# We test for these anyway as part of the shell\n+\t\t# tests. Skipping these here will eliminate failures on odd\n+\t\t# platforms with incomplete locale data.\n+\n+\t\tskip \"GETTEXT_LOCALE must be set by lib-gettext.sh for exhaustive Git::I18N tests\", 2;\n+\t}\n+\n+\t# The is_IS UTF-8 locale passed from lib-gettext.sh\n+\tmy $is_IS_locale = $ENV{is_IS_locale};\n+\n+\tmy $test = sub {\n+\t\tmy ($got, $expect, $msg, $locale) = @_;\n+\t\t# Maybe this system doesn't have the locale we're trying to\n+\t\t# test.\n+\t\tmy $locale_ok = setlocale(LC_ALL, $locale);\n+\t\tis(__($got), $expect, \"$msg a gettext library + <$locale> locale <$got> turns into <$expect>\");\n+\t};\n+\n+\tmy $env_C = sub {\n+\t\t$ENV{LANGUAGE} = 'C';\n+\t\t$ENV{LC_ALL}   = 'C';\n+\t};\n+\n+\tmy $env_is = sub {\n+\t\t$ENV{LANGUAGE} = 'is';\n+\t\t$ENV{LC_ALL}   = $is_IS_locale;\n+\t};\n+\n+\t# Translation's the same as the original\n+\tmy ($got, $expect) = (('TEST: A Perl test string') x 2);\n+\n+\tif ($has_gettext_library) {\n+\t\t{\n+\t\t\tlocal %ENV; $env_C->();\n+\t\t\t$test->($got, $expect, \"With\", 'C');\n+\t\t}\n+\n+\t\t{\n+\t\t\tmy ($got, $expect) = ($got, 'TILRAUN: Perl tilraunastrengur');\n+\t\t\tlocal %ENV; $env_is->();\n+\t\t\t$test->($got, $expect, \"With\", $is_IS_locale);\n+\t\t}\n+\t} else {\n+\t\t{\n+\t\t\tlocal %ENV; $env_C->();\n+\t\t\t$test->($got, $expect, \"Without\", 'C');\n+\t\t}\n+\n+\t\t{\n+\t\t\tlocal %ENV; $env_is->();\n+\t\t\t$test->($got, $expect, \"Without\", 'is');\n+\t\t}\n+\t}\n+}\ndiff --git a/t/test-lib.sh b/t/test-lib.sh\nindex dff5e25..3fcb272 100644\n--- a/t/test-lib.sh\n+++ b/t/test-lib.sh\n@@ -37,6 +37,7 @@ ORIGINAL_TERM=$TERM\n # For repeatability, reset the environment to known value.\n LANG=C\n LC_ALL=C\n+LANGUAGE=C\n PAGER=cat\n TZ=UTC\n TERM=dumb\n@@ -961,6 +962,7 @@ esac\n \n test -z \"$NO_PERL\" && test_set_prereq PERL\n test -z \"$NO_PYTHON\" && test_set_prereq PYTHON\n+test -z \"$NO_GETTEXT\" && test_set_prereq GETTEXT\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\ndiff --git a/upload-pack.c b/upload-pack.c\nindex 92f9530..ce27a1a 100644\n--- a/upload-pack.c\n+++ b/upload-pack.c\n@@ -10,6 +10,7 @@\n #include \"revision.h\"\n #include \"list-objects.h\"\n #include \"run-command.h\"\n+#include \"gettext.h\"\n \n static const char upload_pack_usage[] = \"git upload-pack [--strict] [--timeout=nn] <dir>\";\n \n@@ -682,6 +683,8 @@ int main(int argc, char **argv)\n \tint i;\n \tint strict = 0;\n \n+\tgit_setup_gettext();\n+\n \tgit_extract_argv0_path(argv[0]);\n \tread_replace_refs = 0;\n \n-- \n1.7.2.3.313.gcd15\n"},{"id":"149885","messageId":"1283638229-14199-4-git-send-email-avarab@gmail.com","threadId":"24977","inReplyTo":"1283638229-14199-1-git-send-email-avarab@gmail.com","subject":"[PATCH 05/63] tests: locate i18n lib&data correctly under --valgrind","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2010-09-04T22:10:23Z","receivedAt":"2010-09-04T22:10:23Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"From: Thomas Rast <trast@student.ethz.ch>\n\nThe new t020[01] for gettext support did not find git-sh-i18n and the\ntranslation data when run under --valgrind: lib-gettext.sh tried to\nlocate them under $GIT_EXEC_PATH, which normally is the git build\ndirectory, but is changed by --valgrind to point to the wrappers.\n\nIntroduce a new variable $GIT_BUILD_DIR which can be used to locate\ndata that resides under the build directory, and use that instead.\n\nSigned-off-by: Thomas Rast <trast@student.ethz.ch>\nSigned-off-by: Junio C Hamano <gitster@pobox.com>\nSigned-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n t/lib-gettext.sh |    6 +++---\n 1 files changed, 3 insertions(+), 3 deletions(-)\n\ndiff --git a/t/lib-gettext.sh b/t/lib-gettext.sh\nindex 831ee38..f0cdd3d 100644\n--- a/t/lib-gettext.sh\n+++ b/t/lib-gettext.sh\n@@ -5,11 +5,11 @@\n \n . ./test-lib.sh\n \n-GIT_TEXTDOMAINDIR=\"$GIT_EXEC_PATH/share/locale\"\n-GIT_PO_PATH=\"$GIT_EXEC_PATH/po\"\n+GIT_TEXTDOMAINDIR=\"$GIT_BUILD_DIR/share/locale\"\n+GIT_PO_PATH=\"$GIT_BUILD_DIR/po\"\n export GIT_TEXTDOMAINDIR GIT_PO_PATH\n \n-. \"$GIT_EXEC_PATH\"/git-sh-i18n\n+. \"$GIT_BUILD_DIR\"/git-sh-i18n\n \n if test_have_prereq GETTEXT\n then\n-- \n1.7.2.3.313.gcd15\n"},{"id":"149883","messageId":"1283638229-14199-5-git-send-email-avarab@gmail.com","threadId":"24977","inReplyTo":"1283638229-14199-1-git-send-email-avarab@gmail.com","subject":"[PATCH 21/63] po/is.po: add Icelandic translation","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2010-09-04T22:10:24Z","receivedAt":"2010-09-04T22:10:24Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"Translate the non-TEST messages added in recent patches against\ninit-db.c. This brings Icelandic translation coverage up to 100%.\n\nSigned-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n po/is.po |   95 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n 1 files changed, 95 insertions(+), 0 deletions(-)\n\ndiff --git a/po/is.po b/po/is.po\nindex 2c38b32..85d15b8 100644\n--- a/po/is.po\n+++ b/po/is.po\n@@ -11,6 +11,101 @@ msgstr \"\"\n \"Content-Type: text/plain; charset=UTF-8\\n\"\n \"Content-Transfer-Encoding: 8bit\\n\"\n \n+#, c-format\n+msgid \"Could not make %s writable by group\"\n+msgstr \"Gat ekki gert %s skrifanlega af hóp\"\n+\n+#, c-format\n+msgid \"insanely long template name %s\"\n+msgstr \"brjálæðislega langt sniðsnafn %s\"\n+\n+#, c-format\n+msgid \"cannot stat '%s'\"\n+msgstr \"gat ekki stat-að '%s'\"\n+\n+#, c-format\n+msgid \"cannot stat template '%s'\"\n+msgstr \"gat ekki stat-að sniðið '%s'\"\n+\n+#, c-format\n+msgid \"cannot opendir '%s'\"\n+msgstr \"gat ekki opnað móppuna '%s'\"\n+\n+#, c-format\n+msgid \"cannot readlink '%s'\"\n+msgstr \"gat ekki lesið tengilinn '%s'\"\n+\n+#, c-format\n+msgid \"insanely long symlink %s\"\n+msgstr \"brjálæðislega langur tengill %s\"\n+\n+#, c-format\n+msgid \"cannot symlink '%s' '%s'\"\n+msgstr \"gat ekki búið til tengilinn '%s' '%s'\"\n+\n+#, c-format\n+msgid \"cannot copy '%s' to '%s'\"\n+msgstr \"gat ekki afritað '%s' til '%s'\"\n+\n+#, c-format\n+msgid \"ignoring template %s\"\n+msgstr \"hunsa sniðið %s\"\n+\n+#, c-format\n+msgid \"insanely long template path %s\"\n+msgstr \"brjálæðislega löng slóð á snið %s\"\n+\n+#, c-format\n+msgid \"templates not found %s\"\n+msgstr \"sniðið fannst ekki %s\"\n+\n+#, c-format\n+msgid \"not copying templates of a wrong format version %d from '%s'\"\n+msgstr \"aftira ekki sniðin vegna rangar útgáfu %d frá '%s'\"\n+\n+#, c-format\n+msgid \"insane git directory %s\"\n+msgstr \"brjálúð git mappa %s\"\n+\n+#. TRANSLATORS: The first '%s' is either \"Reinitialized\n+#. existing\" or \"Initialized empty\", the second \" shared\" or\n+#. \"\", and the last '%s%s' is the verbatim directory name.\n+#, c-format\n+msgid \"%s%s Git repository in %s%s\\n\"\n+msgstr \"%s%s Git lind í %s%s\\n\"\n+\n+msgid \"Reinitialized existing\"\n+msgstr \"Endurgerði\"\n+\n+msgid \"Initialized empty\"\n+msgstr \"Bjó til tóma\"\n+\n+msgid \" shared\"\n+msgstr \" sameiginlega\"\n+\n+msgid \"cannot tell cwd\"\n+msgstr \"finn ekki núverandi möppu\"\n+\n+#, c-format\n+msgid \"cannot mkdir %s\"\n+msgstr \"gat ekki búið til möppuna %s\"\n+\n+#, c-format\n+msgid \"cannot chdir to %s\"\n+msgstr \"get ekki farið inn í möppuna %s\"\n+\n+#, c-format\n+msgid \"%s (or --work-tree=<directory>) not allowed without specifying %s (or --git-dir=<directory>)\"\n+msgstr \"%s (eða --work-tree=<mappa>) ekki leyfilegt ásamt %s (eða --git-dir=<mappa>)\"\n+\n+msgid \"Cannot access current working directory\"\n+msgstr \"Get ekki opnað núverandi vinnumöppu\"\n+\n+#, c-format\n+msgid \"Cannot access work tree '%s'\"\n+msgstr \"Get ekki opnað vinnutré '%s'\"\n+\n+#. TRANSLATORS: This is a test. You don't need to translate it.\n msgid \"See 'git help COMMAND' for more information on a specific command.\"\n msgstr \"Sjá 'git help SKIPUN' til að sjá hjálp fyrir tiltekna skipun.\"\n \n-- \n1.7.2.3.313.gcd15\n"},{"id":"149882","messageId":"1283638229-14199-6-git-send-email-avarab@gmail.com","threadId":"24977","inReplyTo":"1283638229-14199-1-git-send-email-avarab@gmail.com","subject":"[PATCH 26/63] gettext tests: add GETTEXT_POISON=YesPlease Makefile parameter","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2010-09-04T22:10:25Z","receivedAt":"2010-09-04T22:10:25Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"Add a new GETTEXT_POISON=YesPlease Makefile debug target. With this\ntarget every invocation of _(s) will return \"# GETTEXT POISON #\"\ninstead of `s' or the msgstr that `s` would look up.\n\nThis target is intended to sanity check the gettextization series\nagainst the test suite.\n\nIf the test suite is relying on the US English output of Git the test\nshould either have a NO_GETTEXT_POISON prerequisite, or the message in\nquestion shouldn't be translated because it's a plumbing message.\n\nWe won't catch everything with this since we don't have 100% test\ncoverage, but the chances of us doing so are much larger.\n\nThe reason I'm using \"# GETTEXT POISON #\" is that a lot of tests that\nrely on the fake editor would break if it wasn't a comment, since the\ncomment message that's inserted on e.g. `git commit --amend' is\ntranslatable.\n\nSigned-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n Makefile      |    9 +++++++++\n gettext.h     |    4 ++++\n t/test-lib.sh |    1 +\n 3 files changed, 14 insertions(+), 0 deletions(-)\n\ndiff --git a/Makefile b/Makefile\nindex 4d2d4c7..f26fca3 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -43,6 +43,10 @@ all::\n # on platforms where we don't expect glibc (Linux, Hurd,\n # GNU/kFreeBSD), which includes libintl.\n #\n+# Define GETTEXT_POISON to turn all strings that use gettext into\n+# gibberish. This option should only be used by the Git developers to\n+# check that the Git gettext implementation itself is sane.\n+#\n # Define EXPATDIR=/foo/bar if your expat header and library files are in\n # /foo/bar/include and /foo/bar/lib directories.\n #\n@@ -1507,6 +1511,10 @@ ifdef NEEDS_LIBINTL\n \tEXTLIBS += -lintl\n endif\n \n+ifdef GETTEXT_POISON\n+\tCOMPAT_CFLAGS += -DGETTEXT_POISON\n+endif\n+\n ifeq ($(TCLTK_PATH),)\n NO_TCLTK=NoThanks\n endif\n@@ -2065,6 +2073,7 @@ ifdef GIT_TEST_CMP_USE_COPIED_CONTEXT\n \t@echo GIT_TEST_CMP_USE_COPIED_CONTEXT=YesPlease >>$@\n endif\n \t@echo NO_GETTEXT=\\''$(subst ','\\'',$(subst ','\\'',$(NO_GETTEXT)))'\\' >>$@\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 e02939a..94ab0f3 100644\n--- a/gettext.h\n+++ b/gettext.h\n@@ -11,8 +11,12 @@ extern void git_setup_gettext(void);\n #ifdef NO_GETTEXT\n #define _(s) (s)\n #else\n+#ifndef GETTEXT_POISON\n #include <libintl.h>\n #define _(s) gettext(s)\n+#else\n+#define _(s) \"# GETTEXT POISON #\"\n+#endif\n #endif\n \n #endif\ndiff --git a/t/test-lib.sh b/t/test-lib.sh\nindex 3fcb272..b297ef6 100644\n--- a/t/test-lib.sh\n+++ b/t/test-lib.sh\n@@ -963,6 +963,7 @@ esac\n test -z \"$NO_PERL\" && test_set_prereq PERL\n test -z \"$NO_PYTHON\" && test_set_prereq PYTHON\n test -z \"$NO_GETTEXT\" && test_set_prereq GETTEXT\n+test -z \"$GETTEXT_POISON\" && 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-- \n1.7.2.3.313.gcd15\n"},{"id":"149890","messageId":"1283638229-14199-7-git-send-email-avarab@gmail.com","threadId":"24977","inReplyTo":"1283638229-14199-1-git-send-email-avarab@gmail.com","subject":"[PATCH 27/63] gettext tests: skip lib-gettext.sh tests under GETTEXT_POISON","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2010-09-04T22:10:26Z","receivedAt":"2010-09-04T22:10:26Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"Change the gettext tests (all of whom use lib-gettext.sh) to skip\nunder GETTEXT_POISON=YesPlease. We also print a message to this\neffect.\n\nSigned-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n t/lib-gettext.sh |   10 ++++++++--\n 1 files changed, 8 insertions(+), 2 deletions(-)\n\ndiff --git a/t/lib-gettext.sh b/t/lib-gettext.sh\nindex 4570ead..c9a079e 100644\n--- a/t/lib-gettext.sh\n+++ b/t/lib-gettext.sh\n@@ -11,7 +11,7 @@ export GIT_TEXTDOMAINDIR GIT_PO_PATH\n \n . \"$GIT_BUILD_DIR\"/git-sh-i18n\n \n-if test_have_prereq GETTEXT\n+if test_have_prereq GETTEXT && test_have_prereq NO_GETTEXT_POISON\n then\n \t# is_IS.UTF-8 on Solaris and FreeBSD, is_IS.utf8 on Debian\n \tis_IS_locale=$(locale -a | sed -n '/^is_IS\\.[uU][tT][fF]-*8$/{\n@@ -58,5 +58,11 @@ then\n else\n \t# Only run some tests when we don't have gettext support\n \ttest_set_prereq NO_GETTEXT\n-\tsay \"# lib-gettext: No GETTEXT support available\"\n+\n+\tif test_have_prereq NO_GETTEXT_POISON\n+\tthen\n+\t\tsay \"# lib-gettext: GETTEXT_POISON defined, can't test gettext\"\n+\telse\n+\t\tsay \"# lib-gettext: No GETTEXT support available\"\n+\tfi\n fi\n-- \n1.7.2.3.313.gcd15\n"},{"id":"149884","messageId":"1283638229-14199-8-git-send-email-avarab@gmail.com","threadId":"24977","inReplyTo":"1283638229-14199-1-git-send-email-avarab@gmail.com","subject":"[PATCH 28/63] gettext tests: skip breaking tests under GETTEXT_POISON","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2010-09-04T22:10:27Z","receivedAt":"2010-09-04T22:10:27Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"Change the tests that depend on the output of the porcelain to only\nrun if the NO_GETTEXT_POISON prerequisite is set. These will always\nfail under GETTEXT_POISON=YesPlease.\n\nI've manually inspected these and determined to the best of my ability\nthat they aren't plumbing output.\n\nSigned-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n\n(repeated)\n\n    This is still the part of this series that needs the most\n    review. I *think* I got this right, but more eyes are needed on\n    it.\n\n t/lib-httpd.sh              |    2 +-\n t/t0001-init.sh             |    2 +-\n t/t1200-tutorial.sh         |    4 +-\n t/t2200-add-update.sh       |    2 +-\n t/t2204-add-ignored.sh      |    8 ++--\n t/t3030-merge-recursive.sh  |    2 +-\n t/t3200-branch.sh           |    2 +-\n t/t3203-branch-output.sh    |    2 +-\n t/t3700-add.sh              |    4 +-\n t/t4001-diff-rename.sh      |    4 +-\n t/t4014-format-patch.sh     |    2 +-\n t/t5541-http-push.sh        |    2 +-\n t/t5601-clone.sh            |    2 +-\n t/t6040-tracking-info.sh    |    2 +-\n t/t7004-tag.sh              |    6 ++-\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/t7500-commit.sh           |    9 +++-\n t/t7501-commit.sh           |   14 ++++--\n t/t7502-commit.sh           |   46 ++++++++++----------\n t/t7506-status-submodule.sh |   28 ++++++------\n t/t7508-status.sh           |   98 +++++++++++++++++++++---------------------\n t/t7600-merge.sh            |    2 +-\n t/t7811-grep-open.sh        |    2 +-\n 26 files changed, 139 insertions(+), 126 deletions(-)\n\ndiff --git a/t/lib-httpd.sh b/t/lib-httpd.sh\nindex e733f65..817b865 100644\n--- a/t/lib-httpd.sh\n+++ b/t/lib-httpd.sh\n@@ -154,7 +154,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/t0001-init.sh b/t/t0001-init.sh\nindex 7fe8883..b45df24 100755\n--- a/t/t0001-init.sh\n+++ b/t/t0001-init.sh\n@@ -124,7 +124,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\tunset GIT_CONFIG GIT_WORK_TREE GIT_CONFIG\ndiff --git a/t/t1200-tutorial.sh b/t/t1200-tutorial.sh\nindex ab55eda..c568e0e 100755\n--- a/t/t1200-tutorial.sh\n+++ b/t/t1200-tutorial.sh\n@@ -163,7 +163,9 @@ 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+test_expect_success NO_GETTEXT_POISON 'git resolve output' '\n \ttest_cmp resolve.expect resolve.output\n '\n \ndiff --git a/t/t2200-add-update.sh b/t/t2200-add-update.sh\nindex 2ad2819..b3b90ca 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'\\''\" &&\ndiff --git a/t/t2204-add-ignored.sh b/t/t2204-add-ignored.sh\nindex 24afdab..b7a0d71 100755\n--- a/t/t2204-add-ignored.sh\n+++ b/t/t2204-add-ignored.sh\n@@ -27,7 +27,7 @@ done\n \n for i in ign dir/ign dir/sub dir/sub/*ign sub/file sub sub/*\n do\n-\ttest_expect_success \"complaints for ignored $i\" '\n+\ttest_expect_success NO_GETTEXT_POISON \"complaints for ignored $i\" '\n \t\trm -f .git/index &&\n \t\ttest_must_fail git add \"$i\" 2>err &&\n \t\tgit ls-files \"$i\" >out &&\n@@ -36,7 +36,7 @@ do\n \t\tcat err\n \t'\n \n-\ttest_expect_success \"complaints for ignored $i with unignored file\" '\n+\ttest_expect_success NO_GETTEXT_POISON \"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@@ -48,7 +48,7 @@ done\n \n for i in sub sub/*\n do\n-\ttest_expect_success \"complaints for ignored $i in dir\" '\n+\ttest_expect_success NO_GETTEXT_POISON \"complaints for ignored $i in dir\" '\n \t\trm -f .git/index &&\n \t\t(\n \t\t\tcd dir &&\n@@ -63,7 +63,7 @@ done\n \n for i in ign file\n do\n-\ttest_expect_success \"complaints for ignored $i in sub\" '\n+\ttest_expect_success NO_GETTEXT_POISON \"complaints for ignored $i in sub\" '\n \t\trm -f .git/index &&\n \t\t(\n \t\t\tcd sub &&\ndiff --git a/t/t3030-merge-recursive.sh b/t/t3030-merge-recursive.sh\nindex efe2900..b8ddb94 100755\n--- a/t/t3030-merge-recursive.sh\n+++ b/t/t3030-merge-recursive.sh\n@@ -281,7 +281,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\" &&\ndiff --git a/t/t3200-branch.sh b/t/t3200-branch.sh\nindex f54a533..d90d9fd 100755\n--- a/t/t3200-branch.sh\n+++ b/t/t3200-branch.sh\n@@ -192,7 +192,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).\"'\ndiff --git a/t/t3203-branch-output.sh b/t/t3203-branch-output.sh\nindex 809d1c4..dfdf5a7 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\ndiff --git a/t/t3700-add.sh b/t/t3700-add.sh\nindex ec71083..fea0c17 100755\n--- a/t/t3700-add.sh\n+++ b/t/t3700-add.sh\n@@ -266,7 +266,7 @@ test_expect_success 'git add --dry-run of existing changed file' \"\n \techo \\\"add 'track-this'\\\" | test_cmp - actual\n \"\n \n-test_expect_success 'git add --dry-run of non-existing file' \"\n+test_expect_success NO_GETTEXT_POISON '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@@ -282,7 +282,7 @@ cat >expect.out <<\\EOF\n add 'track-this'\n EOF\n \n-test_expect_success 'git add --dry-run --ignore-missing of non-existing file' '\n+test_expect_success NO_GETTEXT_POISON '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_cmp expect.out actual.out &&\n \ttest_cmp expect.err actual.err\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/t/t4014-format-patch.sh b/t/t4014-format-patch.sh\nindex f87434b..ae3659e 100755\n--- a/t/t4014-format-patch.sh\n+++ b/t/t4014-format-patch.sh\n@@ -592,7 +592,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 &&\ndiff --git a/t/t5541-http-push.sh b/t/t5541-http-push.sh\nindex b0c2a2c..670d3de 100755\n--- a/t/t5541-http-push.sh\n+++ b/t/t5541-http-push.sh\n@@ -118,7 +118,7 @@ test_expect_success 'used receive-pack service' '\n test_http_push_nonff \"$HTTPD_DOCUMENT_ROOT_PATH\"/test_repo.git \\\n \t\"$ROOT_PATH\"/test_repo_clone master\n \n-test_expect_success 'push fails for non-fast-forward refs unmatched by remote helper' '\n+test_expect_success NO_GETTEXT_POISON 'push fails for non-fast-forward refs unmatched by remote helper' '\n \t# create a dissimilarly-named remote ref so that git is unable to match the\n \t# two refs (viz. local, remote) unless an explicit refspec is provided.\n \tgit push origin master:retsam\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\ndiff --git a/t/t6040-tracking-info.sh b/t/t6040-tracking-info.sh\nindex 1785e17..c9a86f6 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\ndiff --git a/t/t7004-tag.sh b/t/t7004-tag.sh\nindex ac943f5..cf40992 100755\n--- a/t/t7004-tag.sh\n+++ b/t/t7004-tag.sh\n@@ -1044,12 +1044,14 @@ test_expect_success GPG \\\n \t'verify signed tag fails when public key is not present' \\\n \t'test_must_fail git tag -v signed-tag'\n \n-test_expect_success \\\n+# \"POISON\" isn't a comment, so skip under GETTEXT_POISON\n+test_expect_success NO_GETTEXT_POISON \\\n \t'git tag -a fails if tag annotation is empty' '\n \t! (GIT_EDITOR=cat git tag -a initial-comment)\n '\n \n-test_expect_success \\\n+# Likewise GETTEXT_POISON doesn't emit something that looks like a comment\n+test_expect_success NO_GETTEXT_POISON \\\n \t'message in editor has initial comment' '\n \tGIT_EDITOR=cat git tag -a initial-comment > actual\n \t# check the first line --- should be empty\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/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\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 &&\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 &&\ndiff --git a/t/t7500-commit.sh b/t/t7500-commit.sh\nindex aa9c577..6b983b8 100755\n--- a/t/t7500-commit.sh\n+++ b/t/t7500-commit.sh\n@@ -59,7 +59,10 @@ 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+# These fail under GETTEXT_POISON because the poison editor message\n+# doesn't do the right thing with comments and line breaks, this\n+# message will be incorrectly broken up across lines.\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 +70,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 +81,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 &&\ndiff --git a/t/t7501-commit.sh b/t/t7501-commit.sh\nindex 8297cb4..96601db 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\" \\\n@@ -142,7 +145,8 @@ cat >msg <<EOF\n A good commit message.\n EOF\n \n-test_expect_success \\\n+# Can't rely on editor with POISON\n+test_expect_success NO_GETTEXT_POISON \\\n \t'editor not invoked if -F is given' '\n \t echo \"moo\" >file &&\n \t EDITOR=./editor git commit -a -F msg &&\n@@ -163,7 +167,9 @@ d381ac431806e53f3dd7ac2f1ae0534f36d738b9\n 402702b49136e7587daa9280e91e4bb7cb2179f7\n EOF\n \n-test_expect_success \\\n+# rev-list won't be OK under GETTEXT_POISON since the above test won't\n+# run.\n+test_expect_success NO_GETTEXT_POISON \\\n     'validate git rev-list output.' \\\n     'test_cmp expected current'\n \ndiff --git a/t/t7502-commit.sh b/t/t7502-commit.sh\nindex ac2e187..9e293f3 100755\n--- a/t/t7502-commit.sh\n+++ b/t/t7502-commit.sh\n@@ -25,7 +25,7 @@ check_summary_oneline() {\n \ttest_cmp exp act\n }\n \n-test_expect_success 'output summary format' '\n+test_expect_success NO_GETTEXT_POISON 'output summary format' '\n \n \techo new >file1 &&\n \tgit add file1 &&\n@@ -36,12 +36,12 @@ test_expect_success 'output summary format' '\n \tcheck_summary_oneline \"\" \"a change\"\n '\n \n-test_expect_success 'output summary format for commit with an empty diff' '\n+test_expect_success NO_GETTEXT_POISON 'output summary format for commit with an empty diff' '\n \n \tcheck_summary_oneline \"\" \"empty\" \"--allow-empty\"\n '\n \n-test_expect_success 'output summary format for merges' '\n+test_expect_success NO_GETTEXT_POISON 'output summary format for merges' '\n \n \tgit checkout -b recursive-base &&\n \ttest_commit base file1 &&\n@@ -70,7 +70,7 @@ output_tests_cleanup() {\n \tgit commit -m \"cleanup\"\n }\n \n-test_expect_success 'the basics' '\n+test_expect_success NO_GETTEXT_POISON 'the basics' '\n \n \toutput_tests_cleanup &&\n \n@@ -91,7 +91,7 @@ test_expect_success 'the basics' '\n \n '\n \n-test_expect_success 'partial' '\n+test_expect_success NO_GETTEXT_POISON 'partial' '\n \n \techo another >\"commit is\" &&\n \techo another >not/forbid &&\n@@ -103,7 +103,7 @@ test_expect_success 'partial' '\n \n '\n \n-test_expect_success 'partial modification in a subdirectory' '\n+test_expect_success NO_GETTEXT_POISON 'partial modification in a subdirectory' '\n \n \ttest_tick &&\n \tgit commit -m \"partial commit to subdirectory\" not &&\n@@ -113,7 +113,7 @@ test_expect_success 'partial modification in a subdirectory' '\n \n '\n \n-test_expect_success 'partial removal' '\n+test_expect_success NO_GETTEXT_POISON 'partial removal' '\n \n \tgit rm not/forbid &&\n \tgit commit -m \"partial commit to remove not/forbid\" not &&\n@@ -165,7 +165,7 @@ test_expect_success 'verbose respects diff config' '\n \tgit config --unset color.diff\n '\n \n-test_expect_success 'cleanup commit messages (verbatim,-t)' '\n+test_expect_success NO_GETTEXT_POISON 'cleanup commit messages (verbatim,-t)' '\n \n \techo >>negative &&\n \t{ echo;echo \"# text\";echo; } >expect &&\n@@ -175,7 +175,7 @@ test_expect_success 'cleanup commit messages (verbatim,-t)' '\n \n '\n \n-test_expect_success 'cleanup commit messages (verbatim,-F)' '\n+test_expect_success NO_GETTEXT_POISON 'cleanup commit messages (verbatim,-F)' '\n \n \techo >>negative &&\n \tgit commit --cleanup=verbatim -F expect -a &&\n@@ -184,7 +184,7 @@ test_expect_success 'cleanup commit messages (verbatim,-F)' '\n \n '\n \n-test_expect_success 'cleanup commit messages (verbatim,-m)' '\n+test_expect_success NO_GETTEXT_POISON 'cleanup commit messages (verbatim,-m)' '\n \n \techo >>negative &&\n \tgit commit --cleanup=verbatim -m \"$(cat expect)\" -a &&\n@@ -220,7 +220,7 @@ echo \"sample\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+test_expect_success NO_GETTEXT_POISON 'cleanup commit messages (strip,-F,-e)' '\n \n \techo >>negative &&\n \t{ echo;echo sample;echo; } >text &&\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@@ -370,66 +370,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/t/t7506-status-submodule.sh b/t/t7506-status-submodule.sh\nindex 3d4f85d..2347451 100755\n--- a/t/t7506-status-submodule.sh\n+++ b/t/t7506-status-submodule.sh\n@@ -20,17 +20,17 @@ 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 \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\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/t/t7508-status.sh b/t/t7508-status.sh\nindex 18b07d9..97e0d7a 100755\n--- a/t/t7508-status.sh\n+++ b/t/t7508-status.sh\n@@ -31,7 +31,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@@ -61,7 +61,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@@ -87,7 +87,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@@ -148,7 +148,7 @@ 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+test_expect_success NO_GETTEXT_POISON 'status -uno' '\n \tmkdir dir3 &&\n \t: >dir3/untracked1 &&\n \t: >dir3/untracked2 &&\n@@ -156,7 +156,7 @@ test_expect_success 'status -uno' '\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 \tgit status >output &&\n \ttest_cmp expect output\n@@ -173,7 +173,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@@ -219,12 +219,12 @@ 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 \tgit status >output &&\n \ttest_cmp expect output\n@@ -241,13 +241,13 @@ A  dir2/added\n ?? output\n ?? untracked\n EOF\n-test_expect_success 'status -s -unormal' '\n+test_expect_success NO_GETTEXT_POISON 'status -s -unormal' '\n \tgit config --unset status.showuntrackedfiles\n \tgit status -s -unormal >output &&\n \ttest_cmp expect output\n '\n \n-test_expect_success 'status -s (status.showUntrackedFiles normal)' '\n+test_expect_success NO_GETTEXT_POISON 'status -s (status.showUntrackedFiles normal)' '\n \tgit config status.showuntrackedfiles normal\n \tgit status -s >output &&\n \ttest_cmp expect output\n@@ -278,11 +278,11 @@ 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 \tgit status >output &&\n \trm -rf dir3 &&\n@@ -337,7 +337,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@@ -409,7 +409,7 @@ 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 \tgit status | test_decode_color >output &&\n@@ -417,7 +417,7 @@ test_expect_success 'status with color.ui' '\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@@ -437,7 +437,7 @@ cat >expect <<\\EOF\n <BLUE>??<RESET> untracked\n EOF\n \n-test_expect_success 'status -s with color.ui' '\n+test_expect_success NO_GETTEXT_POISON 'status -s with color.ui' '\n \n \tgit config --unset color.status &&\n \tgit config color.ui always &&\n@@ -446,7 +446,7 @@ test_expect_success 'status -s with color.ui' '\n \n '\n \n-test_expect_success 'status -s with color.status' '\n+test_expect_success NO_GETTEXT_POISON 'status -s with color.status' '\n \n \tgit config --unset color.ui &&\n \tgit config color.status always &&\n@@ -467,7 +467,7 @@ cat >expect <<\\EOF\n <BLUE>??<RESET> untracked\n EOF\n \n-test_expect_success 'status -s -b with color.status' '\n+test_expect_success NO_GETTEXT_POISON 'status -s -b with color.status' '\n \n \tgit status -s -b | test_decode_color >output &&\n \ttest_cmp expect output\n@@ -485,7 +485,7 @@ A  dir2/added\n ?? untracked\n EOF\n \n-test_expect_success 'status --porcelain ignores color.ui' '\n+test_expect_success NO_GETTEXT_POISON 'status --porcelain ignores color.ui' '\n \n \tgit config --unset color.status &&\n \tgit config color.ui always &&\n@@ -494,7 +494,7 @@ test_expect_success 'status --porcelain ignores color.ui' '\n \n '\n \n-test_expect_success 'status --porcelain ignores color.status' '\n+test_expect_success NO_GETTEXT_POISON 'status --porcelain ignores color.status' '\n \n \tgit config --unset color.ui &&\n \tgit config color.status always &&\n@@ -539,7 +539,7 @@ 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 \t(cd dir1 && git status) >output &&\n@@ -558,7 +558,7 @@ A  dir2/added\n ?? untracked\n EOF\n \n-test_expect_success 'status -s without relative paths' '\n+test_expect_success NO_GETTEXT_POISON 'status -s without relative paths' '\n \n \t(cd dir1 && git status -s) >output &&\n \ttest_cmp expect output\n@@ -581,7 +581,7 @@ cat <<EOF >expect\n #\toutput\n #\tuntracked\n EOF\n-test_expect_success 'dry-run of partial commit excluding new file in index' '\n+test_expect_success NO_GETTEXT_POISON 'dry-run of partial commit excluding new file in index' '\n \tgit commit --dry-run dir1/modified >output &&\n \ttest_cmp expect output\n '\n@@ -630,13 +630,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@@ -694,7 +694,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@@ -711,7 +711,7 @@ A  sm\n ?? output\n ?? untracked\n EOF\n-test_expect_success 'status -s submodule summary' '\n+test_expect_success NO_GETTEXT_POISON 'status -s submodule summary' '\n \tgit status -s >output &&\n \ttest_cmp expect output\n '\n@@ -735,7 +735,7 @@ 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+test_expect_success NO_GETTEXT_POISON 'status submodule summary (clean submodule)' '\n \tgit commit -m \"commit submodule\" &&\n \tgit config status.submodulesummary 10 &&\n \ttest_must_fail git commit --dry-run >output &&\n@@ -753,7 +753,7 @@ cat >expect <<EOF\n ?? output\n ?? untracked\n EOF\n-test_expect_success 'status -s submodule summary (clean submodule)' '\n+test_expect_success NO_GETTEXT_POISON 'status -s submodule summary (clean submodule)' '\n \tgit status -s >output &&\n \ttest_cmp expect output\n '\n@@ -787,7 +787,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@@ -842,13 +842,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@@ -860,7 +860,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@@ -871,12 +871,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@@ -888,7 +888,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@@ -899,13 +899,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@@ -913,7 +913,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@@ -956,12 +956,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@@ -969,7 +969,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@@ -1018,12 +1018,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@@ -1031,7 +1031,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@@ -1042,11 +1042,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@@ -1054,7 +1054,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@@ -1086,7 +1086,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/t/t7600-merge.sh b/t/t7600-merge.sh\nindex b4f40e4..cc6c4e9 100755\n--- a/t/t7600-merge.sh\n+++ b/t/t7600-merge.sh\n@@ -484,7 +484,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 &&\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.313.gcd15\n"},{"id":"149887","messageId":"1283638229-14199-9-git-send-email-avarab@gmail.com","threadId":"24977","inReplyTo":"1283638229-14199-1-git-send-email-avarab@gmail.com","subject":"[PATCH 51/63] gettextize: git-merge basic messages","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2010-09-04T22:10:28Z","receivedAt":"2010-09-04T22:10: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/merge.c |  122 +++++++++++++++++++++++++++---------------------------\n 1 files changed, 61 insertions(+), 61 deletions(-)\n\ndiff --git a/builtin/merge.c b/builtin/merge.c\nindex 5f65c0c..0ae2b51 100644\n--- a/builtin/merge.c\n+++ b/builtin/merge.c\n@@ -79,7 +79,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@@ -116,13 +116,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@@ -220,17 +220,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 reset_hard(unsigned const char *sha1, int verbose)\n@@ -247,7 +247,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@@ -276,7 +276,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@@ -289,10 +289,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@@ -307,7 +307,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@@ -320,9 +320,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@@ -342,7 +342,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@@ -364,7 +364,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@@ -393,7 +393,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@@ -458,7 +458,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@@ -488,7 +488,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@@ -550,7 +550,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, struct commit_list *common,\n@@ -591,7 +591,7 @@ int try_merge_command(const char *strategy, struct commit_list *common,\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@@ -608,7 +608,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@@ -621,7 +621,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@@ -648,7 +648,7 @@ static int try_merge_strategy(const char *strategy, struct commit_list *common,\n \t\t\telse if (!strcmp(xopts[x], \"no-renormalize\"))\n \t\t\t\to.renormalize = 0;\n \t\t\telse\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 \t\t}\n \n \t\to.branch1 = head_arg;\n@@ -663,7 +663,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@@ -734,7 +734,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@@ -788,7 +788,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;\n@@ -837,7 +837,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@@ -853,8 +853,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@@ -868,7 +868,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@@ -918,10 +918,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    \"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 \n \tresolve_undo_clear();\n@@ -948,12 +948,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@@ -981,16 +981,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\treset_hard(remote_head->sha1, 0);\n@@ -1038,7 +1038,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@@ -1096,7 +1096,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));\n@@ -1130,11 +1130,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@@ -1167,7 +1167,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@@ -1193,11 +1193,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@@ -1258,17 +1258,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@@ -1284,35 +1284,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);\n-- \n1.7.2.3.313.gcd15\n"},{"id":"149889","messageId":"1283638229-14199-10-git-send-email-avarab@gmail.com","threadId":"24977","inReplyTo":"1283638229-14199-1-git-send-email-avarab@gmail.com","subject":"[PATCH 63/63] po/en_GB.po: add British English Translation","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2010-09-04T22:10:29Z","receivedAt":"2010-09-04T22:10:29Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"From: Sam Reed <sam@reedyboy.net>\n\nTranslate the three Git messages from US to British English. These all\nhad to do with z v.s. s differences.\n\nSigned-off-by: Sam Reed <sam@reedyboy.net>\nSigned-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n po/en_GB.po |   22 ++++++++++++++++++++++\n 1 files changed, 22 insertions(+), 0 deletions(-)\n create mode 100644 po/en_GB.po\n\ndiff --git a/po/en_GB.po b/po/en_GB.po\nnew file mode 100644\nindex 0000000..b1f3e34\n--- /dev/null\n+++ b/po/en_GB.po\n@@ -0,0 +1,22 @@\n+msgid \"\"\n+msgstr \"\"\n+\"Project-Id-Version: Git\\n\"\n+\"PO-Revision-Date: 2010-09-02 19:09 +0000\\n\"\n+\"Language-Team: Git Mailing List <git@vger.kernel.org>\\n\"\n+\"Report-Msgid-Bugs-To: Git Mailing List <git@vger.kernel.org>\\n\"\n+\"Last-Translator: Sam Reed <sam@reedyboy.net>\\n\"\n+\"Language-Team: Git Mailing List <git@vger.kernel.org>\\n\"\n+\"Language: en-gb\\n\"\n+\"MIME-Version: 1.0\\n\"\n+\"Content-Type: text/plain; charset=UTF-8\\n\"\n+\"Content-Transfer-Encoding: 8bit\\n\"\n+\n+msgid \"Reinitialized existing\"\n+msgstr \"Reinitialised existing\"\n+\n+msgid \"Initialized empty\"\n+msgstr \"Initialised empty\"\n+\n+#, c-format\n+msgid \"unrecognized argument: %s\"\n+msgstr \"unrecognised argument: %s\"\n-- \n1.7.2.3.313.gcd15\n"},{"id":"150063","messageId":"1283775704-29440-1-git-send-email-avarab@gmail.com","threadId":"24977","inReplyTo":"1283638229-14199-1-git-send-email-avarab@gmail.com","subject":"[PATCH 00/15] [REDO CONTINUE] Add gettext support to Git","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2010-09-06T12:21:29Z","receivedAt":"2010-09-06T12:21:29Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"On Sat, Sep 4, 2010 at 22:10, Ævar Arnfjörð Bjarmason <avarab@gmail.com> wrote:\n> The previous nested pull requests were a mess, and I needed to fix\n> some bugs. So here's a total re-do of the ab/i18n series. Everything\n> that's already in pu from ab/i18n can be ejected in favor of this.\n>\n> Most of these 63 patches have been seen here before. So I'll only be\n> sending the stuff that's changed or interesting along with this\n> series. To get the full thing go to:\n>\n>    git://github.com/avar/git.git ab/i18n-all\n>    http://github.com/avar/git/compare/master...ab/i18n-all\n>    http://github.com/avar/git/compare/master...ab/i18n-all.patch\n>\n> The last of which is a patch file suitable for git-am(1).\n>\n> Since last time I've rebased this on the new upstream master branch,\n> which now has my ab/test-2 series.\n\nHere's more work on top of my existing 63 patch series, bringing it to\n78 patches in total.\n\nWith this all of the 'mainporcelain common' *and* 'mainporcelain' in\ncommand-list.txt has been made translatable, aside from these\nshellscripts:\n    \n    git-am                                  mainporcelain\n    git-bisect                              mainporcelain common\n    git-pull                                mainporcelain common\n    git-rebase                              mainporcelain common\n    git-stash                               mainporcelain\n    git-submodule                           mainporcelain\n\nJan Krüger was doing some work on the git-add--interactive helper and\nthose, and I was getting comfortable with doing only C, so I've left\nthose for now.\n\nThis time around the changes to tests to add the NO_GETTEXT_POISON\nprerequisite are part of the *.c patches themselves. This should make\nit easier to review the series, since you can see what tests need to\nbe skipped for each patch.\n\nThis series goes on top of ab/i18n-all and can be pulled from my\nGitHub branch:\n\n    git://github.com/avar/git.git ab/i18n-all-continue\n    http://github.com/avar/git/compare/ab/i18n-all...ab/i18n-all-continue\n    http://github.com/avar/git/compare/ab/i18n-all...ab/i18n-all-continue.patch\n\nAnd to see the whole thing from master:\n\n    http://github.com/avar/git/compare/master...ab/i18n-all-continue\n    http://github.com/avar/git/compare/master...ab/i18n-all-continue.patch\n\nNote that this doesn't include Ramkumar Ramachandra's patch to add\nHindi. You'll have to get that from the archive separately.\n    \n\nÆvar Arnfjörð Bjarmason (15):\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-notes \"Refusing to %s notes in %s\" message\n  gettextize: git-revert basic messages\n  gettextize: git-revert mark the \"me\" variable for translation\n  gettextize: git-revert messages using the \"me\" variable\n  gettextize: git-revert split up \"could not revert/apply\" message\n  gettextize: git-shortlog basic messages\n\n builtin/archive.c                |   14 ++--\n builtin/bundle.c                 |    6 +-\n builtin/clean.c                  |   28 +++++----\n builtin/describe.c               |   36 +++++-----\n builtin/gc.c                     |   24 ++++----\n builtin/notes.c                  |  132 +++++++++++++++++++------------------\n builtin/revert.c                 |   65 ++++++++++---------\n builtin/shortlog.c               |    8 +-\n t/t3501-revert-cherry-pick.sh    |    2 +-\n t/t3507-cherry-pick-conflict.sh  |    2 +-\n t/t6120-describe.sh              |    2 +-\n t/t7012-skip-worktree-writing.sh |    4 +-\n t/t7300-clean.sh                 |    6 +-\n 13 files changed, 170 insertions(+), 159 deletions(-)\n\n-- \n1.7.2.3.313.gcd15\n"},{"id":"150064","messageId":"1283775704-29440-2-git-send-email-avarab@gmail.com","threadId":"24977","inReplyTo":"1283638229-14199-1-git-send-email-avarab@gmail.com","subject":"[PATCH 01/15] gettextize: git-archive basic messages","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2010-09-06T12:21:30Z","receivedAt":"2010-09-06T12:21:30Z","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.313.gcd15\n"},{"id":"150066","messageId":"1283775704-29440-3-git-send-email-avarab@gmail.com","threadId":"24977","inReplyTo":"1283638229-14199-1-git-send-email-avarab@gmail.com","subject":"[PATCH 02/15] gettextize: git-bundle basic messages","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2010-09-06T12:21:31Z","receivedAt":"2010-09-06T12:21:31Z","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 80649ba..f92970f 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.313.gcd15\n"},{"id":"150068","messageId":"1283775704-29440-4-git-send-email-avarab@gmail.com","threadId":"24977","inReplyTo":"1283638229-14199-1-git-send-email-avarab@gmail.com","subject":"[PATCH 03/15] gettextize: git-clean basic messages","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2010-09-06T12:21:32Z","receivedAt":"2010-09-06T12:21: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/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 b508d2c..10dde87 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 7dbbea1..eed032d 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.313.gcd15\n"},{"id":"150069","messageId":"1283775704-29440-5-git-send-email-avarab@gmail.com","threadId":"24977","inReplyTo":"1283638229-14199-1-git-send-email-avarab@gmail.com","subject":"[PATCH 04/15] gettextize: git-clean clean.requireForce messages","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2010-09-06T12:21:33Z","receivedAt":"2010-09-06T12:21:33Z","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 |    8 ++++++--\n 1 files changed, 6 insertions(+), 2 deletions(-)\n\ndiff --git a/builtin/clean.c b/builtin/clean.c\nindex 10dde87..642d767 100644\n--- a/builtin/clean.c\n+++ b/builtin/clean.c\n@@ -78,8 +78,12 @@ int cmd_clean(int argc, const char **argv, const char *prefix)\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+\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 \n \tif (force > 1)\n \t\trm_flags = 0;\n-- \n1.7.2.3.313.gcd15\n"},{"id":"150065","messageId":"1283775704-29440-6-git-send-email-avarab@gmail.com","threadId":"24977","inReplyTo":"1283638229-14199-1-git-send-email-avarab@gmail.com","subject":"[PATCH 05/15] gettextize: git-describe basic messages","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2010-09-06T12:21:34Z","receivedAt":"2010-09-06T12:21: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/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 43caff2..616d405 100644\n--- a/builtin/describe.c\n+++ b/builtin/describe.c\n@@ -202,13 +202,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@@ -235,10 +235,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 = cmit->util;\n \tif (n && (tags || all || n->prio == 2)) {\n@@ -255,9 +255,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 \tlist = NULL;\n \tcmit->object.flags = SEEN;\n@@ -292,7 +292,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@@ -316,12 +316,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@@ -341,11 +341,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@@ -395,7 +395,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@@ -420,14 +420,14 @@ int cmd_describe(int argc, const char **argv, const char *prefix)\n \n \tfor_each_ref(get_name, NULL);\n \tif (!found_names && !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.313.gcd15\n"},{"id":"150067","messageId":"1283775704-29440-7-git-send-email-avarab@gmail.com","threadId":"24977","inReplyTo":"1283638229-14199-1-git-send-email-avarab@gmail.com","subject":"[PATCH 06/15] gettextize: git-gc basic messages","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2010-09-06T12:21:35Z","receivedAt":"2010-09-06T12:21:35Z","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 c304638..05aed1f 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@@ -248,8 +248,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.313.gcd15\n"},{"id":"150072","messageId":"1283775704-29440-8-git-send-email-avarab@gmail.com","threadId":"24977","inReplyTo":"1283638229-14199-1-git-send-email-avarab@gmail.com","subject":"[PATCH 07/15] gettextize: git-gc \"Auto packing the repository\" message","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2010-09-06T12:21:36Z","receivedAt":"2010-09-06T12:21:36Z","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 05aed1f..74e77cb 100644\n--- a/builtin/gc.c\n+++ b/builtin/gc.c\n@@ -216,13 +216,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.313.gcd15\n"},{"id":"150070","messageId":"1283775704-29440-9-git-send-email-avarab@gmail.com","threadId":"24977","inReplyTo":"1283638229-14199-1-git-send-email-avarab@gmail.com","subject":"[PATCH 08/15] gettextize: git-notes basic commands","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2010-09-06T12:21:37Z","receivedAt":"2010-09-06T12:21:37Z","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 |  108 +++++++++++++++++++++++++++---------------------------\n 1 files changed, 54 insertions(+), 54 deletions(-)\n\ndiff --git a/builtin/notes.c b/builtin/notes.c\nindex fbc347c..d171f6f 100644\n--- a/builtin/notes.c\n+++ b/builtin/notes.c\n@@ -119,13 +119,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@@ -135,10 +135,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@@ -155,7 +155,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@@ -169,8 +169,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@@ -190,14 +190,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@@ -231,9 +231,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@@ -252,10 +252,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@@ -280,7 +280,7 @@ int 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 0; /* don't have to commit an unchanged tree */\n \n@@ -292,7 +292,7 @@ int commit_notes(struct notes_tree *t, const char *msg)\n \n \t/* Convert notes tree to tree object */\n \tif (write_notes_tree(t, tree_sha1))\n-\t\tdie(\"Failed to write current notes tree to database\");\n+\t\tdie(_(\"Failed to write current notes tree to database\"));\n \n \t/* Create new commit for the tree object */\n \tif (!read_ref(t->ref, prev_commit)) { /* retrieve parent commit */\n@@ -304,7 +304,7 @@ int commit_notes(struct notes_tree *t, const char *msg)\n \t\tparent = NULL;\n \t}\n \tif (commit_tree(buf.buf + 7, tree_sha1, parent, new_commit, NULL))\n-\t\tdie(\"Failed to commit notes tree to database\");\n+\t\tdie(_(\"Failed to commit notes tree to database\"));\n \n \t/* Update notes ref with new commit */\n \tupdate_ref(buf.buf, t->ref, new_commit, prev_commit, 0, DIE_ON_ERR);\n@@ -336,7 +336,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@@ -346,8 +346,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@@ -435,13 +435,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@@ -450,7 +450,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@@ -494,20 +494,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@@ -546,26 +546,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@@ -607,7 +607,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@@ -615,41 +615,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@@ -691,19 +691,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@@ -738,20 +738,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@@ -774,18 +774,18 @@ 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-\tfprintf(stderr, \"Removing note for object %s\\n\", sha1_to_hex(object));\n+\tfprintf(stderr, _(\"Removing note for object %s\\n\"), sha1_to_hex(object));\n \tremove_note(t, object);\n \n \tcommit_notes(t, \"Notes removed by 'git notes remove'\");\n@@ -808,7 +808,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@@ -864,7 +864,7 @@ int cmd_notes(int argc, const char **argv, const char *prefix)\n \telse if (!strcmp(argv[0], \"prune\"))\n \t\tresult = prune(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.313.gcd15\n"},{"id":"150075","messageId":"1283775704-29440-10-git-send-email-avarab@gmail.com","threadId":"24977","inReplyTo":"1283638229-14199-1-git-send-email-avarab@gmail.com","subject":"[PATCH 09/15] gettextize: git-notes GIT_NOTES_REWRITE_MODE error message","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2010-09-06T12:21:38Z","receivedAt":"2010-09-06T12:21:38Z","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 d171f6f..fe58a41 100644\n--- a/builtin/notes.c\n+++ b/builtin/notes.c\n@@ -371,8 +371,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.313.gcd15\n"},{"id":"150071","messageId":"1283775704-29440-11-git-send-email-avarab@gmail.com","threadId":"24977","inReplyTo":"1283638229-14199-1-git-send-email-avarab@gmail.com","subject":"[PATCH 10/15] gettextize: git-notes \"Refusing to %s notes in %s\" message","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2010-09-06T12:21:39Z","receivedAt":"2010-09-06T12:21:39Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"The first %s in \"Refusing to %s notes in %s\" is one of \"git notes\nACTION\". So we need to mark those actions for translation and later\nuse _().\n\nAlso add a TRANSLATORS comment explaining to translators what the\nfirst %s means.\n\nSigned-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n builtin/notes.c |   18 ++++++++++--------\n 1 files changed, 10 insertions(+), 8 deletions(-)\n\ndiff --git a/builtin/notes.c b/builtin/notes.c\nindex fe58a41..2b417d7 100644\n--- a/builtin/notes.c\n+++ b/builtin/notes.c\n@@ -476,8 +476,10 @@ static struct notes_tree *init_notes_check(const char *subcommand)\n \tt = &default_notes_tree;\n \n \tif (prefixcmp(t->ref, \"refs/notes/\"))\n-\t\tdie(\"Refusing to %s notes in %s (outside of refs/notes/)\",\n-\t\t    subcommand, t->ref);\n+\t\t/* TRANSLATORS: The first %s is one of \"git notes ACTION\",\n+\t\t   e.g. \"add\", \"copy\", \"append\" etc. */\n+\t\tdie(_(\"Refusing to %s notes in %s (outside of refs/notes/)\"),\n+\t\t    _(subcommand), t->ref);\n \treturn t;\n }\n \n@@ -500,7 +502,7 @@ static int list(int argc, const char **argv, const char *prefix)\n \t\tusage_with_options(git_notes_list_usage, options);\n \t}\n \n-\tt = init_notes_check(\"list\");\n+\tt = init_notes_check(N_(\"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@@ -557,7 +559,7 @@ static int add(int argc, const char **argv, const char *prefix)\n \tif (get_sha1(object_ref, object))\n \t\tdie(_(\"Failed to resolve '%s' as a valid ref.\"), object_ref);\n \n-\tt = init_notes_check(\"add\");\n+\tt = init_notes_check(N_(\"add\"));\n \tnote = get_note(t, object);\n \n \tif (note) {\n@@ -633,7 +635,7 @@ static int copy(int argc, const char **argv, const char *prefix)\n \tif (get_sha1(object_ref, object))\n \t\tdie(_(\"Failed to resolve '%s' as a valid ref.\"), object_ref);\n \n-\tt = init_notes_check(\"copy\");\n+\tt = init_notes_check(N_(\"copy\"));\n \tnote = get_note(t, object);\n \n \tif (note) {\n@@ -749,7 +751,7 @@ static int show(int argc, const char **argv, const char *prefix)\n \tif (get_sha1(object_ref, object))\n \t\tdie(_(\"Failed to resolve '%s' as a valid ref.\"), object_ref);\n \n-\tt = init_notes_check(\"show\");\n+\tt = init_notes_check(N_(\"show\"));\n \tnote = get_note(t, object);\n \n \tif (!note)\n@@ -785,7 +787,7 @@ static int remove_cmd(int argc, const char **argv, const char *prefix)\n \tif (get_sha1(object_ref, object))\n \t\tdie(_(\"Failed to resolve '%s' as a valid ref.\"), object_ref);\n \n-\tt = init_notes_check(\"remove\");\n+\tt = init_notes_check(N_(\"remove\"));\n \n \tfprintf(stderr, _(\"Removing note for object %s\\n\"), sha1_to_hex(object));\n \tremove_note(t, object);\n@@ -814,7 +816,7 @@ static int prune(int argc, const char **argv, const char *prefix)\n \t\tusage_with_options(git_notes_prune_usage, options);\n \t}\n \n-\tt = init_notes_check(\"prune\");\n+\tt = init_notes_check(N_(\"prune\"));\n \n \tprune_notes(t, (verbose ? NOTES_PRUNE_VERBOSE : 0) |\n \t\t(show_only ? NOTES_PRUNE_VERBOSE|NOTES_PRUNE_DRYRUN : 0) );\n-- \n1.7.2.3.313.gcd15\n"},{"id":"150077","messageId":"1283775704-29440-12-git-send-email-avarab@gmail.com","threadId":"24977","inReplyTo":"1283638229-14199-1-git-send-email-avarab@gmail.com","subject":"[PATCH 11/15] gettextize: git-revert basic messages","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2010-09-06T12:21:40Z","receivedAt":"2010-09-06T12:21:40Z","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 |   42 +++++++++++++++++++++---------------------\n 1 files changed, 21 insertions(+), 21 deletions(-)\n\ndiff --git a/builtin/revert.c b/builtin/revert.c\nindex 4b47ace..ece0c0f 100644\n--- a/builtin/revert.c\n+++ b/builtin/revert.c\n@@ -79,7 +79,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@@ -151,7 +151,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@@ -185,7 +185,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@@ -199,7 +199,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@@ -211,7 +211,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@@ -227,7 +227,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@@ -264,10 +264,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@@ -405,10 +405,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@@ -416,7 +416,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@@ -425,7 +425,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@@ -433,11 +433,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@@ -450,7 +450,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@@ -541,10 +541,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 int revert_or_cherry_pick(int argc, const char **argv)\n@@ -558,13 +558,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 \tif (read_cache() < 0)\n-- \n1.7.2.3.313.gcd15\n"},{"id":"150073","messageId":"1283775704-29440-13-git-send-email-avarab@gmail.com","threadId":"24977","inReplyTo":"1283638229-14199-1-git-send-email-avarab@gmail.com","subject":"[PATCH 12/15] gettextize: git-revert mark the \"me\" variable for translation","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2010-09-06T12:21:41Z","receivedAt":"2010-09-06T12:21:41Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"The \"me\" variable is used in many later messages to indicate whether\nwe're using revert or cherry-pick. Mark it for translation for later\nuse. Also leave a TRANSLATORS message explaining what these are for.\n\nSigned-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n builtin/revert.c |    4 +++-\n 1 files changed, 3 insertions(+), 1 deletions(-)\n\ndiff --git a/builtin/revert.c b/builtin/revert.c\nindex ece0c0f..2f319f8 100644\n--- a/builtin/revert.c\n+++ b/builtin/revert.c\n@@ -552,7 +552,9 @@ static int revert_or_cherry_pick(int argc, const char **argv)\n \tstruct rev_info revs;\n \n \tgit_config(git_default_config, NULL);\n-\tme = action == REVERT ? \"revert\" : \"cherry-pick\";\n+\t/* TRANSLATORS: This is used in several error messages indicating\n+\t   the name of the current program */\n+\tme = action == REVERT ? N_(\"revert\") : N_(\"cherry-pick\");\n \tsetenv(GIT_REFLOG_ACTION, me, 0);\n \tparse_args(argc, argv);\n \n-- \n1.7.2.3.313.gcd15\n"},{"id":"150074","messageId":"1283775704-29440-14-git-send-email-avarab@gmail.com","threadId":"24977","inReplyTo":"1283638229-14199-1-git-send-email-avarab@gmail.com","subject":"[PATCH 13/15] gettextize: git-revert messages using the \"me\" variable","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2010-09-06T12:21:42Z","receivedAt":"2010-09-06T12:21:42Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"Mark messages that used the \"me\" variable for translation. The\npotential values of the variable had already been marked using N_(),\nso we can use _(me) here.\n\nSigned-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n builtin/revert.c              |   14 +++++++-------\n t/t3501-revert-cherry-pick.sh |    2 +-\n 2 files changed, 8 insertions(+), 8 deletions(-)\n\ndiff --git a/builtin/revert.c b/builtin/revert.c\nindex 2f319f8..8dff244 100644\n--- a/builtin/revert.c\n+++ b/builtin/revert.c\n@@ -286,10 +286,10 @@ static NORETURN void die_dirty_index(const char *me)\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\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\t\tdie(_(\"Your local changes would be overwritten by %s.\\n\"), _(me));\n \t}\n }\n \n@@ -339,7 +339,7 @@ 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\tdie(_(\"%s: Unable to write new index file\"), _(me));\n \trollback_lock_file(&index_lock);\n \n \tif (!clean) {\n@@ -446,8 +446,8 @@ 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    me, sha1_to_hex(parent->object.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 \t\tdie(_(\"Cannot get commit message for %s\"),\n@@ -570,7 +570,7 @@ static int revert_or_cherry_pick(int argc, const char **argv)\n \t}\n \n \tif (read_cache() < 0)\n-\t\tdie(\"git %s: failed to read the index\", me);\n+\t\tdie(_(\"git %s: failed to read the index\"), _(me));\n \n \tprepare_revs(&revs);\n \ndiff --git a/t/t3501-revert-cherry-pick.sh b/t/t3501-revert-cherry-pick.sh\nindex bc7aedd..b12b1b4 100755\n--- a/t/t3501-revert-cherry-pick.sh\n+++ b/t/t3501-revert-cherry-pick.sh\n@@ -81,7 +81,7 @@ test_expect_success 'revert after renaming branch' '\n \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.313.gcd15\n"},{"id":"150076","messageId":"1283775704-29440-15-git-send-email-avarab@gmail.com","threadId":"24977","inReplyTo":"1283638229-14199-1-git-send-email-avarab@gmail.com","subject":"[PATCH 14/15] gettextize: git-revert split up \"could not revert/apply\" message","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2010-09-06T12:21:43Z","receivedAt":"2010-09-06T12:21:43Z","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 8dff244..7157ee1 100644\n--- a/builtin/revert.c\n+++ b/builtin/revert.c\n@@ -510,8 +510,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.313.gcd15\n"},{"id":"150078","messageId":"1283775704-29440-16-git-send-email-avarab@gmail.com","threadId":"24977","inReplyTo":"1283638229-14199-1-git-send-email-avarab@gmail.com","subject":"[PATCH 15/15] gettextize: git-shortlog basic messages","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2010-09-06T12:21:44Z","receivedAt":"2010-09-06T12:21: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/shortlog.c |    8 ++++----\n 1 files changed, 4 insertions(+), 4 deletions(-)\n\ndiff --git a/builtin/shortlog.c b/builtin/shortlog.c\nindex 2135b0d..f2cfe97 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.313.gcd15\n"},{"id":"150109","messageId":"20100906184153.GC25426@burratino","threadId":"24977","inReplyTo":"1283775704-29440-16-git-send-email-avarab@gmail.com","subject":"Re: [PATCH 15/15] gettextize: git-shortlog basic messages","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2010-09-06T18:41:53Z","receivedAt":"2010-09-06T18:41:53Z","isPatch":true,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"Ævar Arnfjörð Bjarmason wrote:\n\n> Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n\nFor what it's worth:\n\nReviewed-by: Jonathan Nieder <jrnieder@gmail.com>\n\nThanks.\n"},{"id":"150110","messageId":"20100906184536.GD25426@burratino","threadId":"24977","inReplyTo":"1283775704-29440-13-git-send-email-avarab@gmail.com","subject":"Re: [PATCH 12/15] gettextize: git-revert mark the \"me\" variable for translation","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2010-09-06T18:45:36Z","receivedAt":"2010-09-06T18:45:36Z","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 \"me\" variable is used in many later messages to indicate whether\n> we're using revert or cherry-pick.\n\nWhat good does it do to translate it?  The command name is the same\neven in Hindi git.\n\n> --- a/builtin/revert.c\n> +++ b/builtin/revert.c\n> @@ -552,7 +552,9 @@ static int revert_or_cherry_pick(int argc, const char **argv)\n>  \tstruct rev_info revs;\n>  \n>  \tgit_config(git_default_config, NULL);\n> -\tme = action == REVERT ? \"revert\" : \"cherry-pick\";\n> +\t/* TRANSLATORS: This is used in several error messages indicating\n> +\t   the name of the current program */\n> +\tme = action == REVERT ? N_(\"revert\") : N_(\"cherry-pick\");\n>  \tsetenv(GIT_REFLOG_ACTION, me, 0);\n\nUnrelated question: Are reflog actions supposed to be translated?  (I\nhave not thought about that carefully.)\n"},{"id":"150111","messageId":"20100906185023.GE25426@burratino","threadId":"24977","inReplyTo":"1283775704-29440-14-git-send-email-avarab@gmail.com","subject":"Re: [PATCH 13/15] gettextize: git-revert messages using the \"me\" variable","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2010-09-06T18:50:23Z","receivedAt":"2010-09-06T18:50:23Z","isPatch":true,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"(+cc: Christian, de facto cherry-pick maintainer)\n\nÆvar Arnfjörð Bjarmason wrote:\n\n> Mark messages that used the \"me\" variable for translation. The\n> potential values of the variable had already been marked using N_(),\n> so we can use _(me) here.\n\nAh, now I understand better.  Would it be possible to squash this\npatch with the previous one (for clarity)?\n\n> --- a/builtin/revert.c\n> +++ b/builtin/revert.c\n> @@ -286,10 +286,10 @@ static NORETURN void die_dirty_index(const char *me)\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\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\t\tdie(_(\"Your local changes would be overwritten by %s.\\n\"), _(me));\n\nGood.\n\n> @@ -339,7 +339,7 @@ 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\tdie(_(\"%s: Unable to write new index file\"), _(me));\n\nNot good, in my opinion.  The dialogue ought to look like this, I think:\n\n $ git cherry-pick astermay\n ...\n fatal: cherry-pick: Unableway otay itewray ewnay indexway ilefay\n\n> @@ -446,8 +446,8 @@ 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    me, sha1_to_hex(parent->object.sha1));\n> +\t\tdie(_(\"%s: cannot parse parent commit %s\"),\n> +\t\t    _(me), sha1_to_hex(parent->object.sha1));\n\nLikewise.\n\n> @@ -570,7 +570,7 @@ static int revert_or_cherry_pick(int argc, const char **argv)\n>  \t}\n>  \n>  \tif (read_cache() < 0)\n> -\t\tdie(\"git %s: failed to read the index\", me);\n> +\t\tdie(_(\"git %s: failed to read the index\"), _(me));\n\nLikewise.\n\nWith the exceptions mentioned above,\nReviewed-by: Jonathan Nieder <jrnieder@gmail.com>\n\nThanks.\n"},{"id":"150112","messageId":"20100906185547.GF25426@burratino","threadId":"24977","inReplyTo":"1283775704-29440-15-git-send-email-avarab@gmail.com","subject":"Re: [PATCH 14/15] gettextize: git-revert split up \"could not revert/apply\" message","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2010-09-06T18:55:47Z","receivedAt":"2010-09-06T18:55:47Z","isPatch":true,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"(+cc: Christian)\n\nÆvar Arnfjörð Bjarmason wrote:\n\n> 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\n> translators to understand the message.\n\nRight, parts of speech can be a pain.  So:\nAcked-by: Jonathan Nieder <jrnieder@gmail.com>\n\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\nAn idea (it may or may not be a good one ;-)): what if we made the gettext\npoison into an automatically generated .po file?  Then testing poison\nwould be a special case of running tests with an arbitrary locale:\n\n $ TEST_LANGUAGE=poison prove t[0-9]*.sh\n\nand this test prerequisite could be more intuitively named LOCALE_C or\nsimilar.\n"},{"id":"150117","messageId":"AANLkTik2aEYxgpL6QuhbacMv6i2hTNjJ1+0bFdK4tph-@mail.gmail.com","threadId":"24977","inReplyTo":"20100906184536.GD25426@burratino","subject":"Re: [PATCH 12/15] gettextize: git-revert mark the \"me\" variable for translation","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2010-09-06T20:06:34Z","receivedAt":"2010-09-06T20:06:34Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"On Mon, Sep 6, 2010 at 18:45, Jonathan Nieder <jrnieder@gmail.com> wrote:\n> Ævar Arnfjörð Bjarmason wrote:\n>\n>> The \"me\" variable is used in many later messages to indicate whether\n>> we're using revert or cherry-pick.\n>\n> What good does it do to translate it?  The command name is the same\n> even in Hindi git.\n\nNot all uses of it are references to git-%s, e.g. in the next patch:\n\n    die(_(\"Your local changes would be overwritten by %s.\\n\"), _(me));\n\nBut maybe it's used in enough contexts for it to be useless to\ntranslate it like this, i.e. we'll have to fix it later, but we'll see\nabout that.\n\n>> --- a/builtin/revert.c\n>> +++ b/builtin/revert.c\n>> @@ -552,7 +552,9 @@ static int revert_or_cherry_pick(int argc, const char **argv)\n>>       struct rev_info revs;\n>>\n>>       git_config(git_default_config, NULL);\n>> -     me = action == REVERT ? \"revert\" : \"cherry-pick\";\n>> +     /* TRANSLATORS: This is used in several error messages indicating\n>> +        the name of the current program */\n>> +     me = action == REVERT ? N_(\"revert\") : N_(\"cherry-pick\");\n>>       setenv(GIT_REFLOG_ACTION, me, 0);\n>\n> Unrelated question: Are reflog actions supposed to be translated?  (I\n> have not thought about that carefully.)\n\nIn this updated series I've explicitly reverted patches that\n(accidentally) translated some of the reflog.\n\nI'm only translating things which'll be viewed by human eyes, and\nhuman eyes alone. That doesn't apply to the reflog, which I see as\nplumbing.\n"},{"id":"150119","messageId":"20100906200838.GB26371@burratino","threadId":"24977","inReplyTo":"AANLkTik2aEYxgpL6QuhbacMv6i2hTNjJ1+0bFdK4tph-@mail.gmail.com","subject":"Re: [PATCH 12/15] gettextize: git-revert mark the \"me\" variable for translation","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2010-09-06T20:08:38Z","receivedAt":"2010-09-06T20:08:38Z","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, Sep 6, 2010 at 18:45, Jonathan Nieder <jrnieder@gmail.com> wrote:\n\n>> What good does it do to translate it?  The command name is the same\n>> even in Hindi git.\n>\n> Not all uses of it are references to git-%s, e.g. in the next patch:\n\nRight, forget about this comment.  Maybe this patch should be squashed\nwith the next one so reviewers can more easily see what is going on.\n\n> In this updated series I've explicitly reverted patches that\n> (accidentally) translated some of the reflog.\n> \n> I'm only translating things which'll be viewed by human eyes, and\n> human eyes alone. That doesn't apply to the reflog, which I see as\n> plumbing.\n\nThanks for explaining.\n"},{"id":"150120","messageId":"AANLkTi=8VXBFW7jzUe4EuCd+i221zRUt6LHGBYG8FQya@mail.gmail.com","threadId":"24977","inReplyTo":"20100906185023.GE25426@burratino","subject":"Re: [PATCH 13/15] gettextize: git-revert messages using the \"me\" variable","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2010-09-06T20:12:19Z","receivedAt":"2010-09-06T20:12:19Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"On Mon, Sep 6, 2010 at 18:50, Jonathan Nieder <jrnieder@gmail.com> wrote:\n> (+cc: Christian, de facto cherry-pick maintainer)\n\nThanks. In most cases I haven't been CC-ing people,\n\na) because I'd probably end up CC-ing everyone who ever touched git\n\nb) the nature of the changes probalby doesn't especially benefit from\n   me bothering all these people. But maybe that's the wrong assumption.\n\nBut by all means add more people to the CC :)\n\n> Ævar Arnfjörð Bjarmason wrote:\n>\n>> Mark messages that used the \"me\" variable for translation. The\n>> potential values of the variable had already been marked using N_(),\n>> so we can use _(me) here.\n>\n> Ah, now I understand better.  Would it be possible to squash this\n> patch with the previous one (for clarity)?\n\nAnd now I see the reply I just sent off was useless, oh well, that's\nwhat I get for reading things sequentially :)\n\nSure, it can be squashed. I'm just trying to keep things as granular\nas possible, but maybe I'm overshooting it in some cases.\n\n>> --- a/builtin/revert.c\n>> +++ b/builtin/revert.c\n>> @@ -286,10 +286,10 @@ static NORETURN void die_dirty_index(const char *me)\n>>               die_resolve_conflict(me);\n>>       } else {\n>>               if (advice_commit_before_merge)\n>> -                     die(\"Your local changes would be overwritten by %s.\\n\"\n>> -                         \"Please, commit your changes or stash them to proceed.\", me);\n>> +                     die(_(\"Your local changes would be overwritten by %s.\\n\"\n>> +                         \"Please, commit your changes or stash them to proceed.\"), _(me));\n>>               else\n>> -                     die(\"Your local changes would be overwritten by %s.\\n\", me);\n>> +                     die(_(\"Your local changes would be overwritten by %s.\\n\"), _(me));\n>\n> Good.\n>\n>> @@ -339,7 +339,7 @@ static int do_recursive_merge(struct commit *base, struct commit *next,\n>>       if (active_cache_changed &&\n>>           (write_cache(index_fd, active_cache, active_nr) ||\n>>            commit_locked_index(&index_lock)))\n>> -             die(\"%s: Unable to write new index file\", me);\n>> +             die(_(\"%s: Unable to write new index file\"), _(me));\n>\n> Not good, in my opinion.  The dialogue ought to look like this, I think:\n>\n>  $ git cherry-pick astermay\n>  ...\n>  fatal: cherry-pick: Unableway otay itewray ewnay indexway ilefay\n>\n>> @@ -446,8 +446,8 @@ static int do_pick_commit(void)\n>>               return fast_forward_to(commit->object.sha1, head);\n>>\n>>       if (parent && parse_commit(parent) < 0)\n>> -             die(\"%s: cannot parse parent commit %s\",\n>> -                 me, sha1_to_hex(parent->object.sha1));\n>> +             die(_(\"%s: cannot parse parent commit %s\"),\n>> +                 _(me), sha1_to_hex(parent->object.sha1));\n>\n> Likewise.\n>\n>> @@ -570,7 +570,7 @@ static int revert_or_cherry_pick(int argc, const char **argv)\n>>       }\n>>\n>>       if (read_cache() < 0)\n>> -             die(\"git %s: failed to read the index\", me);\n>> +             die(_(\"git %s: failed to read the index\"), _(me));\n>\n> Likewise.\n\nI don't know if all of the above hold true, e.g. because some\nlanguages will always transliterate things, even proper nouns.\n\nBut as mentioned before the string is probably being used in too many\ndifferent contexts for it to be useful to them.\n\n> With the exceptions mentioned above,\n\nSo I should probably just skip translating the \"me\" variable for now. I.e.\nthis and the last patch can probably be dropped.\n\n> Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>\n"},{"id":"150122","messageId":"AANLkTi=V01_OP+6pxrUakF=cTGFL=nOv=9C5meQU2H8C@mail.gmail.com","threadId":"24977","inReplyTo":"20100906185547.GF25426@burratino","subject":"Re: [PATCH 14/15] gettextize: git-revert split up \"could not revert/apply\" message","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2010-09-06T20:25:49Z","receivedAt":"2010-09-06T20:25:49Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"On Mon, Sep 6, 2010 at 18:55, Jonathan Nieder <jrnieder@gmail.com> wrote:\n> (+cc: Christian)\n>\n> Ævar Arnfjörð Bjarmason wrote:\n>\n>> 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\n>> translators to understand the message.\n>\n> Right, parts of speech can be a pain.  So:\n> Acked-by: Jonathan Nieder <jrnieder@gmail.com>\n\nThanks.\n\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>>       test \"$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>\n> An idea (it may or may not be a good one ;-)): what if we made the gettext\n> poison into an automatically generated .po file?  Then testing poison\n> would be a special case of running tests with an arbitrary locale:\n>\n>  $ TEST_LANGUAGE=poison prove t[0-9]*.sh\n>\n> and this test prerequisite could be more intuitively named LOCALE_C or\n> similar.\n\nThe issue with that is that gettext depends on setlocale(), which\nrequires a *valid* locale. This is why I skip the t/lib-gettext.sh\ntests unless `locale -a` says is_IS is there, because even if we\ncompile is.po using it won't work without the locale.\n\nSo to do this we'd have steal some locale.\n\nAlso, the set of tests we want to skip under POISON (i.e. automated\ngarbage) is slightly different from the tests we want to skip under\nTEST_LOCALE=, because some of those tests are checking for the %s in\n\"file failed: %s\". So they'll fail under POISON, but shouldn't fail\nunder any translation.\n"},{"id":"150188","messageId":"20100907053420.GR1182@burratino","threadId":"24977","inReplyTo":"AANLkTi=V01_OP+6pxrUakF=cTGFL=nOv=9C5meQU2H8C@mail.gmail.com","subject":"Re: [PATCH 14/15] gettextize: git-revert split up \"could not revert/apply\" message","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2010-09-07T05:34:20Z","receivedAt":"2010-09-07T05:34:20Z","isPatch":true,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"Ævar Arnfjörð Bjarmason wrote:\n\n> to do this we'd have steal some locale.\n\nAlas.  Thanks for explaining.\n\n> Also, the set of tests we want to skip under POISON (i.e. automated\n> garbage) is slightly different from the tests we want to skip under\n> TEST_LOCALE=, because some of those tests are checking for the %s in\n> \"file failed: %s\". So they'll fail under POISON, but shouldn't fail\n> under any translation.\n\nThis could be fixable in the long term, no?  e.g., under POISON we\ncould have something like\n\n _ () {\n\t perl -pe 's/(?<!%)[^%#]*/POISON/g'\n }\n\nto preserve commit message comments and % directives.\n"},{"id":"150189","messageId":"20100907053936.GS1182@burratino","threadId":"24977","inReplyTo":"AANLkTi=8VXBFW7jzUe4EuCd+i221zRUt6LHGBYG8FQya@mail.gmail.com","subject":"Re: [PATCH 13/15] gettextize: git-revert messages using the \"me\" variable","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2010-09-07T05:39:36Z","receivedAt":"2010-09-07T05:39:36Z","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, Sep 6, 2010 at 18:50, Jonathan Nieder <jrnieder@gmail.com> wrote:\n\n>> Not good, in my opinion.  The dialogue ought to look like this, I think:\n>>\n>>  $ git cherry-pick astermay\n>>  ...\n>>  fatal: cherry-pick: Unableway otay itewray ewnay indexway ilefay\n[...]\n> I don't know if all of the above hold true, e.g. because some\n> languages will always transliterate things, even proper nouns.\n>\n> But as mentioned before the string is probably being used in too many\n> different contexts for it to be useful to them.\n\nHmm, okay.  Do you mean languages like Japanese or something else?  At\nany rate, I guess you are right that this is too complicated for the\nmoment.\n"},{"id":"150198","messageId":"AANLkTinp5R+jMKpHpkMYK3MDWLuUpM7T-+KBZ+NG4g-G@mail.gmail.com","threadId":"24977","inReplyTo":"20100907053420.GR1182@burratino","subject":"Re: [PATCH 14/15] gettextize: git-revert split up \"could not revert/apply\" message","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2010-09-07T08:47:27Z","receivedAt":"2010-09-07T08:47:27Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"On Tue, Sep 7, 2010 at 05:34, Jonathan Nieder <jrnieder@gmail.com> wrote:\n> Ævar Arnfjörð Bjarmason wrote:\n>\n>> to do this we'd have steal some locale.\n>\n> Alas.  Thanks for explaining.\n>\n>> Also, the set of tests we want to skip under POISON (i.e. automated\n>> garbage) is slightly different from the tests we want to skip under\n>> TEST_LOCALE=, because some of those tests are checking for the %s in\n>> \"file failed: %s\". So they'll fail under POISON, but shouldn't fail\n>> under any translation.\n>\n> This could be fixable in the long term, no?  e.g., under POISON we\n> could have something like\n>\n>  _ () {\n>         perl -pe 's/(?<!%)[^%#]*/POISON/g'\n>  }\n>\n> to preserve commit message comments and % directives.\n\nYeah, but rather than do fancy stuff like that in C I just made a dumb\nimplementation.\n\nIt's far easier to just skip a few more tests than it is to come up\nwith your own parser that avoids printf directives but still poisons\nthe message enough that e.g. <grep \"Clone\" ..> won't work anymore.\n"},{"id":"150199","messageId":"AANLkTimTG1FbR988c6cQHQsQ4k6__HVVByt5O0g-pe67@mail.gmail.com","threadId":"24977","inReplyTo":"20100907053936.GS1182@burratino","subject":"Re: [PATCH 13/15] gettextize: git-revert messages using the \"me\" variable","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2010-09-07T08:51:44Z","receivedAt":"2010-09-07T08:51:44Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"On Tue, Sep 7, 2010 at 05:39, Jonathan Nieder <jrnieder@gmail.com> wrote:\n> Ævar Arnfjörð Bjarmason wrote:\n>> On Mon, Sep 6, 2010 at 18:50, Jonathan Nieder <jrnieder@gmail.com> wrote:\n>\n>>> Not good, in my opinion.  The dialogue ought to look like this, I think:\n>>>\n>>>  $ git cherry-pick astermay\n>>>  ...\n>>>  fatal: cherry-pick: Unableway otay itewray ewnay indexway ilefay\n> [...]\n>> I don't know if all of the above hold true, e.g. because some\n>> languages will always transliterate things, even proper nouns.\n>>\n>> But as mentioned before the string is probably being used in too many\n>> different contexts for it to be useful to them.\n>\n> Hmm, okay.  Do you mean languages like Japanese or something else?  At\n> any rate, I guess you are right that this is too complicated for the\n> moment.\n\nThe languages here that translate \"Wikipedia\" differently than\n\"Wikipedia\" are a pretty good indicator:\n\n    http://meta.wikimedia.org/wiki/User:Waldir/Logos_and_slogans\n"},{"id":"150423","messageId":"7vsk1ijvff.fsf@alter.siamese.dyndns.org","threadId":"24977","inReplyTo":"AANLkTimTG1FbR988c6cQHQsQ4k6__HVVByt5O0g-pe67@mail.gmail.com","subject":"Re: [PATCH 13/15] gettextize: git-revert messages using the \"me\" variable","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2010-09-10T00:26:12Z","receivedAt":"2010-09-10T00:26:12Z","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 Tue, Sep 7, 2010 at 05:39, Jonathan Nieder <jrnieder@gmail.com> wrote:\n>> Ævar Arnfjörð Bjarmason wrote:\n>>> On Mon, Sep 6, 2010 at 18:50, Jonathan Nieder <jrnieder@gmail.com> wrote:\n>>\n>>>> Not good, in my opinion.  The dialogue ought to look like this, I think:\n>>>>\n>>>>  $ git cherry-pick astermay\n>>>>  ...\n>>>>  fatal: cherry-pick: Unableway otay itewray ewnay indexway ilefay\n>> [...]\n>>> I don't know if all of the above hold true, e.g. because some\n>>> languages will always transliterate things, even proper nouns.\n>>>\n>>> But as mentioned before the string is probably being used in too many\n>>> different contexts for it to be useful to them.\n>>\n>> Hmm, okay.  Do you mean languages like Japanese or something else?  At\n>> any rate, I guess you are right that this is too complicated for the\n>> moment.\n>\n> The languages here that translate \"Wikipedia\" differently than\n> \"Wikipedia\" are a pretty good indicator:\n>\n>     http://meta.wikimedia.org/wiki/User:Waldir/Logos_and_slogans\n\nI don't think so, unless you are translating the git subcommand names.\n\nIf your translated git lets/forces you to say\n\n  $  git ckcherry-piay astermay\n\nthen that is a different story.  It might be very reasonable to translate\nthe \"fatal:\" message to\n\n    alfatay: ckcherry-piay: Unableway otay itewray ewnay indexway ilefay\n\nand it probably becomes a fair comparison with the wikipedia situation,\nbut otherwise no.\n"}]}