All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 00/72] No-op C gettext wrappers
@ 2011-02-19 19:23 Ævar Arnfjörð Bjarmason
  2011-02-19 19:23 ` [PATCH 01/72] gettext.h: add no-op _() and N_() wrappers Ævar Arnfjörð Bjarmason
                   ` (72 more replies)
  0 siblings, 73 replies; 222+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2011-02-19 19:23 UTC (permalink / raw)
  To: git; +Cc: Junio C Hamano, Ævar Arnfjörð Bjarmason

As discussed on-list previously I'm remaking the gettext series in a
form that'll be easier to swallow. This series is what's at the start
of my own ab/i18n branch hosted at git://github.com/avar/git.git.

It only does these:

 * A skeleton no-op gettext.h wrapper that does nothing
 * Marking up of the relevant source messages so they can be translated
 * Marking up and changing tests that would break under
   GETTEXT_POISON=YesPlease

After this is in I'll submit similar no-op wrappers and gettextization
of the *.sh and *.perl files I have gettextized in ab/i18n, after that
I'll be trying to get the remaining bits of ab/i18n in, which'll be:

 * The actual C, Shell and Perl gettext implementation + tests
 * Documentation on how to translate things
 * po/*.po files containing translations

Ævar Arnfjörð Bjarmason (72):
  gettext.h: add no-op _() and N_() wrappers
  cache.h: include gettext.h
  t/test-lib.sh: add always-set NO_GETTEXT_POISON prerequisite
  gettextize: git-init basic messages
  gettextize: git-init "Initialized [...] repository" message
  gettextize: git-clone basic messages
  gettextize: git-clone "Cloning into" message
  gettextize: git-add basic messages
  gettextize: git-add "no files added" message
  gettextize: git-add "Use -f if you really want" message
  gettextize: git-add "pathspec [...] did not match" message
  gettextize: git-add "remove '%s'" message
  gettextize: git-add refresh_index message
  gettextize: git-branch basic messages
  gettextize: git-branch "remote branch '%s' not found" message
  gettextize: git-branch "Deleted branch [...]" message
  gettextize: git-branch "git branch -v" messages
  gettextize: git-branch "(no branch)" message
  gettextize: git-checkout basic messages
  gettextize: git-checkout: our/their version message
  gettextize: git-checkout describe_detached_head messages
  gettextize: git-checkout "HEAD is now at" message
  gettextize: git-checkout "Switched to a .. branch" message
  gettextize: git-commit basic messages
  gettextize: git-commit "middle of a merge" message
  gettextize: git-commit formatting messages
  gettextize: git-commit print_summary messages
  gettextize: git-commit "enter the commit message" message
  gettextize: git-commit advice messages
  gettextize: git-diff basic messages
  gettextize: git-fetch basic messages
  gettextize: git-fetch formatting messages
  gettextize: git-fetch update_local_ref messages
  gettextize: git-fetch split up "(non-fast-forward)" message
  gettextize: git-grep basic messages
  gettextize: git-grep "--open-files-in-pager" message
  gettextize: git-log basic messages
  gettextize: git-log "--OPT does not make sense" messages
  gettextize: git-merge basic messages
  gettextize: git-merge "Updating %s..%s" message
  gettextize: git-merge "You have not concluded your merge" messages
  gettextize: git-merge "Wonderful" message
  gettextize: git-mv basic messages
  gettextize: git-mv "bad" messages
  gettextize: git-rm basic messages
  gettextize: git-reset basic messages
  gettextize: git-reset reset_type_names messages
  gettextize: git-reset "Unstaged changes after reset" message
  gettextize: git-tag basic messages
  gettextize: git-tag tag_template message
  gettextize: git-push basic messages
  gettextize: git-push "prevent you from losing" message
  gettextize: git-status basic messages
  gettextize: git-status "nothing to commit" messages
  gettextize: git-status shortstatus messages
  gettextize: git-status "Changes to be committed" message
  gettextize: git-status "Initial commit" message
  gettextize: git-status "renamed: " message
  gettextize: git-archive basic messages
  gettextize: git-bundle basic messages
  gettextize: git-clean basic messages
  gettextize: git-clean clean.requireForce messages
  gettextize: git-describe basic messages
  gettextize: git-gc basic messages
  gettextize: git-gc "Auto packing the repository" message
  gettextize: git-notes basic commands
  gettextize: git-notes GIT_NOTES_REWRITE_MODE error message
  gettextize: git-revert basic messages
  gettextize: git-revert "Your local changes" message
  gettextize: git-revert literal "me" messages
  gettextize: git-revert split up "could not revert/apply" message
  gettextize: git-shortlog basic messages

 builtin/add.c                    |   46 ++++++------
 builtin/archive.c                |   14 ++--
 builtin/branch.c                 |   69 ++++++++--------
 builtin/bundle.c                 |    6 +-
 builtin/checkout.c               |   93 +++++++++++-----------
 builtin/clean.c                  |   33 +++++---
 builtin/clone.c                  |   63 ++++++++-------
 builtin/commit.c                 |  162 +++++++++++++++++++-------------------
 builtin/describe.c               |   36 ++++----
 builtin/diff.c                   |   18 ++--
 builtin/fetch.c                  |   82 ++++++++++----------
 builtin/gc.c                     |   24 +++---
 builtin/grep.c                   |   34 ++++----
 builtin/init-db.c                |   58 +++++++------
 builtin/log.c                    |   68 ++++++++--------
 builtin/merge.c                  |  128 +++++++++++++++---------------
 builtin/mv.c                     |   32 ++++----
 builtin/notes.c                  |  112 +++++++++++++-------------
 builtin/push.c                   |   42 +++++-----
 builtin/reset.c                  |   42 +++++-----
 builtin/revert.c                 |   76 ++++++++++--------
 builtin/rm.c                     |   22 +++---
 builtin/shortlog.c               |    8 +-
 builtin/tag.c                    |   66 ++++++++--------
 cache.h                          |    1 +
 gettext.h                        |    9 ++
 t/lib-httpd.sh                   |    2 +-
 t/t0001-init.sh                  |    2 +-
 t/t1200-tutorial.sh              |    5 +-
 t/t2200-add-update.sh            |    2 +-
 t/t2204-add-ignored.sh           |   37 ++++++---
 t/t3030-merge-recursive.sh       |    2 +-
 t/t3200-branch.sh                |    2 +-
 t/t3203-branch-output.sh         |    2 +-
 t/t3501-revert-cherry-pick.sh    |    2 +-
 t/t3507-cherry-pick-conflict.sh  |    2 +-
 t/t3700-add.sh                   |   11 ++-
 t/t4001-diff-rename.sh           |    4 +-
 t/t4014-format-patch.sh          |    2 +-
 t/t5526-fetch-submodules.sh      |   40 ++++++++--
 t/t5541-http-push.sh             |    7 +-
 t/t5601-clone.sh                 |    2 +-
 t/t6040-tracking-info.sh         |    2 +-
 t/t6120-describe.sh              |    2 +-
 t/t7004-tag.sh                   |    1 +
 t/t7012-skip-worktree-writing.sh |    4 +-
 t/t7060-wtstatus.sh              |    2 +-
 t/t7102-reset.sh                 |    2 +-
 t/t7110-reset-merge.sh           |    6 +-
 t/t7201-co.sh                    |   10 +-
 t/t7300-clean.sh                 |    6 +-
 t/t7500-commit.sh                |    8 +-
 t/t7501-commit.sh                |    7 +-
 t/t7502-commit.sh                |   60 +++++++++------
 t/t7506-status-submodule.sh      |   28 +++---
 t/t7508-status.sh                |  115 +++++++++++++++------------
 t/t7600-merge.sh                 |    2 +-
 t/t7607-merge-overwrite.sh       |   10 ++-
 t/t7611-merge-abort.sh           |   20 ++++-
 t/t7811-grep-open.sh             |    2 +-
 t/test-lib.sh                    |    5 +
 wt-status.c                      |  116 ++++++++++++++--------------
 62 files changed, 1011 insertions(+), 865 deletions(-)
 create mode 100644 gettext.h

-- 
1.7.2.3

^ permalink raw reply	[flat|nested] 222+ messages in thread

* [PATCH 01/72] gettext.h: add no-op _() and N_() wrappers
  2011-02-19 19:23 [PATCH 00/72] No-op C gettext wrappers Ævar Arnfjörð Bjarmason
@ 2011-02-19 19:23 ` Ævar Arnfjörð Bjarmason
  2011-02-20  2:01   ` Jonathan Nieder
  2011-02-19 19:23 ` [PATCH 02/72] cache.h: include gettext.h Ævar Arnfjörð Bjarmason
                   ` (71 subsequent siblings)
  72 siblings, 1 reply; 222+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2011-02-19 19:23 UTC (permalink / raw)
  To: git; +Cc: Junio C Hamano, Ævar Arnfjörð Bjarmason

Add a new header called gettext.h which is currently a no-op. To split
up the gettext series I'm first submitting patches to gettextize the
source tree before I add any of the Makefile and C changes needed to
actually use them.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
---
 gettext.h |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)
 create mode 100644 gettext.h

diff --git a/gettext.h b/gettext.h
new file mode 100644
index 0000000..c68bbe9
--- /dev/null
+++ b/gettext.h
@@ -0,0 +1,9 @@
+/*
+ * Copyright (c) 2010 Ævar Arnfjörð Bjarmason
+ *
+ * This is a skeleton no-op implementation of gettext for Git. It'll
+ * be replaced by something that uses libintl.h and wraps gettext() in
+ * a future patch series.
+ */
+#define N_(s) (s)
+#define _(s) (s)
-- 
1.7.2.3

^ permalink raw reply related	[flat|nested] 222+ messages in thread

* [PATCH 02/72] cache.h: include gettext.h
  2011-02-19 19:23 [PATCH 00/72] No-op C gettext wrappers Ævar Arnfjörð Bjarmason
  2011-02-19 19:23 ` [PATCH 01/72] gettext.h: add no-op _() and N_() wrappers Ævar Arnfjörð Bjarmason
@ 2011-02-19 19:23 ` Ævar Arnfjörð Bjarmason
  2011-02-19 19:23 ` [PATCH 03/72] t/test-lib.sh: add always-set NO_GETTEXT_POISON prerequisite Ævar Arnfjörð Bjarmason
                   ` (70 subsequent siblings)
  72 siblings, 0 replies; 222+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2011-02-19 19:23 UTC (permalink / raw)
  To: git; +Cc: Junio C Hamano, Ævar Arnfjörð Bjarmason

Change cache.h to include gettext.h. In previous incarnations of the
gettext series I included gettext.h in builtin.h, then changed
builtin/*.c files to include that when they didn't already.

It was pointed out by Junio and others that it makes more sense to
have the inclusion here, since gettext is going to be used everywhere.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
---
 cache.h |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/cache.h b/cache.h
index 3abf895..a465f38 100644
--- a/cache.h
+++ b/cache.h
@@ -5,6 +5,7 @@
 #include "strbuf.h"
 #include "hash.h"
 #include "advice.h"
+#include "gettext.h"
 
 #include SHA1_HEADER
 #ifndef git_SHA_CTX
-- 
1.7.2.3

^ permalink raw reply related	[flat|nested] 222+ messages in thread

* [PATCH 03/72] t/test-lib.sh: add always-set NO_GETTEXT_POISON prerequisite
  2011-02-19 19:23 [PATCH 00/72] No-op C gettext wrappers Ævar Arnfjörð Bjarmason
  2011-02-19 19:23 ` [PATCH 01/72] gettext.h: add no-op _() and N_() wrappers Ævar Arnfjörð Bjarmason
  2011-02-19 19:23 ` [PATCH 02/72] cache.h: include gettext.h Ævar Arnfjörð Bjarmason
@ 2011-02-19 19:23 ` Ævar Arnfjörð Bjarmason
  2011-02-20  2:10   ` Jonathan Nieder
  2011-02-19 19:23 ` [PATCH 04/72] gettextize: git-init basic messages Ævar Arnfjörð Bjarmason
                   ` (69 subsequent siblings)
  72 siblings, 1 reply; 222+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2011-02-19 19:23 UTC (permalink / raw)
  To: git; +Cc: Junio C Hamano, Ævar Arnfjörð Bjarmason

Add a new test prerequisite called NO_GETTEXT_POISON to t/test-lib.sh
that's always set for now.

Some of the gettextize patches that'll follow this one will change
their test outputs if a functioning gettext implementation with poison
support is sitting on top of them, but for now I only have harmless
no-op wrappers in gettext.h so NO_GETTEXT_POISON can be set all the
time.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
---
 t/test-lib.sh |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/t/test-lib.sh b/t/test-lib.sh
index 0fdc541..ffcfa2e 100644
--- a/t/test-lib.sh
+++ b/t/test-lib.sh
@@ -1079,6 +1079,11 @@ esac
 test -z "$NO_PERL" && test_set_prereq PERL
 test -z "$NO_PYTHON" && test_set_prereq PYTHON
 
+# Always set the NO_GETTEXT_POISON prerequisite while we don't have a
+# real gettext implementation in Git. This will be replaced by
+# something that varies in a future patch series.
+test_set_prereq NO_GETTEXT_POISON
+
 # test whether the filesystem supports symbolic links
 ln -s x y 2>/dev/null && test -h y 2>/dev/null && test_set_prereq SYMLINKS
 rm -f y
-- 
1.7.2.3

^ permalink raw reply related	[flat|nested] 222+ messages in thread

* [PATCH 04/72] gettextize: git-init basic messages
  2011-02-19 19:23 [PATCH 00/72] No-op C gettext wrappers Ævar Arnfjörð Bjarmason
                   ` (2 preceding siblings ...)
  2011-02-19 19:23 ` [PATCH 03/72] t/test-lib.sh: add always-set NO_GETTEXT_POISON prerequisite Ævar Arnfjörð Bjarmason
@ 2011-02-19 19:23 ` Ævar Arnfjörð Bjarmason
  2011-02-20  2:21   ` Jonathan Nieder
  2011-02-19 19:23 ` [PATCH 05/72] gettextize: git-init "Initialized [...] repository" message Ævar Arnfjörð Bjarmason
                   ` (68 subsequent siblings)
  72 siblings, 1 reply; 222+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2011-02-19 19:23 UTC (permalink / raw)
  To: git; +Cc: Junio C Hamano, Ævar Arnfjörð Bjarmason

Change the user visible strings in init-db.c to use gettext
localizations. This only converts messages which needed to be changed
from "foo" to _("foo"), and didn't need any TRANSLATORS comments.

I haven't marked the messages in init_db_usage or init_db_options for
translation, since that would require additional changes in
parse-options.c. Those can be done later.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
---
 builtin/init-db.c |   48 ++++++++++++++++++++++++------------------------
 1 files changed, 24 insertions(+), 24 deletions(-)

diff --git a/builtin/init-db.c b/builtin/init-db.c
index 4f5348e..35f9f13 100644
--- a/builtin/init-db.c
+++ b/builtin/init-db.c
@@ -31,7 +31,7 @@ static void safe_create_dir(const char *dir, int share)
 		}
 	}
 	else if (share && adjust_shared_perm(dir))
-		die("Could not make %s writable by group", dir);
+		die(_("Could not make %s writable by group"), dir);
 }
 
 static void copy_templates_1(char *path, int baselen,
@@ -58,25 +58,25 @@ static void copy_templates_1(char *path, int baselen,
 		namelen = strlen(de->d_name);
 		if ((PATH_MAX <= baselen + namelen) ||
 		    (PATH_MAX <= template_baselen + namelen))
-			die("insanely long template name %s", de->d_name);
+			die(_("insanely long template name %s"), de->d_name);
 		memcpy(path + baselen, de->d_name, namelen+1);
 		memcpy(template + template_baselen, de->d_name, namelen+1);
 		if (lstat(path, &st_git)) {
 			if (errno != ENOENT)
-				die_errno("cannot stat '%s'", path);
+				die_errno(_("cannot stat '%s'"), path);
 		}
 		else
 			exists = 1;
 
 		if (lstat(template, &st_template))
-			die_errno("cannot stat template '%s'", template);
+			die_errno(_("cannot stat template '%s'"), template);
 
 		if (S_ISDIR(st_template.st_mode)) {
 			DIR *subdir = opendir(template);
 			int baselen_sub = baselen + namelen;
 			int template_baselen_sub = template_baselen + namelen;
 			if (!subdir)
-				die_errno("cannot opendir '%s'", template);
+				die_errno(_("cannot opendir '%s'"), template);
 			path[baselen_sub++] =
 				template[template_baselen_sub++] = '/';
 			path[baselen_sub] =
@@ -93,20 +93,20 @@ static void copy_templates_1(char *path, int baselen,
 			int len;
 			len = readlink(template, lnk, sizeof(lnk));
 			if (len < 0)
-				die_errno("cannot readlink '%s'", template);
+				die_errno(_("cannot readlink '%s'"), template);
 			if (sizeof(lnk) <= len)
-				die("insanely long symlink %s", template);
+				die(_("insanely long symlink %s"), template);
 			lnk[len] = 0;
 			if (symlink(lnk, path))
-				die_errno("cannot symlink '%s' '%s'", lnk, path);
+				die_errno(_("cannot symlink '%s' '%s'"), lnk, path);
 		}
 		else if (S_ISREG(st_template.st_mode)) {
 			if (copy_file(path, template, st_template.st_mode))
-				die_errno("cannot copy '%s' to '%s'", template,
+				die_errno(_("cannot copy '%s' to '%s'"), template,
 					  path);
 		}
 		else
-			error("ignoring template %s", template);
+			error(_("ignoring template %s"), template);
 	}
 }
 
@@ -129,7 +129,7 @@ static void copy_templates(const char *template_dir)
 		return;
 	template_len = strlen(template_dir);
 	if (PATH_MAX <= (template_len+strlen("/config")))
-		die("insanely long template path %s", template_dir);
+		die(_("insanely long template path %s"), template_dir);
 	strcpy(template_path, template_dir);
 	if (template_path[template_len-1] != '/') {
 		template_path[template_len++] = '/';
@@ -137,7 +137,7 @@ static void copy_templates(const char *template_dir)
 	}
 	dir = opendir(template_path);
 	if (!dir) {
-		warning("templates not found %s", template_dir);
+		warning(_("templates not found %s"), template_dir);
 		return;
 	}
 
@@ -150,8 +150,8 @@ static void copy_templates(const char *template_dir)
 
 	if (repository_format_version &&
 	    repository_format_version != GIT_REPO_VERSION) {
-		warning("not copying templates of "
-			"a wrong format version %d from '%s'",
+		warning(_("not copying templates of "
+			"a wrong format version %d from '%s'"),
 			repository_format_version,
 			template_dir);
 		closedir(dir);
@@ -188,7 +188,7 @@ static int create_default_files(const char *template_path)
 	int filemode;
 
 	if (len > sizeof(path)-50)
-		die("insane git directory %s", git_dir);
+		die(_("insane git directory %s"), git_dir);
 	memcpy(path, git_dir, len);
 
 	if (len && path[len-1] != '/')
@@ -346,7 +346,7 @@ int init_db(const char *template_dir, unsigned int flags)
 		else if (shared_repository == PERM_EVERYBODY)
 			sprintf(buf, "%d", OLD_PERM_EVERYBODY);
 		else
-			die("oops");
+			die(_("oops"));
 		git_config_set("core.sharedrepository", buf);
 		git_config_set("receive.denyNonFastforwards", "true");
 	}
@@ -375,7 +375,7 @@ static int guess_repository_type(const char *git_dir)
 	if (!strcmp(".", git_dir))
 		return 1;
 	if (!getcwd(cwd, sizeof(cwd)))
-		die_errno("cannot tell cwd");
+		die_errno(_("cannot tell cwd"));
 	if (!strcmp(git_dir, cwd))
 		return 1;
 	/*
@@ -450,18 +450,18 @@ int cmd_init_db(int argc, const char **argv, const char *prefix)
 					errno = EEXIST;
 					/* fallthru */
 				case -1:
-					die_errno("cannot mkdir %s", argv[0]);
+					die_errno(_("cannot mkdir %s"), argv[0]);
 					break;
 				default:
 					break;
 				}
 				shared_repository = saved;
 				if (mkdir(argv[0], 0777) < 0)
-					die_errno("cannot mkdir %s", argv[0]);
+					die_errno(_("cannot mkdir %s"), argv[0]);
 				mkdir_tried = 1;
 				goto retry;
 			}
-			die_errno("cannot chdir to %s", argv[0]);
+			die_errno(_("cannot chdir to %s"), argv[0]);
 		}
 	} else if (0 < argc) {
 		usage(init_db_usage[0]);
@@ -483,8 +483,8 @@ int cmd_init_db(int argc, const char **argv, const char *prefix)
 	git_dir = getenv(GIT_DIR_ENVIRONMENT);
 	work_tree = getenv(GIT_WORK_TREE_ENVIRONMENT);
 	if ((!git_dir || is_bare_repository_cfg == 1) && work_tree)
-		die("%s (or --work-tree=<directory>) not allowed without "
-		    "specifying %s (or --git-dir=<directory>)",
+		die(_("%s (or --work-tree=<directory>) not allowed without "
+			  "specifying %s (or --git-dir=<directory>)"),
 		    GIT_WORK_TREE_ENVIRONMENT,
 		    GIT_DIR_ENVIRONMENT);
 
@@ -509,14 +509,14 @@ int cmd_init_db(int argc, const char **argv, const char *prefix)
 		if (!git_work_tree_cfg) {
 			git_work_tree_cfg = xcalloc(PATH_MAX, 1);
 			if (!getcwd(git_work_tree_cfg, PATH_MAX))
-				die_errno ("Cannot access current working directory");
+				die_errno (_("Cannot access current working directory"));
 		}
 		if (work_tree)
 			set_git_work_tree(make_absolute_path(work_tree));
 		else
 			set_git_work_tree(git_work_tree_cfg);
 		if (access(get_git_work_tree(), X_OK))
-			die_errno ("Cannot access work tree '%s'",
+			die_errno (_("Cannot access work tree '%s'"),
 				   get_git_work_tree());
 	}
 	else {
-- 
1.7.2.3

^ permalink raw reply related	[flat|nested] 222+ messages in thread

* [PATCH 05/72] gettextize: git-init "Initialized [...] repository" message
  2011-02-19 19:23 [PATCH 00/72] No-op C gettext wrappers Ævar Arnfjörð Bjarmason
                   ` (3 preceding siblings ...)
  2011-02-19 19:23 ` [PATCH 04/72] gettextize: git-init basic messages Ævar Arnfjörð Bjarmason
@ 2011-02-19 19:23 ` Ævar Arnfjörð Bjarmason
  2011-02-19 19:23 ` [PATCH 06/72] gettextize: git-clone basic messages Ævar Arnfjörð Bjarmason
                   ` (67 subsequent siblings)
  72 siblings, 0 replies; 222+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2011-02-19 19:23 UTC (permalink / raw)
  To: git; +Cc: Junio C Hamano, Ævar Arnfjörð Bjarmason

Change the git-init "Initialized empty Git repository" message and its
variants to use gettext.

This is one of the messages that could do with splitting up, I had a
WIP patch to do that that began like this:

    const char *reinit_shared   = _("Reinitialized existing shared Git repository in %s\n");
    const char *init_shared	    = _("Initialized empty shared Git repository in %s\n");
    const char *reinit_noshared = _("Reinitialized existing Git repository in %s\n");
    const char *init_noshared   = _("Initialized empty Git repository in %s\n");

But in the first round of gettextization I'm aiming to keep code
changes to a minimum for ease of review.

We can solicit input from translators about which messages that use
too much sprintf-ing are troublesome, and change those later.

Note that the TRANSLATORS comment doesn't use the usual Git
style. This is because everything from "/* TRANSLATORS: " to "*/" will
extracted as-is xgettext(1) and presented to translators, including
newlines and leading "*"'s. There seems to be no way to change that,
short of patching xgettext itself.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
---
 builtin/init-db.c |   10 +++++++---
 t/t0001-init.sh   |    2 +-
 2 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/builtin/init-db.c b/builtin/init-db.c
index 35f9f13..67462ad 100644
--- a/builtin/init-db.c
+++ b/builtin/init-db.c
@@ -354,9 +354,13 @@ int init_db(const char *template_dir, unsigned int flags)
 	if (!(flags & INIT_DB_QUIET)) {
 		const char *git_dir = get_git_dir();
 		int len = strlen(git_dir);
-		printf("%s%s Git repository in %s%s\n",
-		       reinit ? "Reinitialized existing" : "Initialized empty",
-		       shared_repository ? " shared" : "",
+
+		/* TRANSLATORS: The first '%s' is either "Reinitialized
+		   existing" or "Initialized empty", the second " shared" or
+		   "", and the last '%s%s' is the verbatim directory name. */
+		printf(_("%s%s Git repository in %s%s\n"),
+		       reinit ? _("Reinitialized existing") : _("Initialized empty"),
+		       shared_repository ? _(" shared") : "",
 		       git_dir, len && git_dir[len-1] != '/' ? "/" : "");
 	}
 
diff --git a/t/t0001-init.sh b/t/t0001-init.sh
index f684993..4235ad4 100755
--- a/t/t0001-init.sh
+++ b/t/t0001-init.sh
@@ -180,7 +180,7 @@ test_expect_success 'GIT_DIR & GIT_WORK_TREE (2)' '
 	fi
 '
 
-test_expect_success 'reinit' '
+test_expect_success NO_GETTEXT_POISON 'reinit' '
 
 	(
 		sane_unset GIT_CONFIG GIT_WORK_TREE GIT_CONFIG &&
-- 
1.7.2.3

^ permalink raw reply related	[flat|nested] 222+ messages in thread

* [PATCH 06/72] gettextize: git-clone basic messages
  2011-02-19 19:23 [PATCH 00/72] No-op C gettext wrappers Ævar Arnfjörð Bjarmason
                   ` (4 preceding siblings ...)
  2011-02-19 19:23 ` [PATCH 05/72] gettextize: git-init "Initialized [...] repository" message Ævar Arnfjörð Bjarmason
@ 2011-02-19 19:23 ` Ævar Arnfjörð Bjarmason
  2011-02-19 19:23 ` [PATCH 07/72] gettextize: git-clone "Cloning into" message Ævar Arnfjörð Bjarmason
                   ` (66 subsequent siblings)
  72 siblings, 0 replies; 222+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2011-02-19 19:23 UTC (permalink / raw)
  To: git; +Cc: Junio C Hamano, Ævar Arnfjörð Bjarmason

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
---
 builtin/clone.c |   54 +++++++++++++++++++++++++++---------------------------
 1 files changed, 27 insertions(+), 27 deletions(-)

diff --git a/builtin/clone.c b/builtin/clone.c
index 60d9a64..f46d09b 100644
--- a/builtin/clone.c
+++ b/builtin/clone.c
@@ -208,7 +208,7 @@ static void setup_reference(const char *repo)
 	if (is_directory(mkpath("%s/.git/objects", ref_git)))
 		ref_git = mkpath("%s/.git", ref_git);
 	else if (!is_directory(mkpath("%s/objects", ref_git)))
-		die("reference repository '%s' is not a local directory.",
+		die(_("reference repository '%s' is not a local directory."),
 		    option_reference);
 
 	ref_git_copy = xstrdup(ref_git);
@@ -235,15 +235,15 @@ static void copy_or_link_directory(struct strbuf *src, struct strbuf *dest)
 
 	dir = opendir(src->buf);
 	if (!dir)
-		die_errno("failed to open '%s'", src->buf);
+		die_errno(_("failed to open '%s'"), src->buf);
 
 	if (mkdir(dest->buf, 0777)) {
 		if (errno != EEXIST)
-			die_errno("failed to create directory '%s'", dest->buf);
+			die_errno(_("failed to create directory '%s'"), dest->buf);
 		else if (stat(dest->buf, &buf))
-			die_errno("failed to stat '%s'", dest->buf);
+			die_errno(_("failed to stat '%s'"), dest->buf);
 		else if (!S_ISDIR(buf.st_mode))
-			die("%s exists and is not a directory", dest->buf);
+			die(_("%s exists and is not a directory"), dest->buf);
 	}
 
 	strbuf_addch(src, '/');
@@ -257,7 +257,7 @@ static void copy_or_link_directory(struct strbuf *src, struct strbuf *dest)
 		strbuf_setlen(dest, dest_len);
 		strbuf_addstr(dest, de->d_name);
 		if (stat(src->buf, &buf)) {
-			warning ("failed to stat %s\n", src->buf);
+			warning (_("failed to stat %s\n"), src->buf);
 			continue;
 		}
 		if (S_ISDIR(buf.st_mode)) {
@@ -267,16 +267,16 @@ static void copy_or_link_directory(struct strbuf *src, struct strbuf *dest)
 		}
 
 		if (unlink(dest->buf) && errno != ENOENT)
-			die_errno("failed to unlink '%s'", dest->buf);
+			die_errno(_("failed to unlink '%s'"), dest->buf);
 		if (!option_no_hardlinks) {
 			if (!link(src->buf, dest->buf))
 				continue;
 			if (option_local)
-				die_errno("failed to create link '%s'", dest->buf);
+				die_errno(_("failed to create link '%s'"), dest->buf);
 			option_no_hardlinks = 1;
 		}
 		if (copy_file_with_time(dest->buf, src->buf, 0666))
-			die_errno("failed to copy file to '%s'", dest->buf);
+			die_errno(_("failed to copy file to '%s'"), dest->buf);
 	}
 	closedir(dir);
 }
@@ -305,7 +305,7 @@ static const struct ref *clone_local(const char *src_repo,
 	ret = transport_get_remote_refs(transport);
 	transport_disconnect(transport);
 	if (0 <= option_verbosity)
-		printf("done.\n");
+		printf(_("done.\n"));
 	return ret;
 }
 
@@ -387,11 +387,11 @@ int cmd_clone(int argc, const char **argv, const char *prefix)
 			     builtin_clone_usage, 0);
 
 	if (argc > 2)
-		usage_msg_opt("Too many arguments.",
+		usage_msg_opt(_("Too many arguments."),
 			builtin_clone_usage, builtin_clone_options);
 
 	if (argc == 0)
-		usage_msg_opt("You must specify a repository to clone.",
+		usage_msg_opt(_("You must specify a repository to clone."),
 			builtin_clone_usage, builtin_clone_options);
 
 	if (option_mirror)
@@ -399,7 +399,7 @@ int cmd_clone(int argc, const char **argv, const char *prefix)
 
 	if (option_bare) {
 		if (option_origin)
-			die("--bare and --origin %s options are incompatible.",
+			die(_("--bare and --origin %s options are incompatible."),
 			    option_origin);
 		option_no_checkout = 1;
 	}
@@ -418,7 +418,7 @@ int cmd_clone(int argc, const char **argv, const char *prefix)
 		repo = repo_name;
 	is_local = path && !is_bundle;
 	if (is_local && option_depth)
-		warning("--depth is ignored in local clones; use file:// instead.");
+		warning(_("--depth is ignored in local clones; use file:// instead."));
 
 	if (argc == 2)
 		dir = xstrdup(argv[1]);
@@ -428,8 +428,8 @@ int cmd_clone(int argc, const char **argv, const char *prefix)
 
 	dest_exists = !stat(dir, &buf);
 	if (dest_exists && !is_empty_dir(dir))
-		die("destination path '%s' already exists and is not "
-			"an empty directory.", dir);
+		die(_("destination path '%s' already exists and is not "
+			"an empty directory."), dir);
 
 	strbuf_addf(&reflog_msg, "clone: from %s", repo);
 
@@ -438,7 +438,7 @@ int cmd_clone(int argc, const char **argv, const char *prefix)
 	else {
 		work_tree = getenv("GIT_WORK_TREE");
 		if (work_tree && !stat(work_tree, &buf))
-			die("working tree '%s' already exists.", work_tree);
+			die(_("working tree '%s' already exists."), work_tree);
 	}
 
 	if (option_bare || work_tree)
@@ -451,10 +451,10 @@ int cmd_clone(int argc, const char **argv, const char *prefix)
 	if (!option_bare) {
 		junk_work_tree = work_tree;
 		if (safe_create_leading_directories_const(work_tree) < 0)
-			die_errno("could not create leading directories of '%s'",
+			die_errno(_("could not create leading directories of '%s'"),
 				  work_tree);
 		if (!dest_exists && mkdir(work_tree, 0755))
-			die_errno("could not create work tree dir '%s'.",
+			die_errno(_("could not create work tree dir '%s'."),
 				  work_tree);
 		set_git_work_tree(work_tree);
 	}
@@ -465,7 +465,7 @@ int cmd_clone(int argc, const char **argv, const char *prefix)
 	setenv(CONFIG_ENVIRONMENT, mkpath("%s/config", git_dir), 1);
 
 	if (safe_create_leading_directories_const(git_dir) < 0)
-		die("could not create leading directories of '%s'", git_dir);
+		die(_("could not create leading directories of '%s'"), git_dir);
 	set_git_dir(make_absolute_path(git_dir));
 
 	if (0 <= option_verbosity)
@@ -527,7 +527,7 @@ int cmd_clone(int argc, const char **argv, const char *prefix)
 		transport = transport_get(remote, remote->url[0]);
 
 		if (!transport->get_refs_list || !transport->fetch)
-			die("Don't know how to clone %s", transport->url);
+			die(_("Don't know how to clone %s"), transport->url);
 
 		transport_set_option(transport, TRANS_OPT_KEEP, "yes");
 
@@ -566,8 +566,8 @@ int cmd_clone(int argc, const char **argv, const char *prefix)
 			strbuf_release(&head);
 
 			if (!our_head_points_at) {
-				warning("Remote branch %s not found in "
-					"upstream %s, using HEAD instead",
+				warning(_("Remote branch %s not found in "
+					"upstream %s, using HEAD instead"),
 					option_branch, option_origin);
 				our_head_points_at = remote_head_points_at;
 			}
@@ -576,7 +576,7 @@ int cmd_clone(int argc, const char **argv, const char *prefix)
 			our_head_points_at = remote_head_points_at;
 	}
 	else {
-		warning("You appear to have cloned an empty repository.");
+		warning(_("You appear to have cloned an empty repository."));
 		our_head_points_at = NULL;
 		remote_head_points_at = NULL;
 		remote_head = NULL;
@@ -618,8 +618,8 @@ int cmd_clone(int argc, const char **argv, const char *prefix)
 	} else {
 		/* Nothing to checkout out */
 		if (!option_no_checkout)
-			warning("remote HEAD refers to nonexistent ref, "
-				"unable to checkout.\n");
+			warning(_("remote HEAD refers to nonexistent ref, "
+				"unable to checkout.\n"));
 		option_no_checkout = 1;
 	}
 
@@ -655,7 +655,7 @@ int cmd_clone(int argc, const char **argv, const char *prefix)
 
 		if (write_cache(fd, active_cache, active_nr) ||
 		    commit_locked_index(lock_file))
-			die("unable to write new index file");
+			die(_("unable to write new index file"));
 
 		err |= run_hook(NULL, "post-checkout", sha1_to_hex(null_sha1),
 				sha1_to_hex(our_head_points_at->old_sha1), "1",
-- 
1.7.2.3

^ permalink raw reply related	[flat|nested] 222+ messages in thread

* [PATCH 07/72] gettextize: git-clone "Cloning into" message
  2011-02-19 19:23 [PATCH 00/72] No-op C gettext wrappers Ævar Arnfjörð Bjarmason
                   ` (5 preceding siblings ...)
  2011-02-19 19:23 ` [PATCH 06/72] gettextize: git-clone basic messages Ævar Arnfjörð Bjarmason
@ 2011-02-19 19:23 ` Ævar Arnfjörð Bjarmason
  2011-02-21  9:19   ` Jonathan Nieder
  2011-02-19 19:23 ` [PATCH 08/72] gettextize: git-add basic messages Ævar Arnfjörð Bjarmason
                   ` (65 subsequent siblings)
  72 siblings, 1 reply; 222+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2011-02-19 19:23 UTC (permalink / raw)
  To: git; +Cc: Junio C Hamano, Ævar Arnfjörð Bjarmason

Split up the "Cloning into %s" and "Cloning into bare repository %s"
messages to make them easier to translate.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
---
 builtin/clone.c  |    9 ++++++---
 t/t5601-clone.sh |    2 +-
 2 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/builtin/clone.c b/builtin/clone.c
index f46d09b..dffcf80 100644
--- a/builtin/clone.c
+++ b/builtin/clone.c
@@ -468,9 +468,12 @@ int cmd_clone(int argc, const char **argv, const char *prefix)
 		die(_("could not create leading directories of '%s'"), git_dir);
 	set_git_dir(make_absolute_path(git_dir));
 
-	if (0 <= option_verbosity)
-		printf("Cloning into %s%s...\n",
-		       option_bare ? "bare repository " : "", dir);
+	if (0 <= option_verbosity) {
+		if (option_bare)
+			printf(_("Cloning into bare repository %s\n"), dir);
+		else
+			printf(_("Cloning into %s\n"), dir);
+	}
 	init_db(option_template, INIT_DB_QUIET);
 
 	/*
diff --git a/t/t5601-clone.sh b/t/t5601-clone.sh
index 987e0c8..ecb499d 100755
--- a/t/t5601-clone.sh
+++ b/t/t5601-clone.sh
@@ -31,7 +31,7 @@ test_expect_success 'clone with excess parameters (2)' '
 
 '
 
-test_expect_success 'output from clone' '
+test_expect_success NO_GETTEXT_POISON 'output from clone' '
 	rm -fr dst &&
 	git clone -n "file://$(pwd)/src" dst >output &&
 	test $(grep Clon output | wc -l) = 1
-- 
1.7.2.3

^ permalink raw reply related	[flat|nested] 222+ messages in thread

* [PATCH 08/72] gettextize: git-add basic messages
  2011-02-19 19:23 [PATCH 00/72] No-op C gettext wrappers Ævar Arnfjörð Bjarmason
                   ` (6 preceding siblings ...)
  2011-02-19 19:23 ` [PATCH 07/72] gettextize: git-clone "Cloning into" message Ævar Arnfjörð Bjarmason
@ 2011-02-19 19:23 ` Ævar Arnfjörð Bjarmason
  2011-02-19 19:23 ` [PATCH 09/72] gettextize: git-add "no files added" message Ævar Arnfjörð Bjarmason
                   ` (64 subsequent siblings)
  72 siblings, 0 replies; 222+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2011-02-19 19:23 UTC (permalink / raw)
  To: git; +Cc: Junio C Hamano, Ævar Arnfjörð Bjarmason

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
---
 builtin/add.c |   36 ++++++++++++++++++------------------
 1 files changed, 18 insertions(+), 18 deletions(-)

diff --git a/builtin/add.c b/builtin/add.c
index 42c906e..a9a78f4 100644
--- a/builtin/add.c
+++ b/builtin/add.c
@@ -38,7 +38,7 @@ static void update_callback(struct diff_queue_struct *q,
 		const char *path = p->one->path;
 		switch (p->status) {
 		default:
-			die("unexpected diff status %c", p->status);
+			die(_("unexpected diff status %c"), p->status);
 		case DIFF_STATUS_UNMERGED:
 			/*
 			 * ADD_CACHE_IGNORE_REMOVAL is unset if "git
@@ -64,7 +64,7 @@ static void update_callback(struct diff_queue_struct *q,
 		case DIFF_STATUS_TYPE_CHANGED:
 			if (add_file_to_index(&the_index, path, data->flags)) {
 				if (!(data->flags & ADD_CACHE_IGNORE_ERRORS))
-					die("updating files failed");
+					die(_("updating files failed"));
 				data->add_errors++;
 			}
 			break;
@@ -172,7 +172,7 @@ static void treat_gitlinks(const char **pathspec)
 					/* strip trailing slash */
 					pathspec[j] = xstrndup(ce->name, len);
 				else
-					die ("Path '%s' is in submodule '%.*s'",
+					die (_("Path '%s' is in submodule '%.*s'"),
 						pathspec[j], len, ce->name);
 			}
 		}
@@ -191,7 +191,7 @@ static void refresh(int verbose, const char **pathspec)
 		      pathspec, seen, "Unstaged changes after refreshing the index:");
 	for (i = 0; i < specs; i++) {
 		if (!seen[i])
-			die("pathspec '%s' did not match any files", pathspec[i]);
+			die(_("pathspec '%s' did not match any files"), pathspec[i]);
 	}
         free(seen);
 }
@@ -205,7 +205,7 @@ static const char **validate_pathspec(int argc, const char **argv, const char *p
 		for (p = pathspec; *p; p++) {
 			if (has_symlink_leading_path(*p, strlen(*p))) {
 				int len = prefix ? strlen(prefix) : 0;
-				die("'%s' is beyond a symbolic link", *p + len);
+				die(_("'%s' is beyond a symbolic link"), *p + len);
 			}
 		}
 	}
@@ -272,7 +272,7 @@ static int edit_patch(int argc, const char **argv, const char *prefix)
 	git_config(git_diff_basic_config, NULL); /* no "diff" UI options */
 
 	if (read_cache() < 0)
-		die ("Could not read the index");
+		die (_("Could not read the index"));
 
 	init_revisions(&rev, prefix);
 	rev.diffopt.context = 7;
@@ -281,24 +281,24 @@ static int edit_patch(int argc, const char **argv, const char *prefix)
 	rev.diffopt.output_format = DIFF_FORMAT_PATCH;
 	out = open(file, O_CREAT | O_WRONLY, 0644);
 	if (out < 0)
-		die ("Could not open '%s' for writing.", file);
+		die (_("Could not open '%s' for writing."), file);
 	rev.diffopt.file = xfdopen(out, "w");
 	rev.diffopt.close_file = 1;
 	if (run_diff_files(&rev, 0))
-		die ("Could not write patch");
+		die (_("Could not write patch"));
 
 	launch_editor(file, NULL, NULL);
 
 	if (stat(file, &st))
-		die_errno("Could not stat '%s'", file);
+		die_errno(_("Could not stat '%s'"), file);
 	if (!st.st_size)
-		die("Empty patch. Aborted.");
+		die(_("Empty patch. Aborted."));
 
 	memset(&child, 0, sizeof(child));
 	child.git_cmd = 1;
 	child.argv = apply_argv;
 	if (run_command(&child))
-		die ("Could not apply '%s'", file);
+		die (_("Could not apply '%s'"), file);
 
 	unlink(file);
 	return 0;
@@ -354,7 +354,7 @@ static int add_files(struct dir_struct *dir, int flags)
 	for (i = 0; i < dir->nr; i++)
 		if (add_file_to_cache(dir->entries[i]->name, flags)) {
 			if (!ignore_add_errors)
-				die("adding files failed");
+				die(_("adding files failed"));
 			exit_status = 1;
 		}
 	return exit_status;
@@ -386,9 +386,9 @@ int cmd_add(int argc, const char **argv, const char *prefix)
 	argv++;
 
 	if (addremove && take_worktree_changes)
-		die("-A and -u are mutually incompatible");
+		die(_("-A and -u are mutually incompatible"));
 	if (!show_only && ignore_missing)
-		die("Option --ignore-missing can only be used together with --dry-run");
+		die(_("Option --ignore-missing can only be used together with --dry-run"));
 	if ((addremove || take_worktree_changes) && !argc) {
 		static const char *here[2] = { ".", NULL };
 		argc = 1;
@@ -408,14 +408,14 @@ int cmd_add(int argc, const char **argv, const char *prefix)
 		  ? ADD_CACHE_IGNORE_REMOVAL : 0));
 
 	if (require_pathspec && argc == 0) {
-		fprintf(stderr, "Nothing specified, nothing added.\n");
-		fprintf(stderr, "Maybe you wanted to say 'git add .'?\n");
+		fprintf(stderr, _("Nothing specified, nothing added.\n"));
+		fprintf(stderr, _("Maybe you wanted to say 'git add .'?\n"));
 		return 0;
 	}
 	pathspec = validate_pathspec(argc, argv, prefix);
 
 	if (read_cache() < 0)
-		die("index file corrupt");
+		die(_("index file corrupt"));
 	treat_gitlinks(pathspec);
 
 	if (add_new_files) {
@@ -467,7 +467,7 @@ int cmd_add(int argc, const char **argv, const char *prefix)
 	if (active_cache_changed) {
 		if (write_cache(newfd, active_cache, active_nr) ||
 		    commit_locked_index(&lock_file))
-			die("Unable to write new index file");
+			die(_("Unable to write new index file"));
 	}
 
 	return exit_status;
-- 
1.7.2.3

^ permalink raw reply related	[flat|nested] 222+ messages in thread

* [PATCH 09/72] gettextize: git-add "no files added" message
  2011-02-19 19:23 [PATCH 00/72] No-op C gettext wrappers Ævar Arnfjörð Bjarmason
                   ` (7 preceding siblings ...)
  2011-02-19 19:23 ` [PATCH 08/72] gettextize: git-add basic messages Ævar Arnfjörð Bjarmason
@ 2011-02-19 19:23 ` Ævar Arnfjörð Bjarmason
  2011-02-19 19:23 ` [PATCH 10/72] gettextize: git-add "Use -f if you really want" message Ævar Arnfjörð Bjarmason
                   ` (63 subsequent siblings)
  72 siblings, 0 replies; 222+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2011-02-19 19:23 UTC (permalink / raw)
  To: git; +Cc: Junio C Hamano, Ævar Arnfjörð Bjarmason

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
---
 builtin/add.c  |    2 +-
 t/t3700-add.sh |    5 ++++-
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/builtin/add.c b/builtin/add.c
index a9a78f4..df56429 100644
--- a/builtin/add.c
+++ b/builtin/add.c
@@ -348,7 +348,7 @@ static int add_files(struct dir_struct *dir, int flags)
 		for (i = 0; i < dir->ignored_nr; i++)
 			fprintf(stderr, "%s\n", dir->ignored[i]->name);
 		fprintf(stderr, "Use -f if you really want to add them.\n");
-		die("no files added");
+		die(_("no files added"));
 	}
 
 	for (i = 0; i < dir->nr; i++)
diff --git a/t/t3700-add.sh b/t/t3700-add.sh
index ec71083..d4fc563 100755
--- a/t/t3700-add.sh
+++ b/t/t3700-add.sh
@@ -283,7 +283,10 @@ add 'track-this'
 EOF
 
 test_expect_success 'git add --dry-run --ignore-missing of non-existing file' '
-	test_must_fail git add --dry-run --ignore-missing track-this ignored-file >actual.out 2>actual.err &&
+	test_must_fail git add --dry-run --ignore-missing track-this ignored-file >actual.out 2>actual.err
+'
+
+test_expect_success NO_GETTEXT_POISON 'git add --dry-run --ignore-missing of non-existing file output' '
 	test_cmp expect.out actual.out &&
 	test_cmp expect.err actual.err
 '
-- 
1.7.2.3

^ permalink raw reply related	[flat|nested] 222+ messages in thread

* [PATCH 10/72] gettextize: git-add "Use -f if you really want" message
  2011-02-19 19:23 [PATCH 00/72] No-op C gettext wrappers Ævar Arnfjörð Bjarmason
                   ` (8 preceding siblings ...)
  2011-02-19 19:23 ` [PATCH 09/72] gettextize: git-add "no files added" message Ævar Arnfjörð Bjarmason
@ 2011-02-19 19:23 ` Ævar Arnfjörð Bjarmason
  2011-02-19 19:23 ` [PATCH 11/72] gettextize: git-add "pathspec [...] did not match" message Ævar Arnfjörð Bjarmason
                   ` (62 subsequent siblings)
  72 siblings, 0 replies; 222+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2011-02-19 19:23 UTC (permalink / raw)
  To: git; +Cc: Junio C Hamano, Ævar Arnfjörð Bjarmason

Gettextize the "Use -f if you really want to add them.\n"
message. Tests in t2204-add-ignored.sh and t3700-add.sh explicitly
checked for this message. Split the tests that did so up and skip
portion that calls grep on this message under
GETTEXT_POISON=YesPlease.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
---
 builtin/add.c          |    2 +-
 t/t2204-add-ignored.sh |   37 +++++++++++++++++++++++++------------
 2 files changed, 26 insertions(+), 13 deletions(-)

diff --git a/builtin/add.c b/builtin/add.c
index df56429..fe4ac49 100644
--- a/builtin/add.c
+++ b/builtin/add.c
@@ -347,7 +347,7 @@ static int add_files(struct dir_struct *dir, int flags)
 		fprintf(stderr, ignore_error);
 		for (i = 0; i < dir->ignored_nr; i++)
 			fprintf(stderr, "%s\n", dir->ignored[i]->name);
-		fprintf(stderr, "Use -f if you really want to add them.\n");
+		fprintf(stderr, _("Use -f if you really want to add them.\n"));
 		die(_("no files added"));
 	}
 
diff --git a/t/t2204-add-ignored.sh b/t/t2204-add-ignored.sh
index 24afdab..be66e2d 100755
--- a/t/t2204-add-ignored.sh
+++ b/t/t2204-add-ignored.sh
@@ -31,18 +31,21 @@ do
 		rm -f .git/index &&
 		test_must_fail git add "$i" 2>err &&
 		git ls-files "$i" >out &&
-		! test -s out &&
-		grep -e "Use -f if" err &&
-		cat err
+		! test -s out
+	'
+
+	test_expect_success NO_GETTEXT_POISON "complaints for ignored $i output" '
+		grep -e "Use -f if" err
 	'
 
 	test_expect_success "complaints for ignored $i with unignored file" '
 		rm -f .git/index &&
 		test_must_fail git add "$i" file 2>err &&
 		git ls-files "$i" >out &&
-		! test -s out &&
-		grep -e "Use -f if" err &&
-		cat err
+		! test -s out
+	'
+	test_expect_success NO_GETTEXT_POISON "complaints for ignored $i with unignored file output" '
+		grep -e "Use -f if" err
 	'
 done
 
@@ -54,9 +57,14 @@ do
 			cd dir &&
 			test_must_fail git add "$i" 2>err &&
 			git ls-files "$i" >out &&
-			! test -s out &&
-			grep -e "Use -f if" err &&
-			cat err
+			! test -s out
+		)
+	'
+
+	test_expect_success NO_GETTEXT_POISON "complaints for ignored $i in dir output" '
+		(
+			cd dir &&
+			grep -e "Use -f if" err
 		)
 	'
 done
@@ -69,9 +77,14 @@ do
 			cd sub &&
 			test_must_fail git add "$i" 2>err &&
 			git ls-files "$i" >out &&
-			! test -s out &&
-			grep -e "Use -f if" err &&
-			cat err
+			! test -s out
+		)
+	'
+
+	test_expect_success NO_GETTEXT_POISON "complaints for ignored $i in sub output" '
+		(
+			cd sub &&
+			grep -e "Use -f if" err
 		)
 	'
 done
-- 
1.7.2.3

^ permalink raw reply related	[flat|nested] 222+ messages in thread

* [PATCH 11/72] gettextize: git-add "pathspec [...] did not match" message
  2011-02-19 19:23 [PATCH 00/72] No-op C gettext wrappers Ævar Arnfjörð Bjarmason
                   ` (9 preceding siblings ...)
  2011-02-19 19:23 ` [PATCH 10/72] gettextize: git-add "Use -f if you really want" message Ævar Arnfjörð Bjarmason
@ 2011-02-19 19:23 ` Ævar Arnfjörð Bjarmason
  2011-02-19 19:23 ` [PATCH 12/72] gettextize: git-add "remove '%s'" message Ævar Arnfjörð Bjarmason
                   ` (61 subsequent siblings)
  72 siblings, 0 replies; 222+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2011-02-19 19:23 UTC (permalink / raw)
  To: git; +Cc: Junio C Hamano, Ævar Arnfjörð Bjarmason

Gettextize the "pathspec '%s' did not match any files" message. A test
in t3700-add.sh explicitly checked for this message. Change it to skip
under GETTEXT_POISON=YesPlease.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
---
 builtin/add.c  |    2 +-
 t/t3700-add.sh |    6 +++++-
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/builtin/add.c b/builtin/add.c
index fe4ac49..b3640c5 100644
--- a/builtin/add.c
+++ b/builtin/add.c
@@ -451,7 +451,7 @@ int cmd_add(int argc, const char **argv, const char *prefix)
 					if (excluded(&dir, pathspec[i], &dtype))
 						dir_add_ignored(&dir, pathspec[i], strlen(pathspec[i]));
 				} else
-					die("pathspec '%s' did not match any files",
+					die(_("pathspec '%s' did not match any files"),
 					    pathspec[i]);
 			}
 		}
diff --git a/t/t3700-add.sh b/t/t3700-add.sh
index d4fc563..9507191 100755
--- a/t/t3700-add.sh
+++ b/t/t3700-add.sh
@@ -269,7 +269,11 @@ test_expect_success 'git add --dry-run of existing changed file' "
 test_expect_success 'git add --dry-run of non-existing file' "
 	echo ignored-file >>.gitignore &&
 	test_must_fail git add --dry-run track-this ignored-file >actual 2>&1 &&
-	echo \"fatal: pathspec 'ignored-file' did not match any files\" | test_cmp - actual
+	echo \"fatal: pathspec 'ignored-file' did not match any files\" >expect
+"
+
+test_expect_success NO_GETTEXT_POISON 'git add --dry-run of an existing file output' "
+	test_cmp expect actual
 "
 
 cat >expect.err <<\EOF
-- 
1.7.2.3

^ permalink raw reply related	[flat|nested] 222+ messages in thread

* [PATCH 12/72] gettextize: git-add "remove '%s'" message
  2011-02-19 19:23 [PATCH 00/72] No-op C gettext wrappers Ævar Arnfjörð Bjarmason
                   ` (10 preceding siblings ...)
  2011-02-19 19:23 ` [PATCH 11/72] gettextize: git-add "pathspec [...] did not match" message Ævar Arnfjörð Bjarmason
@ 2011-02-19 19:23 ` Ævar Arnfjörð Bjarmason
  2011-02-19 19:23 ` [PATCH 13/72] gettextize: git-add refresh_index message Ævar Arnfjörð Bjarmason
                   ` (60 subsequent siblings)
  72 siblings, 0 replies; 222+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2011-02-19 19:23 UTC (permalink / raw)
  To: git; +Cc: Junio C Hamano, Ævar Arnfjörð Bjarmason

Gettextize the "remove '%s'\n" message. A test in t2200-add-update.sh
explicitly checked for this message. Change it to skip under
GETTEXT_POISON=YesPlease.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
---
 builtin/add.c         |    2 +-
 t/t2200-add-update.sh |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/builtin/add.c b/builtin/add.c
index b3640c5..e399d19 100644
--- a/builtin/add.c
+++ b/builtin/add.c
@@ -74,7 +74,7 @@ static void update_callback(struct diff_queue_struct *q,
 			if (!(data->flags & ADD_CACHE_PRETEND))
 				remove_file_from_index(&the_index, path);
 			if (data->flags & (ADD_CACHE_PRETEND|ADD_CACHE_VERBOSE))
-				printf("remove '%s'\n", path);
+				printf(_("remove '%s'\n"), path);
 			break;
 		}
 	}
diff --git a/t/t2200-add-update.sh b/t/t2200-add-update.sh
index 0692427..64182d9 100755
--- a/t/t2200-add-update.sh
+++ b/t/t2200-add-update.sh
@@ -111,7 +111,7 @@ test_expect_success 'touch and then add explicitly' '
 
 '
 
-test_expect_success 'add -n -u should not add but just report' '
+test_expect_success NO_GETTEXT_POISON 'add -n -u should not add but just report' '
 
 	(
 		echo "add '\''check'\''" &&
-- 
1.7.2.3

^ permalink raw reply related	[flat|nested] 222+ messages in thread

* [PATCH 13/72] gettextize: git-add refresh_index message
  2011-02-19 19:23 [PATCH 00/72] No-op C gettext wrappers Ævar Arnfjörð Bjarmason
                   ` (11 preceding siblings ...)
  2011-02-19 19:23 ` [PATCH 12/72] gettextize: git-add "remove '%s'" message Ævar Arnfjörð Bjarmason
@ 2011-02-19 19:23 ` Ævar Arnfjörð Bjarmason
  2011-02-19 19:23 ` [PATCH 14/72] gettextize: git-branch basic messages Ævar Arnfjörð Bjarmason
                   ` (59 subsequent siblings)
  72 siblings, 0 replies; 222+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2011-02-19 19:23 UTC (permalink / raw)
  To: git; +Cc: Junio C Hamano, Ævar Arnfjörð Bjarmason

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
---
 builtin/add.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/builtin/add.c b/builtin/add.c
index e399d19..3e75460 100644
--- a/builtin/add.c
+++ b/builtin/add.c
@@ -188,7 +188,7 @@ static void refresh(int verbose, const char **pathspec)
 		/* nothing */;
 	seen = xcalloc(specs, 1);
 	refresh_index(&the_index, verbose ? REFRESH_IN_PORCELAIN : REFRESH_QUIET,
-		      pathspec, seen, "Unstaged changes after refreshing the index:");
+		      pathspec, seen, _("Unstaged changes after refreshing the index:"));
 	for (i = 0; i < specs; i++) {
 		if (!seen[i])
 			die(_("pathspec '%s' did not match any files"), pathspec[i]);
-- 
1.7.2.3

^ permalink raw reply related	[flat|nested] 222+ messages in thread

* [PATCH 14/72] gettextize: git-branch basic messages
  2011-02-19 19:23 [PATCH 00/72] No-op C gettext wrappers Ævar Arnfjörð Bjarmason
                   ` (12 preceding siblings ...)
  2011-02-19 19:23 ` [PATCH 13/72] gettextize: git-add refresh_index message Ævar Arnfjörð Bjarmason
@ 2011-02-19 19:23 ` Ævar Arnfjörð Bjarmason
  2011-02-19 19:23 ` [PATCH 15/72] gettextize: git-branch "remote branch '%s' not found" message Ævar Arnfjörð Bjarmason
                   ` (58 subsequent siblings)
  72 siblings, 0 replies; 222+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2011-02-19 19:23 UTC (permalink / raw)
  To: git; +Cc: Junio C Hamano, Ævar Arnfjörð Bjarmason

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
---
 builtin/branch.c |   56 +++++++++++++++++++++++++++---------------------------
 1 files changed, 28 insertions(+), 28 deletions(-)

diff --git a/builtin/branch.c b/builtin/branch.c
index 9e546e4..6695db4 100644
--- a/builtin/branch.c
+++ b/builtin/branch.c
@@ -133,12 +133,12 @@ static int branch_merged(int kind, const char *name,
 	if ((head_rev != reference_rev) &&
 	    in_merge_bases(rev, &head_rev, 1) != merged) {
 		if (merged)
-			warning("deleting branch '%s' that has been merged to\n"
-				"         '%s', but it is not yet merged to HEAD.",
+			warning(_("deleting branch '%s' that has been merged to\n"
+				"         '%s', but it is not yet merged to HEAD."),
 				name, reference_name);
 		else
-			warning("not deleting branch '%s' that is not yet merged to\n"
-				"         '%s', even though it is merged to HEAD.",
+			warning(_("not deleting branch '%s' that is not yet merged to\n"
+				"         '%s', even though it is merged to HEAD."),
 				name, reference_name);
 	}
 	return merged;
@@ -165,19 +165,19 @@ static int delete_branches(int argc, const char **argv, int force, int kinds)
 		remote = "";
 		break;
 	default:
-		die("cannot use -a with -d");
+		die(_("cannot use -a with -d"));
 	}
 
 	if (!force) {
 		head_rev = lookup_commit_reference(head_sha1);
 		if (!head_rev)
-			die("Couldn't look up commit object for HEAD");
+			die(_("Couldn't look up commit object for HEAD"));
 	}
 	for (i = 0; i < argc; i++, strbuf_release(&bname)) {
 		strbuf_branchname(&bname, argv[i]);
 		if (kinds == REF_LOCAL_BRANCH && !strcmp(head, bname.buf)) {
-			error("Cannot delete the branch '%s' "
-			      "which you are currently on.", bname.buf);
+			error(_("Cannot delete the branch '%s' "
+			      "which you are currently on."), bname.buf);
 			ret = 1;
 			continue;
 		}
@@ -186,7 +186,7 @@ static int delete_branches(int argc, const char **argv, int force, int kinds)
 
 		name = xstrdup(mkpath(fmt, bname.buf));
 		if (!resolve_ref(name, sha1, 1, NULL)) {
-			error("%sbranch '%s' not found.",
+			error(_("%sbranch '%s' not found."),
 					remote, bname.buf);
 			ret = 1;
 			continue;
@@ -194,21 +194,21 @@ static int delete_branches(int argc, const char **argv, int force, int kinds)
 
 		rev = lookup_commit_reference(sha1);
 		if (!rev) {
-			error("Couldn't look up commit object for '%s'", name);
+			error(_("Couldn't look up commit object for '%s'"), name);
 			ret = 1;
 			continue;
 		}
 
 		if (!force && !branch_merged(kinds, bname.buf, rev, head_rev)) {
-			error("The branch '%s' is not fully merged.\n"
+			error(_("The branch '%s' is not fully merged.\n"
 			      "If you are sure you want to delete it, "
-			      "run 'git branch -D %s'.", bname.buf, bname.buf);
+			      "run 'git branch -D %s'."), bname.buf, bname.buf);
 			ret = 1;
 			continue;
 		}
 
 		if (delete_ref(name, sha1, 0)) {
-			error("Error deleting %sbranch '%s'", remote,
+			error(_("Error deleting %sbranch '%s'"), remote,
 			      bname.buf);
 			ret = 1;
 		} else {
@@ -218,7 +218,7 @@ static int delete_branches(int argc, const char **argv, int force, int kinds)
 			       find_unique_abbrev(sha1, DEFAULT_ABBREV));
 			strbuf_addf(&buf, "branch.%s", bname.buf);
 			if (git_config_rename_section(buf.buf, NULL) < 0)
-				warning("Update of config-file failed");
+				warning(_("Update of config-file failed"));
 			strbuf_release(&buf);
 		}
 	}
@@ -300,7 +300,7 @@ static int append_ref(const char *refname, const unsigned char *sha1, int flags,
 	if (ref_list->verbose || ref_list->with_commit || merge_filter != NO_FILTER) {
 		commit = lookup_commit_reference_gently(sha1, 1);
 		if (!commit) {
-			cb->ret = error("branch '%s' does not point at a commit", refname);
+			cb->ret = error(_("branch '%s' does not point at a commit"), refname);
 			return 0;
 		}
 
@@ -535,7 +535,7 @@ static int print_ref_list(int kinds, int detached, int verbose, int abbrev, stru
 	free_ref_list(&ref_list);
 
 	if (cb.ret)
-		error("some refs could not be read");
+		error(_("some refs could not be read"));
 
 	return cb.ret;
 }
@@ -548,7 +548,7 @@ static void rename_branch(const char *oldname, const char *newname, int force)
 	int recovery = 0;
 
 	if (!oldname)
-		die("cannot rename the current branch while not on any.");
+		die(_("cannot rename the current branch while not on any."));
 
 	if (strbuf_check_branch_ref(&oldref, oldname)) {
 		/*
@@ -558,35 +558,35 @@ static void rename_branch(const char *oldname, const char *newname, int force)
 		if (resolve_ref(oldref.buf, sha1, 1, NULL))
 			recovery = 1;
 		else
-			die("Invalid branch name: '%s'", oldname);
+			die(_("Invalid branch name: '%s'"), oldname);
 	}
 
 	if (strbuf_check_branch_ref(&newref, newname))
-		die("Invalid branch name: '%s'", newname);
+		die(_("Invalid branch name: '%s'"), newname);
 
 	if (resolve_ref(newref.buf, sha1, 1, NULL) && !force)
-		die("A branch named '%s' already exists.", newref.buf + 11);
+		die(_("A branch named '%s' already exists."), newref.buf + 11);
 
 	strbuf_addf(&logmsg, "Branch: renamed %s to %s",
 		 oldref.buf, newref.buf);
 
 	if (rename_ref(oldref.buf, newref.buf, logmsg.buf))
-		die("Branch rename failed");
+		die(_("Branch rename failed"));
 	strbuf_release(&logmsg);
 
 	if (recovery)
-		warning("Renamed a misnamed branch '%s' away", oldref.buf + 11);
+		warning(_("Renamed a misnamed branch '%s' away"), oldref.buf + 11);
 
 	/* no need to pass logmsg here as HEAD didn't really move */
 	if (!strcmp(oldname, head) && create_symref("HEAD", newref.buf, NULL))
-		die("Branch renamed to %s, but HEAD is not updated!", newname);
+		die(_("Branch renamed to %s, but HEAD is not updated!"), newname);
 
 	strbuf_addf(&oldsection, "branch.%s", oldref.buf + 11);
 	strbuf_release(&oldref);
 	strbuf_addf(&newsection, "branch.%s", newref.buf + 11);
 	strbuf_release(&newref);
 	if (git_config_rename_section(oldsection.buf, newsection.buf) < 0)
-		die("Branch is renamed, but update of config-file failed");
+		die(_("Branch is renamed, but update of config-file failed"));
 	strbuf_release(&oldsection);
 	strbuf_release(&newsection);
 }
@@ -601,7 +601,7 @@ static int opt_parse_merge_filter(const struct option *opt, const char *arg, int
 	if (!arg)
 		arg = "HEAD";
 	if (get_sha1(arg, merge_filter_ref))
-		die("malformed object name %s", arg);
+		die(_("malformed object name %s"), arg);
 	return 0;
 }
 
@@ -675,13 +675,13 @@ int cmd_branch(int argc, const char **argv, const char *prefix)
 
 	head = resolve_ref("HEAD", head_sha1, 0, NULL);
 	if (!head)
-		die("Failed to resolve HEAD as a valid ref.");
+		die(_("Failed to resolve HEAD as a valid ref."));
 	head = xstrdup(head);
 	if (!strcmp(head, "HEAD")) {
 		detached = 1;
 	} else {
 		if (prefixcmp(head, "refs/heads/"))
-			die("HEAD not found below refs/heads!");
+			die(_("HEAD not found below refs/heads!"));
 		head += 11;
 	}
 	hashcpy(merge_filter_ref, head_sha1);
@@ -701,7 +701,7 @@ int cmd_branch(int argc, const char **argv, const char *prefix)
 		rename_branch(argv[0], argv[1], rename > 1);
 	else if (argc <= 2) {
 		if (kinds != REF_LOCAL_BRANCH)
-			die("-a and -r options to 'git branch' do not make sense with a branch name");
+			die(_("-a and -r options to 'git branch' do not make sense with a branch name"));
 		create_branch(head, argv[0], (argc == 2) ? argv[1] : head,
 			      force_create, reflog, track);
 	} else
-- 
1.7.2.3

^ permalink raw reply related	[flat|nested] 222+ messages in thread

* [PATCH 15/72] gettextize: git-branch "remote branch '%s' not found" message
  2011-02-19 19:23 [PATCH 00/72] No-op C gettext wrappers Ævar Arnfjörð Bjarmason
                   ` (13 preceding siblings ...)
  2011-02-19 19:23 ` [PATCH 14/72] gettextize: git-branch basic messages Ævar Arnfjörð Bjarmason
@ 2011-02-19 19:23 ` Ævar Arnfjörð Bjarmason
  2011-02-19 19:23 ` [PATCH 16/72] gettextize: git-branch "Deleted branch [...]" message Ævar Arnfjörð Bjarmason
                   ` (57 subsequent siblings)
  72 siblings, 0 replies; 222+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2011-02-19 19:23 UTC (permalink / raw)
  To: git; +Cc: Junio C Hamano, Ævar Arnfjörð Bjarmason

This could be done better by splitting it up, but it would change too
much code, which I'm trying to avoid at this point. Instead add a
TRANSLATORS comment to explain what "remote " does.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
---
 builtin/branch.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/builtin/branch.c b/builtin/branch.c
index 6695db4..e9d8a5a 100644
--- a/builtin/branch.c
+++ b/builtin/branch.c
@@ -157,7 +157,8 @@ static int delete_branches(int argc, const char **argv, int force, int kinds)
 	switch (kinds) {
 	case REF_REMOTE_BRANCH:
 		fmt = "refs/remotes/%s";
-		remote = "remote ";
+		/* TRANSLATORS: This is "remote " in "remote branch '%s' not found" */
+		remote = _("remote ");
 		force = 1;
 		break;
 	case REF_LOCAL_BRANCH:
-- 
1.7.2.3

^ permalink raw reply related	[flat|nested] 222+ messages in thread

* [PATCH 16/72] gettextize: git-branch "Deleted branch [...]" message
  2011-02-19 19:23 [PATCH 00/72] No-op C gettext wrappers Ævar Arnfjörð Bjarmason
                   ` (14 preceding siblings ...)
  2011-02-19 19:23 ` [PATCH 15/72] gettextize: git-branch "remote branch '%s' not found" message Ævar Arnfjörð Bjarmason
@ 2011-02-19 19:23 ` Ævar Arnfjörð Bjarmason
  2011-02-19 19:24 ` [PATCH 17/72] gettextize: git-branch "git branch -v" messages Ævar Arnfjörð Bjarmason
                   ` (56 subsequent siblings)
  72 siblings, 0 replies; 222+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2011-02-19 19:23 UTC (permalink / raw)
  To: git; +Cc: Junio C Hamano, Ævar Arnfjörð Bjarmason

Gettextize the "Deleted %sbranch %s (was %s).\n" messages. test in
t3200-branch.sh explicitly checked for this message. Change it to skip
under GETTEXT_POISON=YesPlease.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
---
 builtin/branch.c  |    2 +-
 t/t3200-branch.sh |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/builtin/branch.c b/builtin/branch.c
index e9d8a5a..d276681 100644
--- a/builtin/branch.c
+++ b/builtin/branch.c
@@ -214,7 +214,7 @@ static int delete_branches(int argc, const char **argv, int force, int kinds)
 			ret = 1;
 		} else {
 			struct strbuf buf = STRBUF_INIT;
-			printf("Deleted %sbranch %s (was %s).\n", remote,
+			printf(_("Deleted %sbranch %s (was %s).\n"), remote,
 			       bname.buf,
 			       find_unique_abbrev(sha1, DEFAULT_ABBREV));
 			strbuf_addf(&buf, "branch.%s", bname.buf);
diff --git a/t/t3200-branch.sh b/t/t3200-branch.sh
index f308235..04997cf 100755
--- a/t/t3200-branch.sh
+++ b/t/t3200-branch.sh
@@ -203,7 +203,7 @@ test_expect_success 'test deleting branch deletes branch config' \
      test -z "$(git config branch.my7.remote)" &&
      test -z "$(git config branch.my7.merge)"'
 
-test_expect_success 'test deleting branch without config' \
+test_expect_success NO_GETTEXT_POISON 'test deleting branch without config' \
     'git branch my7 s &&
      sha1=$(git rev-parse my7 | cut -c 1-7) &&
      test "$(git branch -d my7 2>&1)" = "Deleted branch my7 (was $sha1)."'
-- 
1.7.2.3

^ permalink raw reply related	[flat|nested] 222+ messages in thread

* [PATCH 17/72] gettextize: git-branch "git branch -v" messages
  2011-02-19 19:23 [PATCH 00/72] No-op C gettext wrappers Ævar Arnfjörð Bjarmason
                   ` (15 preceding siblings ...)
  2011-02-19 19:23 ` [PATCH 16/72] gettextize: git-branch "Deleted branch [...]" message Ævar Arnfjörð Bjarmason
@ 2011-02-19 19:24 ` Ævar Arnfjörð Bjarmason
  2011-02-19 19:24 ` [PATCH 18/72] gettextize: git-branch "(no branch)" message Ævar Arnfjörð Bjarmason
                   ` (55 subsequent siblings)
  72 siblings, 0 replies; 222+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2011-02-19 19:24 UTC (permalink / raw)
  To: git; +Cc: Junio C Hamano, Ævar Arnfjörð Bjarmason

Make the "git branch -v" messages translatable, e.g.:

    5054b57 [ahead 8] branch error fixup

This is possibly a plumbing message.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
---
 builtin/branch.c         |    6 +++---
 t/t6040-tracking-info.sh |    2 +-
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/builtin/branch.c b/builtin/branch.c
index d276681..4c1a256 100644
--- a/builtin/branch.c
+++ b/builtin/branch.c
@@ -373,11 +373,11 @@ static void fill_tracking_info(struct strbuf *stat, const char *branch_name,
 		strbuf_addf(stat, "%s: ",
 			shorten_unambiguous_ref(branch->merge[0]->dst, 0));
 	if (!ours)
-		strbuf_addf(stat, "behind %d] ", theirs);
+		strbuf_addf(stat, _("behind %d] "), theirs);
 	else if (!theirs)
-		strbuf_addf(stat, "ahead %d] ", ours);
+		strbuf_addf(stat, _("ahead %d] "), ours);
 	else
-		strbuf_addf(stat, "ahead %d, behind %d] ", ours, theirs);
+		strbuf_addf(stat, _("ahead %d, behind %d] "), ours, theirs);
 }
 
 static int matches_merge_filter(struct commit *commit)
diff --git a/t/t6040-tracking-info.sh b/t/t6040-tracking-info.sh
index 1e0447f..d508a19 100755
--- a/t/t6040-tracking-info.sh
+++ b/t/t6040-tracking-info.sh
@@ -42,7 +42,7 @@ b3 behind 1
 b4 ahead 2
 EOF
 
-test_expect_success 'branch -v' '
+test_expect_success NO_GETTEXT_POISON 'branch -v' '
 	(
 		cd test &&
 		git branch -v
-- 
1.7.2.3

^ permalink raw reply related	[flat|nested] 222+ messages in thread

* [PATCH 18/72] gettextize: git-branch "(no branch)" message
  2011-02-19 19:23 [PATCH 00/72] No-op C gettext wrappers Ævar Arnfjörð Bjarmason
                   ` (16 preceding siblings ...)
  2011-02-19 19:24 ` [PATCH 17/72] gettextize: git-branch "git branch -v" messages Ævar Arnfjörð Bjarmason
@ 2011-02-19 19:24 ` Ævar Arnfjörð Bjarmason
  2011-02-19 19:24 ` [PATCH 19/72] gettextize: git-checkout basic messages Ævar Arnfjörð Bjarmason
                   ` (54 subsequent siblings)
  72 siblings, 0 replies; 222+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2011-02-19 19:24 UTC (permalink / raw)
  To: git; +Cc: Junio C Hamano, Ævar Arnfjörð Bjarmason

Gettextize the "(no branch)" message that's shown by "git branch" when
you're in a detached HEAD.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
---
 builtin/branch.c         |    2 +-
 t/t3203-branch-output.sh |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/builtin/branch.c b/builtin/branch.c
index 4c1a256..244589e 100644
--- a/builtin/branch.c
+++ b/builtin/branch.c
@@ -476,7 +476,7 @@ static void show_detached(struct ref_list *ref_list)
 
 	if (head_commit && is_descendant_of(head_commit, ref_list->with_commit)) {
 		struct ref_item item;
-		item.name = xstrdup("(no branch)");
+		item.name = xstrdup(_("(no branch)"));
 		item.len = strlen(item.name);
 		item.kind = REF_LOCAL_BRANCH;
 		item.dest = NULL;
diff --git a/t/t3203-branch-output.sh b/t/t3203-branch-output.sh
index 6028748..cf04bb2 100755
--- a/t/t3203-branch-output.sh
+++ b/t/t3203-branch-output.sh
@@ -72,7 +72,7 @@ cat >expect <<'EOF'
   branch-two
   master
 EOF
-test_expect_success 'git branch shows detached HEAD properly' '
+test_expect_success NO_GETTEXT_POISON 'git branch shows detached HEAD properly' '
 	git checkout HEAD^0 &&
 	git branch >actual &&
 	test_cmp expect actual
-- 
1.7.2.3

^ permalink raw reply related	[flat|nested] 222+ messages in thread

* [PATCH 19/72] gettextize: git-checkout basic messages
  2011-02-19 19:23 [PATCH 00/72] No-op C gettext wrappers Ævar Arnfjörð Bjarmason
                   ` (17 preceding siblings ...)
  2011-02-19 19:24 ` [PATCH 18/72] gettextize: git-branch "(no branch)" message Ævar Arnfjörð Bjarmason
@ 2011-02-19 19:24 ` Ævar Arnfjörð Bjarmason
  2011-02-19 19:24 ` [PATCH 20/72] gettextize: git-checkout: our/their version message Ævar Arnfjörð Bjarmason
                   ` (53 subsequent siblings)
  72 siblings, 0 replies; 222+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2011-02-19 19:24 UTC (permalink / raw)
  To: git; +Cc: Junio C Hamano, Ævar Arnfjörð Bjarmason

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
---
 builtin/checkout.c |   68 ++++++++++++++++++++++++++--------------------------
 1 files changed, 34 insertions(+), 34 deletions(-)

diff --git a/builtin/checkout.c b/builtin/checkout.c
index cd7f56e..b5060ab 100644
--- a/builtin/checkout.c
+++ b/builtin/checkout.c
@@ -116,7 +116,7 @@ static int check_all_stages(struct cache_entry *ce, int pos)
 	    ce_stage(active_cache[pos+1]) != 2 ||
 	    strcmp(active_cache[pos+2]->name, ce->name) ||
 	    ce_stage(active_cache[pos+2]) != 3)
-		return error("path '%s' does not have all three versions",
+		return error(_("path '%s' does not have all three versions"),
 			     ce->name);
 	return 0;
 }
@@ -150,7 +150,7 @@ static int checkout_merged(int pos, struct checkout *state)
 	    ce_stage(active_cache[pos+1]) != 2 ||
 	    strcmp(active_cache[pos+2]->name, path) ||
 	    ce_stage(active_cache[pos+2]) != 3)
-		return error("path '%s' does not have all 3 versions", path);
+		return error(_("path '%s' does not have all 3 versions"), path);
 
 	read_mmblob(&ancestor, active_cache[pos]->sha1);
 	read_mmblob(&ours, active_cache[pos+1]->sha1);
@@ -167,7 +167,7 @@ static int checkout_merged(int pos, struct checkout *state)
 	free(theirs.ptr);
 	if (status < 0 || !result_buf.ptr) {
 		free(result_buf.ptr);
-		return error("path '%s': cannot merge", path);
+		return error(_("path '%s': cannot merge"), path);
 	}
 
 	/*
@@ -184,12 +184,12 @@ static int checkout_merged(int pos, struct checkout *state)
 	 */
 	if (write_sha1_file(result_buf.ptr, result_buf.size,
 			    blob_type, sha1))
-		die("Unable to add merge result for '%s'", path);
+		die(_("Unable to add merge result for '%s'"), path);
 	ce = make_cache_entry(create_ce_mode(active_cache[pos+1]->ce_mode),
 			      sha1,
 			      path, 2, 0);
 	if (!ce)
-		die("make_cache_entry failed for path '%s'", path);
+		die(_("make_cache_entry failed for path '%s'"), path);
 	status = checkout_entry(ce, state, NULL);
 	return status;
 }
@@ -211,7 +211,7 @@ static int checkout_paths(struct tree *source_tree, const char **pathspec,
 
 	newfd = hold_locked_index(lock_file, 1);
 	if (read_cache_preload(pathspec) < 0)
-		return error("corrupt index file");
+		return error(_("corrupt index file"));
 
 	if (source_tree)
 		read_tree_some(source_tree, pathspec);
@@ -239,14 +239,14 @@ static int checkout_paths(struct tree *source_tree, const char **pathspec,
 			if (!ce_stage(ce))
 				continue;
 			if (opts->force) {
-				warning("path '%s' is unmerged", ce->name);
+				warning(_("path '%s' is unmerged"), ce->name);
 			} else if (stage) {
 				errs |= check_stage(stage, ce, pos);
 			} else if (opts->merge) {
 				errs |= check_all_stages(ce, pos);
 			} else {
 				errs = 1;
-				error("path '%s' is unmerged", ce->name);
+				error(_("path '%s' is unmerged"), ce->name);
 			}
 			pos = skip_same_name(ce, pos) - 1;
 		}
@@ -275,7 +275,7 @@ static int checkout_paths(struct tree *source_tree, const char **pathspec,
 
 	if (write_cache(newfd, active_cache, active_nr) ||
 	    commit_locked_index(lock_file))
-		die("unable to write new index file");
+		die(_("unable to write new index file"));
 
 	resolve_ref("HEAD", rev, 0, &flag);
 	head = lookup_commit_reference_gently(rev, 1);
@@ -292,7 +292,7 @@ static void show_local_changes(struct object *head, struct diff_options *opts)
 	rev.diffopt.flags = opts->flags;
 	rev.diffopt.output_format |= DIFF_FORMAT_NAME_STATUS;
 	if (diff_setup_done(&rev.diffopt) < 0)
-		die("diff_setup_done failed");
+		die(_("diff_setup_done failed"));
 	add_pending_object(&rev, head, NULL);
 	run_diff_index(&rev, 0);
 }
@@ -366,7 +366,7 @@ static int merge_working_tree(struct checkout_opts *opts,
 	int newfd = hold_locked_index(lock_file, 1);
 
 	if (read_cache_preload(NULL) < 0)
-		return error("corrupt index file");
+		return error(_("corrupt index file"));
 
 	resolve_undo_clear();
 	if (opts->force) {
@@ -388,7 +388,7 @@ static int merge_working_tree(struct checkout_opts *opts,
 		refresh_cache(REFRESH_QUIET);
 
 		if (unmerged_cache()) {
-			error("you need to resolve your current index first");
+			error(_("you need to resolve your current index first"));
 			return 1;
 		}
 
@@ -470,7 +470,7 @@ static int merge_working_tree(struct checkout_opts *opts,
 
 	if (write_cache(newfd, active_cache, active_nr) ||
 	    commit_locked_index(lock_file))
-		die("unable to write new index file");
+		die(_("unable to write new index file"));
 
 	if (!opts->force && !opts->quiet)
 		show_local_changes(&new->commit->object, &opts->diff_options);
@@ -519,7 +519,7 @@ static void update_refs_for_switch(struct checkout_opts *opts,
 				temp = log_all_ref_updates;
 				log_all_ref_updates = 1;
 				if (log_ref_setup(ref_name, log_file, sizeof(log_file))) {
-					fprintf(stderr, "Can not do reflog for '%s'\n",
+					fprintf(stderr, _("Can not do reflog for '%s'\n"),
 					    opts->new_orphan_branch);
 					log_all_ref_updates = temp;
 					return;
@@ -545,14 +545,14 @@ static void update_refs_for_switch(struct checkout_opts *opts,
 		create_symref("HEAD", new->path, msg.buf);
 		if (!opts->quiet) {
 			if (old->path && !strcmp(new->path, old->path))
-				fprintf(stderr, "Already on '%s'\n",
+				fprintf(stderr, _("Already on '%s'\n"),
 					new->name);
 			else if (opts->new_branch)
 				fprintf(stderr, "Switched to%s branch '%s'\n",
 					opts->branch_exists ? " and reset" : " a new",
 					new->name);
 			else
-				fprintf(stderr, "Switched to branch '%s'\n",
+				fprintf(stderr, _("Switched to branch '%s'\n"),
 					new->name);
 		}
 		if (old->path && old->name) {
@@ -597,7 +597,7 @@ static int switch_branches(struct checkout_opts *opts, struct branch_info *new)
 		new->name = "HEAD";
 		new->commit = old.commit;
 		if (!new->commit)
-			die("You are on a branch yet to be born");
+			die(_("You are on a branch yet to be born"));
 		parse_commit(new->commit);
 	}
 
@@ -724,7 +724,7 @@ int cmd_checkout(int argc, const char **argv, const char *prefix)
 
 	/* we can assume from now on new_branch = !new_branch_force */
 	if (opts.new_branch && opts.new_branch_force)
-		die("-B cannot be used with -b");
+		die(_("-B cannot be used with -b"));
 
 	/* copy -B over to -b, so that we can just check the latter */
 	if (opts.new_branch_force)
@@ -732,28 +732,28 @@ int cmd_checkout(int argc, const char **argv, const char *prefix)
 
 	if (patch_mode && (opts.track > 0 || opts.new_branch
 			   || opts.new_branch_log || opts.merge || opts.force))
-		die ("--patch is incompatible with all other options");
+		die (_("--patch is incompatible with all other options"));
 
 	/* --track without -b should DWIM */
 	if (0 < opts.track && !opts.new_branch) {
 		const char *argv0 = argv[0];
 		if (!argc || !strcmp(argv0, "--"))
-			die ("--track needs a branch name");
+			die (_("--track needs a branch name"));
 		if (!prefixcmp(argv0, "refs/"))
 			argv0 += 5;
 		if (!prefixcmp(argv0, "remotes/"))
 			argv0 += 8;
 		argv0 = strchr(argv0, '/');
 		if (!argv0 || !argv0[1])
-			die ("Missing branch name; try -b");
+			die (_("Missing branch name; try -b"));
 		opts.new_branch = argv0 + 1;
 	}
 
 	if (opts.new_orphan_branch) {
 		if (opts.new_branch)
-			die("--orphan and -b|-B are mutually exclusive");
+			die(_("--orphan and -b|-B are mutually exclusive"));
 		if (opts.track > 0)
-			die("--orphan cannot be used with -t");
+			die(_("--orphan cannot be used with -t"));
 		opts.new_branch = opts.new_orphan_branch;
 	}
 
@@ -763,7 +763,7 @@ int cmd_checkout(int argc, const char **argv, const char *prefix)
 	}
 
 	if (opts.force && opts.merge)
-		die("git checkout: -f and -m are incompatible");
+		die(_("git checkout: -f and -m are incompatible"));
 
 	/*
 	 * case 1: git checkout <ref> -- [<paths>]
@@ -809,7 +809,7 @@ int cmd_checkout(int argc, const char **argv, const char *prefix)
 
 		if (get_sha1_mb(arg, rev)) {
 			if (has_dash_dash)          /* case (1) */
-				die("invalid reference: %s", arg);
+				die(_("invalid reference: %s"), arg);
 			if (!patch_mode &&
 			    dwim_new_local_branch &&
 			    opts.track == BRANCH_TRACK_UNSPECIFIED &&
@@ -846,7 +846,7 @@ int cmd_checkout(int argc, const char **argv, const char *prefix)
 			source_tree = parse_tree_indirect(rev);
 
 		if (!source_tree)                   /* case (1): want a tree */
-			die("reference is not a tree: %s", arg);
+			die(_("reference is not a tree: %s"), arg);
 		if (!has_dash_dash) {/* case (3 -> 1) */
 			/*
 			 * Do not complain the most common case
@@ -872,7 +872,7 @@ no_reference:
 		const char **pathspec = get_pathspec(prefix, argv);
 
 		if (!pathspec)
-			die("invalid path specification");
+			die(_("invalid path specification"));
 
 		if (patch_mode)
 			return interactive_checkout(new.name, pathspec, &opts);
@@ -880,14 +880,14 @@ no_reference:
 		/* Checkout paths */
 		if (opts.new_branch) {
 			if (argc == 1) {
-				die("git checkout: updating paths is incompatible with switching branches.\nDid you intend to checkout '%s' which can not be resolved as commit?", argv[0]);
+				die(_("git checkout: updating paths is incompatible with switching branches.\nDid you intend to checkout '%s' which can not be resolved as commit?"), argv[0]);
 			} else {
-				die("git checkout: updating paths is incompatible with switching branches.");
+				die(_("git checkout: updating paths is incompatible with switching branches."));
 			}
 		}
 
 		if (1 < !!opts.writeout_stage + !!opts.force + !!opts.merge)
-			die("git checkout: --ours/--theirs, --force and --merge are incompatible when\nchecking out of the index.");
+			die(_("git checkout: --ours/--theirs, --force and --merge are incompatible when\nchecking out of the index."));
 
 		return checkout_paths(source_tree, pathspec, &opts);
 	}
@@ -898,22 +898,22 @@ no_reference:
 	if (opts.new_branch) {
 		struct strbuf buf = STRBUF_INIT;
 		if (strbuf_check_branch_ref(&buf, opts.new_branch))
-			die("git checkout: we do not like '%s' as a branch name.",
+			die(_("git checkout: we do not like '%s' as a branch name."),
 			    opts.new_branch);
 		if (!get_sha1(buf.buf, rev)) {
 			opts.branch_exists = 1;
 			if (!opts.new_branch_force)
-				die("git checkout: branch %s already exists",
+				die(_("git checkout: branch %s already exists"),
 				    opts.new_branch);
 		}
 		strbuf_release(&buf);
 	}
 
 	if (new.name && !new.commit) {
-		die("Cannot switch branch to a non-commit.");
+		die(_("Cannot switch branch to a non-commit."));
 	}
 	if (opts.writeout_stage)
-		die("--ours/--theirs is incompatible with switching branches.");
+		die(_("--ours/--theirs is incompatible with switching branches."));
 
 	return switch_branches(&opts, &new);
 }
-- 
1.7.2.3

^ permalink raw reply related	[flat|nested] 222+ messages in thread

* [PATCH 20/72] gettextize: git-checkout: our/their version message
  2011-02-19 19:23 [PATCH 00/72] No-op C gettext wrappers Ævar Arnfjörð Bjarmason
                   ` (18 preceding siblings ...)
  2011-02-19 19:24 ` [PATCH 19/72] gettextize: git-checkout basic messages Ævar Arnfjörð Bjarmason
@ 2011-02-19 19:24 ` Ævar Arnfjörð Bjarmason
  2011-02-19 19:24 ` [PATCH 21/72] gettextize: git-checkout describe_detached_head messages Ævar Arnfjörð Bjarmason
                   ` (52 subsequent siblings)
  72 siblings, 0 replies; 222+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2011-02-19 19:24 UTC (permalink / raw)
  To: git; +Cc: Junio C Hamano, Ævar Arnfjörð Bjarmason

Split up the "does not have our/their version" message to make it
easier to translate.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
---
 builtin/checkout.c |   14 ++++++++------
 1 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/builtin/checkout.c b/builtin/checkout.c
index b5060ab..7ba0788 100644
--- a/builtin/checkout.c
+++ b/builtin/checkout.c
@@ -103,9 +103,10 @@ static int check_stage(int stage, struct cache_entry *ce, int pos)
 			return 0;
 		pos++;
 	}
-	return error("path '%s' does not have %s version",
-		     ce->name,
-		     (stage == 2) ? "our" : "their");
+	if (stage == 2)
+		return error(_("path '%s' does not have our version"), ce->name);
+	else
+		return error(_("path '%s' does not have their version"), ce->name);
 }
 
 static int check_all_stages(struct cache_entry *ce, int pos)
@@ -130,9 +131,10 @@ static int checkout_stage(int stage, struct cache_entry *ce, int pos,
 			return checkout_entry(active_cache[pos], state, NULL);
 		pos++;
 	}
-	return error("path '%s' does not have %s version",
-		     ce->name,
-		     (stage == 2) ? "our" : "their");
+	if (stage == 2)
+		return error(_("path '%s' does not have our version"), ce->name);
+	else
+		return error(_("path '%s' does not have their version"), ce->name);
 }
 
 static int checkout_merged(int pos, struct checkout *state)
-- 
1.7.2.3

^ permalink raw reply related	[flat|nested] 222+ messages in thread

* [PATCH 21/72] gettextize: git-checkout describe_detached_head messages
  2011-02-19 19:23 [PATCH 00/72] No-op C gettext wrappers Ævar Arnfjörð Bjarmason
                   ` (19 preceding siblings ...)
  2011-02-19 19:24 ` [PATCH 20/72] gettextize: git-checkout: our/their version message Ævar Arnfjörð Bjarmason
@ 2011-02-19 19:24 ` Ævar Arnfjörð Bjarmason
  2011-02-19 19:24 ` [PATCH 22/72] gettextize: git-checkout "HEAD is now at" message Ævar Arnfjörð Bjarmason
                   ` (51 subsequent siblings)
  72 siblings, 0 replies; 222+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2011-02-19 19:24 UTC (permalink / raw)
  To: git; +Cc: Junio C Hamano, Ævar Arnfjörð Bjarmason

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
---
 builtin/checkout.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/builtin/checkout.c b/builtin/checkout.c
index 7ba0788..698ac63 100644
--- a/builtin/checkout.c
+++ b/builtin/checkout.c
@@ -613,7 +613,7 @@ static int switch_branches(struct checkout_opts *opts, struct branch_info *new)
 	 * to remind the user that it might be lost.
 	 */
 	if (!opts->quiet && !old.path && old.commit && new->commit != old.commit)
-		describe_detached_head("Previous HEAD position was", old.commit);
+		describe_detached_head(_("Previous HEAD position was"), old.commit);
 
 	update_refs_for_switch(opts, &old, new);
 
-- 
1.7.2.3

^ permalink raw reply related	[flat|nested] 222+ messages in thread

* [PATCH 22/72] gettextize: git-checkout "HEAD is now at" message
  2011-02-19 19:23 [PATCH 00/72] No-op C gettext wrappers Ævar Arnfjörð Bjarmason
                   ` (20 preceding siblings ...)
  2011-02-19 19:24 ` [PATCH 21/72] gettextize: git-checkout describe_detached_head messages Ævar Arnfjörð Bjarmason
@ 2011-02-19 19:24 ` Ævar Arnfjörð Bjarmason
  2011-02-19 19:24 ` [PATCH 23/72] gettextize: git-checkout "Switched to a .. branch" message Ævar Arnfjörð Bjarmason
                   ` (50 subsequent siblings)
  72 siblings, 0 replies; 222+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2011-02-19 19:24 UTC (permalink / raw)
  To: git; +Cc: Junio C Hamano, Ævar Arnfjörð Bjarmason

Gettextize the "HEAD is now at" messages. Several tests in t7201-co.sh
explicitly checked for this message. Change them to skip under
GETTEXT_POISON=YesPlease.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
---
 builtin/checkout.c |    2 +-
 t/t7201-co.sh      |   10 +++++-----
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/builtin/checkout.c b/builtin/checkout.c
index 698ac63..f833330 100644
--- a/builtin/checkout.c
+++ b/builtin/checkout.c
@@ -571,7 +571,7 @@ static void update_refs_for_switch(struct checkout_opts *opts,
 		if (!opts->quiet) {
 			if (old->path && advice_detached_head)
 				detach_advice(old->path, new->name);
-			describe_detached_head("HEAD is now at", new->commit);
+			describe_detached_head(_("HEAD is now at"), new->commit);
 		}
 	}
 	remove_branch_state();
diff --git a/t/t7201-co.sh b/t/t7201-co.sh
index 1337fa5..fe7536b 100755
--- a/t/t7201-co.sh
+++ b/t/t7201-co.sh
@@ -223,7 +223,7 @@ test_expect_success 'checkout --merge --conflict=diff3 <branch>' '
 	test_cmp two expect
 '
 
-test_expect_success 'checkout to detach HEAD (with advice declined)' '
+test_expect_success NO_GETTEXT_POISON 'checkout to detach HEAD (with advice declined)' '
 
 	git config advice.detachedHead false &&
 	git checkout -f renamer && git clean -f &&
@@ -242,7 +242,7 @@ test_expect_success 'checkout to detach HEAD (with advice declined)' '
 	fi
 '
 
-test_expect_success 'checkout to detach HEAD' '
+test_expect_success NO_GETTEXT_POISON 'checkout to detach HEAD' '
 	git config advice.detachedHead true &&
 	git checkout -f renamer && git clean -f &&
 	git checkout renamer^ 2>messages &&
@@ -260,7 +260,7 @@ test_expect_success 'checkout to detach HEAD' '
 	fi
 '
 
-test_expect_success 'checkout to detach HEAD with branchname^' '
+test_expect_success NO_GETTEXT_POISON 'checkout to detach HEAD with branchname^' '
 
 	git checkout -f master && git clean -f &&
 	git checkout renamer^ &&
@@ -276,7 +276,7 @@ test_expect_success 'checkout to detach HEAD with branchname^' '
 	fi
 '
 
-test_expect_success 'checkout to detach HEAD with :/message' '
+test_expect_success NO_GETTEXT_POISON 'checkout to detach HEAD with :/message' '
 
 	git checkout -f master && git clean -f &&
 	git checkout ":/Initial" &&
@@ -292,7 +292,7 @@ test_expect_success 'checkout to detach HEAD with :/message' '
 	fi
 '
 
-test_expect_success 'checkout to detach HEAD with HEAD^0' '
+test_expect_success NO_GETTEXT_POISON 'checkout to detach HEAD with HEAD^0' '
 
 	git checkout -f master && git clean -f &&
 	git checkout HEAD^0 &&
-- 
1.7.2.3

^ permalink raw reply related	[flat|nested] 222+ messages in thread

* [PATCH 23/72] gettextize: git-checkout "Switched to a .. branch" message
  2011-02-19 19:23 [PATCH 00/72] No-op C gettext wrappers Ævar Arnfjörð Bjarmason
                   ` (21 preceding siblings ...)
  2011-02-19 19:24 ` [PATCH 22/72] gettextize: git-checkout "HEAD is now at" message Ævar Arnfjörð Bjarmason
@ 2011-02-19 19:24 ` Ævar Arnfjörð Bjarmason
  2011-02-19 19:24 ` [PATCH 24/72] gettextize: git-commit basic messages Ævar Arnfjörð Bjarmason
                   ` (49 subsequent siblings)
  72 siblings, 0 replies; 222+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2011-02-19 19:24 UTC (permalink / raw)
  To: git; +Cc: Junio C Hamano, Ævar Arnfjörð Bjarmason

Split up the "Switched to and reset branch" and "Switched to a new
branch" messages to make them easier to translate.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
---
 builtin/checkout.c |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/builtin/checkout.c b/builtin/checkout.c
index f833330..2bb7759 100644
--- a/builtin/checkout.c
+++ b/builtin/checkout.c
@@ -550,9 +550,10 @@ static void update_refs_for_switch(struct checkout_opts *opts,
 				fprintf(stderr, _("Already on '%s'\n"),
 					new->name);
 			else if (opts->new_branch)
-				fprintf(stderr, "Switched to%s branch '%s'\n",
-					opts->branch_exists ? " and reset" : " a new",
-					new->name);
+				if (opts->branch_exists)
+					fprintf(stderr, _("Switched to and reset branch '%s'\n"), new->name);
+				else
+					fprintf(stderr, _("Switched to a new branch '%s'\n"), new->name);
 			else
 				fprintf(stderr, _("Switched to branch '%s'\n"),
 					new->name);
-- 
1.7.2.3

^ permalink raw reply related	[flat|nested] 222+ messages in thread

* [PATCH 24/72] gettextize: git-commit basic messages
  2011-02-19 19:23 [PATCH 00/72] No-op C gettext wrappers Ævar Arnfjörð Bjarmason
                   ` (22 preceding siblings ...)
  2011-02-19 19:24 ` [PATCH 23/72] gettextize: git-checkout "Switched to a .. branch" message Ævar Arnfjörð Bjarmason
@ 2011-02-19 19:24 ` Ævar Arnfjörð Bjarmason
  2011-02-19 19:24 ` [PATCH 25/72] gettextize: git-commit "middle of a merge" message Ævar Arnfjörð Bjarmason
                   ` (48 subsequent siblings)
  72 siblings, 0 replies; 222+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2011-02-19 19:24 UTC (permalink / raw)
  To: git; +Cc: Junio C Hamano, Ævar Arnfjörð Bjarmason

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
---
 builtin/commit.c |  118 +++++++++++++++++++++++++++---------------------------
 1 files changed, 59 insertions(+), 59 deletions(-)

diff --git a/builtin/commit.c b/builtin/commit.c
index d7f55e3..c57f603 100644
--- a/builtin/commit.c
+++ b/builtin/commit.c
@@ -243,7 +243,7 @@ static void add_remove_files(struct string_list *list)
 
 		if (!lstat(p->string, &st)) {
 			if (add_to_cache(p->string, &st, 0))
-				die("updating files failed");
+				die(_("updating files failed"));
 		} else
 			remove_file_from_cache(p->string);
 	}
@@ -270,7 +270,7 @@ static void create_base_index(void)
 	opts.fn = oneway_merge;
 	tree = parse_tree_indirect(head_sha1);
 	if (!tree)
-		die("failed to unpack HEAD tree object");
+		die(_("failed to unpack HEAD tree object"));
 	parse_tree(tree);
 	init_tree_desc(&t, tree->buffer, tree->size);
 	if (unpack_trees(1, &t, &opts))
@@ -298,9 +298,9 @@ static char *prepare_index(int argc, const char **argv, const char *prefix, int
 		refresh_flags |= REFRESH_UNMERGED;
 	if (interactive) {
 		if (interactive_add(argc, argv, prefix) != 0)
-			die("interactive add failed");
+			die(_("interactive add failed"));
 		if (read_cache_preload(NULL) < 0)
-			die("index file corrupt");
+			die(_("index file corrupt"));
 		commit_style = COMMIT_AS_IS;
 		return get_index_file();
 	}
@@ -309,7 +309,7 @@ static char *prepare_index(int argc, const char **argv, const char *prefix, int
 		pathspec = get_pathspec(prefix, argv);
 
 	if (read_cache_preload(pathspec) < 0)
-		die("index file corrupt");
+		die(_("index file corrupt"));
 
 	/*
 	 * Non partial, non as-is commit.
@@ -329,7 +329,7 @@ static char *prepare_index(int argc, const char **argv, const char *prefix, int
 		refresh_cache_or_die(refresh_flags);
 		if (write_cache(fd, active_cache, active_nr) ||
 		    close_lock_file(&index_lock))
-			die("unable to write new_index file");
+			die(_("unable to write new_index file"));
 		commit_style = COMMIT_NORMAL;
 		return index_lock.filename;
 	}
@@ -349,7 +349,7 @@ static char *prepare_index(int argc, const char **argv, const char *prefix, int
 		if (active_cache_changed) {
 			if (write_cache(fd, active_cache, active_nr) ||
 			    commit_locked_index(&index_lock))
-				die("unable to write new_index file");
+				die(_("unable to write new_index file"));
 		} else {
 			rollback_lock_file(&index_lock);
 		}
@@ -379,7 +379,7 @@ static char *prepare_index(int argc, const char **argv, const char *prefix, int
 	commit_style = COMMIT_PARTIAL;
 
 	if (in_merge)
-		die("cannot do a partial commit during a merge.");
+		die(_("cannot do a partial commit during a merge."));
 
 	memset(&partial, 0, sizeof(partial));
 	partial.strdup_strings = 1;
@@ -388,14 +388,14 @@ static char *prepare_index(int argc, const char **argv, const char *prefix, int
 
 	discard_cache();
 	if (read_cache() < 0)
-		die("cannot read the index");
+		die(_("cannot read the index"));
 
 	fd = hold_locked_index(&index_lock, 1);
 	add_remove_files(&partial);
 	refresh_cache(REFRESH_QUIET);
 	if (write_cache(fd, active_cache, active_nr) ||
 	    close_lock_file(&index_lock))
-		die("unable to write new_index file");
+		die(_("unable to write new_index file"));
 
 	fd = hold_lock_file_for_update(&false_lock,
 				       git_path("next-index-%"PRIuMAX,
@@ -408,7 +408,7 @@ static char *prepare_index(int argc, const char **argv, const char *prefix, int
 
 	if (write_cache(fd, active_cache, active_nr) ||
 	    close_lock_file(&false_lock))
-		die("unable to write temporary index file");
+		die(_("unable to write temporary index file"));
 
 	discard_cache();
 	read_cache_from(false_lock.filename);
@@ -455,7 +455,7 @@ static int is_a_merge(const unsigned char *sha1)
 {
 	struct commit *commit = lookup_commit(sha1);
 	if (!commit || parse_commit(commit))
-		die("could not parse HEAD commit");
+		die(_("could not parse HEAD commit"));
 	return !!(commit->parents && commit->parents->next);
 }
 
@@ -474,13 +474,13 @@ static void determine_author_info(struct strbuf *author_ident)
 
 		a = strstr(use_message_buffer, "\nauthor ");
 		if (!a)
-			die("invalid commit: %s", use_message);
+			die(_("invalid commit: %s"), use_message);
 
 		lb = strchrnul(a + strlen("\nauthor "), '<');
 		rb = strchrnul(lb, '>');
 		eol = strchrnul(rb, '\n');
 		if (!*lb || !*rb || !*eol)
-			die("invalid commit: %s", use_message);
+			die(_("invalid commit: %s"), use_message);
 
 		if (lb == a + strlen("\nauthor "))
 			/* \nauthor <foo@example.com> */
@@ -498,7 +498,7 @@ static void determine_author_info(struct strbuf *author_ident)
 		const char *rb = strchr(force_author, '>');
 
 		if (!lb || !rb)
-			die("malformed --author parameter");
+			die(_("malformed --author parameter"));
 		name = xstrndup(force_author, lb - force_author);
 		email = xstrndup(lb + 2, rb - (lb + 2));
 	}
@@ -554,7 +554,7 @@ static char *cut_ident_timestamp_part(char *string)
 {
 	char *ket = strrchr(string, '>');
 	if (!ket || ket[1] != ' ')
-		die("Malformed ident string: '%s'", string);
+		die(_("Malformed ident string: '%s'"), string);
 	*++ket = '\0';
 	return ket;
 }
@@ -588,7 +588,7 @@ static int prepare_to_commit(const char *index_file, const char *prefix,
 			struct commit *c;
 			c = lookup_commit_reference_by_name(squash_message);
 			if (!c)
-				die("could not lookup commit %s", squash_message);
+				die(_("could not lookup commit %s"), squash_message);
 			ctx.output_encoding = get_commit_output_encoding();
 			format_commit_message(c, "squash! %s\n\n", &sb,
 					      &ctx);
@@ -600,19 +600,19 @@ static int prepare_to_commit(const char *index_file, const char *prefix,
 		hook_arg1 = "message";
 	} else if (logfile && !strcmp(logfile, "-")) {
 		if (isatty(0))
-			fprintf(stderr, "(reading log message from standard input)\n");
+			fprintf(stderr, _("(reading log message from standard input)\n"));
 		if (strbuf_read(&sb, 0, 0) < 0)
-			die_errno("could not read log from standard input");
+			die_errno(_("could not read log from standard input"));
 		hook_arg1 = "message";
 	} else if (logfile) {
 		if (strbuf_read_file(&sb, logfile, 0) < 0)
-			die_errno("could not read log file '%s'",
+			die_errno(_("could not read log file '%s'"),
 				  logfile);
 		hook_arg1 = "message";
 	} else if (use_message) {
 		buffer = strstr(use_message_buffer, "\n\n");
 		if (!buffer || buffer[2] == '\0')
-			die("commit has empty message");
+			die(_("commit has empty message"));
 		strbuf_add(&sb, buffer + 2, strlen(buffer + 2));
 		hook_arg1 = "commit";
 		hook_arg2 = use_message;
@@ -621,22 +621,22 @@ static int prepare_to_commit(const char *index_file, const char *prefix,
 		struct commit *commit;
 		commit = lookup_commit_reference_by_name(fixup_message);
 		if (!commit)
-			die("could not lookup commit %s", fixup_message);
+			die(_("could not lookup commit %s"), fixup_message);
 		ctx.output_encoding = get_commit_output_encoding();
 		format_commit_message(commit, "fixup! %s\n\n",
 				      &sb, &ctx);
 		hook_arg1 = "message";
 	} else if (!stat(git_path("MERGE_MSG"), &statbuf)) {
 		if (strbuf_read_file(&sb, git_path("MERGE_MSG"), 0) < 0)
-			die_errno("could not read MERGE_MSG");
+			die_errno(_("could not read MERGE_MSG"));
 		hook_arg1 = "merge";
 	} else if (!stat(git_path("SQUASH_MSG"), &statbuf)) {
 		if (strbuf_read_file(&sb, git_path("SQUASH_MSG"), 0) < 0)
-			die_errno("could not read SQUASH_MSG");
+			die_errno(_("could not read SQUASH_MSG"));
 		hook_arg1 = "squash";
 	} else if (template_file && !stat(template_file, &statbuf)) {
 		if (strbuf_read_file(&sb, template_file, 0) < 0)
-			die_errno("could not read '%s'", template_file);
+			die_errno(_("could not read '%s'"), template_file);
 		hook_arg1 = "template";
 	}
 
@@ -659,7 +659,7 @@ static int prepare_to_commit(const char *index_file, const char *prefix,
 
 	fp = fopen(git_path(commit_editmsg), "w");
 	if (fp == NULL)
-		die_errno("could not open '%s'", git_path(commit_editmsg));
+		die_errno(_("could not open '%s'"), git_path(commit_editmsg));
 
 	if (cleanup_mode != CLEANUP_NONE)
 		stripspace(&sb, 0);
@@ -683,7 +683,7 @@ static int prepare_to_commit(const char *index_file, const char *prefix,
 	}
 
 	if (fwrite(sb.buf, 1, sb.len, fp) < sb.len)
-		die_errno("could not write commit template");
+		die_errno(_("could not write commit template"));
 
 	strbuf_release(&sb);
 
@@ -752,7 +752,7 @@ static int prepare_to_commit(const char *index_file, const char *prefix,
 		const char *parent = "HEAD";
 
 		if (!active_nr && read_cache() < 0)
-			die("Cannot read index");
+			die(_("Cannot read index"));
 
 		if (amend)
 			parent = "HEAD^1";
@@ -785,7 +785,7 @@ static int prepare_to_commit(const char *index_file, const char *prefix,
 		active_cache_tree = cache_tree();
 	if (cache_tree_update(active_cache_tree,
 			      active_cache, active_nr, 0, 0) < 0) {
-		error("Error building trees");
+		error(_("Error building trees"));
 		return 0;
 	}
 
@@ -800,7 +800,7 @@ static int prepare_to_commit(const char *index_file, const char *prefix,
 		snprintf(index, sizeof(index), "GIT_INDEX_FILE=%s", index_file);
 		if (launch_editor(git_path(commit_editmsg), NULL, env)) {
 			fprintf(stderr,
-			"Please supply the message using either -m or -F option.\n");
+			_("Please supply the message using either -m or -F option.\n"));
 			exit(1);
 		}
 	}
@@ -880,7 +880,7 @@ static const char *find_author_by_nickname(const char *name)
 		format_commit_message(commit, "%an <%ae>", &buf, &ctx);
 		return strbuf_detach(&buf, NULL);
 	}
-	die("No existing author found with '%s'", name);
+	die(_("No existing author found with '%s'"), name);
 }
 
 
@@ -895,7 +895,7 @@ static void handle_untracked_files_arg(struct wt_status *s)
 	else if (!strcmp(untracked_files_arg, "all"))
 		s->show_untracked_files = SHOW_ALL_UNTRACKED_FILES;
 	else
-		die("Invalid untracked files mode '%s'", untracked_files_arg);
+		die(_("Invalid untracked files mode '%s'"), untracked_files_arg);
 }
 
 static int parse_and_validate_options(int argc, const char *argv[],
@@ -912,7 +912,7 @@ static int parse_and_validate_options(int argc, const char *argv[],
 		force_author = find_author_by_nickname(force_author);
 
 	if (force_author && renew_authorship)
-		die("Using both --reset-author and --author does not make sense");
+		die(_("Using both --reset-author and --author does not make sense"));
 
 	if (logfile || message.len || use_message || fixup_message)
 		use_editor = 0;
@@ -926,7 +926,7 @@ static int parse_and_validate_options(int argc, const char *argv[],
 
 	/* Sanity check options */
 	if (amend && initial_commit)
-		die("You have nothing to amend.");
+		die(_("You have nothing to amend."));
 	if (amend && in_merge)
 		die("You are in the middle of a merge -- cannot amend.");
 	if (fixup_message && squash_message)
@@ -940,22 +940,22 @@ static int parse_and_validate_options(int argc, const char *argv[],
 	if (logfile)
 		f++;
 	if (f > 1)
-		die("Only one of -c/-C/-F/--fixup can be used.");
+		die(_("Only one of -c/-C/-F/--fixup can be used."));
 	if (message.len && f > 0)
-		die("Option -m cannot be combined with -c/-C/-F/--fixup.");
+		die((_("Option -m cannot be combined with -c/-C/-F/--fixup.")));
 	if (edit_message)
 		use_message = edit_message;
 	if (amend && !use_message && !fixup_message)
 		use_message = "HEAD";
 	if (!use_message && renew_authorship)
-		die("--reset-author can be used only with -C, -c or --amend.");
+		die(_("--reset-author can be used only with -C, -c or --amend."));
 	if (use_message) {
 		const char *out_enc;
 		struct commit *commit;
 
 		commit = lookup_commit_reference_by_name(use_message);
 		if (!commit)
-			die("could not lookup commit %s", use_message);
+			die(_("could not lookup commit %s"), use_message);
 		out_enc = get_commit_output_encoding();
 		use_message_buffer = logmsg_reencode(commit, out_enc);
 
@@ -970,13 +970,13 @@ static int parse_and_validate_options(int argc, const char *argv[],
 	}
 
 	if (!!also + !!only + !!all + !!interactive > 1)
-		die("Only one of --include/--only/--all/--interactive can be used.");
+		die(_("Only one of --include/--only/--all/--interactive can be used."));
 	if (argc == 0 && (also || (only && !amend)))
-		die("No paths with --include/--only does not make sense.");
+		die(_("No paths with --include/--only does not make sense."));
 	if (argc == 0 && only && amend)
-		only_include_assumed = "Clever... amending the last one with dirty index.";
+		only_include_assumed = _("Clever... amending the last one with dirty index.");
 	if (argc > 0 && !also && !only)
-		only_include_assumed = "Explicit paths specified without -i nor -o; assuming --only paths...";
+		only_include_assumed = _("Explicit paths specified without -i nor -o; assuming --only paths...");
 	if (!cleanup_arg || !strcmp(cleanup_arg, "default"))
 		cleanup_mode = use_editor ? CLEANUP_ALL : CLEANUP_SPACE;
 	else if (!strcmp(cleanup_arg, "verbatim"))
@@ -986,14 +986,14 @@ static int parse_and_validate_options(int argc, const char *argv[],
 	else if (!strcmp(cleanup_arg, "strip"))
 		cleanup_mode = CLEANUP_ALL;
 	else
-		die("Invalid cleanup mode %s", cleanup_arg);
+		die(_("Invalid cleanup mode %s"), cleanup_arg);
 
 	handle_untracked_files_arg(s);
 
 	if (all && argc > 0)
-		die("Paths with -a does not make sense.");
+		die(_("Paths with -a does not make sense."));
 	else if (interactive && argc > 0)
-		die("Paths with --interactive does not make sense.");
+		die(_("Paths with --interactive does not make sense."));
 
 	if (null_termination && status_format == STATUS_FORMAT_LONG)
 		status_format = STATUS_FORMAT_PORCELAIN;
@@ -1074,7 +1074,7 @@ static int git_status_config(const char *k, const char *v, void *cb)
 		else if (!strcmp(v, "all"))
 			s->show_untracked_files = SHOW_ALL_UNTRACKED_FILES;
 		else
-			return error("Invalid untracked files mode '%s'", v);
+			return error(_("Invalid untracked files mode '%s'"), v);
 		return 0;
 	}
 	return git_diff_ui_config(k, v, NULL);
@@ -1180,9 +1180,9 @@ static void print_summary(const char *prefix, const unsigned char *sha1)
 
 	commit = lookup_commit(sha1);
 	if (!commit)
-		die("couldn't look up newly created commit");
+		die(_("couldn't look up newly created commit"));
 	if (!commit || parse_commit(commit))
-		die("could not parse newly created commit");
+		die(_("could not parse newly created commit"));
 
 	strbuf_addstr(&format, "format:%h] %s");
 
@@ -1336,7 +1336,7 @@ int cmd_commit(int argc, const char **argv, const char *prefix)
 			reflog_msg = "commit (amend)";
 		commit = lookup_commit(head_sha1);
 		if (!commit || parse_commit(commit))
-			die("could not parse HEAD commit");
+			die(_("could not parse HEAD commit"));
 
 		for (c = commit->parents; c; c = c->next)
 			pptr = &commit_list_insert(c->item, pptr)->next;
@@ -1349,19 +1349,19 @@ int cmd_commit(int argc, const char **argv, const char *prefix)
 		pptr = &commit_list_insert(lookup_commit(head_sha1), pptr)->next;
 		fp = fopen(git_path("MERGE_HEAD"), "r");
 		if (fp == NULL)
-			die_errno("could not open '%s' for reading",
+			die_errno(_("could not open '%s' for reading"),
 				  git_path("MERGE_HEAD"));
 		while (strbuf_getline(&m, fp, '\n') != EOF) {
 			unsigned char sha1[20];
 			if (get_sha1_hex(m.buf, sha1) < 0)
-				die("Corrupt MERGE_HEAD file (%s)", m.buf);
+				die(_("Corrupt MERGE_HEAD file (%s)"), m.buf);
 			pptr = &commit_list_insert(lookup_commit(sha1), pptr)->next;
 		}
 		fclose(fp);
 		strbuf_release(&m);
 		if (!stat(git_path("MERGE_MODE"), &statbuf)) {
 			if (strbuf_read_file(&sb, git_path("MERGE_MODE"), 0) < 0)
-				die_errno("could not read MERGE_MODE");
+				die_errno(_("could not read MERGE_MODE"));
 			if (!strcmp(sb.buf, "no-ff"))
 				allow_fast_forward = 0;
 		}
@@ -1378,7 +1378,7 @@ int cmd_commit(int argc, const char **argv, const char *prefix)
 	if (strbuf_read_file(&sb, git_path(commit_editmsg), 0) < 0) {
 		int saved_errno = errno;
 		rollback_index_files();
-		die("could not read commit message: %s", strerror(saved_errno));
+		die(_("could not read commit message: %s"), strerror(saved_errno));
 	}
 
 	/* Truncate the message just before the diff, if any. */
@@ -1392,14 +1392,14 @@ int cmd_commit(int argc, const char **argv, const char *prefix)
 		stripspace(&sb, cleanup_mode == CLEANUP_ALL);
 	if (message_is_empty(&sb) && !allow_empty_message) {
 		rollback_index_files();
-		fprintf(stderr, "Aborting commit due to empty commit message.\n");
+		fprintf(stderr, _("Aborting commit due to empty commit message.\n"));
 		exit(1);
 	}
 
 	if (commit_tree(sb.buf, active_cache_tree->sha1, parents, commit_sha1,
 			author_ident.buf)) {
 		rollback_index_files();
-		die("failed to write commit object");
+		die(_("failed to write commit object"));
 	}
 	strbuf_release(&author_ident);
 
@@ -1417,11 +1417,11 @@ int cmd_commit(int argc, const char **argv, const char *prefix)
 
 	if (!ref_lock) {
 		rollback_index_files();
-		die("cannot lock HEAD ref");
+		die(_("cannot lock HEAD ref"));
 	}
 	if (write_ref_sha1(ref_lock, commit_sha1, sb.buf) < 0) {
 		rollback_index_files();
-		die("cannot update HEAD ref");
+		die(_("cannot update HEAD ref"));
 	}
 
 	unlink(git_path("MERGE_HEAD"));
@@ -1430,9 +1430,9 @@ int cmd_commit(int argc, const char **argv, const char *prefix)
 	unlink(git_path("SQUASH_MSG"));
 
 	if (commit_index_files())
-		die ("Repository has been updated, but unable to write\n"
+		die (_("Repository has been updated, but unable to write\n"
 		     "new_index file. Check that disk is not full or quota is\n"
-		     "not exceeded, and then \"git reset HEAD\" to recover.");
+		     "not exceeded, and then \"git reset HEAD\" to recover."));
 
 	rerere(0);
 	run_hook(get_index_file(), "post-commit", NULL);
-- 
1.7.2.3

^ permalink raw reply related	[flat|nested] 222+ messages in thread

* [PATCH 25/72] gettextize: git-commit "middle of a merge" message
  2011-02-19 19:23 [PATCH 00/72] No-op C gettext wrappers Ævar Arnfjörð Bjarmason
                   ` (23 preceding siblings ...)
  2011-02-19 19:24 ` [PATCH 24/72] gettextize: git-commit basic messages Ævar Arnfjörð Bjarmason
@ 2011-02-19 19:24 ` Ævar Arnfjörð Bjarmason
  2011-02-19 19:24 ` [PATCH 26/72] gettextize: git-commit formatting messages Ævar Arnfjörð Bjarmason
                   ` (47 subsequent siblings)
  72 siblings, 0 replies; 222+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2011-02-19 19:24 UTC (permalink / raw)
  To: git; +Cc: Junio C Hamano, Ævar Arnfjörð Bjarmason

Gettextize the "You are in the middle of a merge -- cannot amend."
message. Several tests in t7110-reset-merge.sh explicitly checked for
this message. Change them to skip under GETTEXT_POISON=YesPlease.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
---
 builtin/commit.c       |    4 ++--
 t/t7110-reset-merge.sh |    6 +++---
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/builtin/commit.c b/builtin/commit.c
index c57f603..0198e90 100644
--- a/builtin/commit.c
+++ b/builtin/commit.c
@@ -928,9 +928,9 @@ static int parse_and_validate_options(int argc, const char *argv[],
 	if (amend && initial_commit)
 		die(_("You have nothing to amend."));
 	if (amend && in_merge)
-		die("You are in the middle of a merge -- cannot amend.");
+		die(_("You are in the middle of a merge -- cannot amend."));
 	if (fixup_message && squash_message)
-		die("Options --squash and --fixup cannot be used together");
+		die(_("Options --squash and --fixup cannot be used together"));
 	if (use_message)
 		f++;
 	if (edit_message)
diff --git a/t/t7110-reset-merge.sh b/t/t7110-reset-merge.sh
index 70cdd8e..8e54f0c 100755
--- a/t/t7110-reset-merge.sh
+++ b/t/t7110-reset-merge.sh
@@ -233,7 +233,7 @@ test_expect_success '"reset --merge HEAD^" is ok with pending merge' '
 #           working index HEAD target         working index HEAD
 #           ----------------------------------------------------
 # file1:     X       U     B    C     --keep   (disallowed)
-test_expect_success '"reset --keep HEAD^" fails with pending merge' '
+test_expect_success NO_GETTEXT_POISON '"reset --keep HEAD^" fails with pending merge' '
     git reset --hard third &&
     test_must_fail git merge branch1 &&
     test_must_fail git reset --keep HEAD^ 2>err.log &&
@@ -259,7 +259,7 @@ test_expect_success '"reset --merge HEAD" is ok with pending merge' '
 #           working index HEAD target         working index HEAD
 #           ----------------------------------------------------
 # file1:     X       U     B    B     --keep   (disallowed)
-test_expect_success '"reset --keep HEAD" fails with pending merge' '
+test_expect_success NO_GETTEXT_POISON '"reset --keep HEAD" fails with pending merge' '
     git reset --hard third &&
     test_must_fail git merge branch1 &&
     test_must_fail git reset --keep HEAD 2>err.log &&
@@ -280,7 +280,7 @@ test_expect_success '--merge is ok with added/deleted merge' '
     git diff --exit-code --cached
 '
 
-test_expect_success '--keep fails with added/deleted merge' '
+test_expect_success NO_GETTEXT_POISON '--keep fails with added/deleted merge' '
     git reset --hard third &&
     rm -f file2 &&
     test_must_fail git merge branch3 &&
-- 
1.7.2.3

^ permalink raw reply related	[flat|nested] 222+ messages in thread

* [PATCH 26/72] gettextize: git-commit formatting messages
  2011-02-19 19:23 [PATCH 00/72] No-op C gettext wrappers Ævar Arnfjörð Bjarmason
                   ` (24 preceding siblings ...)
  2011-02-19 19:24 ` [PATCH 25/72] gettextize: git-commit "middle of a merge" message Ævar Arnfjörð Bjarmason
@ 2011-02-19 19:24 ` Ævar Arnfjörð Bjarmason
  2011-02-19 19:24 ` [PATCH 27/72] gettextize: git-commit print_summary messages Ævar Arnfjörð Bjarmason
                   ` (46 subsequent siblings)
  72 siblings, 0 replies; 222+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2011-02-19 19:24 UTC (permalink / raw)
  To: git; +Cc: Junio C Hamano, Ævar Arnfjörð Bjarmason

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
---
 builtin/commit.c  |   12 ++++++------
 t/t7502-commit.sh |    4 ++--
 2 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/builtin/commit.c b/builtin/commit.c
index 0198e90..c7c6c59 100644
--- a/builtin/commit.c
+++ b/builtin/commit.c
@@ -696,12 +696,12 @@ static int prepare_to_commit(const char *index_file, const char *prefix,
 		char *ai_tmp, *ci_tmp;
 		if (in_merge)
 			fprintf(fp,
-				"#\n"
+				_("#\n"
 				"# It looks like you may be committing a MERGE.\n"
 				"# If this is not correct, please remove the file\n"
 				"#	%s\n"
 				"# and try again.\n"
-				"#\n",
+				"#\n"),
 				git_path("MERGE_HEAD"));
 
 		fprintf(fp,
@@ -725,15 +725,15 @@ static int prepare_to_commit(const char *index_file, const char *prefix,
 		ci_tmp = cut_ident_timestamp_part(committer_ident.buf);
 		if (strcmp(author_ident->buf, committer_ident.buf))
 			fprintf(fp,
-				"%s"
-				"# Author:    %s\n",
+				_("%s"
+				"# Author:    %s\n"),
 				ident_shown++ ? "" : "#\n",
 				author_ident->buf);
 
 		if (!user_ident_sufficiently_given())
 			fprintf(fp,
-				"%s"
-				"# Committer: %s\n",
+				_("%s"
+				"# Committer: %s\n"),
 				ident_shown++ ? "" : "#\n",
 				committer_ident.buf);
 
diff --git a/t/t7502-commit.sh b/t/t7502-commit.sh
index 50da034..9204a4d 100755
--- a/t/t7502-commit.sh
+++ b/t/t7502-commit.sh
@@ -234,7 +234,7 @@ echo "#
 # Author:    $GIT_AUTHOR_NAME <$GIT_AUTHOR_EMAIL>
 #" >> expect
 
-test_expect_success 'author different from committer' '
+test_expect_success NO_GETTEXT_POISON 'author different from committer' '
 
 	echo >>negative &&
 	git commit -e -m "sample"
@@ -248,7 +248,7 @@ rm -f expect.tmp
 echo "# Committer:
 #" >> expect
 
-test_expect_success 'committer is automatic' '
+test_expect_success NO_GETTEXT_POISON 'committer is automatic' '
 
 	echo >>negative &&
 	(
-- 
1.7.2.3

^ permalink raw reply related	[flat|nested] 222+ messages in thread

* [PATCH 27/72] gettextize: git-commit print_summary messages
  2011-02-19 19:23 [PATCH 00/72] No-op C gettext wrappers Ævar Arnfjörð Bjarmason
                   ` (25 preceding siblings ...)
  2011-02-19 19:24 ` [PATCH 26/72] gettextize: git-commit formatting messages Ævar Arnfjörð Bjarmason
@ 2011-02-19 19:24 ` Ævar Arnfjörð Bjarmason
  2011-02-19 19:24 ` [PATCH 28/72] gettextize: git-commit "enter the commit message" message Ævar Arnfjörð Bjarmason
                   ` (45 subsequent siblings)
  72 siblings, 0 replies; 222+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2011-02-19 19:24 UTC (permalink / raw)
  To: git; +Cc: Junio C Hamano, Ævar Arnfjörð Bjarmason

Gettextize the "(root-commit)" and "detached HEAD" fragments that
appear when you commit either the root commit, or a commit in a
detached head translatable.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
---
 builtin/commit.c  |    4 ++--
 t/t7502-commit.sh |   10 ++++++++--
 2 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/builtin/commit.c b/builtin/commit.c
index c7c6c59..c90a8cf 100644
--- a/builtin/commit.c
+++ b/builtin/commit.c
@@ -1223,9 +1223,9 @@ static void print_summary(const char *prefix, const unsigned char *sha1)
 		!prefixcmp(head, "refs/heads/") ?
 			head + 11 :
 			!strcmp(head, "HEAD") ?
-				"detached HEAD" :
+				_("detached HEAD") :
 				head,
-		initial_commit ? " (root-commit)" : "");
+		initial_commit ? _(" (root-commit)") : "");
 
 	if (!log_tree_commit(&rev, commit)) {
 		rev.always_show_header = 1;
diff --git a/t/t7502-commit.sh b/t/t7502-commit.sh
index 9204a4d..298f7d9 100755
--- a/t/t7502-commit.sh
+++ b/t/t7502-commit.sh
@@ -22,7 +22,10 @@ check_summary_oneline() {
 	SUMMARY_POSTFIX="$(git log -1 --pretty='format:%h')"
 	echo "[$SUMMARY_PREFIX $SUMMARY_POSTFIX] $2" >exp &&
 
-	test_cmp exp act
+	if test_have_prereq NO_GETTEXT_POISON
+	then
+		test_cmp exp act
+	fi
 }
 
 test_expect_success 'output summary format' '
@@ -32,7 +35,10 @@ test_expect_success 'output summary format' '
 	check_summary_oneline "root-commit" "initial" &&
 
 	echo change >>file1 &&
-	git add file1 &&
+	git add file1
+'
+
+test_expect_success 'output summary format: root-commit' '
 	check_summary_oneline "" "a change"
 '
 
-- 
1.7.2.3

^ permalink raw reply related	[flat|nested] 222+ messages in thread

* [PATCH 28/72] gettextize: git-commit "enter the commit message" message
  2011-02-19 19:23 [PATCH 00/72] No-op C gettext wrappers Ævar Arnfjörð Bjarmason
                   ` (26 preceding siblings ...)
  2011-02-19 19:24 ` [PATCH 27/72] gettextize: git-commit print_summary messages Ævar Arnfjörð Bjarmason
@ 2011-02-19 19:24 ` Ævar Arnfjörð Bjarmason
  2011-02-19 19:24 ` [PATCH 29/72] gettextize: git-commit advice messages Ævar Arnfjörð Bjarmason
                   ` (44 subsequent siblings)
  72 siblings, 0 replies; 222+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2011-02-19 19:24 UTC (permalink / raw)
  To: git; +Cc: Junio C Hamano, Ævar Arnfjörð Bjarmason

Gettextize the "# Please enter the commit message for your changes."
message. Several tests in t7500-commit.sh and t7502-commit.sh assume
that this message starts with a newline. Change the tests to to skip
under GETTEXT_POISON=YesPlease.

These fail under GETTEXT_POISON=YesPlease because the poison editor
message doesn't do the right thing with comments and line breaks, so
these messages will be incorrectly broken up across lines.

This test should not be skipped under a hypothetical future testing
mode that tests Git under language locales, since those messages
should all start with a newline like the original.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
---
 builtin/commit.c  |   12 ++++++------
 t/t7500-commit.sh |    8 ++++----
 t/t7502-commit.sh |   26 +++++++++++++++++---------
 3 files changed, 27 insertions(+), 19 deletions(-)

diff --git a/builtin/commit.c b/builtin/commit.c
index c90a8cf..ac8da45 100644
--- a/builtin/commit.c
+++ b/builtin/commit.c
@@ -705,19 +705,19 @@ static int prepare_to_commit(const char *index_file, const char *prefix,
 				git_path("MERGE_HEAD"));
 
 		fprintf(fp,
-			"\n"
-			"# Please enter the commit message for your changes.");
+			_("\n"
+			"# Please enter the commit message for your changes."));
 		if (cleanup_mode == CLEANUP_ALL)
 			fprintf(fp,
-				" Lines starting\n"
+				_(" Lines starting\n"
 				"# with '#' will be ignored, and an empty"
-				" message aborts the commit.\n");
+				" message aborts the commit.\n"));
 		else /* CLEANUP_SPACE, that is. */
 			fprintf(fp,
-				" Lines starting\n"
+				_(" Lines starting\n"
 				"# with '#' will be kept; you may remove them"
 				" yourself if you want to.\n"
-				"# An empty message aborts the commit.\n");
+				"# An empty message aborts the commit.\n"));
 		if (only_include_assumed)
 			fprintf(fp, "# %s\n", only_include_assumed);
 
diff --git a/t/t7500-commit.sh b/t/t7500-commit.sh
index 162527c..70dfc88 100755
--- a/t/t7500-commit.sh
+++ b/t/t7500-commit.sh
@@ -59,7 +59,7 @@ test_expect_success 'adding comments to a template should not commit' '
 	)
 '
 
-test_expect_success 'adding real content to a template should commit' '
+test_expect_success NO_GETTEXT_POISON 'adding real content to a template should commit' '
 	(
 		test_set_editor "$TEST_DIRECTORY"/t7500/add-content &&
 		git commit --template "$TEMPLATE"
@@ -67,7 +67,7 @@ test_expect_success 'adding real content to a template should commit' '
 	commit_msg_is "template linecommit message"
 '
 
-test_expect_success '-t option should be short for --template' '
+test_expect_success NO_GETTEXT_POISON '-t option should be short for --template' '
 	echo "short template" > "$TEMPLATE" &&
 	echo "new content" >> foo &&
 	git add foo &&
@@ -78,7 +78,7 @@ test_expect_success '-t option should be short for --template' '
 	commit_msg_is "short templatecommit message"
 '
 
-test_expect_success 'config-specified template should commit' '
+test_expect_success NO_GETTEXT_POISON 'config-specified template should commit' '
 	echo "new template" > "$TEMPLATE" &&
 	git config commit.template "$TEMPLATE" &&
 	echo "more content" >> foo &&
@@ -277,7 +277,7 @@ test_expect_success 'commit --squash works with -c for same commit' '
 	commit_msg_is "squash! edited commit"
 '
 
-test_expect_success 'commit --squash works with editor' '
+test_expect_success NO_GETTEXT_POISON 'commit --squash works with editor' '
 	commit_for_rebase_autosquash_setup &&
 	test_set_editor "$TEST_DIRECTORY"/t7500/add-content &&
 	git commit --squash HEAD~1 &&
diff --git a/t/t7502-commit.sh b/t/t7502-commit.sh
index 298f7d9..6586355 100755
--- a/t/t7502-commit.sh
+++ b/t/t7502-commit.sh
@@ -221,19 +221,21 @@ test_expect_success 'cleanup commit messages (strip,-F)' '
 
 '
 
-echo "sample
-
-# Please enter the commit message for your changes. Lines starting
-# with '#' will be ignored, and an empty message aborts the commit." >expect
-
 test_expect_success 'cleanup commit messages (strip,-F,-e)' '
 
 	echo >>negative &&
 	{ echo;echo sample;echo; } >text &&
 	git commit -e -F text -a &&
-	head -n 4 .git/COMMIT_EDITMSG >actual &&
-	test_cmp expect actual
+	head -n 4 .git/COMMIT_EDITMSG >actual
+'
+
+echo "sample
 
+# Please enter the commit message for your changes. Lines starting
+# with '#' will be ignored, and an empty message aborts the commit." >expect
+
+test_expect_success NO_GETTEXT_POISON 'cleanup commit messages (strip,-F,-e): output' '
+	test_cmp expect actual
 '
 
 echo "#
@@ -244,7 +246,10 @@ test_expect_success NO_GETTEXT_POISON 'author different from committer' '
 
 	echo >>negative &&
 	git commit -e -m "sample"
-	head -n 7 .git/COMMIT_EDITMSG >actual &&
+	head -n 7 .git/COMMIT_EDITMSG >actual
+'
+
+test_expect_success NO_GETTEXT_POISON 'author different from committer: output' '
 	test_cmp expect actual
 '
 
@@ -264,7 +269,10 @@ test_expect_success NO_GETTEXT_POISON 'committer is automatic' '
 		test_must_fail git commit -e -m "sample"
 	) &&
 	head -n 8 .git/COMMIT_EDITMSG |	\
-	sed "s/^# Committer: .*/# Committer:/" >actual &&
+	sed "s/^# Committer: .*/# Committer:/" >actual
+'
+
+test_expect_success NO_GETTEXT_POISON 'committer is automatic: output' '
 	test_cmp expect actual
 '
 
-- 
1.7.2.3

^ permalink raw reply related	[flat|nested] 222+ messages in thread

* [PATCH 29/72] gettextize: git-commit advice messages
  2011-02-19 19:23 [PATCH 00/72] No-op C gettext wrappers Ævar Arnfjörð Bjarmason
                   ` (27 preceding siblings ...)
  2011-02-19 19:24 ` [PATCH 28/72] gettextize: git-commit "enter the commit message" message Ævar Arnfjörð Bjarmason
@ 2011-02-19 19:24 ` Ævar Arnfjörð Bjarmason
  2011-02-19 19:24 ` [PATCH 30/72] gettextize: git-diff basic messages Ævar Arnfjörð Bjarmason
                   ` (43 subsequent siblings)
  72 siblings, 0 replies; 222+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2011-02-19 19:24 UTC (permalink / raw)
  To: git; +Cc: Junio C Hamano, Ævar Arnfjörð Bjarmason

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
---
 builtin/commit.c |   12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/builtin/commit.c b/builtin/commit.c
index ac8da45..df881d5 100644
--- a/builtin/commit.c
+++ b/builtin/commit.c
@@ -38,7 +38,7 @@ static const char * const builtin_status_usage[] = {
 };
 
 static const char implicit_ident_advice[] =
-"Your name and email address were configured automatically based\n"
+N_("Your name and email address were configured automatically based\n"
 "on your username and hostname. Please check that they are accurate.\n"
 "You can suppress this message by setting them explicitly:\n"
 "\n"
@@ -47,12 +47,12 @@ static const char implicit_ident_advice[] =
 "\n"
 "After doing this, you may fix the identity used for this commit with:\n"
 "\n"
-"    git commit --amend --reset-author\n";
+"    git commit --amend --reset-author\n");
 
 static const char empty_amend_advice[] =
-"You asked to amend the most recent commit, but doing so would make\n"
+N_("You asked to amend the most recent commit, but doing so would make\n"
 "it empty. You can repeat your command with --allow-empty, or you can\n"
-"remove the commit entirely with \"git reset HEAD^\".\n";
+"remove the commit entirely with \"git reset HEAD^\".\n");
 
 static unsigned char head_sha1[20];
 
@@ -770,7 +770,7 @@ static int prepare_to_commit(const char *index_file, const char *prefix,
 	    !(amend && is_a_merge(head_sha1))) {
 		run_status(stdout, index_file, prefix, 0, s);
 		if (amend)
-			fputs(empty_amend_advice, stderr);
+			fputs(_(empty_amend_advice), stderr);
 		return 0;
 	}
 
@@ -1197,7 +1197,7 @@ static void print_summary(const char *prefix, const unsigned char *sha1)
 		strbuf_addbuf_percentquote(&format, &committer_ident);
 		if (advice_implicit_identity) {
 			strbuf_addch(&format, '\n');
-			strbuf_addstr(&format, implicit_ident_advice);
+			strbuf_addstr(&format, _(implicit_ident_advice));
 		}
 	}
 	strbuf_release(&author_ident);
-- 
1.7.2.3

^ permalink raw reply related	[flat|nested] 222+ messages in thread

* [PATCH 30/72] gettextize: git-diff basic messages
  2011-02-19 19:23 [PATCH 00/72] No-op C gettext wrappers Ævar Arnfjörð Bjarmason
                   ` (28 preceding siblings ...)
  2011-02-19 19:24 ` [PATCH 29/72] gettextize: git-commit advice messages Ævar Arnfjörð Bjarmason
@ 2011-02-19 19:24 ` Ævar Arnfjörð Bjarmason
  2011-02-19 19:24 ` [PATCH 31/72] gettextize: git-fetch " Ævar Arnfjörð Bjarmason
                   ` (42 subsequent siblings)
  72 siblings, 0 replies; 222+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2011-02-19 19:24 UTC (permalink / raw)
  To: git; +Cc: Junio C Hamano, Ævar Arnfjörð Bjarmason

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
---
 builtin/diff.c |   18 +++++++++---------
 1 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/builtin/diff.c b/builtin/diff.c
index 42822cd..0034273 100644
--- a/builtin/diff.c
+++ b/builtin/diff.c
@@ -71,9 +71,9 @@ static int builtin_diff_b_f(struct rev_info *revs,
 		usage(builtin_diff_usage);
 
 	if (lstat(path, &st))
-		die_errno("failed to stat '%s'", path);
+		die_errno(_("failed to stat '%s'"), path);
 	if (!(S_ISREG(st.st_mode) || S_ISLNK(st.st_mode)))
-		die("'%s': not a regular file or symlink", path);
+		die(_("'%s': not a regular file or symlink"), path);
 
 	diff_set_mnemonic_prefix(&revs->diffopt, "o/", "w/");
 
@@ -222,7 +222,7 @@ static int builtin_diff_files(struct rev_info *revs, int argc, const char **argv
 		else if (!strcmp(argv[1], "-h"))
 			usage(builtin_diff_usage);
 		else
-			return error("invalid option: %s", argv[1]);
+			return error(_("invalid option: %s"), argv[1]);
 		argv++; argc--;
 	}
 
@@ -299,12 +299,12 @@ int cmd_diff(int argc, const char **argv, const char *prefix)
 	DIFF_OPT_SET(&rev.diffopt, ALLOW_TEXTCONV);
 
 	if (nongit)
-		die("Not a git repository");
+		die(_("Not a git repository"));
 	argc = setup_revisions(argc, argv, &rev, NULL);
 	if (!rev.diffopt.output_format) {
 		rev.diffopt.output_format = DIFF_FORMAT_PATCH;
 		if (diff_setup_done(&rev.diffopt) < 0)
-			die("diff_setup_done failed");
+			die(_("diff_setup_done failed"));
 	}
 
 	DIFF_OPT_SET(&rev.diffopt, RECURSIVE);
@@ -349,12 +349,12 @@ int cmd_diff(int argc, const char **argv, const char *prefix)
 			obj = parse_object(obj->sha1);
 		obj = deref_tag(obj, NULL, 0);
 		if (!obj)
-			die("invalid object '%s' given.", name);
+			die(_("invalid object '%s' given."), name);
 		if (obj->type == OBJ_COMMIT)
 			obj = &((struct commit *)obj)->tree->object;
 		if (obj->type == OBJ_TREE) {
 			if (ARRAY_SIZE(ent) <= ents)
-				die("more than %d trees given: '%s'",
+				die(_("more than %d trees given: '%s'"),
 				    (int) ARRAY_SIZE(ent), name);
 			obj->flags |= flags;
 			ent[ents].item = obj;
@@ -364,7 +364,7 @@ int cmd_diff(int argc, const char **argv, const char *prefix)
 		}
 		if (obj->type == OBJ_BLOB) {
 			if (2 <= blobs)
-				die("more than two blobs given: '%s'", name);
+				die(_("more than two blobs given: '%s'"), name);
 			hashcpy(blob[blobs].sha1, obj->sha1);
 			blob[blobs].name = name;
 			blob[blobs].mode = list->mode;
@@ -372,7 +372,7 @@ int cmd_diff(int argc, const char **argv, const char *prefix)
 			continue;
 
 		}
-		die("unhandled object '%s' given.", name);
+		die(_("unhandled object '%s' given."), name);
 	}
 	if (rev.prune_data) {
 		const char **pathspec = rev.prune_data;
-- 
1.7.2.3

^ permalink raw reply related	[flat|nested] 222+ messages in thread

* [PATCH 31/72] gettextize: git-fetch basic messages
  2011-02-19 19:23 [PATCH 00/72] No-op C gettext wrappers Ævar Arnfjörð Bjarmason
                   ` (29 preceding siblings ...)
  2011-02-19 19:24 ` [PATCH 30/72] gettextize: git-diff basic messages Ævar Arnfjörð Bjarmason
@ 2011-02-19 19:24 ` Ævar Arnfjörð Bjarmason
  2011-02-19 19:24 ` [PATCH 32/72] gettextize: git-fetch formatting messages Ævar Arnfjörð Bjarmason
                   ` (41 subsequent siblings)
  72 siblings, 0 replies; 222+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2011-02-19 19:24 UTC (permalink / raw)
  To: git; +Cc: Junio C Hamano, Ævar Arnfjörð Bjarmason

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
---
 builtin/fetch.c |   46 +++++++++++++++++++++++-----------------------
 1 files changed, 23 insertions(+), 23 deletions(-)

diff --git a/builtin/fetch.c b/builtin/fetch.c
index 357f3cd..c27c3e9 100644
--- a/builtin/fetch.c
+++ b/builtin/fetch.c
@@ -184,7 +184,7 @@ static struct ref *get_ref_map(struct transport *transport,
 		} else {
 			ref_map = get_remote_ref(remote_refs, "HEAD");
 			if (!ref_map)
-				die("Couldn't find remote ref HEAD");
+				die(_("Couldn't find remote ref HEAD"));
 			ref_map->merge = 1;
 			tail = &ref_map->next;
 		}
@@ -237,7 +237,7 @@ static int update_local_ref(struct ref *ref,
 	*display = 0;
 	type = sha1_object_info(ref->new_sha1, NULL);
 	if (type < 0)
-		die("object %s not found", sha1_to_hex(ref->new_sha1));
+		die(_("object %s not found"), sha1_to_hex(ref->new_sha1));
 
 	if (!hashcmp(ref->old_sha1, ref->new_sha1)) {
 		if (verbosity > 0)
@@ -337,7 +337,7 @@ static int store_updated_refs(const char *raw_url, const char *remote_name,
 
 	fp = fopen(filename, "a");
 	if (!fp)
-		return error("cannot open %s: %s\n", filename, strerror(errno));
+		return error(_("cannot open %s: %s\n"), filename, strerror(errno));
 
 	if (raw_url)
 		url = transport_anonymize_url(raw_url);
@@ -426,9 +426,9 @@ static int store_updated_refs(const char *raw_url, const char *remote_name,
 	free(url);
 	fclose(fp);
 	if (rc & STORE_REF_ERROR_DF_CONFLICT)
-		error("some local refs could not be updated; try running\n"
+		error(_("some local refs could not be updated; try running\n"
 		      " 'git remote prune %s' to remove any old, conflicting "
-		      "branches", remote_name);
+		      "branches"), remote_name);
 	return rc;
 }
 
@@ -476,7 +476,7 @@ static int quickfetch(struct ref *ref_map)
 
 	err = start_command(&revlist);
 	if (err) {
-		error("could not run rev-list");
+		error(_("could not run rev-list"));
 		return err;
 	}
 
@@ -490,14 +490,14 @@ static int quickfetch(struct ref *ref_map)
 		if (write_in_full(revlist.in, sha1_to_hex(ref->old_sha1), 40) < 0 ||
 		    write_str_in_full(revlist.in, "\n") < 0) {
 			if (errno != EPIPE && errno != EINVAL)
-				error("failed write to rev-list: %s", strerror(errno));
+				error(_("failed write to rev-list: %s"), strerror(errno));
 			err = -1;
 			break;
 		}
 	}
 
 	if (close(revlist.in)) {
-		error("failed to close rev-list's stdin: %s", strerror(errno));
+		error(_("failed to close rev-list's stdin: %s"), strerror(errno));
 		err = -1;
 	}
 
@@ -650,8 +650,8 @@ static void check_not_current_branch(struct ref *ref_map)
 	for (; ref_map; ref_map = ref_map->next)
 		if (ref_map->peer_ref && !strcmp(current_branch->refname,
 					ref_map->peer_ref->name))
-			die("Refusing to fetch into current branch %s "
-			    "of non-bare repository", current_branch->refname);
+			die(_("Refusing to fetch into current branch %s "
+			    "of non-bare repository"), current_branch->refname);
 }
 
 static int truncate_fetch_head(void)
@@ -660,7 +660,7 @@ static int truncate_fetch_head(void)
 	FILE *fp = fopen(filename, "w");
 
 	if (!fp)
-		return error("cannot open %s: %s\n", filename, strerror(errno));
+		return error(_("cannot open %s: %s\n"), filename, strerror(errno));
 	fclose(fp);
 	return 0;
 }
@@ -684,7 +684,7 @@ static int do_fetch(struct transport *transport,
 	}
 
 	if (!transport->get_refs_list || !transport->fetch)
-		die("Don't know how to fetch from %s", transport->url);
+		die(_("Don't know how to fetch from %s"), transport->url);
 
 	/* if not appending, truncate FETCH_HEAD */
 	if (!append && !dry_run) {
@@ -738,10 +738,10 @@ static void set_option(const char *name, const char *value)
 {
 	int r = transport_set_option(transport, name, value);
 	if (r < 0)
-		die("Option \"%s\" value \"%s\" is not valid for %s",
+		die(_("Option \"%s\" value \"%s\" is not valid for %s"),
 			name, value, transport->url);
 	if (r > 0)
-		warning("Option \"%s\" is ignored for %s\n",
+		warning(_("Option \"%s\" is ignored for %s\n"),
 			name, transport->url);
 }
 
@@ -838,9 +838,9 @@ static int fetch_multiple(struct string_list *list)
 		argv[argc] = name;
 		argv[argc + 1] = NULL;
 		if (verbosity >= 0)
-			printf("Fetching %s\n", name);
+			printf(_("Fetching %s\n"), name);
 		if (run_command_v_opt(argv, RUN_GIT_CMD)) {
-			error("Could not fetch %s", name);
+			error(_("Could not fetch %s"), name);
 			result = 1;
 		}
 	}
@@ -856,8 +856,8 @@ static int fetch_one(struct remote *remote, int argc, const char **argv)
 	int exit_code;
 
 	if (!remote)
-		die("No remote repository specified.  Please, specify either a URL or a\n"
-		    "remote name from which new revisions should be fetched.");
+		die(_("No remote repository specified.  Please, specify either a URL or a\n"
+		    "remote name from which new revisions should be fetched."));
 
 	transport = transport_get(remote, NULL);
 	transport_set_verbosity(transport, verbosity, progress);
@@ -876,7 +876,7 @@ static int fetch_one(struct remote *remote, int argc, const char **argv)
 				char *ref;
 				i++;
 				if (i >= argc)
-					die("You need to specify a tag name.");
+					die(_("You need to specify a tag name."));
 				ref = xmalloc(strlen(argv[i]) * 2 + 22);
 				strcpy(ref, "refs/tags/");
 				strcat(ref, argv[i]);
@@ -916,9 +916,9 @@ int cmd_fetch(int argc, const char **argv, const char *prefix)
 
 	if (all) {
 		if (argc == 1)
-			die("fetch --all does not take a repository argument");
+			die(_("fetch --all does not take a repository argument"));
 		else if (argc > 1)
-			die("fetch --all does not make sense with refspecs");
+			die(_("fetch --all does not make sense with refspecs"));
 		(void) for_each_remote(get_one_remote_for_fetch, &list);
 		result = fetch_multiple(&list);
 	} else if (argc == 0) {
@@ -929,7 +929,7 @@ int cmd_fetch(int argc, const char **argv, const char *prefix)
 		/* All arguments are assumed to be remotes or groups */
 		for (i = 0; i < argc; i++)
 			if (!add_remote_or_group(argv[i], &list))
-				die("No such remote or remote group: %s", argv[i]);
+				die(_("No such remote or remote group: %s"), argv[i]);
 		result = fetch_multiple(&list);
 	} else {
 		/* Single remote or group */
@@ -937,7 +937,7 @@ int cmd_fetch(int argc, const char **argv, const char *prefix)
 		if (list.nr > 1) {
 			/* More than one remote */
 			if (argc > 1)
-				die("Fetching a group and specifying refspecs does not make sense");
+				die(_("Fetching a group and specifying refspecs does not make sense"));
 			result = fetch_multiple(&list);
 		} else {
 			/* Zero or one remotes */
-- 
1.7.2.3

^ permalink raw reply related	[flat|nested] 222+ messages in thread

* [PATCH 32/72] gettextize: git-fetch formatting messages
  2011-02-19 19:23 [PATCH 00/72] No-op C gettext wrappers Ævar Arnfjörð Bjarmason
                   ` (30 preceding siblings ...)
  2011-02-19 19:24 ` [PATCH 31/72] gettextize: git-fetch " Ævar Arnfjörð Bjarmason
@ 2011-02-19 19:24 ` Ævar Arnfjörð Bjarmason
  2011-02-19 19:24 ` [PATCH 33/72] gettextize: git-fetch update_local_ref messages Ævar Arnfjörð Bjarmason
                   ` (40 subsequent siblings)
  72 siblings, 0 replies; 222+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2011-02-19 19:24 UTC (permalink / raw)
  To: git; +Cc: Junio C Hamano, Ævar Arnfjörð Bjarmason

Translate some of the formatting messages that appear on git-fetch
showing how branches/tags etc. were updated.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
---
 builtin/fetch.c             |   20 ++++++++++----------
 t/t5526-fetch-submodules.sh |   40 ++++++++++++++++++++++++++++++++--------
 2 files changed, 42 insertions(+), 18 deletions(-)

diff --git a/builtin/fetch.c b/builtin/fetch.c
index c27c3e9..0a73dff 100644
--- a/builtin/fetch.c
+++ b/builtin/fetch.c
@@ -242,7 +242,7 @@ static int update_local_ref(struct ref *ref,
 	if (!hashcmp(ref->old_sha1, ref->new_sha1)) {
 		if (verbosity > 0)
 			sprintf(display, "= %-*s %-*s -> %s", TRANSPORT_SUMMARY_WIDTH,
-				"[up to date]", REFCOL_WIDTH, remote,
+				_("[up to date]"), REFCOL_WIDTH, remote,
 				pretty_ref);
 		return 0;
 	}
@@ -255,8 +255,8 @@ static int update_local_ref(struct ref *ref,
 		 * If this is the head, and it's not okay to update
 		 * the head, and the old value of the head isn't empty...
 		 */
-		sprintf(display, "! %-*s %-*s -> %s  (can't fetch in current branch)",
-			TRANSPORT_SUMMARY_WIDTH, "[rejected]", REFCOL_WIDTH, remote,
+		sprintf(display, _("! %-*s %-*s -> %s  (can't fetch in current branch)"),
+			TRANSPORT_SUMMARY_WIDTH, _("[rejected]"), REFCOL_WIDTH, remote,
 			pretty_ref);
 		return 1;
 	}
@@ -266,8 +266,8 @@ static int update_local_ref(struct ref *ref,
 		int r;
 		r = s_update_ref("updating tag", ref, 0);
 		sprintf(display, "%c %-*s %-*s -> %s%s", r ? '!' : '-',
-			TRANSPORT_SUMMARY_WIDTH, "[tag update]", REFCOL_WIDTH, remote,
-			pretty_ref, r ? "  (unable to update local ref)" : "");
+			TRANSPORT_SUMMARY_WIDTH, _("[tag update]"), REFCOL_WIDTH, remote,
+			pretty_ref, r ? _("  (unable to update local ref)") : "");
 		return r;
 	}
 
@@ -415,7 +415,7 @@ static int store_updated_refs(const char *raw_url, const char *remote_name,
 				 REFCOL_WIDTH, *what ? what : "HEAD");
 		if (*note) {
 			if (verbosity >= 0 && !shown_url) {
-				fprintf(stderr, "From %.*s\n",
+				fprintf(stderr, _("From %.*s\n"),
 						url_len, url);
 				shown_url = 1;
 			}
@@ -524,16 +524,16 @@ static int prune_refs(struct transport *transport, struct ref *ref_map)
 	int result = 0;
 	struct ref *ref, *stale_refs = get_stale_heads(transport->remote, ref_map);
 	const char *dangling_msg = dry_run
-		? "   (%s will become dangling)\n"
-		: "   (%s has become dangling)\n";
+		? _("   (%s will become dangling)\n")
+		: _("   (%s has become dangling)\n");
 
 	for (ref = stale_refs; ref; ref = ref->next) {
 		if (!dry_run)
 			result |= delete_ref(ref->name, NULL, 0);
 		if (verbosity >= 0) {
 			fprintf(stderr, " x %-*s %-*s -> %s\n",
-				TRANSPORT_SUMMARY_WIDTH, "[deleted]",
-				REFCOL_WIDTH, "(none)", prettify_refname(ref->name));
+				TRANSPORT_SUMMARY_WIDTH, _("[deleted]"),
+				REFCOL_WIDTH, _("(none)"), prettify_refname(ref->name));
 			warn_dangling_symref(stderr, dangling_msg, ref->name);
 		}
 	}
diff --git a/t/t5526-fetch-submodules.sh b/t/t5526-fetch-submodules.sh
index a5f4585..617ce67 100755
--- a/t/t5526-fetch-submodules.sh
+++ b/t/t5526-fetch-submodules.sh
@@ -66,7 +66,10 @@ test_expect_success "fetch --recurse-submodules recurses into submodules" '
 	(
 		cd downstream &&
 		git fetch --recurse-submodules >../actual.out 2>../actual.err
-	) &&
+	)
+'
+
+test_expect_success NO_GETTEXT_POISON "fetch --recurse-submodules recurses into submodules: output" '
 	test_cmp expect.out actual.out &&
 	test_cmp expect.err actual.err
 '
@@ -95,7 +98,10 @@ test_expect_success "using fetchRecurseSubmodules=true in .gitmodules recurses i
 		cd downstream &&
 		git config -f .gitmodules submodule.submodule.fetchRecurseSubmodules true &&
 		git fetch >../actual.out 2>../actual.err
-	) &&
+	)
+'
+
+test_expect_success NO_GETTEXT_POISON "using fetchRecurseSubmodules=true in .gitmodules recurses into submodules" '
 	test_cmp expect.out actual.out &&
 	test_cmp expect.err actual.err
 '
@@ -126,7 +132,10 @@ test_expect_success "--recurse-submodules overrides fetchRecurseSubmodules setti
 		git fetch --recurse-submodules >../actual.out 2>../actual.err &&
 		git config --unset -f .gitmodules submodule.submodule.fetchRecurseSubmodules &&
 		git config --unset submodule.submodule.fetchRecurseSubmodules
-	) &&
+	)
+'
+
+test_expect_success NO_GETTEXT_POISON "--recurse-submodules overrides fetchRecurseSubmodules setting from .git/config: output" '
 	test_cmp expect.out actual.out &&
 	test_cmp expect.err actual.err
 '
@@ -145,13 +154,22 @@ test_expect_success "--dry-run propagates to submodules" '
 	(
 		cd downstream &&
 		git fetch --recurse-submodules --dry-run >../actual.out 2>../actual.err
-	) &&
+	)
+'
+
+test_expect_success NO_GETTEXT_POISON "--dry-run propagates to submodules: output" '
 	test_cmp expect.out actual.out &&
-	test_cmp expect.err actual.err &&
+	test_cmp expect.err actual.err
+'
+
+test_expect_success "Without --dry-run propagates to submodules" '
 	(
 		cd downstream &&
 		git fetch --recurse-submodules >../actual.out 2>../actual.err
-	) &&
+	)
+'
+
+test_expect_success NO_GETTEXT_POISON "Without --dry-run propagates to submodules: output" '
 	test_cmp expect.out actual.out &&
 	test_cmp expect.err actual.err
 '
@@ -162,7 +180,10 @@ test_expect_success "recurseSubmodules=true propagates into submodules" '
 		cd downstream &&
 		git config fetch.recurseSubmodules true
 		git fetch >../actual.out 2>../actual.err
-	) &&
+	)
+'
+
+test_expect_success NO_GETTEXT_POISON "recurseSubmodules=true propagates into submodules: output" '
 	test_cmp expect.out actual.out &&
 	test_cmp expect.err actual.err
 '
@@ -176,7 +197,10 @@ test_expect_success "--recurse-submodules overrides config in submodule" '
 			git config fetch.recurseSubmodules false
 		) &&
 		git fetch --recurse-submodules >../actual.out 2>../actual.err
-	) &&
+	)
+'
+
+test_expect_success NO_GETTEXT_POISON "--recurse-submodules overrides config in submodule: output" '
 	test_cmp expect.out actual.out &&
 	test_cmp expect.err actual.err
 '
-- 
1.7.2.3

^ permalink raw reply related	[flat|nested] 222+ messages in thread

* [PATCH 33/72] gettextize: git-fetch update_local_ref messages
  2011-02-19 19:23 [PATCH 00/72] No-op C gettext wrappers Ævar Arnfjörð Bjarmason
                   ` (31 preceding siblings ...)
  2011-02-19 19:24 ` [PATCH 32/72] gettextize: git-fetch formatting messages Ævar Arnfjörð Bjarmason
@ 2011-02-19 19:24 ` Ævar Arnfjörð Bjarmason
  2011-02-19 19:24 ` [PATCH 34/72] gettextize: git-fetch split up "(non-fast-forward)" message Ævar Arnfjörð Bjarmason
                   ` (39 subsequent siblings)
  72 siblings, 0 replies; 222+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2011-02-19 19:24 UTC (permalink / raw)
  To: git; +Cc: Junio C Hamano, Ævar Arnfjörð Bjarmason

Translate a "[rejected]" message spotted by Jeff King, and other
things in update_local_ref along with it.

Reported-by: Jeff King <peff@peff.net>
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
---
 builtin/fetch.c |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/builtin/fetch.c b/builtin/fetch.c
index 0a73dff..4f622fd 100644
--- a/builtin/fetch.c
+++ b/builtin/fetch.c
@@ -279,17 +279,17 @@ static int update_local_ref(struct ref *ref,
 		int r;
 		if (!strncmp(ref->name, "refs/tags/", 10)) {
 			msg = "storing tag";
-			what = "[new tag]";
+			what = _("[new tag]");
 		}
 		else {
 			msg = "storing head";
-			what = "[new branch]";
+			what = _("[new branch]");
 		}
 
 		r = s_update_ref(msg, ref, 0);
 		sprintf(display, "%c %-*s %-*s -> %s%s", r ? '!' : '*',
 			TRANSPORT_SUMMARY_WIDTH, what, REFCOL_WIDTH, remote, pretty_ref,
-			r ? "  (unable to update local ref)" : "");
+			r ? _("  (unable to update local ref)") : "");
 		return r;
 	}
 
@@ -302,7 +302,7 @@ static int update_local_ref(struct ref *ref,
 		r = s_update_ref("fast-forward", ref, 1);
 		sprintf(display, "%c %-*s %-*s -> %s%s", r ? '!' : ' ',
 			TRANSPORT_SUMMARY_WIDTH, quickref, REFCOL_WIDTH, remote,
-			pretty_ref, r ? "  (unable to update local ref)" : "");
+			pretty_ref, r ? _("  (unable to update local ref)") : "");
 		return r;
 	} else if (force || ref->force) {
 		char quickref[84];
@@ -314,7 +314,7 @@ static int update_local_ref(struct ref *ref,
 		sprintf(display, "%c %-*s %-*s -> %s  (%s)", r ? '!' : '+',
 			TRANSPORT_SUMMARY_WIDTH, quickref, REFCOL_WIDTH, remote,
 			pretty_ref,
-			r ? "unable to update local ref" : "forced update");
+			r ? _("unable to update local ref") : _("forced update"));
 		return r;
 	} else {
 		sprintf(display, "! %-*s %-*s -> %s  (non-fast-forward)",
-- 
1.7.2.3

^ permalink raw reply related	[flat|nested] 222+ messages in thread

* [PATCH 34/72] gettextize: git-fetch split up "(non-fast-forward)" message
  2011-02-19 19:23 [PATCH 00/72] No-op C gettext wrappers Ævar Arnfjörð Bjarmason
                   ` (32 preceding siblings ...)
  2011-02-19 19:24 ` [PATCH 33/72] gettextize: git-fetch update_local_ref messages Ævar Arnfjörð Bjarmason
@ 2011-02-19 19:24 ` Ævar Arnfjörð Bjarmason
  2011-02-19 19:24 ` [PATCH 35/72] gettextize: git-grep basic messages Ævar Arnfjörð Bjarmason
                   ` (38 subsequent siblings)
  72 siblings, 0 replies; 222+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2011-02-19 19:24 UTC (permalink / raw)
  To: git; +Cc: Junio C Hamano, Ævar Arnfjörð Bjarmason

Split up the "(non-fast-forward)" message from printf directives and
make it translatable.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
---
 builtin/fetch.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/builtin/fetch.c b/builtin/fetch.c
index 4f622fd..ee2c5f5 100644
--- a/builtin/fetch.c
+++ b/builtin/fetch.c
@@ -317,9 +317,9 @@ static int update_local_ref(struct ref *ref,
 			r ? _("unable to update local ref") : _("forced update"));
 		return r;
 	} else {
-		sprintf(display, "! %-*s %-*s -> %s  (non-fast-forward)",
-			TRANSPORT_SUMMARY_WIDTH, "[rejected]", REFCOL_WIDTH, remote,
-			pretty_ref);
+		sprintf(display, "! %-*s %-*s -> %s  %s",
+			TRANSPORT_SUMMARY_WIDTH, _("[rejected]"), REFCOL_WIDTH, remote,
+			pretty_ref, _("(non-fast-forward)"));
 		return 1;
 	}
 }
-- 
1.7.2.3

^ permalink raw reply related	[flat|nested] 222+ messages in thread

* [PATCH 35/72] gettextize: git-grep basic messages
  2011-02-19 19:23 [PATCH 00/72] No-op C gettext wrappers Ævar Arnfjörð Bjarmason
                   ` (33 preceding siblings ...)
  2011-02-19 19:24 ` [PATCH 34/72] gettextize: git-fetch split up "(non-fast-forward)" message Ævar Arnfjörð Bjarmason
@ 2011-02-19 19:24 ` Ævar Arnfjörð Bjarmason
  2011-02-19 19:24 ` [PATCH 36/72] gettextize: git-grep "--open-files-in-pager" message Ævar Arnfjörð Bjarmason
                   ` (37 subsequent siblings)
  72 siblings, 0 replies; 222+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2011-02-19 19:24 UTC (permalink / raw)
  To: git; +Cc: Junio C Hamano, Ævar Arnfjörð Bjarmason

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
---
 builtin/grep.c |   32 ++++++++++++++++----------------
 1 files changed, 16 insertions(+), 16 deletions(-)

diff --git a/builtin/grep.c b/builtin/grep.c
index fdf7131..d35b76c 100644
--- a/builtin/grep.c
+++ b/builtin/grep.c
@@ -245,7 +245,7 @@ static void start_threads(struct grep_opt *opt)
 		err = pthread_create(&threads[i], NULL, run, o);
 
 		if (err)
-			die("grep: failed to create thread: %s",
+			die(_("grep: failed to create thread: %s"),
 			    strerror(err));
 	}
 }
@@ -450,7 +450,7 @@ static void *load_sha1(const unsigned char *sha1, unsigned long *size,
 	void *data = lock_and_read_sha1_file(sha1, &type, size);
 
 	if (!data)
-		error("'%s': unable to read %s", name, sha1_to_hex(sha1));
+		error(_("'%s': unable to read %s"), name, sha1_to_hex(sha1));
 
 	return data;
 }
@@ -501,7 +501,7 @@ static void *load_file(const char *filename, size_t *sz)
 	if (lstat(filename, &st) < 0) {
 	err_ret:
 		if (errno != ENOENT)
-			error("'%s': %s", filename, strerror(errno));
+			error(_("'%s': %s"), filename, strerror(errno));
 		return 0;
 	}
 	if (!S_ISREG(st.st_mode))
@@ -512,7 +512,7 @@ static void *load_file(const char *filename, size_t *sz)
 		goto err_ret;
 	data = xmalloc(*sz + 1);
 	if (st.st_size != read_in_full(i, data, *sz)) {
-		error("'%s': short read %s", filename, strerror(errno));
+		error(_("'%s': short read %s"), filename, strerror(errno));
 		close(i);
 		free(data);
 		return 0;
@@ -574,7 +574,7 @@ static void run_pager(struct grep_opt *opt, const char *prefix)
 	argv[path_list->nr] = NULL;
 
 	if (prefix && chdir(prefix))
-		die("Failed to chdir: %s", prefix);
+		die(_("Failed to chdir: %s"), prefix);
 	status = run_command_v_opt(argv, RUN_USING_SHELL);
 	if (status)
 		exit(status);
@@ -664,7 +664,7 @@ static int grep_tree(struct grep_opt *opt, const char **paths,
 
 			data = lock_and_read_sha1_file(entry.sha1, &type, &size);
 			if (!data)
-				die("unable to read tree (%s)",
+				die(_("unable to read tree (%s)"),
 				    sha1_to_hex(entry.sha1));
 			init_tree_desc(&sub, data, size);
 			hit |= grep_tree(opt, paths, &sub, tree_name, down);
@@ -690,13 +690,13 @@ static int grep_object(struct grep_opt *opt, const char **paths,
 		data = read_object_with_reference(obj->sha1, tree_type,
 						  &size, NULL);
 		if (!data)
-			die("unable to read tree (%s)", sha1_to_hex(obj->sha1));
+			die(_("unable to read tree (%s)"), sha1_to_hex(obj->sha1));
 		init_tree_desc(&tree, data, size);
 		hit = grep_tree(opt, paths, &tree, name, "");
 		free(data);
 		return hit;
 	}
-	die("unable to grep from object of type %s", typename(obj->type));
+	die(_("unable to grep from object of type %s"), typename(obj->type));
 }
 
 static int grep_objects(struct grep_opt *opt, const char **paths,
@@ -748,7 +748,7 @@ static int context_callback(const struct option *opt, const char *arg,
 	}
 	value = strtol(arg, (char **)&endp, 10);
 	if (*endp) {
-		return error("switch `%c' expects a numerical value",
+		return error(_("switch `%c' expects a numerical value"),
 			     opt->short_name);
 	}
 	grep_opt->pre_context = grep_opt->post_context = value;
@@ -764,7 +764,7 @@ static int file_callback(const struct option *opt, const char *arg, int unset)
 
 	patterns = fopen(arg, "r");
 	if (!patterns)
-		die_errno("cannot open '%s'", arg);
+		die_errno(_("cannot open '%s'"), arg);
 	while (strbuf_getline(&sb, patterns, '\n') == 0) {
 		char *s;
 		size_t len;
@@ -1005,11 +1005,11 @@ int cmd_grep(int argc, const char **argv, const char *prefix)
 	}
 
 	if (!opt.pattern_list)
-		die("no pattern given.");
+		die(_("no pattern given."));
 	if (!opt.fixed && opt.ignore_case)
 		opt.regflags |= REG_ICASE;
 	if ((opt.regflags != REG_NEWLINE) && opt.fixed)
-		die("cannot mix --fixed-strings and regexp");
+		die(_("cannot mix --fixed-strings and regexp"));
 
 #ifndef NO_PTHREADS
 	if (online_cpus() == 1 || !grep_threads_ok(&opt))
@@ -1034,7 +1034,7 @@ int cmd_grep(int argc, const char **argv, const char *prefix)
 		if (!get_sha1(arg, sha1)) {
 			struct object *object = parse_object(sha1);
 			if (!object)
-				die("bad object %s", arg);
+				die(_("bad object %s"), arg);
 			add_object_array(object, arg, &list);
 			continue;
 		}
@@ -1086,9 +1086,9 @@ int cmd_grep(int argc, const char **argv, const char *prefix)
 
 	if (!use_index) {
 		if (cached)
-			die("--cached cannot be used with --no-index.");
+			die(_("--cached cannot be used with --no-index."));
 		if (list.nr)
-			die("--no-index cannot be used with revs.");
+			die(_("--no-index cannot be used with revs."));
 		hit = grep_directory(&opt, paths);
 	} else if (!list.nr) {
 		if (!cached)
@@ -1097,7 +1097,7 @@ int cmd_grep(int argc, const char **argv, const char *prefix)
 		hit = grep_cache(&opt, paths, cached);
 	} else {
 		if (cached)
-			die("both --cached and trees are given.");
+			die(_("both --cached and trees are given."));
 		hit = grep_objects(&opt, paths, &list);
 	}
 
-- 
1.7.2.3

^ permalink raw reply related	[flat|nested] 222+ messages in thread

* [PATCH 36/72] gettextize: git-grep "--open-files-in-pager" message
  2011-02-19 19:23 [PATCH 00/72] No-op C gettext wrappers Ævar Arnfjörð Bjarmason
                   ` (34 preceding siblings ...)
  2011-02-19 19:24 ` [PATCH 35/72] gettextize: git-grep basic messages Ævar Arnfjörð Bjarmason
@ 2011-02-19 19:24 ` Ævar Arnfjörð Bjarmason
  2011-02-19 19:24 ` [PATCH 37/72] gettextize: git-log basic messages Ævar Arnfjörð Bjarmason
                   ` (36 subsequent siblings)
  72 siblings, 0 replies; 222+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2011-02-19 19:24 UTC (permalink / raw)
  To: git; +Cc: Junio C Hamano, Ævar Arnfjörð Bjarmason

Gettextize the "--open-files-in-pager only works on the worktree"
message. A test in t7811-grep-open.sh explicitly checked for this
message. Change it to skip under GETTEXT_POISON=YesPlease.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
---
 builtin/grep.c       |    2 +-
 t/t7811-grep-open.sh |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/builtin/grep.c b/builtin/grep.c
index d35b76c..dfc32fb 100644
--- a/builtin/grep.c
+++ b/builtin/grep.c
@@ -1061,7 +1061,7 @@ int cmd_grep(int argc, const char **argv, const char *prefix)
 	}
 
 	if (show_in_pager && (cached || list.nr))
-		die("--open-files-in-pager only works on the worktree");
+		die(_("--open-files-in-pager only works on the worktree"));
 
 	if (show_in_pager && opt.pattern_list && !opt.pattern_list->next) {
 		const char *pager = path_list.items[0].string;
diff --git a/t/t7811-grep-open.sh b/t/t7811-grep-open.sh
index 568a6f2..3aa544c 100755
--- a/t/t7811-grep-open.sh
+++ b/t/t7811-grep-open.sh
@@ -61,7 +61,7 @@ test_expect_success SIMPLEPAGER 'git grep -O' '
 	test_cmp empty out
 '
 
-test_expect_success 'git grep -O --cached' '
+test_expect_success NO_GETTEXT_POISON 'git grep -O --cached' '
 	test_must_fail git grep --cached -O GREP_PATTERN >out 2>msg &&
 	grep open-files-in-pager msg
 '
-- 
1.7.2.3

^ permalink raw reply related	[flat|nested] 222+ messages in thread

* [PATCH 37/72] gettextize: git-log basic messages
  2011-02-19 19:23 [PATCH 00/72] No-op C gettext wrappers Ævar Arnfjörð Bjarmason
                   ` (35 preceding siblings ...)
  2011-02-19 19:24 ` [PATCH 36/72] gettextize: git-grep "--open-files-in-pager" message Ævar Arnfjörð Bjarmason
@ 2011-02-19 19:24 ` Ævar Arnfjörð Bjarmason
  2011-02-19 19:24 ` [PATCH 38/72] gettextize: git-log "--OPT does not make sense" messages Ævar Arnfjörð Bjarmason
                   ` (35 subsequent siblings)
  72 siblings, 0 replies; 222+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2011-02-19 19:24 UTC (permalink / raw)
  To: git; +Cc: Junio C Hamano, Ævar Arnfjörð Bjarmason

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
---
 builtin/log.c |   62 ++++++++++++++++++++++++++++----------------------------
 1 files changed, 31 insertions(+), 31 deletions(-)

diff --git a/builtin/log.c b/builtin/log.c
index d8c6c28..b36a01e 100644
--- a/builtin/log.c
+++ b/builtin/log.c
@@ -101,7 +101,7 @@ static void cmd_log_init(int argc, const char **argv, const char *prefix,
 			const char *v = skip_prefix(arg, "--decorate=");
 			decoration_style = parse_decoration_style(arg, v);
 			if (decoration_style < 0)
-				die("invalid --decorate option: %s", arg);
+				die(_("invalid --decorate option: %s"), arg);
 			decoration_given = 1;
 		} else if (!strcmp(arg, "--no-decorate")) {
 			decoration_style = 0;
@@ -110,7 +110,7 @@ static void cmd_log_init(int argc, const char **argv, const char *prefix,
 		} else if (!strcmp(arg, "-h")) {
 			usage(builtin_log_usage);
 		} else
-			die("unrecognized argument: %s", arg);
+			die(_("unrecognized argument: %s"), arg);
 	}
 
 	/*
@@ -153,7 +153,7 @@ static void show_early_header(struct rev_info *rev, const char *stage, int nr)
 		if (rev->commit_format != CMIT_FMT_ONELINE)
 			putchar(rev->diffopt.line_termination);
 	}
-	printf("Final output: %d %s\n", nr, stage);
+	printf(_("Final output: %d %s\n"), nr, stage);
 }
 
 static struct itimerval early_output_timer;
@@ -252,7 +252,7 @@ static int cmd_log_walk(struct rev_info *rev)
 		setup_early_output(rev);
 
 	if (prepare_revision_walk(rev))
-		die("revision walk setup failed");
+		die(_("revision walk setup failed"));
 
 	if (rev->early_output)
 		finish_early_output(rev);
@@ -343,7 +343,7 @@ static int show_object(const unsigned char *sha1, int show_tag_object,
 	int offset = 0;
 
 	if (!buf)
-		return error("Could not read object %s", sha1_to_hex(sha1));
+		return error(_("Could not read object %s"), sha1_to_hex(sha1));
 
 	if (show_tag_object)
 		while (offset < size && buf[offset] != '\n') {
@@ -430,7 +430,7 @@ int cmd_show(int argc, const char **argv, const char *prefix)
 				break;
 			o = parse_object(t->tagged->sha1);
 			if (!o)
-				ret = error("Could not read object %s",
+				ret = error(_("Could not read object %s"),
 					    sha1_to_hex(t->tagged->sha1));
 			objects[i].item = o;
 			i--;
@@ -454,7 +454,7 @@ int cmd_show(int argc, const char **argv, const char *prefix)
 			ret = cmd_log_walk(&rev);
 			break;
 		default:
-			ret = error("Unknown type: %d", o->type);
+			ret = error(_("Unknown type: %d"), o->type);
 		}
 	}
 	free(objects);
@@ -554,7 +554,7 @@ static int git_format_config(const char *var, const char *value, void *cb)
 {
 	if (!strcmp(var, "format.headers")) {
 		if (!value)
-			die("format.headers without value");
+			die(_("format.headers without value"));
 		add_header(value);
 		return 0;
 	}
@@ -626,7 +626,7 @@ static int reopen_stdout(struct commit *commit, struct rev_info *rev)
 		strbuf_addstr(&filename, output_directory);
 		if (filename.len >=
 		    PATH_MAX - FORMAT_PATCH_NAME_MAX - suffix_len)
-			return error("name of output directory is too long");
+			return error(_("name of output directory is too long"));
 		if (filename.buf[filename.len - 1] != '/')
 			strbuf_addch(&filename, '/');
 	}
@@ -637,7 +637,7 @@ static int reopen_stdout(struct commit *commit, struct rev_info *rev)
 		fprintf(realstdout, "%s\n", filename.buf + outdir_offset);
 
 	if (freopen(filename.buf, "w", stdout) == NULL)
-		return error("Cannot open patch file %s", filename.buf);
+		return error(_("Cannot open patch file %s"), filename.buf);
 
 	strbuf_release(&filename);
 	return 0;
@@ -651,7 +651,7 @@ static void get_patch_ids(struct rev_info *rev, struct patch_ids *ids, const cha
 	unsigned flags1, flags2;
 
 	if (rev->pending.nr != 2)
-		die("Need exactly one range.");
+		die(_("Need exactly one range."));
 
 	o1 = rev->pending.objects[0].item;
 	flags1 = o1->flags;
@@ -659,7 +659,7 @@ static void get_patch_ids(struct rev_info *rev, struct patch_ids *ids, const cha
 	flags2 = o2->flags;
 
 	if ((flags1 & UNINTERESTING) == (flags2 & UNINTERESTING))
-		die("Not a range.");
+		die(_("Not a range."));
 
 	init_patch_ids(ids);
 
@@ -670,7 +670,7 @@ static void get_patch_ids(struct rev_info *rev, struct patch_ids *ids, const cha
 	add_pending_object(&check_rev, o1, "o1");
 	add_pending_object(&check_rev, o2, "o2");
 	if (prepare_revision_walk(&check_rev))
-		die("revision walk setup failed");
+		die(_("revision walk setup failed"));
 
 	while ((commit = get_revision(&check_rev)) != NULL) {
 		/* ignore merges */
@@ -696,7 +696,7 @@ static void gen_message_id(struct rev_info *info, char *base)
 	const char *email_end = strrchr(committer, '>');
 	struct strbuf buf = STRBUF_INIT;
 	if (!email_start || !email_end || email_start > email_end - 1)
-		die("Could not extract email from committer identity.");
+		die(_("Could not extract email from committer identity."));
 	strbuf_addf(&buf, "%s.%lu.git.%.*s", base,
 		    (unsigned long) time(NULL),
 		    (int)(email_end - email_start - 1), email_start + 1);
@@ -728,7 +728,7 @@ static void make_cover_letter(struct rev_info *rev, int use_stdout,
 	struct commit *commit = NULL;
 
 	if (rev->commit_format != CMIT_FMT_EMAIL)
-		die("Cover letter needs email format");
+		die(_("Cover letter needs email format"));
 
 	committer = git_committer_info(0);
 
@@ -821,7 +821,7 @@ static const char *clean_message_id(const char *msg_id)
 		m++;
 	}
 	if (!z)
-		die("insane in-reply-to: %s", msg_id);
+		die(_("insane in-reply-to: %s"), msg_id);
 	if (++z == m)
 		return a;
 	return xmemdupz(a, z - a);
@@ -894,7 +894,7 @@ static int output_directory_callback(const struct option *opt, const char *arg,
 {
 	const char **dir = (const char **)opt->value;
 	if (*dir)
-		die("Two output directories?");
+		die(_("Two output directories?"));
 	*dir = arg;
 	return 0;
 }
@@ -1082,7 +1082,7 @@ int cmd_format_patch(int argc, const char **argv, const char *prefix)
 		committer = git_committer_info(IDENT_ERROR_ON_NO_NAME);
 		endpos = strchr(committer, '>');
 		if (!endpos)
-			die("bogus committer info %s", committer);
+			die(_("bogus committer info %s"), committer);
 		add_signoff = xmemdupz(committer, endpos - committer + 1);
 	}
 
@@ -1127,13 +1127,13 @@ int cmd_format_patch(int argc, const char **argv, const char *prefix)
 		numbered = 0;
 
 	if (numbered && keep_subject)
-		die ("-n and -k are mutually exclusive.");
+		die (_("-n and -k are mutually exclusive."));
 	if (keep_subject && subject_prefix)
-		die ("--subject-prefix and -k are mutually exclusive.");
+		die (_("--subject-prefix and -k are mutually exclusive."));
 
 	argc = setup_revisions(argc, argv, &rev, &s_r_opt);
 	if (argc > 1)
-		die ("unrecognized argument: %s", argv[1]);
+		die (_("unrecognized argument: %s"), argv[1]);
 
 	if (rev.diffopt.output_format & DIFF_FORMAT_NAME)
 		die("--name-only does not make sense");
@@ -1163,9 +1163,9 @@ int cmd_format_patch(int argc, const char **argv, const char *prefix)
 
 	if (output_directory) {
 		if (use_stdout)
-			die("standard output, or directory, which one?");
+			die(_("standard output, or directory, which one?"));
 		if (mkdir(output_directory, 0777) < 0 && errno != EEXIST)
-			die_errno("Could not create directory '%s'",
+			die_errno(_("Could not create directory '%s'"),
 				  output_directory);
 	}
 
@@ -1219,7 +1219,7 @@ int cmd_format_patch(int argc, const char **argv, const char *prefix)
 		realstdout = xfdopen(xdup(1), "w");
 
 	if (prepare_revision_walk(&rev))
-		die("revision walk setup failed");
+		die(_("revision walk setup failed"));
 	rev.boundary = 1;
 	while ((commit = get_revision(&rev)) != NULL) {
 		if (commit->object.flags & BOUNDARY) {
@@ -1300,7 +1300,7 @@ int cmd_format_patch(int argc, const char **argv, const char *prefix)
 
 		if (!use_stdout && reopen_stdout(numbered_files ? NULL : commit,
 						 &rev))
-			die("Failed to create output files");
+			die(_("Failed to create output files"));
 		shown = log_tree_commit(&rev, commit);
 		free(commit->buffer);
 		commit->buffer = NULL;
@@ -1387,9 +1387,9 @@ int cmd_cherry(int argc, const char **argv, const char *prefix)
 		if (!current_branch || !current_branch->merge
 					|| !current_branch->merge[0]
 					|| !current_branch->merge[0]->dst) {
-			fprintf(stderr, "Could not find a tracked"
+			fprintf(stderr, _("Could not find a tracked"
 					" remote branch, please"
-					" specify <upstream> manually.\n");
+					" specify <upstream> manually.\n"));
 			usage_with_options(cherry_usage, options);
 		}
 
@@ -1403,9 +1403,9 @@ int cmd_cherry(int argc, const char **argv, const char *prefix)
 	DIFF_OPT_SET(&revs.diffopt, RECURSIVE);
 
 	if (add_pending_commit(head, &revs, 0))
-		die("Unknown commit %s", head);
+		die(_("Unknown commit %s"), head);
 	if (add_pending_commit(upstream, &revs, UNINTERESTING))
-		die("Unknown commit %s", upstream);
+		die(_("Unknown commit %s"), upstream);
 
 	/* Don't say anything if head and upstream are the same. */
 	if (revs.pending.nr == 2) {
@@ -1417,11 +1417,11 @@ int cmd_cherry(int argc, const char **argv, const char *prefix)
 	get_patch_ids(&revs, &ids, prefix);
 
 	if (limit && add_pending_commit(limit, &revs, UNINTERESTING))
-		die("Unknown commit %s", limit);
+		die(_("Unknown commit %s"), limit);
 
 	/* reverse the list of commits */
 	if (prepare_revision_walk(&revs))
-		die("revision walk setup failed");
+		die(_("revision walk setup failed"));
 	while ((commit = get_revision(&revs)) != NULL) {
 		/* ignore merges */
 		if (commit->parents && commit->parents->next)
-- 
1.7.2.3

^ permalink raw reply related	[flat|nested] 222+ messages in thread

* [PATCH 38/72] gettextize: git-log "--OPT does not make sense" messages
  2011-02-19 19:23 [PATCH 00/72] No-op C gettext wrappers Ævar Arnfjörð Bjarmason
                   ` (36 preceding siblings ...)
  2011-02-19 19:24 ` [PATCH 37/72] gettextize: git-log basic messages Ævar Arnfjörð Bjarmason
@ 2011-02-19 19:24 ` Ævar Arnfjörð Bjarmason
  2011-02-19 19:24 ` [PATCH 39/72] gettextize: git-merge basic messages Ævar Arnfjörð Bjarmason
                   ` (34 subsequent siblings)
  72 siblings, 0 replies; 222+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2011-02-19 19:24 UTC (permalink / raw)
  To: git; +Cc: Junio C Hamano, Ævar Arnfjörð Bjarmason

Gettextize the "--name-only/--name-status/--check does not make sense"
messages. A test in t4014-format-patch.sh explicitly checked for these
messages. Change them to skip under GETTEXT_POISON=YesPlease.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
---
 builtin/log.c           |    6 +++---
 t/t4014-format-patch.sh |    2 +-
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/builtin/log.c b/builtin/log.c
index b36a01e..853f5d0 100644
--- a/builtin/log.c
+++ b/builtin/log.c
@@ -1136,11 +1136,11 @@ int cmd_format_patch(int argc, const char **argv, const char *prefix)
 		die (_("unrecognized argument: %s"), argv[1]);
 
 	if (rev.diffopt.output_format & DIFF_FORMAT_NAME)
-		die("--name-only does not make sense");
+		die(_("--name-only does not make sense"));
 	if (rev.diffopt.output_format & DIFF_FORMAT_NAME_STATUS)
-		die("--name-status does not make sense");
+		die(_("--name-status does not make sense"));
 	if (rev.diffopt.output_format & DIFF_FORMAT_CHECKDIFF)
-		die("--check does not make sense");
+		die(_("--check does not make sense"));
 
 	if (!use_patch_format &&
 		(!rev.diffopt.output_format ||
diff --git a/t/t4014-format-patch.sh b/t/t4014-format-patch.sh
index 027c13d..3b182f5 100755
--- a/t/t4014-format-patch.sh
+++ b/t/t4014-format-patch.sh
@@ -614,7 +614,7 @@ echo "fatal: --name-only does not make sense" > expect.name-only
 echo "fatal: --name-status does not make sense" > expect.name-status
 echo "fatal: --check does not make sense" > expect.check
 
-test_expect_success 'options no longer allowed for format-patch' '
+test_expect_success NO_GETTEXT_POISON 'options no longer allowed for format-patch' '
 	test_must_fail git format-patch --name-only 2> output &&
 	test_cmp expect.name-only output &&
 	test_must_fail git format-patch --name-status 2> output &&
-- 
1.7.2.3

^ permalink raw reply related	[flat|nested] 222+ messages in thread

* [PATCH 39/72] gettextize: git-merge basic messages
  2011-02-19 19:23 [PATCH 00/72] No-op C gettext wrappers Ævar Arnfjörð Bjarmason
                   ` (37 preceding siblings ...)
  2011-02-19 19:24 ` [PATCH 38/72] gettextize: git-log "--OPT does not make sense" messages Ævar Arnfjörð Bjarmason
@ 2011-02-19 19:24 ` Ævar Arnfjörð Bjarmason
  2011-02-19 19:24 ` [PATCH 40/72] gettextize: git-merge "Updating %s..%s" message Ævar Arnfjörð Bjarmason
                   ` (33 subsequent siblings)
  72 siblings, 0 replies; 222+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2011-02-19 19:24 UTC (permalink / raw)
  To: git; +Cc: Junio C Hamano, Ævar Arnfjörð Bjarmason

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
---
 builtin/merge.c            |  124 ++++++++++++++++++++++----------------------
 t/t7607-merge-overwrite.sh |   10 +++-
 t/t7611-merge-abort.sh     |   20 ++++++--
 3 files changed, 86 insertions(+), 68 deletions(-)

diff --git a/builtin/merge.c b/builtin/merge.c
index 8c58c3c..0be4dfa 100644
--- a/builtin/merge.c
+++ b/builtin/merge.c
@@ -80,7 +80,7 @@ static int option_parse_message(const struct option *opt,
 		strbuf_addf(buf, "%s%s", buf->len ? "\n\n" : "", arg);
 		have_message = 1;
 	} else
-		return error("switch `m' requires a value");
+		return error(_("switch `m' requires a value"));
 	return 0;
 }
 
@@ -117,13 +117,13 @@ static struct strategy *get_strategy(const char *name)
 		exclude_cmds(&main_cmds, &not_strategies);
 	}
 	if (!is_in_cmdlist(&main_cmds, name) && !is_in_cmdlist(&other_cmds, name)) {
-		fprintf(stderr, "Could not find merge strategy '%s'.\n", name);
-		fprintf(stderr, "Available strategies are:");
+		fprintf(stderr, _("Could not find merge strategy '%s'.\n"), name);
+		fprintf(stderr, _("Available strategies are:"));
 		for (i = 0; i < main_cmds.cnt; i++)
 			fprintf(stderr, " %s", main_cmds.names[i]->name);
 		fprintf(stderr, ".\n");
 		if (other_cmds.cnt) {
-			fprintf(stderr, "Available custom strategies are:");
+			fprintf(stderr, _("Available custom strategies are:"));
 			for (i = 0; i < other_cmds.cnt; i++)
 				fprintf(stderr, " %s", other_cmds.names[i]->name);
 			fprintf(stderr, ".\n");
@@ -224,17 +224,17 @@ static void save_state(void)
 	cp.git_cmd = 1;
 
 	if (start_command(&cp))
-		die("could not run stash.");
+		die(_("could not run stash."));
 	len = strbuf_read(&buffer, cp.out, 1024);
 	close(cp.out);
 
 	if (finish_command(&cp) || len < 0)
-		die("stash failed");
+		die(_("stash failed"));
 	else if (!len)
 		return;
 	strbuf_setlen(&buffer, buffer.len-1);
 	if (get_sha1(buffer.buf, stash))
-		die("not a valid object: %s", buffer.buf);
+		die(_("not a valid object: %s"), buffer.buf);
 }
 
 static void read_empty(unsigned const char *sha1, int verbose)
@@ -252,7 +252,7 @@ static void read_empty(unsigned const char *sha1, int verbose)
 	args[i] = NULL;
 
 	if (run_command_v_opt(args, RUN_GIT_CMD))
-		die("read-tree failed");
+		die(_("read-tree failed"));
 }
 
 static void reset_hard(unsigned const char *sha1, int verbose)
@@ -269,7 +269,7 @@ static void reset_hard(unsigned const char *sha1, int verbose)
 	args[i] = NULL;
 
 	if (run_command_v_opt(args, RUN_GIT_CMD))
-		die("read-tree failed");
+		die(_("read-tree failed"));
 }
 
 static void restore_state(void)
@@ -298,7 +298,7 @@ static void restore_state(void)
 static void finish_up_to_date(const char *msg)
 {
 	if (verbosity >= 0)
-		printf("%s%s\n", squash ? " (nothing to squash)" : "", msg);
+		printf("%s%s\n", squash ? _(" (nothing to squash)") : "", msg);
 	drop_save();
 }
 
@@ -311,10 +311,10 @@ static void squash_message(void)
 	int fd;
 	struct pretty_print_context ctx = {0};
 
-	printf("Squash commit -- not updating HEAD\n");
+	printf(_("Squash commit -- not updating HEAD\n"));
 	fd = open(git_path("SQUASH_MSG"), O_WRONLY | O_CREAT, 0666);
 	if (fd < 0)
-		die_errno("Could not write to '%s'", git_path("SQUASH_MSG"));
+		die_errno(_("Could not write to '%s'"), git_path("SQUASH_MSG"));
 
 	init_revisions(&rev, NULL);
 	rev.ignore_merges = 1;
@@ -329,7 +329,7 @@ static void squash_message(void)
 
 	setup_revisions(0, NULL, &rev, NULL);
 	if (prepare_revision_walk(&rev))
-		die("revision walk setup failed");
+		die(_("revision walk setup failed"));
 
 	ctx.abbrev = rev.abbrev;
 	ctx.date_mode = rev.date_mode;
@@ -342,9 +342,9 @@ static void squash_message(void)
 		pretty_print_commit(rev.commit_format, commit, &out, &ctx);
 	}
 	if (write(fd, out.buf, out.len) < 0)
-		die_errno("Writing SQUASH_MSG");
+		die_errno(_("Writing SQUASH_MSG"));
 	if (close(fd))
-		die_errno("Finishing SQUASH_MSG");
+		die_errno(_("Finishing SQUASH_MSG"));
 	strbuf_release(&out);
 }
 
@@ -364,7 +364,7 @@ static void finish(const unsigned char *new_head, const char *msg)
 		squash_message();
 	} else {
 		if (verbosity >= 0 && !merge_msg.len)
-			printf("No merge message -- not updating HEAD\n");
+			printf(_("No merge message -- not updating HEAD\n"));
 		else {
 			const char *argv_gc_auto[] = { "gc", "--auto", NULL };
 			update_ref(reflog_message.buf, "HEAD",
@@ -386,7 +386,7 @@ static void finish(const unsigned char *new_head, const char *msg)
 		if (diff_use_color_default > 0)
 			DIFF_OPT_SET(&opts, COLOR_DIFF);
 		if (diff_setup_done(&opts) < 0)
-			die("diff_setup_done failed");
+			die(_("diff_setup_done failed"));
 		diff_tree_sha1(head, new_head, "", &opts);
 		diffcore_std(&opts);
 		diff_flush(&opts);
@@ -415,7 +415,7 @@ static void merge_name(const char *remote, struct strbuf *msg)
 	memset(branch_head, 0, sizeof(branch_head));
 	remote_head = peel_to_type(remote, 0, NULL, OBJ_COMMIT);
 	if (!remote_head)
-		die("'%s' does not point to a commit", remote);
+		die(_("'%s' does not point to a commit"), remote);
 
 	if (dwim_ref(remote, strlen(remote), branch_head, &found_ref) > 0) {
 		if (!prefixcmp(found_ref, "refs/heads/")) {
@@ -480,7 +480,7 @@ static void merge_name(const char *remote, struct strbuf *msg)
 
 		fp = fopen(git_path("FETCH_HEAD"), "r");
 		if (!fp)
-			die_errno("could not open '%s' for reading",
+			die_errno(_("could not open '%s' for reading"),
 				  git_path("FETCH_HEAD"));
 		strbuf_getline(&line, fp, '\n');
 		fclose(fp);
@@ -510,7 +510,7 @@ static int git_merge_config(const char *k, const char *v, void *cb)
 		buf = xstrdup(v);
 		argc = split_cmdline(buf, &argv);
 		if (argc < 0)
-			die("Bad branch.%s.mergeoptions string: %s", branch,
+			die(_("Bad branch.%s.mergeoptions string: %s"), branch,
 			    split_cmdline_strerror(argc));
 		argv = xrealloc(argv, sizeof(*argv) * (argc + 2));
 		memmove(argv + 1, argv, sizeof(*argv) * (argc + 1));
@@ -532,7 +532,7 @@ static int git_merge_config(const char *k, const char *v, void *cb)
 		int is_bool;
 		shortlog_len = git_config_bool_or_int(k, v, &is_bool);
 		if (!is_bool && shortlog_len < 0)
-			return error("%s: negative length %s", k, v);
+			return error(_("%s: negative length %s"), k, v);
 		if (is_bool && shortlog_len)
 			shortlog_len = DEFAULT_MERGE_LOG_LEN;
 		return 0;
@@ -579,7 +579,7 @@ static int read_tree_trivial(unsigned char *common, unsigned char *head,
 static void write_tree_trivial(unsigned char *sha1)
 {
 	if (write_cache_as_tree(sha1, 0, NULL))
-		die("git write-tree failed to write a tree");
+		die(_("git write-tree failed to write a tree"));
 }
 
 int try_merge_command(const char *strategy, size_t xopts_nr,
@@ -621,7 +621,7 @@ int try_merge_command(const char *strategy, size_t xopts_nr,
 	free(args);
 	discard_cache();
 	if (read_cache() < 0)
-		die("failed to read the cache");
+		die(_("failed to read the cache"));
 	resolve_undo_clear();
 
 	return ret;
@@ -638,7 +638,7 @@ static int try_merge_strategy(const char *strategy, struct commit_list *common,
 	if (active_cache_changed &&
 			(write_cache(index_fd, active_cache, active_nr) ||
 			 commit_locked_index(lock)))
-		return error("Unable to write index.");
+		return error(_("Unable to write index."));
 	rollback_lock_file(lock);
 
 	if (!strcmp(strategy, "recursive") || !strcmp(strategy, "subtree")) {
@@ -651,7 +651,7 @@ static int try_merge_strategy(const char *strategy, struct commit_list *common,
 		struct commit_list *j;
 
 		if (remoteheads->next) {
-			error("Not handling anything other than two heads merge.");
+			error(_("Not handling anything other than two heads merge."));
 			return 2;
 		}
 
@@ -663,7 +663,7 @@ static int try_merge_strategy(const char *strategy, struct commit_list *common,
 
 		for (x = 0; x < xopts_nr; x++)
 			if (parse_merge_opt(&o, xopts[x]))
-				die("Unknown option for merge-recursive: -X%s", xopts[x]);
+				die(_("Unknown option for merge-recursive: -X%s"), xopts[x]);
 
 		o.branch1 = head_arg;
 		o.branch2 = remoteheads->item->util;
@@ -677,7 +677,7 @@ static int try_merge_strategy(const char *strategy, struct commit_list *common,
 		if (active_cache_changed &&
 				(write_cache(index_fd, active_cache, active_nr) ||
 				 commit_locked_index(lock)))
-			die ("unable to write %s", get_index_file());
+			die (_("unable to write %s"), get_index_file());
 		rollback_lock_file(lock);
 		return clean ? 0 : 1;
 	} else {
@@ -749,7 +749,7 @@ int checkout_fast_forward(const unsigned char *head, const unsigned char *remote
 		return -1;
 	if (write_cache(fd, active_cache, active_nr) ||
 		commit_locked_index(lock_file))
-		die("unable to write new index file");
+		die(_("unable to write new index file"));
 	return 0;
 }
 
@@ -852,7 +852,7 @@ static int suggest_conflicts(int renormalizing)
 
 	fp = fopen(git_path("MERGE_MSG"), "a");
 	if (!fp)
-		die_errno("Could not open '%s' for writing",
+		die_errno(_("Could not open '%s' for writing"),
 			  git_path("MERGE_MSG"));
 	fprintf(fp, "\nConflicts:\n");
 	for (pos = 0; pos < active_nr; pos++) {
@@ -868,8 +868,8 @@ static int suggest_conflicts(int renormalizing)
 	}
 	fclose(fp);
 	rerere(allow_rerere_auto);
-	printf("Automatic merge failed; "
-			"fix conflicts and then commit the result.\n");
+	printf(_("Automatic merge failed; "
+			"fix conflicts and then commit the result.\n"));
 	return 1;
 }
 
@@ -883,7 +883,7 @@ static struct commit *is_old_style_invocation(int argc, const char **argv)
 			return NULL;
 		second_token = lookup_commit_reference_gently(second_sha1, 0);
 		if (!second_token)
-			die("'%s' is not a commit", argv[1]);
+			die(_("'%s' is not a commit"), argv[1]);
 		if (hashcmp(second_token->object.sha1, head))
 			return NULL;
 	}
@@ -951,7 +951,7 @@ int cmd_merge(int argc, const char **argv, const char *prefix)
 		const char *nargv[] = {"reset", "--merge", NULL};
 
 		if (!file_exists(git_path("MERGE_HEAD")))
-			die("There is no merge to abort (MERGE_HEAD missing).");
+			die(_("There is no merge to abort (MERGE_HEAD missing)."));
 
 		/* Invoke 'git reset --merge' */
 		return cmd_reset(nargc, nargv, prefix);
@@ -966,10 +966,10 @@ int cmd_merge(int argc, const char **argv, const char *prefix)
 		 * add/rm <file>', just 'git commit'.
 		 */
 		if (advice_resolve_conflict)
-			die("You have not concluded your merge (MERGE_HEAD exists).\n"
-			    "Please, commit your changes before you can merge.");
+			die(_("You have not concluded your merge (MERGE_HEAD exists).\n"
+				  "Please, commit your changes before you can merge."));
 		else
-			die("You have not concluded your merge (MERGE_HEAD exists).");
+			die(_("You have not concluded your merge (MERGE_HEAD exists)."));
 	}
 	resolve_undo_clear();
 
@@ -978,12 +978,12 @@ int cmd_merge(int argc, const char **argv, const char *prefix)
 
 	if (squash) {
 		if (!allow_fast_forward)
-			die("You cannot combine --squash with --no-ff.");
+			die(_("You cannot combine --squash with --no-ff."));
 		option_commit = 0;
 	}
 
 	if (!allow_fast_forward && fast_forward_only)
-		die("You cannot combine --no-ff with --ff-only.");
+		die(_("You cannot combine --no-ff with --ff-only."));
 
 	if (!argc)
 		usage_with_options(builtin_merge_usage,
@@ -1011,16 +1011,16 @@ int cmd_merge(int argc, const char **argv, const char *prefix)
 		 * We do the same for "git pull".
 		 */
 		if (argc != 1)
-			die("Can merge only exactly one commit into "
-				"empty head");
+			die(_("Can merge only exactly one commit into "
+				"empty head"));
 		if (squash)
-			die("Squash commit into empty head not supported yet");
+			die(_("Squash commit into empty head not supported yet"));
 		if (!allow_fast_forward)
-			die("Non-fast-forward commit does not make sense into "
-			    "an empty head");
+			die(_("Non-fast-forward commit does not make sense into "
+			    "an empty head"));
 		remote_head = peel_to_type(argv[0], 0, NULL, OBJ_COMMIT);
 		if (!remote_head)
-			die("%s - not something we can merge", argv[0]);
+			die(_("%s - not something we can merge"), argv[0]);
 		update_ref("initial pull", "HEAD", remote_head->sha1, NULL, 0,
 				DIE_ON_ERR);
 		read_empty(remote_head->sha1, 0);
@@ -1066,7 +1066,7 @@ int cmd_merge(int argc, const char **argv, const char *prefix)
 
 		o = peel_to_type(argv[i], 0, NULL, OBJ_COMMIT);
 		if (!o)
-			die("%s - not something we can merge", argv[i]);
+			die(_("%s - not something we can merge"), argv[i]);
 		commit = lookup_commit(o->sha1);
 		commit->util = (void *)argv[i];
 		remotes = &commit_list_insert(commit, remotes)->next;
@@ -1158,11 +1158,11 @@ int cmd_merge(int argc, const char **argv, const char *prefix)
 		if (allow_trivial && !fast_forward_only) {
 			/* See if it is really trivial. */
 			git_committer_info(IDENT_ERROR_ON_NO_NAME);
-			printf("Trying really trivial in-index merge...\n");
+			printf(_("Trying really trivial in-index merge...\n"));
 			if (!read_tree_trivial(common->item->object.sha1,
 					head, remoteheads->item->object.sha1))
 				return merge_trivial();
-			printf("Nope.\n");
+			printf(_("Nope.\n"));
 		}
 	} else {
 		/*
@@ -1195,7 +1195,7 @@ int cmd_merge(int argc, const char **argv, const char *prefix)
 	}
 
 	if (fast_forward_only)
-		die("Not possible to fast-forward, aborting.");
+		die(_("Not possible to fast-forward, aborting."));
 
 	/* We are going to make a new commit. */
 	git_committer_info(IDENT_ERROR_ON_NO_NAME);
@@ -1221,11 +1221,11 @@ int cmd_merge(int argc, const char **argv, const char *prefix)
 	for (i = 0; i < use_strategies_nr; i++) {
 		int ret;
 		if (i) {
-			printf("Rewinding the tree to pristine...\n");
+			printf(_("Rewinding the tree to pristine...\n"));
 			restore_state();
 		}
 		if (use_strategies_nr != 1)
-			printf("Trying merge strategy %s...\n",
+			printf(_("Trying merge strategy %s...\n"),
 				use_strategies[i]->name);
 		/*
 		 * Remember which strategy left the state in the working
@@ -1286,17 +1286,17 @@ int cmd_merge(int argc, const char **argv, const char *prefix)
 		restore_state();
 		if (use_strategies_nr > 1)
 			fprintf(stderr,
-				"No merge strategy handled the merge.\n");
+				_("No merge strategy handled the merge.\n"));
 		else
-			fprintf(stderr, "Merge with strategy %s failed.\n",
+			fprintf(stderr, _("Merge with strategy %s failed.\n"),
 				use_strategies[0]->name);
 		return 2;
 	} else if (best_strategy == wt_strategy)
 		; /* We already have its result in the working tree. */
 	else {
-		printf("Rewinding the tree to pristine...\n");
+		printf(_("Rewinding the tree to pristine...\n"));
 		restore_state();
-		printf("Using the %s to prepare resolving by hand.\n",
+		printf(_("Using the %s to prepare resolving by hand.\n"),
 			best_strategy);
 		try_merge_strategy(best_strategy, common, head_arg);
 	}
@@ -1312,35 +1312,35 @@ int cmd_merge(int argc, const char **argv, const char *prefix)
 				sha1_to_hex(j->item->object.sha1));
 		fd = open(git_path("MERGE_HEAD"), O_WRONLY | O_CREAT, 0666);
 		if (fd < 0)
-			die_errno("Could not open '%s' for writing",
+			die_errno(_("Could not open '%s' for writing"),
 				  git_path("MERGE_HEAD"));
 		if (write_in_full(fd, buf.buf, buf.len) != buf.len)
-			die_errno("Could not write to '%s'", git_path("MERGE_HEAD"));
+			die_errno(_("Could not write to '%s'"), git_path("MERGE_HEAD"));
 		close(fd);
 		strbuf_addch(&merge_msg, '\n');
 		fd = open(git_path("MERGE_MSG"), O_WRONLY | O_CREAT, 0666);
 		if (fd < 0)
-			die_errno("Could not open '%s' for writing",
+			die_errno(_("Could not open '%s' for writing"),
 				  git_path("MERGE_MSG"));
 		if (write_in_full(fd, merge_msg.buf, merge_msg.len) !=
 			merge_msg.len)
-			die_errno("Could not write to '%s'", git_path("MERGE_MSG"));
+			die_errno(_("Could not write to '%s'"), git_path("MERGE_MSG"));
 		close(fd);
 		fd = open(git_path("MERGE_MODE"), O_WRONLY | O_CREAT | O_TRUNC, 0666);
 		if (fd < 0)
-			die_errno("Could not open '%s' for writing",
+			die_errno(_("Could not open '%s' for writing"),
 				  git_path("MERGE_MODE"));
 		strbuf_reset(&buf);
 		if (!allow_fast_forward)
 			strbuf_addf(&buf, "no-ff");
 		if (write_in_full(fd, buf.buf, buf.len) != buf.len)
-			die_errno("Could not write to '%s'", git_path("MERGE_MODE"));
+			die_errno(_("Could not write to '%s'"), git_path("MERGE_MODE"));
 		close(fd);
 	}
 
 	if (merge_was_ok) {
-		fprintf(stderr, "Automatic merge went well; "
-			"stopped before committing as requested\n");
+		fprintf(stderr, _("Automatic merge went well; "
+			"stopped before committing as requested\n"));
 		return 0;
 	} else
 		return suggest_conflicts(option_renormalize);
diff --git a/t/t7607-merge-overwrite.sh b/t/t7607-merge-overwrite.sh
index 5f731a1..ccd5a56 100755
--- a/t/t7607-merge-overwrite.sh
+++ b/t/t7607-merge-overwrite.sh
@@ -150,8 +150,14 @@ test_expect_success 'will not overwrite untracked file on unborn branch' '
 	git rm -fr . &&
 	git checkout --orphan new &&
 	cp important c0.c &&
-	test_must_fail git merge c0 2>out &&
-	test_cmp out expect &&
+	test_must_fail git merge c0 2>out
+'
+
+test_expect_success NO_GETTEXT_POISON 'will not overwrite untracked file on unborn branch: output' '
+	test_cmp out expect
+'
+
+test_expect_success 'will not overwrite untracked file on unborn branch .git/MERGE_HEAD sanity etc.' '
 	test_path_is_missing .git/MERGE_HEAD &&
 	test_cmp important c0.c
 '
diff --git a/t/t7611-merge-abort.sh b/t/t7611-merge-abort.sh
index 61890bc..760271c 100755
--- a/t/t7611-merge-abort.sh
+++ b/t/t7611-merge-abort.sh
@@ -46,8 +46,14 @@ test_expect_success 'setup' '
 pre_merge_head="$(git rev-parse HEAD)"
 
 test_expect_success 'fails without MERGE_HEAD (unstarted merge)' '
-	test_must_fail git merge --abort 2>output &&
-	grep -q MERGE_HEAD output &&
+	test_must_fail git merge --abort 2>output
+'
+
+test_expect_success NO_GETTEXT_POISON 'fails without MERGE_HEAD (unstarted merge): fatal output' '
+	grep -q MERGE_HEAD output
+'
+
+test_expect_success 'fails without MERGE_HEAD (unstarted merge): .git/MERGE_HEAD sanity' '
 	test ! -f .git/MERGE_HEAD &&
 	test "$pre_merge_head" = "$(git rev-parse HEAD)"
 '
@@ -57,8 +63,14 @@ test_expect_success 'fails without MERGE_HEAD (completed merge)' '
 	test ! -f .git/MERGE_HEAD &&
 	# Merge successfully completed
 	post_merge_head="$(git rev-parse HEAD)" &&
-	test_must_fail git merge --abort 2>output &&
-	grep -q MERGE_HEAD output &&
+	test_must_fail git merge --abort 2>output
+'
+
+test_expect_success NO_GETTEXT_POISON 'fails without MERGE_HEAD (completed merge): output' '
+	grep -q MERGE_HEAD output
+'
+
+test_expect_success 'fails without MERGE_HEAD (completed merge): .git/MERGE_HEAD sanity' '
 	test ! -f .git/MERGE_HEAD &&
 	test "$post_merge_head" = "$(git rev-parse HEAD)"
 '
-- 
1.7.2.3

^ permalink raw reply related	[flat|nested] 222+ messages in thread

* [PATCH 40/72] gettextize: git-merge "Updating %s..%s" message
  2011-02-19 19:23 [PATCH 00/72] No-op C gettext wrappers Ævar Arnfjörð Bjarmason
                   ` (38 preceding siblings ...)
  2011-02-19 19:24 ` [PATCH 39/72] gettextize: git-merge basic messages Ævar Arnfjörð Bjarmason
@ 2011-02-19 19:24 ` Ævar Arnfjörð Bjarmason
  2011-02-19 19:24 ` [PATCH 41/72] gettextize: git-merge "You have not concluded your merge" messages Ævar Arnfjörð Bjarmason
                   ` (32 subsequent siblings)
  72 siblings, 0 replies; 222+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2011-02-19 19:24 UTC (permalink / raw)
  To: git; +Cc: Junio C Hamano, Ævar Arnfjörð Bjarmason

Gettextize the "Updating %s..%s\n" message. A test in
t1200-tutorial.sh explicitly checked for this message. Split it into
two tests to skip the test_cmp test under GETTEXT_POISON=YesPlease.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
---
 builtin/merge.c     |    2 +-
 t/t1200-tutorial.sh |    5 ++++-
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/builtin/merge.c b/builtin/merge.c
index 0be4dfa..4f6b34f 100644
--- a/builtin/merge.c
+++ b/builtin/merge.c
@@ -1124,7 +1124,7 @@ int cmd_merge(int argc, const char **argv, const char *prefix)
 		strcpy(hex, find_unique_abbrev(head, DEFAULT_ABBREV));
 
 		if (verbosity >= 0)
-			printf("Updating %s..%s\n",
+			printf(_("Updating %s..%s\n"),
 				hex,
 				find_unique_abbrev(remoteheads->item->object.sha1,
 				DEFAULT_ABBREV));
diff --git a/t/t1200-tutorial.sh b/t/t1200-tutorial.sh
index bfa2c21..fb02cac 100755
--- a/t/t1200-tutorial.sh
+++ b/t/t1200-tutorial.sh
@@ -163,7 +163,10 @@ test_expect_success 'git resolve' '
 	git checkout mybranch &&
 	git merge -m "Merge upstream changes." master |
 		sed -e "1s/[0-9a-f]\{7\}/VARIABLE/g" \
-		-e "s/^Fast[- ]forward /FASTFORWARD /" >resolve.output &&
+		-e "s/^Fast[- ]forward /FASTFORWARD /" >resolve.output
+'
+
+test_expect_success NO_GETTEXT_POISON 'git resolve output' '
 	test_cmp resolve.expect resolve.output
 '
 
-- 
1.7.2.3

^ permalink raw reply related	[flat|nested] 222+ messages in thread

* [PATCH 41/72] gettextize: git-merge "You have not concluded your merge" messages
  2011-02-19 19:23 [PATCH 00/72] No-op C gettext wrappers Ævar Arnfjörð Bjarmason
                   ` (39 preceding siblings ...)
  2011-02-19 19:24 ` [PATCH 40/72] gettextize: git-merge "Updating %s..%s" message Ævar Arnfjörð Bjarmason
@ 2011-02-19 19:24 ` Ævar Arnfjörð Bjarmason
  2011-02-19 19:24 ` [PATCH 42/72] gettextize: git-merge "Wonderful" message Ævar Arnfjörð Bjarmason
                   ` (31 subsequent siblings)
  72 siblings, 0 replies; 222+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2011-02-19 19:24 UTC (permalink / raw)
  To: git; +Cc: Junio C Hamano, Ævar Arnfjörð Bjarmason

Gettextize the "You have not concluded your merge messages. A test in
t3030-merge-recursive.sh explicitly checked for this message. Change
it to skip the test under GETTEXT_POISON=YesPlease.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
---
 t/t3030-merge-recursive.sh |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/t/t3030-merge-recursive.sh b/t/t3030-merge-recursive.sh
index 34794f8..d441036 100755
--- a/t/t3030-merge-recursive.sh
+++ b/t/t3030-merge-recursive.sh
@@ -312,7 +312,7 @@ test_expect_success 'merge-recursive result' '
 
 '
 
-test_expect_success 'fail if the index has unresolved entries' '
+test_expect_success NO_GETTEXT_POISON 'fail if the index has unresolved entries' '
 
 	rm -fr [abcd] &&
 	git checkout -f "$c1" &&
-- 
1.7.2.3

^ permalink raw reply related	[flat|nested] 222+ messages in thread

* [PATCH 42/72] gettextize: git-merge "Wonderful" message
  2011-02-19 19:23 [PATCH 00/72] No-op C gettext wrappers Ævar Arnfjörð Bjarmason
                   ` (40 preceding siblings ...)
  2011-02-19 19:24 ` [PATCH 41/72] gettextize: git-merge "You have not concluded your merge" messages Ævar Arnfjörð Bjarmason
@ 2011-02-19 19:24 ` Ævar Arnfjörð Bjarmason
  2011-02-19 19:24 ` [PATCH 43/72] gettextize: git-mv basic messages Ævar Arnfjörð Bjarmason
                   ` (30 subsequent siblings)
  72 siblings, 0 replies; 222+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2011-02-19 19:24 UTC (permalink / raw)
  To: git; +Cc: Junio C Hamano, Ævar Arnfjörð Bjarmason

Gettextize the "Wonderful" message. A test in t7600-merge.sh
explicitly checked for this message. Change it to skip under
GETTEXT_POISON=YesPlease.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
---
 builtin/merge.c  |    2 +-
 t/t7600-merge.sh |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/builtin/merge.c b/builtin/merge.c
index 4f6b34f..f998206 100644
--- a/builtin/merge.c
+++ b/builtin/merge.c
@@ -803,7 +803,7 @@ static int merge_trivial(void)
 	struct commit_list *parent = xmalloc(sizeof(*parent));
 
 	write_tree_trivial(result_tree);
-	printf("Wonderful.\n");
+	printf(_("Wonderful.\n"));
 	parent->item = lookup_commit(head);
 	parent->next = xmalloc(sizeof(*parent->next));
 	parent->next->item = remoteheads->item;
diff --git a/t/t7600-merge.sh b/t/t7600-merge.sh
index b147a1b..3aafdda 100755
--- a/t/t7600-merge.sh
+++ b/t/t7600-merge.sh
@@ -495,7 +495,7 @@ test_expect_success 'merge fast-forward in a dirty tree' '
 
 test_debug 'git log --graph --decorate --oneline --all'
 
-test_expect_success 'in-index merge' '
+test_expect_success NO_GETTEXT_POISON 'in-index merge' '
 	git reset --hard c0 &&
 	git merge --no-ff -s resolve c1 >out &&
 	grep "Wonderful." out &&
-- 
1.7.2.3

^ permalink raw reply related	[flat|nested] 222+ messages in thread

* [PATCH 43/72] gettextize: git-mv basic messages
  2011-02-19 19:23 [PATCH 00/72] No-op C gettext wrappers Ævar Arnfjörð Bjarmason
                   ` (41 preceding siblings ...)
  2011-02-19 19:24 ` [PATCH 42/72] gettextize: git-merge "Wonderful" message Ævar Arnfjörð Bjarmason
@ 2011-02-19 19:24 ` Ævar Arnfjörð Bjarmason
  2011-02-19 19:24 ` [PATCH 44/72] gettextize: git-mv "bad" messages Ævar Arnfjörð Bjarmason
                   ` (29 subsequent siblings)
  72 siblings, 0 replies; 222+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2011-02-19 19:24 UTC (permalink / raw)
  To: git; +Cc: Junio C Hamano, Ævar Arnfjörð Bjarmason

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
---
 builtin/mv.c |   16 ++++++++--------
 1 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/builtin/mv.c b/builtin/mv.c
index 93e8995..18a2218 100644
--- a/builtin/mv.c
+++ b/builtin/mv.c
@@ -74,7 +74,7 @@ int cmd_mv(int argc, const char **argv, const char *prefix)
 
 	newfd = hold_locked_index(&lock_file, 1);
 	if (read_cache() < 0)
-		die("index file corrupt");
+		die(_("index file corrupt"));
 
 	source = copy_pathspec(prefix, argv, argc, 0);
 	modes = xcalloc(argc, sizeof(enum update_mode));
@@ -100,7 +100,7 @@ int cmd_mv(int argc, const char **argv, const char *prefix)
 		const char *bad = NULL;
 
 		if (show_only)
-			printf("Checking rename of '%s' to '%s'\n", src, dst);
+			printf(_("Checking rename of '%s' to '%s'\n"), src, dst);
 
 		length = strlen(src);
 		if (lstat(src, &st) < 0)
@@ -120,7 +120,7 @@ int cmd_mv(int argc, const char **argv, const char *prefix)
 
 			first = cache_name_pos(src_w_slash, len_w_slash);
 			if (first >= 0)
-				die ("Huh? %.*s is in index?",
+				die (_("Huh? %.*s is in index?"),
 						len_w_slash, src_w_slash);
 
 			first = -1 - first;
@@ -172,7 +172,7 @@ int cmd_mv(int argc, const char **argv, const char *prefix)
 				 * check both source and destination
 				 */
 				if (S_ISREG(st.st_mode) || S_ISLNK(st.st_mode)) {
-					warning("%s; will overwrite!", bad);
+					warning(_("%s; will overwrite!"), bad);
 					bad = NULL;
 				} else
 					bad = "Cannot overwrite";
@@ -193,7 +193,7 @@ int cmd_mv(int argc, const char **argv, const char *prefix)
 					i--;
 				}
 			} else
-				die ("%s, source=%s, destination=%s",
+				die (_("%s, source=%s, destination=%s"),
 				     bad, src, dst);
 		}
 	}
@@ -203,10 +203,10 @@ int cmd_mv(int argc, const char **argv, const char *prefix)
 		enum update_mode mode = modes[i];
 		int pos;
 		if (show_only || verbose)
-			printf("Renaming %s to %s\n", src, dst);
+			printf(_("Renaming %s to %s\n"), src, dst);
 		if (!show_only && mode != INDEX &&
 				rename(src, dst) < 0 && !ignore_errors)
-			die_errno ("renaming '%s' failed", src);
+			die_errno (_("renaming '%s' failed"), src);
 
 		if (mode == WORKING_DIRECTORY)
 			continue;
@@ -220,7 +220,7 @@ int cmd_mv(int argc, const char **argv, const char *prefix)
 	if (active_cache_changed) {
 		if (write_cache(newfd, active_cache, active_nr) ||
 		    commit_locked_index(&lock_file))
-			die("Unable to write new index file");
+			die(_("Unable to write new index file"));
 	}
 
 	return 0;
-- 
1.7.2.3

^ permalink raw reply related	[flat|nested] 222+ messages in thread

* [PATCH 44/72] gettextize: git-mv "bad" messages
  2011-02-19 19:23 [PATCH 00/72] No-op C gettext wrappers Ævar Arnfjörð Bjarmason
                   ` (42 preceding siblings ...)
  2011-02-19 19:24 ` [PATCH 43/72] gettextize: git-mv basic messages Ævar Arnfjörð Bjarmason
@ 2011-02-19 19:24 ` Ævar Arnfjörð Bjarmason
  2011-02-19 19:24 ` [PATCH 45/72] gettextize: git-rm basic messages Ævar Arnfjörð Bjarmason
                   ` (28 subsequent siblings)
  72 siblings, 0 replies; 222+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2011-02-19 19:24 UTC (permalink / raw)
  To: git; +Cc: Junio C Hamano, Ævar Arnfjörð Bjarmason

Gettextize messages made by assigning to the "bad" char* variable.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
---
 builtin/mv.c |   16 ++++++++--------
 1 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/builtin/mv.c b/builtin/mv.c
index 18a2218..40f33ca 100644
--- a/builtin/mv.c
+++ b/builtin/mv.c
@@ -104,13 +104,13 @@ int cmd_mv(int argc, const char **argv, const char *prefix)
 
 		length = strlen(src);
 		if (lstat(src, &st) < 0)
-			bad = "bad source";
+			bad = _("bad source");
 		else if (!strncmp(src, dst, length) &&
 				(dst[length] == 0 || dst[length] == '/')) {
-			bad = "can not move directory into itself";
+			bad = _("can not move directory into itself");
 		} else if ((src_is_dir = S_ISDIR(st.st_mode))
 				&& lstat(dst, &st) == 0)
-			bad = "cannot move directory over file";
+			bad = _("cannot move directory over file");
 		else if (src_is_dir) {
 			const char *src_w_slash = add_slash(src);
 			int len_w_slash = length + 1;
@@ -132,7 +132,7 @@ int cmd_mv(int argc, const char **argv, const char *prefix)
 			free((char *)src_w_slash);
 
 			if (last - first < 1)
-				bad = "source directory is empty";
+				bad = _("source directory is empty");
 			else {
 				int j, dst_len;
 
@@ -163,9 +163,9 @@ int cmd_mv(int argc, const char **argv, const char *prefix)
 				argc += last - first;
 			}
 		} else if (cache_name_pos(src, length) < 0)
-			bad = "not under version control";
+			bad = _("not under version control");
 		else if (lstat(dst, &st) == 0) {
-			bad = "destination exists";
+			bad = _("destination exists");
 			if (force) {
 				/*
 				 * only files can overwrite each other:
@@ -175,10 +175,10 @@ int cmd_mv(int argc, const char **argv, const char *prefix)
 					warning(_("%s; will overwrite!"), bad);
 					bad = NULL;
 				} else
-					bad = "Cannot overwrite";
+					bad = _("Cannot overwrite");
 			}
 		} else if (string_list_has_string(&src_for_dst, dst))
-			bad = "multiple sources for the same target";
+			bad = _("multiple sources for the same target");
 		else
 			string_list_insert(&src_for_dst, dst);
 
-- 
1.7.2.3

^ permalink raw reply related	[flat|nested] 222+ messages in thread

* [PATCH 45/72] gettextize: git-rm basic messages
  2011-02-19 19:23 [PATCH 00/72] No-op C gettext wrappers Ævar Arnfjörð Bjarmason
                   ` (43 preceding siblings ...)
  2011-02-19 19:24 ` [PATCH 44/72] gettextize: git-mv "bad" messages Ævar Arnfjörð Bjarmason
@ 2011-02-19 19:24 ` Ævar Arnfjörð Bjarmason
  2011-02-19 19:24 ` [PATCH 46/72] gettextize: git-reset " Ævar Arnfjörð Bjarmason
                   ` (27 subsequent siblings)
  72 siblings, 0 replies; 222+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2011-02-19 19:24 UTC (permalink / raw)
  To: git; +Cc: Junio C Hamano, Ævar Arnfjörð Bjarmason

Make the basic git-mv messages translatable, but skip things like "rm
'%s'\n" and "git rm '%s'\n" for now.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
---
 builtin/rm.c |   22 +++++++++++-----------
 1 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/builtin/rm.c b/builtin/rm.c
index ff491d7..90c8a50 100644
--- a/builtin/rm.c
+++ b/builtin/rm.c
@@ -106,19 +106,19 @@ static int check_local_mod(unsigned char *head, int index_only)
 		 */
 		if (local_changes && staged_changes) {
 			if (!index_only || !(ce->ce_flags & CE_INTENT_TO_ADD))
-				errs = error("'%s' has staged content different "
+				errs = error(_("'%s' has staged content different "
 					     "from both the file and the HEAD\n"
-					     "(use -f to force removal)", name);
+					     "(use -f to force removal)"), name);
 		}
 		else if (!index_only) {
 			if (staged_changes)
-				errs = error("'%s' has changes staged in the index\n"
+				errs = error(_("'%s' has changes staged in the index\n"
 					     "(use --cached to keep the file, "
-					     "or -f to force removal)", name);
+					     "or -f to force removal)"), name);
 			if (local_changes)
-				errs = error("'%s' has local modifications\n"
+				errs = error(_("'%s' has local modifications\n"
 					     "(use --cached to keep the file, "
-					     "or -f to force removal)", name);
+					     "or -f to force removal)"), name);
 		}
 	}
 	return errs;
@@ -159,7 +159,7 @@ int cmd_rm(int argc, const char **argv, const char *prefix)
 	newfd = hold_locked_index(&lock_file, 1);
 
 	if (read_cache() < 0)
-		die("index file corrupt");
+		die(_("index file corrupt"));
 
 	pathspec = get_pathspec(prefix, argv);
 	refresh_index(&the_index, REFRESH_QUIET, pathspec, NULL, NULL);
@@ -183,7 +183,7 @@ int cmd_rm(int argc, const char **argv, const char *prefix)
 		for (i = 0; (match = pathspec[i]) != NULL ; i++) {
 			if (!seen[i]) {
 				if (!ignore_unmatch) {
-					die("pathspec '%s' did not match any files",
+					die(_("pathspec '%s' did not match any files"),
 					    match);
 				}
 			}
@@ -191,7 +191,7 @@ int cmd_rm(int argc, const char **argv, const char *prefix)
 				seen_any = 1;
 			}
 			if (!recursive && seen[i] == MATCHED_RECURSIVELY)
-				die("not removing '%s' recursively without -r",
+				die(_("not removing '%s' recursively without -r"),
 				    *match ? match : ".");
 		}
 
@@ -227,7 +227,7 @@ int cmd_rm(int argc, const char **argv, const char *prefix)
 			printf("rm '%s'\n", path);
 
 		if (remove_file_from_cache(path))
-			die("git rm: unable to remove %s", path);
+			die(_("git rm: unable to remove %s"), path);
 	}
 
 	if (show_only)
@@ -257,7 +257,7 @@ int cmd_rm(int argc, const char **argv, const char *prefix)
 	if (active_cache_changed) {
 		if (write_cache(newfd, active_cache, active_nr) ||
 		    commit_locked_index(&lock_file))
-			die("Unable to write new index file");
+			die(_("Unable to write new index file"));
 	}
 
 	return 0;
-- 
1.7.2.3

^ permalink raw reply related	[flat|nested] 222+ messages in thread

* [PATCH 46/72] gettextize: git-reset basic messages
  2011-02-19 19:23 [PATCH 00/72] No-op C gettext wrappers Ævar Arnfjörð Bjarmason
                   ` (44 preceding siblings ...)
  2011-02-19 19:24 ` [PATCH 45/72] gettextize: git-rm basic messages Ævar Arnfjörð Bjarmason
@ 2011-02-19 19:24 ` Ævar Arnfjörð Bjarmason
  2011-02-19 19:24 ` [PATCH 47/72] gettextize: git-reset reset_type_names messages Ævar Arnfjörð Bjarmason
                   ` (26 subsequent siblings)
  72 siblings, 0 replies; 222+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2011-02-19 19:24 UTC (permalink / raw)
  To: git; +Cc: Junio C Hamano, Ævar Arnfjörð Bjarmason

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
---
 builtin/reset.c |   26 +++++++++++++-------------
 1 files changed, 13 insertions(+), 13 deletions(-)

diff --git a/builtin/reset.c b/builtin/reset.c
index 5de2bce..0823955 100644
--- a/builtin/reset.c
+++ b/builtin/reset.c
@@ -92,20 +92,20 @@ static int reset_index_file(const unsigned char *sha1, int reset_type, int quiet
 	if (reset_type == KEEP) {
 		unsigned char head_sha1[20];
 		if (get_sha1("HEAD", head_sha1))
-			return error("You do not have a valid HEAD.");
+			return error(_("You do not have a valid HEAD."));
 		if (!fill_tree_descriptor(desc, head_sha1))
-			return error("Failed to find tree of HEAD.");
+			return error(_("Failed to find tree of HEAD."));
 		nr++;
 		opts.fn = twoway_merge;
 	}
 
 	if (!fill_tree_descriptor(desc + nr - 1, sha1))
-		return error("Failed to find tree of %s.", sha1_to_hex(sha1));
+		return error(_("Failed to find tree of %s."), sha1_to_hex(sha1));
 	if (unpack_trees(nr, desc, &opts))
 		return -1;
 	if (write_cache(newfd, active_cache, active_nr) ||
 	    commit_locked_index(lock))
-		return error("Could not write new index file.");
+		return error(_("Could not write new index file."));
 
 	return 0;
 }
@@ -115,7 +115,7 @@ static void print_new_head_line(struct commit *commit)
 	const char *hex, *body;
 
 	hex = find_unique_abbrev(commit->object.sha1, DEFAULT_ABBREV);
-	printf("HEAD is now at %s", hex);
+	printf(_("HEAD is now at %s"), hex);
 	body = strstr(commit->buffer, "\n\n");
 	if (body) {
 		const char *eol;
@@ -139,7 +139,7 @@ static int update_index_refresh(int fd, struct lock_file *index_lock, int flags)
 	}
 
 	if (read_cache() < 0)
-		return error("Could not read index");
+		return error(_("Could not read index"));
 
 	result = refresh_index(&the_index, (flags), NULL, NULL,
 			       "Unstaged changes after reset:") ? 1 : 0;
@@ -167,7 +167,7 @@ static void update_index_from_diff(struct diff_queue_struct *q,
 			ce = make_cache_entry(one->mode, one->sha1, one->path,
 				0, 0);
 			if (!ce)
-				die("make_cache_entry failed for path '%s'",
+				die(_("make_cache_entry failed for path '%s'"),
 				    one->path);
 			add_cache_entry(ce, ADD_CACHE_OK_TO_ADD |
 				ADD_CACHE_OK_TO_REPLACE);
@@ -222,7 +222,7 @@ static void prepend_reflog_action(const char *action, char *buf, size_t size)
 	if (!rla)
 		rla = sep = "";
 	if (snprintf(buf, size, "%s%s%s", rla, sep, action) >= size)
-		warning("Reflog action message too long: %.*s...", 50, buf);
+		warning(_("Reflog action message too long: %.*s..."), 50, buf);
 }
 
 static void die_if_unmerged_cache(int reset_type)
@@ -300,16 +300,16 @@ int cmd_reset(int argc, const char **argv, const char *prefix)
 	}
 
 	if (get_sha1(rev, sha1))
-		die("Failed to resolve '%s' as a valid ref.", rev);
+		die(_("Failed to resolve '%s' as a valid ref."), rev);
 
 	commit = lookup_commit_reference(sha1);
 	if (!commit)
-		die("Could not parse object '%s'.", rev);
+		die(_("Could not parse object '%s'."), rev);
 	hashcpy(sha1, commit->object.sha1);
 
 	if (patch_mode) {
 		if (reset_type != NONE)
-			die("--patch is incompatible with --{hard,mixed,soft}");
+			die(_("--patch is incompatible with --{hard,mixed,soft}"));
 		return interactive_reset(rev, argv + i, prefix);
 	}
 
@@ -318,7 +318,7 @@ int cmd_reset(int argc, const char **argv, const char *prefix)
 	 * affecting the working tree nor HEAD. */
 	if (i < argc) {
 		if (reset_type == MIXED)
-			warning("--mixed with paths is deprecated; use 'git reset -- <paths>' instead.");
+			warning(_("--mixed with paths is deprecated; use 'git reset -- <paths>' instead."));
 		else if (reset_type != NONE)
 			die("Cannot do %s reset with paths.",
 					reset_type_names[reset_type]);
@@ -348,7 +348,7 @@ int cmd_reset(int argc, const char **argv, const char *prefix)
 		if (reset_type == KEEP)
 			err = err || reset_index_file(sha1, MIXED, quiet);
 		if (err)
-			die("Could not reset index file to revision '%s'.", rev);
+			die(_("Could not reset index file to revision '%s'."), rev);
 	}
 
 	/* Any resets update HEAD to the head being switched to,
-- 
1.7.2.3

^ permalink raw reply related	[flat|nested] 222+ messages in thread

* [PATCH 47/72] gettextize: git-reset reset_type_names messages
  2011-02-19 19:23 [PATCH 00/72] No-op C gettext wrappers Ævar Arnfjörð Bjarmason
                   ` (45 preceding siblings ...)
  2011-02-19 19:24 ` [PATCH 46/72] gettextize: git-reset " Ævar Arnfjörð Bjarmason
@ 2011-02-19 19:24 ` Ævar Arnfjörð Bjarmason
  2011-02-19 19:24 ` [PATCH 48/72] gettextize: git-reset "Unstaged changes after reset" message Ævar Arnfjörð Bjarmason
                   ` (25 subsequent siblings)
  72 siblings, 0 replies; 222+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2011-02-19 19:24 UTC (permalink / raw)
  To: git; +Cc: Junio C Hamano, Ævar Arnfjörð Bjarmason

Make the messages in git-reset that use the reset_type_names static
array to be translatable by marking the array items with N_() and
using _() later.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
---
 builtin/reset.c |   14 +++++++-------
 1 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/builtin/reset.c b/builtin/reset.c
index 0823955..1465174 100644
--- a/builtin/reset.c
+++ b/builtin/reset.c
@@ -30,7 +30,7 @@ static const char * const git_reset_usage[] = {
 
 enum reset_type { MIXED, SOFT, HARD, MERGE, KEEP, NONE };
 static const char *reset_type_names[] = {
-	"mixed", "soft", "hard", "merge", "keep", NULL
+	N_("mixed"), N_("soft"), N_("hard"), N_("merge"), N_("keep"), NULL
 };
 
 static char *args_to_str(const char **argv)
@@ -228,8 +228,8 @@ static void prepend_reflog_action(const char *action, char *buf, size_t size)
 static void die_if_unmerged_cache(int reset_type)
 {
 	if (is_merge() || read_cache() < 0 || unmerged_cache())
-		die("Cannot do a %s reset in the middle of a merge.",
-		    reset_type_names[reset_type]);
+		die(_("Cannot do a %s reset in the middle of a merge."),
+		    _(reset_type_names[reset_type]));
 
 }
 
@@ -320,8 +320,8 @@ int cmd_reset(int argc, const char **argv, const char *prefix)
 		if (reset_type == MIXED)
 			warning(_("--mixed with paths is deprecated; use 'git reset -- <paths>' instead."));
 		else if (reset_type != NONE)
-			die("Cannot do %s reset with paths.",
-					reset_type_names[reset_type]);
+			die(_("Cannot do %s reset with paths."),
+					_(reset_type_names[reset_type]));
 		return read_from_tree(prefix, argv + i, sha1,
 				quiet ? REFRESH_QUIET : REFRESH_IN_PORCELAIN);
 	}
@@ -332,8 +332,8 @@ int cmd_reset(int argc, const char **argv, const char *prefix)
 		setup_work_tree();
 
 	if (reset_type == MIXED && is_bare_repository())
-		die("%s reset is not allowed in a bare repository",
-		    reset_type_names[reset_type]);
+		die(_("%s reset is not allowed in a bare repository"),
+		    _(reset_type_names[reset_type]));
 
 	/* Soft reset does not touch the index file nor the working tree
 	 * at all, but requires them in a good order.  Other resets reset
-- 
1.7.2.3

^ permalink raw reply related	[flat|nested] 222+ messages in thread

* [PATCH 48/72] gettextize: git-reset "Unstaged changes after reset" message
  2011-02-19 19:23 [PATCH 00/72] No-op C gettext wrappers Ævar Arnfjörð Bjarmason
                   ` (46 preceding siblings ...)
  2011-02-19 19:24 ` [PATCH 47/72] gettextize: git-reset reset_type_names messages Ævar Arnfjörð Bjarmason
@ 2011-02-19 19:24 ` Ævar Arnfjörð Bjarmason
  2011-02-19 19:24 ` [PATCH 49/72] gettextize: git-tag basic messages Ævar Arnfjörð Bjarmason
                   ` (24 subsequent siblings)
  72 siblings, 0 replies; 222+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2011-02-19 19:24 UTC (permalink / raw)
  To: git; +Cc: Junio C Hamano, Ævar Arnfjörð Bjarmason

Gettextize the ""Unstaged changes after reset:" message. A test in
t7102-reset.sh explicitly checked for this message. Change it to skip
under GETTEXT_POISON=YesPlease.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
---
 builtin/reset.c  |    2 +-
 t/t7102-reset.sh |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/builtin/reset.c b/builtin/reset.c
index 1465174..1fe5b0f 100644
--- a/builtin/reset.c
+++ b/builtin/reset.c
@@ -142,7 +142,7 @@ static int update_index_refresh(int fd, struct lock_file *index_lock, int flags)
 		return error(_("Could not read index"));
 
 	result = refresh_index(&the_index, (flags), NULL, NULL,
-			       "Unstaged changes after reset:") ? 1 : 0;
+			       _("Unstaged changes after reset:")) ? 1 : 0;
 	if (write_cache(fd, active_cache, active_nr) ||
 			commit_locked_index(index_lock))
 		return error ("Could not refresh index");
diff --git a/t/t7102-reset.sh b/t/t7102-reset.sh
index b8cf260..1370949 100755
--- a/t/t7102-reset.sh
+++ b/t/t7102-reset.sh
@@ -423,7 +423,7 @@ Unstaged changes after reset:
 M	file2
 EOF
 
-test_expect_success '--mixed refreshes the index' '
+test_expect_success NO_GETTEXT_POISON '--mixed refreshes the index' '
 	echo 123 >> file2 &&
 	git reset --mixed HEAD > output &&
 	test_cmp expect output
-- 
1.7.2.3

^ permalink raw reply related	[flat|nested] 222+ messages in thread

* [PATCH 49/72] gettextize: git-tag basic messages
  2011-02-19 19:23 [PATCH 00/72] No-op C gettext wrappers Ævar Arnfjörð Bjarmason
                   ` (47 preceding siblings ...)
  2011-02-19 19:24 ` [PATCH 48/72] gettextize: git-reset "Unstaged changes after reset" message Ævar Arnfjörð Bjarmason
@ 2011-02-19 19:24 ` Ævar Arnfjörð Bjarmason
  2011-02-19 19:24 ` [PATCH 50/72] gettextize: git-tag tag_template message Ævar Arnfjörð Bjarmason
                   ` (23 subsequent siblings)
  72 siblings, 0 replies; 222+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2011-02-19 19:24 UTC (permalink / raw)
  To: git; +Cc: Junio C Hamano, Ævar Arnfjörð Bjarmason

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
---
 builtin/tag.c |   60 ++++++++++++++++++++++++++++----------------------------
 1 files changed, 30 insertions(+), 30 deletions(-)

diff --git a/builtin/tag.c b/builtin/tag.c
index 246a2bc..4bed7c2 100644
--- a/builtin/tag.c
+++ b/builtin/tag.c
@@ -118,12 +118,12 @@ static int for_each_tag_name(const char **argv, each_tag_name_fn fn)
 	for (p = argv; *p; p++) {
 		if (snprintf(ref, sizeof(ref), "refs/tags/%s", *p)
 					>= sizeof(ref)) {
-			error("tag name too long: %.*s...", 50, *p);
+			error(_("tag name too long: %.*s..."), 50, *p);
 			had_error = 1;
 			continue;
 		}
 		if (!resolve_ref(ref, sha1, 1, NULL)) {
-			error("tag '%s' not found.", *p);
+			error(_("tag '%s' not found."), *p);
 			had_error = 1;
 			continue;
 		}
@@ -138,7 +138,7 @@ static int delete_tag(const char *name, const char *ref,
 {
 	if (delete_ref(ref, sha1, 0))
 		return 1;
-	printf("Deleted tag '%s' (was %s)\n", name, find_unique_abbrev(sha1, DEFAULT_ABBREV));
+	printf(_("Deleted tag '%s' (was %s)\n"), name, find_unique_abbrev(sha1, DEFAULT_ABBREV));
 	return 0;
 }
 
@@ -150,7 +150,7 @@ static int verify_tag(const char *name, const char *ref,
 	argv_verify_tag[2] = sha1_to_hex(sha1);
 
 	if (run_command_v_opt(argv_verify_tag, RUN_GIT_CMD))
-		return error("could not verify the tag '%s'", name);
+		return error(_("could not verify the tag '%s'"), name);
 	return 0;
 }
 
@@ -165,7 +165,7 @@ static int do_sign(struct strbuf *buffer)
 	if (!*signingkey) {
 		if (strlcpy(signingkey, git_committer_info(IDENT_ERROR_ON_NO_NAME),
 				sizeof(signingkey)) > sizeof(signingkey) - 1)
-			return error("committer info too long.");
+			return error(_("committer info too long."));
 		bracket = strchr(signingkey, '>');
 		if (bracket)
 			bracket[1] = '\0';
@@ -185,20 +185,20 @@ static int do_sign(struct strbuf *buffer)
 	args[3] = NULL;
 
 	if (start_command(&gpg))
-		return error("could not run gpg.");
+		return error(_("could not run gpg."));
 
 	if (write_in_full(gpg.in, buffer->buf, buffer->len) != buffer->len) {
 		close(gpg.in);
 		close(gpg.out);
 		finish_command(&gpg);
-		return error("gpg did not accept the tag data");
+		return error(_("gpg did not accept the tag data"));
 	}
 	close(gpg.in);
 	len = strbuf_read(buffer, gpg.out, 1024);
 	close(gpg.out);
 
 	if (finish_command(&gpg) || !len || len < 0)
-		return error("gpg failed to sign the tag");
+		return error(_("gpg failed to sign the tag"));
 
 	/* Strip CR from the line endings, in case we are on Windows. */
 	for (i = j = 0; i < buffer->len; i++)
@@ -221,7 +221,7 @@ static const char tag_template[] =
 static void set_signingkey(const char *value)
 {
 	if (strlcpy(signingkey, value, sizeof(signingkey)) >= sizeof(signingkey))
-		die("signing key value too long (%.10s...)", value);
+		die(_("signing key value too long (%.10s...)"), value);
 }
 
 static int git_tag_config(const char *var, const char *value, void *cb)
@@ -261,9 +261,9 @@ static void write_tag_body(int fd, const unsigned char *sha1)
 static int build_tag_object(struct strbuf *buf, int sign, unsigned char *result)
 {
 	if (sign && do_sign(buf) < 0)
-		return error("unable to sign the tag");
+		return error(_("unable to sign the tag"));
 	if (write_sha1_file(buf->buf, buf->len, tag_type, result) < 0)
-		return error("unable to write tag file");
+		return error(_("unable to write tag file"));
 	return 0;
 }
 
@@ -278,7 +278,7 @@ static void create_tag(const unsigned char *object, const char *tag,
 
 	type = sha1_object_info(object, NULL);
 	if (type <= OBJ_NONE)
-	    die("bad object type.");
+	    die(_("bad object type."));
 
 	header_len = snprintf(header_buf, sizeof(header_buf),
 			  "object %s\n"
@@ -291,7 +291,7 @@ static void create_tag(const unsigned char *object, const char *tag,
 			  git_committer_info(IDENT_ERROR_ON_NO_NAME));
 
 	if (header_len > sizeof(header_buf) - 1)
-		die("tag header too big.");
+		die(_("tag header too big."));
 
 	if (!message) {
 		int fd;
@@ -300,7 +300,7 @@ static void create_tag(const unsigned char *object, const char *tag,
 		path = git_pathdup("TAG_EDITMSG");
 		fd = open(path, O_CREAT | O_TRUNC | O_WRONLY, 0600);
 		if (fd < 0)
-			die_errno("could not create file '%s'", path);
+			die_errno(_("could not create file '%s'"), path);
 
 		if (!is_null_sha1(prev))
 			write_tag_body(fd, prev);
@@ -310,7 +310,7 @@ static void create_tag(const unsigned char *object, const char *tag,
 
 		if (launch_editor(path, buf, NULL)) {
 			fprintf(stderr,
-			"Please supply the message using either -m or -F option.\n");
+			_("Please supply the message using either -m or -F option.\n"));
 			exit(1);
 		}
 	}
@@ -318,13 +318,13 @@ static void create_tag(const unsigned char *object, const char *tag,
 	stripspace(buf, 1);
 
 	if (!message && !buf->len)
-		die("no tag message?");
+		die(_("no tag message?"));
 
 	strbuf_insert(buf, 0, header_buf, header_len);
 
 	if (build_tag_object(buf, sign, result) < 0) {
 		if (path)
-			fprintf(stderr, "The tag message has been left in %s\n",
+			fprintf(stderr, _("The tag message has been left in %s\n"),
 				path);
 		exit(128);
 	}
@@ -417,9 +417,9 @@ int cmd_tag(int argc, const char **argv, const char *prefix)
 		return list_tags(argv[0], lines == -1 ? 0 : lines,
 				 with_commit);
 	if (lines != -1)
-		die("-n option is only allowed with -l.");
+		die(_("-n option is only allowed with -l."));
 	if (with_commit)
-		die("--contains option is only allowed with -l.");
+		die(_("--contains option is only allowed with -l."));
 	if (delete)
 		return for_each_tag_name(argv, delete_tag);
 	if (verify)
@@ -427,17 +427,17 @@ int cmd_tag(int argc, const char **argv, const char *prefix)
 
 	if (msg.given || msgfile) {
 		if (msg.given && msgfile)
-			die("only one -F or -m option is allowed.");
+			die(_("only one -F or -m option is allowed."));
 		annotate = 1;
 		if (msg.given)
 			strbuf_addbuf(&buf, &(msg.buf));
 		else {
 			if (!strcmp(msgfile, "-")) {
 				if (strbuf_read(&buf, 0, 1024) < 0)
-					die_errno("cannot read '%s'", msgfile);
+					die_errno(_("cannot read '%s'"), msgfile);
 			} else {
 				if (strbuf_read_file(&buf, msgfile, 1024) < 0)
-					die_errno("could not open or read '%s'",
+					die_errno(_("could not open or read '%s'"),
 						msgfile);
 			}
 		}
@@ -447,20 +447,20 @@ int cmd_tag(int argc, const char **argv, const char *prefix)
 
 	object_ref = argc == 2 ? argv[1] : "HEAD";
 	if (argc > 2)
-		die("too many params");
+		die(_("too many params"));
 
 	if (get_sha1(object_ref, object))
-		die("Failed to resolve '%s' as a valid ref.", object_ref);
+		die(_("Failed to resolve '%s' as a valid ref."), object_ref);
 
 	if (snprintf(ref, sizeof(ref), "refs/tags/%s", tag) > sizeof(ref) - 1)
-		die("tag name too long: %.*s...", 50, tag);
+		die(_("tag name too long: %.*s..."), 50, tag);
 	if (check_ref_format(ref))
-		die("'%s' is not a valid tag name.", tag);
+		die(_("'%s' is not a valid tag name."), tag);
 
 	if (!resolve_ref(ref, prev, 1, NULL))
 		hashclr(prev);
 	else if (!force)
-		die("tag '%s' already exists", tag);
+		die(_("tag '%s' already exists"), tag);
 
 	if (annotate)
 		create_tag(object, tag, &buf, msg.given || msgfile,
@@ -468,11 +468,11 @@ int cmd_tag(int argc, const char **argv, const char *prefix)
 
 	lock = lock_any_ref_for_update(ref, prev, 0);
 	if (!lock)
-		die("%s: cannot lock the ref", ref);
+		die(_("%s: cannot lock the ref"), ref);
 	if (write_ref_sha1(lock, object, NULL) < 0)
-		die("%s: cannot update the ref", ref);
+		die(_("%s: cannot update the ref"), ref);
 	if (force && hashcmp(prev, object))
-		printf("Updated tag '%s' (was %s)\n", tag, find_unique_abbrev(prev, DEFAULT_ABBREV));
+		printf(_("Updated tag '%s' (was %s)\n"), tag, find_unique_abbrev(prev, DEFAULT_ABBREV));
 
 	strbuf_release(&buf);
 	return 0;
-- 
1.7.2.3

^ permalink raw reply related	[flat|nested] 222+ messages in thread

* [PATCH 50/72] gettextize: git-tag tag_template message
  2011-02-19 19:23 [PATCH 00/72] No-op C gettext wrappers Ævar Arnfjörð Bjarmason
                   ` (48 preceding siblings ...)
  2011-02-19 19:24 ` [PATCH 49/72] gettextize: git-tag basic messages Ævar Arnfjörð Bjarmason
@ 2011-02-19 19:24 ` Ævar Arnfjörð Bjarmason
  2011-02-19 19:24 ` [PATCH 51/72] gettextize: git-push basic messages Ævar Arnfjörð Bjarmason
                   ` (22 subsequent siblings)
  72 siblings, 0 replies; 222+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2011-02-19 19:24 UTC (permalink / raw)
  To: git; +Cc: Junio C Hamano, Ævar Arnfjörð Bjarmason

Mark the tag_template message as translatable with N_() and then use
it later with _(). We need to skip a test under GETTEXT_POISON that
relies on the output having a leading newline.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
---
 builtin/tag.c  |    6 +++---
 t/t7004-tag.sh |    1 +
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/builtin/tag.c b/builtin/tag.c
index 4bed7c2..4242e27 100644
--- a/builtin/tag.c
+++ b/builtin/tag.c
@@ -213,10 +213,10 @@ static int do_sign(struct strbuf *buffer)
 }
 
 static const char tag_template[] =
-	"\n"
+	N_("\n"
 	"#\n"
 	"# Write a tag message\n"
-	"#\n";
+	"#\n");
 
 static void set_signingkey(const char *value)
 {
@@ -305,7 +305,7 @@ static void create_tag(const unsigned char *object, const char *tag,
 		if (!is_null_sha1(prev))
 			write_tag_body(fd, prev);
 		else
-			write_or_die(fd, tag_template, strlen(tag_template));
+			write_or_die(fd, _(tag_template), strlen(_(tag_template)));
 		close(fd);
 
 		if (launch_editor(path, buf, NULL)) {
diff --git a/t/t7004-tag.sh b/t/t7004-tag.sh
index 3e7baaf..99d1fbc 100755
--- a/t/t7004-tag.sh
+++ b/t/t7004-tag.sh
@@ -1121,6 +1121,7 @@ test_expect_success \
 '
 
 test_expect_success \
+	NO_GETTEXT_POISON \
 	'message in editor has initial comment: first line' '
 	# check the first line --- should be empty
 	echo >first.expect &&
-- 
1.7.2.3

^ permalink raw reply related	[flat|nested] 222+ messages in thread

* [PATCH 51/72] gettextize: git-push basic messages
  2011-02-19 19:23 [PATCH 00/72] No-op C gettext wrappers Ævar Arnfjörð Bjarmason
                   ` (49 preceding siblings ...)
  2011-02-19 19:24 ` [PATCH 50/72] gettextize: git-tag tag_template message Ævar Arnfjörð Bjarmason
@ 2011-02-19 19:24 ` Ævar Arnfjörð Bjarmason
  2011-02-19 19:24 ` [PATCH 52/72] gettextize: git-push "prevent you from losing" message Ævar Arnfjörð Bjarmason
                   ` (21 subsequent siblings)
  72 siblings, 0 replies; 222+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2011-02-19 19:24 UTC (permalink / raw)
  To: git; +Cc: Junio C Hamano, Ævar Arnfjörð Bjarmason

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
---
 builtin/push.c |   38 +++++++++++++++++++-------------------
 1 files changed, 19 insertions(+), 19 deletions(-)

diff --git a/builtin/push.c b/builtin/push.c
index e655eb7..513bc57 100644
--- a/builtin/push.c
+++ b/builtin/push.c
@@ -40,7 +40,7 @@ static void set_refspecs(const char **refs, int nr)
 			char *tag;
 			int len;
 			if (nr <= ++i)
-				die("tag shorthand without <tag>");
+				die(_("tag shorthand without <tag>"));
 			len = strlen(refs[i]) + 11;
 			if (deleterefs) {
 				tag = xmalloc(len+1);
@@ -59,7 +59,7 @@ static void set_refspecs(const char **refs, int nr)
 			strcat(delref, ref);
 			ref = delref;
 		} else if (deleterefs)
-			die("--delete only accepts plain target ref names");
+			die(_("--delete only accepts plain target ref names"));
 		add_refspec(ref);
 	}
 }
@@ -69,13 +69,13 @@ static void setup_push_tracking(void)
 	struct strbuf refspec = STRBUF_INIT;
 	struct branch *branch = branch_get(NULL);
 	if (!branch)
-		die("You are not currently on a branch.");
+		die(_("You are not currently on a branch."));
 	if (!branch->merge_nr || !branch->merge)
-		die("The current branch %s is not tracking anything.",
+		die(_("The current branch %s is not tracking anything."),
 		    branch->name);
 	if (branch->merge_nr != 1)
-		die("The current branch %s is tracking multiple branches, "
-		    "refusing to push.", branch->name);
+		die(_("The current branch %s is tracking multiple branches, "
+		    "refusing to push."), branch->name);
 	strbuf_addf(&refspec, "%s:%s", branch->name, branch->merge[0]->src);
 	add_refspec(refspec.buf);
 }
@@ -97,8 +97,8 @@ static void setup_default_push_refspecs(void)
 		break;
 
 	case PUSH_DEFAULT_NOTHING:
-		die("You didn't specify any refspecs to push, and "
-		    "push.default is \"nothing\".");
+		die(_("You didn't specify any refspecs to push, and "
+		    "push.default is \"nothing\"."));
 		break;
 	}
 }
@@ -117,11 +117,11 @@ static int push_with_options(struct transport *transport, int flags)
 		transport_set_option(transport, TRANS_OPT_THIN, "yes");
 
 	if (verbosity > 0)
-		fprintf(stderr, "Pushing to %s\n", transport->url);
+		fprintf(stderr, _("Pushing to %s\n"), transport->url);
 	err = transport_push(transport, refspec_nr, refspec, flags,
 			     &nonfastforward);
 	if (err != 0)
-		error("failed to push some refs to '%s'", transport->url);
+		error(_("failed to push some refs to '%s'"), transport->url);
 
 	err |= transport_disconnect(transport);
 
@@ -146,8 +146,8 @@ static int do_push(const char *repo, int flags)
 
 	if (!remote) {
 		if (repo)
-			die("bad repository '%s'", repo);
-		die("No destination configured to push to.");
+			die(_("bad repository '%s'"), repo);
+		die(_("No destination configured to push to."));
 	}
 
 	if (remote->mirror)
@@ -155,19 +155,19 @@ static int do_push(const char *repo, int flags)
 
 	if ((flags & TRANSPORT_PUSH_ALL) && refspec) {
 		if (!strcmp(*refspec, "refs/tags/*"))
-			return error("--all and --tags are incompatible");
-		return error("--all can't be combined with refspecs");
+			return error(_("--all and --tags are incompatible"));
+		return error(_("--all can't be combined with refspecs"));
 	}
 
 	if ((flags & TRANSPORT_PUSH_MIRROR) && refspec) {
 		if (!strcmp(*refspec, "refs/tags/*"))
-			return error("--mirror and --tags are incompatible");
-		return error("--mirror can't be combined with refspecs");
+			return error(_("--mirror and --tags are incompatible"));
+		return error(_("--mirror can't be combined with refspecs"));
 	}
 
 	if ((flags & (TRANSPORT_PUSH_ALL|TRANSPORT_PUSH_MIRROR)) ==
 				(TRANSPORT_PUSH_ALL|TRANSPORT_PUSH_MIRROR)) {
-		return error("--all and --mirror are incompatible");
+		return error(_("--all and --mirror are incompatible"));
 	}
 
 	if (!refspec && !(flags & TRANSPORT_PUSH_ALL)) {
@@ -232,9 +232,9 @@ int cmd_push(int argc, const char **argv, const char *prefix)
 	argc = parse_options(argc, argv, prefix, options, push_usage, 0);
 
 	if (deleterefs && (tags || (flags & (TRANSPORT_PUSH_ALL | TRANSPORT_PUSH_MIRROR))))
-		die("--delete is incompatible with --all, --mirror and --tags");
+		die(_("--delete is incompatible with --all, --mirror and --tags"));
 	if (deleterefs && argc < 2)
-		die("--delete doesn't make sense without any refs");
+		die(_("--delete doesn't make sense without any refs"));
 
 	if (tags)
 		add_refspec("refs/tags/*");
-- 
1.7.2.3

^ permalink raw reply related	[flat|nested] 222+ messages in thread

* [PATCH 52/72] gettextize: git-push "prevent you from losing" message
  2011-02-19 19:23 [PATCH 00/72] No-op C gettext wrappers Ævar Arnfjörð Bjarmason
                   ` (50 preceding siblings ...)
  2011-02-19 19:24 ` [PATCH 51/72] gettextize: git-push basic messages Ævar Arnfjörð Bjarmason
@ 2011-02-19 19:24 ` Ævar Arnfjörð Bjarmason
  2011-02-19 19:24 ` [PATCH 53/72] gettextize: git-status basic messages Ævar Arnfjörð Bjarmason
                   ` (20 subsequent siblings)
  72 siblings, 0 replies; 222+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2011-02-19 19:24 UTC (permalink / raw)
  To: git; +Cc: Junio C Hamano, Ævar Arnfjörð Bjarmason

Gettextize the "To prevent you from losing history" message. A test in
lib-httpd.sh and another in t5541-http-push.sh explicitly checked for
this message. Change them to skip under GETTEXT_POISON=YesPlease.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
---
 builtin/push.c       |    4 ++--
 t/lib-httpd.sh       |    2 +-
 t/t5541-http-push.sh |    7 +++++--
 3 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/builtin/push.c b/builtin/push.c
index 513bc57..8c8d8c7 100644
--- a/builtin/push.c
+++ b/builtin/push.c
@@ -129,9 +129,9 @@ static int push_with_options(struct transport *transport, int flags)
 		return 0;
 
 	if (nonfastforward && advice_push_nonfastforward) {
-		fprintf(stderr, "To prevent you from losing history, non-fast-forward updates were rejected\n"
+		fprintf(stderr, _("To prevent you from losing history, non-fast-forward updates were rejected\n"
 				"Merge the remote changes (e.g. 'git pull') before pushing again.  See the\n"
-				"'Note about fast-forwards' section of 'git push --help' for details.\n");
+				"'Note about fast-forwards' section of 'git push --help' for details.\n"));
 	}
 
 	return 1;
diff --git a/t/lib-httpd.sh b/t/lib-httpd.sh
index 3f24384..0f0b35a 100644
--- a/t/lib-httpd.sh
+++ b/t/lib-httpd.sh
@@ -157,7 +157,7 @@ test_http_push_nonff() {
 		grep "^ ! \[rejected\][ ]*$BRANCH -> $BRANCH (non-fast-forward)$" output
 	'
 
-	test_expect_success 'non-fast-forward push shows help message' '
+	test_expect_success NO_GETTEXT_POISON 'non-fast-forward push shows help message' '
 		grep "To prevent you from losing history, non-fast-forward updates were rejected" \
 			output
 	'
diff --git a/t/t5541-http-push.sh b/t/t5541-http-push.sh
index b0c2a2c..b341d8b 100755
--- a/t/t5541-http-push.sh
+++ b/t/t5541-http-push.sh
@@ -128,11 +128,14 @@ test_expect_success 'push fails for non-fast-forward refs unmatched by remote he
 
 	# push master too; this ensures there is at least one '"'push'"' command to
 	# the remote helper and triggers interaction with the helper.
-	test_must_fail git push -v origin +master master:retsam >output 2>&1 &&
+	test_must_fail git push -v origin +master master:retsam >output 2>&1'
 
+test_expect_success 'push fails for non-fast-forward refs unmatched by remote helper: remote output' '
 	grep "^ + [a-f0-9]*\.\.\.[a-f0-9]* *master -> master (forced update)$" output &&
-	grep "^ ! \[rejected\] *master -> retsam (non-fast-forward)$" output &&
+	grep "^ ! \[rejected\] *master -> retsam (non-fast-forward)$" output
+'
 
+test_expect_success NO_GETTEXT_POISON 'push fails for non-fast-forward refs unmatched by remote helper: our output' '
 	grep "To prevent you from losing history, non-fast-forward updates were rejected" \
 		output
 '
-- 
1.7.2.3

^ permalink raw reply related	[flat|nested] 222+ messages in thread

* [PATCH 53/72] gettextize: git-status basic messages
  2011-02-19 19:23 [PATCH 00/72] No-op C gettext wrappers Ævar Arnfjörð Bjarmason
                   ` (51 preceding siblings ...)
  2011-02-19 19:24 ` [PATCH 52/72] gettextize: git-push "prevent you from losing" message Ævar Arnfjörð Bjarmason
@ 2011-02-19 19:24 ` Ævar Arnfjörð Bjarmason
  2011-02-19 19:24 ` [PATCH 54/72] gettextize: git-status "nothing to commit" messages Ævar Arnfjörð Bjarmason
                   ` (19 subsequent siblings)
  72 siblings, 0 replies; 222+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2011-02-19 19:24 UTC (permalink / raw)
  To: git; +Cc: Junio C Hamano, Ævar Arnfjörð Bjarmason

Gettextize the most common git-status messages. Many tests checked for
these explicitly. Change them to skip under GETTEXT_POISON=YesPlease.

Some of the tests in t7508-status.sh needed to be split up when I
added NO_GETTEXT_POISON to them, since parts of them affected later
tests (some of which aren't being skipped) indirectly.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
---
 t/t7060-wtstatus.sh         |    2 +-
 t/t7506-status-submodule.sh |   20 ++++----
 t/t7508-status.sh           |  115 ++++++++++++++++++++++++-------------------
 wt-status.c                 |   86 ++++++++++++++++----------------
 4 files changed, 119 insertions(+), 104 deletions(-)

diff --git a/t/t7060-wtstatus.sh b/t/t7060-wtstatus.sh
index fcac472..7205154 100755
--- a/t/t7060-wtstatus.sh
+++ b/t/t7060-wtstatus.sh
@@ -38,7 +38,7 @@ cat >expect <<EOF
 no changes added to commit (use "git add" and/or "git commit -a")
 EOF
 
-test_expect_success 'M/D conflict does not segfault' '
+test_expect_success NO_GETTEXT_POISON 'M/D conflict does not segfault' '
 	mkdir mdconflict &&
 	(
 		cd mdconflict &&
diff --git a/t/t7506-status-submodule.sh b/t/t7506-status-submodule.sh
index 3d4f85d..74e0f6f 100755
--- a/t/t7506-status-submodule.sh
+++ b/t/t7506-status-submodule.sh
@@ -30,7 +30,7 @@ test_expect_success 'commit --dry-run -a clean' '
 	grep "nothing to commit" output
 '
 
-test_expect_success 'status with modified file in submodule' '
+test_expect_success NO_GETTEXT_POISON 'status with modified file in submodule' '
 	(cd sub && git reset --hard) &&
 	echo "changed" >sub/foo &&
 	git status >output &&
@@ -46,7 +46,7 @@ test_expect_success 'status with modified file in submodule (porcelain)' '
 	EOF
 '
 
-test_expect_success 'status with added file in submodule' '
+test_expect_success NO_GETTEXT_POISON 'status with added file in submodule' '
 	(cd sub && git reset --hard && echo >foo && git add foo) &&
 	git status >output &&
 	grep "modified:   sub (modified content)" output
@@ -60,14 +60,14 @@ test_expect_success 'status with added file in submodule (porcelain)' '
 	EOF
 '
 
-test_expect_success 'status with untracked file in submodule' '
+test_expect_success NO_GETTEXT_POISON 'status with untracked file in submodule' '
 	(cd sub && git reset --hard) &&
 	echo "content" >sub/new-file &&
 	git status >output &&
 	grep "modified:   sub (untracked content)" output
 '
 
-test_expect_success 'status -uno with untracked file in submodule' '
+test_expect_success NO_GETTEXT_POISON 'status -uno with untracked file in submodule' '
 	git status -uno >output &&
 	grep "^nothing to commit" output
 '
@@ -79,7 +79,7 @@ test_expect_success 'status with untracked file in submodule (porcelain)' '
 	EOF
 '
 
-test_expect_success 'status with added and untracked file in submodule' '
+test_expect_success NO_GETTEXT_POISON 'status with added and untracked file in submodule' '
 	(cd sub && git reset --hard && echo >foo && git add foo) &&
 	echo "content" >sub/new-file &&
 	git status >output &&
@@ -95,7 +95,7 @@ test_expect_success 'status with added and untracked file in submodule (porcelai
 	EOF
 '
 
-test_expect_success 'status with modified file in modified submodule' '
+test_expect_success NO_GETTEXT_POISON 'status with modified file in modified submodule' '
 	(cd sub && git reset --hard) &&
 	rm sub/new-file &&
 	(cd sub && echo "next change" >foo && git commit -m "next change" foo) &&
@@ -113,7 +113,7 @@ test_expect_success 'status with modified file in modified submodule (porcelain)
 	EOF
 '
 
-test_expect_success 'status with added file in modified submodule' '
+test_expect_success NO_GETTEXT_POISON 'status with added file in modified submodule' '
 	(cd sub && git reset --hard && echo >foo && git add foo) &&
 	git status >output &&
 	grep "modified:   sub (new commits, modified content)" output
@@ -127,7 +127,7 @@ test_expect_success 'status with added file in modified submodule (porcelain)' '
 	EOF
 '
 
-test_expect_success 'status with untracked file in modified submodule' '
+test_expect_success NO_GETTEXT_POISON 'status with untracked file in modified submodule' '
 	(cd sub && git reset --hard) &&
 	echo "content" >sub/new-file &&
 	git status >output &&
@@ -141,7 +141,7 @@ test_expect_success 'status with untracked file in modified submodule (porcelain
 	EOF
 '
 
-test_expect_success 'status with added and untracked file in modified submodule' '
+test_expect_success NO_GETTEXT_POISON 'status with added and untracked file in modified submodule' '
 	(cd sub && git reset --hard && echo >foo && git add foo) &&
 	echo "content" >sub/new-file &&
 	git status >output &&
@@ -167,7 +167,7 @@ test_expect_success 'setup .git file for sub' '
 	 git commit -m "added .real to .gitignore" .gitignore
 '
 
-test_expect_success 'status with added file in modified submodule with .git file' '
+test_expect_success NO_GETTEXT_POISON 'status with added file in modified submodule with .git file' '
 	(cd sub && git reset --hard && echo >foo && git add foo) &&
 	git status >output &&
 	grep "modified:   sub (new commits, modified content)" output
diff --git a/t/t7508-status.sh b/t/t7508-status.sh
index f1dc5c3..d79737f 100755
--- a/t/t7508-status.sh
+++ b/t/t7508-status.sh
@@ -55,7 +55,7 @@ test_expect_success 'setup' '
 	git add dir2/added
 '
 
-test_expect_success 'status (1)' '
+test_expect_success NO_GETTEXT_POISON 'status (1)' '
 
 	grep "use \"git rm --cached <file>\.\.\.\" to unstage" output
 
@@ -85,7 +85,7 @@ cat >expect <<\EOF
 #	untracked
 EOF
 
-test_expect_success 'status (2)' '
+test_expect_success NO_GETTEXT_POISON 'status (2)' '
 
 	git status >output &&
 	test_cmp expect output
@@ -111,7 +111,7 @@ EOF
 
 git config advice.statusHints false
 
-test_expect_success 'status (advice.statusHints false)' '
+test_expect_success NO_GETTEXT_POISON 'status (advice.statusHints false)' '
 
 	git status >output &&
 	test_cmp expect output
@@ -157,6 +157,12 @@ test_expect_success 'status -s -b' '
 
 '
 
+test_expect_success 'setup dir3' '
+	mkdir dir3 &&
+	: >dir3/untracked1 &&
+	: >dir3/untracked2
+'
+
 cat >expect <<EOF
 # On branch master
 # Changes to be committed:
@@ -172,16 +178,14 @@ cat >expect <<EOF
 #
 # Untracked files not listed (use -u option to show untracked files)
 EOF
-test_expect_success 'status -uno' '
-	mkdir dir3 &&
-	: >dir3/untracked1 &&
-	: >dir3/untracked2 &&
+test_expect_success NO_GETTEXT_POISON 'status -uno' '
 	git status -uno >output &&
 	test_cmp expect output
 '
 
-test_expect_success 'status (status.showUntrackedFiles no)' '
+test_expect_success NO_GETTEXT_POISON 'status (status.showUntrackedFiles no)' '
 	git config status.showuntrackedfiles no
+	test_when_finished "git config --unset status.showuntrackedfiles" &&
 	git status >output &&
 	test_cmp expect output
 '
@@ -197,7 +201,7 @@ cat >expect <<EOF
 # Untracked files not listed
 EOF
 git config advice.statusHints false
-test_expect_success 'status -uno (advice.statusHints false)' '
+test_expect_success NO_GETTEXT_POISON 'status -uno (advice.statusHints false)' '
 	git status -uno >output &&
 	test_cmp expect output
 '
@@ -208,7 +212,6 @@ cat >expect << EOF
 A  dir2/added
 EOF
 test_expect_success 'status -s -uno' '
-	git config --unset status.showuntrackedfiles
 	git status -s -uno >output &&
 	test_cmp expect output
 '
@@ -243,13 +246,14 @@ cat >expect <<EOF
 #	output
 #	untracked
 EOF
-test_expect_success 'status -unormal' '
+test_expect_success NO_GETTEXT_POISON 'status -unormal' '
 	git status -unormal >output &&
 	test_cmp expect output
 '
 
-test_expect_success 'status (status.showUntrackedFiles normal)' '
+test_expect_success NO_GETTEXT_POISON 'status (status.showUntrackedFiles normal)' '
 	git config status.showuntrackedfiles normal
+	test_when_finished "git config --unset status.showuntrackedfiles" &&
 	git status >output &&
 	test_cmp expect output
 '
@@ -266,7 +270,6 @@ A  dir2/added
 ?? untracked
 EOF
 test_expect_success 'status -s -unormal' '
-	git config --unset status.showuntrackedfiles
 	git status -s -unormal >output &&
 	test_cmp expect output
 '
@@ -302,18 +305,21 @@ cat >expect <<EOF
 #	output
 #	untracked
 EOF
-test_expect_success 'status -uall' '
+test_expect_success NO_GETTEXT_POISON 'status -uall' '
 	git status -uall >output &&
 	test_cmp expect output
 '
-test_expect_success 'status (status.showUntrackedFiles all)' '
+test_expect_success NO_GETTEXT_POISON 'status (status.showUntrackedFiles all)' '
 	git config status.showuntrackedfiles all
+	test_when_finished "git config --unset status.showuntrackedfiles" &&
 	git status >output &&
-	rm -rf dir3 &&
-	git config --unset status.showuntrackedfiles &&
 	test_cmp expect output
 '
 
+test_expect_success 'teardown dir3' '
+	rm -rf dir3
+'
+
 cat >expect <<EOF
  M dir1/modified
 A  dir2/added
@@ -361,7 +367,7 @@ cat >expect <<\EOF
 #	../untracked
 EOF
 
-test_expect_success 'status with relative paths' '
+test_expect_success NO_GETTEXT_POISON 'status with relative paths' '
 
 	(cd dir1 && git status) >output &&
 	test_cmp expect output
@@ -434,18 +440,19 @@ cat >expect <<\EOF
 #	<BLUE>untracked<RESET>
 EOF
 
-test_expect_success 'status with color.ui' '
+test_expect_success NO_GETTEXT_POISON 'status with color.ui' '
 
 	git config color.ui always &&
+	test_when_finished "git config --unset color.ui" &&
 	git status | test_decode_color >output &&
 	test_cmp expect output
 
 '
 
-test_expect_success 'status with color.status' '
+test_expect_success NO_GETTEXT_POISON 'status with color.status' '
 
-	git config --unset color.ui &&
 	git config color.status always &&
+	test_when_finished "git config --unset color.status" &&
 	git status | test_decode_color >output &&
 	test_cmp expect output
 
@@ -464,7 +471,6 @@ EOF
 
 test_expect_success 'status -s with color.ui' '
 
-	git config --unset color.status &&
 	git config color.ui always &&
 	git status -s | test_decode_color >output &&
 	test_cmp expect output
@@ -564,9 +570,10 @@ cat >expect <<\EOF
 EOF
 
 
-test_expect_success 'status without relative paths' '
+test_expect_success NO_GETTEXT_POISON 'status without relative paths' '
 
-	git config status.relativePaths false
+	git config status.relativePaths false &&
+	test_when_finished "git config --unset status.relativePaths" &&
 	(cd dir1 && git status) >output &&
 	test_cmp expect output
 
@@ -585,6 +592,8 @@ EOF
 
 test_expect_success 'status -s without relative paths' '
 
+	git config status.relativePaths false &&
+	test_when_finished "git config --unset status.relativePaths" &&
 	(cd dir1 && git status -s) >output &&
 	test_cmp expect output
 
@@ -607,7 +616,10 @@ cat <<EOF >expect
 #	untracked
 EOF
 test_expect_success 'dry-run of partial commit excluding new file in index' '
-	git commit --dry-run dir1/modified >output &&
+	git commit --dry-run dir1/modified >output
+'
+
+test_expect_success NO_GETTEXT_POISON 'dry-run of partial commit excluding new file in index: output' '
 	test_cmp expect output
 '
 
@@ -655,13 +667,13 @@ cat >expect <<EOF
 #	output
 #	untracked
 EOF
-test_expect_success 'status submodule summary is disabled by default' '
+test_expect_success NO_GETTEXT_POISON 'status submodule summary is disabled by default' '
 	git status >output &&
 	test_cmp expect output
 '
 
 # we expect the same as the previous test
-test_expect_success 'status --untracked-files=all does not show submodule' '
+test_expect_success NO_GETTEXT_POISON 'status --untracked-files=all does not show submodule' '
 	git status --untracked-files=all >output &&
 	test_cmp expect output
 '
@@ -719,7 +731,7 @@ cat >expect <<EOF
 #	output
 #	untracked
 EOF
-test_expect_success 'status submodule summary' '
+test_expect_success NO_GETTEXT_POISON 'status submodule summary' '
 	git config status.submodulesummary 10 &&
 	git status >output &&
 	test_cmp expect output
@@ -760,8 +772,11 @@ cat >expect <<EOF
 #	untracked
 no changes added to commit (use "git add" and/or "git commit -a")
 EOF
-test_expect_success 'status submodule summary (clean submodule)' '
-	git commit -m "commit submodule" &&
+test_expect_success 'status submodule summary (clean submodule): commit' '
+	git commit -m "commit submodule"
+'
+
+test_expect_success NO_GETTEXT_POISON 'status submodule summary (clean submodule): output' '
 	git config status.submodulesummary 10 &&
 	test_must_fail git commit --dry-run >output &&
 	test_cmp expect output &&
@@ -812,7 +827,7 @@ cat >expect <<EOF
 #	output
 #	untracked
 EOF
-test_expect_success 'commit --dry-run submodule summary (--amend)' '
+test_expect_success NO_GETTEXT_POISON 'commit --dry-run submodule summary (--amend)' '
 	git config status.submodulesummary 10 &&
 	git commit --dry-run --amend >output &&
 	test_cmp expect output
@@ -867,13 +882,13 @@ cat > expect << EOF
 #	untracked
 EOF
 
-test_expect_success '--ignore-submodules=untracked suppresses submodules with untracked content' '
+test_expect_success NO_GETTEXT_POISON '--ignore-submodules=untracked suppresses submodules with untracked content' '
 	echo modified > sm/untracked &&
 	git status --ignore-submodules=untracked > output &&
 	test_cmp expect output
 '
 
-test_expect_success '.gitmodules ignore=untracked suppresses submodules with untracked content' '
+test_expect_success NO_GETTEXT_POISON '.gitmodules ignore=untracked suppresses submodules with untracked content' '
 	git config diff.ignoreSubmodules dirty &&
 	git status >output &&
 	test_cmp expect output &&
@@ -885,7 +900,7 @@ test_expect_success '.gitmodules ignore=untracked suppresses submodules with unt
 	git config --unset diff.ignoreSubmodules
 '
 
-test_expect_success '.git/config ignore=untracked suppresses submodules with untracked content' '
+test_expect_success NO_GETTEXT_POISON '.git/config ignore=untracked suppresses submodules with untracked content' '
 	git config --add -f .gitmodules submodule.subname.ignore none &&
 	git config --add -f .gitmodules submodule.subname.path sm &&
 	git config --add submodule.subname.ignore untracked &&
@@ -896,12 +911,12 @@ test_expect_success '.git/config ignore=untracked suppresses submodules with unt
 	git config --remove-section -f .gitmodules submodule.subname
 '
 
-test_expect_success '--ignore-submodules=dirty suppresses submodules with untracked content' '
+test_expect_success NO_GETTEXT_POISON '--ignore-submodules=dirty suppresses submodules with untracked content' '
 	git status --ignore-submodules=dirty > output &&
 	test_cmp expect output
 '
 
-test_expect_success '.gitmodules ignore=dirty suppresses submodules with untracked content' '
+test_expect_success NO_GETTEXT_POISON '.gitmodules ignore=dirty suppresses submodules with untracked content' '
 	git config diff.ignoreSubmodules dirty &&
 	git status >output &&
 	! test -s actual &&
@@ -913,7 +928,7 @@ test_expect_success '.gitmodules ignore=dirty suppresses submodules with untrack
 	git config --unset diff.ignoreSubmodules
 '
 
-test_expect_success '.git/config ignore=dirty suppresses submodules with untracked content' '
+test_expect_success NO_GETTEXT_POISON '.git/config ignore=dirty suppresses submodules with untracked content' '
 	git config --add -f .gitmodules submodule.subname.ignore none &&
 	git config --add -f .gitmodules submodule.subname.path sm &&
 	git config --add submodule.subname.ignore dirty &&
@@ -924,13 +939,13 @@ test_expect_success '.git/config ignore=dirty suppresses submodules with untrack
 	git config -f .gitmodules  --remove-section submodule.subname
 '
 
-test_expect_success '--ignore-submodules=dirty suppresses submodules with modified content' '
+test_expect_success NO_GETTEXT_POISON '--ignore-submodules=dirty suppresses submodules with modified content' '
 	echo modified > sm/foo &&
 	git status --ignore-submodules=dirty > output &&
 	test_cmp expect output
 '
 
-test_expect_success '.gitmodules ignore=dirty suppresses submodules with modified content' '
+test_expect_success NO_GETTEXT_POISON '.gitmodules ignore=dirty suppresses submodules with modified content' '
 	git config --add -f .gitmodules submodule.subname.ignore dirty &&
 	git config --add -f .gitmodules submodule.subname.path sm &&
 	git status > output &&
@@ -938,7 +953,7 @@ test_expect_success '.gitmodules ignore=dirty suppresses submodules with modifie
 	git config -f .gitmodules  --remove-section submodule.subname
 '
 
-test_expect_success '.git/config ignore=dirty suppresses submodules with modified content' '
+test_expect_success NO_GETTEXT_POISON '.git/config ignore=dirty suppresses submodules with modified content' '
 	git config --add -f .gitmodules submodule.subname.ignore none &&
 	git config --add -f .gitmodules submodule.subname.path sm &&
 	git config --add submodule.subname.ignore dirty &&
@@ -981,12 +996,12 @@ cat > expect << EOF
 #	untracked
 EOF
 
-test_expect_success "--ignore-submodules=untracked doesn't suppress submodules with modified content" '
+test_expect_success NO_GETTEXT_POISON "--ignore-submodules=untracked doesn't suppress submodules with modified content" '
 	git status --ignore-submodules=untracked > output &&
 	test_cmp expect output
 '
 
-test_expect_success ".gitmodules ignore=untracked doesn't suppress submodules with modified content" '
+test_expect_success NO_GETTEXT_POISON ".gitmodules ignore=untracked doesn't suppress submodules with modified content" '
 	git config --add -f .gitmodules submodule.subname.ignore untracked &&
 	git config --add -f .gitmodules submodule.subname.path sm &&
 	git status > output &&
@@ -994,7 +1009,7 @@ test_expect_success ".gitmodules ignore=untracked doesn't suppress submodules wi
 	git config -f .gitmodules  --remove-section submodule.subname
 '
 
-test_expect_success ".git/config ignore=untracked doesn't suppress submodules with modified content" '
+test_expect_success NO_GETTEXT_POISON ".git/config ignore=untracked doesn't suppress submodules with modified content" '
 	git config --add -f .gitmodules submodule.subname.ignore none &&
 	git config --add -f .gitmodules submodule.subname.path sm &&
 	git config --add submodule.subname.ignore untracked &&
@@ -1043,12 +1058,12 @@ cat > expect << EOF
 #	untracked
 EOF
 
-test_expect_success "--ignore-submodules=untracked doesn't suppress submodule summary" '
+test_expect_success NO_GETTEXT_POISON "--ignore-submodules=untracked doesn't suppress submodule summary" '
 	git status --ignore-submodules=untracked > output &&
 	test_cmp expect output
 '
 
-test_expect_success ".gitmodules ignore=untracked doesn't suppress submodule summary" '
+test_expect_success NO_GETTEXT_POISON ".gitmodules ignore=untracked doesn't suppress submodule summary" '
 	git config --add -f .gitmodules submodule.subname.ignore untracked &&
 	git config --add -f .gitmodules submodule.subname.path sm &&
 	git status > output &&
@@ -1056,7 +1071,7 @@ test_expect_success ".gitmodules ignore=untracked doesn't suppress submodule sum
 	git config -f .gitmodules  --remove-section submodule.subname
 '
 
-test_expect_success ".git/config ignore=untracked doesn't suppress submodule summary" '
+test_expect_success NO_GETTEXT_POISON ".git/config ignore=untracked doesn't suppress submodule summary" '
 	git config --add -f .gitmodules submodule.subname.ignore none &&
 	git config --add -f .gitmodules submodule.subname.path sm &&
 	git config --add submodule.subname.ignore untracked &&
@@ -1067,11 +1082,11 @@ test_expect_success ".git/config ignore=untracked doesn't suppress submodule sum
 	git config -f .gitmodules  --remove-section submodule.subname
 '
 
-test_expect_success "--ignore-submodules=dirty doesn't suppress submodule summary" '
+test_expect_success NO_GETTEXT_POISON "--ignore-submodules=dirty doesn't suppress submodule summary" '
 	git status --ignore-submodules=dirty > output &&
 	test_cmp expect output
 '
-test_expect_success ".gitmodules ignore=dirty doesn't suppress submodule summary" '
+test_expect_success NO_GETTEXT_POISON ".gitmodules ignore=dirty doesn't suppress submodule summary" '
 	git config --add -f .gitmodules submodule.subname.ignore dirty &&
 	git config --add -f .gitmodules submodule.subname.path sm &&
 	git status > output &&
@@ -1079,7 +1094,7 @@ test_expect_success ".gitmodules ignore=dirty doesn't suppress submodule summary
 	git config -f .gitmodules  --remove-section submodule.subname
 '
 
-test_expect_success ".git/config ignore=dirty doesn't suppress submodule summary" '
+test_expect_success NO_GETTEXT_POISON ".git/config ignore=dirty doesn't suppress submodule summary" '
 	git config --add -f .gitmodules submodule.subname.ignore none &&
 	git config --add -f .gitmodules submodule.subname.path sm &&
 	git config --add submodule.subname.ignore dirty &&
@@ -1111,7 +1126,7 @@ cat > expect << EOF
 no changes added to commit (use "git add" and/or "git commit -a")
 EOF
 
-test_expect_success "--ignore-submodules=all suppresses submodule summary" '
+test_expect_success NO_GETTEXT_POISON "--ignore-submodules=all suppresses submodule summary" '
 	git status --ignore-submodules=all > output &&
 	test_cmp expect output
 '
diff --git a/wt-status.c b/wt-status.c
index 123582b..f369eba 100644
--- a/wt-status.c
+++ b/wt-status.c
@@ -57,16 +57,16 @@ static void wt_status_print_unmerged_header(struct wt_status *s)
 {
 	const char *c = color(WT_STATUS_HEADER, s);
 
-	color_fprintf_ln(s->fp, c, "# Unmerged paths:");
+	color_fprintf_ln(s->fp, c, _("# Unmerged paths:"));
 	if (!advice_status_hints)
 		return;
 	if (s->in_merge)
 		;
 	else if (!s->is_initial)
-		color_fprintf_ln(s->fp, c, "#   (use \"git reset %s <file>...\" to unstage)", s->reference);
+		color_fprintf_ln(s->fp, c, _("#   (use \"git reset %s <file>...\" to unstage)"), s->reference);
 	else
-		color_fprintf_ln(s->fp, c, "#   (use \"git rm --cached <file>...\" to unstage)");
-	color_fprintf_ln(s->fp, c, "#   (use \"git add/rm <file>...\" as appropriate to mark resolution)");
+		color_fprintf_ln(s->fp, c, _("#   (use \"git rm --cached <file>...\" to unstage)"));
+	color_fprintf_ln(s->fp, c, _("#   (use \"git add/rm <file>...\" as appropriate to mark resolution)"));
 	color_fprintf_ln(s->fp, c, "#");
 }
 
@@ -80,9 +80,9 @@ static void wt_status_print_cached_header(struct wt_status *s)
 	if (s->in_merge)
 		; /* NEEDSWORK: use "git reset --unresolve"??? */
 	else if (!s->is_initial)
-		color_fprintf_ln(s->fp, c, "#   (use \"git reset %s <file>...\" to unstage)", s->reference);
+		color_fprintf_ln(s->fp, c, _("#   (use \"git reset %s <file>...\" to unstage)"), s->reference);
 	else
-		color_fprintf_ln(s->fp, c, "#   (use \"git rm --cached <file>...\" to unstage)");
+		color_fprintf_ln(s->fp, c, _("#   (use \"git rm --cached <file>...\" to unstage)"));
 	color_fprintf_ln(s->fp, c, "#");
 }
 
@@ -92,16 +92,16 @@ static void wt_status_print_dirty_header(struct wt_status *s,
 {
 	const char *c = color(WT_STATUS_HEADER, s);
 
-	color_fprintf_ln(s->fp, c, "# Changes not staged for commit:");
+	color_fprintf_ln(s->fp, c, _("# Changes not staged for commit:"));
 	if (!advice_status_hints)
 		return;
 	if (!has_deleted)
-		color_fprintf_ln(s->fp, c, "#   (use \"git add <file>...\" to update what will be committed)");
+		color_fprintf_ln(s->fp, c, _("#   (use \"git add <file>...\" to update what will be committed)"));
 	else
-		color_fprintf_ln(s->fp, c, "#   (use \"git add/rm <file>...\" to update what will be committed)");
-	color_fprintf_ln(s->fp, c, "#   (use \"git checkout -- <file>...\" to discard changes in working directory)");
+		color_fprintf_ln(s->fp, c, _("#   (use \"git add/rm <file>...\" to update what will be committed)"));
+	color_fprintf_ln(s->fp, c, _("#   (use \"git checkout -- <file>...\" to discard changes in working directory)"));
 	if (has_dirty_submodules)
-		color_fprintf_ln(s->fp, c, "#   (commit or discard the untracked or modified content in submodules)");
+		color_fprintf_ln(s->fp, c, _("#   (commit or discard the untracked or modified content in submodules)"));
 	color_fprintf_ln(s->fp, c, "#");
 }
 
@@ -110,10 +110,10 @@ static void wt_status_print_other_header(struct wt_status *s,
 					 const char *how)
 {
 	const char *c = color(WT_STATUS_HEADER, s);
-	color_fprintf_ln(s->fp, c, "# %s files:", what);
+	color_fprintf_ln(s->fp, c, _("# %s files:"), what);
 	if (!advice_status_hints)
 		return;
-	color_fprintf_ln(s->fp, c, "#   (use \"git %s <file>...\" to include in what will be committed)", how);
+	color_fprintf_ln(s->fp, c, _("#   (use \"git %s <file>...\" to include in what will be committed)"), how);
 	color_fprintf_ln(s->fp, c, "#");
 }
 
@@ -130,18 +130,18 @@ static void wt_status_print_unmerged_data(struct wt_status *s,
 	const char *c = color(WT_STATUS_UNMERGED, s);
 	struct wt_status_change_data *d = it->util;
 	struct strbuf onebuf = STRBUF_INIT;
-	const char *one, *how = "bug";
+	const char *one, *how = _("bug");
 
 	one = quote_path(it->string, -1, &onebuf, s->prefix);
 	color_fprintf(s->fp, color(WT_STATUS_HEADER, s), "#\t");
 	switch (d->stagemask) {
-	case 1: how = "both deleted:"; break;
-	case 2: how = "added by us:"; break;
-	case 3: how = "deleted by them:"; break;
-	case 4: how = "added by them:"; break;
-	case 5: how = "deleted by us:"; break;
-	case 6: how = "both added:"; break;
-	case 7: how = "both modified:"; break;
+	case 1: how = _("both deleted:"); break;
+	case 2: how = _("added by us:"); break;
+	case 3: how = _("deleted by them:"); break;
+	case 4: how = _("added by them:"); break;
+	case 5: how = _("deleted by us:"); break;
+	case 6: how = _("both added:"); break;
+	case 7: how = _("both modified:"); break;
 	}
 	color_fprintf(s->fp, c, "%-20s%s\n", how, one);
 	strbuf_release(&onebuf);
@@ -171,11 +171,11 @@ static void wt_status_print_change_data(struct wt_status *s,
 		if (d->new_submodule_commits || d->dirty_submodule) {
 			strbuf_addstr(&extra, " (");
 			if (d->new_submodule_commits)
-				strbuf_addf(&extra, "new commits, ");
+				strbuf_addf(&extra, _("new commits, "));
 			if (d->dirty_submodule & DIRTY_SUBMODULE_MODIFIED)
-				strbuf_addf(&extra, "modified content, ");
+				strbuf_addf(&extra, _("modified content, "));
 			if (d->dirty_submodule & DIRTY_SUBMODULE_UNTRACKED)
-				strbuf_addf(&extra, "untracked content, ");
+				strbuf_addf(&extra, _("untracked content, "));
 			strbuf_setlen(&extra, extra.len - 2);
 			strbuf_addch(&extra, ')');
 		}
@@ -189,31 +189,31 @@ static void wt_status_print_change_data(struct wt_status *s,
 	color_fprintf(s->fp, color(WT_STATUS_HEADER, s), "#\t");
 	switch (status) {
 	case DIFF_STATUS_ADDED:
-		color_fprintf(s->fp, c, "new file:   %s", one);
+		color_fprintf(s->fp, c, _("new file:   %s"), one);
 		break;
 	case DIFF_STATUS_COPIED:
-		color_fprintf(s->fp, c, "copied:     %s -> %s", one, two);
+		color_fprintf(s->fp, c, _("copied:     %s -> %s"), one, two);
 		break;
 	case DIFF_STATUS_DELETED:
-		color_fprintf(s->fp, c, "deleted:    %s", one);
+		color_fprintf(s->fp, c, _("deleted:    %s"), one);
 		break;
 	case DIFF_STATUS_MODIFIED:
-		color_fprintf(s->fp, c, "modified:   %s", one);
+		color_fprintf(s->fp, c, _("modified:   %s"), one);
 		break;
 	case DIFF_STATUS_RENAMED:
 		color_fprintf(s->fp, c, "renamed:    %s -> %s", one, two);
 		break;
 	case DIFF_STATUS_TYPE_CHANGED:
-		color_fprintf(s->fp, c, "typechange: %s", one);
+		color_fprintf(s->fp, c, _("typechange: %s"), one);
 		break;
 	case DIFF_STATUS_UNKNOWN:
-		color_fprintf(s->fp, c, "unknown:    %s", one);
+		color_fprintf(s->fp, c, _("unknown:    %s"), one);
 		break;
 	case DIFF_STATUS_UNMERGED:
-		color_fprintf(s->fp, c, "unmerged:   %s", one);
+		color_fprintf(s->fp, c, _("unmerged:   %s"), one);
 		break;
 	default:
-		die("bug: unhandled diff status %c", status);
+		die(_("bug: unhandled diff status %c"), status);
 	}
 	if (extra.len) {
 		color_fprintf(s->fp, color(WT_STATUS_HEADER, s), "%s", extra.buf);
@@ -633,14 +633,14 @@ void wt_status_print(struct wt_status *s)
 	const char *branch_status_color = color(WT_STATUS_HEADER, s);
 
 	if (s->branch) {
-		const char *on_what = "On branch ";
+		const char *on_what = _("On branch ");
 		const char *branch_name = s->branch;
 		if (!prefixcmp(branch_name, "refs/heads/"))
 			branch_name += 11;
 		else if (!strcmp(branch_name, "HEAD")) {
 			branch_name = "";
 			branch_status_color = color(WT_STATUS_NOBRANCH, s);
-			on_what = "Not currently on any branch.";
+			on_what = _("Not currently on any branch.");
 		}
 		color_fprintf(s->fp, color(WT_STATUS_HEADER, s), "# ");
 		color_fprintf(s->fp, branch_status_color, "%s", on_what);
@@ -665,29 +665,29 @@ void wt_status_print(struct wt_status *s)
 		wt_status_print_submodule_summary(s, 1);  /* unstaged */
 	}
 	if (s->show_untracked_files) {
-		wt_status_print_other(s, &s->untracked, "Untracked", "add");
+		wt_status_print_other(s, &s->untracked, _("Untracked"), "add");
 		if (s->show_ignored_files)
-			wt_status_print_other(s, &s->ignored, "Ignored", "add -f");
+			wt_status_print_other(s, &s->ignored, _("Ignored"), "add -f");
 	} else if (s->commitable)
-		fprintf(s->fp, "# Untracked files not listed%s\n",
+		fprintf(s->fp, _("# Untracked files not listed%s\n"),
 			advice_status_hints
-			? " (use -u option to show untracked files)" : "");
+			? _(" (use -u option to show untracked files)") : "");
 
 	if (s->verbose)
 		wt_status_print_verbose(s);
 	if (!s->commitable) {
 		if (s->amend)
-			fprintf(s->fp, "# No changes\n");
+			fprintf(s->fp, _("# No changes\n"));
 		else if (s->nowarn)
 			; /* nothing */
 		else if (s->workdir_dirty)
-			printf("no changes added to commit%s\n",
+			printf(_("no changes added to commit%s\n"),
 				advice_status_hints
-				? " (use \"git add\" and/or \"git commit -a\")" : "");
+				? _(" (use \"git add\" and/or \"git commit -a\")") : "");
 		else if (s->untracked.nr)
-			printf("nothing added to commit but untracked files present%s\n",
+			printf(_("nothing added to commit but untracked files present%s\n"),
 				advice_status_hints
-				? " (use \"git add\" to track)" : "");
+				? _(" (use \"git add\" to track)") : "");
 		else if (s->is_initial)
 			printf("nothing to commit%s\n", advice_status_hints
 				? " (create/copy files and use \"git add\" to track)" : "");
-- 
1.7.2.3

^ permalink raw reply related	[flat|nested] 222+ messages in thread

* [PATCH 54/72] gettextize: git-status "nothing to commit" messages
  2011-02-19 19:23 [PATCH 00/72] No-op C gettext wrappers Ævar Arnfjörð Bjarmason
                   ` (52 preceding siblings ...)
  2011-02-19 19:24 ` [PATCH 53/72] gettextize: git-status basic messages Ævar Arnfjörð Bjarmason
@ 2011-02-19 19:24 ` Ævar Arnfjörð Bjarmason
  2011-02-19 19:24 ` [PATCH 55/72] gettextize: git-status shortstatus messages Ævar Arnfjörð Bjarmason
                   ` (18 subsequent siblings)
  72 siblings, 0 replies; 222+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2011-02-19 19:24 UTC (permalink / raw)
  To: git; +Cc: Junio C Hamano, Ævar Arnfjörð Bjarmason

Gettextize the "nothing to commit" messages. Many tests explicitly
checked for this message. Change them to skip under
GETTEXT_POISON=YesPlease.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
---
 t/t7506-status-submodule.sh |    8 ++++----
 wt-status.c                 |   12 ++++++------
 2 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/t/t7506-status-submodule.sh b/t/t7506-status-submodule.sh
index 74e0f6f..2347451 100755
--- a/t/t7506-status-submodule.sh
+++ b/t/t7506-status-submodule.sh
@@ -20,12 +20,12 @@ test_expect_success 'setup' '
 	git commit -m "Add submodule sub"
 '
 
-test_expect_success 'status clean' '
+test_expect_success NO_GETTEXT_POISON 'status clean' '
 	git status >output &&
 	grep "nothing to commit" output
 '
 
-test_expect_success 'commit --dry-run -a clean' '
+test_expect_success NO_GETTEXT_POISON 'commit --dry-run -a clean' '
 	test_must_fail git commit --dry-run -a >output &&
 	grep "nothing to commit" output
 '
@@ -177,12 +177,12 @@ test_expect_success 'rm submodule contents' '
 	rm -rf sub/* sub/.git
 '
 
-test_expect_success 'status clean (empty submodule dir)' '
+test_expect_success NO_GETTEXT_POISON 'status clean (empty submodule dir)' '
 	git status >output &&
 	grep "nothing to commit" output
 '
 
-test_expect_success 'status -a clean (empty submodule dir)' '
+test_expect_success NO_GETTEXT_POISON 'status -a clean (empty submodule dir)' '
 	test_must_fail git commit --dry-run -a >output &&
 	grep "nothing to commit" output
 '
diff --git a/wt-status.c b/wt-status.c
index f369eba..a975d07 100644
--- a/wt-status.c
+++ b/wt-status.c
@@ -689,14 +689,14 @@ void wt_status_print(struct wt_status *s)
 				advice_status_hints
 				? _(" (use \"git add\" to track)") : "");
 		else if (s->is_initial)
-			printf("nothing to commit%s\n", advice_status_hints
-				? " (create/copy files and use \"git add\" to track)" : "");
+			printf(_("nothing to commit%s\n"), advice_status_hints
+				? _(" (create/copy files and use \"git add\" to track)") : "");
 		else if (!s->show_untracked_files)
-			printf("nothing to commit%s\n", advice_status_hints
-				? " (use -u to show untracked files)" : "");
+			printf(_("nothing to commit%s\n"), advice_status_hints
+				? _(" (use -u to show untracked files)") : "");
 		else
-			printf("nothing to commit%s\n", advice_status_hints
-				? " (working directory clean)" : "");
+			printf(_("nothing to commit%s\n"), advice_status_hints
+				? _(" (working directory clean)") : "");
 	}
 }
 
-- 
1.7.2.3

^ permalink raw reply related	[flat|nested] 222+ messages in thread

* [PATCH 55/72] gettextize: git-status shortstatus messages
  2011-02-19 19:23 [PATCH 00/72] No-op C gettext wrappers Ævar Arnfjörð Bjarmason
                   ` (53 preceding siblings ...)
  2011-02-19 19:24 ` [PATCH 54/72] gettextize: git-status "nothing to commit" messages Ævar Arnfjörð Bjarmason
@ 2011-02-19 19:24 ` Ævar Arnfjörð Bjarmason
  2011-02-19 19:24 ` [PATCH 56/72] gettextize: git-status "Changes to be committed" message Ævar Arnfjörð Bjarmason
                   ` (17 subsequent siblings)
  72 siblings, 0 replies; 222+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2011-02-19 19:24 UTC (permalink / raw)
  To: git; +Cc: Junio C Hamano, Ævar Arnfjörð Bjarmason

Make the messages added in v1.7.2-rc0~54^2~1 translatable. Some of
these could use the to be implemented plural support in the gettext
library.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
---
 wt-status.c |   12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/wt-status.c b/wt-status.c
index a975d07..fc38ac2 100644
--- a/wt-status.c
+++ b/wt-status.c
@@ -804,13 +804,13 @@ static void wt_shortstatus_print_tracking(struct wt_status *s)
 	if (!prefixcmp(branch_name, "refs/heads/"))
 		branch_name += 11;
 	else if (!strcmp(branch_name, "HEAD")) {
-		branch_name = "HEAD (no branch)";
+		branch_name = _("HEAD (no branch)");
 		branch_color_local = color(WT_STATUS_NOBRANCH, s);
 	}
 
 	branch = branch_get(s->branch + 11);
 	if (s->is_initial)
-		color_fprintf(s->fp, header_color, "Initial commit on ");
+		color_fprintf(s->fp, header_color, _("Initial commit on "));
 	if (!stat_tracking_info(branch, &num_ours, &num_theirs)) {
 		color_fprintf_ln(s->fp, branch_color_local,
 			"%s", branch_name);
@@ -825,15 +825,15 @@ static void wt_shortstatus_print_tracking(struct wt_status *s)
 
 	color_fprintf(s->fp, header_color, " [");
 	if (!num_ours) {
-		color_fprintf(s->fp, header_color, "behind ");
+		color_fprintf(s->fp, header_color, _("behind "));
 		color_fprintf(s->fp, branch_color_remote, "%d", num_theirs);
 	} else if (!num_theirs) {
-		color_fprintf(s->fp, header_color, "ahead ");
+		color_fprintf(s->fp, header_color, _("ahead "));
 		color_fprintf(s->fp, branch_color_local, "%d", num_ours);
 	} else {
-		color_fprintf(s->fp, header_color, "ahead ");
+		color_fprintf(s->fp, header_color, _("ahead "));
 		color_fprintf(s->fp, branch_color_local, "%d", num_ours);
-		color_fprintf(s->fp, header_color, ", behind ");
+		color_fprintf(s->fp, header_color, _(", behind "));
 		color_fprintf(s->fp, branch_color_remote, "%d", num_theirs);
 	}
 
-- 
1.7.2.3

^ permalink raw reply related	[flat|nested] 222+ messages in thread

* [PATCH 56/72] gettextize: git-status "Changes to be committed" message
  2011-02-19 19:23 [PATCH 00/72] No-op C gettext wrappers Ævar Arnfjörð Bjarmason
                   ` (54 preceding siblings ...)
  2011-02-19 19:24 ` [PATCH 55/72] gettextize: git-status shortstatus messages Ævar Arnfjörð Bjarmason
@ 2011-02-19 19:24 ` Ævar Arnfjörð Bjarmason
  2011-02-19 19:24 ` [PATCH 57/72] gettextize: git-status "Initial commit" message Ævar Arnfjörð Bjarmason
                   ` (16 subsequent siblings)
  72 siblings, 0 replies; 222+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2011-02-19 19:24 UTC (permalink / raw)
  To: git; +Cc: Junio C Hamano, Ævar Arnfjörð Bjarmason

Gettextize the "# Changes to be committed:" messages. Several tests
explicitly checked for this message. Change them to skip under
GETTEXT_POISON=YesPlease.

Since these tests didn't check for the rest of the git-status(1)
output this change has been split up from the "git-status basic
messages" patch.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
---
 t/t7502-commit.sh |   20 ++++++++++----------
 wt-status.c       |    2 +-
 2 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/t/t7502-commit.sh b/t/t7502-commit.sh
index 6586355..d7c4280 100755
--- a/t/t7502-commit.sh
+++ b/t/t7502-commit.sh
@@ -384,66 +384,66 @@ try_commit () {
 
 try_commit_status_combo () {
 
-	test_expect_success 'commit' '
+	test_expect_success NO_GETTEXT_POISON 'commit' '
 		clear_config commit.status &&
 		try_commit "" &&
 		grep "^# Changes to be committed:" .git/COMMIT_EDITMSG
 	'
 
-	test_expect_success 'commit' '
+	test_expect_success NO_GETTEXT_POISON 'commit' '
 		clear_config commit.status &&
 		try_commit "" &&
 		grep "^# Changes to be committed:" .git/COMMIT_EDITMSG
 	'
 
-	test_expect_success 'commit --status' '
+	test_expect_success NO_GETTEXT_POISON 'commit --status' '
 		clear_config commit.status &&
 		try_commit --status &&
 		grep "^# Changes to be committed:" .git/COMMIT_EDITMSG
 	'
 
-	test_expect_success 'commit --no-status' '
+	test_expect_success NO_GETTEXT_POISON 'commit --no-status' '
 		clear_config commit.status &&
 		try_commit --no-status &&
 		! grep "^# Changes to be committed:" .git/COMMIT_EDITMSG
 	'
 
-	test_expect_success 'commit with commit.status = yes' '
+	test_expect_success NO_GETTEXT_POISON 'commit with commit.status = yes' '
 		clear_config commit.status &&
 		git config commit.status yes &&
 		try_commit "" &&
 		grep "^# Changes to be committed:" .git/COMMIT_EDITMSG
 	'
 
-	test_expect_success 'commit with commit.status = no' '
+	test_expect_success NO_GETTEXT_POISON 'commit with commit.status = no' '
 		clear_config commit.status &&
 		git config commit.status no &&
 		try_commit "" &&
 		! grep "^# Changes to be committed:" .git/COMMIT_EDITMSG
 	'
 
-	test_expect_success 'commit --status with commit.status = yes' '
+	test_expect_success NO_GETTEXT_POISON 'commit --status with commit.status = yes' '
 		clear_config commit.status &&
 		git config commit.status yes &&
 		try_commit --status &&
 		grep "^# Changes to be committed:" .git/COMMIT_EDITMSG
 	'
 
-	test_expect_success 'commit --no-status with commit.status = yes' '
+	test_expect_success NO_GETTEXT_POISON 'commit --no-status with commit.status = yes' '
 		clear_config commit.status &&
 		git config commit.status yes &&
 		try_commit --no-status &&
 		! grep "^# Changes to be committed:" .git/COMMIT_EDITMSG
 	'
 
-	test_expect_success 'commit --status with commit.status = no' '
+	test_expect_success NO_GETTEXT_POISON 'commit --status with commit.status = no' '
 		clear_config commit.status &&
 		git config commit.status no &&
 		try_commit --status &&
 		grep "^# Changes to be committed:" .git/COMMIT_EDITMSG
 	'
 
-	test_expect_success 'commit --no-status with commit.status = no' '
+	test_expect_success NO_GETTEXT_POISON 'commit --no-status with commit.status = no' '
 		clear_config commit.status &&
 		git config commit.status no &&
 		try_commit --no-status &&
diff --git a/wt-status.c b/wt-status.c
index fc38ac2..c6295f9 100644
--- a/wt-status.c
+++ b/wt-status.c
@@ -74,7 +74,7 @@ static void wt_status_print_cached_header(struct wt_status *s)
 {
 	const char *c = color(WT_STATUS_HEADER, s);
 
-	color_fprintf_ln(s->fp, c, "# Changes to be committed:");
+	color_fprintf_ln(s->fp, c, _("# Changes to be committed:"));
 	if (!advice_status_hints)
 		return;
 	if (s->in_merge)
-- 
1.7.2.3

^ permalink raw reply related	[flat|nested] 222+ messages in thread

* [PATCH 57/72] gettextize: git-status "Initial commit" message
  2011-02-19 19:23 [PATCH 00/72] No-op C gettext wrappers Ævar Arnfjörð Bjarmason
                   ` (55 preceding siblings ...)
  2011-02-19 19:24 ` [PATCH 56/72] gettextize: git-status "Changes to be committed" message Ævar Arnfjörð Bjarmason
@ 2011-02-19 19:24 ` Ævar Arnfjörð Bjarmason
  2011-02-19 19:24 ` [PATCH 58/72] gettextize: git-status "renamed: " message Ævar Arnfjörð Bjarmason
                   ` (15 subsequent siblings)
  72 siblings, 0 replies; 222+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2011-02-19 19:24 UTC (permalink / raw)
  To: git; +Cc: Junio C Hamano, Ævar Arnfjörð Bjarmason

Gettextize the "# Initial commit" message. A test in t7501-commit.sh
explicitly checked for this message. Change it to skip under
GETTEXT_POISON=YesPlease.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
---
 t/t7501-commit.sh |    7 +++++--
 wt-status.c       |    2 +-
 2 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/t/t7501-commit.sh b/t/t7501-commit.sh
index 8980738..9f6e852 100755
--- a/t/t7501-commit.sh
+++ b/t/t7501-commit.sh
@@ -14,8 +14,11 @@ test_tick
 test_expect_success \
 	"initial status" \
 	"echo 'bongo bongo' >file &&
-	 git add file && \
-	 git status | grep 'Initial commit'"
+	 git add file"
+
+test_expect_success NO_GETTEXT_POISON \
+	"Constructing initial commit" \
+	"git status | grep 'Initial commit'"
 
 test_expect_success \
 	"fail initial amend" \
diff --git a/wt-status.c b/wt-status.c
index c6295f9..ad6ef7a 100644
--- a/wt-status.c
+++ b/wt-status.c
@@ -651,7 +651,7 @@ void wt_status_print(struct wt_status *s)
 
 	if (s->is_initial) {
 		color_fprintf_ln(s->fp, color(WT_STATUS_HEADER, s), "#");
-		color_fprintf_ln(s->fp, color(WT_STATUS_HEADER, s), "# Initial commit");
+		color_fprintf_ln(s->fp, color(WT_STATUS_HEADER, s), _("# Initial commit"));
 		color_fprintf_ln(s->fp, color(WT_STATUS_HEADER, s), "#");
 	}
 
-- 
1.7.2.3

^ permalink raw reply related	[flat|nested] 222+ messages in thread

* [PATCH 58/72] gettextize: git-status "renamed: " message
  2011-02-19 19:23 [PATCH 00/72] No-op C gettext wrappers Ævar Arnfjörð Bjarmason
                   ` (56 preceding siblings ...)
  2011-02-19 19:24 ` [PATCH 57/72] gettextize: git-status "Initial commit" message Ævar Arnfjörð Bjarmason
@ 2011-02-19 19:24 ` Ævar Arnfjörð Bjarmason
  2011-02-19 19:24 ` [PATCH 59/72] gettextize: git-archive basic messages Ævar Arnfjörð Bjarmason
                   ` (14 subsequent siblings)
  72 siblings, 0 replies; 222+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2011-02-19 19:24 UTC (permalink / raw)
  To: git; +Cc: Junio C Hamano, Ævar Arnfjörð Bjarmason

Gettextize the "renamed: %s -> %s" message which appears as part of
git-status(1) output. Two tests in t4001-diff-rename.sh explicitly
checked for this message. Change them to skip under
GETTEXT_POISON=YesPlease.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
---
 t/t4001-diff-rename.sh |    4 ++--
 wt-status.c            |    2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/t/t4001-diff-rename.sh b/t/t4001-diff-rename.sh
index 71bac83..d42c077 100755
--- a/t/t4001-diff-rename.sh
+++ b/t/t4001-diff-rename.sh
@@ -64,7 +64,7 @@ test_expect_success \
     'validate the output.' \
     'compare_diff_patch current expected'
 
-test_expect_success 'favour same basenames over different ones' '
+test_expect_success NO_GETTEXT_POISON 'favour same basenames over different ones' '
 	cp path1 another-path &&
 	git add another-path &&
 	git commit -m 1 &&
@@ -73,7 +73,7 @@ test_expect_success 'favour same basenames over different ones' '
 	git mv another-path subdir/path1 &&
 	git status | grep "renamed: .*path1 -> subdir/path1"'
 
-test_expect_success  'favour same basenames even with minor differences' '
+test_expect_success NO_GETTEXT_POISON  'favour same basenames even with minor differences' '
 	git show HEAD:path1 | sed "s/15/16/" > subdir/path1 &&
 	git status | grep "renamed: .*path1 -> subdir/path1"'
 
diff --git a/wt-status.c b/wt-status.c
index ad6ef7a..ed6bedd 100644
--- a/wt-status.c
+++ b/wt-status.c
@@ -201,7 +201,7 @@ static void wt_status_print_change_data(struct wt_status *s,
 		color_fprintf(s->fp, c, _("modified:   %s"), one);
 		break;
 	case DIFF_STATUS_RENAMED:
-		color_fprintf(s->fp, c, "renamed:    %s -> %s", one, two);
+		color_fprintf(s->fp, c, _("renamed:    %s -> %s"), one, two);
 		break;
 	case DIFF_STATUS_TYPE_CHANGED:
 		color_fprintf(s->fp, c, _("typechange: %s"), one);
-- 
1.7.2.3

^ permalink raw reply related	[flat|nested] 222+ messages in thread

* [PATCH 59/72] gettextize: git-archive basic messages
  2011-02-19 19:23 [PATCH 00/72] No-op C gettext wrappers Ævar Arnfjörð Bjarmason
                   ` (57 preceding siblings ...)
  2011-02-19 19:24 ` [PATCH 58/72] gettextize: git-status "renamed: " message Ævar Arnfjörð Bjarmason
@ 2011-02-19 19:24 ` Ævar Arnfjörð Bjarmason
  2011-02-19 19:24 ` [PATCH 60/72] gettextize: git-bundle " Ævar Arnfjörð Bjarmason
                   ` (13 subsequent siblings)
  72 siblings, 0 replies; 222+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2011-02-19 19:24 UTC (permalink / raw)
  To: git; +Cc: Junio C Hamano, Ævar Arnfjörð Bjarmason

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
---
 builtin/archive.c |   14 +++++++-------
 1 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/builtin/archive.c b/builtin/archive.c
index 6a887f5..b14eaba 100644
--- a/builtin/archive.c
+++ b/builtin/archive.c
@@ -14,10 +14,10 @@ static void create_output_file(const char *output_file)
 {
 	int output_fd = open(output_file, O_CREAT | O_WRONLY | O_TRUNC, 0666);
 	if (output_fd < 0)
-		die_errno("could not create archive file '%s'", output_file);
+		die_errno(_("could not create archive file '%s'"), output_file);
 	if (output_fd != 1) {
 		if (dup2(output_fd, 1) < 0)
-			die_errno("could not redirect output");
+			die_errno(_("could not redirect output"));
 		else
 			close(output_fd);
 	}
@@ -33,7 +33,7 @@ static int run_remote_archiver(int argc, const char **argv,
 
 	_remote = remote_get(remote);
 	if (!_remote->url[0])
-		die("git archive: Remote with no URL");
+		die(_("git archive: Remote with no URL"));
 	transport = transport_get(_remote, _remote->url[0]);
 	transport_connect(transport, "git-upload-archive", exec, fd);
 
@@ -43,18 +43,18 @@ static int run_remote_archiver(int argc, const char **argv,
 
 	len = packet_read_line(fd[0], buf, sizeof(buf));
 	if (!len)
-		die("git archive: expected ACK/NAK, got EOF");
+		die(_("git archive: expected ACK/NAK, got EOF"));
 	if (buf[len-1] == '\n')
 		buf[--len] = 0;
 	if (strcmp(buf, "ACK")) {
 		if (len > 5 && !prefixcmp(buf, "NACK "))
-			die("git archive: NACK %s", buf + 5);
-		die("git archive: protocol error");
+			die(_("git archive: NACK %s"), buf + 5);
+		die(_("git archive: protocol error"));
 	}
 
 	len = packet_read_line(fd[0], buf, sizeof(buf));
 	if (len)
-		die("git archive: expected a flush");
+		die(_("git archive: expected a flush"));
 
 	/* Now, start reading from fd[0] and spit it out to stdout */
 	rv = recv_sideband("archive", fd[0], 1);
-- 
1.7.2.3

^ permalink raw reply related	[flat|nested] 222+ messages in thread

* [PATCH 60/72] gettextize: git-bundle basic messages
  2011-02-19 19:23 [PATCH 00/72] No-op C gettext wrappers Ævar Arnfjörð Bjarmason
                   ` (58 preceding siblings ...)
  2011-02-19 19:24 ` [PATCH 59/72] gettextize: git-archive basic messages Ævar Arnfjörð Bjarmason
@ 2011-02-19 19:24 ` Ævar Arnfjörð Bjarmason
  2011-02-19 19:24 ` [PATCH 61/72] gettextize: git-clean " Ævar Arnfjörð Bjarmason
                   ` (12 subsequent siblings)
  72 siblings, 0 replies; 222+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2011-02-19 19:24 UTC (permalink / raw)
  To: git; +Cc: Junio C Hamano, Ævar Arnfjörð Bjarmason

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
---
 builtin/bundle.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/builtin/bundle.c b/builtin/bundle.c
index 9b87fb9..81046a9 100644
--- a/builtin/bundle.c
+++ b/builtin/bundle.c
@@ -44,7 +44,7 @@ int cmd_bundle(int argc, const char **argv, const char *prefix)
 		close(bundle_fd);
 		if (verify_bundle(&header, 1))
 			return 1;
-		fprintf(stderr, "%s is okay\n", bundle_file);
+		fprintf(stderr, _("%s is okay\n"), bundle_file);
 		return 0;
 	}
 	if (!strcmp(cmd, "list-heads")) {
@@ -53,11 +53,11 @@ int cmd_bundle(int argc, const char **argv, const char *prefix)
 	}
 	if (!strcmp(cmd, "create")) {
 		if (!startup_info->have_repository)
-			die("Need a repository to create a bundle.");
+			die(_("Need a repository to create a bundle."));
 		return !!create_bundle(&header, bundle_file, argc, argv);
 	} else if (!strcmp(cmd, "unbundle")) {
 		if (!startup_info->have_repository)
-			die("Need a repository to unbundle.");
+			die(_("Need a repository to unbundle."));
 		return !!unbundle(&header, bundle_fd) ||
 			list_bundle_refs(&header, argc, argv);
 	} else
-- 
1.7.2.3

^ permalink raw reply related	[flat|nested] 222+ messages in thread

* [PATCH 61/72] gettextize: git-clean basic messages
  2011-02-19 19:23 [PATCH 00/72] No-op C gettext wrappers Ævar Arnfjörð Bjarmason
                   ` (59 preceding siblings ...)
  2011-02-19 19:24 ` [PATCH 60/72] gettextize: git-bundle " Ævar Arnfjörð Bjarmason
@ 2011-02-19 19:24 ` Ævar Arnfjörð Bjarmason
  2011-02-19 19:24 ` [PATCH 62/72] gettextize: git-clean clean.requireForce messages Ævar Arnfjörð Bjarmason
                   ` (11 subsequent siblings)
  72 siblings, 0 replies; 222+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2011-02-19 19:24 UTC (permalink / raw)
  To: git; +Cc: Junio C Hamano, Ævar Arnfjörð Bjarmason

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
---
 builtin/clean.c                  |   20 ++++++++++----------
 t/t7012-skip-worktree-writing.sh |    4 ++--
 t/t7300-clean.sh                 |    6 +++---
 3 files changed, 15 insertions(+), 15 deletions(-)

diff --git a/builtin/clean.c b/builtin/clean.c
index 4a312ab..2d0054b 100644
--- a/builtin/clean.c
+++ b/builtin/clean.c
@@ -75,7 +75,7 @@ int cmd_clean(int argc, const char **argv, const char *prefix)
 		dir.flags |= DIR_SHOW_IGNORED;
 
 	if (ignored && ignored_only)
-		die("-x and -X cannot be used together");
+		die(_("-x and -X cannot be used together"));
 
 	if (!show_only && !force)
 		die("clean.requireForce %s to true and neither -n nor -f given; "
@@ -87,7 +87,7 @@ int cmd_clean(int argc, const char **argv, const char *prefix)
 	dir.flags |= DIR_SHOW_OTHER_DIRECTORIES;
 
 	if (read_cache() < 0)
-		die("index file corrupt");
+		die(_("index file corrupt"));
 
 	if (!ignored)
 		setup_standard_excludes(&dir);
@@ -146,20 +146,20 @@ int cmd_clean(int argc, const char **argv, const char *prefix)
 			qname = quote_path_relative(directory.buf, directory.len, &buf, prefix);
 			if (show_only && (remove_directories ||
 			    (matches == MATCHED_EXACTLY))) {
-				printf("Would remove %s\n", qname);
+				printf(_("Would remove %s\n"), qname);
 			} else if (remove_directories ||
 				   (matches == MATCHED_EXACTLY)) {
 				if (!quiet)
-					printf("Removing %s\n", qname);
+					printf(_("Removing %s\n"), qname);
 				if (remove_dir_recursively(&directory,
 							   rm_flags) != 0) {
-					warning("failed to remove %s", qname);
+					warning(_("failed to remove %s"), qname);
 					errors++;
 				}
 			} else if (show_only) {
-				printf("Would not remove %s\n", qname);
+				printf(_("Would not remove %s\n"), qname);
 			} else {
-				printf("Not removing %s\n", qname);
+				printf(_("Not removing %s\n"), qname);
 			}
 			strbuf_reset(&directory);
 		} else {
@@ -167,13 +167,13 @@ int cmd_clean(int argc, const char **argv, const char *prefix)
 				continue;
 			qname = quote_path_relative(ent->name, -1, &buf, prefix);
 			if (show_only) {
-				printf("Would remove %s\n", qname);
+				printf(_("Would remove %s\n"), qname);
 				continue;
 			} else if (!quiet) {
-				printf("Removing %s\n", qname);
+				printf(_("Removing %s\n"), qname);
 			}
 			if (unlink(ent->name) != 0) {
-				warning("failed to remove %s", qname);
+				warning(_("failed to remove %s"), qname);
 				errors++;
 			}
 		}
diff --git a/t/t7012-skip-worktree-writing.sh b/t/t7012-skip-worktree-writing.sh
index 582d0b5..6fccd91 100755
--- a/t/t7012-skip-worktree-writing.sh
+++ b/t/t7012-skip-worktree-writing.sh
@@ -124,13 +124,13 @@ cat >expected <<EOF
 Would remove expected
 Would remove result
 EOF
-test_expect_success 'git-clean, absent case' '
+test_expect_success NO_GETTEXT_POISON 'git-clean, absent case' '
 	setup_absent &&
 	git clean -n > result &&
 	test_cmp expected result
 '
 
-test_expect_success 'git-clean, dirty case' '
+test_expect_success NO_GETTEXT_POISON 'git-clean, dirty case' '
 	setup_dirty &&
 	git clean -n > result &&
 	test_cmp expected result
diff --git a/t/t7300-clean.sh b/t/t7300-clean.sh
index 02f67b7..70d8168 100755
--- a/t/t7300-clean.sh
+++ b/t/t7300-clean.sh
@@ -110,7 +110,7 @@ test_expect_success 'git clean with prefix' '
 
 '
 
-test_expect_success 'git clean with relative prefix' '
+test_expect_success NO_GETTEXT_POISON 'git clean with relative prefix' '
 
 	mkdir -p build docs &&
 	touch a.out src/part3.c docs/manual.txt obj.o build/lib.so &&
@@ -125,7 +125,7 @@ test_expect_success 'git clean with relative prefix' '
 	}
 '
 
-test_expect_success 'git clean with absolute path' '
+test_expect_success NO_GETTEXT_POISON 'git clean with absolute path' '
 
 	mkdir -p build docs &&
 	touch a.out src/part3.c docs/manual.txt obj.o build/lib.so &&
@@ -377,7 +377,7 @@ test_expect_success 'clean.requireForce and -f' '
 
 '
 
-test_expect_success 'core.excludesfile' '
+test_expect_success NO_GETTEXT_POISON 'core.excludesfile' '
 
 	echo excludes >excludes &&
 	echo included >included &&
-- 
1.7.2.3

^ permalink raw reply related	[flat|nested] 222+ messages in thread

* [PATCH 62/72] gettextize: git-clean clean.requireForce messages
  2011-02-19 19:23 [PATCH 00/72] No-op C gettext wrappers Ævar Arnfjörð Bjarmason
                   ` (60 preceding siblings ...)
  2011-02-19 19:24 ` [PATCH 61/72] gettextize: git-clean " Ævar Arnfjörð Bjarmason
@ 2011-02-19 19:24 ` Ævar Arnfjörð Bjarmason
  2011-02-19 19:24 ` [PATCH 63/72] gettextize: git-describe basic messages Ævar Arnfjörð Bjarmason
                   ` (10 subsequent siblings)
  72 siblings, 0 replies; 222+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2011-02-19 19:24 UTC (permalink / raw)
  To: git; +Cc: Junio C Hamano, Ævar Arnfjörð Bjarmason

Split up the "clean.requireForce set/defaults to true..." die()
message to make it easier to translate.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
---
 builtin/clean.c |   11 ++++++++---
 1 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/builtin/clean.c b/builtin/clean.c
index 2d0054b..75697f7 100644
--- a/builtin/clean.c
+++ b/builtin/clean.c
@@ -77,9 +77,14 @@ int cmd_clean(int argc, const char **argv, const char *prefix)
 	if (ignored && ignored_only)
 		die(_("-x and -X cannot be used together"));
 
-	if (!show_only && !force)
-		die("clean.requireForce %s to true and neither -n nor -f given; "
-		    "refusing to clean", config_set ? "set" : "defaults");
+	if (!show_only && !force) {
+		if (config_set)
+			die(_("clean.requireForce set to true and neither -n nor -f given; "
+				  "refusing to clean"));
+		else
+			die(_("clean.requireForce defaults to true and neither -n nor -f given; "
+				  "refusing to clean"));
+	}
 
 	if (force > 1)
 		rm_flags = 0;
-- 
1.7.2.3

^ permalink raw reply related	[flat|nested] 222+ messages in thread

* [PATCH 63/72] gettextize: git-describe basic messages
  2011-02-19 19:23 [PATCH 00/72] No-op C gettext wrappers Ævar Arnfjörð Bjarmason
                   ` (61 preceding siblings ...)
  2011-02-19 19:24 ` [PATCH 62/72] gettextize: git-clean clean.requireForce messages Ævar Arnfjörð Bjarmason
@ 2011-02-19 19:24 ` Ævar Arnfjörð Bjarmason
  2011-02-19 19:24 ` [PATCH 64/72] gettextize: git-gc " Ævar Arnfjörð Bjarmason
                   ` (9 subsequent siblings)
  72 siblings, 0 replies; 222+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2011-02-19 19:24 UTC (permalink / raw)
  To: git; +Cc: Junio C Hamano, Ævar Arnfjörð Bjarmason

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
---
 builtin/describe.c  |   36 ++++++++++++++++++------------------
 t/t6120-describe.sh |    2 +-
 2 files changed, 19 insertions(+), 19 deletions(-)

diff --git a/builtin/describe.c b/builtin/describe.c
index 342129f..037691e 100644
--- a/builtin/describe.c
+++ b/builtin/describe.c
@@ -231,13 +231,13 @@ static void display_name(struct commit_name *n)
 	if (n->prio == 2 && !n->tag) {
 		n->tag = lookup_tag(n->sha1);
 		if (!n->tag || parse_tag(n->tag))
-			die("annotated tag %s not available", n->path);
+			die(_("annotated tag %s not available"), n->path);
 	}
 	if (n->tag && !n->name_checked) {
 		if (!n->tag->tag)
-			die("annotated tag %s has no embedded name", n->path);
+			die(_("annotated tag %s has no embedded name"), n->path);
 		if (strcmp(n->tag->tag, all ? n->path + 5 : n->path))
-			warning("tag '%s' is really '%s' here", n->tag->tag, n->path);
+			warning(_("tag '%s' is really '%s' here"), n->tag->tag, n->path);
 		n->name_checked = 1;
 	}
 
@@ -264,10 +264,10 @@ static void describe(const char *arg, int last_one)
 	unsigned int unannotated_cnt = 0;
 
 	if (get_sha1(arg, sha1))
-		die("Not a valid object name %s", arg);
+		die(_("Not a valid object name %s"), arg);
 	cmit = lookup_commit_reference(sha1);
 	if (!cmit)
-		die("%s is not a valid '%s' object", arg, commit_type);
+		die(_("%s is not a valid '%s' object"), arg, commit_type);
 
 	n = find_commit_name(cmit->object.sha1);
 	if (n && (tags || all || n->prio == 2)) {
@@ -284,9 +284,9 @@ static void describe(const char *arg, int last_one)
 	}
 
 	if (!max_candidates)
-		die("no tag exactly matches '%s'", sha1_to_hex(cmit->object.sha1));
+		die(_("no tag exactly matches '%s'"), sha1_to_hex(cmit->object.sha1));
 	if (debug)
-		fprintf(stderr, "searching to describe %s\n", arg);
+		fprintf(stderr, _("searching to describe %s\n"), arg);
 
 	if (!have_util) {
 		for_each_hash(&names, set_util);
@@ -326,7 +326,7 @@ static void describe(const char *arg, int last_one)
 		}
 		if (annotated_cnt && !list) {
 			if (debug)
-				fprintf(stderr, "finished search at %s\n",
+				fprintf(stderr, _("finished search at %s\n"),
 					sha1_to_hex(c->object.sha1));
 			break;
 		}
@@ -350,12 +350,12 @@ static void describe(const char *arg, int last_one)
 			return;
 		}
 		if (unannotated_cnt)
-			die("No annotated tags can describe '%s'.\n"
-			    "However, there were unannotated tags: try --tags.",
+			die(_("No annotated tags can describe '%s'.\n"
+			    "However, there were unannotated tags: try --tags."),
 			    sha1_to_hex(sha1));
 		else
-			die("No tags can describe '%s'.\n"
-			    "Try --always, or create some tags.",
+			die(_("No tags can describe '%s'.\n"
+			    "Try --always, or create some tags."),
 			    sha1_to_hex(sha1));
 	}
 
@@ -375,11 +375,11 @@ static void describe(const char *arg, int last_one)
 				prio_names[t->name->prio],
 				t->depth, t->name->path);
 		}
-		fprintf(stderr, "traversed %lu commits\n", seen_commits);
+		fprintf(stderr, _("traversed %lu commits\n"), seen_commits);
 		if (gave_up_on) {
 			fprintf(stderr,
-				"more than %i tags found; listed %i most recent\n"
-				"gave up search at %s\n",
+				_("more than %i tags found; listed %i most recent\n"
+				"gave up search at %s\n"),
 				max_candidates, max_candidates,
 				sha1_to_hex(gave_up_on->object.sha1));
 		}
@@ -429,7 +429,7 @@ int cmd_describe(int argc, const char **argv, const char *prefix)
 	save_commit_buffer = 0;
 
 	if (longformat && abbrev == 0)
-		die("--long is incompatible with --abbrev=0");
+		die(_("--long is incompatible with --abbrev=0"));
 
 	if (contains) {
 		const char **args = xmalloc((7 + argc) * sizeof(char *));
@@ -455,14 +455,14 @@ int cmd_describe(int argc, const char **argv, const char *prefix)
 	init_hash(&names);
 	for_each_rawref(get_name, NULL);
 	if (!names.nr && !always)
-		die("No names found, cannot describe anything.");
+		die(_("No names found, cannot describe anything."));
 
 	if (argc == 0) {
 		if (dirty && !cmd_diff_index(ARRAY_SIZE(diff_index_args) - 1, diff_index_args, prefix))
 			dirty = NULL;
 		describe("HEAD", 1);
 	} else if (dirty) {
-		die("--dirty is incompatible with committishes");
+		die(_("--dirty is incompatible with committishes"));
 	} else {
 		while (argc-- > 0) {
 			describe(*argv++, argc == 0);
diff --git a/t/t6120-describe.sh b/t/t6120-describe.sh
index 876d1ab..210b9a2 100755
--- a/t/t6120-describe.sh
+++ b/t/t6120-describe.sh
@@ -123,7 +123,7 @@ cat - >err.expect <<EOF
 warning: tag 'A' is really 'Q' here
 EOF
 check_describe A-* HEAD
-test_expect_success 'warning was displayed for Q' '
+test_expect_success NO_GETTEXT_POISON 'warning was displayed for Q' '
 	test_cmp err.expect err.actual
 '
 test_expect_success 'rename tag Q back to A' '
-- 
1.7.2.3

^ permalink raw reply related	[flat|nested] 222+ messages in thread

* [PATCH 64/72] gettextize: git-gc basic messages
  2011-02-19 19:23 [PATCH 00/72] No-op C gettext wrappers Ævar Arnfjörð Bjarmason
                   ` (62 preceding siblings ...)
  2011-02-19 19:24 ` [PATCH 63/72] gettextize: git-describe basic messages Ævar Arnfjörð Bjarmason
@ 2011-02-19 19:24 ` Ævar Arnfjörð Bjarmason
  2011-02-19 19:24 ` [PATCH 65/72] gettextize: git-gc "Auto packing the repository" message Ævar Arnfjörð Bjarmason
                   ` (8 subsequent siblings)
  72 siblings, 0 replies; 222+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2011-02-19 19:24 UTC (permalink / raw)
  To: git; +Cc: Junio C Hamano, Ævar Arnfjörð Bjarmason

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
---
 builtin/gc.c |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/builtin/gc.c b/builtin/gc.c
index 1a80702..a2be62a 100644
--- a/builtin/gc.c
+++ b/builtin/gc.c
@@ -60,7 +60,7 @@ static int gc_config(const char *var, const char *value, void *cb)
 		if (value && strcmp(value, "now")) {
 			unsigned long now = approxidate("now");
 			if (approxidate(value) >= now)
-				return error("Invalid %s: '%s'", var, value);
+				return error(_("Invalid %s: '%s'"), var, value);
 		}
 		return git_config_string(&prune_expire, var, value);
 	}
@@ -75,7 +75,7 @@ static void append_option(const char **cmd, const char *opt, int max_length)
 		;
 
 	if (i + 2 >= max_length)
-		die("Too many options specified");
+		die(_("Too many options specified"));
 	cmd[i++] = opt;
 	cmd[i] = NULL;
 }
@@ -100,7 +100,7 @@ static int too_many_loose_objects(void)
 		return 0;
 
 	if (sizeof(path) <= snprintf(path, sizeof(path), "%s/17", objdir)) {
-		warning("insanely long object directory %.*s", 50, objdir);
+		warning(_("insanely long object directory %.*s"), 50, objdir);
 		return 0;
 	}
 	dir = opendir(path);
@@ -251,8 +251,8 @@ int cmd_gc(int argc, const char **argv, const char *prefix)
 		return error(FAILED_RUN, argv_rerere[0]);
 
 	if (auto_gc && too_many_loose_objects())
-		warning("There are too many unreachable loose objects; "
-			"run 'git prune' to remove them.");
+		warning(_("There are too many unreachable loose objects; "
+			"run 'git prune' to remove them."));
 
 	return 0;
 }
-- 
1.7.2.3

^ permalink raw reply related	[flat|nested] 222+ messages in thread

* [PATCH 65/72] gettextize: git-gc "Auto packing the repository" message
  2011-02-19 19:23 [PATCH 00/72] No-op C gettext wrappers Ævar Arnfjörð Bjarmason
                   ` (63 preceding siblings ...)
  2011-02-19 19:24 ` [PATCH 64/72] gettextize: git-gc " Ævar Arnfjörð Bjarmason
@ 2011-02-19 19:24 ` Ævar Arnfjörð Bjarmason
  2011-02-19 19:24 ` [PATCH 66/72] gettextize: git-notes basic commands Ævar Arnfjörð Bjarmason
                   ` (7 subsequent siblings)
  72 siblings, 0 replies; 222+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2011-02-19 19:24 UTC (permalink / raw)
  To: git; +Cc: Junio C Hamano, Ævar Arnfjörð Bjarmason

Split up the "Auto packing the repository" message into quiet and
verbose variants to make translation easier.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
---
 builtin/gc.c |   14 +++++++-------
 1 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/builtin/gc.c b/builtin/gc.c
index a2be62a..ff5f73b 100644
--- a/builtin/gc.c
+++ b/builtin/gc.c
@@ -219,13 +219,13 @@ int cmd_gc(int argc, const char **argv, const char *prefix)
 		 */
 		if (!need_to_gc())
 			return 0;
-		fprintf(stderr,
-			"Auto packing the repository for optimum performance.%s\n",
-			quiet
-			? ""
-			: (" You may also\n"
-			   "run \"git gc\" manually. See "
-			   "\"git help gc\" for more information."));
+		if (quiet)
+			fprintf(stderr, _("Auto packing the repository for optimum performance.\n"));
+		else
+			fprintf(stderr,
+					_("Auto packing the repository for optimum performance. You may also\n"
+					"run \"git gc\" manually. See "
+					"\"git help gc\" for more information."));
 	} else
 		append_option(argv_repack,
 			      prune_expire && !strcmp(prune_expire, "now")
-- 
1.7.2.3

^ permalink raw reply related	[flat|nested] 222+ messages in thread

* [PATCH 66/72] gettextize: git-notes basic commands
  2011-02-19 19:23 [PATCH 00/72] No-op C gettext wrappers Ævar Arnfjörð Bjarmason
                   ` (64 preceding siblings ...)
  2011-02-19 19:24 ` [PATCH 65/72] gettextize: git-gc "Auto packing the repository" message Ævar Arnfjörð Bjarmason
@ 2011-02-19 19:24 ` Ævar Arnfjörð Bjarmason
  2011-02-19 19:24 ` [PATCH 67/72] gettextize: git-notes GIT_NOTES_REWRITE_MODE error message Ævar Arnfjörð Bjarmason
                   ` (6 subsequent siblings)
  72 siblings, 0 replies; 222+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2011-02-19 19:24 UTC (permalink / raw)
  To: git; +Cc: Junio C Hamano, Ævar Arnfjörð Bjarmason

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
---
 builtin/notes.c |  106 +++++++++++++++++++++++++++---------------------------
 1 files changed, 53 insertions(+), 53 deletions(-)

diff --git a/builtin/notes.c b/builtin/notes.c
index 4d5556e..4c6cf85 100644
--- a/builtin/notes.c
+++ b/builtin/notes.c
@@ -146,13 +146,13 @@ static void write_commented_object(int fd, const unsigned char *object)
 	show.err = 0;
 	show.git_cmd = 1;
 	if (start_command(&show))
-		die("unable to start 'show' for object '%s'",
+		die(_("unable to start 'show' for object '%s'"),
 		    sha1_to_hex(object));
 
 	/* Open the output as FILE* so strbuf_getline() can be used. */
 	show_out = xfdopen(show.out, "r");
 	if (show_out == NULL)
-		die_errno("can't fdopen 'show' output fd");
+		die_errno(_("can't fdopen 'show' output fd"));
 
 	/* Prepend "# " to each output line and write result to 'fd' */
 	while (strbuf_getline(&buf, show_out, '\n') != EOF) {
@@ -162,10 +162,10 @@ static void write_commented_object(int fd, const unsigned char *object)
 	}
 	strbuf_release(&buf);
 	if (fclose(show_out))
-		die_errno("failed to close pipe to 'show' for object '%s'",
+		die_errno(_("failed to close pipe to 'show' for object '%s'"),
 			  sha1_to_hex(object));
 	if (finish_command(&show))
-		die("failed to finish 'show' for object '%s'",
+		die(_("failed to finish 'show' for object '%s'"),
 		    sha1_to_hex(object));
 }
 
@@ -182,7 +182,7 @@ static void create_note(const unsigned char *object, struct msg_arg *msg,
 		path = git_pathdup("NOTES_EDITMSG");
 		fd = open(path, O_CREAT | O_TRUNC | O_WRONLY, 0600);
 		if (fd < 0)
-			die_errno("could not create file '%s'", path);
+			die_errno(_("could not create file '%s'"), path);
 
 		if (msg->given)
 			write_or_die(fd, msg->buf.buf, msg->buf.len);
@@ -196,8 +196,8 @@ static void create_note(const unsigned char *object, struct msg_arg *msg,
 		strbuf_reset(&(msg->buf));
 
 		if (launch_editor(path, &(msg->buf), NULL)) {
-			die("Please supply the note contents using either -m" \
-			    " or -F option");
+			die(_("Please supply the note contents using either -m" \
+			    " or -F option"));
 		}
 		stripspace(&(msg->buf), 1);
 	}
@@ -217,14 +217,14 @@ static void create_note(const unsigned char *object, struct msg_arg *msg,
 	}
 
 	if (!msg->buf.len) {
-		fprintf(stderr, "Removing note for object %s\n",
+		fprintf(stderr, _("Removing note for object %s\n"),
 			sha1_to_hex(object));
 		hashclr(result);
 	} else {
 		if (write_sha1_file(msg->buf.buf, msg->buf.len, blob_type, result)) {
-			error("unable to write note object");
+			error(_("unable to write note object"));
 			if (path)
-				error("The note contents has been left in %s",
+				error(_("The note contents has been left in %s"),
 				      path);
 			exit(128);
 		}
@@ -258,9 +258,9 @@ static int parse_file_arg(const struct option *opt, const char *arg, int unset)
 		strbuf_addch(&(msg->buf), '\n');
 	if (!strcmp(arg, "-")) {
 		if (strbuf_read(&(msg->buf), 0, 1024) < 0)
-			die_errno("cannot read '%s'", arg);
+			die_errno(_("cannot read '%s'"), arg);
 	} else if (strbuf_read_file(&(msg->buf), arg, 1024) < 0)
-		die_errno("could not open or read '%s'", arg);
+		die_errno(_("could not open or read '%s'"), arg);
 	stripspace(&(msg->buf), 0);
 
 	msg->given = 1;
@@ -279,10 +279,10 @@ static int parse_reuse_arg(const struct option *opt, const char *arg, int unset)
 		strbuf_addch(&(msg->buf), '\n');
 
 	if (get_sha1(arg, object))
-		die("Failed to resolve '%s' as a valid ref.", arg);
+		die(_("Failed to resolve '%s' as a valid ref."), arg);
 	if (!(buf = read_sha1_file(object, &type, &len)) || !len) {
 		free(buf);
-		die("Failed to read object '%s'.", arg);;
+		die(_("Failed to read object '%s'."), arg);;
 	}
 	strbuf_add(&(msg->buf), buf, len);
 	free(buf);
@@ -306,7 +306,7 @@ void commit_notes(struct notes_tree *t, const char *msg)
 	if (!t)
 		t = &default_notes_tree;
 	if (!t->initialized || !t->ref || !*t->ref)
-		die("Cannot commit uninitialized/unreferenced notes tree");
+		die(_("Cannot commit uninitialized/unreferenced notes tree"));
 	if (!t->dirty)
 		return; /* don't have to commit an unchanged tree */
 
@@ -347,7 +347,7 @@ static int notes_rewrite_config(const char *k, const char *v, void *cb)
 			config_error_nonbool(k);
 		c->combine = parse_combine_notes_fn(v);
 		if (!c->combine) {
-			error("Bad notes.rewriteMode value: '%s'", v);
+			error(_("Bad notes.rewriteMode value: '%s'"), v);
 			return 1;
 		}
 		return 0;
@@ -357,8 +357,8 @@ static int notes_rewrite_config(const char *k, const char *v, void *cb)
 		if (!prefixcmp(v, "refs/notes/"))
 			string_list_add_refs_by_glob(c->refs, v);
 		else
-			warning("Refusing to rewrite notes in %s"
-				" (outside of refs/notes/)", v);
+			warning(_("Refusing to rewrite notes in %s"
+				" (outside of refs/notes/)"), v);
 		return 0;
 	}
 
@@ -446,13 +446,13 @@ int notes_copy_from_stdin(int force, const char *rewrite_cmd)
 
 		split = strbuf_split(&buf, ' ');
 		if (!split[0] || !split[1])
-			die("Malformed input line: '%s'.", buf.buf);
+			die(_("Malformed input line: '%s'."), buf.buf);
 		strbuf_rtrim(split[0]);
 		strbuf_rtrim(split[1]);
 		if (get_sha1(split[0]->buf, from_obj))
-			die("Failed to resolve '%s' as a valid ref.", split[0]->buf);
+			die(_("Failed to resolve '%s' as a valid ref."), split[0]->buf);
 		if (get_sha1(split[1]->buf, to_obj))
-			die("Failed to resolve '%s' as a valid ref.", split[1]->buf);
+			die(_("Failed to resolve '%s' as a valid ref."), split[1]->buf);
 
 		if (rewrite_cmd)
 			err = copy_note_for_rewrite(c, from_obj, to_obj);
@@ -461,7 +461,7 @@ int notes_copy_from_stdin(int force, const char *rewrite_cmd)
 					combine_notes_overwrite);
 
 		if (err) {
-			error("Failed to copy notes from '%s' to '%s'",
+			error(_("Failed to copy notes from '%s' to '%s'"),
 			      split[0]->buf, split[1]->buf);
 			ret = 1;
 		}
@@ -505,20 +505,20 @@ static int list(int argc, const char **argv, const char *prefix)
 				     git_notes_list_usage, 0);
 
 	if (1 < argc) {
-		error("too many parameters");
+		error(_("too many parameters"));
 		usage_with_options(git_notes_list_usage, options);
 	}
 
 	t = init_notes_check("list");
 	if (argc) {
 		if (get_sha1(argv[0], object))
-			die("Failed to resolve '%s' as a valid ref.", argv[0]);
+			die(_("Failed to resolve '%s' as a valid ref."), argv[0]);
 		note = get_note(t, object);
 		if (note) {
 			puts(sha1_to_hex(note));
 			retval = 0;
 		} else
-			retval = error("No note found for object %s.",
+			retval = error(_("No note found for object %s."),
 				       sha1_to_hex(object));
 	} else
 		retval = for_each_note(t, 0, list_each_note, NULL);
@@ -557,26 +557,26 @@ static int add(int argc, const char **argv, const char *prefix)
 			     0);
 
 	if (1 < argc) {
-		error("too many parameters");
+		error(_("too many parameters"));
 		usage_with_options(git_notes_add_usage, options);
 	}
 
 	object_ref = argc ? argv[0] : "HEAD";
 
 	if (get_sha1(object_ref, object))
-		die("Failed to resolve '%s' as a valid ref.", object_ref);
+		die(_("Failed to resolve '%s' as a valid ref."), object_ref);
 
 	t = init_notes_check("add");
 	note = get_note(t, object);
 
 	if (note) {
 		if (!force) {
-			retval = error("Cannot add notes. Found existing notes "
+			retval = error(_("Cannot add notes. Found existing notes "
 				       "for object %s. Use '-f' to overwrite "
-				       "existing notes", sha1_to_hex(object));
+				       "existing notes"), sha1_to_hex(object));
 			goto out;
 		}
-		fprintf(stderr, "Overwriting existing notes for object %s\n",
+		fprintf(stderr, _("Overwriting existing notes for object %s\n"),
 			sha1_to_hex(object));
 	}
 
@@ -618,7 +618,7 @@ static int copy(int argc, const char **argv, const char *prefix)
 
 	if (from_stdin || rewrite_cmd) {
 		if (argc) {
-			error("too many parameters");
+			error(_("too many parameters"));
 			usage_with_options(git_notes_copy_usage, options);
 		} else {
 			return notes_copy_from_stdin(force, rewrite_cmd);
@@ -626,41 +626,41 @@ static int copy(int argc, const char **argv, const char *prefix)
 	}
 
 	if (argc < 2) {
-		error("too few parameters");
+		error(_("too few parameters"));
 		usage_with_options(git_notes_copy_usage, options);
 	}
 	if (2 < argc) {
-		error("too many parameters");
+		error(_("too many parameters"));
 		usage_with_options(git_notes_copy_usage, options);
 	}
 
 	if (get_sha1(argv[0], from_obj))
-		die("Failed to resolve '%s' as a valid ref.", argv[0]);
+		die(_("Failed to resolve '%s' as a valid ref."), argv[0]);
 
 	object_ref = 1 < argc ? argv[1] : "HEAD";
 
 	if (get_sha1(object_ref, object))
-		die("Failed to resolve '%s' as a valid ref.", object_ref);
+		die(_("Failed to resolve '%s' as a valid ref."), object_ref);
 
 	t = init_notes_check("copy");
 	note = get_note(t, object);
 
 	if (note) {
 		if (!force) {
-			retval = error("Cannot copy notes. Found existing "
+			retval = error(_("Cannot copy notes. Found existing "
 				       "notes for object %s. Use '-f' to "
-				       "overwrite existing notes",
+				       "overwrite existing notes"),
 				       sha1_to_hex(object));
 			goto out;
 		}
-		fprintf(stderr, "Overwriting existing notes for object %s\n",
+		fprintf(stderr, _("Overwriting existing notes for object %s\n"),
 			sha1_to_hex(object));
 	}
 
 	from_note = get_note(t, from_obj);
 	if (!from_note) {
-		retval = error("Missing notes on source object %s. Cannot "
-			       "copy.", sha1_to_hex(from_obj));
+		retval = error(_("Missing notes on source object %s. Cannot "
+			       "copy."), sha1_to_hex(from_obj));
 		goto out;
 	}
 
@@ -703,19 +703,19 @@ static int append_edit(int argc, const char **argv, const char *prefix)
 			     PARSE_OPT_KEEP_ARGV0);
 
 	if (2 < argc) {
-		error("too many parameters");
+		error(_("too many parameters"));
 		usage_with_options(usage, options);
 	}
 
 	if (msg.given && edit)
-		fprintf(stderr, "The -m/-F/-c/-C options have been deprecated "
+		fprintf(stderr, _("The -m/-F/-c/-C options have been deprecated "
 			"for the 'edit' subcommand.\n"
-			"Please use 'git notes add -f -m/-F/-c/-C' instead.\n");
+			"Please use 'git notes add -f -m/-F/-c/-C' instead.\n"));
 
 	object_ref = 1 < argc ? argv[1] : "HEAD";
 
 	if (get_sha1(object_ref, object))
-		die("Failed to resolve '%s' as a valid ref.", object_ref);
+		die(_("Failed to resolve '%s' as a valid ref."), object_ref);
 
 	t = init_notes_check(argv[0]);
 	note = get_note(t, object);
@@ -750,20 +750,20 @@ static int show(int argc, const char **argv, const char *prefix)
 			     0);
 
 	if (1 < argc) {
-		error("too many parameters");
+		error(_("too many parameters"));
 		usage_with_options(git_notes_show_usage, options);
 	}
 
 	object_ref = argc ? argv[0] : "HEAD";
 
 	if (get_sha1(object_ref, object))
-		die("Failed to resolve '%s' as a valid ref.", object_ref);
+		die(_("Failed to resolve '%s' as a valid ref."), object_ref);
 
 	t = init_notes_check("show");
 	note = get_note(t, object);
 
 	if (!note)
-		retval = error("No note found for object %s.",
+		retval = error(_("No note found for object %s."),
 			       sha1_to_hex(object));
 	else {
 		const char *show_args[3] = {"show", sha1_to_hex(note), NULL};
@@ -961,22 +961,22 @@ static int remove_cmd(int argc, const char **argv, const char *prefix)
 			     git_notes_remove_usage, 0);
 
 	if (1 < argc) {
-		error("too many parameters");
+		error(_("too many parameters"));
 		usage_with_options(git_notes_remove_usage, options);
 	}
 
 	object_ref = argc ? argv[0] : "HEAD";
 
 	if (get_sha1(object_ref, object))
-		die("Failed to resolve '%s' as a valid ref.", object_ref);
+		die(_("Failed to resolve '%s' as a valid ref."), object_ref);
 
 	t = init_notes_check("remove");
 
 	retval = remove_note(t, object);
 	if (retval)
-		fprintf(stderr, "Object %s has no note\n", sha1_to_hex(object));
+		fprintf(stderr, _("Object %s has no note\n"), sha1_to_hex(object));
 	else {
-		fprintf(stderr, "Removing note for object %s\n",
+		fprintf(stderr, _("Removing note for object %s\n"),
 			sha1_to_hex(object));
 
 		commit_notes(t, "Notes removed by 'git notes remove'");
@@ -999,7 +999,7 @@ static int prune(int argc, const char **argv, const char *prefix)
 			     0);
 
 	if (argc) {
-		error("too many parameters");
+		error(_("too many parameters"));
 		usage_with_options(git_notes_prune_usage, options);
 	}
 
@@ -1069,7 +1069,7 @@ int cmd_notes(int argc, const char **argv, const char *prefix)
 	else if (!strcmp(argv[0], "get-ref"))
 		result = get_ref(argc, argv, prefix);
 	else {
-		result = error("Unknown subcommand: %s", argv[0]);
+		result = error(_("Unknown subcommand: %s"), argv[0]);
 		usage_with_options(git_notes_usage, options);
 	}
 
-- 
1.7.2.3

^ permalink raw reply related	[flat|nested] 222+ messages in thread

* [PATCH 67/72] gettextize: git-notes GIT_NOTES_REWRITE_MODE error message
  2011-02-19 19:23 [PATCH 00/72] No-op C gettext wrappers Ævar Arnfjörð Bjarmason
                   ` (65 preceding siblings ...)
  2011-02-19 19:24 ` [PATCH 66/72] gettextize: git-notes basic commands Ævar Arnfjörð Bjarmason
@ 2011-02-19 19:24 ` Ævar Arnfjörð Bjarmason
  2011-02-19 19:24 ` [PATCH 68/72] gettextize: git-revert basic messages Ævar Arnfjörð Bjarmason
                   ` (5 subsequent siblings)
  72 siblings, 0 replies; 222+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2011-02-19 19:24 UTC (permalink / raw)
  To: git; +Cc: Junio C Hamano, Ævar Arnfjörð Bjarmason

Use sprintf format for the error message that's displayed if
GIT_NOTES_REWRITE_MODE is invalid, and leave a note in a TRANSLATORS
comment indicating what the message means.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
---
 builtin/notes.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/builtin/notes.c b/builtin/notes.c
index 4c6cf85..a0aa995 100644
--- a/builtin/notes.c
+++ b/builtin/notes.c
@@ -382,8 +382,10 @@ struct notes_rewrite_cfg *init_copy_notes_for_rewrite(const char *cmd)
 		c->mode_from_env = 1;
 		c->combine = parse_combine_notes_fn(rewrite_mode_env);
 		if (!c->combine)
-			error("Bad " GIT_NOTES_REWRITE_MODE_ENVIRONMENT
-			      " value: '%s'", rewrite_mode_env);
+			/* TRANSLATORS: The first %s is the name of the
+			   environment variable, the second %s is its value */
+			error(_("Bad %s value: '%s'"), GIT_NOTES_REWRITE_MODE_ENVIRONMENT,
+					rewrite_mode_env);
 	}
 	if (rewrite_refs_env) {
 		c->refs_from_env = 1;
-- 
1.7.2.3

^ permalink raw reply related	[flat|nested] 222+ messages in thread

* [PATCH 68/72] gettextize: git-revert basic messages
  2011-02-19 19:23 [PATCH 00/72] No-op C gettext wrappers Ævar Arnfjörð Bjarmason
                   ` (66 preceding siblings ...)
  2011-02-19 19:24 ` [PATCH 67/72] gettextize: git-notes GIT_NOTES_REWRITE_MODE error message Ævar Arnfjörð Bjarmason
@ 2011-02-19 19:24 ` Ævar Arnfjörð Bjarmason
  2011-02-19 19:24 ` [PATCH 69/72] gettextize: git-revert "Your local changes" message Ævar Arnfjörð Bjarmason
                   ` (4 subsequent siblings)
  72 siblings, 0 replies; 222+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2011-02-19 19:24 UTC (permalink / raw)
  To: git; +Cc: Junio C Hamano, Ævar Arnfjörð Bjarmason

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
---
 builtin/revert.c |   46 +++++++++++++++++++++++-----------------------
 1 files changed, 23 insertions(+), 23 deletions(-)

diff --git a/builtin/revert.c b/builtin/revert.c
index dc1b702..1ca08da 100644
--- a/builtin/revert.c
+++ b/builtin/revert.c
@@ -96,7 +96,7 @@ static void parse_args(int argc, const char **argv)
 			OPT_END(),
 		};
 		if (parse_options_concat(options, ARRAY_SIZE(options), cp_extra))
-			die("program error");
+			die(_("program error"));
 	}
 
 	commit_argc = parse_options(argc, argv, NULL, options, usage_str,
@@ -168,7 +168,7 @@ static char *get_encoding(const char *message)
 	const char *p = message, *eol;
 
 	if (!p)
-		die ("Could not read commit message of %s",
+		die (_("Could not read commit message of %s"),
 				sha1_to_hex(commit->object.sha1));
 	while (*p && *p != '\n') {
 		for (eol = p + 1; *eol && *eol != '\n'; eol++)
@@ -202,7 +202,7 @@ static void set_author_ident_env(const char *message)
 {
 	const char *p = message;
 	if (!p)
-		die ("Could not read commit message of %s",
+		die (_("Could not read commit message of %s"),
 				sha1_to_hex(commit->object.sha1));
 	while (*p && *p != '\n') {
 		const char *eol;
@@ -216,7 +216,7 @@ static void set_author_ident_env(const char *message)
 			line = xmemdupz(p, eol - p);
 			email = strchr(line, '<');
 			if (!email)
-				die ("Could not extract author email from %s",
+				die (_("Could not extract author email from %s"),
 					sha1_to_hex(commit->object.sha1));
 			if (email == line)
 				pend = line;
@@ -228,7 +228,7 @@ static void set_author_ident_env(const char *message)
 			email++;
 			timestamp = strchr(email, '>');
 			if (!timestamp)
-				die ("Could not extract author time from %s",
+				die (_("Could not extract author time from %s"),
 					sha1_to_hex(commit->object.sha1));
 			*timestamp = '\0';
 			for (timestamp++; *timestamp && isspace(*timestamp);
@@ -244,7 +244,7 @@ static void set_author_ident_env(const char *message)
 		if (*p == '\n')
 			p++;
 	}
-	die ("No author information found in %s",
+	die (_("No author information found in %s"),
 			sha1_to_hex(commit->object.sha1));
 }
 
@@ -281,10 +281,10 @@ static void write_message(struct strbuf *msgbuf, const char *filename)
 	int msg_fd = hold_lock_file_for_update(&msg_file, filename,
 					       LOCK_DIE_ON_ERROR);
 	if (write_in_full(msg_fd, msgbuf->buf, msgbuf->len) < 0)
-		die_errno("Could not write to %s.", filename);
+		die_errno(_("Could not write to %s."), filename);
 	strbuf_release(msgbuf);
 	if (commit_lock_file(&msg_file) < 0)
-		die("Error wrapping up %s", filename);
+		die(_("Error wrapping up %s"), filename);
 }
 
 static struct tree *empty_tree(void)
@@ -420,10 +420,10 @@ static int do_pick_commit(void)
 		 * to work on.
 		 */
 		if (write_cache_as_tree(head, 0, NULL))
-			die ("Your index file is unmerged.");
+			die (_("Your index file is unmerged."));
 	} else {
 		if (get_sha1("HEAD", head))
-			die ("You do not have a valid HEAD");
+			die (_("You do not have a valid HEAD"));
 		if (index_differs_from("HEAD", 0))
 			die_dirty_index(me);
 	}
@@ -431,7 +431,7 @@ static int do_pick_commit(void)
 
 	if (!commit->parents) {
 		if (action == REVERT)
-			die ("Cannot revert a root commit");
+			die (_("Cannot revert a root commit"));
 		parent = NULL;
 	}
 	else if (commit->parents->next) {
@@ -440,7 +440,7 @@ static int do_pick_commit(void)
 		struct commit_list *p;
 
 		if (!mainline)
-			die("Commit %s is a merge but no -m option was given.",
+			die(_("Commit %s is a merge but no -m option was given."),
 			    sha1_to_hex(commit->object.sha1));
 
 		for (cnt = 1, p = commit->parents;
@@ -448,11 +448,11 @@ static int do_pick_commit(void)
 		     cnt++)
 			p = p->next;
 		if (cnt != mainline || !p)
-			die("Commit %s does not have parent %d",
+			die(_("Commit %s does not have parent %d"),
 			    sha1_to_hex(commit->object.sha1), mainline);
 		parent = p->item;
 	} else if (0 < mainline)
-		die("Mainline was specified but commit %s is not a merge.",
+		die(_("Mainline was specified but commit %s is not a merge."),
 		    sha1_to_hex(commit->object.sha1));
 	else
 		parent = commit->parents->item;
@@ -465,7 +465,7 @@ static int do_pick_commit(void)
 		    me, sha1_to_hex(parent->object.sha1));
 
 	if (get_message(commit->buffer, &msg) != 0)
-		die("Cannot get commit message for %s",
+		die(_("Cannot get commit message for %s"),
 				sha1_to_hex(commit->object.sha1));
 
 	/*
@@ -556,10 +556,10 @@ static void prepare_revs(struct rev_info *revs)
 		usage(*revert_or_cherry_pick_usage());
 
 	if (prepare_revision_walk(revs))
-		die("revision walk setup failed");
+		die(_("revision walk setup failed"));
 
 	if (!revs->commits)
-		die("empty commit set passed");
+		die(_("empty commit set passed"));
 }
 
 static void read_and_refresh_cache(const char *me)
@@ -567,12 +567,12 @@ static void read_and_refresh_cache(const char *me)
 	static struct lock_file index_lock;
 	int index_fd = hold_locked_index(&index_lock, 0);
 	if (read_index_preload(&the_index, NULL) < 0)
-		die("git %s: failed to read the index", me);
+		die(_("git %s: failed to read the index"), me);
 	refresh_index(&the_index, REFRESH_QUIET|REFRESH_UNMERGED, NULL, NULL, NULL);
 	if (the_index.cache_changed) {
 		if (write_index(&the_index, index_fd) ||
 		    commit_locked_index(&index_lock))
-			die("git %s: failed to refresh the index", me);
+			die(_("git %s: failed to refresh the index"), me);
 	}
 	rollback_lock_file(&index_lock);
 }
@@ -588,13 +588,13 @@ static int revert_or_cherry_pick(int argc, const char **argv)
 
 	if (allow_ff) {
 		if (signoff)
-			die("cherry-pick --ff cannot be used with --signoff");
+			die(_("cherry-pick --ff cannot be used with --signoff"));
 		if (no_commit)
-			die("cherry-pick --ff cannot be used with --no-commit");
+			die(_("cherry-pick --ff cannot be used with --no-commit"));
 		if (no_replay)
-			die("cherry-pick --ff cannot be used with -x");
+			die(_("cherry-pick --ff cannot be used with -x"));
 		if (edit)
-			die("cherry-pick --ff cannot be used with --edit");
+			die(_("cherry-pick --ff cannot be used with --edit"));
 	}
 
 	read_and_refresh_cache(me);
-- 
1.7.2.3

^ permalink raw reply related	[flat|nested] 222+ messages in thread

* [PATCH 69/72] gettextize: git-revert "Your local changes" message
  2011-02-19 19:23 [PATCH 00/72] No-op C gettext wrappers Ævar Arnfjörð Bjarmason
                   ` (67 preceding siblings ...)
  2011-02-19 19:24 ` [PATCH 68/72] gettextize: git-revert basic messages Ævar Arnfjörð Bjarmason
@ 2011-02-19 19:24 ` Ævar Arnfjörð Bjarmason
  2011-02-19 19:24 ` [PATCH 70/72] gettextize: git-revert literal "me" messages Ævar Arnfjörð Bjarmason
                   ` (3 subsequent siblings)
  72 siblings, 0 replies; 222+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2011-02-19 19:24 UTC (permalink / raw)
  To: git; +Cc: Junio C Hamano, Ævar Arnfjörð Bjarmason

Translate the "Your local changes [...]" message without using the
`me' variable, instead split up the two messages so translators can
translate the whole messages as-is.

Reported-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
---
 builtin/revert.c              |   18 +++++++++++++-----
 t/t3501-revert-cherry-pick.sh |    2 +-
 2 files changed, 14 insertions(+), 6 deletions(-)

diff --git a/builtin/revert.c b/builtin/revert.c
index 1ca08da..02c23c9 100644
--- a/builtin/revert.c
+++ b/builtin/revert.c
@@ -302,11 +302,19 @@ static NORETURN void die_dirty_index(const char *me)
 	if (read_cache_unmerged()) {
 		die_resolve_conflict(me);
 	} else {
-		if (advice_commit_before_merge)
-			die("Your local changes would be overwritten by %s.\n"
-			    "Please, commit your changes or stash them to proceed.", me);
-		else
-			die("Your local changes would be overwritten by %s.\n", me);
+		if (advice_commit_before_merge) {
+			if (action == REVERT)
+				die(_("Your local changes would be overwritten by revert.\n"
+					  "Please, commit your changes or stash them to proceed."));
+			else
+				die(_("Your local changes would be overwritten by cherry-pick.\n"
+					  "Please, commit your changes or stash them to proceed."));
+		} else {
+			if (action == REVERT)
+				die(_("Your local changes would be overwritten by revert.\n"));
+			else
+				die(_("Your local changes would be overwritten by cherry-pick.\n"));
+		}
 	}
 }
 
diff --git a/t/t3501-revert-cherry-pick.sh b/t/t3501-revert-cherry-pick.sh
index 0439544..76d3252 100755
--- a/t/t3501-revert-cherry-pick.sh
+++ b/t/t3501-revert-cherry-pick.sh
@@ -91,7 +91,7 @@ test_expect_success 'cherry-pick on stat-dirty working tree' '
 	)
 '
 
-test_expect_success 'revert forbidden on dirty working tree' '
+test_expect_success NO_GETTEXT_POISON 'revert forbidden on dirty working tree' '
 
 	echo content >extra_file &&
 	git add extra_file &&
-- 
1.7.2.3

^ permalink raw reply related	[flat|nested] 222+ messages in thread

* [PATCH 70/72] gettextize: git-revert literal "me" messages
  2011-02-19 19:23 [PATCH 00/72] No-op C gettext wrappers Ævar Arnfjörð Bjarmason
                   ` (68 preceding siblings ...)
  2011-02-19 19:24 ` [PATCH 69/72] gettextize: git-revert "Your local changes" message Ævar Arnfjörð Bjarmason
@ 2011-02-19 19:24 ` Ævar Arnfjörð Bjarmason
  2011-02-19 19:24 ` [PATCH 71/72] gettextize: git-revert split up "could not revert/apply" message Ævar Arnfjörð Bjarmason
                   ` (2 subsequent siblings)
  72 siblings, 0 replies; 222+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2011-02-19 19:24 UTC (permalink / raw)
  To: git; +Cc: Junio C Hamano, Ævar Arnfjörð Bjarmason

Translate messages that use the `me' variable. These are all error
messages referencing the command name, so the name shouldn't be
translated.

Reported-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
---
 builtin/revert.c |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/builtin/revert.c b/builtin/revert.c
index 02c23c9..b0a5ffb 100644
--- a/builtin/revert.c
+++ b/builtin/revert.c
@@ -362,7 +362,8 @@ static int do_recursive_merge(struct commit *base, struct commit *next,
 	if (active_cache_changed &&
 	    (write_cache(index_fd, active_cache, active_nr) ||
 	     commit_locked_index(&index_lock)))
-		die("%s: Unable to write new index file", me);
+		/* TRANSLATORS: %s will be "revert" or "cherry-pick" */
+		die(_("%s: Unable to write new index file"), me);
 	rollback_lock_file(&index_lock);
 
 	if (!clean) {
@@ -469,7 +470,9 @@ static int do_pick_commit(void)
 		return fast_forward_to(commit->object.sha1, head);
 
 	if (parent && parse_commit(parent) < 0)
-		die("%s: cannot parse parent commit %s",
+		/* TRANSLATORS: The first %s will be "revert" or
+		   "cherry-pick", the second %s a SHA1 */
+		die(_("%s: cannot parse parent commit %s"),
 		    me, sha1_to_hex(parent->object.sha1));
 
 	if (get_message(commit->buffer, &msg) != 0)
-- 
1.7.2.3

^ permalink raw reply related	[flat|nested] 222+ messages in thread

* [PATCH 71/72] gettextize: git-revert split up "could not revert/apply" message
  2011-02-19 19:23 [PATCH 00/72] No-op C gettext wrappers Ævar Arnfjörð Bjarmason
                   ` (69 preceding siblings ...)
  2011-02-19 19:24 ` [PATCH 70/72] gettextize: git-revert literal "me" messages Ævar Arnfjörð Bjarmason
@ 2011-02-19 19:24 ` Ævar Arnfjörð Bjarmason
  2011-02-19 19:24 ` [PATCH 72/72] gettextize: git-shortlog basic messages Ævar Arnfjörð Bjarmason
  2011-02-21  4:00 ` [PATCH v2 0/3] No-op C gettext wrappers Jonathan Nieder
  72 siblings, 0 replies; 222+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2011-02-19 19:24 UTC (permalink / raw)
  To: git; +Cc: Junio C Hamano, Ævar Arnfjörð Bjarmason

Split up the "could not %s %s... %s" message into "could not revert
%s... %s" and "could not apply %s... %s". This makes it easier for
translators to understand the message.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
---
 builtin/revert.c                |    5 +++--
 t/t3507-cherry-pick-conflict.sh |    2 +-
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/builtin/revert.c b/builtin/revert.c
index b0a5ffb..98dfd4d 100644
--- a/builtin/revert.c
+++ b/builtin/revert.c
@@ -536,8 +536,9 @@ static int do_pick_commit(void)
 	}
 
 	if (res) {
-		error("could not %s %s... %s",
-		      action == REVERT ? "revert" : "apply",
+		error(action == REVERT
+		      ? _("could not revert %s... %s")
+		      : _("could not apply %s... %s"),
 		      find_unique_abbrev(commit->object.sha1, DEFAULT_ABBREV),
 		      msg.subject);
 		print_advice();
diff --git a/t/t3507-cherry-pick-conflict.sh b/t/t3507-cherry-pick-conflict.sh
index 607bf25..bf664ec 100755
--- a/t/t3507-cherry-pick-conflict.sh
+++ b/t/t3507-cherry-pick-conflict.sh
@@ -38,7 +38,7 @@ test_expect_success 'failed cherry-pick does not advance HEAD' '
 	test "$head" = "$newhead"
 '
 
-test_expect_success 'advice from failed cherry-pick' "
+test_expect_success NO_GETTEXT_POISON 'advice from failed cherry-pick' "
 	git checkout -f initial^0 &&
 	git read-tree -u --reset HEAD &&
 	git clean -d -f -f -q -x &&
-- 
1.7.2.3

^ permalink raw reply related	[flat|nested] 222+ messages in thread

* [PATCH 72/72] gettextize: git-shortlog basic messages
  2011-02-19 19:23 [PATCH 00/72] No-op C gettext wrappers Ævar Arnfjörð Bjarmason
                   ` (70 preceding siblings ...)
  2011-02-19 19:24 ` [PATCH 71/72] gettextize: git-revert split up "could not revert/apply" message Ævar Arnfjörð Bjarmason
@ 2011-02-19 19:24 ` Ævar Arnfjörð Bjarmason
  2011-02-21  4:00 ` [PATCH v2 0/3] No-op C gettext wrappers Jonathan Nieder
  72 siblings, 0 replies; 222+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2011-02-19 19:24 UTC (permalink / raw)
  To: git; +Cc: Junio C Hamano, Ævar Arnfjörð Bjarmason

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
---
 builtin/shortlog.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/builtin/shortlog.c b/builtin/shortlog.c
index 1a21e4b..f5efc67 100644
--- a/builtin/shortlog.c
+++ b/builtin/shortlog.c
@@ -158,7 +158,7 @@ void shortlog_add_commit(struct shortlog *log, struct commit *commit)
 		buffer = eol;
 	}
 	if (!author)
-		die("Missing author: %s",
+		die(_("Missing author: %s"),
 		    sha1_to_hex(commit->object.sha1));
 	if (log->user_format) {
 		struct pretty_print_context ctx = {0};
@@ -181,7 +181,7 @@ static void get_from_rev(struct rev_info *rev, struct shortlog *log)
 	struct commit *commit;
 
 	if (prepare_revision_walk(rev))
-		die("revision walk setup failed");
+		die(_("revision walk setup failed"));
 	while ((commit = get_revision(rev)) != NULL)
 		shortlog_add_commit(log, commit);
 }
@@ -284,7 +284,7 @@ parse_done:
 	argc = parse_options_end(&ctx);
 
 	if (setup_revisions(argc, argv, &rev, NULL) != 1) {
-		error("unrecognized argument: %s", argv[1]);
+		error(_("unrecognized argument: %s"), argv[1]);
 		usage_with_options(shortlog_usage, options);
 	}
 
@@ -296,7 +296,7 @@ parse_done:
 		add_head_to_pending(&rev);
 	if (rev.pending.nr == 0) {
 		if (isatty(0))
-			fprintf(stderr, "(reading log message from standard input)\n");
+			fprintf(stderr, _("(reading log message from standard input)\n"));
 		read_from_stdin(&log);
 	}
 	else
-- 
1.7.2.3

^ permalink raw reply related	[flat|nested] 222+ messages in thread

* Re: [PATCH 01/72] gettext.h: add no-op _() and N_() wrappers
  2011-02-19 19:23 ` [PATCH 01/72] gettext.h: add no-op _() and N_() wrappers Ævar Arnfjörð Bjarmason
@ 2011-02-20  2:01   ` Jonathan Nieder
  2011-02-20 10:13     ` Erik Faye-Lund
  2011-02-20 21:11     ` Ævar Arnfjörð Bjarmason
  0 siblings, 2 replies; 222+ messages in thread
From: Jonathan Nieder @ 2011-02-20  2:01 UTC (permalink / raw)
  To: Ævar Arnfjörð Bjarmason; +Cc: git, Junio C Hamano

Hi Ævar,

Ævar Arnfjörð Bjarmason wrote:

> Add a new header called gettext.h which is currently a no-op.

Thanks.  I'd suggest squashing this with patch #2 (#including
gettext.h in cache.h).

> --- /dev/null
> +++ b/gettext.h
> @@ -0,0 +1,9 @@
> +/*
> + * Copyright (c) 2010 Ævar Arnfjörð Bjarmason

Is such a simple header file copyrightable?  But I don't mind.

> + *
> + * This is a skeleton no-op implementation of gettext for Git. It'll
> + * be replaced by something that uses libintl.h and wraps gettext() in
> + * a future patch series.
> + */
> +#define N_(s) (s)

Might be nice to make this an inline function, for type safety.

> +#define _(s) (s)

This one can't be a function, though, since it needs to transform
literals to literals.

Some possible tweaks:

 - protect against double inclusion
 - make _ into a function
 - add a comment vaguely explaining N_
 - avoid confusing errors if some other header has pre-defined _.

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
---
 gettext.h |   19 +++++++++++++++++--
 1 files changed, 17 insertions(+), 2 deletions(-)

diff --git a/gettext.h b/gettext.h
index c68bbe9..2f806cb 100644
--- a/gettext.h
+++ b/gettext.h
@@ -1,3 +1,10 @@
+#ifndef GETTEXT_H
+#define GETTEXT_H
+
+#ifdef _
+#error "namespace conflict: '_' is pre-defined?"
+#endif
+
 /*
  * Copyright (c) 2010 Ævar Arnfjörð Bjarmason
  *
@@ -5,5 +12,13 @@
  * be replaced by something that uses libintl.h and wraps gettext() in
  * a future patch series.
  */
-#define N_(s) (s)
-#define _(s) (s)
+
+static inline const char *_(const char *msgid)
+{
+	return msgid;
+}
+
+/* Mark msgid for translation but do not translate it. */
+#define N_(msgid) (msgid)
+
+#endif
-- 
1.7.4.1

^ permalink raw reply related	[flat|nested] 222+ messages in thread

* Re: [PATCH 03/72] t/test-lib.sh: add always-set NO_GETTEXT_POISON prerequisite
  2011-02-19 19:23 ` [PATCH 03/72] t/test-lib.sh: add always-set NO_GETTEXT_POISON prerequisite Ævar Arnfjörð Bjarmason
@ 2011-02-20  2:10   ` Jonathan Nieder
  2011-02-20 12:42     ` Ævar Arnfjörð Bjarmason
  0 siblings, 1 reply; 222+ messages in thread
From: Jonathan Nieder @ 2011-02-20  2:10 UTC (permalink / raw)
  To: Ævar Arnfjörð Bjarmason; +Cc: git, Junio C Hamano

Hi Ævar,

Ævar Arnfjörð Bjarmason wrote:

> Add a new test prerequisite called NO_GETTEXT_POISON to t/test-lib.sh
> that's always set for now.

Suppose I am writing a new family of tests.  Which of them will need
the NO_GETTEXT_POISON prerequisite?  The name doesn't make it easy to
guess.

If later the testsuite learns to take a --lang= option to test that
git works correctly in my native language, I'd think this same
prerequisite would be relevant for that, too.  So maybe:

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
---
 t/test-lib.sh |    6 ++----
 1 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/t/test-lib.sh b/t/test-lib.sh
index ffcfa2e..32004c1 100644
--- a/t/test-lib.sh
+++ b/t/test-lib.sh
@@ -1079,10 +1079,8 @@ esac
 test -z "$NO_PERL" && test_set_prereq PERL
 test -z "$NO_PYTHON" && test_set_prereq PYTHON
 
-# Always set the NO_GETTEXT_POISON prerequisite while we don't have a
-# real gettext implementation in Git. This will be replaced by
-# something that varies in a future patch series.
-test_set_prereq NO_GETTEXT_POISON
+# We can rely on output using the C locale.
+test_set_prereq ENGLISH
 
 # test whether the filesystem supports symbolic links
 ln -s x y 2>/dev/null && test -h y 2>/dev/null && test_set_prereq SYMLINKS
-- 
1.7.4.1

^ permalink raw reply related	[flat|nested] 222+ messages in thread

* Re: [PATCH 04/72] gettextize: git-init basic messages
  2011-02-19 19:23 ` [PATCH 04/72] gettextize: git-init basic messages Ævar Arnfjörð Bjarmason
@ 2011-02-20  2:21   ` Jonathan Nieder
  0 siblings, 0 replies; 222+ messages in thread
From: Jonathan Nieder @ 2011-02-20  2:21 UTC (permalink / raw)
  To: Ævar Arnfjörð Bjarmason; +Cc: git, Junio C Hamano

One more comment.  (The gettextization so far looks good to me.)

Ævar Arnfjörð Bjarmason wrote:

> --- a/builtin/init-db.c
> +++ b/builtin/init-db.c
> @@ -31,7 +31,7 @@ static void safe_create_dir(const char *dir, int share)
>  		}
>  	}
>  	else if (share && adjust_shared_perm(dir))
> -		die("Could not make %s writable by group", dir);
> +		die(_("Could not make %s writable by group"), dir);

Hmm, forgot to include something like the following in the reply to
patch 1.

> @@ -346,7 +346,7 @@ int init_db(const char *template_dir, unsigned int flags)
>  		else if (shared_repository == PERM_EVERYBODY)
>  			sprintf(buf, "%d", OLD_PERM_EVERYBODY);
>  		else
> -			die("oops");
> +			die(_("oops"));

(Not related to this series, but that seems like a pretty unhelpful
error message.)
---
 gettext.h |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/gettext.h b/gettext.h
index 2f806cb..2bd70d4 100644
--- a/gettext.h
+++ b/gettext.h
@@ -5,6 +5,8 @@
 #error "namespace conflict: _ is pre-defined?"
 #endif
 
+#define FORMAT_PRESERVING(n) __attribute__((format_arg(n)))
+
 /*
  * Copyright (c) 2010 Ævar Arnfjörð Bjarmason
  *
@@ -13,7 +15,7 @@
  * a future patch series.
  */
 
-static inline const char *_(const char *msgid)
+static inline FORMAT_PRESERVING(1) const char *_(const char *msgid)
 {
 	return msgid;
 }
-- 
1.7.4.1

^ permalink raw reply related	[flat|nested] 222+ messages in thread

* Re: [PATCH 01/72] gettext.h: add no-op _() and N_() wrappers
  2011-02-20  2:01   ` Jonathan Nieder
@ 2011-02-20 10:13     ` Erik Faye-Lund
  2011-02-20 10:34       ` Jonathan Nieder
  2011-02-20 21:11     ` Ævar Arnfjörð Bjarmason
  1 sibling, 1 reply; 222+ messages in thread
From: Erik Faye-Lund @ 2011-02-20 10:13 UTC (permalink / raw)
  To: Jonathan Nieder; +Cc: Ævar Arnfjörð, git, Junio C Hamano

On Sun, Feb 20, 2011 at 3:01 AM, Jonathan Nieder <jrnieder@gmail.com> wrote:
> Ævar Arnfjörð Bjarmason wrote:
>> +#define N_(s) (s)
>
> Might be nice to make this an inline function, for type safety.
>
>> +#define _(s) (s)
>
> This one can't be a function, though, since it needs to transform
> literals to literals.
>
...
> -#define N_(s) (s)
> -#define _(s) (s)
> +
> +static inline const char *_(const char *msgid)
> +{
> +       return msgid;
> +}
> +
> +/* Mark msgid for translation but do not translate it. */
> +#define N_(msgid) (msgid)

Isn't this the opposite of what you suggested above?

^ permalink raw reply	[flat|nested] 222+ messages in thread

* Re: [PATCH 01/72] gettext.h: add no-op _() and N_() wrappers
  2011-02-20 10:13     ` Erik Faye-Lund
@ 2011-02-20 10:34       ` Jonathan Nieder
  0 siblings, 0 replies; 222+ messages in thread
From: Jonathan Nieder @ 2011-02-20 10:34 UTC (permalink / raw)
  To: Erik Faye-Lund; +Cc: Ævar Arnfjörð, git, Junio C Hamano

Erik Faye-Lund wrote:
> On Sun, Feb 20, 2011 at 3:01 AM, Jonathan Nieder <jrnieder@gmail.com> wrote:
>> Ævar Arnfjörð Bjarmason wrote:

>>> +#define N_(s) (s)
>>
>> Might be nice to make this an inline function, for type safety.
>>
>>> +#define _(s) (s)
>>
>> This one can't be a function, though, since it needs to transform
>> literals to literals.
[...]
>> +/* Mark msgid for translation but do not translate it. */
>> +#define N_(msgid) (msgid)
>
> Isn't this the opposite of what you suggested above?

Agh.  I mixed up the snippets from Ævar’s message.

N_ needs to take literals to literals, so even the non-stub version would
be defined as

	#define N_(msgid) (msgid)

for use in contexts like

	const char *unpack_plumbing_errors[NB_UNPACK_TREES_ERROR_TYPES] = {
		/* ERROR_WOULD_OVERWRITE */
		N_("Entry '%s' would be overwritten by merge. Cannot merge."),

		/* ERROR_NOT_UPTODATE_FILE */
		N_("Entry '%s' not uptodate. Cannot merge."),
	[...]

Meanwhile, in the non-stub version, _ is a synonym for the gettext()
function.

Sorry for the noise.
Jonathan

^ permalink raw reply	[flat|nested] 222+ messages in thread

* Re: [PATCH 03/72] t/test-lib.sh: add always-set NO_GETTEXT_POISON prerequisite
  2011-02-20  2:10   ` Jonathan Nieder
@ 2011-02-20 12:42     ` Ævar Arnfjörð Bjarmason
  2011-02-20 21:55       ` Jonathan Nieder
  2011-02-21  6:56       ` Junio C Hamano
  0 siblings, 2 replies; 222+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2011-02-20 12:42 UTC (permalink / raw)
  To: Jonathan Nieder; +Cc: git, Junio C Hamano

On Sun, Feb 20, 2011 at 03:10, Jonathan Nieder <jrnieder@gmail.com> wrote:
> Hi Ævar,
>
> Ævar Arnfjörð Bjarmason wrote:
>
>> Add a new test prerequisite called NO_GETTEXT_POISON to t/test-lib.sh
>> that's always set for now.
>
> Suppose I am writing a new family of tests.  Which of them will need
> the NO_GETTEXT_POISON prerequisite?  The name doesn't make it easy to
> guess.

You shouldn't worry about it for now. FWIW NO_GETTEXT_POISON is
documented in po/README in a patch that I plan to submit later.

NO_GETTEXT_POISON is only relevant to people such as myself who are
adding new translations to the source. I.e. changing "foo" to
_("foo"). It's a sanity check to make sure that by doing so you're not
changing some plumbing test, or at least have to realize what it is
that you're changing.

It's not perfect since we don't have tests for everything, but it's
helped me a few times.

> If later the testsuite learns to take a --lang= option to test that
> git works correctly in my native language.

Yeah, I plan to add something like --lang later, but for now we have
POISON :)

> -# Always set the NO_GETTEXT_POISON prerequisite while we don't have a
> -# real gettext implementation in Git. This will be replaced by
> -# something that varies in a future patch series.
> -test_set_prereq NO_GETTEXT_POISON
> +# We can rely on output using the C locale.
> +test_set_prereq ENGLISH

It's explicitly about tests that can't deal with poison, not
non-English. See this comment in patch  28/72:

    gettextize: git-commit "enter the commit message" message

    Gettextize the "# Please enter the commit message for your changes."
    message. Several tests in t7500-commit.sh and t7502-commit.sh assume
    that this message starts with a newline. Change the tests to to skip
    under GETTEXT_POISON=YesPlease.

    These fail under GETTEXT_POISON=YesPlease because the poison editor
    message doesn't do the right thing with comments and line breaks, so
    these messages will be incorrectly broken up across lines.

    This test should not be skipped under a hypothetical future testing
    mode that tests Git under language locales, since those messages
    should all start with a newline like the original.

^ permalink raw reply	[flat|nested] 222+ messages in thread

* Re: [PATCH 01/72] gettext.h: add no-op _() and N_() wrappers
  2011-02-20  2:01   ` Jonathan Nieder
  2011-02-20 10:13     ` Erik Faye-Lund
@ 2011-02-20 21:11     ` Ævar Arnfjörð Bjarmason
  2011-02-20 22:03       ` Jonathan Nieder
  1 sibling, 1 reply; 222+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2011-02-20 21:11 UTC (permalink / raw)
  To: Jonathan Nieder; +Cc: git, Junio C Hamano

On Sun, Feb 20, 2011 at 03:01, Jonathan Nieder <jrnieder@gmail.com> wrote:

> Ævar Arnfjörð Bjarmason wrote:
>
>> Add a new header called gettext.h which is currently a no-op.
>
> Thanks.  I'd suggest squashing this with patch #2 (#including
> gettext.h in cache.h).
>
>> --- /dev/null
>> +++ b/gettext.h
>> @@ -0,0 +1,9 @@
>> +/*
>> + * Copyright (c) 2010 Ævar Arnfjörð Bjarmason
>
> Is such a simple header file copyrightable?  But I don't mind.
>
>> + *
>> + * This is a skeleton no-op implementation of gettext for Git. It'll
>> + * be replaced by something that uses libintl.h and wraps gettext() in
>> + * a future patch series.
>> + */
>> +#define N_(s) (s)
>
> Might be nice to make this an inline function, for type safety.
>
>> +#define _(s) (s)
>
> This one can't be a function, though, since it needs to transform
> literals to literals.
>
> Some possible tweaks:
>
>  - protect against double inclusion
>  - make _ into a function
>  - add a comment vaguely explaining N_
>  - avoid confusing errors if some other header has pre-defined _.
>
> Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
> ---
>  gettext.h |   19 +++++++++++++++++--
>  1 files changed, 17 insertions(+), 2 deletions(-)
>
> diff --git a/gettext.h b/gettext.h
> index c68bbe9..2f806cb 100644
> --- a/gettext.h
> +++ b/gettext.h
> @@ -1,3 +1,10 @@
> +#ifndef GETTEXT_H
> +#define GETTEXT_H
> +
> +#ifdef _
> +#error "namespace conflict: '_' is pre-defined?"
> +#endif
> +
>  /*
>  * Copyright (c) 2010 Ævar Arnfjörð Bjarmason
>  *
> @@ -5,5 +12,13 @@
>  * be replaced by something that uses libintl.h and wraps gettext() in
>  * a future patch series.
>  */
> -#define N_(s) (s)
> -#define _(s) (s)
> +
> +static inline const char *_(const char *msgid)
> +{
> +       return msgid;
> +}
> +
> +/* Mark msgid for translation but do not translate it. */
> +#define N_(msgid) (msgid)
> +
> +#endif

Thanks for this. This was raised earlier in the discussion for this
series (by you, IIRC). I've considered it, and while I see your point
(type safety = good) I think I like my way of doing it better.

The _() macro/function is usually a macro and not a function. The good
thing about this is that I can prove that it's a no-op on all
compilers, whereas if it's an inline function (stupid) compilers will
actually make it into a function, which'll result in overhead,
which'll mean I can't advertise this series as a "no-op" anymore.

Check out some of the recent work in perl.git for reference. There's
now a probe in perl which check is the compiler can *really* handle
inline functions, and if not perl will fall back on using macros.

I'd rather not use inline functions for every string in Git without
such a probe, especially since it's for a very marginal gain. Using
_() for non-strings isn't going to make it past the list, and if it's
used with e.g. multiple arguments compilers will already whine about
it.

So that's why I didn't do it. But if everyone else feels strongly
about it I'll change my mind, I don't care *that* much about it, but
I'd prefer a macro.

^ permalink raw reply	[flat|nested] 222+ messages in thread

* Re: [PATCH 03/72] t/test-lib.sh: add always-set NO_GETTEXT_POISON prerequisite
  2011-02-20 12:42     ` Ævar Arnfjörð Bjarmason
@ 2011-02-20 21:55       ` Jonathan Nieder
  2011-02-20 22:05         ` Ævar Arnfjörð Bjarmason
  2011-02-21  6:56       ` Junio C Hamano
  1 sibling, 1 reply; 222+ messages in thread
From: Jonathan Nieder @ 2011-02-20 21:55 UTC (permalink / raw)
  To: Ævar Arnfjörð Bjarmason; +Cc: git, Junio C Hamano

Ævar Arnfjörð Bjarmason wrote:

> It's explicitly about tests that can't deal with poison, not
> non-English. See this comment in patch  28/72:
>
>     gettextize: git-commit "enter the commit message" message
>
>     Gettextize the "# Please enter the commit message for your changes."
>     message. Several tests in t7500-commit.sh and t7502-commit.sh assume
>     that this message starts with a newline. Change the tests to to skip
>     under GETTEXT_POISON=YesPlease.

Shouldn't the functional part (the starting newline, opening # marks)
be untranslatable then, to avoid making a trap for translators?  Such
a fix could happen at any time, and until then, we could skip those
tests in the non-English case.

Since that codepath requires human intervention anyway (which is
generally slow), I can't imagine doing that would hurt runtime
performance enough to matter.

But I do get your point --- perhaps in some other circumstance we have
to rely on some intelligence by the translator for correct behavior.
So maybe it means something along the lines of

	test_set_prereq SANE_TRANSLATION

?

^ permalink raw reply	[flat|nested] 222+ messages in thread

* Re: [PATCH 01/72] gettext.h: add no-op _() and N_() wrappers
  2011-02-20 21:11     ` Ævar Arnfjörð Bjarmason
@ 2011-02-20 22:03       ` Jonathan Nieder
  0 siblings, 0 replies; 222+ messages in thread
From: Jonathan Nieder @ 2011-02-20 22:03 UTC (permalink / raw)
  To: Ævar Arnfjörð Bjarmason; +Cc: git, Junio C Hamano

Ævar Arnfjörð Bjarmason wrote:

> Thanks for this. This was raised earlier in the discussion for this
> series (by you, IIRC). I've considered it, and while I see your point
> (type safety = good) I think I like my way of doing it better.
>
> The _() macro/function is usually a macro and not a function. The good
> thing about this is that I can prove that it's a no-op on all
> compilers, whereas if it's an inline function (stupid) compilers will
> actually make it into a function, which'll result in overhead,
> which'll mean I can't advertise this series as a "no-op" anymore.

I hope we don't support (meaning "worry about") such stupid compilers?

At least I haven't seen this being a consideration in deciding whether
to split out inline functions in the past.  Perl is much more portable
than git, and that seems perfectly fine to me.

> So that's why I didn't do it. But if everyone else feels strongly
> about it I'll change my mind, I don't care *that* much about it, but
> I'd prefer a macro.

I think it's perfectly possible there's some aesthetic or functional
reason to make this a macro instead of a function, and that would be
fine with me.  On the other hand, if there's no reason, then I do feel
strongly about it, fwiw.  New code should set a good example.

Thanks for your thoughtfulness.
Jonathan

^ permalink raw reply	[flat|nested] 222+ messages in thread

* Re: [PATCH 03/72] t/test-lib.sh: add always-set NO_GETTEXT_POISON prerequisite
  2011-02-20 21:55       ` Jonathan Nieder
@ 2011-02-20 22:05         ` Ævar Arnfjörð Bjarmason
  2011-02-20 22:10           ` Jonathan Nieder
  0 siblings, 1 reply; 222+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2011-02-20 22:05 UTC (permalink / raw)
  To: Jonathan Nieder; +Cc: git, Junio C Hamano

On Sun, Feb 20, 2011 at 22:55, Jonathan Nieder <jrnieder@gmail.com> wrote:
> Ævar Arnfjörð Bjarmason wrote:
>
>> It's explicitly about tests that can't deal with poison, not
>> non-English. See this comment in patch  28/72:
>>
>>     gettextize: git-commit "enter the commit message" message
>>
>>     Gettextize the "# Please enter the commit message for your changes."
>>     message. Several tests in t7500-commit.sh and t7502-commit.sh assume
>>     that this message starts with a newline. Change the tests to to skip
>>     under GETTEXT_POISON=YesPlease.
>
> Shouldn't the functional part (the starting newline, opening # marks)
> be untranslatable then, to avoid making a trap for translators?  Such
> a fix could happen at any time, and until then, we could skip those
> tests in the non-English case.

I'm aiming to make this as minimal as possible, so I'm not going to
change the code to start constructing string buffers where we
previously had literals in this iteration.

And the trap is minimimal, sinc msgfmt --check will warn if the
structure of the newlines in the translation is different.

> Since that codepath requires human intervention anyway (which is
> generally slow), I can't imagine doing that would hurt runtime
> performance enough to matter.
>
> But I do get your point --- perhaps in some other circumstance we have
> to rely on some intelligence by the translator for correct behavior.
> So maybe it means something along the lines of
>
>        test_set_prereq SANE_TRANSLATION

Well, the feature I have is to inject garbage into the gettext strings
in an effort to smoke out when I break the plumbing. So I think given
that functionality calling it NO_GETTEXT_POISON makes sense.

But I plan to add something to smoke other languages etc. later. Then
I might name that other prerequisite something else.

^ permalink raw reply	[flat|nested] 222+ messages in thread

* Re: [PATCH 03/72] t/test-lib.sh: add always-set NO_GETTEXT_POISON prerequisite
  2011-02-20 22:05         ` Ævar Arnfjörð Bjarmason
@ 2011-02-20 22:10           ` Jonathan Nieder
  2011-02-20 22:31             ` Ævar Arnfjörð Bjarmason
  0 siblings, 1 reply; 222+ messages in thread
From: Jonathan Nieder @ 2011-02-20 22:10 UTC (permalink / raw)
  To: Ævar Arnfjörð Bjarmason; +Cc: git, Junio C Hamano

Ævar Arnfjörð Bjarmason wrote:

> Well, the feature I have is to inject garbage into the gettext strings
> in an effort to smoke out when I break the plumbing. So I think given
> that functionality calling it NO_GETTEXT_POISON makes sense.
>
> But I plan to add something to smoke other languages etc. later. Then
> I might name that other prerequisite something else.

On second thought, another possibility would be _two_ prerequisites,
one NO_GETTEXT_POISON one and one ENGLISH one.  The weird edge cases
could require NO_GETTEXT_POISON, causing the reader to look to
t/README to figure out what is going on.  The others would just use
ENGLISH.

Does that sound reasonable?

^ permalink raw reply	[flat|nested] 222+ messages in thread

* Re: [PATCH 03/72] t/test-lib.sh: add always-set NO_GETTEXT_POISON prerequisite
  2011-02-20 22:10           ` Jonathan Nieder
@ 2011-02-20 22:31             ` Ævar Arnfjörð Bjarmason
  2011-02-20 22:36               ` Jonathan Nieder
  0 siblings, 1 reply; 222+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2011-02-20 22:31 UTC (permalink / raw)
  To: Jonathan Nieder; +Cc: git, Junio C Hamano

On Sun, Feb 20, 2011 at 23:10, Jonathan Nieder <jrnieder@gmail.com> wrote:
> Ævar Arnfjörð Bjarmason wrote:
>
>> Well, the feature I have is to inject garbage into the gettext strings
>> in an effort to smoke out when I break the plumbing. So I think given
>> that functionality calling it NO_GETTEXT_POISON makes sense.
>>
>> But I plan to add something to smoke other languages etc. later. Then
>> I might name that other prerequisite something else.
>
> On second thought, another possibility would be _two_ prerequisites,
> one NO_GETTEXT_POISON one and one ENGLISH one.  The weird edge cases
> could require NO_GETTEXT_POISON, causing the reader to look to
> t/README to figure out what is going on.  The others would just use
> ENGLISH.
>
> Does that sound reasonable?

Yes, I suggested implementing that in the "enter the commit message"
patch, but since we don't have a 100% translation yet I was going to
wait until then.

It's also a very low priority, the point of these tests is to make
sure I don't make a plumbing message translatable. The things that
start failing under a testing mode like ENGLISH are by definition a
subset of the things that'll start failing under NO_GETTEXT_POISON. So
there's not a lot of incentive for me to implement that.

The only reason I can think of to have it is to make sure that
messages like the "enter the commit message" ones have the correct
newlines in all languages, but msgfmt --check catches that anyway, or
to somehow test Git's output in different languages, but I'd rather do
that differently (not test output, but behavior).

So given all of the above I might never get around to implementing it.

^ permalink raw reply	[flat|nested] 222+ messages in thread

* Re: [PATCH 03/72] t/test-lib.sh: add always-set NO_GETTEXT_POISON prerequisite
  2011-02-20 22:31             ` Ævar Arnfjörð Bjarmason
@ 2011-02-20 22:36               ` Jonathan Nieder
  0 siblings, 0 replies; 222+ messages in thread
From: Jonathan Nieder @ 2011-02-20 22:36 UTC (permalink / raw)
  To: Ævar Arnfjörð Bjarmason; +Cc: git, Junio C Hamano

Ævar Arnfjörð Bjarmason wrote:

> The only reason I can think of to have it is to make sure that
> messages like the "enter the commit message" ones have the correct
> newlines in all languages, but msgfmt --check catches that anyway, or
> to somehow test Git's output in different languages, but I'd rather do
> that differently (not test output, but behavior).
>
> So given all of the above I might never get around to implementing it.

I guess I'm confused.  I've been saying (repeatedly, and probably
annoyingly) that anyone seeing the NO_GETTEXT_POISON prereq for the
first time isn't going to have any clue what it means.  I think that's
a problem.  Do you not think so?

^ permalink raw reply	[flat|nested] 222+ messages in thread

* [PATCH v2 0/3] No-op C gettext wrappers
  2011-02-19 19:23 [PATCH 00/72] No-op C gettext wrappers Ævar Arnfjörð Bjarmason
                   ` (71 preceding siblings ...)
  2011-02-19 19:24 ` [PATCH 72/72] gettextize: git-shortlog basic messages Ævar Arnfjörð Bjarmason
@ 2011-02-21  4:00 ` Jonathan Nieder
  2011-02-21  4:02   ` [PATCH 1/3] i18n: add no-op _() and N_() wrappers Jonathan Nieder
                     ` (3 more replies)
  72 siblings, 4 replies; 222+ messages in thread
From: Jonathan Nieder @ 2011-02-21  4:00 UTC (permalink / raw)
  To: Ævar Arnfjörð Bjarmason; +Cc: git, Junio C Hamano

Hi,

Ævar Arnfjörð Bjarmason wrote:

> As discussed on-list previously I'm remaking the gettext series in a
> form that'll be easier to swallow.

Here's a reroll of the skeleton gettext.h wrapper as requested.
I'll send some gettextization patches in a separate series, time
permitting.

Changes from v1:

 - renamed NO_GETTEXT_POISON prereq to C_LOCALE_OUTPUT.  This should
   make it possible to reuse that prereq is the test suite ever
   learns a --lang option.  Hopefully this will also make it easier
   for authors of new tests to tell whether that prereq needs to be
   set.
 - GETTEXT_POISON can be enabled or disabled at runtime
 - _() is an inline function to catch misuses like

   const char *some_strings[] = { _("foo"), _("bar"), _("baz") };
 - combined some patches, tweaked commit messages

Thoughts welcome, as always.
Jonathan Nieder (1):
  tests: let GETTEXT_POISON be disabled at run time

Ævar Arnfjörð Bjarmason (2):
  i18n: add no-op _() and N_() wrappers
  tests: add GETTEXT_POISON to simulate unfriendly translator

 Makefile      |    9 +++++++++
 cache.h       |    1 +
 gettext.c     |   14 ++++++++++++++
 gettext.h     |   32 ++++++++++++++++++++++++++++++++
 t/test-lib.sh |    9 +++++++++
 5 files changed, 65 insertions(+), 0 deletions(-)
 create mode 100644 gettext.c
 create mode 100644 gettext.h

^ permalink raw reply	[flat|nested] 222+ messages in thread

* [PATCH 1/3] i18n: add no-op _() and N_() wrappers
  2011-02-21  4:00 ` [PATCH v2 0/3] No-op C gettext wrappers Jonathan Nieder
@ 2011-02-21  4:02   ` Jonathan Nieder
  2011-02-21  4:03   ` [PATCH 2/3] tests: add GETTEXT_POISON to simulate unfriendly translator Jonathan Nieder
                     ` (2 subsequent siblings)
  3 siblings, 0 replies; 222+ messages in thread
From: Jonathan Nieder @ 2011-02-21  4:02 UTC (permalink / raw)
  To: Ævar Arnfjörð Bjarmason; +Cc: git, Junio C Hamano

From: Ævar Arnfjörð Bjarmason <avarab@gmail.com>

The _ function is meant to be used to translate strings into the
user's chosen language.

The N_ macro is a marker for xgettext to find translatable strings
in contexts where a function call cannot be used directly, like so:

	const char *unpack_plumbing_errors[NB_UNPACK_TREES_ERROR_TYPES] = {
		/* ERROR_WOULD_OVERWRITE */
		N_("Entry '%s' would be overwritten by merge. Cannot merge."),
	[...]

Its result is still untranslated and should be fed to _ before it
is printed.

Making _ a function and N_ a macro avoids the temptation to use
_("foo") instead of N_("foo") as a string literal.

Define these in a new gettext.h and include it in cache.h, so they can
be used everywhere.  They just return their argument for now.  To
split up the gettext series I'm first submitting patches to gettextize
the source tree before I add any of the Makefile and C changes needed
to actually use translations.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
---
 Makefile  |    1 +
 cache.h   |    1 +
 gettext.h |   26 ++++++++++++++++++++++++++
 3 files changed, 28 insertions(+), 0 deletions(-)
 create mode 100644 gettext.h

diff --git a/Makefile b/Makefile
index ade7923..c153f45 100644
--- a/Makefile
+++ b/Makefile
@@ -515,6 +515,7 @@ LIB_H += diff.h
 LIB_H += dir.h
 LIB_H += exec_cmd.h
 LIB_H += fsck.h
+LIB_H += gettext.h
 LIB_H += git-compat-util.h
 LIB_H += graph.h
 LIB_H += grep.h
diff --git a/cache.h b/cache.h
index 3abf895..a465f38 100644
--- a/cache.h
+++ b/cache.h
@@ -5,6 +5,7 @@
 #include "strbuf.h"
 #include "hash.h"
 #include "advice.h"
+#include "gettext.h"
 
 #include SHA1_HEADER
 #ifndef git_SHA_CTX
diff --git a/gettext.h b/gettext.h
new file mode 100644
index 0000000..dc44825
--- /dev/null
+++ b/gettext.h
@@ -0,0 +1,26 @@
+#ifndef GETTEXT_H
+#define GETTEXT_H
+
+/*
+ * Copyright (c) 2010 Ævar Arnfjörð Bjarmason
+ *
+ * This is a skeleton no-op implementation of gettext for Git.
+ * You can replace it with something that uses libintl.h and wraps
+ * gettext() to try out the translations.
+ */
+
+#ifdef _
+#error "namespace conflict: '_' is pre-defined?"
+#endif
+
+#define FORMAT_PRESERVING(n) __attribute__((format_arg(n)))
+
+static inline FORMAT_PRESERVING(1) const char *_(const char *msgid)
+{
+	return msgid;
+}
+
+/* Mark msgid for translation but do not translate it. */
+#define N_(msgid) (msgid)
+
+#endif
-- 
1.7.4.1

^ permalink raw reply related	[flat|nested] 222+ messages in thread

* [PATCH 2/3] tests: add GETTEXT_POISON to simulate unfriendly translator
  2011-02-21  4:00 ` [PATCH v2 0/3] No-op C gettext wrappers Jonathan Nieder
  2011-02-21  4:02   ` [PATCH 1/3] i18n: add no-op _() and N_() wrappers Jonathan Nieder
@ 2011-02-21  4:03   ` Jonathan Nieder
  2011-02-21  4:05   ` [PATCH 3/3] tests: let GETTEXT_POISON be disabled at run time Jonathan Nieder
  2011-02-21 10:12   ` [PATCH v3 00/15] Mark "init", "clone", and "add" output for translation Jonathan Nieder
  3 siblings, 0 replies; 222+ messages in thread
From: Jonathan Nieder @ 2011-02-21  4:03 UTC (permalink / raw)
  To: Ævar Arnfjörð Bjarmason; +Cc: git, Junio C Hamano

From: Ævar Arnfjörð Bjarmason <avarab@gmail.com>

Add a new GETTEXT_POISON Makefile parameter.  When it is set, every
invocation of _(s) will return a nonsense string instead of 's' or an
actual translation of 's'.  By setting this parameter, we can make
sure that none of the strings marked for translation are functionally
important.

When tests are checking specific (US English) output from Git, they
should add a C_LOCALE_OUTPUT prerequisite.  Running through tests in
this way can help to find messages that should not be translated
because they are part of the git plumbing.

The poison string is "# GETTEXT POISON #", so it is still a valid
comment that is safe to put at the end of the message shown by 'git
commit --amend' and so on.  That simplifies life until git can learn
to add the "# " comment markers itself instead of relying on
translators to remember them.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
---
 Makefile      |    7 +++++++
 gettext.h     |    8 +++++++-
 t/test-lib.sh |    3 +++
 3 files changed, 17 insertions(+), 1 deletions(-)

diff --git a/Makefile b/Makefile
index c153f45..c348bb7 100644
--- a/Makefile
+++ b/Makefile
@@ -216,6 +216,9 @@ all::
 #
 # Define NO_REGEX if you have no or inferior regex support in your C library.
 #
+# Define GETTEXT_POISON if you are debugging the choice of strings marked
+# for translation.  This will turn all strings that use gettext into gibberish.
+#
 # Define JSMIN to point to JavaScript minifier that functions as
 # a filter to have gitweb.js minified.
 #
@@ -1370,6 +1373,9 @@ endif
 ifdef NO_SYMLINK_HEAD
 	BASIC_CFLAGS += -DNO_SYMLINK_HEAD
 endif
+ifdef GETTEXT_POISON
+	BASIC_CFLAGS += -DGETTEXT_POISON
+endif
 ifdef NO_STRCASESTR
 	COMPAT_CFLAGS += -DNO_STRCASESTR
 	COMPAT_OBJS += compat/strcasestr.o
@@ -2089,6 +2095,7 @@ endif
 ifdef GIT_TEST_CMP_USE_COPIED_CONTEXT
 	@echo GIT_TEST_CMP_USE_COPIED_CONTEXT=YesPlease >>$@
 endif
+	@echo GETTEXT_POISON=\''$(subst ','\'',$(subst ','\'',$(GETTEXT_POISON)))'\' >>$@
 
 ### Detect Tck/Tk interpreter path changes
 ifndef NO_TCLTK
diff --git a/gettext.h b/gettext.h
index dc44825..6daa57c 100644
--- a/gettext.h
+++ b/gettext.h
@@ -15,9 +15,15 @@
 
 #define FORMAT_PRESERVING(n) __attribute__((format_arg(n)))
 
+#ifdef GETTEXT_POISON
+#define use_poison() 1
+#else
+#define use_poison() 0
+#endif
+
 static inline FORMAT_PRESERVING(1) const char *_(const char *msgid)
 {
-	return msgid;
+	return use_poison() ? "# GETTEXT POISON #" : msgid;
 }
 
 /* Mark msgid for translation but do not translate it. */
diff --git a/t/test-lib.sh b/t/test-lib.sh
index 0fdc541..0840e4a 100644
--- a/t/test-lib.sh
+++ b/t/test-lib.sh
@@ -1079,6 +1079,9 @@ esac
 test -z "$NO_PERL" && test_set_prereq PERL
 test -z "$NO_PYTHON" && test_set_prereq PYTHON
 
+# Can we rely on git's output in the C locale?
+test -z "$GETTEXT_POISON" && test_set_prereq C_LOCALE_OUTPUT
+
 # test whether the filesystem supports symbolic links
 ln -s x y 2>/dev/null && test -h y 2>/dev/null && test_set_prereq SYMLINKS
 rm -f y
-- 
1.7.4.1

^ permalink raw reply related	[flat|nested] 222+ messages in thread

* [PATCH 3/3] tests: let GETTEXT_POISON be disabled at run time
  2011-02-21  4:00 ` [PATCH v2 0/3] No-op C gettext wrappers Jonathan Nieder
  2011-02-21  4:02   ` [PATCH 1/3] i18n: add no-op _() and N_() wrappers Jonathan Nieder
  2011-02-21  4:03   ` [PATCH 2/3] tests: add GETTEXT_POISON to simulate unfriendly translator Jonathan Nieder
@ 2011-02-21  4:05   ` Jonathan Nieder
  2011-02-21 10:12   ` [PATCH v3 00/15] Mark "init", "clone", and "add" output for translation Jonathan Nieder
  3 siblings, 0 replies; 222+ messages in thread
From: Jonathan Nieder @ 2011-02-21  4:05 UTC (permalink / raw)
  To: Ævar Arnfjörð Bjarmason; +Cc: git, Junio C Hamano

Do not poison translations unless the GIT_GETTEXT_POISON environment
variable is set.  This way, a copy of git with GETTEXT_POISON set is
still generally usable and testers can avoid building two copies of
git to compare behavior with and without poison.

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
---
Thanks again for your help.  Hopefully that turned out okay.  Please
feel free to ack or complain to indicate either way.

 Makefile      |    1 +
 gettext.c     |   14 ++++++++++++++
 gettext.h     |    2 +-
 t/test-lib.sh |    8 +++++++-
 4 files changed, 23 insertions(+), 2 deletions(-)
 create mode 100644 gettext.c

diff --git a/Makefile b/Makefile
index c348bb7..142ed86 100644
--- a/Makefile
+++ b/Makefile
@@ -1374,6 +1374,7 @@ ifdef NO_SYMLINK_HEAD
 	BASIC_CFLAGS += -DNO_SYMLINK_HEAD
 endif
 ifdef GETTEXT_POISON
+	LIB_OBJS += gettext.o
 	BASIC_CFLAGS += -DGETTEXT_POISON
 endif
 ifdef NO_STRCASESTR
diff --git a/gettext.c b/gettext.c
new file mode 100644
index 0000000..9688c8b
--- /dev/null
+++ b/gettext.c
@@ -0,0 +1,14 @@
+/*
+ * Copyright (c) 2010 Ævar Arnfjörð Bjarmason
+ */
+
+#include "git-compat-util.h"
+#include "gettext.h"
+
+int use_poison(void)
+{
+	static int poison_requested = -1;
+	if (poison_requested == -1)
+		poison_requested = getenv("GIT_GETTEXT_POISON") ? 1 : 0;
+	return poison_requested;
+}
diff --git a/gettext.h b/gettext.h
index 6daa57c..051bf11 100644
--- a/gettext.h
+++ b/gettext.h
@@ -16,7 +16,7 @@
 #define FORMAT_PRESERVING(n) __attribute__((format_arg(n)))
 
 #ifdef GETTEXT_POISON
-#define use_poison() 1
+extern int use_poison(void);
 #else
 #define use_poison() 0
 #endif
diff --git a/t/test-lib.sh b/t/test-lib.sh
index 0840e4a..f4c1e04 100644
--- a/t/test-lib.sh
+++ b/t/test-lib.sh
@@ -1080,7 +1080,13 @@ test -z "$NO_PERL" && test_set_prereq PERL
 test -z "$NO_PYTHON" && test_set_prereq PYTHON
 
 # Can we rely on git's output in the C locale?
-test -z "$GETTEXT_POISON" && test_set_prereq C_LOCALE_OUTPUT
+if test -n "$GETTEXT_POISON"
+then
+	GIT_GETTEXT_POISON=YesPlease
+	export GIT_GETTEXT_POISON
+else
+	test_set_prereq C_LOCALE_OUTPUT
+fi
 
 # test whether the filesystem supports symbolic links
 ln -s x y 2>/dev/null && test -h y 2>/dev/null && test_set_prereq SYMLINKS
-- 
1.7.4.1

^ permalink raw reply related	[flat|nested] 222+ messages in thread

* Re: [PATCH 03/72] t/test-lib.sh: add always-set NO_GETTEXT_POISON prerequisite
  2011-02-20 12:42     ` Ævar Arnfjörð Bjarmason
  2011-02-20 21:55       ` Jonathan Nieder
@ 2011-02-21  6:56       ` Junio C Hamano
  1 sibling, 0 replies; 222+ messages in thread
From: Junio C Hamano @ 2011-02-21  6:56 UTC (permalink / raw)
  To: Ævar Arnfjörð Bjarmason; +Cc: Jonathan Nieder, git

Ævar Arnfjörð Bjarmason <avarab@gmail.com> writes:

> You shouldn't worry about it for now. FWIW NO_GETTEXT_POISON is
> documented in po/README in a patch that I plan to submit later.
>
> NO_GETTEXT_POISON is only relevant to people such as myself who are
> adding new translations to the source. I.e. changing "foo" to
> _("foo"). It's a sanity check to make sure that by doing so you're not
> changing some plumbing test, or at least have to realize what it is
> that you're changing.

I also had the same reaction to NO_GETTEXT_POISON as Jonathan, and your
above argument is not quite right.

GETTEXT_POISON _is_ relevant to people like you who are working on the
i18n part of the system.  It is a debugging aid to make sure that you are
not marking plumbing messages that should never be translated.

But you cannot say NO_GETTEXT_POISON is not relevant to others; everybody
else who is not actively working on i18n needs to be aware of it, and
needs to be careful when writing his tests.  When your test depends on
output from Porcelain (which is not something we should encourage, but
that is a separate matter), you need to mark that test as "this test will
be broken under GETTEXT_POISON build".

"This test requires NO_GETTEXT_POISON pre-requisite, which is only true
when git is built without GETTEXT_POISON" makes logical sense as a
statement, but it feels somewhat a roundabout way to explain it.

This is somewhat a tangent, but I've been wondering if it might be a
better design to make GETTEXT_POISON a runtime thing.  When git is run
with GIT_LOCALE=POISON, "_(msg)" will all result in gibberish or rot13,
and instead of building a special test-only binary, always compile i18n
version of git that way.

^ permalink raw reply	[flat|nested] 222+ messages in thread

* Re: [PATCH 07/72] gettextize: git-clone "Cloning into" message
  2011-02-19 19:23 ` [PATCH 07/72] gettextize: git-clone "Cloning into" message Ævar Arnfjörð Bjarmason
@ 2011-02-21  9:19   ` Jonathan Nieder
  0 siblings, 0 replies; 222+ messages in thread
From: Jonathan Nieder @ 2011-02-21  9:19 UTC (permalink / raw)
  To: Ævar Arnfjörð Bjarmason; +Cc: git, Junio C Hamano

Ævar Arnfjörð Bjarmason wrote:

> --- a/builtin/clone.c
> +++ b/builtin/clone.c
> @@ -468,9 +468,12 @@ int cmd_clone(int argc, const char **argv, const char *prefix)
>  		die(_("could not create leading directories of '%s'"), git_dir);
>  	set_git_dir(make_absolute_path(git_dir));
>  
> -	if (0 <= option_verbosity)
> -		printf("Cloning into %s%s...\n",
> -		       option_bare ? "bare repository " : "", dir);
> +	if (0 <= option_verbosity) {
> +		if (option_bare)
> +			printf(_("Cloning into bare repository %s\n"), dir);
> +		else
> +			printf(_("Cloning into %s\n"), dir);
> +	}

An ellipsis seems to have been lost.  I wonder if there is some easy
(automated, ideally) way to check these patches.

^ permalink raw reply	[flat|nested] 222+ messages in thread

* [PATCH v3 00/15] Mark "init", "clone", and "add" output for translation
  2011-02-21  4:00 ` [PATCH v2 0/3] No-op C gettext wrappers Jonathan Nieder
                     ` (2 preceding siblings ...)
  2011-02-21  4:05   ` [PATCH 3/3] tests: let GETTEXT_POISON be disabled at run time Jonathan Nieder
@ 2011-02-21 10:12   ` Jonathan Nieder
  2011-02-21 10:13     ` [PATCH 01/15] i18n: add no-op _() and N_() wrappers Jonathan Nieder
                       ` (16 more replies)
  3 siblings, 17 replies; 222+ messages in thread
From: Jonathan Nieder @ 2011-02-21 10:12 UTC (permalink / raw)
  To: Ævar Arnfjörð Bjarmason; +Cc: git, Junio C Hamano

Hi again,

To make the primitives introduced by v2 more concrete, here's a series
including a few gettextization patches.  I don't plan to send more of
these unless there is some agreement that the basic structure is
right.  Maybe by next time I'll hunker down and write myself a tool to
check that a commit only inserts "_("-")" pairs (maybe using diff
--word-diff?)

This series still includes the skeleton gettext.h wrapper.

Changes from v1:

 - clearer commit messages, hopefully
 - clearer documentation for GETTEXT_POISON in the makefile

Please feel free to try it out, complain, ack, send patches, and so
on.

Jonathan Nieder (2):
  i18n: do not poison translations unless GIT_GETTEXT_POISON envvar is
    set
  update-index --refresh --porcelain: add missing const

Ævar Arnfjörð Bjarmason (13):
  i18n: add no-op _() and N_() wrappers
  tests: add GETTEXT_POISON to simulate unfriendly translator
  Makefile: "pot" target to extract messages marked for translation
  init: mark basic messages for translation
  init: mark "Initialized [...] repository" for translation
  clone: mark basic messages for translation
  clone: split "Cloning into" message into two
  clone: mark "Cloning into" message for translation
  add: mark basic messages for translation
  add: mark "The following paths are ignored" for translation
  add: mark "did not match any files" for translation
  add -u --verbose: mark "remove '%s'" for translation
  add --refresh --verbose: mark "Unstaged changes" heading for
    translation

 Makefile               |   27 ++++++++++++++++++++
 builtin/add.c          |   50 +++++++++++++++++++-------------------
 builtin/clone.c        |   63 +++++++++++++++++++++++++----------------------
 builtin/init-db.c      |   58 ++++++++++++++++++++++++-------------------
 cache.h                |    3 +-
 gettext.c              |   14 ++++++++++
 gettext.h              |   32 ++++++++++++++++++++++++
 po/.gitignore          |    1 +
 read-cache.c           |    4 +-
 t/t0001-init.sh        |    2 +-
 t/t2200-add-update.sh  |    2 +-
 t/t2204-add-ignored.sh |   37 +++++++++++++++++++---------
 t/t3700-add.sh         |   13 +++++++--
 t/t5601-clone.sh       |    2 +-
 t/test-lib.sh          |    9 +++++++
 15 files changed, 215 insertions(+), 102 deletions(-)
 create mode 100644 gettext.c
 create mode 100644 gettext.h
 create mode 100644 po/.gitignore

^ permalink raw reply	[flat|nested] 222+ messages in thread

* [PATCH 01/15] i18n: add no-op _() and N_() wrappers
  2011-02-21 10:12   ` [PATCH v3 00/15] Mark "init", "clone", and "add" output for translation Jonathan Nieder
@ 2011-02-21 10:13     ` Jonathan Nieder
  2011-02-21 10:13     ` [PATCH 02/15] tests: add GETTEXT_POISON to simulate unfriendly translator Jonathan Nieder
                       ` (15 subsequent siblings)
  16 siblings, 0 replies; 222+ messages in thread
From: Jonathan Nieder @ 2011-02-21 10:13 UTC (permalink / raw)
  To: Ævar Arnfjörð Bjarmason; +Cc: git, Junio C Hamano

From: Ævar Arnfjörð Bjarmason <avarab@gmail.com>

The _ function is for translating strings into the user's chosen
language.  The N_ macro just marks translatable strings for the
xgettext(1) tool without translating them; it is intended for use in
contexts where a function call cannot be used.  So, for example:

	fprintf(stderr, _("Expansion of alias '%s' failed; "
		"'%s' is not a git command\n"),
		cmd, argv[0]);

and

	const char *unpack_plumbing_errors[NB_UNPACK_TREES_ERROR_TYPES] = {
		/* ERROR_WOULD_OVERWRITE */
		N_("Entry '%s' would be overwritten by merge. Cannot merge."),
	[...]

Define such _ and N_ in a new gettext.h and include it in cache.h, so
they can be used everywhere.  Each just returns its argument for now.
_ is a function rather than a macro like N_ to avoid the temptation to
use _("foo") as a string literal (which would be a compile-time error
once _(s) expands to an expression for the translation of s).

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
---
 Makefile  |    1 +
 cache.h   |    1 +
 gettext.h |   26 ++++++++++++++++++++++++++
 3 files changed, 28 insertions(+), 0 deletions(-)
 create mode 100644 gettext.h

diff --git a/Makefile b/Makefile
index ade7923..c153f45 100644
--- a/Makefile
+++ b/Makefile
@@ -515,6 +515,7 @@ LIB_H += diff.h
 LIB_H += dir.h
 LIB_H += exec_cmd.h
 LIB_H += fsck.h
+LIB_H += gettext.h
 LIB_H += git-compat-util.h
 LIB_H += graph.h
 LIB_H += grep.h
diff --git a/cache.h b/cache.h
index 3abf895..a465f38 100644
--- a/cache.h
+++ b/cache.h
@@ -5,6 +5,7 @@
 #include "strbuf.h"
 #include "hash.h"
 #include "advice.h"
+#include "gettext.h"
 
 #include SHA1_HEADER
 #ifndef git_SHA_CTX
diff --git a/gettext.h b/gettext.h
new file mode 100644
index 0000000..dc44825
--- /dev/null
+++ b/gettext.h
@@ -0,0 +1,26 @@
+#ifndef GETTEXT_H
+#define GETTEXT_H
+
+/*
+ * Copyright (c) 2010 Ævar Arnfjörð Bjarmason
+ *
+ * This is a skeleton no-op implementation of gettext for Git.
+ * You can replace it with something that uses libintl.h and wraps
+ * gettext() to try out the translations.
+ */
+
+#ifdef _
+#error "namespace conflict: '_' is pre-defined?"
+#endif
+
+#define FORMAT_PRESERVING(n) __attribute__((format_arg(n)))
+
+static inline FORMAT_PRESERVING(1) const char *_(const char *msgid)
+{
+	return msgid;
+}
+
+/* Mark msgid for translation but do not translate it. */
+#define N_(msgid) (msgid)
+
+#endif
-- 
1.7.4.1

^ permalink raw reply related	[flat|nested] 222+ messages in thread

* [PATCH 02/15] tests: add GETTEXT_POISON to simulate unfriendly translator
  2011-02-21 10:12   ` [PATCH v3 00/15] Mark "init", "clone", and "add" output for translation Jonathan Nieder
  2011-02-21 10:13     ` [PATCH 01/15] i18n: add no-op _() and N_() wrappers Jonathan Nieder
@ 2011-02-21 10:13     ` Jonathan Nieder
  2011-02-21 12:41       ` Ævar Arnfjörð Bjarmason
  2011-02-21 10:14     ` [PATCH 03/15] i18n: do not poison translations unless GIT_GETTEXT_POISON envvar is set Jonathan Nieder
                       ` (14 subsequent siblings)
  16 siblings, 1 reply; 222+ messages in thread
From: Jonathan Nieder @ 2011-02-21 10:13 UTC (permalink / raw)
  To: Ævar Arnfjörð Bjarmason; +Cc: git, Junio C Hamano

From: Ævar Arnfjörð Bjarmason <avarab@gmail.com>

Add a new GETTEXT_POISON compile-time parameter to make _(msg) always
return gibberish.  So now you can run

	make GETTEXT_POISON=YesPlease

to get a copy of git that functions correctly (one hopes) but produces
output that is in nobody's native language at all.

This is a debugging aid for people who are working on the i18n part of
the system, to make sure that they are not marking plumbing messages
that should never be translated with _().

As new strings get marked for translation, naturally a number of tests
will be broken in this mode.  Tests that depend on output from
Porcelain will need to be marked with the new C_LOCALE_OUTPUT test
prerequisite.  Newly failing tests that do not depend on output from
Porcelain would be bugs due to messages that should not have been
marked for translation.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
---
 Makefile      |    7 +++++++
 gettext.h     |    8 +++++++-
 t/test-lib.sh |    3 +++
 3 files changed, 17 insertions(+), 1 deletions(-)

diff --git a/Makefile b/Makefile
index c153f45..c348bb7 100644
--- a/Makefile
+++ b/Makefile
@@ -216,6 +216,9 @@ all::
 #
 # Define NO_REGEX if you have no or inferior regex support in your C library.
 #
+# Define GETTEXT_POISON if you are debugging the choice of strings marked
+# for translation.  This will turn all strings that use gettext into gibberish.
+#
 # Define JSMIN to point to JavaScript minifier that functions as
 # a filter to have gitweb.js minified.
 #
@@ -1370,6 +1373,9 @@ endif
 ifdef NO_SYMLINK_HEAD
 	BASIC_CFLAGS += -DNO_SYMLINK_HEAD
 endif
+ifdef GETTEXT_POISON
+	BASIC_CFLAGS += -DGETTEXT_POISON
+endif
 ifdef NO_STRCASESTR
 	COMPAT_CFLAGS += -DNO_STRCASESTR
 	COMPAT_OBJS += compat/strcasestr.o
@@ -2089,6 +2095,7 @@ endif
 ifdef GIT_TEST_CMP_USE_COPIED_CONTEXT
 	@echo GIT_TEST_CMP_USE_COPIED_CONTEXT=YesPlease >>$@
 endif
+	@echo GETTEXT_POISON=\''$(subst ','\'',$(subst ','\'',$(GETTEXT_POISON)))'\' >>$@
 
 ### Detect Tck/Tk interpreter path changes
 ifndef NO_TCLTK
diff --git a/gettext.h b/gettext.h
index dc44825..68e3a19 100644
--- a/gettext.h
+++ b/gettext.h
@@ -15,9 +15,15 @@
 
 #define FORMAT_PRESERVING(n) __attribute__((format_arg(n)))
 
+#ifdef GETTEXT_POISON
+#define use_poison() 1
+#else
+#define use_poison() 0
+#endif
+
 static inline FORMAT_PRESERVING(1) const char *_(const char *msgid)
 {
-	return msgid;
+	return use_poison() ? "Malkovich" : msgid;
 }
 
 /* Mark msgid for translation but do not translate it. */
diff --git a/t/test-lib.sh b/t/test-lib.sh
index 0fdc541..0840e4a 100644
--- a/t/test-lib.sh
+++ b/t/test-lib.sh
@@ -1079,6 +1079,9 @@ esac
 test -z "$NO_PERL" && test_set_prereq PERL
 test -z "$NO_PYTHON" && test_set_prereq PYTHON
 
+# Can we rely on git's output in the C locale?
+test -z "$GETTEXT_POISON" && test_set_prereq C_LOCALE_OUTPUT
+
 # test whether the filesystem supports symbolic links
 ln -s x y 2>/dev/null && test -h y 2>/dev/null && test_set_prereq SYMLINKS
 rm -f y
-- 
1.7.4.1

^ permalink raw reply related	[flat|nested] 222+ messages in thread

* [PATCH 03/15] i18n: do not poison translations unless GIT_GETTEXT_POISON envvar is set
  2011-02-21 10:12   ` [PATCH v3 00/15] Mark "init", "clone", and "add" output for translation Jonathan Nieder
  2011-02-21 10:13     ` [PATCH 01/15] i18n: add no-op _() and N_() wrappers Jonathan Nieder
  2011-02-21 10:13     ` [PATCH 02/15] tests: add GETTEXT_POISON to simulate unfriendly translator Jonathan Nieder
@ 2011-02-21 10:14     ` Jonathan Nieder
  2011-02-21 10:15     ` [PATCH 04/15] Makefile: "pot" target to extract messages marked for translation Jonathan Nieder
                       ` (13 subsequent siblings)
  16 siblings, 0 replies; 222+ messages in thread
From: Jonathan Nieder @ 2011-02-21 10:14 UTC (permalink / raw)
  To: Ævar Arnfjörð Bjarmason; +Cc: git, Junio C Hamano

Tweak the GETTEXT_POISON facility so it is activated at run time
instead of compile time.  If the GIT_GETTEXT_POISON environment
variable is set, _(msg) will result in gibberish as before; but if the
GIT_GETTEXT_POISON variable is not set, it will return the message for
human-readable output.  So the behavior of mistranslated and
untranslated git can be compared without rebuilding git in between.

For simplicity we always set the GIT_GETTEXT_POISON variable in tests.

This does not affect builds without the GETTEXT_POISON compile-time
option set, so non-i18n git will not be slowed down.

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
---
 Makefile      |    5 ++++-
 gettext.c     |   14 ++++++++++++++
 gettext.h     |    2 +-
 t/test-lib.sh |    8 +++++++-
 4 files changed, 26 insertions(+), 3 deletions(-)
 create mode 100644 gettext.c

diff --git a/Makefile b/Makefile
index c348bb7..4e9d935 100644
--- a/Makefile
+++ b/Makefile
@@ -217,7 +217,9 @@ all::
 # Define NO_REGEX if you have no or inferior regex support in your C library.
 #
 # Define GETTEXT_POISON if you are debugging the choice of strings marked
-# for translation.  This will turn all strings that use gettext into gibberish.
+# for translation.  In a GETTEXT_POISON build, you can turn all strings marked
+# for translation into gibberish by setting the GIT_GETTEXT_POISON variable
+# (to any value) in your environment.
 #
 # Define JSMIN to point to JavaScript minifier that functions as
 # a filter to have gitweb.js minified.
@@ -1374,6 +1376,7 @@ ifdef NO_SYMLINK_HEAD
 	BASIC_CFLAGS += -DNO_SYMLINK_HEAD
 endif
 ifdef GETTEXT_POISON
+	LIB_OBJS += gettext.o
 	BASIC_CFLAGS += -DGETTEXT_POISON
 endif
 ifdef NO_STRCASESTR
diff --git a/gettext.c b/gettext.c
new file mode 100644
index 0000000..9688c8b
--- /dev/null
+++ b/gettext.c
@@ -0,0 +1,14 @@
+/*
+ * Copyright (c) 2010 Ævar Arnfjörð Bjarmason
+ */
+
+#include "git-compat-util.h"
+#include "gettext.h"
+
+int use_poison(void)
+{
+	static int poison_requested = -1;
+	if (poison_requested == -1)
+		poison_requested = getenv("GIT_GETTEXT_POISON") ? 1 : 0;
+	return poison_requested;
+}
diff --git a/gettext.h b/gettext.h
index 68e3a19..4d2338b 100644
--- a/gettext.h
+++ b/gettext.h
@@ -16,7 +16,7 @@
 #define FORMAT_PRESERVING(n) __attribute__((format_arg(n)))
 
 #ifdef GETTEXT_POISON
-#define use_poison() 1
+extern int use_poison(void);
 #else
 #define use_poison() 0
 #endif
diff --git a/t/test-lib.sh b/t/test-lib.sh
index 0840e4a..f4c1e04 100644
--- a/t/test-lib.sh
+++ b/t/test-lib.sh
@@ -1080,7 +1080,13 @@ test -z "$NO_PERL" && test_set_prereq PERL
 test -z "$NO_PYTHON" && test_set_prereq PYTHON
 
 # Can we rely on git's output in the C locale?
-test -z "$GETTEXT_POISON" && test_set_prereq C_LOCALE_OUTPUT
+if test -n "$GETTEXT_POISON"
+then
+	GIT_GETTEXT_POISON=YesPlease
+	export GIT_GETTEXT_POISON
+else
+	test_set_prereq C_LOCALE_OUTPUT
+fi
 
 # test whether the filesystem supports symbolic links
 ln -s x y 2>/dev/null && test -h y 2>/dev/null && test_set_prereq SYMLINKS
-- 
1.7.4.1

^ permalink raw reply related	[flat|nested] 222+ messages in thread

* [PATCH 04/15] Makefile: "pot" target to extract messages marked for translation
  2011-02-21 10:12   ` [PATCH v3 00/15] Mark "init", "clone", and "add" output for translation Jonathan Nieder
                       ` (2 preceding siblings ...)
  2011-02-21 10:14     ` [PATCH 03/15] i18n: do not poison translations unless GIT_GETTEXT_POISON envvar is set Jonathan Nieder
@ 2011-02-21 10:15     ` Jonathan Nieder
  2011-02-21 12:35       ` Ævar Arnfjörð Bjarmason
  2011-02-21 10:16     ` [PATCH 05/15] init: mark basic messages " Jonathan Nieder
                       ` (12 subsequent siblings)
  16 siblings, 1 reply; 222+ messages in thread
From: Jonathan Nieder @ 2011-02-21 10:15 UTC (permalink / raw)
  To: Ævar Arnfjörð Bjarmason; +Cc: git, Junio C Hamano

From: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Date: Tue, 31 Aug 2010 16:35:16 +0000

Add rules to generate a template (po/git.pot) listing messages marked
for translation in the C portion of git.

To get started translating, just run "make pot".

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
---
 Makefile      |   16 ++++++++++++++++
 po/.gitignore |    1 +
 2 files changed, 17 insertions(+), 0 deletions(-)
 create mode 100644 po/.gitignore

diff --git a/Makefile b/Makefile
index 4e9d935..1cc6c60 100644
--- a/Makefile
+++ b/Makefile
@@ -321,6 +321,7 @@ INSTALL = install
 RPMBUILD = rpmbuild
 TCL_PATH = tclsh
 TCLTK_PATH = wish
+XGETTEXT = xgettext
 PTHREAD_LIBS = -lpthread
 PTHREAD_CFLAGS =
 GCOV = gcov
@@ -1590,6 +1591,7 @@ ifndef V
 	QUIET_BUILT_IN = @echo '   ' BUILTIN $@;
 	QUIET_GEN      = @echo '   ' GEN $@;
 	QUIET_LNCP     = @echo '   ' LN/CP $@;
+	QUIET_XGETTEXT = @echo '   ' XGETTEXT $@;
 	QUIET_GCOV     = @echo '   ' GCOV $@;
 	QUIET_SUBDIR0  = +@subdir=
 	QUIET_SUBDIR1  = ;$(NO_SUBDIR) echo '   ' SUBDIR $$subdir; \
@@ -2057,6 +2059,20 @@ info:
 pdf:
 	$(MAKE) -C Documentation pdf
 
+XGETTEXT_FLAGS = \
+	--force-po \
+	--add-comments \
+	--msgid-bugs-address="Git Mailing List <git@vger.kernel.org>" \
+	--from-code=UTF-8
+XGETTEXT_FLAGS_C = $(XGETTEXT_FLAGS) --keyword=_ --keyword=N_ --language=C
+LOCALIZED_C := $(C_OBJ:o=c)
+
+po/git.pot: $(LOCALIZED_C)
+	$(QUIET_XGETTEXT)$(XGETTEXT) -o$@+ $(XGETTEXT_FLAGS_C) $(LOCALIZED_C) && \
+	mv $@+ $@
+
+pot: po/git.pot
+
 $(ETAGS_TARGET): FORCE
 	$(RM) $(ETAGS_TARGET)
 	$(FIND) . -name '*.[hcS]' -print | xargs etags -a -o $(ETAGS_TARGET)
diff --git a/po/.gitignore b/po/.gitignore
new file mode 100644
index 0000000..a242a86
--- /dev/null
+++ b/po/.gitignore
@@ -0,0 +1 @@
+/git.pot
-- 
1.7.4.1

^ permalink raw reply related	[flat|nested] 222+ messages in thread

* [PATCH 05/15] init: mark basic messages for translation
  2011-02-21 10:12   ` [PATCH v3 00/15] Mark "init", "clone", and "add" output for translation Jonathan Nieder
                       ` (3 preceding siblings ...)
  2011-02-21 10:15     ` [PATCH 04/15] Makefile: "pot" target to extract messages marked for translation Jonathan Nieder
@ 2011-02-21 10:16     ` Jonathan Nieder
  2011-02-21 10:17     ` [PATCH 06/15] init: mark "Initialized [...] repository" " Jonathan Nieder
                       ` (11 subsequent siblings)
  16 siblings, 0 replies; 222+ messages in thread
From: Jonathan Nieder @ 2011-02-21 10:16 UTC (permalink / raw)
  To: Ævar Arnfjörð Bjarmason; +Cc: git, Junio C Hamano

From: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Date: Sat, 28 Aug 2010 15:04:43 +0000

Change the user visible strings in init-db.c to use gettext
localizations. This only converts messages which needed to be changed
from "foo" to _("foo"), and didn't need any TRANSLATORS comments.

I haven't marked the messages in init_db_usage or init_db_options for
translation, since that would require additional changes in
parse-options.c. Those can be done later.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
---
 builtin/init-db.c |   46 +++++++++++++++++++++++-----------------------
 1 files changed, 23 insertions(+), 23 deletions(-)

diff --git a/builtin/init-db.c b/builtin/init-db.c
index 4f5348e..f7ddf5b 100644
--- a/builtin/init-db.c
+++ b/builtin/init-db.c
@@ -31,7 +31,7 @@ static void safe_create_dir(const char *dir, int share)
 		}
 	}
 	else if (share && adjust_shared_perm(dir))
-		die("Could not make %s writable by group", dir);
+		die(_("Could not make %s writable by group"), dir);
 }
 
 static void copy_templates_1(char *path, int baselen,
@@ -58,25 +58,25 @@ static void copy_templates_1(char *path, int baselen,
 		namelen = strlen(de->d_name);
 		if ((PATH_MAX <= baselen + namelen) ||
 		    (PATH_MAX <= template_baselen + namelen))
-			die("insanely long template name %s", de->d_name);
+			die(_("insanely long template name %s"), de->d_name);
 		memcpy(path + baselen, de->d_name, namelen+1);
 		memcpy(template + template_baselen, de->d_name, namelen+1);
 		if (lstat(path, &st_git)) {
 			if (errno != ENOENT)
-				die_errno("cannot stat '%s'", path);
+				die_errno(_("cannot stat '%s'"), path);
 		}
 		else
 			exists = 1;
 
 		if (lstat(template, &st_template))
-			die_errno("cannot stat template '%s'", template);
+			die_errno(_("cannot stat template '%s'"), template);
 
 		if (S_ISDIR(st_template.st_mode)) {
 			DIR *subdir = opendir(template);
 			int baselen_sub = baselen + namelen;
 			int template_baselen_sub = template_baselen + namelen;
 			if (!subdir)
-				die_errno("cannot opendir '%s'", template);
+				die_errno(_("cannot opendir '%s'"), template);
 			path[baselen_sub++] =
 				template[template_baselen_sub++] = '/';
 			path[baselen_sub] =
@@ -93,20 +93,20 @@ static void copy_templates_1(char *path, int baselen,
 			int len;
 			len = readlink(template, lnk, sizeof(lnk));
 			if (len < 0)
-				die_errno("cannot readlink '%s'", template);
+				die_errno(_("cannot readlink '%s'"), template);
 			if (sizeof(lnk) <= len)
-				die("insanely long symlink %s", template);
+				die(_("insanely long symlink %s"), template);
 			lnk[len] = 0;
 			if (symlink(lnk, path))
-				die_errno("cannot symlink '%s' '%s'", lnk, path);
+				die_errno(_("cannot symlink '%s' '%s'"), lnk, path);
 		}
 		else if (S_ISREG(st_template.st_mode)) {
 			if (copy_file(path, template, st_template.st_mode))
-				die_errno("cannot copy '%s' to '%s'", template,
+				die_errno(_("cannot copy '%s' to '%s'"), template,
 					  path);
 		}
 		else
-			error("ignoring template %s", template);
+			error(_("ignoring template %s"), template);
 	}
 }
 
@@ -129,7 +129,7 @@ static void copy_templates(const char *template_dir)
 		return;
 	template_len = strlen(template_dir);
 	if (PATH_MAX <= (template_len+strlen("/config")))
-		die("insanely long template path %s", template_dir);
+		die(_("insanely long template path %s"), template_dir);
 	strcpy(template_path, template_dir);
 	if (template_path[template_len-1] != '/') {
 		template_path[template_len++] = '/';
@@ -137,7 +137,7 @@ static void copy_templates(const char *template_dir)
 	}
 	dir = opendir(template_path);
 	if (!dir) {
-		warning("templates not found %s", template_dir);
+		warning(_("templates not found %s"), template_dir);
 		return;
 	}
 
@@ -150,8 +150,8 @@ static void copy_templates(const char *template_dir)
 
 	if (repository_format_version &&
 	    repository_format_version != GIT_REPO_VERSION) {
-		warning("not copying templates of "
-			"a wrong format version %d from '%s'",
+		warning(_("not copying templates of "
+			"a wrong format version %d from '%s'"),
 			repository_format_version,
 			template_dir);
 		closedir(dir);
@@ -188,7 +188,7 @@ static int create_default_files(const char *template_path)
 	int filemode;
 
 	if (len > sizeof(path)-50)
-		die("insane git directory %s", git_dir);
+		die(_("insane git directory %s"), git_dir);
 	memcpy(path, git_dir, len);
 
 	if (len && path[len-1] != '/')
@@ -375,7 +375,7 @@ static int guess_repository_type(const char *git_dir)
 	if (!strcmp(".", git_dir))
 		return 1;
 	if (!getcwd(cwd, sizeof(cwd)))
-		die_errno("cannot tell cwd");
+		die_errno(_("cannot tell cwd"));
 	if (!strcmp(git_dir, cwd))
 		return 1;
 	/*
@@ -450,18 +450,18 @@ int cmd_init_db(int argc, const char **argv, const char *prefix)
 					errno = EEXIST;
 					/* fallthru */
 				case -1:
-					die_errno("cannot mkdir %s", argv[0]);
+					die_errno(_("cannot mkdir %s"), argv[0]);
 					break;
 				default:
 					break;
 				}
 				shared_repository = saved;
 				if (mkdir(argv[0], 0777) < 0)
-					die_errno("cannot mkdir %s", argv[0]);
+					die_errno(_("cannot mkdir %s"), argv[0]);
 				mkdir_tried = 1;
 				goto retry;
 			}
-			die_errno("cannot chdir to %s", argv[0]);
+			die_errno(_("cannot chdir to %s"), argv[0]);
 		}
 	} else if (0 < argc) {
 		usage(init_db_usage[0]);
@@ -483,8 +483,8 @@ int cmd_init_db(int argc, const char **argv, const char *prefix)
 	git_dir = getenv(GIT_DIR_ENVIRONMENT);
 	work_tree = getenv(GIT_WORK_TREE_ENVIRONMENT);
 	if ((!git_dir || is_bare_repository_cfg == 1) && work_tree)
-		die("%s (or --work-tree=<directory>) not allowed without "
-		    "specifying %s (or --git-dir=<directory>)",
+		die(_("%s (or --work-tree=<directory>) not allowed without "
+			  "specifying %s (or --git-dir=<directory>)"),
 		    GIT_WORK_TREE_ENVIRONMENT,
 		    GIT_DIR_ENVIRONMENT);
 
@@ -509,14 +509,14 @@ int cmd_init_db(int argc, const char **argv, const char *prefix)
 		if (!git_work_tree_cfg) {
 			git_work_tree_cfg = xcalloc(PATH_MAX, 1);
 			if (!getcwd(git_work_tree_cfg, PATH_MAX))
-				die_errno ("Cannot access current working directory");
+				die_errno (_("Cannot access current working directory"));
 		}
 		if (work_tree)
 			set_git_work_tree(make_absolute_path(work_tree));
 		else
 			set_git_work_tree(git_work_tree_cfg);
 		if (access(get_git_work_tree(), X_OK))
-			die_errno ("Cannot access work tree '%s'",
+			die_errno (_("Cannot access work tree '%s'"),
 				   get_git_work_tree());
 	}
 	else {
-- 
1.7.4.1

^ permalink raw reply related	[flat|nested] 222+ messages in thread

* [PATCH 06/15] init: mark "Initialized [...] repository" for translation
  2011-02-21 10:12   ` [PATCH v3 00/15] Mark "init", "clone", and "add" output for translation Jonathan Nieder
                       ` (4 preceding siblings ...)
  2011-02-21 10:16     ` [PATCH 05/15] init: mark basic messages " Jonathan Nieder
@ 2011-02-21 10:17     ` Jonathan Nieder
  2011-02-21 10:18     ` [PATCH 07/15] clone: mark basic messages " Jonathan Nieder
                       ` (10 subsequent siblings)
  16 siblings, 0 replies; 222+ messages in thread
From: Jonathan Nieder @ 2011-02-21 10:17 UTC (permalink / raw)
  To: Ævar Arnfjörð Bjarmason; +Cc: git, Junio C Hamano

From: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Date: Sat, 28 Aug 2010 15:32:15 +0000

These messages could benefit from splitting up.  An earlier version of
this patch began like this:

    const char *reinit_shared   = _("Reinitialized existing shared Git repository in %s\n");
    const char *init_shared     = _("Initialized empty shared Git repository in %s\n");
    const char *reinit_noshared = _("Reinitialized existing Git repository in %s\n");
    const char *init_noshared   = _("Initialized empty Git repository in %s\n");

But in the first round of gettextization I'm aiming to keep code
changes to a minimum for ease of review.  So just add a comment
explaining to translators how the sprintf format gets used so they
can cope for now if the language's grammar allows.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
---
I heard a rumor that this style of TRANSLATORS comment doesn't pass
unscathed through xgettext, but when I tried it with "make pot" it
worked okay.  Ideas?

 builtin/init-db.c |   12 +++++++++---
 t/t0001-init.sh   |    2 +-
 2 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/builtin/init-db.c b/builtin/init-db.c
index f7ddf5b..e0e5ce3 100644
--- a/builtin/init-db.c
+++ b/builtin/init-db.c
@@ -354,9 +354,15 @@ int init_db(const char *template_dir, unsigned int flags)
 	if (!(flags & INIT_DB_QUIET)) {
 		const char *git_dir = get_git_dir();
 		int len = strlen(git_dir);
-		printf("%s%s Git repository in %s%s\n",
-		       reinit ? "Reinitialized existing" : "Initialized empty",
-		       shared_repository ? " shared" : "",
+
+		/*
+		 * TRANSLATORS: The first '%s' is either "Reinitialized
+		 * existing" or "Initialized empty", the second " shared" or
+		 * "", and the last '%s%s' is the verbatim directory name.
+		 */
+		printf(_("%s%s Git repository in %s%s\n"),
+		       reinit ? _("Reinitialized existing") : _("Initialized empty"),
+		       shared_repository ? _(" shared") : "",
 		       git_dir, len && git_dir[len-1] != '/' ? "/" : "");
 	}
 
diff --git a/t/t0001-init.sh b/t/t0001-init.sh
index f684993..dd4c00d 100755
--- a/t/t0001-init.sh
+++ b/t/t0001-init.sh
@@ -180,7 +180,7 @@ test_expect_success 'GIT_DIR & GIT_WORK_TREE (2)' '
 	fi
 '
 
-test_expect_success 'reinit' '
+test_expect_success C_LOCALE_OUTPUT 'reinit' '
 
 	(
 		sane_unset GIT_CONFIG GIT_WORK_TREE GIT_CONFIG &&
-- 
1.7.4.1

^ permalink raw reply related	[flat|nested] 222+ messages in thread

* [PATCH 07/15] clone: mark basic messages for translation
  2011-02-21 10:12   ` [PATCH v3 00/15] Mark "init", "clone", and "add" output for translation Jonathan Nieder
                       ` (5 preceding siblings ...)
  2011-02-21 10:17     ` [PATCH 06/15] init: mark "Initialized [...] repository" " Jonathan Nieder
@ 2011-02-21 10:18     ` Jonathan Nieder
  2011-02-21 10:18     ` [PATCH 08/15] clone: split "Cloning into" message into two Jonathan Nieder
                       ` (9 subsequent siblings)
  16 siblings, 0 replies; 222+ messages in thread
From: Jonathan Nieder @ 2011-02-21 10:18 UTC (permalink / raw)
  To: Ævar Arnfjörð Bjarmason; +Cc: git, Junio C Hamano

From: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Date: Wed, 1 Sep 2010 15:44:13 +0000

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
---
 builtin/clone.c |   54 +++++++++++++++++++++++++++---------------------------
 1 files changed, 27 insertions(+), 27 deletions(-)

diff --git a/builtin/clone.c b/builtin/clone.c
index 60d9a64..f46d09b 100644
--- a/builtin/clone.c
+++ b/builtin/clone.c
@@ -208,7 +208,7 @@ static void setup_reference(const char *repo)
 	if (is_directory(mkpath("%s/.git/objects", ref_git)))
 		ref_git = mkpath("%s/.git", ref_git);
 	else if (!is_directory(mkpath("%s/objects", ref_git)))
-		die("reference repository '%s' is not a local directory.",
+		die(_("reference repository '%s' is not a local directory."),
 		    option_reference);
 
 	ref_git_copy = xstrdup(ref_git);
@@ -235,15 +235,15 @@ static void copy_or_link_directory(struct strbuf *src, struct strbuf *dest)
 
 	dir = opendir(src->buf);
 	if (!dir)
-		die_errno("failed to open '%s'", src->buf);
+		die_errno(_("failed to open '%s'"), src->buf);
 
 	if (mkdir(dest->buf, 0777)) {
 		if (errno != EEXIST)
-			die_errno("failed to create directory '%s'", dest->buf);
+			die_errno(_("failed to create directory '%s'"), dest->buf);
 		else if (stat(dest->buf, &buf))
-			die_errno("failed to stat '%s'", dest->buf);
+			die_errno(_("failed to stat '%s'"), dest->buf);
 		else if (!S_ISDIR(buf.st_mode))
-			die("%s exists and is not a directory", dest->buf);
+			die(_("%s exists and is not a directory"), dest->buf);
 	}
 
 	strbuf_addch(src, '/');
@@ -257,7 +257,7 @@ static void copy_or_link_directory(struct strbuf *src, struct strbuf *dest)
 		strbuf_setlen(dest, dest_len);
 		strbuf_addstr(dest, de->d_name);
 		if (stat(src->buf, &buf)) {
-			warning ("failed to stat %s\n", src->buf);
+			warning (_("failed to stat %s\n"), src->buf);
 			continue;
 		}
 		if (S_ISDIR(buf.st_mode)) {
@@ -267,16 +267,16 @@ static void copy_or_link_directory(struct strbuf *src, struct strbuf *dest)
 		}
 
 		if (unlink(dest->buf) && errno != ENOENT)
-			die_errno("failed to unlink '%s'", dest->buf);
+			die_errno(_("failed to unlink '%s'"), dest->buf);
 		if (!option_no_hardlinks) {
 			if (!link(src->buf, dest->buf))
 				continue;
 			if (option_local)
-				die_errno("failed to create link '%s'", dest->buf);
+				die_errno(_("failed to create link '%s'"), dest->buf);
 			option_no_hardlinks = 1;
 		}
 		if (copy_file_with_time(dest->buf, src->buf, 0666))
-			die_errno("failed to copy file to '%s'", dest->buf);
+			die_errno(_("failed to copy file to '%s'"), dest->buf);
 	}
 	closedir(dir);
 }
@@ -305,7 +305,7 @@ static const struct ref *clone_local(const char *src_repo,
 	ret = transport_get_remote_refs(transport);
 	transport_disconnect(transport);
 	if (0 <= option_verbosity)
-		printf("done.\n");
+		printf(_("done.\n"));
 	return ret;
 }
 
@@ -387,11 +387,11 @@ int cmd_clone(int argc, const char **argv, const char *prefix)
 			     builtin_clone_usage, 0);
 
 	if (argc > 2)
-		usage_msg_opt("Too many arguments.",
+		usage_msg_opt(_("Too many arguments."),
 			builtin_clone_usage, builtin_clone_options);
 
 	if (argc == 0)
-		usage_msg_opt("You must specify a repository to clone.",
+		usage_msg_opt(_("You must specify a repository to clone."),
 			builtin_clone_usage, builtin_clone_options);
 
 	if (option_mirror)
@@ -399,7 +399,7 @@ int cmd_clone(int argc, const char **argv, const char *prefix)
 
 	if (option_bare) {
 		if (option_origin)
-			die("--bare and --origin %s options are incompatible.",
+			die(_("--bare and --origin %s options are incompatible."),
 			    option_origin);
 		option_no_checkout = 1;
 	}
@@ -418,7 +418,7 @@ int cmd_clone(int argc, const char **argv, const char *prefix)
 		repo = repo_name;
 	is_local = path && !is_bundle;
 	if (is_local && option_depth)
-		warning("--depth is ignored in local clones; use file:// instead.");
+		warning(_("--depth is ignored in local clones; use file:// instead."));
 
 	if (argc == 2)
 		dir = xstrdup(argv[1]);
@@ -428,8 +428,8 @@ int cmd_clone(int argc, const char **argv, const char *prefix)
 
 	dest_exists = !stat(dir, &buf);
 	if (dest_exists && !is_empty_dir(dir))
-		die("destination path '%s' already exists and is not "
-			"an empty directory.", dir);
+		die(_("destination path '%s' already exists and is not "
+			"an empty directory."), dir);
 
 	strbuf_addf(&reflog_msg, "clone: from %s", repo);
 
@@ -438,7 +438,7 @@ int cmd_clone(int argc, const char **argv, const char *prefix)
 	else {
 		work_tree = getenv("GIT_WORK_TREE");
 		if (work_tree && !stat(work_tree, &buf))
-			die("working tree '%s' already exists.", work_tree);
+			die(_("working tree '%s' already exists."), work_tree);
 	}
 
 	if (option_bare || work_tree)
@@ -451,10 +451,10 @@ int cmd_clone(int argc, const char **argv, const char *prefix)
 	if (!option_bare) {
 		junk_work_tree = work_tree;
 		if (safe_create_leading_directories_const(work_tree) < 0)
-			die_errno("could not create leading directories of '%s'",
+			die_errno(_("could not create leading directories of '%s'"),
 				  work_tree);
 		if (!dest_exists && mkdir(work_tree, 0755))
-			die_errno("could not create work tree dir '%s'.",
+			die_errno(_("could not create work tree dir '%s'."),
 				  work_tree);
 		set_git_work_tree(work_tree);
 	}
@@ -465,7 +465,7 @@ int cmd_clone(int argc, const char **argv, const char *prefix)
 	setenv(CONFIG_ENVIRONMENT, mkpath("%s/config", git_dir), 1);
 
 	if (safe_create_leading_directories_const(git_dir) < 0)
-		die("could not create leading directories of '%s'", git_dir);
+		die(_("could not create leading directories of '%s'"), git_dir);
 	set_git_dir(make_absolute_path(git_dir));
 
 	if (0 <= option_verbosity)
@@ -527,7 +527,7 @@ int cmd_clone(int argc, const char **argv, const char *prefix)
 		transport = transport_get(remote, remote->url[0]);
 
 		if (!transport->get_refs_list || !transport->fetch)
-			die("Don't know how to clone %s", transport->url);
+			die(_("Don't know how to clone %s"), transport->url);
 
 		transport_set_option(transport, TRANS_OPT_KEEP, "yes");
 
@@ -566,8 +566,8 @@ int cmd_clone(int argc, const char **argv, const char *prefix)
 			strbuf_release(&head);
 
 			if (!our_head_points_at) {
-				warning("Remote branch %s not found in "
-					"upstream %s, using HEAD instead",
+				warning(_("Remote branch %s not found in "
+					"upstream %s, using HEAD instead"),
 					option_branch, option_origin);
 				our_head_points_at = remote_head_points_at;
 			}
@@ -576,7 +576,7 @@ int cmd_clone(int argc, const char **argv, const char *prefix)
 			our_head_points_at = remote_head_points_at;
 	}
 	else {
-		warning("You appear to have cloned an empty repository.");
+		warning(_("You appear to have cloned an empty repository."));
 		our_head_points_at = NULL;
 		remote_head_points_at = NULL;
 		remote_head = NULL;
@@ -618,8 +618,8 @@ int cmd_clone(int argc, const char **argv, const char *prefix)
 	} else {
 		/* Nothing to checkout out */
 		if (!option_no_checkout)
-			warning("remote HEAD refers to nonexistent ref, "
-				"unable to checkout.\n");
+			warning(_("remote HEAD refers to nonexistent ref, "
+				"unable to checkout.\n"));
 		option_no_checkout = 1;
 	}
 
@@ -655,7 +655,7 @@ int cmd_clone(int argc, const char **argv, const char *prefix)
 
 		if (write_cache(fd, active_cache, active_nr) ||
 		    commit_locked_index(lock_file))
-			die("unable to write new index file");
+			die(_("unable to write new index file"));
 
 		err |= run_hook(NULL, "post-checkout", sha1_to_hex(null_sha1),
 				sha1_to_hex(our_head_points_at->old_sha1), "1",
-- 
1.7.4.1

^ permalink raw reply related	[flat|nested] 222+ messages in thread

* [PATCH 08/15] clone: split "Cloning into" message into two
  2011-02-21 10:12   ` [PATCH v3 00/15] Mark "init", "clone", and "add" output for translation Jonathan Nieder
                       ` (6 preceding siblings ...)
  2011-02-21 10:18     ` [PATCH 07/15] clone: mark basic messages " Jonathan Nieder
@ 2011-02-21 10:18     ` Jonathan Nieder
  2011-02-21 10:19     ` [PATCH 09/15] clone: mark "Cloning into" message for translation Jonathan Nieder
                       ` (8 subsequent siblings)
  16 siblings, 0 replies; 222+ messages in thread
From: Jonathan Nieder @ 2011-02-21 10:18 UTC (permalink / raw)
  To: Ævar Arnfjörð Bjarmason; +Cc: git, Junio C Hamano

From: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Date: Wed, 1 Sep 2010 15:54:30 +0000

Separate the "Cloning into %s" and "Cloning into bare repository %s"
messages to make them easier to translate.  No noticeable change
intended.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
---
 builtin/clone.c |    9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/builtin/clone.c b/builtin/clone.c
index f46d09b..db0240d 100644
--- a/builtin/clone.c
+++ b/builtin/clone.c
@@ -468,9 +468,12 @@ int cmd_clone(int argc, const char **argv, const char *prefix)
 		die(_("could not create leading directories of '%s'"), git_dir);
 	set_git_dir(make_absolute_path(git_dir));
 
-	if (0 <= option_verbosity)
-		printf("Cloning into %s%s...\n",
-		       option_bare ? "bare repository " : "", dir);
+	if (0 <= option_verbosity) {
+		if (option_bare)
+			printf("Cloning into bare repository %s...\n", dir);
+		else
+			printf("Cloning into %s...\n", dir);
+	}
 	init_db(option_template, INIT_DB_QUIET);
 
 	/*
-- 
1.7.4.1

^ permalink raw reply related	[flat|nested] 222+ messages in thread

* [PATCH 09/15] clone: mark "Cloning into" message for translation
  2011-02-21 10:12   ` [PATCH v3 00/15] Mark "init", "clone", and "add" output for translation Jonathan Nieder
                       ` (7 preceding siblings ...)
  2011-02-21 10:18     ` [PATCH 08/15] clone: split "Cloning into" message into two Jonathan Nieder
@ 2011-02-21 10:19     ` Jonathan Nieder
  2011-02-21 10:24     ` [PATCH 10/15] add: mark basic messages " Jonathan Nieder
                       ` (7 subsequent siblings)
  16 siblings, 0 replies; 222+ messages in thread
From: Jonathan Nieder @ 2011-02-21 10:19 UTC (permalink / raw)
  To: Ævar Arnfjörð Bjarmason; +Cc: git, Junio C Hamano

From: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Date: Wed, 1 Sep 2010 15:54:30 +0000

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
---
 builtin/clone.c  |    4 ++--
 t/t5601-clone.sh |    2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/builtin/clone.c b/builtin/clone.c
index db0240d..b9394c4 100644
--- a/builtin/clone.c
+++ b/builtin/clone.c
@@ -470,9 +470,9 @@ int cmd_clone(int argc, const char **argv, const char *prefix)
 
 	if (0 <= option_verbosity) {
 		if (option_bare)
-			printf("Cloning into bare repository %s...\n", dir);
+			printf(_("Cloning into bare repository %s...\n"), dir);
 		else
-			printf("Cloning into %s...\n", dir);
+			printf(_("Cloning into %s...\n"), dir);
 	}
 	init_db(option_template, INIT_DB_QUIET);
 
diff --git a/t/t5601-clone.sh b/t/t5601-clone.sh
index 987e0c8..9e6fa3b 100755
--- a/t/t5601-clone.sh
+++ b/t/t5601-clone.sh
@@ -31,7 +31,7 @@ test_expect_success 'clone with excess parameters (2)' '
 
 '
 
-test_expect_success 'output from clone' '
+test_expect_success C_LOCALE_OUTPUT 'output from clone' '
 	rm -fr dst &&
 	git clone -n "file://$(pwd)/src" dst >output &&
 	test $(grep Clon output | wc -l) = 1
-- 
1.7.4.1

^ permalink raw reply related	[flat|nested] 222+ messages in thread

* [PATCH 10/15] add: mark basic messages for translation
  2011-02-21 10:12   ` [PATCH v3 00/15] Mark "init", "clone", and "add" output for translation Jonathan Nieder
                       ` (8 preceding siblings ...)
  2011-02-21 10:19     ` [PATCH 09/15] clone: mark "Cloning into" message for translation Jonathan Nieder
@ 2011-02-21 10:24     ` Jonathan Nieder
  2011-02-21 10:25     ` [PATCH 11/15] add: mark "The following paths are ignored" " Jonathan Nieder
                       ` (6 subsequent siblings)
  16 siblings, 0 replies; 222+ messages in thread
From: Jonathan Nieder @ 2011-02-21 10:24 UTC (permalink / raw)
  To: Ævar Arnfjörð Bjarmason; +Cc: git, Junio C Hamano

From: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Date: Wed, 1 Sep 2010 18:40:13 +0000

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
---
 builtin/add.c |   36 ++++++++++++++++++------------------
 1 files changed, 18 insertions(+), 18 deletions(-)

diff --git a/builtin/add.c b/builtin/add.c
index 42c906e..a9a78f4 100644
--- a/builtin/add.c
+++ b/builtin/add.c
@@ -38,7 +38,7 @@ static void update_callback(struct diff_queue_struct *q,
 		const char *path = p->one->path;
 		switch (p->status) {
 		default:
-			die("unexpected diff status %c", p->status);
+			die(_("unexpected diff status %c"), p->status);
 		case DIFF_STATUS_UNMERGED:
 			/*
 			 * ADD_CACHE_IGNORE_REMOVAL is unset if "git
@@ -64,7 +64,7 @@ static void update_callback(struct diff_queue_struct *q,
 		case DIFF_STATUS_TYPE_CHANGED:
 			if (add_file_to_index(&the_index, path, data->flags)) {
 				if (!(data->flags & ADD_CACHE_IGNORE_ERRORS))
-					die("updating files failed");
+					die(_("updating files failed"));
 				data->add_errors++;
 			}
 			break;
@@ -172,7 +172,7 @@ static void treat_gitlinks(const char **pathspec)
 					/* strip trailing slash */
 					pathspec[j] = xstrndup(ce->name, len);
 				else
-					die ("Path '%s' is in submodule '%.*s'",
+					die (_("Path '%s' is in submodule '%.*s'"),
 						pathspec[j], len, ce->name);
 			}
 		}
@@ -191,7 +191,7 @@ static void refresh(int verbose, const char **pathspec)
 		      pathspec, seen, "Unstaged changes after refreshing the index:");
 	for (i = 0; i < specs; i++) {
 		if (!seen[i])
-			die("pathspec '%s' did not match any files", pathspec[i]);
+			die(_("pathspec '%s' did not match any files"), pathspec[i]);
 	}
         free(seen);
 }
@@ -205,7 +205,7 @@ static const char **validate_pathspec(int argc, const char **argv, const char *p
 		for (p = pathspec; *p; p++) {
 			if (has_symlink_leading_path(*p, strlen(*p))) {
 				int len = prefix ? strlen(prefix) : 0;
-				die("'%s' is beyond a symbolic link", *p + len);
+				die(_("'%s' is beyond a symbolic link"), *p + len);
 			}
 		}
 	}
@@ -272,7 +272,7 @@ static int edit_patch(int argc, const char **argv, const char *prefix)
 	git_config(git_diff_basic_config, NULL); /* no "diff" UI options */
 
 	if (read_cache() < 0)
-		die ("Could not read the index");
+		die (_("Could not read the index"));
 
 	init_revisions(&rev, prefix);
 	rev.diffopt.context = 7;
@@ -281,24 +281,24 @@ static int edit_patch(int argc, const char **argv, const char *prefix)
 	rev.diffopt.output_format = DIFF_FORMAT_PATCH;
 	out = open(file, O_CREAT | O_WRONLY, 0644);
 	if (out < 0)
-		die ("Could not open '%s' for writing.", file);
+		die (_("Could not open '%s' for writing."), file);
 	rev.diffopt.file = xfdopen(out, "w");
 	rev.diffopt.close_file = 1;
 	if (run_diff_files(&rev, 0))
-		die ("Could not write patch");
+		die (_("Could not write patch"));
 
 	launch_editor(file, NULL, NULL);
 
 	if (stat(file, &st))
-		die_errno("Could not stat '%s'", file);
+		die_errno(_("Could not stat '%s'"), file);
 	if (!st.st_size)
-		die("Empty patch. Aborted.");
+		die(_("Empty patch. Aborted."));
 
 	memset(&child, 0, sizeof(child));
 	child.git_cmd = 1;
 	child.argv = apply_argv;
 	if (run_command(&child))
-		die ("Could not apply '%s'", file);
+		die (_("Could not apply '%s'"), file);
 
 	unlink(file);
 	return 0;
@@ -354,7 +354,7 @@ static int add_files(struct dir_struct *dir, int flags)
 	for (i = 0; i < dir->nr; i++)
 		if (add_file_to_cache(dir->entries[i]->name, flags)) {
 			if (!ignore_add_errors)
-				die("adding files failed");
+				die(_("adding files failed"));
 			exit_status = 1;
 		}
 	return exit_status;
@@ -386,9 +386,9 @@ int cmd_add(int argc, const char **argv, const char *prefix)
 	argv++;
 
 	if (addremove && take_worktree_changes)
-		die("-A and -u are mutually incompatible");
+		die(_("-A and -u are mutually incompatible"));
 	if (!show_only && ignore_missing)
-		die("Option --ignore-missing can only be used together with --dry-run");
+		die(_("Option --ignore-missing can only be used together with --dry-run"));
 	if ((addremove || take_worktree_changes) && !argc) {
 		static const char *here[2] = { ".", NULL };
 		argc = 1;
@@ -408,14 +408,14 @@ int cmd_add(int argc, const char **argv, const char *prefix)
 		  ? ADD_CACHE_IGNORE_REMOVAL : 0));
 
 	if (require_pathspec && argc == 0) {
-		fprintf(stderr, "Nothing specified, nothing added.\n");
-		fprintf(stderr, "Maybe you wanted to say 'git add .'?\n");
+		fprintf(stderr, _("Nothing specified, nothing added.\n"));
+		fprintf(stderr, _("Maybe you wanted to say 'git add .'?\n"));
 		return 0;
 	}
 	pathspec = validate_pathspec(argc, argv, prefix);
 
 	if (read_cache() < 0)
-		die("index file corrupt");
+		die(_("index file corrupt"));
 	treat_gitlinks(pathspec);
 
 	if (add_new_files) {
@@ -467,7 +467,7 @@ int cmd_add(int argc, const char **argv, const char *prefix)
 	if (active_cache_changed) {
 		if (write_cache(newfd, active_cache, active_nr) ||
 		    commit_locked_index(&lock_file))
-			die("Unable to write new index file");
+			die(_("Unable to write new index file"));
 	}
 
 	return exit_status;
-- 
1.7.4.1

^ permalink raw reply related	[flat|nested] 222+ messages in thread

* [PATCH 11/15] add: mark "The following paths are ignored" for translation
  2011-02-21 10:12   ` [PATCH v3 00/15] Mark "init", "clone", and "add" output for translation Jonathan Nieder
                       ` (9 preceding siblings ...)
  2011-02-21 10:24     ` [PATCH 10/15] add: mark basic messages " Jonathan Nieder
@ 2011-02-21 10:25     ` Jonathan Nieder
  2011-02-21 10:25     ` [PATCH 12/15] add: mark "did not match any files" " Jonathan Nieder
                       ` (5 subsequent siblings)
  16 siblings, 0 replies; 222+ messages in thread
From: Jonathan Nieder @ 2011-02-21 10:25 UTC (permalink / raw)
  To: Ævar Arnfjörð Bjarmason; +Cc: git, Junio C Hamano

From: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Date: Wed, 22 Sep 2010 19:20:25 +0000

t2204 (.gitignore) and t3700 (add) explicitly check this sequence of
messages, so while at it, split each relevant test into a part that
just checks "git add"'s exit status and a part that checks porcelain
output.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
---
 builtin/add.c          |    8 ++++----
 t/t2204-add-ignored.sh |   37 +++++++++++++++++++++++++------------
 t/t3700-add.sh         |    5 ++++-
 3 files changed, 33 insertions(+), 17 deletions(-)

diff --git a/builtin/add.c b/builtin/add.c
index a9a78f4..21776ac 100644
--- a/builtin/add.c
+++ b/builtin/add.c
@@ -307,7 +307,7 @@ static int edit_patch(int argc, const char **argv, const char *prefix)
 static struct lock_file lock_file;
 
 static const char ignore_error[] =
-"The following paths are ignored by one of your .gitignore files:\n";
+N_("The following paths are ignored by one of your .gitignore files:\n");
 
 static int verbose = 0, show_only = 0, ignored_too = 0, refresh_only = 0;
 static int ignore_add_errors, addremove, intent_to_add, ignore_missing = 0;
@@ -344,11 +344,11 @@ static int add_files(struct dir_struct *dir, int flags)
 	int i, exit_status = 0;
 
 	if (dir->ignored_nr) {
-		fprintf(stderr, ignore_error);
+		fprintf(stderr, _(ignore_error));
 		for (i = 0; i < dir->ignored_nr; i++)
 			fprintf(stderr, "%s\n", dir->ignored[i]->name);
-		fprintf(stderr, "Use -f if you really want to add them.\n");
-		die("no files added");
+		fprintf(stderr, _("Use -f if you really want to add them.\n"));
+		die(_("no files added"));
 	}
 
 	for (i = 0; i < dir->nr; i++)
diff --git a/t/t2204-add-ignored.sh b/t/t2204-add-ignored.sh
index 24afdab..4975336 100755
--- a/t/t2204-add-ignored.sh
+++ b/t/t2204-add-ignored.sh
@@ -31,18 +31,21 @@ do
 		rm -f .git/index &&
 		test_must_fail git add "$i" 2>err &&
 		git ls-files "$i" >out &&
-		! test -s out &&
-		grep -e "Use -f if" err &&
-		cat err
+		! test -s out
+	'
+
+	test_expect_success C_LOCALE_OUTPUT "complaints for ignored $i output" '
+		grep -e "Use -f if" err
 	'
 
 	test_expect_success "complaints for ignored $i with unignored file" '
 		rm -f .git/index &&
 		test_must_fail git add "$i" file 2>err &&
 		git ls-files "$i" >out &&
-		! test -s out &&
-		grep -e "Use -f if" err &&
-		cat err
+		! test -s out
+	'
+	test_expect_success C_LOCALE_OUTPUT "complaints for ignored $i with unignored file output" '
+		grep -e "Use -f if" err
 	'
 done
 
@@ -54,9 +57,14 @@ do
 			cd dir &&
 			test_must_fail git add "$i" 2>err &&
 			git ls-files "$i" >out &&
-			! test -s out &&
-			grep -e "Use -f if" err &&
-			cat err
+			! test -s out
+		)
+	'
+
+	test_expect_success C_LOCALE_OUTPUT "complaints for ignored $i in dir output" '
+		(
+			cd dir &&
+			grep -e "Use -f if" err
 		)
 	'
 done
@@ -69,9 +77,14 @@ do
 			cd sub &&
 			test_must_fail git add "$i" 2>err &&
 			git ls-files "$i" >out &&
-			! test -s out &&
-			grep -e "Use -f if" err &&
-			cat err
+			! test -s out
+		)
+	'
+
+	test_expect_success C_LOCALE_OUTPUT "complaints for ignored $i in sub output" '
+		(
+			cd sub &&
+			grep -e "Use -f if" err
 		)
 	'
 done
diff --git a/t/t3700-add.sh b/t/t3700-add.sh
index ec71083..ac115ed 100755
--- a/t/t3700-add.sh
+++ b/t/t3700-add.sh
@@ -283,7 +283,10 @@ add 'track-this'
 EOF
 
 test_expect_success 'git add --dry-run --ignore-missing of non-existing file' '
-	test_must_fail git add --dry-run --ignore-missing track-this ignored-file >actual.out 2>actual.err &&
+	test_must_fail git add --dry-run --ignore-missing track-this ignored-file >actual.out 2>actual.err
+'
+
+test_expect_success C_LOCALE_OUTPUT 'git add --dry-run --ignore-missing of non-existing file output' '
 	test_cmp expect.out actual.out &&
 	test_cmp expect.err actual.err
 '
-- 
1.7.4.1

^ permalink raw reply related	[flat|nested] 222+ messages in thread

* [PATCH 12/15] add: mark "did not match any files" for translation
  2011-02-21 10:12   ` [PATCH v3 00/15] Mark "init", "clone", and "add" output for translation Jonathan Nieder
                       ` (10 preceding siblings ...)
  2011-02-21 10:25     ` [PATCH 11/15] add: mark "The following paths are ignored" " Jonathan Nieder
@ 2011-02-21 10:25     ` Jonathan Nieder
  2011-02-21 10:26     ` [PATCH 13/15] add -u --verbose: mark "remove '%s'" " Jonathan Nieder
                       ` (4 subsequent siblings)
  16 siblings, 0 replies; 222+ messages in thread
From: Jonathan Nieder @ 2011-02-21 10:25 UTC (permalink / raw)
  To: Ævar Arnfjörð Bjarmason; +Cc: git, Junio C Hamano

From: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Date: Sun, 19 Sep 2010 15:48:06 +0000

... and skip the test that checks for it when the C_LOCALE_OUTPUT
prereq is not present.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
---
 builtin/add.c  |    2 +-
 t/t3700-add.sh |    8 ++++++--
 2 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/builtin/add.c b/builtin/add.c
index 21776ac..ffbd459 100644
--- a/builtin/add.c
+++ b/builtin/add.c
@@ -451,7 +451,7 @@ int cmd_add(int argc, const char **argv, const char *prefix)
 					if (excluded(&dir, pathspec[i], &dtype))
 						dir_add_ignored(&dir, pathspec[i], strlen(pathspec[i]));
 				} else
-					die("pathspec '%s' did not match any files",
+					die(_("pathspec '%s' did not match any files"),
 					    pathspec[i]);
 			}
 		}
diff --git a/t/t3700-add.sh b/t/t3700-add.sh
index ac115ed..7de42fa 100755
--- a/t/t3700-add.sh
+++ b/t/t3700-add.sh
@@ -268,8 +268,12 @@ test_expect_success 'git add --dry-run of existing changed file' "
 
 test_expect_success 'git add --dry-run of non-existing file' "
 	echo ignored-file >>.gitignore &&
-	test_must_fail git add --dry-run track-this ignored-file >actual 2>&1 &&
-	echo \"fatal: pathspec 'ignored-file' did not match any files\" | test_cmp - actual
+	test_must_fail git add --dry-run track-this ignored-file >actual 2>&1
+"
+
+test_expect_success C_LOCALE_OUTPUT 'git add --dry-run of an existing file output' "
+	echo \"fatal: pathspec 'ignored-file' did not match any files\" >expect &&
+	test_cmp expect actual
 "
 
 cat >expect.err <<\EOF
-- 
1.7.4.1

^ permalink raw reply related	[flat|nested] 222+ messages in thread

* [PATCH 13/15] add -u --verbose: mark "remove '%s'" for translation
  2011-02-21 10:12   ` [PATCH v3 00/15] Mark "init", "clone", and "add" output for translation Jonathan Nieder
                       ` (11 preceding siblings ...)
  2011-02-21 10:25     ` [PATCH 12/15] add: mark "did not match any files" " Jonathan Nieder
@ 2011-02-21 10:26     ` Jonathan Nieder
  2011-02-21 10:26     ` [PATCH 14/15] update-index --refresh --porcelain: add missing const Jonathan Nieder
                       ` (3 subsequent siblings)
  16 siblings, 0 replies; 222+ messages in thread
From: Jonathan Nieder @ 2011-02-21 10:26 UTC (permalink / raw)
  To: Ævar Arnfjörð Bjarmason; +Cc: git, Junio C Hamano

From: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Date: Sun, 19 Sep 2010 14:48:59 +0000

... and skip the corresponding test when output is not in the
C locale.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
---
 builtin/add.c         |    2 +-
 t/t2200-add-update.sh |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/builtin/add.c b/builtin/add.c
index ffbd459..33b9970 100644
--- a/builtin/add.c
+++ b/builtin/add.c
@@ -74,7 +74,7 @@ static void update_callback(struct diff_queue_struct *q,
 			if (!(data->flags & ADD_CACHE_PRETEND))
 				remove_file_from_index(&the_index, path);
 			if (data->flags & (ADD_CACHE_PRETEND|ADD_CACHE_VERBOSE))
-				printf("remove '%s'\n", path);
+				printf(_("remove '%s'\n"), path);
 			break;
 		}
 	}
diff --git a/t/t2200-add-update.sh b/t/t2200-add-update.sh
index 0692427..856e7da 100755
--- a/t/t2200-add-update.sh
+++ b/t/t2200-add-update.sh
@@ -111,7 +111,7 @@ test_expect_success 'touch and then add explicitly' '
 
 '
 
-test_expect_success 'add -n -u should not add but just report' '
+test_expect_success C_LOCALE_OUTPUT 'add -n -u should not add but just report' '
 
 	(
 		echo "add '\''check'\''" &&
-- 
1.7.4.1

^ permalink raw reply related	[flat|nested] 222+ messages in thread

* [PATCH 14/15] update-index --refresh --porcelain: add missing const
  2011-02-21 10:12   ` [PATCH v3 00/15] Mark "init", "clone", and "add" output for translation Jonathan Nieder
                       ` (12 preceding siblings ...)
  2011-02-21 10:26     ` [PATCH 13/15] add -u --verbose: mark "remove '%s'" " Jonathan Nieder
@ 2011-02-21 10:26     ` Jonathan Nieder
  2011-02-21 10:29     ` [PATCH 15/15] add --refresh --verbose: mark "Unstaged changes" heading for translation Jonathan Nieder
                       ` (2 subsequent siblings)
  16 siblings, 0 replies; 222+ messages in thread
From: Jonathan Nieder @ 2011-02-21 10:26 UTC (permalink / raw)
  To: Ævar Arnfjörð Bjarmason; +Cc: git, Junio C Hamano

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
---
 cache.h      |    2 +-
 read-cache.c |    4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/cache.h b/cache.h
index a465f38..8188169 100644
--- a/cache.h
+++ b/cache.h
@@ -512,7 +512,7 @@ extern void fill_stat_cache_info(struct cache_entry *ce, struct stat *st);
 #define REFRESH_IGNORE_MISSING	0x0008	/* ignore non-existent */
 #define REFRESH_IGNORE_SUBMODULES	0x0010	/* ignore submodules */
 #define REFRESH_IN_PORCELAIN	0x0020	/* user friendly output, not "needs update" */
-extern int refresh_index(struct index_state *, unsigned int flags, const char **pathspec, char *seen, char *header_msg);
+extern int refresh_index(struct index_state *, unsigned int flags, const char **pathspec, char *seen, const char *header_msg);
 
 struct lock_file {
 	struct lock_file *next;
diff --git a/read-cache.c b/read-cache.c
index 4f2e890..15b0a73 100644
--- a/read-cache.c
+++ b/read-cache.c
@@ -1104,7 +1104,7 @@ static struct cache_entry *refresh_cache_ent(struct index_state *istate,
 }
 
 static void show_file(const char * fmt, const char * name, int in_porcelain,
-		      int * first, char *header_msg)
+		      int * first, const char *header_msg)
 {
 	if (in_porcelain && *first && header_msg) {
 		printf("%s\n", header_msg);
@@ -1114,7 +1114,7 @@ static void show_file(const char * fmt, const char * name, int in_porcelain,
 }
 
 int refresh_index(struct index_state *istate, unsigned int flags, const char **pathspec,
-		  char *seen, char *header_msg)
+		  char *seen, const char *header_msg)
 {
 	int i;
 	int has_errors = 0;
-- 
1.7.4.1

^ permalink raw reply related	[flat|nested] 222+ messages in thread

* [PATCH 15/15] add --refresh --verbose: mark "Unstaged changes" heading for translation
  2011-02-21 10:12   ` [PATCH v3 00/15] Mark "init", "clone", and "add" output for translation Jonathan Nieder
                       ` (13 preceding siblings ...)
  2011-02-21 10:26     ` [PATCH 14/15] update-index --refresh --porcelain: add missing const Jonathan Nieder
@ 2011-02-21 10:29     ` Jonathan Nieder
  2011-02-21 12:38     ` [PATCH v3 00/15] Mark "init", "clone", and "add" output " Ævar Arnfjörð Bjarmason
  2011-02-22 18:11     ` Junio C Hamano
  16 siblings, 0 replies; 222+ messages in thread
From: Jonathan Nieder @ 2011-02-21 10:29 UTC (permalink / raw)
  To: Ævar Arnfjörð Bjarmason; +Cc: git, Junio C Hamano

From: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Date: Wed, 1 Sep 2010 18:49:22 +0000

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
---
That's the end of the series.  Thanks for reading.

I also should say, to be clear, I will not be sending more series like
this (though if there are bugs in this one I'd be happy to fix them).

 builtin/add.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/builtin/add.c b/builtin/add.c
index 33b9970..a512597 100644
--- a/builtin/add.c
+++ b/builtin/add.c
@@ -188,7 +188,7 @@ static void refresh(int verbose, const char **pathspec)
 		/* nothing */;
 	seen = xcalloc(specs, 1);
 	refresh_index(&the_index, verbose ? REFRESH_IN_PORCELAIN : REFRESH_QUIET,
-		      pathspec, seen, "Unstaged changes after refreshing the index:");
+		      pathspec, seen, _("Unstaged changes after refreshing the index:"));
 	for (i = 0; i < specs; i++) {
 		if (!seen[i])
 			die(_("pathspec '%s' did not match any files"), pathspec[i]);
-- 
1.7.4.1

^ permalink raw reply related	[flat|nested] 222+ messages in thread

* Re: [PATCH 04/15] Makefile: "pot" target to extract messages marked for translation
  2011-02-21 10:15     ` [PATCH 04/15] Makefile: "pot" target to extract messages marked for translation Jonathan Nieder
@ 2011-02-21 12:35       ` Ævar Arnfjörð Bjarmason
  2011-02-21 13:05         ` Jonathan Nieder
  0 siblings, 1 reply; 222+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2011-02-21 12:35 UTC (permalink / raw)
  To: Jonathan Nieder; +Cc: git, Junio C Hamano

On Mon, Feb 21, 2011 at 11:15, Jonathan Nieder <jrnieder@gmail.com> wrote:
> From: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
> Date: Tue, 31 Aug 2010 16:35:16 +0000
>
> Add rules to generate a template (po/git.pot) listing messages marked
> for translation in the C portion of git.

Can we please not apply this? I have a series of patches for this that
I'm submitting later, it's easier for me if don't have conflicts with
stuff like this.

I don't think it's a big deal that we have _() C translations in the
source for some time without the capability to generate POT files from
them.

^ permalink raw reply	[flat|nested] 222+ messages in thread

* Re: [PATCH v3 00/15] Mark "init", "clone", and "add" output for translation
  2011-02-21 10:12   ` [PATCH v3 00/15] Mark "init", "clone", and "add" output for translation Jonathan Nieder
                       ` (14 preceding siblings ...)
  2011-02-21 10:29     ` [PATCH 15/15] add --refresh --verbose: mark "Unstaged changes" heading for translation Jonathan Nieder
@ 2011-02-21 12:38     ` Ævar Arnfjörð Bjarmason
  2011-02-22  7:36       ` Junio C Hamano
  2011-02-22 18:11     ` Junio C Hamano
  16 siblings, 1 reply; 222+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2011-02-21 12:38 UTC (permalink / raw)
  To: Jonathan Nieder; +Cc: git, Junio C Hamano

On Mon, Feb 21, 2011 at 11:12, Jonathan Nieder <jrnieder@gmail.com> wrote:
> Please feel free to try it out, complain, ack, send patches, and so
> on.

Thanks a lot for taking this on.

^ permalink raw reply	[flat|nested] 222+ messages in thread

* Re: [PATCH 02/15] tests: add GETTEXT_POISON to simulate unfriendly translator
  2011-02-21 10:13     ` [PATCH 02/15] tests: add GETTEXT_POISON to simulate unfriendly translator Jonathan Nieder
@ 2011-02-21 12:41       ` Ævar Arnfjörð Bjarmason
  2011-02-21 12:58         ` Jonathan Nieder
  0 siblings, 1 reply; 222+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2011-02-21 12:41 UTC (permalink / raw)
  To: Jonathan Nieder; +Cc: git, Junio C Hamano

On Mon, Feb 21, 2011 at 11:13, Jonathan Nieder <jrnieder@gmail.com> wrote:

>  static inline FORMAT_PRESERVING(1) const char *_(const char *msgid)
>  {
> -       return msgid;
> +       return use_poison() ? "Malkovich" : msgid;
>  }

Why did you change this from "# GETTEXT POISON #" to "Malkovich"?

The reason it started with a "#" is because many rebase tests were
broken otherwise.

The reason it was in all caps was so that when I run the tests in
debug mode it's really easy to see at a glance if I'm encountering
these strings.

Do those tests still pass with this new string, and is there any
reason to change this?

^ permalink raw reply	[flat|nested] 222+ messages in thread

* Re: [PATCH 02/15] tests: add GETTEXT_POISON to simulate unfriendly translator
  2011-02-21 12:41       ` Ævar Arnfjörð Bjarmason
@ 2011-02-21 12:58         ` Jonathan Nieder
  0 siblings, 0 replies; 222+ messages in thread
From: Jonathan Nieder @ 2011-02-21 12:58 UTC (permalink / raw)
  To: Ævar Arnfjörð Bjarmason; +Cc: git, Junio C Hamano

Hi Ævar,

Ævar Arnfjörð Bjarmason wrote:

> Why did you change this from "# GETTEXT POISON #" to "Malkovich"?

I forgot to mention that change in the cover letter --- thanks for a
reminder.

> Do those tests still pass with this new string, and is there any
> reason to change this?

Yes, all the tests in this series still pass (on this machine, at
least).  Which is why I changed it --- it is a lot easier to explain
having the '#' at the beginning and end of a magic string as part of a
patch that would break tests without that change.

Of course the specific string is arbitrary.  All caps sounds fine to
me, too.

Hope that helps,
Jonathan

^ permalink raw reply	[flat|nested] 222+ messages in thread

* Re: [PATCH 04/15] Makefile: "pot" target to extract messages marked for translation
  2011-02-21 12:35       ` Ævar Arnfjörð Bjarmason
@ 2011-02-21 13:05         ` Jonathan Nieder
  2011-02-21 13:14           ` Ævar Arnfjörð Bjarmason
  0 siblings, 1 reply; 222+ messages in thread
From: Jonathan Nieder @ 2011-02-21 13:05 UTC (permalink / raw)
  To: Ævar Arnfjörð Bjarmason; +Cc: git, Junio C Hamano

Ævar Arnfjörð Bjarmason wrote:
> On Mon, Feb 21, 2011 at 11:15, Jonathan Nieder <jrnieder@gmail.com> wrote:

>> Add rules to generate a template (po/git.pot) listing messages marked
>> for translation in the C portion of git.
>
> Can we please not apply this?

I included it in the series because I used it to test, for what it's
worth.

I also think it could be useful to translators, so they could work
against git.git directly once it has enough translatable strings.
That sounds valuable to me.

But I have no strong preference about what actually gets applied to
git.git in this case.

^ permalink raw reply	[flat|nested] 222+ messages in thread

* Re: [PATCH 04/15] Makefile: "pot" target to extract messages marked for translation
  2011-02-21 13:05         ` Jonathan Nieder
@ 2011-02-21 13:14           ` Ævar Arnfjörð Bjarmason
  0 siblings, 0 replies; 222+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2011-02-21 13:14 UTC (permalink / raw)
  To: Jonathan Nieder; +Cc: git, Junio C Hamano

On Mon, Feb 21, 2011 at 14:05, Jonathan Nieder <jrnieder@gmail.com> wrote:
> Ævar Arnfjörð Bjarmason wrote:
>> On Mon, Feb 21, 2011 at 11:15, Jonathan Nieder <jrnieder@gmail.com> wrote:
>
>>> Add rules to generate a template (po/git.pot) listing messages marked
>>> for translation in the C portion of git.
>>
>> Can we please not apply this?
>
> I included it in the series because I used it to test, for what it's
> worth.
>
> I also think it could be useful to translators, so they could work
> against git.git directly once it has enough translatable strings.
> That sounds valuable to me.

Yeah it's valuable, but I'm just optimizing this for the time I can
spent on it, I already have a patch series that has these things. It's
much easier if I can:

 1. Apply C translations
 2. Apply Shell translations
 3. Apply Translation documentation / po/* stuff

Then later:

 4. Add actual gettext support

But not have to deal with bits of #3 while I do #1 and #2. That's all.

Since hopefully we'll get to #3 relatively quickly I think that's OK.

^ permalink raw reply	[flat|nested] 222+ messages in thread

* Re: [PATCH v3 00/15] Mark "init", "clone", and "add" output for translation
  2011-02-21 12:38     ` [PATCH v3 00/15] Mark "init", "clone", and "add" output " Ævar Arnfjörð Bjarmason
@ 2011-02-22  7:36       ` Junio C Hamano
  2011-02-22 11:22         ` Ævar Arnfjörð Bjarmason
  0 siblings, 1 reply; 222+ messages in thread
From: Junio C Hamano @ 2011-02-22  7:36 UTC (permalink / raw)
  To: Ævar Arnfjörð Bjarmason; +Cc: Jonathan Nieder, git

Ævar Arnfjörð Bjarmason <avarab@gmail.com> writes:

> On Mon, Feb 21, 2011 at 11:12, Jonathan Nieder <jrnieder@gmail.com> wrote:
>> Please feel free to try it out, complain, ack, send patches, and so
>> on.
>
> Thanks a lot for taking this on.

I compared this miniseries with the early part of your original.  It seems
to contain only sane refinements, adding missed markings etc.

^ permalink raw reply	[flat|nested] 222+ messages in thread

* Re: [PATCH v3 00/15] Mark "init", "clone", and "add" output for translation
  2011-02-22  7:36       ` Junio C Hamano
@ 2011-02-22 11:22         ` Ævar Arnfjörð Bjarmason
  0 siblings, 0 replies; 222+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2011-02-22 11:22 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: Jonathan Nieder, git

On Tue, Feb 22, 2011 at 08:36, Junio C Hamano <gitster@pobox.com> wrote:
> Ævar Arnfjörð Bjarmason <avarab@gmail.com> writes:
>
>> On Mon, Feb 21, 2011 at 11:12, Jonathan Nieder <jrnieder@gmail.com> wrote:
>>> Please feel free to try it out, complain, ack, send patches, and so
>>> on.
>>
>> Thanks a lot for taking this on.
>
> I compared this miniseries with the early part of your original.  It seems
> to contain only sane refinements, adding missed markings etc.

Yeah it's looking much better.

I've been coordinating with Jonathan on #git-devel. Some more changes
were made yesterday. I'm going to pack them up and re-submit again
(just minor nits etc). That series should be in a form that's
acceptable for being applied as-is.

^ permalink raw reply	[flat|nested] 222+ messages in thread

* Re: [PATCH v3 00/15] Mark "init", "clone", and "add" output for translation
  2011-02-21 10:12   ` [PATCH v3 00/15] Mark "init", "clone", and "add" output for translation Jonathan Nieder
                       ` (15 preceding siblings ...)
  2011-02-21 12:38     ` [PATCH v3 00/15] Mark "init", "clone", and "add" output " Ævar Arnfjörð Bjarmason
@ 2011-02-22 18:11     ` Junio C Hamano
  2011-02-22 23:41       ` [PATCH v4 00/73] No-op gettextize core Git C programs Ævar Arnfjörð Bjarmason
                         ` (73 more replies)
  16 siblings, 74 replies; 222+ messages in thread
From: Junio C Hamano @ 2011-02-22 18:11 UTC (permalink / raw)
  To: Jonathan Nieder; +Cc: Ævar Arnfjörð Bjarmason, git

Jonathan Nieder <jrnieder@gmail.com> writes:

> This series still includes the skeleton gettext.h wrapper.
>
> Changes from v1:
>
>  - clearer commit messages, hopefully
>  - clearer documentation for GETTEXT_POISON in the makefile
>
> Please feel free to try it out, complain, ack, send patches, and so
> on.
>
> Jonathan Nieder (2):
>   i18n: do not poison translations unless GIT_GETTEXT_POISON envvar is
>     set
>   update-index --refresh --porcelain: add missing const

I took this series (minus 4/15), which roughly corresponds to up to 13/72
of Ævar's original.  A few quick comments:

 * 01/15
   Thanks for guarding the header file from double inclusion.  I have this
   nagging feeling that the inline _() function might be too clever for
   some compilers (non gcc and perhaps older versions of gcc), but we can
   always ifdef it away if it turns problematic.

 * 02/15
   I am not entirely happy that it is a too generic name to contaminate
   namespace of programs that may want to get i18n support while wanting
   to catch bugs with their own unrelated poisoning scheme.

   As to Malkovich, I tend to agree with your reasoning that code that
   emit messages prefixed by "#" rebase relies on should be restructured
   to limit the scope of translation to just the body of these lines, and
   that should be done in a separate patch.

 * 04/15
   Deferred per request from Ævar.

^ permalink raw reply	[flat|nested] 222+ messages in thread

* [PATCH v4 00/73] No-op gettextize core Git C programs
  2011-02-22 18:11     ` Junio C Hamano
@ 2011-02-22 23:41       ` Ævar Arnfjörð Bjarmason
  2011-02-23  0:49         ` Junio C Hamano
  2011-02-22 23:41       ` [PATCH v4 01/73] gettext: add no-op _() and N_() wrappers Ævar Arnfjörð Bjarmason
                         ` (72 subsequent siblings)
  73 siblings, 1 reply; 222+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2011-02-22 23:41 UTC (permalink / raw)
  To: git
  Cc: Junio C Hamano, Jakub Narebski, Ævar Arnfjörð Bjarmason

This is an improved version of the no-op gettextize series for core
Git C programs based on Jonathan Nieder's v3 series. Changes since
then.

  * After it's applied Git will no longer fail tests when compiled
    with GETTEXT_POISON=YesPlease. It did this because Jonathan's
    series changed the GETTEXT POISON string. See the comment in the
    "simulate unfriendly translator" patch. Regarding Junio's comment:
    
      As to Malkovich, I tend to agree with your reasoning that code that
      emit messages prefixed by "#" rebase relies on should be restructured
      to limit the scope of translation to just the body of these lines, and
      that should be done in a separate patch.

    I agree. I'll change it to just "GETTEXT POISON" in a later
    patch. But I'd prefer not to break git in any testing mode until
    then.
    
  * Reverted back to using the "gettextize" patch subjects I
    originally used. I'm using these consistetly so I can later git
    log --grep=gettextize: to find them. I'd like to preserve that
    attributed.

  * Amended and improved some log messages.

Other than that it's the same. For this to compile without warnings
you first need the "Add missing const to char* declarations" series
I've just submitted. But otherwise it's all good to go.

Jonathan Nieder (1):
  gettext: do not poison translations unless GIT_GETTEXT_POISON envvar
    is set

Ævar Arnfjörð Bjarmason (72):
  gettext: add no-op _() and N_() wrappers
  gettext tests: add GETTEXT_POISON to simulate unfriendly translator
  Makefile: "pot" target to extract messages marked for translation
  gettextize: git-init basic messages
  gettextize: git-init "Initialized [...] repository" message
  gettextize: git-clone basic messages
  gettextize: git-clone "Cloning into" message
  gettextize: git-clone "Cloning into" message
  gettextize: git-add basic messages
  gettextize: git-add "The following paths are ignored" message
  gettextize: git-add "did not match any files" message
  gettextize: git-add "remove '%s'" message
  gettextize: git-add "Unstaged changes" message
  gettextize: git-branch basic messages
  gettextize: git-branch "remote branch '%s' not found" message
  gettextize: git-branch "Deleted branch [...]" message
  gettextize: git-branch "git branch -v" messages
  gettextize: git-branch "(no branch)" message
  gettextize: git-checkout basic messages
  gettextize: git-checkout: our/their version message
  gettextize: git-checkout describe_detached_head messages
  gettextize: git-checkout "HEAD is now at" message
  gettextize: git-checkout "Switched to a .. branch" message
  gettextize: git-commit basic messages
  gettextize: git-commit "middle of a merge" message
  gettextize: git-commit formatting messages
  gettextize: git-commit print_summary messages
  gettextize: git-commit "enter the commit message" message
  gettextize: git-commit advice messages
  gettextize: git-diff basic messages
  gettextize: git-fetch basic messages
  gettextize: git-fetch formatting messages
  gettextize: git-fetch update_local_ref messages
  gettextize: git-fetch split up "(non-fast-forward)" message
  gettextize: git-grep basic messages
  gettextize: git-grep "--open-files-in-pager" message
  gettextize: git-log basic messages
  gettextize: git-log "--OPT does not make sense" messages
  gettextize: git-merge basic messages
  gettextize: git-merge "Updating %s..%s" message
  gettextize: git-merge "You have not concluded your merge" messages
  gettextize: git-merge "Wonderful" message
  gettextize: git-mv basic messages
  gettextize: git-mv "bad" messages
  gettextize: git-rm basic messages
  gettextize: git-reset basic messages
  gettextize: git-reset reset_type_names messages
  gettextize: git-reset "Unstaged changes after reset" message
  gettextize: git-tag basic messages
  gettextize: git-tag tag_template message
  gettextize: git-push basic messages
  gettextize: git-push "prevent you from losing" message
  gettextize: git-status basic messages
  gettextize: git-status "nothing to commit" messages
  gettextize: git-status shortstatus messages
  gettextize: git-status "Changes to be committed" message
  gettextize: git-status "Initial commit" message
  gettextize: git-status "renamed: " message
  gettextize: git-archive basic messages
  gettextize: git-bundle basic messages
  gettextize: git-clean basic messages
  gettextize: git-clean clean.requireForce messages
  gettextize: git-describe basic messages
  gettextize: git-gc basic messages
  gettextize: git-gc "Auto packing the repository" message
  gettextize: git-notes basic commands
  gettextize: git-notes GIT_NOTES_REWRITE_MODE error message
  gettextize: git-revert basic messages
  gettextize: git-revert "Your local changes" message
  gettextize: git-revert literal "me" messages
  gettextize: git-revert split up "could not revert/apply" message
  gettextize: git-shortlog basic messages

 Makefile                         |   27 ++++++
 builtin/add.c                    |   50 ++++++------
 builtin/archive.c                |   14 ++--
 builtin/branch.c                 |   69 ++++++++--------
 builtin/bundle.c                 |    6 +-
 builtin/checkout.c               |   93 +++++++++++-----------
 builtin/clean.c                  |   33 +++++---
 builtin/clone.c                  |   63 ++++++++-------
 builtin/commit.c                 |  162 +++++++++++++++++++-------------------
 builtin/describe.c               |   36 ++++----
 builtin/diff.c                   |   18 ++--
 builtin/fetch.c                  |   82 ++++++++++----------
 builtin/gc.c                     |   24 +++---
 builtin/grep.c                   |   34 ++++----
 builtin/init-db.c                |   58 ++++++++------
 builtin/log.c                    |   68 ++++++++--------
 builtin/merge.c                  |  128 +++++++++++++++---------------
 builtin/mv.c                     |   32 ++++----
 builtin/notes.c                  |  112 +++++++++++++-------------
 builtin/push.c                   |   42 +++++-----
 builtin/reset.c                  |   42 +++++-----
 builtin/revert.c                 |   76 ++++++++++--------
 builtin/rm.c                     |   22 +++---
 builtin/shortlog.c               |    8 +-
 builtin/tag.c                    |   66 ++++++++--------
 cache.h                          |    1 +
 gettext.c                        |   14 +++
 gettext.h                        |   32 ++++++++
 po/.gitignore                    |    1 +
 t/lib-httpd.sh                   |    2 +-
 t/t0001-init.sh                  |    2 +-
 t/t1200-tutorial.sh              |    5 +-
 t/t2200-add-update.sh            |    2 +-
 t/t2204-add-ignored.sh           |   37 ++++++---
 t/t3030-merge-recursive.sh       |    2 +-
 t/t3200-branch.sh                |    2 +-
 t/t3203-branch-output.sh         |    2 +-
 t/t3501-revert-cherry-pick.sh    |    2 +-
 t/t3507-cherry-pick-conflict.sh  |    2 +-
 t/t3700-add.sh                   |   13 +++-
 t/t4001-diff-rename.sh           |    4 +-
 t/t4014-format-patch.sh          |    2 +-
 t/t5526-fetch-submodules.sh      |   40 ++++++++--
 t/t5541-http-push.sh             |    7 +-
 t/t5601-clone.sh                 |    2 +-
 t/t6040-tracking-info.sh         |    2 +-
 t/t6120-describe.sh              |    2 +-
 t/t7004-tag.sh                   |    1 +
 t/t7012-skip-worktree-writing.sh |    4 +-
 t/t7060-wtstatus.sh              |    2 +-
 t/t7102-reset.sh                 |    2 +-
 t/t7110-reset-merge.sh           |    6 +-
 t/t7201-co.sh                    |   10 +-
 t/t7300-clean.sh                 |    6 +-
 t/t7500-commit.sh                |    8 +-
 t/t7501-commit.sh                |    7 +-
 t/t7502-commit.sh                |   60 +++++++++------
 t/t7506-status-submodule.sh      |   28 +++---
 t/t7508-status.sh                |  115 +++++++++++++++------------
 t/t7600-merge.sh                 |    2 +-
 t/t7607-merge-overwrite.sh       |   10 ++-
 t/t7611-merge-abort.sh           |   20 ++++-
 t/t7811-grep-open.sh             |    2 +-
 t/test-lib.sh                    |    9 ++
 wt-status.c                      |  116 ++++++++++++++--------------
 65 files changed, 1084 insertions(+), 867 deletions(-)
 create mode 100644 gettext.c
 create mode 100644 gettext.h
 create mode 100644 po/.gitignore

-- 
1.7.2.3

^ permalink raw reply	[flat|nested] 222+ messages in thread

* [PATCH v4 01/73] gettext: add no-op _() and N_() wrappers
  2011-02-22 18:11     ` Junio C Hamano
  2011-02-22 23:41       ` [PATCH v4 00/73] No-op gettextize core Git C programs Ævar Arnfjörð Bjarmason
@ 2011-02-22 23:41       ` Ævar Arnfjörð Bjarmason
  2011-02-22 23:41       ` [PATCH v4 02/73] gettext tests: add GETTEXT_POISON to simulate unfriendly translator Ævar Arnfjörð Bjarmason
                         ` (71 subsequent siblings)
  73 siblings, 0 replies; 222+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2011-02-22 23:41 UTC (permalink / raw)
  To: git
  Cc: Junio C Hamano, Jakub Narebski,
	Ævar Arnfjörð Bjarmason, Jonathan Nieder

The _ function is for translating strings into the user's chosen
language.  The N_ macro just marks translatable strings for the
xgettext(1) tool without translating them; it is intended for use in
contexts where a function call cannot be used.  So, for example:

	fprintf(stderr, _("Expansion of alias '%s' failed; "
		"'%s' is not a git command\n"),
		cmd, argv[0]);

and

	const char *unpack_plumbing_errors[NB_UNPACK_TREES_ERROR_TYPES] = {
		/* ERROR_WOULD_OVERWRITE */
		N_("Entry '%s' would be overwritten by merge. Cannot merge."),
	[...]

Define such _ and N_ in a new gettext.h and include it in cache.h, so
they can be used everywhere.  Each just returns its argument for now.
_ is a function rather than a macro like N_ to avoid the temptation to
use _("foo") as a string literal (which would be a compile-time error
once _(s) expands to an expression for the translation of s).

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
---
 Makefile  |    1 +
 cache.h   |    1 +
 gettext.h |   26 ++++++++++++++++++++++++++
 3 files changed, 28 insertions(+), 0 deletions(-)
 create mode 100644 gettext.h

diff --git a/Makefile b/Makefile
index ade7923..c153f45 100644
--- a/Makefile
+++ b/Makefile
@@ -515,6 +515,7 @@ LIB_H += diff.h
 LIB_H += dir.h
 LIB_H += exec_cmd.h
 LIB_H += fsck.h
+LIB_H += gettext.h
 LIB_H += git-compat-util.h
 LIB_H += graph.h
 LIB_H += grep.h
diff --git a/cache.h b/cache.h
index 3abf895..a465f38 100644
--- a/cache.h
+++ b/cache.h
@@ -5,6 +5,7 @@
 #include "strbuf.h"
 #include "hash.h"
 #include "advice.h"
+#include "gettext.h"
 
 #include SHA1_HEADER
 #ifndef git_SHA_CTX
diff --git a/gettext.h b/gettext.h
new file mode 100644
index 0000000..6949d73
--- /dev/null
+++ b/gettext.h
@@ -0,0 +1,26 @@
+/*
+ * Copyright (c) 2010-2011 Ævar Arnfjörð Bjarmason
+ *
+ * This is a skeleton no-op implementation of gettext for Git.
+ * You can replace it with something that uses libintl.h and wraps
+ * gettext() to try out the translations.
+ */
+
+#ifndef GETTEXT_H
+#define GETTEXT_H
+
+#ifdef _
+#error "namespace conflict: '_' is pre-defined?"
+#endif
+
+#define FORMAT_PRESERVING(n) __attribute__((format_arg(n)))
+
+static inline FORMAT_PRESERVING(1) const char *_(const char *msgid)
+{
+	return msgid;
+}
+
+/* Mark msgid for translation but do not translate it. */
+#define N_(msgid) (msgid)
+
+#endif
-- 
1.7.2.3

^ permalink raw reply related	[flat|nested] 222+ messages in thread

* [PATCH v4 02/73] gettext tests: add GETTEXT_POISON to simulate unfriendly translator
  2011-02-22 18:11     ` Junio C Hamano
  2011-02-22 23:41       ` [PATCH v4 00/73] No-op gettextize core Git C programs Ævar Arnfjörð Bjarmason
  2011-02-22 23:41       ` [PATCH v4 01/73] gettext: add no-op _() and N_() wrappers Ævar Arnfjörð Bjarmason
@ 2011-02-22 23:41       ` Ævar Arnfjörð Bjarmason
  2011-02-25  7:08         ` Jonathan Nieder
  2011-02-22 23:41       ` [PATCH v4 03/73] gettext: do not poison translations unless GIT_GETTEXT_POISON envvar is set Ævar Arnfjörð Bjarmason
                         ` (70 subsequent siblings)
  73 siblings, 1 reply; 222+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2011-02-22 23:41 UTC (permalink / raw)
  To: git
  Cc: Junio C Hamano, Jakub Narebski,
	Ævar Arnfjörð Bjarmason, Jonathan Nieder

Add a new GETTEXT_POISON compile-time parameter to make _(msg) always
return gibberish. So now you can run

	make GETTEXT_POISON=YesPlease

to get a copy of git that functions correctly (one hopes) but produces
output that is in nobody's native language at all.

This is a debugging aid for people who are working on the i18n part of
the system, to make sure that they are not marking plumbing messages
that should never be translated with _().

As new strings get marked for translation, naturally a number of tests
will be broken in this mode. Tests that depend on output from
Porcelain will need to be marked with the new C_LOCALE_OUTPUT test
prerequisite. Newly failing tests that do not depend on output from
Porcelain would be bugs due to messages that should not have been
marked for translation.

Note that the string we're using ("# GETTEXT POISON #") intentionally
starts the pound sign. Some of Git's tests such as
t3404-rebase-interactive.sh rely on interactive editing with a fake
editor, and will needlessly break if the message doesn't start with
something the interactive editor considers a comment.

A future patch will fix fix the underlying cause of that issue by
adding "#" characters to the commit advice automatically.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
---
 Makefile      |    7 +++++++
 gettext.h     |    8 +++++++-
 t/test-lib.sh |    3 +++
 3 files changed, 17 insertions(+), 1 deletions(-)

diff --git a/Makefile b/Makefile
index c153f45..c348bb7 100644
--- a/Makefile
+++ b/Makefile
@@ -216,6 +216,9 @@ all::
 #
 # Define NO_REGEX if you have no or inferior regex support in your C library.
 #
+# Define GETTEXT_POISON if you are debugging the choice of strings marked
+# for translation.  This will turn all strings that use gettext into gibberish.
+#
 # Define JSMIN to point to JavaScript minifier that functions as
 # a filter to have gitweb.js minified.
 #
@@ -1370,6 +1373,9 @@ endif
 ifdef NO_SYMLINK_HEAD
 	BASIC_CFLAGS += -DNO_SYMLINK_HEAD
 endif
+ifdef GETTEXT_POISON
+	BASIC_CFLAGS += -DGETTEXT_POISON
+endif
 ifdef NO_STRCASESTR
 	COMPAT_CFLAGS += -DNO_STRCASESTR
 	COMPAT_OBJS += compat/strcasestr.o
@@ -2089,6 +2095,7 @@ endif
 ifdef GIT_TEST_CMP_USE_COPIED_CONTEXT
 	@echo GIT_TEST_CMP_USE_COPIED_CONTEXT=YesPlease >>$@
 endif
+	@echo GETTEXT_POISON=\''$(subst ','\'',$(subst ','\'',$(GETTEXT_POISON)))'\' >>$@
 
 ### Detect Tck/Tk interpreter path changes
 ifndef NO_TCLTK
diff --git a/gettext.h b/gettext.h
index 6949d73..3d7cf44 100644
--- a/gettext.h
+++ b/gettext.h
@@ -15,9 +15,15 @@
 
 #define FORMAT_PRESERVING(n) __attribute__((format_arg(n)))
 
+#ifdef GETTEXT_POISON
+#define use_poison() 1
+#else
+#define use_poison() 0
+#endif
+
 static inline FORMAT_PRESERVING(1) const char *_(const char *msgid)
 {
-	return msgid;
+	return use_poison() ? "# GETTEXT POISON #" : msgid;
 }
 
 /* Mark msgid for translation but do not translate it. */
diff --git a/t/test-lib.sh b/t/test-lib.sh
index 0fdc541..0840e4a 100644
--- a/t/test-lib.sh
+++ b/t/test-lib.sh
@@ -1079,6 +1079,9 @@ esac
 test -z "$NO_PERL" && test_set_prereq PERL
 test -z "$NO_PYTHON" && test_set_prereq PYTHON
 
+# Can we rely on git's output in the C locale?
+test -z "$GETTEXT_POISON" && test_set_prereq C_LOCALE_OUTPUT
+
 # test whether the filesystem supports symbolic links
 ln -s x y 2>/dev/null && test -h y 2>/dev/null && test_set_prereq SYMLINKS
 rm -f y
-- 
1.7.2.3

^ permalink raw reply related	[flat|nested] 222+ messages in thread

* [PATCH v4 03/73] gettext: do not poison translations unless GIT_GETTEXT_POISON envvar is set
  2011-02-22 18:11     ` Junio C Hamano
                         ` (2 preceding siblings ...)
  2011-02-22 23:41       ` [PATCH v4 02/73] gettext tests: add GETTEXT_POISON to simulate unfriendly translator Ævar Arnfjörð Bjarmason
@ 2011-02-22 23:41       ` Ævar Arnfjörð Bjarmason
  2011-02-22 23:41       ` [PATCH v4 04/73] Makefile: "pot" target to extract messages marked for translation Ævar Arnfjörð Bjarmason
                         ` (69 subsequent siblings)
  73 siblings, 0 replies; 222+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2011-02-22 23:41 UTC (permalink / raw)
  To: git; +Cc: Junio C Hamano, Jakub Narebski, Jonathan Nieder

From: Jonathan Nieder <jrnieder@gmail.com>

Tweak the GETTEXT_POISON facility so it is activated at run time
instead of compile time.  If the GIT_GETTEXT_POISON environment
variable is set, _(msg) will result in gibberish as before; but if the
GIT_GETTEXT_POISON variable is not set, it will return the message for
human-readable output.  So the behavior of mistranslated and
untranslated git can be compared without rebuilding git in between.

For simplicity we always set the GIT_GETTEXT_POISON variable in tests.

This does not affect builds without the GETTEXT_POISON compile-time
option set, so non-i18n git will not be slowed down.

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
---
 Makefile      |    5 ++++-
 gettext.c     |   14 ++++++++++++++
 gettext.h     |    2 +-
 t/test-lib.sh |    8 +++++++-
 4 files changed, 26 insertions(+), 3 deletions(-)
 create mode 100644 gettext.c

diff --git a/Makefile b/Makefile
index c348bb7..4e9d935 100644
--- a/Makefile
+++ b/Makefile
@@ -217,7 +217,9 @@ all::
 # Define NO_REGEX if you have no or inferior regex support in your C library.
 #
 # Define GETTEXT_POISON if you are debugging the choice of strings marked
-# for translation.  This will turn all strings that use gettext into gibberish.
+# for translation.  In a GETTEXT_POISON build, you can turn all strings marked
+# for translation into gibberish by setting the GIT_GETTEXT_POISON variable
+# (to any value) in your environment.
 #
 # Define JSMIN to point to JavaScript minifier that functions as
 # a filter to have gitweb.js minified.
@@ -1374,6 +1376,7 @@ ifdef NO_SYMLINK_HEAD
 	BASIC_CFLAGS += -DNO_SYMLINK_HEAD
 endif
 ifdef GETTEXT_POISON
+	LIB_OBJS += gettext.o
 	BASIC_CFLAGS += -DGETTEXT_POISON
 endif
 ifdef NO_STRCASESTR
diff --git a/gettext.c b/gettext.c
new file mode 100644
index 0000000..9688c8b
--- /dev/null
+++ b/gettext.c
@@ -0,0 +1,14 @@
+/*
+ * Copyright (c) 2010 Ævar Arnfjörð Bjarmason
+ */
+
+#include "git-compat-util.h"
+#include "gettext.h"
+
+int use_poison(void)
+{
+	static int poison_requested = -1;
+	if (poison_requested == -1)
+		poison_requested = getenv("GIT_GETTEXT_POISON") ? 1 : 0;
+	return poison_requested;
+}
diff --git a/gettext.h b/gettext.h
index 3d7cf44..ee7d41d 100644
--- a/gettext.h
+++ b/gettext.h
@@ -16,7 +16,7 @@
 #define FORMAT_PRESERVING(n) __attribute__((format_arg(n)))
 
 #ifdef GETTEXT_POISON
-#define use_poison() 1
+extern int use_poison(void);
 #else
 #define use_poison() 0
 #endif
diff --git a/t/test-lib.sh b/t/test-lib.sh
index 0840e4a..f4c1e04 100644
--- a/t/test-lib.sh
+++ b/t/test-lib.sh
@@ -1080,7 +1080,13 @@ test -z "$NO_PERL" && test_set_prereq PERL
 test -z "$NO_PYTHON" && test_set_prereq PYTHON
 
 # Can we rely on git's output in the C locale?
-test -z "$GETTEXT_POISON" && test_set_prereq C_LOCALE_OUTPUT
+if test -n "$GETTEXT_POISON"
+then
+	GIT_GETTEXT_POISON=YesPlease
+	export GIT_GETTEXT_POISON
+else
+	test_set_prereq C_LOCALE_OUTPUT
+fi
 
 # test whether the filesystem supports symbolic links
 ln -s x y 2>/dev/null && test -h y 2>/dev/null && test_set_prereq SYMLINKS
-- 
1.7.2.3

^ permalink raw reply related	[flat|nested] 222+ messages in thread

* [PATCH v4 04/73] Makefile: "pot" target to extract messages marked for translation
  2011-02-22 18:11     ` Junio C Hamano
                         ` (3 preceding siblings ...)
  2011-02-22 23:41       ` [PATCH v4 03/73] gettext: do not poison translations unless GIT_GETTEXT_POISON envvar is set Ævar Arnfjörð Bjarmason
@ 2011-02-22 23:41       ` Ævar Arnfjörð Bjarmason
  2011-02-25  7:22         ` Jonathan Nieder
  2011-02-22 23:41       ` [PATCH v4 05/73] gettextize: git-init basic messages Ævar Arnfjörð Bjarmason
                         ` (68 subsequent siblings)
  73 siblings, 1 reply; 222+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2011-02-22 23:41 UTC (permalink / raw)
  To: git
  Cc: Junio C Hamano, Jakub Narebski,
	Ævar Arnfjörð Bjarmason, Jonathan Nieder

Add rules to generate a template (po/git.pot) listing messages marked
for translation in the C portion of git.

To get started translating, just run "make pot".

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
---
 Makefile      |   16 ++++++++++++++++
 po/.gitignore |    1 +
 2 files changed, 17 insertions(+), 0 deletions(-)
 create mode 100644 po/.gitignore

diff --git a/Makefile b/Makefile
index 4e9d935..1cc6c60 100644
--- a/Makefile
+++ b/Makefile
@@ -321,6 +321,7 @@ INSTALL = install
 RPMBUILD = rpmbuild
 TCL_PATH = tclsh
 TCLTK_PATH = wish
+XGETTEXT = xgettext
 PTHREAD_LIBS = -lpthread
 PTHREAD_CFLAGS =
 GCOV = gcov
@@ -1590,6 +1591,7 @@ ifndef V
 	QUIET_BUILT_IN = @echo '   ' BUILTIN $@;
 	QUIET_GEN      = @echo '   ' GEN $@;
 	QUIET_LNCP     = @echo '   ' LN/CP $@;
+	QUIET_XGETTEXT = @echo '   ' XGETTEXT $@;
 	QUIET_GCOV     = @echo '   ' GCOV $@;
 	QUIET_SUBDIR0  = +@subdir=
 	QUIET_SUBDIR1  = ;$(NO_SUBDIR) echo '   ' SUBDIR $$subdir; \
@@ -2057,6 +2059,20 @@ info:
 pdf:
 	$(MAKE) -C Documentation pdf
 
+XGETTEXT_FLAGS = \
+	--force-po \
+	--add-comments \
+	--msgid-bugs-address="Git Mailing List <git@vger.kernel.org>" \
+	--from-code=UTF-8
+XGETTEXT_FLAGS_C = $(XGETTEXT_FLAGS) --keyword=_ --keyword=N_ --language=C
+LOCALIZED_C := $(C_OBJ:o=c)
+
+po/git.pot: $(LOCALIZED_C)
+	$(QUIET_XGETTEXT)$(XGETTEXT) -o$@+ $(XGETTEXT_FLAGS_C) $(LOCALIZED_C) && \
+	mv $@+ $@
+
+pot: po/git.pot
+
 $(ETAGS_TARGET): FORCE
 	$(RM) $(ETAGS_TARGET)
 	$(FIND) . -name '*.[hcS]' -print | xargs etags -a -o $(ETAGS_TARGET)
diff --git a/po/.gitignore b/po/.gitignore
new file mode 100644
index 0000000..a242a86
--- /dev/null
+++ b/po/.gitignore
@@ -0,0 +1 @@
+/git.pot
-- 
1.7.2.3

^ permalink raw reply related	[flat|nested] 222+ messages in thread

* [PATCH v4 05/73] gettextize: git-init basic messages
  2011-02-22 18:11     ` Junio C Hamano
                         ` (4 preceding siblings ...)
  2011-02-22 23:41       ` [PATCH v4 04/73] Makefile: "pot" target to extract messages marked for translation Ævar Arnfjörð Bjarmason
@ 2011-02-22 23:41       ` Ævar Arnfjörð Bjarmason
  2011-02-22 23:41       ` [PATCH v4 06/73] gettextize: git-init "Initialized [...] repository" message Ævar Arnfjörð Bjarmason
                         ` (67 subsequent siblings)
  73 siblings, 0 replies; 222+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2011-02-22 23:41 UTC (permalink / raw)
  To: git
  Cc: Junio C Hamano, Jakub Narebski,
	Ævar Arnfjörð Bjarmason, Jonathan Nieder

Change the user visible strings in init-db.c to use gettext
localizations. This only converts messages which needed to be changed
from "foo" to _("foo"), and didn't need any TRANSLATORS comments.

I haven't marked the messages in init_db_usage or init_db_options for
translation, since that would require additional changes in
parse-options.c. Those can be done later.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
---
 builtin/init-db.c |   46 +++++++++++++++++++++++-----------------------
 1 files changed, 23 insertions(+), 23 deletions(-)

diff --git a/builtin/init-db.c b/builtin/init-db.c
index 4f5348e..f7ddf5b 100644
--- a/builtin/init-db.c
+++ b/builtin/init-db.c
@@ -31,7 +31,7 @@ static void safe_create_dir(const char *dir, int share)
 		}
 	}
 	else if (share && adjust_shared_perm(dir))
-		die("Could not make %s writable by group", dir);
+		die(_("Could not make %s writable by group"), dir);
 }
 
 static void copy_templates_1(char *path, int baselen,
@@ -58,25 +58,25 @@ static void copy_templates_1(char *path, int baselen,
 		namelen = strlen(de->d_name);
 		if ((PATH_MAX <= baselen + namelen) ||
 		    (PATH_MAX <= template_baselen + namelen))
-			die("insanely long template name %s", de->d_name);
+			die(_("insanely long template name %s"), de->d_name);
 		memcpy(path + baselen, de->d_name, namelen+1);
 		memcpy(template + template_baselen, de->d_name, namelen+1);
 		if (lstat(path, &st_git)) {
 			if (errno != ENOENT)
-				die_errno("cannot stat '%s'", path);
+				die_errno(_("cannot stat '%s'"), path);
 		}
 		else
 			exists = 1;
 
 		if (lstat(template, &st_template))
-			die_errno("cannot stat template '%s'", template);
+			die_errno(_("cannot stat template '%s'"), template);
 
 		if (S_ISDIR(st_template.st_mode)) {
 			DIR *subdir = opendir(template);
 			int baselen_sub = baselen + namelen;
 			int template_baselen_sub = template_baselen + namelen;
 			if (!subdir)
-				die_errno("cannot opendir '%s'", template);
+				die_errno(_("cannot opendir '%s'"), template);
 			path[baselen_sub++] =
 				template[template_baselen_sub++] = '/';
 			path[baselen_sub] =
@@ -93,20 +93,20 @@ static void copy_templates_1(char *path, int baselen,
 			int len;
 			len = readlink(template, lnk, sizeof(lnk));
 			if (len < 0)
-				die_errno("cannot readlink '%s'", template);
+				die_errno(_("cannot readlink '%s'"), template);
 			if (sizeof(lnk) <= len)
-				die("insanely long symlink %s", template);
+				die(_("insanely long symlink %s"), template);
 			lnk[len] = 0;
 			if (symlink(lnk, path))
-				die_errno("cannot symlink '%s' '%s'", lnk, path);
+				die_errno(_("cannot symlink '%s' '%s'"), lnk, path);
 		}
 		else if (S_ISREG(st_template.st_mode)) {
 			if (copy_file(path, template, st_template.st_mode))
-				die_errno("cannot copy '%s' to '%s'", template,
+				die_errno(_("cannot copy '%s' to '%s'"), template,
 					  path);
 		}
 		else
-			error("ignoring template %s", template);
+			error(_("ignoring template %s"), template);
 	}
 }
 
@@ -129,7 +129,7 @@ static void copy_templates(const char *template_dir)
 		return;
 	template_len = strlen(template_dir);
 	if (PATH_MAX <= (template_len+strlen("/config")))
-		die("insanely long template path %s", template_dir);
+		die(_("insanely long template path %s"), template_dir);
 	strcpy(template_path, template_dir);
 	if (template_path[template_len-1] != '/') {
 		template_path[template_len++] = '/';
@@ -137,7 +137,7 @@ static void copy_templates(const char *template_dir)
 	}
 	dir = opendir(template_path);
 	if (!dir) {
-		warning("templates not found %s", template_dir);
+		warning(_("templates not found %s"), template_dir);
 		return;
 	}
 
@@ -150,8 +150,8 @@ static void copy_templates(const char *template_dir)
 
 	if (repository_format_version &&
 	    repository_format_version != GIT_REPO_VERSION) {
-		warning("not copying templates of "
-			"a wrong format version %d from '%s'",
+		warning(_("not copying templates of "
+			"a wrong format version %d from '%s'"),
 			repository_format_version,
 			template_dir);
 		closedir(dir);
@@ -188,7 +188,7 @@ static int create_default_files(const char *template_path)
 	int filemode;
 
 	if (len > sizeof(path)-50)
-		die("insane git directory %s", git_dir);
+		die(_("insane git directory %s"), git_dir);
 	memcpy(path, git_dir, len);
 
 	if (len && path[len-1] != '/')
@@ -375,7 +375,7 @@ static int guess_repository_type(const char *git_dir)
 	if (!strcmp(".", git_dir))
 		return 1;
 	if (!getcwd(cwd, sizeof(cwd)))
-		die_errno("cannot tell cwd");
+		die_errno(_("cannot tell cwd"));
 	if (!strcmp(git_dir, cwd))
 		return 1;
 	/*
@@ -450,18 +450,18 @@ int cmd_init_db(int argc, const char **argv, const char *prefix)
 					errno = EEXIST;
 					/* fallthru */
 				case -1:
-					die_errno("cannot mkdir %s", argv[0]);
+					die_errno(_("cannot mkdir %s"), argv[0]);
 					break;
 				default:
 					break;
 				}
 				shared_repository = saved;
 				if (mkdir(argv[0], 0777) < 0)
-					die_errno("cannot mkdir %s", argv[0]);
+					die_errno(_("cannot mkdir %s"), argv[0]);
 				mkdir_tried = 1;
 				goto retry;
 			}
-			die_errno("cannot chdir to %s", argv[0]);
+			die_errno(_("cannot chdir to %s"), argv[0]);
 		}
 	} else if (0 < argc) {
 		usage(init_db_usage[0]);
@@ -483,8 +483,8 @@ int cmd_init_db(int argc, const char **argv, const char *prefix)
 	git_dir = getenv(GIT_DIR_ENVIRONMENT);
 	work_tree = getenv(GIT_WORK_TREE_ENVIRONMENT);
 	if ((!git_dir || is_bare_repository_cfg == 1) && work_tree)
-		die("%s (or --work-tree=<directory>) not allowed without "
-		    "specifying %s (or --git-dir=<directory>)",
+		die(_("%s (or --work-tree=<directory>) not allowed without "
+			  "specifying %s (or --git-dir=<directory>)"),
 		    GIT_WORK_TREE_ENVIRONMENT,
 		    GIT_DIR_ENVIRONMENT);
 
@@ -509,14 +509,14 @@ int cmd_init_db(int argc, const char **argv, const char *prefix)
 		if (!git_work_tree_cfg) {
 			git_work_tree_cfg = xcalloc(PATH_MAX, 1);
 			if (!getcwd(git_work_tree_cfg, PATH_MAX))
-				die_errno ("Cannot access current working directory");
+				die_errno (_("Cannot access current working directory"));
 		}
 		if (work_tree)
 			set_git_work_tree(make_absolute_path(work_tree));
 		else
 			set_git_work_tree(git_work_tree_cfg);
 		if (access(get_git_work_tree(), X_OK))
-			die_errno ("Cannot access work tree '%s'",
+			die_errno (_("Cannot access work tree '%s'"),
 				   get_git_work_tree());
 	}
 	else {
-- 
1.7.2.3

^ permalink raw reply related	[flat|nested] 222+ messages in thread

* [PATCH v4 06/73] gettextize: git-init "Initialized [...] repository" message
  2011-02-22 18:11     ` Junio C Hamano
                         ` (5 preceding siblings ...)
  2011-02-22 23:41       ` [PATCH v4 05/73] gettextize: git-init basic messages Ævar Arnfjörð Bjarmason
@ 2011-02-22 23:41       ` Ævar Arnfjörð Bjarmason
  2011-02-22 23:41       ` [PATCH v4 07/73] gettextize: git-clone basic messages Ævar Arnfjörð Bjarmason
                         ` (66 subsequent siblings)
  73 siblings, 0 replies; 222+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2011-02-22 23:41 UTC (permalink / raw)
  To: git
  Cc: Junio C Hamano, Jakub Narebski,
	Ævar Arnfjörð Bjarmason, Jonathan Nieder

These messages could benefit from splitting up.  An earlier version of
this patch began like this:

    const char *reinit_shared   = _("Reinitialized existing shared Git repository in %s\n");
    const char *init_shared     = _("Initialized empty shared Git repository in %s\n");
    const char *reinit_noshared = _("Reinitialized existing Git repository in %s\n");
    const char *init_noshared   = _("Initialized empty Git repository in %s\n");

But in the first round of gettextization I'm aiming to keep code
changes to a minimum for ease of review.  So just add a comment
explaining to translators how the sprintf format gets used so they
can cope for now if the language's grammar allows.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
---
 builtin/init-db.c |   12 +++++++++---
 t/t0001-init.sh   |    2 +-
 2 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/builtin/init-db.c b/builtin/init-db.c
index f7ddf5b..e0e5ce3 100644
--- a/builtin/init-db.c
+++ b/builtin/init-db.c
@@ -354,9 +354,15 @@ int init_db(const char *template_dir, unsigned int flags)
 	if (!(flags & INIT_DB_QUIET)) {
 		const char *git_dir = get_git_dir();
 		int len = strlen(git_dir);
-		printf("%s%s Git repository in %s%s\n",
-		       reinit ? "Reinitialized existing" : "Initialized empty",
-		       shared_repository ? " shared" : "",
+
+		/*
+		 * TRANSLATORS: The first '%s' is either "Reinitialized
+		 * existing" or "Initialized empty", the second " shared" or
+		 * "", and the last '%s%s' is the verbatim directory name.
+		 */
+		printf(_("%s%s Git repository in %s%s\n"),
+		       reinit ? _("Reinitialized existing") : _("Initialized empty"),
+		       shared_repository ? _(" shared") : "",
 		       git_dir, len && git_dir[len-1] != '/' ? "/" : "");
 	}
 
diff --git a/t/t0001-init.sh b/t/t0001-init.sh
index f684993..dd4c00d 100755
--- a/t/t0001-init.sh
+++ b/t/t0001-init.sh
@@ -180,7 +180,7 @@ test_expect_success 'GIT_DIR & GIT_WORK_TREE (2)' '
 	fi
 '
 
-test_expect_success 'reinit' '
+test_expect_success C_LOCALE_OUTPUT 'reinit' '
 
 	(
 		sane_unset GIT_CONFIG GIT_WORK_TREE GIT_CONFIG &&
-- 
1.7.2.3

^ permalink raw reply related	[flat|nested] 222+ messages in thread

* [PATCH v4 07/73] gettextize: git-clone basic messages
  2011-02-22 18:11     ` Junio C Hamano
                         ` (6 preceding siblings ...)
  2011-02-22 23:41       ` [PATCH v4 06/73] gettextize: git-init "Initialized [...] repository" message Ævar Arnfjörð Bjarmason
@ 2011-02-22 23:41       ` Ævar Arnfjörð Bjarmason
  2011-02-22 23:41       ` [PATCH v4 08/73] gettextize: git-clone "Cloning into" message Ævar Arnfjörð Bjarmason
                         ` (65 subsequent siblings)
  73 siblings, 0 replies; 222+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2011-02-22 23:41 UTC (permalink / raw)
  To: git
  Cc: Junio C Hamano, Jakub Narebski, Ævar Arnfjörð Bjarmason

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
---
 builtin/clone.c |   54 +++++++++++++++++++++++++++---------------------------
 1 files changed, 27 insertions(+), 27 deletions(-)

diff --git a/builtin/clone.c b/builtin/clone.c
index 60d9a64..f46d09b 100644
--- a/builtin/clone.c
+++ b/builtin/clone.c
@@ -208,7 +208,7 @@ static void setup_reference(const char *repo)
 	if (is_directory(mkpath("%s/.git/objects", ref_git)))
 		ref_git = mkpath("%s/.git", ref_git);
 	else if (!is_directory(mkpath("%s/objects", ref_git)))
-		die("reference repository '%s' is not a local directory.",
+		die(_("reference repository '%s' is not a local directory."),
 		    option_reference);
 
 	ref_git_copy = xstrdup(ref_git);
@@ -235,15 +235,15 @@ static void copy_or_link_directory(struct strbuf *src, struct strbuf *dest)
 
 	dir = opendir(src->buf);
 	if (!dir)
-		die_errno("failed to open '%s'", src->buf);
+		die_errno(_("failed to open '%s'"), src->buf);
 
 	if (mkdir(dest->buf, 0777)) {
 		if (errno != EEXIST)
-			die_errno("failed to create directory '%s'", dest->buf);
+			die_errno(_("failed to create directory '%s'"), dest->buf);
 		else if (stat(dest->buf, &buf))
-			die_errno("failed to stat '%s'", dest->buf);
+			die_errno(_("failed to stat '%s'"), dest->buf);
 		else if (!S_ISDIR(buf.st_mode))
-			die("%s exists and is not a directory", dest->buf);
+			die(_("%s exists and is not a directory"), dest->buf);
 	}
 
 	strbuf_addch(src, '/');
@@ -257,7 +257,7 @@ static void copy_or_link_directory(struct strbuf *src, struct strbuf *dest)
 		strbuf_setlen(dest, dest_len);
 		strbuf_addstr(dest, de->d_name);
 		if (stat(src->buf, &buf)) {
-			warning ("failed to stat %s\n", src->buf);
+			warning (_("failed to stat %s\n"), src->buf);
 			continue;
 		}
 		if (S_ISDIR(buf.st_mode)) {
@@ -267,16 +267,16 @@ static void copy_or_link_directory(struct strbuf *src, struct strbuf *dest)
 		}
 
 		if (unlink(dest->buf) && errno != ENOENT)
-			die_errno("failed to unlink '%s'", dest->buf);
+			die_errno(_("failed to unlink '%s'"), dest->buf);
 		if (!option_no_hardlinks) {
 			if (!link(src->buf, dest->buf))
 				continue;
 			if (option_local)
-				die_errno("failed to create link '%s'", dest->buf);
+				die_errno(_("failed to create link '%s'"), dest->buf);
 			option_no_hardlinks = 1;
 		}
 		if (copy_file_with_time(dest->buf, src->buf, 0666))
-			die_errno("failed to copy file to '%s'", dest->buf);
+			die_errno(_("failed to copy file to '%s'"), dest->buf);
 	}
 	closedir(dir);
 }
@@ -305,7 +305,7 @@ static const struct ref *clone_local(const char *src_repo,
 	ret = transport_get_remote_refs(transport);
 	transport_disconnect(transport);
 	if (0 <= option_verbosity)
-		printf("done.\n");
+		printf(_("done.\n"));
 	return ret;
 }
 
@@ -387,11 +387,11 @@ int cmd_clone(int argc, const char **argv, const char *prefix)
 			     builtin_clone_usage, 0);
 
 	if (argc > 2)
-		usage_msg_opt("Too many arguments.",
+		usage_msg_opt(_("Too many arguments."),
 			builtin_clone_usage, builtin_clone_options);
 
 	if (argc == 0)
-		usage_msg_opt("You must specify a repository to clone.",
+		usage_msg_opt(_("You must specify a repository to clone."),
 			builtin_clone_usage, builtin_clone_options);
 
 	if (option_mirror)
@@ -399,7 +399,7 @@ int cmd_clone(int argc, const char **argv, const char *prefix)
 
 	if (option_bare) {
 		if (option_origin)
-			die("--bare and --origin %s options are incompatible.",
+			die(_("--bare and --origin %s options are incompatible."),
 			    option_origin);
 		option_no_checkout = 1;
 	}
@@ -418,7 +418,7 @@ int cmd_clone(int argc, const char **argv, const char *prefix)
 		repo = repo_name;
 	is_local = path && !is_bundle;
 	if (is_local && option_depth)
-		warning("--depth is ignored in local clones; use file:// instead.");
+		warning(_("--depth is ignored in local clones; use file:// instead."));
 
 	if (argc == 2)
 		dir = xstrdup(argv[1]);
@@ -428,8 +428,8 @@ int cmd_clone(int argc, const char **argv, const char *prefix)
 
 	dest_exists = !stat(dir, &buf);
 	if (dest_exists && !is_empty_dir(dir))
-		die("destination path '%s' already exists and is not "
-			"an empty directory.", dir);
+		die(_("destination path '%s' already exists and is not "
+			"an empty directory."), dir);
 
 	strbuf_addf(&reflog_msg, "clone: from %s", repo);
 
@@ -438,7 +438,7 @@ int cmd_clone(int argc, const char **argv, const char *prefix)
 	else {
 		work_tree = getenv("GIT_WORK_TREE");
 		if (work_tree && !stat(work_tree, &buf))
-			die("working tree '%s' already exists.", work_tree);
+			die(_("working tree '%s' already exists."), work_tree);
 	}
 
 	if (option_bare || work_tree)
@@ -451,10 +451,10 @@ int cmd_clone(int argc, const char **argv, const char *prefix)
 	if (!option_bare) {
 		junk_work_tree = work_tree;
 		if (safe_create_leading_directories_const(work_tree) < 0)
-			die_errno("could not create leading directories of '%s'",
+			die_errno(_("could not create leading directories of '%s'"),
 				  work_tree);
 		if (!dest_exists && mkdir(work_tree, 0755))
-			die_errno("could not create work tree dir '%s'.",
+			die_errno(_("could not create work tree dir '%s'."),
 				  work_tree);
 		set_git_work_tree(work_tree);
 	}
@@ -465,7 +465,7 @@ int cmd_clone(int argc, const char **argv, const char *prefix)
 	setenv(CONFIG_ENVIRONMENT, mkpath("%s/config", git_dir), 1);
 
 	if (safe_create_leading_directories_const(git_dir) < 0)
-		die("could not create leading directories of '%s'", git_dir);
+		die(_("could not create leading directories of '%s'"), git_dir);
 	set_git_dir(make_absolute_path(git_dir));
 
 	if (0 <= option_verbosity)
@@ -527,7 +527,7 @@ int cmd_clone(int argc, const char **argv, const char *prefix)
 		transport = transport_get(remote, remote->url[0]);
 
 		if (!transport->get_refs_list || !transport->fetch)
-			die("Don't know how to clone %s", transport->url);
+			die(_("Don't know how to clone %s"), transport->url);
 
 		transport_set_option(transport, TRANS_OPT_KEEP, "yes");
 
@@ -566,8 +566,8 @@ int cmd_clone(int argc, const char **argv, const char *prefix)
 			strbuf_release(&head);
 
 			if (!our_head_points_at) {
-				warning("Remote branch %s not found in "
-					"upstream %s, using HEAD instead",
+				warning(_("Remote branch %s not found in "
+					"upstream %s, using HEAD instead"),
 					option_branch, option_origin);
 				our_head_points_at = remote_head_points_at;
 			}
@@ -576,7 +576,7 @@ int cmd_clone(int argc, const char **argv, const char *prefix)
 			our_head_points_at = remote_head_points_at;
 	}
 	else {
-		warning("You appear to have cloned an empty repository.");
+		warning(_("You appear to have cloned an empty repository."));
 		our_head_points_at = NULL;
 		remote_head_points_at = NULL;
 		remote_head = NULL;
@@ -618,8 +618,8 @@ int cmd_clone(int argc, const char **argv, const char *prefix)
 	} else {
 		/* Nothing to checkout out */
 		if (!option_no_checkout)
-			warning("remote HEAD refers to nonexistent ref, "
-				"unable to checkout.\n");
+			warning(_("remote HEAD refers to nonexistent ref, "
+				"unable to checkout.\n"));
 		option_no_checkout = 1;
 	}
 
@@ -655,7 +655,7 @@ int cmd_clone(int argc, const char **argv, const char *prefix)
 
 		if (write_cache(fd, active_cache, active_nr) ||
 		    commit_locked_index(lock_file))
-			die("unable to write new index file");
+			die(_("unable to write new index file"));
 
 		err |= run_hook(NULL, "post-checkout", sha1_to_hex(null_sha1),
 				sha1_to_hex(our_head_points_at->old_sha1), "1",
-- 
1.7.2.3

^ permalink raw reply related	[flat|nested] 222+ messages in thread

* [PATCH v4 08/73] gettextize: git-clone "Cloning into" message
  2011-02-22 18:11     ` Junio C Hamano
                         ` (7 preceding siblings ...)
  2011-02-22 23:41       ` [PATCH v4 07/73] gettextize: git-clone basic messages Ævar Arnfjörð Bjarmason
@ 2011-02-22 23:41       ` Ævar Arnfjörð Bjarmason
  2011-02-22 23:41       ` [PATCH v4 09/73] " Ævar Arnfjörð Bjarmason
                         ` (64 subsequent siblings)
  73 siblings, 0 replies; 222+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2011-02-22 23:41 UTC (permalink / raw)
  To: git
  Cc: Junio C Hamano, Jakub Narebski,
	Ævar Arnfjörð Bjarmason, Jonathan Nieder

Separate the "Cloning into %s" and "Cloning into bare repository %s"
messages to make them easier to translate. No noticeable change
intended.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
---
 builtin/clone.c |    9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/builtin/clone.c b/builtin/clone.c
index f46d09b..db0240d 100644
--- a/builtin/clone.c
+++ b/builtin/clone.c
@@ -468,9 +468,12 @@ int cmd_clone(int argc, const char **argv, const char *prefix)
 		die(_("could not create leading directories of '%s'"), git_dir);
 	set_git_dir(make_absolute_path(git_dir));
 
-	if (0 <= option_verbosity)
-		printf("Cloning into %s%s...\n",
-		       option_bare ? "bare repository " : "", dir);
+	if (0 <= option_verbosity) {
+		if (option_bare)
+			printf("Cloning into bare repository %s...\n", dir);
+		else
+			printf("Cloning into %s...\n", dir);
+	}
 	init_db(option_template, INIT_DB_QUIET);
 
 	/*
-- 
1.7.2.3

^ permalink raw reply related	[flat|nested] 222+ messages in thread

* [PATCH v4 09/73] gettextize: git-clone "Cloning into" message
  2011-02-22 18:11     ` Junio C Hamano
                         ` (8 preceding siblings ...)
  2011-02-22 23:41       ` [PATCH v4 08/73] gettextize: git-clone "Cloning into" message Ævar Arnfjörð Bjarmason
@ 2011-02-22 23:41       ` Ævar Arnfjörð Bjarmason
  2011-02-22 23:41       ` [PATCH v4 10/73] gettextize: git-add basic messages Ævar Arnfjörð Bjarmason
                         ` (63 subsequent siblings)
  73 siblings, 0 replies; 222+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2011-02-22 23:41 UTC (permalink / raw)
  To: git
  Cc: Junio C Hamano, Jakub Narebski,
	Ævar Arnfjörð Bjarmason, Jonathan Nieder

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
---
 builtin/clone.c  |    4 ++--
 t/t5601-clone.sh |    2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/builtin/clone.c b/builtin/clone.c
index db0240d..b9394c4 100644
--- a/builtin/clone.c
+++ b/builtin/clone.c
@@ -470,9 +470,9 @@ int cmd_clone(int argc, const char **argv, const char *prefix)
 
 	if (0 <= option_verbosity) {
 		if (option_bare)
-			printf("Cloning into bare repository %s...\n", dir);
+			printf(_("Cloning into bare repository %s...\n"), dir);
 		else
-			printf("Cloning into %s...\n", dir);
+			printf(_("Cloning into %s...\n"), dir);
 	}
 	init_db(option_template, INIT_DB_QUIET);
 
diff --git a/t/t5601-clone.sh b/t/t5601-clone.sh
index 987e0c8..9e6fa3b 100755
--- a/t/t5601-clone.sh
+++ b/t/t5601-clone.sh
@@ -31,7 +31,7 @@ test_expect_success 'clone with excess parameters (2)' '
 
 '
 
-test_expect_success 'output from clone' '
+test_expect_success C_LOCALE_OUTPUT 'output from clone' '
 	rm -fr dst &&
 	git clone -n "file://$(pwd)/src" dst >output &&
 	test $(grep Clon output | wc -l) = 1
-- 
1.7.2.3

^ permalink raw reply related	[flat|nested] 222+ messages in thread

* [PATCH v4 10/73] gettextize: git-add basic messages
  2011-02-22 18:11     ` Junio C Hamano
                         ` (9 preceding siblings ...)
  2011-02-22 23:41       ` [PATCH v4 09/73] " Ævar Arnfjörð Bjarmason
@ 2011-02-22 23:41       ` Ævar Arnfjörð Bjarmason
  2011-02-22 23:41       ` [PATCH v4 11/73] gettextize: git-add "The following paths are ignored" message Ævar Arnfjörð Bjarmason
                         ` (62 subsequent siblings)
  73 siblings, 0 replies; 222+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2011-02-22 23:41 UTC (permalink / raw)
  To: git
  Cc: Junio C Hamano, Jakub Narebski,
	Ævar Arnfjörð Bjarmason, Jonathan Nieder

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
---
 builtin/add.c |   36 ++++++++++++++++++------------------
 1 files changed, 18 insertions(+), 18 deletions(-)

diff --git a/builtin/add.c b/builtin/add.c
index 42c906e..a9a78f4 100644
--- a/builtin/add.c
+++ b/builtin/add.c
@@ -38,7 +38,7 @@ static void update_callback(struct diff_queue_struct *q,
 		const char *path = p->one->path;
 		switch (p->status) {
 		default:
-			die("unexpected diff status %c", p->status);
+			die(_("unexpected diff status %c"), p->status);
 		case DIFF_STATUS_UNMERGED:
 			/*
 			 * ADD_CACHE_IGNORE_REMOVAL is unset if "git
@@ -64,7 +64,7 @@ static void update_callback(struct diff_queue_struct *q,
 		case DIFF_STATUS_TYPE_CHANGED:
 			if (add_file_to_index(&the_index, path, data->flags)) {
 				if (!(data->flags & ADD_CACHE_IGNORE_ERRORS))
-					die("updating files failed");
+					die(_("updating files failed"));
 				data->add_errors++;
 			}
 			break;
@@ -172,7 +172,7 @@ static void treat_gitlinks(const char **pathspec)
 					/* strip trailing slash */
 					pathspec[j] = xstrndup(ce->name, len);
 				else
-					die ("Path '%s' is in submodule '%.*s'",
+					die (_("Path '%s' is in submodule '%.*s'"),
 						pathspec[j], len, ce->name);
 			}
 		}
@@ -191,7 +191,7 @@ static void refresh(int verbose, const char **pathspec)
 		      pathspec, seen, "Unstaged changes after refreshing the index:");
 	for (i = 0; i < specs; i++) {
 		if (!seen[i])
-			die("pathspec '%s' did not match any files", pathspec[i]);
+			die(_("pathspec '%s' did not match any files"), pathspec[i]);
 	}
         free(seen);
 }
@@ -205,7 +205,7 @@ static const char **validate_pathspec(int argc, const char **argv, const char *p
 		for (p = pathspec; *p; p++) {
 			if (has_symlink_leading_path(*p, strlen(*p))) {
 				int len = prefix ? strlen(prefix) : 0;
-				die("'%s' is beyond a symbolic link", *p + len);
+				die(_("'%s' is beyond a symbolic link"), *p + len);
 			}
 		}
 	}
@@ -272,7 +272,7 @@ static int edit_patch(int argc, const char **argv, const char *prefix)
 	git_config(git_diff_basic_config, NULL); /* no "diff" UI options */
 
 	if (read_cache() < 0)
-		die ("Could not read the index");
+		die (_("Could not read the index"));
 
 	init_revisions(&rev, prefix);
 	rev.diffopt.context = 7;
@@ -281,24 +281,24 @@ static int edit_patch(int argc, const char **argv, const char *prefix)
 	rev.diffopt.output_format = DIFF_FORMAT_PATCH;
 	out = open(file, O_CREAT | O_WRONLY, 0644);
 	if (out < 0)
-		die ("Could not open '%s' for writing.", file);
+		die (_("Could not open '%s' for writing."), file);
 	rev.diffopt.file = xfdopen(out, "w");
 	rev.diffopt.close_file = 1;
 	if (run_diff_files(&rev, 0))
-		die ("Could not write patch");
+		die (_("Could not write patch"));
 
 	launch_editor(file, NULL, NULL);
 
 	if (stat(file, &st))
-		die_errno("Could not stat '%s'", file);
+		die_errno(_("Could not stat '%s'"), file);
 	if (!st.st_size)
-		die("Empty patch. Aborted.");
+		die(_("Empty patch. Aborted."));
 
 	memset(&child, 0, sizeof(child));
 	child.git_cmd = 1;
 	child.argv = apply_argv;
 	if (run_command(&child))
-		die ("Could not apply '%s'", file);
+		die (_("Could not apply '%s'"), file);
 
 	unlink(file);
 	return 0;
@@ -354,7 +354,7 @@ static int add_files(struct dir_struct *dir, int flags)
 	for (i = 0; i < dir->nr; i++)
 		if (add_file_to_cache(dir->entries[i]->name, flags)) {
 			if (!ignore_add_errors)
-				die("adding files failed");
+				die(_("adding files failed"));
 			exit_status = 1;
 		}
 	return exit_status;
@@ -386,9 +386,9 @@ int cmd_add(int argc, const char **argv, const char *prefix)
 	argv++;
 
 	if (addremove && take_worktree_changes)
-		die("-A and -u are mutually incompatible");
+		die(_("-A and -u are mutually incompatible"));
 	if (!show_only && ignore_missing)
-		die("Option --ignore-missing can only be used together with --dry-run");
+		die(_("Option --ignore-missing can only be used together with --dry-run"));
 	if ((addremove || take_worktree_changes) && !argc) {
 		static const char *here[2] = { ".", NULL };
 		argc = 1;
@@ -408,14 +408,14 @@ int cmd_add(int argc, const char **argv, const char *prefix)
 		  ? ADD_CACHE_IGNORE_REMOVAL : 0));
 
 	if (require_pathspec && argc == 0) {
-		fprintf(stderr, "Nothing specified, nothing added.\n");
-		fprintf(stderr, "Maybe you wanted to say 'git add .'?\n");
+		fprintf(stderr, _("Nothing specified, nothing added.\n"));
+		fprintf(stderr, _("Maybe you wanted to say 'git add .'?\n"));
 		return 0;
 	}
 	pathspec = validate_pathspec(argc, argv, prefix);
 
 	if (read_cache() < 0)
-		die("index file corrupt");
+		die(_("index file corrupt"));
 	treat_gitlinks(pathspec);
 
 	if (add_new_files) {
@@ -467,7 +467,7 @@ int cmd_add(int argc, const char **argv, const char *prefix)
 	if (active_cache_changed) {
 		if (write_cache(newfd, active_cache, active_nr) ||
 		    commit_locked_index(&lock_file))
-			die("Unable to write new index file");
+			die(_("Unable to write new index file"));
 	}
 
 	return exit_status;
-- 
1.7.2.3

^ permalink raw reply related	[flat|nested] 222+ messages in thread

* [PATCH v4 11/73] gettextize: git-add "The following paths are ignored" message
  2011-02-22 18:11     ` Junio C Hamano
                         ` (10 preceding siblings ...)
  2011-02-22 23:41       ` [PATCH v4 10/73] gettextize: git-add basic messages Ævar Arnfjörð Bjarmason
@ 2011-02-22 23:41       ` Ævar Arnfjörð Bjarmason
  2011-02-22 23:41       ` [PATCH v4 12/73] gettextize: git-add "did not match any files" message Ævar Arnfjörð Bjarmason
                         ` (61 subsequent siblings)
  73 siblings, 0 replies; 222+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2011-02-22 23:41 UTC (permalink / raw)
  To: git
  Cc: Junio C Hamano, Jakub Narebski,
	Ævar Arnfjörð Bjarmason, Jonathan Nieder

The tests t2204 (.gitignore) and t3700 (add) explicitly check for
these messages, so while at it, split each relevant test into a part
that just checks "git add"'s exit status and a part that checks
porcelain output.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
---
 builtin/add.c          |    8 ++++----
 t/t2204-add-ignored.sh |   37 +++++++++++++++++++++++++------------
 t/t3700-add.sh         |    5 ++++-
 3 files changed, 33 insertions(+), 17 deletions(-)

diff --git a/builtin/add.c b/builtin/add.c
index a9a78f4..21776ac 100644
--- a/builtin/add.c
+++ b/builtin/add.c
@@ -307,7 +307,7 @@ static int edit_patch(int argc, const char **argv, const char *prefix)
 static struct lock_file lock_file;
 
 static const char ignore_error[] =
-"The following paths are ignored by one of your .gitignore files:\n";
+N_("The following paths are ignored by one of your .gitignore files:\n");
 
 static int verbose = 0, show_only = 0, ignored_too = 0, refresh_only = 0;
 static int ignore_add_errors, addremove, intent_to_add, ignore_missing = 0;
@@ -344,11 +344,11 @@ static int add_files(struct dir_struct *dir, int flags)
 	int i, exit_status = 0;
 
 	if (dir->ignored_nr) {
-		fprintf(stderr, ignore_error);
+		fprintf(stderr, _(ignore_error));
 		for (i = 0; i < dir->ignored_nr; i++)
 			fprintf(stderr, "%s\n", dir->ignored[i]->name);
-		fprintf(stderr, "Use -f if you really want to add them.\n");
-		die("no files added");
+		fprintf(stderr, _("Use -f if you really want to add them.\n"));
+		die(_("no files added"));
 	}
 
 	for (i = 0; i < dir->nr; i++)
diff --git a/t/t2204-add-ignored.sh b/t/t2204-add-ignored.sh
index 24afdab..4975336 100755
--- a/t/t2204-add-ignored.sh
+++ b/t/t2204-add-ignored.sh
@@ -31,18 +31,21 @@ do
 		rm -f .git/index &&
 		test_must_fail git add "$i" 2>err &&
 		git ls-files "$i" >out &&
-		! test -s out &&
-		grep -e "Use -f if" err &&
-		cat err
+		! test -s out
+	'
+
+	test_expect_success C_LOCALE_OUTPUT "complaints for ignored $i output" '
+		grep -e "Use -f if" err
 	'
 
 	test_expect_success "complaints for ignored $i with unignored file" '
 		rm -f .git/index &&
 		test_must_fail git add "$i" file 2>err &&
 		git ls-files "$i" >out &&
-		! test -s out &&
-		grep -e "Use -f if" err &&
-		cat err
+		! test -s out
+	'
+	test_expect_success C_LOCALE_OUTPUT "complaints for ignored $i with unignored file output" '
+		grep -e "Use -f if" err
 	'
 done
 
@@ -54,9 +57,14 @@ do
 			cd dir &&
 			test_must_fail git add "$i" 2>err &&
 			git ls-files "$i" >out &&
-			! test -s out &&
-			grep -e "Use -f if" err &&
-			cat err
+			! test -s out
+		)
+	'
+
+	test_expect_success C_LOCALE_OUTPUT "complaints for ignored $i in dir output" '
+		(
+			cd dir &&
+			grep -e "Use -f if" err
 		)
 	'
 done
@@ -69,9 +77,14 @@ do
 			cd sub &&
 			test_must_fail git add "$i" 2>err &&
 			git ls-files "$i" >out &&
-			! test -s out &&
-			grep -e "Use -f if" err &&
-			cat err
+			! test -s out
+		)
+	'
+
+	test_expect_success C_LOCALE_OUTPUT "complaints for ignored $i in sub output" '
+		(
+			cd sub &&
+			grep -e "Use -f if" err
 		)
 	'
 done
diff --git a/t/t3700-add.sh b/t/t3700-add.sh
index ec71083..ac115ed 100755
--- a/t/t3700-add.sh
+++ b/t/t3700-add.sh
@@ -283,7 +283,10 @@ add 'track-this'
 EOF
 
 test_expect_success 'git add --dry-run --ignore-missing of non-existing file' '
-	test_must_fail git add --dry-run --ignore-missing track-this ignored-file >actual.out 2>actual.err &&
+	test_must_fail git add --dry-run --ignore-missing track-this ignored-file >actual.out 2>actual.err
+'
+
+test_expect_success C_LOCALE_OUTPUT 'git add --dry-run --ignore-missing of non-existing file output' '
 	test_cmp expect.out actual.out &&
 	test_cmp expect.err actual.err
 '
-- 
1.7.2.3

^ permalink raw reply related	[flat|nested] 222+ messages in thread

* [PATCH v4 12/73] gettextize: git-add "did not match any files" message
  2011-02-22 18:11     ` Junio C Hamano
                         ` (11 preceding siblings ...)
  2011-02-22 23:41       ` [PATCH v4 11/73] gettextize: git-add "The following paths are ignored" message Ævar Arnfjörð Bjarmason
@ 2011-02-22 23:41       ` Ævar Arnfjörð Bjarmason
  2011-02-22 23:41       ` [PATCH v4 13/73] gettextize: git-add "remove '%s'" message Ævar Arnfjörð Bjarmason
                         ` (60 subsequent siblings)
  73 siblings, 0 replies; 222+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2011-02-22 23:41 UTC (permalink / raw)
  To: git
  Cc: Junio C Hamano, Jakub Narebski,
	Ævar Arnfjörð Bjarmason, Jonathan Nieder

Make the "did not match any files" message translatable, and skip the
test that checks for it when the C_LOCALE_OUTPUT prereq is not
present.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
---
 builtin/add.c  |    2 +-
 t/t3700-add.sh |    8 ++++++--
 2 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/builtin/add.c b/builtin/add.c
index 21776ac..ffbd459 100644
--- a/builtin/add.c
+++ b/builtin/add.c
@@ -451,7 +451,7 @@ int cmd_add(int argc, const char **argv, const char *prefix)
 					if (excluded(&dir, pathspec[i], &dtype))
 						dir_add_ignored(&dir, pathspec[i], strlen(pathspec[i]));
 				} else
-					die("pathspec '%s' did not match any files",
+					die(_("pathspec '%s' did not match any files"),
 					    pathspec[i]);
 			}
 		}
diff --git a/t/t3700-add.sh b/t/t3700-add.sh
index ac115ed..7de42fa 100755
--- a/t/t3700-add.sh
+++ b/t/t3700-add.sh
@@ -268,8 +268,12 @@ test_expect_success 'git add --dry-run of existing changed file' "
 
 test_expect_success 'git add --dry-run of non-existing file' "
 	echo ignored-file >>.gitignore &&
-	test_must_fail git add --dry-run track-this ignored-file >actual 2>&1 &&
-	echo \"fatal: pathspec 'ignored-file' did not match any files\" | test_cmp - actual
+	test_must_fail git add --dry-run track-this ignored-file >actual 2>&1
+"
+
+test_expect_success C_LOCALE_OUTPUT 'git add --dry-run of an existing file output' "
+	echo \"fatal: pathspec 'ignored-file' did not match any files\" >expect &&
+	test_cmp expect actual
 "
 
 cat >expect.err <<\EOF
-- 
1.7.2.3

^ permalink raw reply related	[flat|nested] 222+ messages in thread

* [PATCH v4 13/73] gettextize: git-add "remove '%s'" message
  2011-02-22 18:11     ` Junio C Hamano
                         ` (12 preceding siblings ...)
  2011-02-22 23:41       ` [PATCH v4 12/73] gettextize: git-add "did not match any files" message Ævar Arnfjörð Bjarmason
@ 2011-02-22 23:41       ` Ævar Arnfjörð Bjarmason
  2011-02-22 23:41       ` [PATCH v4 14/73] gettextize: git-add "Unstaged changes" message Ævar Arnfjörð Bjarmason
                         ` (59 subsequent siblings)
  73 siblings, 0 replies; 222+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2011-02-22 23:41 UTC (permalink / raw)
  To: git
  Cc: Junio C Hamano, Jakub Narebski,
	Ævar Arnfjörð Bjarmason, Jonathan Nieder

Make the "remove '%s'" message translatable. It's displayed under `git
add -u --verbose`. Also skip the corresponding test when output is not
in the C locale.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
---
 builtin/add.c         |    2 +-
 t/t2200-add-update.sh |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/builtin/add.c b/builtin/add.c
index ffbd459..33b9970 100644
--- a/builtin/add.c
+++ b/builtin/add.c
@@ -74,7 +74,7 @@ static void update_callback(struct diff_queue_struct *q,
 			if (!(data->flags & ADD_CACHE_PRETEND))
 				remove_file_from_index(&the_index, path);
 			if (data->flags & (ADD_CACHE_PRETEND|ADD_CACHE_VERBOSE))
-				printf("remove '%s'\n", path);
+				printf(_("remove '%s'\n"), path);
 			break;
 		}
 	}
diff --git a/t/t2200-add-update.sh b/t/t2200-add-update.sh
index 0692427..856e7da 100755
--- a/t/t2200-add-update.sh
+++ b/t/t2200-add-update.sh
@@ -111,7 +111,7 @@ test_expect_success 'touch and then add explicitly' '
 
 '
 
-test_expect_success 'add -n -u should not add but just report' '
+test_expect_success C_LOCALE_OUTPUT 'add -n -u should not add but just report' '
 
 	(
 		echo "add '\''check'\''" &&
-- 
1.7.2.3

^ permalink raw reply related	[flat|nested] 222+ messages in thread

* [PATCH v4 14/73] gettextize: git-add "Unstaged changes" message
  2011-02-22 18:11     ` Junio C Hamano
                         ` (13 preceding siblings ...)
  2011-02-22 23:41       ` [PATCH v4 13/73] gettextize: git-add "remove '%s'" message Ævar Arnfjörð Bjarmason
@ 2011-02-22 23:41       ` Ævar Arnfjörð Bjarmason
  2011-02-22 23:41       ` [PATCH v4 15/73] gettextize: git-branch basic messages Ævar Arnfjörð Bjarmason
                         ` (58 subsequent siblings)
  73 siblings, 0 replies; 222+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2011-02-22 23:41 UTC (permalink / raw)
  To: git
  Cc: Junio C Hamano, Jakub Narebski,
	Ævar Arnfjörð Bjarmason, Jonathan Nieder

Make the "Unstaged changes after refreshing the index:"
translatable. It's displayed under `git add --refresh --verbose`.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
---
 builtin/add.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/builtin/add.c b/builtin/add.c
index 33b9970..a512597 100644
--- a/builtin/add.c
+++ b/builtin/add.c
@@ -188,7 +188,7 @@ static void refresh(int verbose, const char **pathspec)
 		/* nothing */;
 	seen = xcalloc(specs, 1);
 	refresh_index(&the_index, verbose ? REFRESH_IN_PORCELAIN : REFRESH_QUIET,
-		      pathspec, seen, "Unstaged changes after refreshing the index:");
+		      pathspec, seen, _("Unstaged changes after refreshing the index:"));
 	for (i = 0; i < specs; i++) {
 		if (!seen[i])
 			die(_("pathspec '%s' did not match any files"), pathspec[i]);
-- 
1.7.2.3

^ permalink raw reply related	[flat|nested] 222+ messages in thread

* [PATCH v4 15/73] gettextize: git-branch basic messages
  2011-02-22 18:11     ` Junio C Hamano
                         ` (14 preceding siblings ...)
  2011-02-22 23:41       ` [PATCH v4 14/73] gettextize: git-add "Unstaged changes" message Ævar Arnfjörð Bjarmason
@ 2011-02-22 23:41       ` Ævar Arnfjörð Bjarmason
  2011-02-22 23:41       ` [PATCH v4 16/73] gettextize: git-branch "remote branch '%s' not found" message Ævar Arnfjörð Bjarmason
                         ` (57 subsequent siblings)
  73 siblings, 0 replies; 222+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2011-02-22 23:41 UTC (permalink / raw)
  To: git
  Cc: Junio C Hamano, Jakub Narebski, Ævar Arnfjörð Bjarmason

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
---
 builtin/branch.c |   56 +++++++++++++++++++++++++++---------------------------
 1 files changed, 28 insertions(+), 28 deletions(-)

diff --git a/builtin/branch.c b/builtin/branch.c
index 9e546e4..6695db4 100644
--- a/builtin/branch.c
+++ b/builtin/branch.c
@@ -133,12 +133,12 @@ static int branch_merged(int kind, const char *name,
 	if ((head_rev != reference_rev) &&
 	    in_merge_bases(rev, &head_rev, 1) != merged) {
 		if (merged)
-			warning("deleting branch '%s' that has been merged to\n"
-				"         '%s', but it is not yet merged to HEAD.",
+			warning(_("deleting branch '%s' that has been merged to\n"
+				"         '%s', but it is not yet merged to HEAD."),
 				name, reference_name);
 		else
-			warning("not deleting branch '%s' that is not yet merged to\n"
-				"         '%s', even though it is merged to HEAD.",
+			warning(_("not deleting branch '%s' that is not yet merged to\n"
+				"         '%s', even though it is merged to HEAD."),
 				name, reference_name);
 	}
 	return merged;
@@ -165,19 +165,19 @@ static int delete_branches(int argc, const char **argv, int force, int kinds)
 		remote = "";
 		break;
 	default:
-		die("cannot use -a with -d");
+		die(_("cannot use -a with -d"));
 	}
 
 	if (!force) {
 		head_rev = lookup_commit_reference(head_sha1);
 		if (!head_rev)
-			die("Couldn't look up commit object for HEAD");
+			die(_("Couldn't look up commit object for HEAD"));
 	}
 	for (i = 0; i < argc; i++, strbuf_release(&bname)) {
 		strbuf_branchname(&bname, argv[i]);
 		if (kinds == REF_LOCAL_BRANCH && !strcmp(head, bname.buf)) {
-			error("Cannot delete the branch '%s' "
-			      "which you are currently on.", bname.buf);
+			error(_("Cannot delete the branch '%s' "
+			      "which you are currently on."), bname.buf);
 			ret = 1;
 			continue;
 		}
@@ -186,7 +186,7 @@ static int delete_branches(int argc, const char **argv, int force, int kinds)
 
 		name = xstrdup(mkpath(fmt, bname.buf));
 		if (!resolve_ref(name, sha1, 1, NULL)) {
-			error("%sbranch '%s' not found.",
+			error(_("%sbranch '%s' not found."),
 					remote, bname.buf);
 			ret = 1;
 			continue;
@@ -194,21 +194,21 @@ static int delete_branches(int argc, const char **argv, int force, int kinds)
 
 		rev = lookup_commit_reference(sha1);
 		if (!rev) {
-			error("Couldn't look up commit object for '%s'", name);
+			error(_("Couldn't look up commit object for '%s'"), name);
 			ret = 1;
 			continue;
 		}
 
 		if (!force && !branch_merged(kinds, bname.buf, rev, head_rev)) {
-			error("The branch '%s' is not fully merged.\n"
+			error(_("The branch '%s' is not fully merged.\n"
 			      "If you are sure you want to delete it, "
-			      "run 'git branch -D %s'.", bname.buf, bname.buf);
+			      "run 'git branch -D %s'."), bname.buf, bname.buf);
 			ret = 1;
 			continue;
 		}
 
 		if (delete_ref(name, sha1, 0)) {
-			error("Error deleting %sbranch '%s'", remote,
+			error(_("Error deleting %sbranch '%s'"), remote,
 			      bname.buf);
 			ret = 1;
 		} else {
@@ -218,7 +218,7 @@ static int delete_branches(int argc, const char **argv, int force, int kinds)
 			       find_unique_abbrev(sha1, DEFAULT_ABBREV));
 			strbuf_addf(&buf, "branch.%s", bname.buf);
 			if (git_config_rename_section(buf.buf, NULL) < 0)
-				warning("Update of config-file failed");
+				warning(_("Update of config-file failed"));
 			strbuf_release(&buf);
 		}
 	}
@@ -300,7 +300,7 @@ static int append_ref(const char *refname, const unsigned char *sha1, int flags,
 	if (ref_list->verbose || ref_list->with_commit || merge_filter != NO_FILTER) {
 		commit = lookup_commit_reference_gently(sha1, 1);
 		if (!commit) {
-			cb->ret = error("branch '%s' does not point at a commit", refname);
+			cb->ret = error(_("branch '%s' does not point at a commit"), refname);
 			return 0;
 		}
 
@@ -535,7 +535,7 @@ static int print_ref_list(int kinds, int detached, int verbose, int abbrev, stru
 	free_ref_list(&ref_list);
 
 	if (cb.ret)
-		error("some refs could not be read");
+		error(_("some refs could not be read"));
 
 	return cb.ret;
 }
@@ -548,7 +548,7 @@ static void rename_branch(const char *oldname, const char *newname, int force)
 	int recovery = 0;
 
 	if (!oldname)
-		die("cannot rename the current branch while not on any.");
+		die(_("cannot rename the current branch while not on any."));
 
 	if (strbuf_check_branch_ref(&oldref, oldname)) {
 		/*
@@ -558,35 +558,35 @@ static void rename_branch(const char *oldname, const char *newname, int force)
 		if (resolve_ref(oldref.buf, sha1, 1, NULL))
 			recovery = 1;
 		else
-			die("Invalid branch name: '%s'", oldname);
+			die(_("Invalid branch name: '%s'"), oldname);
 	}
 
 	if (strbuf_check_branch_ref(&newref, newname))
-		die("Invalid branch name: '%s'", newname);
+		die(_("Invalid branch name: '%s'"), newname);
 
 	if (resolve_ref(newref.buf, sha1, 1, NULL) && !force)
-		die("A branch named '%s' already exists.", newref.buf + 11);
+		die(_("A branch named '%s' already exists."), newref.buf + 11);
 
 	strbuf_addf(&logmsg, "Branch: renamed %s to %s",
 		 oldref.buf, newref.buf);
 
 	if (rename_ref(oldref.buf, newref.buf, logmsg.buf))
-		die("Branch rename failed");
+		die(_("Branch rename failed"));
 	strbuf_release(&logmsg);
 
 	if (recovery)
-		warning("Renamed a misnamed branch '%s' away", oldref.buf + 11);
+		warning(_("Renamed a misnamed branch '%s' away"), oldref.buf + 11);
 
 	/* no need to pass logmsg here as HEAD didn't really move */
 	if (!strcmp(oldname, head) && create_symref("HEAD", newref.buf, NULL))
-		die("Branch renamed to %s, but HEAD is not updated!", newname);
+		die(_("Branch renamed to %s, but HEAD is not updated!"), newname);
 
 	strbuf_addf(&oldsection, "branch.%s", oldref.buf + 11);
 	strbuf_release(&oldref);
 	strbuf_addf(&newsection, "branch.%s", newref.buf + 11);
 	strbuf_release(&newref);
 	if (git_config_rename_section(oldsection.buf, newsection.buf) < 0)
-		die("Branch is renamed, but update of config-file failed");
+		die(_("Branch is renamed, but update of config-file failed"));
 	strbuf_release(&oldsection);
 	strbuf_release(&newsection);
 }
@@ -601,7 +601,7 @@ static int opt_parse_merge_filter(const struct option *opt, const char *arg, int
 	if (!arg)
 		arg = "HEAD";
 	if (get_sha1(arg, merge_filter_ref))
-		die("malformed object name %s", arg);
+		die(_("malformed object name %s"), arg);
 	return 0;
 }
 
@@ -675,13 +675,13 @@ int cmd_branch(int argc, const char **argv, const char *prefix)
 
 	head = resolve_ref("HEAD", head_sha1, 0, NULL);
 	if (!head)
-		die("Failed to resolve HEAD as a valid ref.");
+		die(_("Failed to resolve HEAD as a valid ref."));
 	head = xstrdup(head);
 	if (!strcmp(head, "HEAD")) {
 		detached = 1;
 	} else {
 		if (prefixcmp(head, "refs/heads/"))
-			die("HEAD not found below refs/heads!");
+			die(_("HEAD not found below refs/heads!"));
 		head += 11;
 	}
 	hashcpy(merge_filter_ref, head_sha1);
@@ -701,7 +701,7 @@ int cmd_branch(int argc, const char **argv, const char *prefix)
 		rename_branch(argv[0], argv[1], rename > 1);
 	else if (argc <= 2) {
 		if (kinds != REF_LOCAL_BRANCH)
-			die("-a and -r options to 'git branch' do not make sense with a branch name");
+			die(_("-a and -r options to 'git branch' do not make sense with a branch name"));
 		create_branch(head, argv[0], (argc == 2) ? argv[1] : head,
 			      force_create, reflog, track);
 	} else
-- 
1.7.2.3

^ permalink raw reply related	[flat|nested] 222+ messages in thread

* [PATCH v4 16/73] gettextize: git-branch "remote branch '%s' not found" message
  2011-02-22 18:11     ` Junio C Hamano
                         ` (15 preceding siblings ...)
  2011-02-22 23:41       ` [PATCH v4 15/73] gettextize: git-branch basic messages Ævar Arnfjörð Bjarmason
@ 2011-02-22 23:41       ` Ævar Arnfjörð Bjarmason
  2011-02-27 19:14         ` Piotr Krukowiecki
  2011-02-22 23:41       ` [PATCH v4 17/73] gettextize: git-branch "Deleted branch [...]" message Ævar Arnfjörð Bjarmason
                         ` (56 subsequent siblings)
  73 siblings, 1 reply; 222+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2011-02-22 23:41 UTC (permalink / raw)
  To: git
  Cc: Junio C Hamano, Jakub Narebski, Ævar Arnfjörð Bjarmason

This could be done better by splitting it up, but it would change too
much code, which I'm trying to avoid at this point. Instead add a
TRANSLATORS comment to explain what "remote " does.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
---
 builtin/branch.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/builtin/branch.c b/builtin/branch.c
index 6695db4..e9d8a5a 100644
--- a/builtin/branch.c
+++ b/builtin/branch.c
@@ -157,7 +157,8 @@ static int delete_branches(int argc, const char **argv, int force, int kinds)
 	switch (kinds) {
 	case REF_REMOTE_BRANCH:
 		fmt = "refs/remotes/%s";
-		remote = "remote ";
+		/* TRANSLATORS: This is "remote " in "remote branch '%s' not found" */
+		remote = _("remote ");
 		force = 1;
 		break;
 	case REF_LOCAL_BRANCH:
-- 
1.7.2.3

^ permalink raw reply related	[flat|nested] 222+ messages in thread

* [PATCH v4 17/73] gettextize: git-branch "Deleted branch [...]" message
  2011-02-22 18:11     ` Junio C Hamano
                         ` (16 preceding siblings ...)
  2011-02-22 23:41       ` [PATCH v4 16/73] gettextize: git-branch "remote branch '%s' not found" message Ævar Arnfjörð Bjarmason
@ 2011-02-22 23:41       ` Ævar Arnfjörð Bjarmason
  2011-02-25  7:54         ` Jonathan Nieder
  2011-02-22 23:41       ` [PATCH v4 18/73] gettextize: git-branch "git branch -v" messages Ævar Arnfjörð Bjarmason
                         ` (55 subsequent siblings)
  73 siblings, 1 reply; 222+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2011-02-22 23:41 UTC (permalink / raw)
  To: git
  Cc: Junio C Hamano, Jakub Narebski, Ævar Arnfjörð Bjarmason

Gettextize the "Deleted %sbranch %s (was %s).\n" messages. test in
t3200-branch.sh explicitly checked for this message. Change it to skip
under GETTEXT_POISON=YesPlease.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
---
 builtin/branch.c  |    2 +-
 t/t3200-branch.sh |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/builtin/branch.c b/builtin/branch.c
index e9d8a5a..d276681 100644
--- a/builtin/branch.c
+++ b/builtin/branch.c
@@ -214,7 +214,7 @@ static int delete_branches(int argc, const char **argv, int force, int kinds)
 			ret = 1;
 		} else {
 			struct strbuf buf = STRBUF_INIT;
-			printf("Deleted %sbranch %s (was %s).\n", remote,
+			printf(_("Deleted %sbranch %s (was %s).\n"), remote,
 			       bname.buf,
 			       find_unique_abbrev(sha1, DEFAULT_ABBREV));
 			strbuf_addf(&buf, "branch.%s", bname.buf);
diff --git a/t/t3200-branch.sh b/t/t3200-branch.sh
index f308235..940d7ae 100755
--- a/t/t3200-branch.sh
+++ b/t/t3200-branch.sh
@@ -203,7 +203,7 @@ test_expect_success 'test deleting branch deletes branch config' \
      test -z "$(git config branch.my7.remote)" &&
      test -z "$(git config branch.my7.merge)"'
 
-test_expect_success 'test deleting branch without config' \
+test_expect_success C_LOCALE_OUTPUT 'test deleting branch without config' \
     'git branch my7 s &&
      sha1=$(git rev-parse my7 | cut -c 1-7) &&
      test "$(git branch -d my7 2>&1)" = "Deleted branch my7 (was $sha1)."'
-- 
1.7.2.3

^ permalink raw reply related	[flat|nested] 222+ messages in thread

* [PATCH v4 18/73] gettextize: git-branch "git branch -v" messages
  2011-02-22 18:11     ` Junio C Hamano
                         ` (17 preceding siblings ...)
  2011-02-22 23:41       ` [PATCH v4 17/73] gettextize: git-branch "Deleted branch [...]" message Ævar Arnfjörð Bjarmason
@ 2011-02-22 23:41       ` Ævar Arnfjörð Bjarmason
  2011-02-25  7:52         ` Jonathan Nieder
  2011-02-22 23:41       ` [PATCH v4 19/73] gettextize: git-branch "(no branch)" message Ævar Arnfjörð Bjarmason
                         ` (54 subsequent siblings)
  73 siblings, 1 reply; 222+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2011-02-22 23:41 UTC (permalink / raw)
  To: git
  Cc: Junio C Hamano, Jakub Narebski, Ævar Arnfjörð Bjarmason

Make the "git branch -v" messages translatable, e.g.:

    5054b57 [ahead 8] branch error fixup

This is possibly a plumbing message.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
---
 builtin/branch.c         |    6 +++---
 t/t6040-tracking-info.sh |    2 +-
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/builtin/branch.c b/builtin/branch.c
index d276681..4c1a256 100644
--- a/builtin/branch.c
+++ b/builtin/branch.c
@@ -373,11 +373,11 @@ static void fill_tracking_info(struct strbuf *stat, const char *branch_name,
 		strbuf_addf(stat, "%s: ",
 			shorten_unambiguous_ref(branch->merge[0]->dst, 0));
 	if (!ours)
-		strbuf_addf(stat, "behind %d] ", theirs);
+		strbuf_addf(stat, _("behind %d] "), theirs);
 	else if (!theirs)
-		strbuf_addf(stat, "ahead %d] ", ours);
+		strbuf_addf(stat, _("ahead %d] "), ours);
 	else
-		strbuf_addf(stat, "ahead %d, behind %d] ", ours, theirs);
+		strbuf_addf(stat, _("ahead %d, behind %d] "), ours, theirs);
 }
 
 static int matches_merge_filter(struct commit *commit)
diff --git a/t/t6040-tracking-info.sh b/t/t6040-tracking-info.sh
index 1e0447f..6cad643 100755
--- a/t/t6040-tracking-info.sh
+++ b/t/t6040-tracking-info.sh
@@ -42,7 +42,7 @@ b3 behind 1
 b4 ahead 2
 EOF
 
-test_expect_success 'branch -v' '
+test_expect_success C_LOCALE_OUTPUT 'branch -v' '
 	(
 		cd test &&
 		git branch -v
-- 
1.7.2.3

^ permalink raw reply related	[flat|nested] 222+ messages in thread

* [PATCH v4 19/73] gettextize: git-branch "(no branch)" message
  2011-02-22 18:11     ` Junio C Hamano
                         ` (18 preceding siblings ...)
  2011-02-22 23:41       ` [PATCH v4 18/73] gettextize: git-branch "git branch -v" messages Ævar Arnfjörð Bjarmason
@ 2011-02-22 23:41       ` Ævar Arnfjörð Bjarmason
  2011-02-22 23:41       ` [PATCH v4 20/73] gettextize: git-checkout basic messages Ævar Arnfjörð Bjarmason
                         ` (53 subsequent siblings)
  73 siblings, 0 replies; 222+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2011-02-22 23:41 UTC (permalink / raw)
  To: git
  Cc: Junio C Hamano, Jakub Narebski, Ævar Arnfjörð Bjarmason

Gettextize the "(no branch)" message that's shown by "git branch" when
you're in a detached HEAD.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
---
 builtin/branch.c         |    2 +-
 t/t3203-branch-output.sh |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/builtin/branch.c b/builtin/branch.c
index 4c1a256..244589e 100644
--- a/builtin/branch.c
+++ b/builtin/branch.c
@@ -476,7 +476,7 @@ static void show_detached(struct ref_list *ref_list)
 
 	if (head_commit && is_descendant_of(head_commit, ref_list->with_commit)) {
 		struct ref_item item;
-		item.name = xstrdup("(no branch)");
+		item.name = xstrdup(_("(no branch)"));
 		item.len = strlen(item.name);
 		item.kind = REF_LOCAL_BRANCH;
 		item.dest = NULL;
diff --git a/t/t3203-branch-output.sh b/t/t3203-branch-output.sh
index 6028748..4ef7d09 100755
--- a/t/t3203-branch-output.sh
+++ b/t/t3203-branch-output.sh
@@ -72,7 +72,7 @@ cat >expect <<'EOF'
   branch-two
   master
 EOF
-test_expect_success 'git branch shows detached HEAD properly' '
+test_expect_success C_LOCALE_OUTPUT 'git branch shows detached HEAD properly' '
 	git checkout HEAD^0 &&
 	git branch >actual &&
 	test_cmp expect actual
-- 
1.7.2.3

^ permalink raw reply related	[flat|nested] 222+ messages in thread

* [PATCH v4 20/73] gettextize: git-checkout basic messages
  2011-02-22 18:11     ` Junio C Hamano
                         ` (19 preceding siblings ...)
  2011-02-22 23:41       ` [PATCH v4 19/73] gettextize: git-branch "(no branch)" message Ævar Arnfjörð Bjarmason
@ 2011-02-22 23:41       ` Ævar Arnfjörð Bjarmason
  2011-02-22 23:41       ` [PATCH v4 21/73] gettextize: git-checkout: our/their version message Ævar Arnfjörð Bjarmason
                         ` (52 subsequent siblings)
  73 siblings, 0 replies; 222+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2011-02-22 23:41 UTC (permalink / raw)
  To: git
  Cc: Junio C Hamano, Jakub Narebski, Ævar Arnfjörð Bjarmason

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
---
 builtin/checkout.c |   68 ++++++++++++++++++++++++++--------------------------
 1 files changed, 34 insertions(+), 34 deletions(-)

diff --git a/builtin/checkout.c b/builtin/checkout.c
index cd7f56e..b5060ab 100644
--- a/builtin/checkout.c
+++ b/builtin/checkout.c
@@ -116,7 +116,7 @@ static int check_all_stages(struct cache_entry *ce, int pos)
 	    ce_stage(active_cache[pos+1]) != 2 ||
 	    strcmp(active_cache[pos+2]->name, ce->name) ||
 	    ce_stage(active_cache[pos+2]) != 3)
-		return error("path '%s' does not have all three versions",
+		return error(_("path '%s' does not have all three versions"),
 			     ce->name);
 	return 0;
 }
@@ -150,7 +150,7 @@ static int checkout_merged(int pos, struct checkout *state)
 	    ce_stage(active_cache[pos+1]) != 2 ||
 	    strcmp(active_cache[pos+2]->name, path) ||
 	    ce_stage(active_cache[pos+2]) != 3)
-		return error("path '%s' does not have all 3 versions", path);
+		return error(_("path '%s' does not have all 3 versions"), path);
 
 	read_mmblob(&ancestor, active_cache[pos]->sha1);
 	read_mmblob(&ours, active_cache[pos+1]->sha1);
@@ -167,7 +167,7 @@ static int checkout_merged(int pos, struct checkout *state)
 	free(theirs.ptr);
 	if (status < 0 || !result_buf.ptr) {
 		free(result_buf.ptr);
-		return error("path '%s': cannot merge", path);
+		return error(_("path '%s': cannot merge"), path);
 	}
 
 	/*
@@ -184,12 +184,12 @@ static int checkout_merged(int pos, struct checkout *state)
 	 */
 	if (write_sha1_file(result_buf.ptr, result_buf.size,
 			    blob_type, sha1))
-		die("Unable to add merge result for '%s'", path);
+		die(_("Unable to add merge result for '%s'"), path);
 	ce = make_cache_entry(create_ce_mode(active_cache[pos+1]->ce_mode),
 			      sha1,
 			      path, 2, 0);
 	if (!ce)
-		die("make_cache_entry failed for path '%s'", path);
+		die(_("make_cache_entry failed for path '%s'"), path);
 	status = checkout_entry(ce, state, NULL);
 	return status;
 }
@@ -211,7 +211,7 @@ static int checkout_paths(struct tree *source_tree, const char **pathspec,
 
 	newfd = hold_locked_index(lock_file, 1);
 	if (read_cache_preload(pathspec) < 0)
-		return error("corrupt index file");
+		return error(_("corrupt index file"));
 
 	if (source_tree)
 		read_tree_some(source_tree, pathspec);
@@ -239,14 +239,14 @@ static int checkout_paths(struct tree *source_tree, const char **pathspec,
 			if (!ce_stage(ce))
 				continue;
 			if (opts->force) {
-				warning("path '%s' is unmerged", ce->name);
+				warning(_("path '%s' is unmerged"), ce->name);
 			} else if (stage) {
 				errs |= check_stage(stage, ce, pos);
 			} else if (opts->merge) {
 				errs |= check_all_stages(ce, pos);
 			} else {
 				errs = 1;
-				error("path '%s' is unmerged", ce->name);
+				error(_("path '%s' is unmerged"), ce->name);
 			}
 			pos = skip_same_name(ce, pos) - 1;
 		}
@@ -275,7 +275,7 @@ static int checkout_paths(struct tree *source_tree, const char **pathspec,
 
 	if (write_cache(newfd, active_cache, active_nr) ||
 	    commit_locked_index(lock_file))
-		die("unable to write new index file");
+		die(_("unable to write new index file"));
 
 	resolve_ref("HEAD", rev, 0, &flag);
 	head = lookup_commit_reference_gently(rev, 1);
@@ -292,7 +292,7 @@ static void show_local_changes(struct object *head, struct diff_options *opts)
 	rev.diffopt.flags = opts->flags;
 	rev.diffopt.output_format |= DIFF_FORMAT_NAME_STATUS;
 	if (diff_setup_done(&rev.diffopt) < 0)
-		die("diff_setup_done failed");
+		die(_("diff_setup_done failed"));
 	add_pending_object(&rev, head, NULL);
 	run_diff_index(&rev, 0);
 }
@@ -366,7 +366,7 @@ static int merge_working_tree(struct checkout_opts *opts,
 	int newfd = hold_locked_index(lock_file, 1);
 
 	if (read_cache_preload(NULL) < 0)
-		return error("corrupt index file");
+		return error(_("corrupt index file"));
 
 	resolve_undo_clear();
 	if (opts->force) {
@@ -388,7 +388,7 @@ static int merge_working_tree(struct checkout_opts *opts,
 		refresh_cache(REFRESH_QUIET);
 
 		if (unmerged_cache()) {
-			error("you need to resolve your current index first");
+			error(_("you need to resolve your current index first"));
 			return 1;
 		}
 
@@ -470,7 +470,7 @@ static int merge_working_tree(struct checkout_opts *opts,
 
 	if (write_cache(newfd, active_cache, active_nr) ||
 	    commit_locked_index(lock_file))
-		die("unable to write new index file");
+		die(_("unable to write new index file"));
 
 	if (!opts->force && !opts->quiet)
 		show_local_changes(&new->commit->object, &opts->diff_options);
@@ -519,7 +519,7 @@ static void update_refs_for_switch(struct checkout_opts *opts,
 				temp = log_all_ref_updates;
 				log_all_ref_updates = 1;
 				if (log_ref_setup(ref_name, log_file, sizeof(log_file))) {
-					fprintf(stderr, "Can not do reflog for '%s'\n",
+					fprintf(stderr, _("Can not do reflog for '%s'\n"),
 					    opts->new_orphan_branch);
 					log_all_ref_updates = temp;
 					return;
@@ -545,14 +545,14 @@ static void update_refs_for_switch(struct checkout_opts *opts,
 		create_symref("HEAD", new->path, msg.buf);
 		if (!opts->quiet) {
 			if (old->path && !strcmp(new->path, old->path))
-				fprintf(stderr, "Already on '%s'\n",
+				fprintf(stderr, _("Already on '%s'\n"),
 					new->name);
 			else if (opts->new_branch)
 				fprintf(stderr, "Switched to%s branch '%s'\n",
 					opts->branch_exists ? " and reset" : " a new",
 					new->name);
 			else
-				fprintf(stderr, "Switched to branch '%s'\n",
+				fprintf(stderr, _("Switched to branch '%s'\n"),
 					new->name);
 		}
 		if (old->path && old->name) {
@@ -597,7 +597,7 @@ static int switch_branches(struct checkout_opts *opts, struct branch_info *new)
 		new->name = "HEAD";
 		new->commit = old.commit;
 		if (!new->commit)
-			die("You are on a branch yet to be born");
+			die(_("You are on a branch yet to be born"));
 		parse_commit(new->commit);
 	}
 
@@ -724,7 +724,7 @@ int cmd_checkout(int argc, const char **argv, const char *prefix)
 
 	/* we can assume from now on new_branch = !new_branch_force */
 	if (opts.new_branch && opts.new_branch_force)
-		die("-B cannot be used with -b");
+		die(_("-B cannot be used with -b"));
 
 	/* copy -B over to -b, so that we can just check the latter */
 	if (opts.new_branch_force)
@@ -732,28 +732,28 @@ int cmd_checkout(int argc, const char **argv, const char *prefix)
 
 	if (patch_mode && (opts.track > 0 || opts.new_branch
 			   || opts.new_branch_log || opts.merge || opts.force))
-		die ("--patch is incompatible with all other options");
+		die (_("--patch is incompatible with all other options"));
 
 	/* --track without -b should DWIM */
 	if (0 < opts.track && !opts.new_branch) {
 		const char *argv0 = argv[0];
 		if (!argc || !strcmp(argv0, "--"))
-			die ("--track needs a branch name");
+			die (_("--track needs a branch name"));
 		if (!prefixcmp(argv0, "refs/"))
 			argv0 += 5;
 		if (!prefixcmp(argv0, "remotes/"))
 			argv0 += 8;
 		argv0 = strchr(argv0, '/');
 		if (!argv0 || !argv0[1])
-			die ("Missing branch name; try -b");
+			die (_("Missing branch name; try -b"));
 		opts.new_branch = argv0 + 1;
 	}
 
 	if (opts.new_orphan_branch) {
 		if (opts.new_branch)
-			die("--orphan and -b|-B are mutually exclusive");
+			die(_("--orphan and -b|-B are mutually exclusive"));
 		if (opts.track > 0)
-			die("--orphan cannot be used with -t");
+			die(_("--orphan cannot be used with -t"));
 		opts.new_branch = opts.new_orphan_branch;
 	}
 
@@ -763,7 +763,7 @@ int cmd_checkout(int argc, const char **argv, const char *prefix)
 	}
 
 	if (opts.force && opts.merge)
-		die("git checkout: -f and -m are incompatible");
+		die(_("git checkout: -f and -m are incompatible"));
 
 	/*
 	 * case 1: git checkout <ref> -- [<paths>]
@@ -809,7 +809,7 @@ int cmd_checkout(int argc, const char **argv, const char *prefix)
 
 		if (get_sha1_mb(arg, rev)) {
 			if (has_dash_dash)          /* case (1) */
-				die("invalid reference: %s", arg);
+				die(_("invalid reference: %s"), arg);
 			if (!patch_mode &&
 			    dwim_new_local_branch &&
 			    opts.track == BRANCH_TRACK_UNSPECIFIED &&
@@ -846,7 +846,7 @@ int cmd_checkout(int argc, const char **argv, const char *prefix)
 			source_tree = parse_tree_indirect(rev);
 
 		if (!source_tree)                   /* case (1): want a tree */
-			die("reference is not a tree: %s", arg);
+			die(_("reference is not a tree: %s"), arg);
 		if (!has_dash_dash) {/* case (3 -> 1) */
 			/*
 			 * Do not complain the most common case
@@ -872,7 +872,7 @@ no_reference:
 		const char **pathspec = get_pathspec(prefix, argv);
 
 		if (!pathspec)
-			die("invalid path specification");
+			die(_("invalid path specification"));
 
 		if (patch_mode)
 			return interactive_checkout(new.name, pathspec, &opts);
@@ -880,14 +880,14 @@ no_reference:
 		/* Checkout paths */
 		if (opts.new_branch) {
 			if (argc == 1) {
-				die("git checkout: updating paths is incompatible with switching branches.\nDid you intend to checkout '%s' which can not be resolved as commit?", argv[0]);
+				die(_("git checkout: updating paths is incompatible with switching branches.\nDid you intend to checkout '%s' which can not be resolved as commit?"), argv[0]);
 			} else {
-				die("git checkout: updating paths is incompatible with switching branches.");
+				die(_("git checkout: updating paths is incompatible with switching branches."));
 			}
 		}
 
 		if (1 < !!opts.writeout_stage + !!opts.force + !!opts.merge)
-			die("git checkout: --ours/--theirs, --force and --merge are incompatible when\nchecking out of the index.");
+			die(_("git checkout: --ours/--theirs, --force and --merge are incompatible when\nchecking out of the index."));
 
 		return checkout_paths(source_tree, pathspec, &opts);
 	}
@@ -898,22 +898,22 @@ no_reference:
 	if (opts.new_branch) {
 		struct strbuf buf = STRBUF_INIT;
 		if (strbuf_check_branch_ref(&buf, opts.new_branch))
-			die("git checkout: we do not like '%s' as a branch name.",
+			die(_("git checkout: we do not like '%s' as a branch name."),
 			    opts.new_branch);
 		if (!get_sha1(buf.buf, rev)) {
 			opts.branch_exists = 1;
 			if (!opts.new_branch_force)
-				die("git checkout: branch %s already exists",
+				die(_("git checkout: branch %s already exists"),
 				    opts.new_branch);
 		}
 		strbuf_release(&buf);
 	}
 
 	if (new.name && !new.commit) {
-		die("Cannot switch branch to a non-commit.");
+		die(_("Cannot switch branch to a non-commit."));
 	}
 	if (opts.writeout_stage)
-		die("--ours/--theirs is incompatible with switching branches.");
+		die(_("--ours/--theirs is incompatible with switching branches."));
 
 	return switch_branches(&opts, &new);
 }
-- 
1.7.2.3

^ permalink raw reply related	[flat|nested] 222+ messages in thread

* [PATCH v4 21/73] gettextize: git-checkout: our/their version message
  2011-02-22 18:11     ` Junio C Hamano
                         ` (20 preceding siblings ...)
  2011-02-22 23:41       ` [PATCH v4 20/73] gettextize: git-checkout basic messages Ævar Arnfjörð Bjarmason
@ 2011-02-22 23:41       ` Ævar Arnfjörð Bjarmason
  2011-02-22 23:41       ` [PATCH v4 22/73] gettextize: git-checkout describe_detached_head messages Ævar Arnfjörð Bjarmason
                         ` (51 subsequent siblings)
  73 siblings, 0 replies; 222+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2011-02-22 23:41 UTC (permalink / raw)
  To: git
  Cc: Junio C Hamano, Jakub Narebski, Ævar Arnfjörð Bjarmason

Split up the "does not have our/their version" message to make it
easier to translate.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
---
 builtin/checkout.c |   14 ++++++++------
 1 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/builtin/checkout.c b/builtin/checkout.c
index b5060ab..7ba0788 100644
--- a/builtin/checkout.c
+++ b/builtin/checkout.c
@@ -103,9 +103,10 @@ static int check_stage(int stage, struct cache_entry *ce, int pos)
 			return 0;
 		pos++;
 	}
-	return error("path '%s' does not have %s version",
-		     ce->name,
-		     (stage == 2) ? "our" : "their");
+	if (stage == 2)
+		return error(_("path '%s' does not have our version"), ce->name);
+	else
+		return error(_("path '%s' does not have their version"), ce->name);
 }
 
 static int check_all_stages(struct cache_entry *ce, int pos)
@@ -130,9 +131,10 @@ static int checkout_stage(int stage, struct cache_entry *ce, int pos,
 			return checkout_entry(active_cache[pos], state, NULL);
 		pos++;
 	}
-	return error("path '%s' does not have %s version",
-		     ce->name,
-		     (stage == 2) ? "our" : "their");
+	if (stage == 2)
+		return error(_("path '%s' does not have our version"), ce->name);
+	else
+		return error(_("path '%s' does not have their version"), ce->name);
 }
 
 static int checkout_merged(int pos, struct checkout *state)
-- 
1.7.2.3

^ permalink raw reply related	[flat|nested] 222+ messages in thread

* [PATCH v4 22/73] gettextize: git-checkout describe_detached_head messages
  2011-02-22 18:11     ` Junio C Hamano
                         ` (21 preceding siblings ...)
  2011-02-22 23:41       ` [PATCH v4 21/73] gettextize: git-checkout: our/their version message Ævar Arnfjörð Bjarmason
@ 2011-02-22 23:41       ` Ævar Arnfjörð Bjarmason
  2011-02-22 23:41       ` [PATCH v4 23/73] gettextize: git-checkout "HEAD is now at" message Ævar Arnfjörð Bjarmason
                         ` (50 subsequent siblings)
  73 siblings, 0 replies; 222+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2011-02-22 23:41 UTC (permalink / raw)
  To: git
  Cc: Junio C Hamano, Jakub Narebski, Ævar Arnfjörð Bjarmason

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
---
 builtin/checkout.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/builtin/checkout.c b/builtin/checkout.c
index 7ba0788..698ac63 100644
--- a/builtin/checkout.c
+++ b/builtin/checkout.c
@@ -613,7 +613,7 @@ static int switch_branches(struct checkout_opts *opts, struct branch_info *new)
 	 * to remind the user that it might be lost.
 	 */
 	if (!opts->quiet && !old.path && old.commit && new->commit != old.commit)
-		describe_detached_head("Previous HEAD position was", old.commit);
+		describe_detached_head(_("Previous HEAD position was"), old.commit);
 
 	update_refs_for_switch(opts, &old, new);
 
-- 
1.7.2.3

^ permalink raw reply related	[flat|nested] 222+ messages in thread

* [PATCH v4 23/73] gettextize: git-checkout "HEAD is now at" message
  2011-02-22 18:11     ` Junio C Hamano
                         ` (22 preceding siblings ...)
  2011-02-22 23:41       ` [PATCH v4 22/73] gettextize: git-checkout describe_detached_head messages Ævar Arnfjörð Bjarmason
@ 2011-02-22 23:41       ` Ævar Arnfjörð Bjarmason
  2011-02-25  8:04         ` Jonathan Nieder
  2011-02-22 23:41       ` [PATCH v4 24/73] gettextize: git-checkout "Switched to a .. branch" message Ævar Arnfjörð Bjarmason
                         ` (49 subsequent siblings)
  73 siblings, 1 reply; 222+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2011-02-22 23:41 UTC (permalink / raw)
  To: git
  Cc: Junio C Hamano, Jakub Narebski, Ævar Arnfjörð Bjarmason

Gettextize the "HEAD is now at" messages. Several tests in t7201-co.sh
explicitly checked for this message. Change them to skip under
GETTEXT_POISON=YesPlease.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
---
 builtin/checkout.c |    2 +-
 t/t7201-co.sh      |   10 +++++-----
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/builtin/checkout.c b/builtin/checkout.c
index 698ac63..f833330 100644
--- a/builtin/checkout.c
+++ b/builtin/checkout.c
@@ -571,7 +571,7 @@ static void update_refs_for_switch(struct checkout_opts *opts,
 		if (!opts->quiet) {
 			if (old->path && advice_detached_head)
 				detach_advice(old->path, new->name);
-			describe_detached_head("HEAD is now at", new->commit);
+			describe_detached_head(_("HEAD is now at"), new->commit);
 		}
 	}
 	remove_branch_state();
diff --git a/t/t7201-co.sh b/t/t7201-co.sh
index 1337fa5..fb1fe68 100755
--- a/t/t7201-co.sh
+++ b/t/t7201-co.sh
@@ -223,7 +223,7 @@ test_expect_success 'checkout --merge --conflict=diff3 <branch>' '
 	test_cmp two expect
 '
 
-test_expect_success 'checkout to detach HEAD (with advice declined)' '
+test_expect_success C_LOCALE_OUTPUT 'checkout to detach HEAD (with advice declined)' '
 
 	git config advice.detachedHead false &&
 	git checkout -f renamer && git clean -f &&
@@ -242,7 +242,7 @@ test_expect_success 'checkout to detach HEAD (with advice declined)' '
 	fi
 '
 
-test_expect_success 'checkout to detach HEAD' '
+test_expect_success C_LOCALE_OUTPUT 'checkout to detach HEAD' '
 	git config advice.detachedHead true &&
 	git checkout -f renamer && git clean -f &&
 	git checkout renamer^ 2>messages &&
@@ -260,7 +260,7 @@ test_expect_success 'checkout to detach HEAD' '
 	fi
 '
 
-test_expect_success 'checkout to detach HEAD with branchname^' '
+test_expect_success C_LOCALE_OUTPUT 'checkout to detach HEAD with branchname^' '
 
 	git checkout -f master && git clean -f &&
 	git checkout renamer^ &&
@@ -276,7 +276,7 @@ test_expect_success 'checkout to detach HEAD with branchname^' '
 	fi
 '
 
-test_expect_success 'checkout to detach HEAD with :/message' '
+test_expect_success C_LOCALE_OUTPUT 'checkout to detach HEAD with :/message' '
 
 	git checkout -f master && git clean -f &&
 	git checkout ":/Initial" &&
@@ -292,7 +292,7 @@ test_expect_success 'checkout to detach HEAD with :/message' '
 	fi
 '
 
-test_expect_success 'checkout to detach HEAD with HEAD^0' '
+test_expect_success C_LOCALE_OUTPUT 'checkout to detach HEAD with HEAD^0' '
 
 	git checkout -f master && git clean -f &&
 	git checkout HEAD^0 &&
-- 
1.7.2.3

^ permalink raw reply related	[flat|nested] 222+ messages in thread

* [PATCH v4 24/73] gettextize: git-checkout "Switched to a .. branch" message
  2011-02-22 18:11     ` Junio C Hamano
                         ` (23 preceding siblings ...)
  2011-02-22 23:41       ` [PATCH v4 23/73] gettextize: git-checkout "HEAD is now at" message Ævar Arnfjörð Bjarmason
@ 2011-02-22 23:41       ` Ævar Arnfjörð Bjarmason
  2011-02-25  8:10         ` Jonathan Nieder
  2011-02-22 23:41       ` [PATCH v4 25/73] gettextize: git-commit basic messages Ævar Arnfjörð Bjarmason
                         ` (48 subsequent siblings)
  73 siblings, 1 reply; 222+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2011-02-22 23:41 UTC (permalink / raw)
  To: git
  Cc: Junio C Hamano, Jakub Narebski, Ævar Arnfjörð Bjarmason

Split up the "Switched to and reset branch" and "Switched to a new
branch" messages to make them easier to translate.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
---
 builtin/checkout.c |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/builtin/checkout.c b/builtin/checkout.c
index f833330..2bb7759 100644
--- a/builtin/checkout.c
+++ b/builtin/checkout.c
@@ -550,9 +550,10 @@ static void update_refs_for_switch(struct checkout_opts *opts,
 				fprintf(stderr, _("Already on '%s'\n"),
 					new->name);
 			else if (opts->new_branch)
-				fprintf(stderr, "Switched to%s branch '%s'\n",
-					opts->branch_exists ? " and reset" : " a new",
-					new->name);
+				if (opts->branch_exists)
+					fprintf(stderr, _("Switched to and reset branch '%s'\n"), new->name);
+				else
+					fprintf(stderr, _("Switched to a new branch '%s'\n"), new->name);
 			else
 				fprintf(stderr, _("Switched to branch '%s'\n"),
 					new->name);
-- 
1.7.2.3

^ permalink raw reply related	[flat|nested] 222+ messages in thread

* [PATCH v4 25/73] gettextize: git-commit basic messages
  2011-02-22 18:11     ` Junio C Hamano
                         ` (24 preceding siblings ...)
  2011-02-22 23:41       ` [PATCH v4 24/73] gettextize: git-checkout "Switched to a .. branch" message Ævar Arnfjörð Bjarmason
@ 2011-02-22 23:41       ` Ævar Arnfjörð Bjarmason
  2011-02-22 23:41       ` [PATCH v4 26/73] gettextize: git-commit "middle of a merge" message Ævar Arnfjörð Bjarmason
                         ` (47 subsequent siblings)
  73 siblings, 0 replies; 222+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2011-02-22 23:41 UTC (permalink / raw)
  To: git
  Cc: Junio C Hamano, Jakub Narebski, Ævar Arnfjörð Bjarmason

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
---
 builtin/commit.c |  118 +++++++++++++++++++++++++++---------------------------
 1 files changed, 59 insertions(+), 59 deletions(-)

diff --git a/builtin/commit.c b/builtin/commit.c
index d7f55e3..c57f603 100644
--- a/builtin/commit.c
+++ b/builtin/commit.c
@@ -243,7 +243,7 @@ static void add_remove_files(struct string_list *list)
 
 		if (!lstat(p->string, &st)) {
 			if (add_to_cache(p->string, &st, 0))
-				die("updating files failed");
+				die(_("updating files failed"));
 		} else
 			remove_file_from_cache(p->string);
 	}
@@ -270,7 +270,7 @@ static void create_base_index(void)
 	opts.fn = oneway_merge;
 	tree = parse_tree_indirect(head_sha1);
 	if (!tree)
-		die("failed to unpack HEAD tree object");
+		die(_("failed to unpack HEAD tree object"));
 	parse_tree(tree);
 	init_tree_desc(&t, tree->buffer, tree->size);
 	if (unpack_trees(1, &t, &opts))
@@ -298,9 +298,9 @@ static char *prepare_index(int argc, const char **argv, const char *prefix, int
 		refresh_flags |= REFRESH_UNMERGED;
 	if (interactive) {
 		if (interactive_add(argc, argv, prefix) != 0)
-			die("interactive add failed");
+			die(_("interactive add failed"));
 		if (read_cache_preload(NULL) < 0)
-			die("index file corrupt");
+			die(_("index file corrupt"));
 		commit_style = COMMIT_AS_IS;
 		return get_index_file();
 	}
@@ -309,7 +309,7 @@ static char *prepare_index(int argc, const char **argv, const char *prefix, int
 		pathspec = get_pathspec(prefix, argv);
 
 	if (read_cache_preload(pathspec) < 0)
-		die("index file corrupt");
+		die(_("index file corrupt"));
 
 	/*
 	 * Non partial, non as-is commit.
@@ -329,7 +329,7 @@ static char *prepare_index(int argc, const char **argv, const char *prefix, int
 		refresh_cache_or_die(refresh_flags);
 		if (write_cache(fd, active_cache, active_nr) ||
 		    close_lock_file(&index_lock))
-			die("unable to write new_index file");
+			die(_("unable to write new_index file"));
 		commit_style = COMMIT_NORMAL;
 		return index_lock.filename;
 	}
@@ -349,7 +349,7 @@ static char *prepare_index(int argc, const char **argv, const char *prefix, int
 		if (active_cache_changed) {
 			if (write_cache(fd, active_cache, active_nr) ||
 			    commit_locked_index(&index_lock))
-				die("unable to write new_index file");
+				die(_("unable to write new_index file"));
 		} else {
 			rollback_lock_file(&index_lock);
 		}
@@ -379,7 +379,7 @@ static char *prepare_index(int argc, const char **argv, const char *prefix, int
 	commit_style = COMMIT_PARTIAL;
 
 	if (in_merge)
-		die("cannot do a partial commit during a merge.");
+		die(_("cannot do a partial commit during a merge."));
 
 	memset(&partial, 0, sizeof(partial));
 	partial.strdup_strings = 1;
@@ -388,14 +388,14 @@ static char *prepare_index(int argc, const char **argv, const char *prefix, int
 
 	discard_cache();
 	if (read_cache() < 0)
-		die("cannot read the index");
+		die(_("cannot read the index"));
 
 	fd = hold_locked_index(&index_lock, 1);
 	add_remove_files(&partial);
 	refresh_cache(REFRESH_QUIET);
 	if (write_cache(fd, active_cache, active_nr) ||
 	    close_lock_file(&index_lock))
-		die("unable to write new_index file");
+		die(_("unable to write new_index file"));
 
 	fd = hold_lock_file_for_update(&false_lock,
 				       git_path("next-index-%"PRIuMAX,
@@ -408,7 +408,7 @@ static char *prepare_index(int argc, const char **argv, const char *prefix, int
 
 	if (write_cache(fd, active_cache, active_nr) ||
 	    close_lock_file(&false_lock))
-		die("unable to write temporary index file");
+		die(_("unable to write temporary index file"));
 
 	discard_cache();
 	read_cache_from(false_lock.filename);
@@ -455,7 +455,7 @@ static int is_a_merge(const unsigned char *sha1)
 {
 	struct commit *commit = lookup_commit(sha1);
 	if (!commit || parse_commit(commit))
-		die("could not parse HEAD commit");
+		die(_("could not parse HEAD commit"));
 	return !!(commit->parents && commit->parents->next);
 }
 
@@ -474,13 +474,13 @@ static void determine_author_info(struct strbuf *author_ident)
 
 		a = strstr(use_message_buffer, "\nauthor ");
 		if (!a)
-			die("invalid commit: %s", use_message);
+			die(_("invalid commit: %s"), use_message);
 
 		lb = strchrnul(a + strlen("\nauthor "), '<');
 		rb = strchrnul(lb, '>');
 		eol = strchrnul(rb, '\n');
 		if (!*lb || !*rb || !*eol)
-			die("invalid commit: %s", use_message);
+			die(_("invalid commit: %s"), use_message);
 
 		if (lb == a + strlen("\nauthor "))
 			/* \nauthor <foo@example.com> */
@@ -498,7 +498,7 @@ static void determine_author_info(struct strbuf *author_ident)
 		const char *rb = strchr(force_author, '>');
 
 		if (!lb || !rb)
-			die("malformed --author parameter");
+			die(_("malformed --author parameter"));
 		name = xstrndup(force_author, lb - force_author);
 		email = xstrndup(lb + 2, rb - (lb + 2));
 	}
@@ -554,7 +554,7 @@ static char *cut_ident_timestamp_part(char *string)
 {
 	char *ket = strrchr(string, '>');
 	if (!ket || ket[1] != ' ')
-		die("Malformed ident string: '%s'", string);
+		die(_("Malformed ident string: '%s'"), string);
 	*++ket = '\0';
 	return ket;
 }
@@ -588,7 +588,7 @@ static int prepare_to_commit(const char *index_file, const char *prefix,
 			struct commit *c;
 			c = lookup_commit_reference_by_name(squash_message);
 			if (!c)
-				die("could not lookup commit %s", squash_message);
+				die(_("could not lookup commit %s"), squash_message);
 			ctx.output_encoding = get_commit_output_encoding();
 			format_commit_message(c, "squash! %s\n\n", &sb,
 					      &ctx);
@@ -600,19 +600,19 @@ static int prepare_to_commit(const char *index_file, const char *prefix,
 		hook_arg1 = "message";
 	} else if (logfile && !strcmp(logfile, "-")) {
 		if (isatty(0))
-			fprintf(stderr, "(reading log message from standard input)\n");
+			fprintf(stderr, _("(reading log message from standard input)\n"));
 		if (strbuf_read(&sb, 0, 0) < 0)
-			die_errno("could not read log from standard input");
+			die_errno(_("could not read log from standard input"));
 		hook_arg1 = "message";
 	} else if (logfile) {
 		if (strbuf_read_file(&sb, logfile, 0) < 0)
-			die_errno("could not read log file '%s'",
+			die_errno(_("could not read log file '%s'"),
 				  logfile);
 		hook_arg1 = "message";
 	} else if (use_message) {
 		buffer = strstr(use_message_buffer, "\n\n");
 		if (!buffer || buffer[2] == '\0')
-			die("commit has empty message");
+			die(_("commit has empty message"));
 		strbuf_add(&sb, buffer + 2, strlen(buffer + 2));
 		hook_arg1 = "commit";
 		hook_arg2 = use_message;
@@ -621,22 +621,22 @@ static int prepare_to_commit(const char *index_file, const char *prefix,
 		struct commit *commit;
 		commit = lookup_commit_reference_by_name(fixup_message);
 		if (!commit)
-			die("could not lookup commit %s", fixup_message);
+			die(_("could not lookup commit %s"), fixup_message);
 		ctx.output_encoding = get_commit_output_encoding();
 		format_commit_message(commit, "fixup! %s\n\n",
 				      &sb, &ctx);
 		hook_arg1 = "message";
 	} else if (!stat(git_path("MERGE_MSG"), &statbuf)) {
 		if (strbuf_read_file(&sb, git_path("MERGE_MSG"), 0) < 0)
-			die_errno("could not read MERGE_MSG");
+			die_errno(_("could not read MERGE_MSG"));
 		hook_arg1 = "merge";
 	} else if (!stat(git_path("SQUASH_MSG"), &statbuf)) {
 		if (strbuf_read_file(&sb, git_path("SQUASH_MSG"), 0) < 0)
-			die_errno("could not read SQUASH_MSG");
+			die_errno(_("could not read SQUASH_MSG"));
 		hook_arg1 = "squash";
 	} else if (template_file && !stat(template_file, &statbuf)) {
 		if (strbuf_read_file(&sb, template_file, 0) < 0)
-			die_errno("could not read '%s'", template_file);
+			die_errno(_("could not read '%s'"), template_file);
 		hook_arg1 = "template";
 	}
 
@@ -659,7 +659,7 @@ static int prepare_to_commit(const char *index_file, const char *prefix,
 
 	fp = fopen(git_path(commit_editmsg), "w");
 	if (fp == NULL)
-		die_errno("could not open '%s'", git_path(commit_editmsg));
+		die_errno(_("could not open '%s'"), git_path(commit_editmsg));
 
 	if (cleanup_mode != CLEANUP_NONE)
 		stripspace(&sb, 0);
@@ -683,7 +683,7 @@ static int prepare_to_commit(const char *index_file, const char *prefix,
 	}
 
 	if (fwrite(sb.buf, 1, sb.len, fp) < sb.len)
-		die_errno("could not write commit template");
+		die_errno(_("could not write commit template"));
 
 	strbuf_release(&sb);
 
@@ -752,7 +752,7 @@ static int prepare_to_commit(const char *index_file, const char *prefix,
 		const char *parent = "HEAD";
 
 		if (!active_nr && read_cache() < 0)
-			die("Cannot read index");
+			die(_("Cannot read index"));
 
 		if (amend)
 			parent = "HEAD^1";
@@ -785,7 +785,7 @@ static int prepare_to_commit(const char *index_file, const char *prefix,
 		active_cache_tree = cache_tree();
 	if (cache_tree_update(active_cache_tree,
 			      active_cache, active_nr, 0, 0) < 0) {
-		error("Error building trees");
+		error(_("Error building trees"));
 		return 0;
 	}
 
@@ -800,7 +800,7 @@ static int prepare_to_commit(const char *index_file, const char *prefix,
 		snprintf(index, sizeof(index), "GIT_INDEX_FILE=%s", index_file);
 		if (launch_editor(git_path(commit_editmsg), NULL, env)) {
 			fprintf(stderr,
-			"Please supply the message using either -m or -F option.\n");
+			_("Please supply the message using either -m or -F option.\n"));
 			exit(1);
 		}
 	}
@@ -880,7 +880,7 @@ static const char *find_author_by_nickname(const char *name)
 		format_commit_message(commit, "%an <%ae>", &buf, &ctx);
 		return strbuf_detach(&buf, NULL);
 	}
-	die("No existing author found with '%s'", name);
+	die(_("No existing author found with '%s'"), name);
 }
 
 
@@ -895,7 +895,7 @@ static void handle_untracked_files_arg(struct wt_status *s)
 	else if (!strcmp(untracked_files_arg, "all"))
 		s->show_untracked_files = SHOW_ALL_UNTRACKED_FILES;
 	else
-		die("Invalid untracked files mode '%s'", untracked_files_arg);
+		die(_("Invalid untracked files mode '%s'"), untracked_files_arg);
 }
 
 static int parse_and_validate_options(int argc, const char *argv[],
@@ -912,7 +912,7 @@ static int parse_and_validate_options(int argc, const char *argv[],
 		force_author = find_author_by_nickname(force_author);
 
 	if (force_author && renew_authorship)
-		die("Using both --reset-author and --author does not make sense");
+		die(_("Using both --reset-author and --author does not make sense"));
 
 	if (logfile || message.len || use_message || fixup_message)
 		use_editor = 0;
@@ -926,7 +926,7 @@ static int parse_and_validate_options(int argc, const char *argv[],
 
 	/* Sanity check options */
 	if (amend && initial_commit)
-		die("You have nothing to amend.");
+		die(_("You have nothing to amend."));
 	if (amend && in_merge)
 		die("You are in the middle of a merge -- cannot amend.");
 	if (fixup_message && squash_message)
@@ -940,22 +940,22 @@ static int parse_and_validate_options(int argc, const char *argv[],
 	if (logfile)
 		f++;
 	if (f > 1)
-		die("Only one of -c/-C/-F/--fixup can be used.");
+		die(_("Only one of -c/-C/-F/--fixup can be used."));
 	if (message.len && f > 0)
-		die("Option -m cannot be combined with -c/-C/-F/--fixup.");
+		die((_("Option -m cannot be combined with -c/-C/-F/--fixup.")));
 	if (edit_message)
 		use_message = edit_message;
 	if (amend && !use_message && !fixup_message)
 		use_message = "HEAD";
 	if (!use_message && renew_authorship)
-		die("--reset-author can be used only with -C, -c or --amend.");
+		die(_("--reset-author can be used only with -C, -c or --amend."));
 	if (use_message) {
 		const char *out_enc;
 		struct commit *commit;
 
 		commit = lookup_commit_reference_by_name(use_message);
 		if (!commit)
-			die("could not lookup commit %s", use_message);
+			die(_("could not lookup commit %s"), use_message);
 		out_enc = get_commit_output_encoding();
 		use_message_buffer = logmsg_reencode(commit, out_enc);
 
@@ -970,13 +970,13 @@ static int parse_and_validate_options(int argc, const char *argv[],
 	}
 
 	if (!!also + !!only + !!all + !!interactive > 1)
-		die("Only one of --include/--only/--all/--interactive can be used.");
+		die(_("Only one of --include/--only/--all/--interactive can be used."));
 	if (argc == 0 && (also || (only && !amend)))
-		die("No paths with --include/--only does not make sense.");
+		die(_("No paths with --include/--only does not make sense."));
 	if (argc == 0 && only && amend)
-		only_include_assumed = "Clever... amending the last one with dirty index.";
+		only_include_assumed = _("Clever... amending the last one with dirty index.");
 	if (argc > 0 && !also && !only)
-		only_include_assumed = "Explicit paths specified without -i nor -o; assuming --only paths...";
+		only_include_assumed = _("Explicit paths specified without -i nor -o; assuming --only paths...");
 	if (!cleanup_arg || !strcmp(cleanup_arg, "default"))
 		cleanup_mode = use_editor ? CLEANUP_ALL : CLEANUP_SPACE;
 	else if (!strcmp(cleanup_arg, "verbatim"))
@@ -986,14 +986,14 @@ static int parse_and_validate_options(int argc, const char *argv[],
 	else if (!strcmp(cleanup_arg, "strip"))
 		cleanup_mode = CLEANUP_ALL;
 	else
-		die("Invalid cleanup mode %s", cleanup_arg);
+		die(_("Invalid cleanup mode %s"), cleanup_arg);
 
 	handle_untracked_files_arg(s);
 
 	if (all && argc > 0)
-		die("Paths with -a does not make sense.");
+		die(_("Paths with -a does not make sense."));
 	else if (interactive && argc > 0)
-		die("Paths with --interactive does not make sense.");
+		die(_("Paths with --interactive does not make sense."));
 
 	if (null_termination && status_format == STATUS_FORMAT_LONG)
 		status_format = STATUS_FORMAT_PORCELAIN;
@@ -1074,7 +1074,7 @@ static int git_status_config(const char *k, const char *v, void *cb)
 		else if (!strcmp(v, "all"))
 			s->show_untracked_files = SHOW_ALL_UNTRACKED_FILES;
 		else
-			return error("Invalid untracked files mode '%s'", v);
+			return error(_("Invalid untracked files mode '%s'"), v);
 		return 0;
 	}
 	return git_diff_ui_config(k, v, NULL);
@@ -1180,9 +1180,9 @@ static void print_summary(const char *prefix, const unsigned char *sha1)
 
 	commit = lookup_commit(sha1);
 	if (!commit)
-		die("couldn't look up newly created commit");
+		die(_("couldn't look up newly created commit"));
 	if (!commit || parse_commit(commit))
-		die("could not parse newly created commit");
+		die(_("could not parse newly created commit"));
 
 	strbuf_addstr(&format, "format:%h] %s");
 
@@ -1336,7 +1336,7 @@ int cmd_commit(int argc, const char **argv, const char *prefix)
 			reflog_msg = "commit (amend)";
 		commit = lookup_commit(head_sha1);
 		if (!commit || parse_commit(commit))
-			die("could not parse HEAD commit");
+			die(_("could not parse HEAD commit"));
 
 		for (c = commit->parents; c; c = c->next)
 			pptr = &commit_list_insert(c->item, pptr)->next;
@@ -1349,19 +1349,19 @@ int cmd_commit(int argc, const char **argv, const char *prefix)
 		pptr = &commit_list_insert(lookup_commit(head_sha1), pptr)->next;
 		fp = fopen(git_path("MERGE_HEAD"), "r");
 		if (fp == NULL)
-			die_errno("could not open '%s' for reading",
+			die_errno(_("could not open '%s' for reading"),
 				  git_path("MERGE_HEAD"));
 		while (strbuf_getline(&m, fp, '\n') != EOF) {
 			unsigned char sha1[20];
 			if (get_sha1_hex(m.buf, sha1) < 0)
-				die("Corrupt MERGE_HEAD file (%s)", m.buf);
+				die(_("Corrupt MERGE_HEAD file (%s)"), m.buf);
 			pptr = &commit_list_insert(lookup_commit(sha1), pptr)->next;
 		}
 		fclose(fp);
 		strbuf_release(&m);
 		if (!stat(git_path("MERGE_MODE"), &statbuf)) {
 			if (strbuf_read_file(&sb, git_path("MERGE_MODE"), 0) < 0)
-				die_errno("could not read MERGE_MODE");
+				die_errno(_("could not read MERGE_MODE"));
 			if (!strcmp(sb.buf, "no-ff"))
 				allow_fast_forward = 0;
 		}
@@ -1378,7 +1378,7 @@ int cmd_commit(int argc, const char **argv, const char *prefix)
 	if (strbuf_read_file(&sb, git_path(commit_editmsg), 0) < 0) {
 		int saved_errno = errno;
 		rollback_index_files();
-		die("could not read commit message: %s", strerror(saved_errno));
+		die(_("could not read commit message: %s"), strerror(saved_errno));
 	}
 
 	/* Truncate the message just before the diff, if any. */
@@ -1392,14 +1392,14 @@ int cmd_commit(int argc, const char **argv, const char *prefix)
 		stripspace(&sb, cleanup_mode == CLEANUP_ALL);
 	if (message_is_empty(&sb) && !allow_empty_message) {
 		rollback_index_files();
-		fprintf(stderr, "Aborting commit due to empty commit message.\n");
+		fprintf(stderr, _("Aborting commit due to empty commit message.\n"));
 		exit(1);
 	}
 
 	if (commit_tree(sb.buf, active_cache_tree->sha1, parents, commit_sha1,
 			author_ident.buf)) {
 		rollback_index_files();
-		die("failed to write commit object");
+		die(_("failed to write commit object"));
 	}
 	strbuf_release(&author_ident);
 
@@ -1417,11 +1417,11 @@ int cmd_commit(int argc, const char **argv, const char *prefix)
 
 	if (!ref_lock) {
 		rollback_index_files();
-		die("cannot lock HEAD ref");
+		die(_("cannot lock HEAD ref"));
 	}
 	if (write_ref_sha1(ref_lock, commit_sha1, sb.buf) < 0) {
 		rollback_index_files();
-		die("cannot update HEAD ref");
+		die(_("cannot update HEAD ref"));
 	}
 
 	unlink(git_path("MERGE_HEAD"));
@@ -1430,9 +1430,9 @@ int cmd_commit(int argc, const char **argv, const char *prefix)
 	unlink(git_path("SQUASH_MSG"));
 
 	if (commit_index_files())
-		die ("Repository has been updated, but unable to write\n"
+		die (_("Repository has been updated, but unable to write\n"
 		     "new_index file. Check that disk is not full or quota is\n"
-		     "not exceeded, and then \"git reset HEAD\" to recover.");
+		     "not exceeded, and then \"git reset HEAD\" to recover."));
 
 	rerere(0);
 	run_hook(get_index_file(), "post-commit", NULL);
-- 
1.7.2.3

^ permalink raw reply related	[flat|nested] 222+ messages in thread

* [PATCH v4 26/73] gettextize: git-commit "middle of a merge" message
  2011-02-22 18:11     ` Junio C Hamano
                         ` (25 preceding siblings ...)
  2011-02-22 23:41       ` [PATCH v4 25/73] gettextize: git-commit basic messages Ævar Arnfjörð Bjarmason
@ 2011-02-22 23:41       ` Ævar Arnfjörð Bjarmason
  2011-02-22 23:41       ` [PATCH v4 27/73] gettextize: git-commit formatting messages Ævar Arnfjörð Bjarmason
                         ` (46 subsequent siblings)
  73 siblings, 0 replies; 222+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2011-02-22 23:41 UTC (permalink / raw)
  To: git
  Cc: Junio C Hamano, Jakub Narebski, Ævar Arnfjörð Bjarmason

Gettextize the "You are in the middle of a merge -- cannot amend."
message. Several tests in t7110-reset-merge.sh explicitly checked for
this message. Change them to skip under GETTEXT_POISON=YesPlease.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
---
 builtin/commit.c       |    4 ++--
 t/t7110-reset-merge.sh |    6 +++---
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/builtin/commit.c b/builtin/commit.c
index c57f603..0198e90 100644
--- a/builtin/commit.c
+++ b/builtin/commit.c
@@ -928,9 +928,9 @@ static int parse_and_validate_options(int argc, const char *argv[],
 	if (amend && initial_commit)
 		die(_("You have nothing to amend."));
 	if (amend && in_merge)
-		die("You are in the middle of a merge -- cannot amend.");
+		die(_("You are in the middle of a merge -- cannot amend."));
 	if (fixup_message && squash_message)
-		die("Options --squash and --fixup cannot be used together");
+		die(_("Options --squash and --fixup cannot be used together"));
 	if (use_message)
 		f++;
 	if (edit_message)
diff --git a/t/t7110-reset-merge.sh b/t/t7110-reset-merge.sh
index 70cdd8e..b42820a 100755
--- a/t/t7110-reset-merge.sh
+++ b/t/t7110-reset-merge.sh
@@ -233,7 +233,7 @@ test_expect_success '"reset --merge HEAD^" is ok with pending merge' '
 #           working index HEAD target         working index HEAD
 #           ----------------------------------------------------
 # file1:     X       U     B    C     --keep   (disallowed)
-test_expect_success '"reset --keep HEAD^" fails with pending merge' '
+test_expect_success C_LOCALE_OUTPUT '"reset --keep HEAD^" fails with pending merge' '
     git reset --hard third &&
     test_must_fail git merge branch1 &&
     test_must_fail git reset --keep HEAD^ 2>err.log &&
@@ -259,7 +259,7 @@ test_expect_success '"reset --merge HEAD" is ok with pending merge' '
 #           working index HEAD target         working index HEAD
 #           ----------------------------------------------------
 # file1:     X       U     B    B     --keep   (disallowed)
-test_expect_success '"reset --keep HEAD" fails with pending merge' '
+test_expect_success C_LOCALE_OUTPUT '"reset --keep HEAD" fails with pending merge' '
     git reset --hard third &&
     test_must_fail git merge branch1 &&
     test_must_fail git reset --keep HEAD 2>err.log &&
@@ -280,7 +280,7 @@ test_expect_success '--merge is ok with added/deleted merge' '
     git diff --exit-code --cached
 '
 
-test_expect_success '--keep fails with added/deleted merge' '
+test_expect_success C_LOCALE_OUTPUT '--keep fails with added/deleted merge' '
     git reset --hard third &&
     rm -f file2 &&
     test_must_fail git merge branch3 &&
-- 
1.7.2.3

^ permalink raw reply related	[flat|nested] 222+ messages in thread

* [PATCH v4 27/73] gettextize: git-commit formatting messages
  2011-02-22 18:11     ` Junio C Hamano
                         ` (26 preceding siblings ...)
  2011-02-22 23:41       ` [PATCH v4 26/73] gettextize: git-commit "middle of a merge" message Ævar Arnfjörð Bjarmason
@ 2011-02-22 23:41       ` Ævar Arnfjörð Bjarmason
  2011-02-25  9:07         ` [PATCH] commit: error out for missing commit message template Jonathan Nieder
  2011-02-25  9:43         ` [PATCH v4 27/73] gettextize: git-commit formatting messages Jonathan Nieder
  2011-02-22 23:41       ` [PATCH v4 28/73] gettextize: git-commit print_summary messages Ævar Arnfjörð Bjarmason
                         ` (45 subsequent siblings)
  73 siblings, 2 replies; 222+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2011-02-22 23:41 UTC (permalink / raw)
  To: git
  Cc: Junio C Hamano, Jakub Narebski, Ævar Arnfjörð Bjarmason

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
---
 builtin/commit.c  |   12 ++++++------
 t/t7502-commit.sh |    4 ++--
 2 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/builtin/commit.c b/builtin/commit.c
index 0198e90..c7c6c59 100644
--- a/builtin/commit.c
+++ b/builtin/commit.c
@@ -696,12 +696,12 @@ static int prepare_to_commit(const char *index_file, const char *prefix,
 		char *ai_tmp, *ci_tmp;
 		if (in_merge)
 			fprintf(fp,
-				"#\n"
+				_("#\n"
 				"# It looks like you may be committing a MERGE.\n"
 				"# If this is not correct, please remove the file\n"
 				"#	%s\n"
 				"# and try again.\n"
-				"#\n",
+				"#\n"),
 				git_path("MERGE_HEAD"));
 
 		fprintf(fp,
@@ -725,15 +725,15 @@ static int prepare_to_commit(const char *index_file, const char *prefix,
 		ci_tmp = cut_ident_timestamp_part(committer_ident.buf);
 		if (strcmp(author_ident->buf, committer_ident.buf))
 			fprintf(fp,
-				"%s"
-				"# Author:    %s\n",
+				_("%s"
+				"# Author:    %s\n"),
 				ident_shown++ ? "" : "#\n",
 				author_ident->buf);
 
 		if (!user_ident_sufficiently_given())
 			fprintf(fp,
-				"%s"
-				"# Committer: %s\n",
+				_("%s"
+				"# Committer: %s\n"),
 				ident_shown++ ? "" : "#\n",
 				committer_ident.buf);
 
diff --git a/t/t7502-commit.sh b/t/t7502-commit.sh
index 50da034..034b9c3 100755
--- a/t/t7502-commit.sh
+++ b/t/t7502-commit.sh
@@ -234,7 +234,7 @@ echo "#
 # Author:    $GIT_AUTHOR_NAME <$GIT_AUTHOR_EMAIL>
 #" >> expect
 
-test_expect_success 'author different from committer' '
+test_expect_success C_LOCALE_OUTPUT 'author different from committer' '
 
 	echo >>negative &&
 	git commit -e -m "sample"
@@ -248,7 +248,7 @@ rm -f expect.tmp
 echo "# Committer:
 #" >> expect
 
-test_expect_success 'committer is automatic' '
+test_expect_success C_LOCALE_OUTPUT 'committer is automatic' '
 
 	echo >>negative &&
 	(
-- 
1.7.2.3

^ permalink raw reply related	[flat|nested] 222+ messages in thread

* [PATCH v4 28/73] gettextize: git-commit print_summary messages
  2011-02-22 18:11     ` Junio C Hamano
                         ` (27 preceding siblings ...)
  2011-02-22 23:41       ` [PATCH v4 27/73] gettextize: git-commit formatting messages Ævar Arnfjörð Bjarmason
@ 2011-02-22 23:41       ` Ævar Arnfjörð Bjarmason
  2011-02-22 23:41       ` [PATCH v4 29/73] gettextize: git-commit "enter the commit message" message Ævar Arnfjörð Bjarmason
                         ` (44 subsequent siblings)
  73 siblings, 0 replies; 222+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2011-02-22 23:41 UTC (permalink / raw)
  To: git
  Cc: Junio C Hamano, Jakub Narebski, Ævar Arnfjörð Bjarmason

Gettextize the "(root-commit)" and "detached HEAD" fragments that
appear when you commit either the root commit, or a commit in a
detached head translatable.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
---
 builtin/commit.c  |    4 ++--
 t/t7502-commit.sh |   10 ++++++++--
 2 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/builtin/commit.c b/builtin/commit.c
index c7c6c59..c90a8cf 100644
--- a/builtin/commit.c
+++ b/builtin/commit.c
@@ -1223,9 +1223,9 @@ static void print_summary(const char *prefix, const unsigned char *sha1)
 		!prefixcmp(head, "refs/heads/") ?
 			head + 11 :
 			!strcmp(head, "HEAD") ?
-				"detached HEAD" :
+				_("detached HEAD") :
 				head,
-		initial_commit ? " (root-commit)" : "");
+		initial_commit ? _(" (root-commit)") : "");
 
 	if (!log_tree_commit(&rev, commit)) {
 		rev.always_show_header = 1;
diff --git a/t/t7502-commit.sh b/t/t7502-commit.sh
index 034b9c3..dad1b2b 100755
--- a/t/t7502-commit.sh
+++ b/t/t7502-commit.sh
@@ -22,7 +22,10 @@ check_summary_oneline() {
 	SUMMARY_POSTFIX="$(git log -1 --pretty='format:%h')"
 	echo "[$SUMMARY_PREFIX $SUMMARY_POSTFIX] $2" >exp &&
 
-	test_cmp exp act
+	if test_have_prereq C_LOCALE_OUTPUT
+	then
+		test_cmp exp act
+	fi
 }
 
 test_expect_success 'output summary format' '
@@ -32,7 +35,10 @@ test_expect_success 'output summary format' '
 	check_summary_oneline "root-commit" "initial" &&
 
 	echo change >>file1 &&
-	git add file1 &&
+	git add file1
+'
+
+test_expect_success 'output summary format: root-commit' '
 	check_summary_oneline "" "a change"
 '
 
-- 
1.7.2.3

^ permalink raw reply related	[flat|nested] 222+ messages in thread

* [PATCH v4 29/73] gettextize: git-commit "enter the commit message" message
  2011-02-22 18:11     ` Junio C Hamano
                         ` (28 preceding siblings ...)
  2011-02-22 23:41       ` [PATCH v4 28/73] gettextize: git-commit print_summary messages Ævar Arnfjörð Bjarmason
@ 2011-02-22 23:41       ` Ævar Arnfjörð Bjarmason
  2011-02-22 23:41       ` [PATCH v4 30/73] gettextize: git-commit advice messages Ævar Arnfjörð Bjarmason
                         ` (43 subsequent siblings)
  73 siblings, 0 replies; 222+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2011-02-22 23:41 UTC (permalink / raw)
  To: git
  Cc: Junio C Hamano, Jakub Narebski, Ævar Arnfjörð Bjarmason

Gettextize the "# Please enter the commit message for your changes."
message. Several tests in t7500-commit.sh and t7502-commit.sh assume
that this message starts with a newline. Change the tests to to skip
under GETTEXT_POISON=YesPlease.

These fail under GETTEXT_POISON=YesPlease because the poison editor
message doesn't do the right thing with comments and line breaks, so
these messages will be incorrectly broken up across lines.

This test should not be skipped under a hypothetical future testing
mode that tests Git under language locales, since those messages
should all start with a newline like the original.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
---
 builtin/commit.c  |   12 ++++++------
 t/t7500-commit.sh |    8 ++++----
 t/t7502-commit.sh |   26 +++++++++++++++++---------
 3 files changed, 27 insertions(+), 19 deletions(-)

diff --git a/builtin/commit.c b/builtin/commit.c
index c90a8cf..ac8da45 100644
--- a/builtin/commit.c
+++ b/builtin/commit.c
@@ -705,19 +705,19 @@ static int prepare_to_commit(const char *index_file, const char *prefix,
 				git_path("MERGE_HEAD"));
 
 		fprintf(fp,
-			"\n"
-			"# Please enter the commit message for your changes.");
+			_("\n"
+			"# Please enter the commit message for your changes."));
 		if (cleanup_mode == CLEANUP_ALL)
 			fprintf(fp,
-				" Lines starting\n"
+				_(" Lines starting\n"
 				"# with '#' will be ignored, and an empty"
-				" message aborts the commit.\n");
+				" message aborts the commit.\n"));
 		else /* CLEANUP_SPACE, that is. */
 			fprintf(fp,
-				" Lines starting\n"
+				_(" Lines starting\n"
 				"# with '#' will be kept; you may remove them"
 				" yourself if you want to.\n"
-				"# An empty message aborts the commit.\n");
+				"# An empty message aborts the commit.\n"));
 		if (only_include_assumed)
 			fprintf(fp, "# %s\n", only_include_assumed);
 
diff --git a/t/t7500-commit.sh b/t/t7500-commit.sh
index 162527c..92cd3f5 100755
--- a/t/t7500-commit.sh
+++ b/t/t7500-commit.sh
@@ -59,7 +59,7 @@ test_expect_success 'adding comments to a template should not commit' '
 	)
 '
 
-test_expect_success 'adding real content to a template should commit' '
+test_expect_success C_LOCALE_OUTPUT 'adding real content to a template should commit' '
 	(
 		test_set_editor "$TEST_DIRECTORY"/t7500/add-content &&
 		git commit --template "$TEMPLATE"
@@ -67,7 +67,7 @@ test_expect_success 'adding real content to a template should commit' '
 	commit_msg_is "template linecommit message"
 '
 
-test_expect_success '-t option should be short for --template' '
+test_expect_success C_LOCALE_OUTPUT '-t option should be short for --template' '
 	echo "short template" > "$TEMPLATE" &&
 	echo "new content" >> foo &&
 	git add foo &&
@@ -78,7 +78,7 @@ test_expect_success '-t option should be short for --template' '
 	commit_msg_is "short templatecommit message"
 '
 
-test_expect_success 'config-specified template should commit' '
+test_expect_success C_LOCALE_OUTPUT 'config-specified template should commit' '
 	echo "new template" > "$TEMPLATE" &&
 	git config commit.template "$TEMPLATE" &&
 	echo "more content" >> foo &&
@@ -277,7 +277,7 @@ test_expect_success 'commit --squash works with -c for same commit' '
 	commit_msg_is "squash! edited commit"
 '
 
-test_expect_success 'commit --squash works with editor' '
+test_expect_success C_LOCALE_OUTPUT 'commit --squash works with editor' '
 	commit_for_rebase_autosquash_setup &&
 	test_set_editor "$TEST_DIRECTORY"/t7500/add-content &&
 	git commit --squash HEAD~1 &&
diff --git a/t/t7502-commit.sh b/t/t7502-commit.sh
index dad1b2b..1f29b5c 100755
--- a/t/t7502-commit.sh
+++ b/t/t7502-commit.sh
@@ -221,19 +221,21 @@ test_expect_success 'cleanup commit messages (strip,-F)' '
 
 '
 
-echo "sample
-
-# Please enter the commit message for your changes. Lines starting
-# with '#' will be ignored, and an empty message aborts the commit." >expect
-
 test_expect_success 'cleanup commit messages (strip,-F,-e)' '
 
 	echo >>negative &&
 	{ echo;echo sample;echo; } >text &&
 	git commit -e -F text -a &&
-	head -n 4 .git/COMMIT_EDITMSG >actual &&
-	test_cmp expect actual
+	head -n 4 .git/COMMIT_EDITMSG >actual
+'
+
+echo "sample
 
+# Please enter the commit message for your changes. Lines starting
+# with '#' will be ignored, and an empty message aborts the commit." >expect
+
+test_expect_success C_LOCALE_OUTPUT 'cleanup commit messages (strip,-F,-e): output' '
+	test_cmp expect actual
 '
 
 echo "#
@@ -244,7 +246,10 @@ test_expect_success C_LOCALE_OUTPUT 'author different from committer' '
 
 	echo >>negative &&
 	git commit -e -m "sample"
-	head -n 7 .git/COMMIT_EDITMSG >actual &&
+	head -n 7 .git/COMMIT_EDITMSG >actual
+'
+
+test_expect_success C_LOCALE_OUTPUT 'author different from committer: output' '
 	test_cmp expect actual
 '
 
@@ -264,7 +269,10 @@ test_expect_success C_LOCALE_OUTPUT 'committer is automatic' '
 		test_must_fail git commit -e -m "sample"
 	) &&
 	head -n 8 .git/COMMIT_EDITMSG |	\
-	sed "s/^# Committer: .*/# Committer:/" >actual &&
+	sed "s/^# Committer: .*/# Committer:/" >actual
+'
+
+test_expect_success C_LOCALE_OUTPUT 'committer is automatic: output' '
 	test_cmp expect actual
 '
 
-- 
1.7.2.3

^ permalink raw reply related	[flat|nested] 222+ messages in thread

* [PATCH v4 30/73] gettextize: git-commit advice messages
  2011-02-22 18:11     ` Junio C Hamano
                         ` (29 preceding siblings ...)
  2011-02-22 23:41       ` [PATCH v4 29/73] gettextize: git-commit "enter the commit message" message Ævar Arnfjörð Bjarmason
@ 2011-02-22 23:41       ` Ævar Arnfjörð Bjarmason
  2011-02-22 23:41       ` [PATCH v4 31/73] gettextize: git-diff basic messages Ævar Arnfjörð Bjarmason
                         ` (42 subsequent siblings)
  73 siblings, 0 replies; 222+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2011-02-22 23:41 UTC (permalink / raw)
  To: git
  Cc: Junio C Hamano, Jakub Narebski, Ævar Arnfjörð Bjarmason

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
---
 builtin/commit.c |   12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/builtin/commit.c b/builtin/commit.c
index ac8da45..df881d5 100644
--- a/builtin/commit.c
+++ b/builtin/commit.c
@@ -38,7 +38,7 @@ static const char * const builtin_status_usage[] = {
 };
 
 static const char implicit_ident_advice[] =
-"Your name and email address were configured automatically based\n"
+N_("Your name and email address were configured automatically based\n"
 "on your username and hostname. Please check that they are accurate.\n"
 "You can suppress this message by setting them explicitly:\n"
 "\n"
@@ -47,12 +47,12 @@ static const char implicit_ident_advice[] =
 "\n"
 "After doing this, you may fix the identity used for this commit with:\n"
 "\n"
-"    git commit --amend --reset-author\n";
+"    git commit --amend --reset-author\n");
 
 static const char empty_amend_advice[] =
-"You asked to amend the most recent commit, but doing so would make\n"
+N_("You asked to amend the most recent commit, but doing so would make\n"
 "it empty. You can repeat your command with --allow-empty, or you can\n"
-"remove the commit entirely with \"git reset HEAD^\".\n";
+"remove the commit entirely with \"git reset HEAD^\".\n");
 
 static unsigned char head_sha1[20];
 
@@ -770,7 +770,7 @@ static int prepare_to_commit(const char *index_file, const char *prefix,
 	    !(amend && is_a_merge(head_sha1))) {
 		run_status(stdout, index_file, prefix, 0, s);
 		if (amend)
-			fputs(empty_amend_advice, stderr);
+			fputs(_(empty_amend_advice), stderr);
 		return 0;
 	}
 
@@ -1197,7 +1197,7 @@ static void print_summary(const char *prefix, const unsigned char *sha1)
 		strbuf_addbuf_percentquote(&format, &committer_ident);
 		if (advice_implicit_identity) {
 			strbuf_addch(&format, '\n');
-			strbuf_addstr(&format, implicit_ident_advice);
+			strbuf_addstr(&format, _(implicit_ident_advice));
 		}
 	}
 	strbuf_release(&author_ident);
-- 
1.7.2.3

^ permalink raw reply related	[flat|nested] 222+ messages in thread

* [PATCH v4 31/73] gettextize: git-diff basic messages
  2011-02-22 18:11     ` Junio C Hamano
                         ` (30 preceding siblings ...)
  2011-02-22 23:41       ` [PATCH v4 30/73] gettextize: git-commit advice messages Ævar Arnfjörð Bjarmason
@ 2011-02-22 23:41       ` Ævar Arnfjörð Bjarmason
  2011-02-22 23:41       ` [PATCH v4 32/73] gettextize: git-fetch " Ævar Arnfjörð Bjarmason
                         ` (41 subsequent siblings)
  73 siblings, 0 replies; 222+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2011-02-22 23:41 UTC (permalink / raw)
  To: git
  Cc: Junio C Hamano, Jakub Narebski, Ævar Arnfjörð Bjarmason

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
---
 builtin/diff.c |   18 +++++++++---------
 1 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/builtin/diff.c b/builtin/diff.c
index 42822cd..0034273 100644
--- a/builtin/diff.c
+++ b/builtin/diff.c
@@ -71,9 +71,9 @@ static int builtin_diff_b_f(struct rev_info *revs,
 		usage(builtin_diff_usage);
 
 	if (lstat(path, &st))
-		die_errno("failed to stat '%s'", path);
+		die_errno(_("failed to stat '%s'"), path);
 	if (!(S_ISREG(st.st_mode) || S_ISLNK(st.st_mode)))
-		die("'%s': not a regular file or symlink", path);
+		die(_("'%s': not a regular file or symlink"), path);
 
 	diff_set_mnemonic_prefix(&revs->diffopt, "o/", "w/");
 
@@ -222,7 +222,7 @@ static int builtin_diff_files(struct rev_info *revs, int argc, const char **argv
 		else if (!strcmp(argv[1], "-h"))
 			usage(builtin_diff_usage);
 		else
-			return error("invalid option: %s", argv[1]);
+			return error(_("invalid option: %s"), argv[1]);
 		argv++; argc--;
 	}
 
@@ -299,12 +299,12 @@ int cmd_diff(int argc, const char **argv, const char *prefix)
 	DIFF_OPT_SET(&rev.diffopt, ALLOW_TEXTCONV);
 
 	if (nongit)
-		die("Not a git repository");
+		die(_("Not a git repository"));
 	argc = setup_revisions(argc, argv, &rev, NULL);
 	if (!rev.diffopt.output_format) {
 		rev.diffopt.output_format = DIFF_FORMAT_PATCH;
 		if (diff_setup_done(&rev.diffopt) < 0)
-			die("diff_setup_done failed");
+			die(_("diff_setup_done failed"));
 	}
 
 	DIFF_OPT_SET(&rev.diffopt, RECURSIVE);
@@ -349,12 +349,12 @@ int cmd_diff(int argc, const char **argv, const char *prefix)
 			obj = parse_object(obj->sha1);
 		obj = deref_tag(obj, NULL, 0);
 		if (!obj)
-			die("invalid object '%s' given.", name);
+			die(_("invalid object '%s' given."), name);
 		if (obj->type == OBJ_COMMIT)
 			obj = &((struct commit *)obj)->tree->object;
 		if (obj->type == OBJ_TREE) {
 			if (ARRAY_SIZE(ent) <= ents)
-				die("more than %d trees given: '%s'",
+				die(_("more than %d trees given: '%s'"),
 				    (int) ARRAY_SIZE(ent), name);
 			obj->flags |= flags;
 			ent[ents].item = obj;
@@ -364,7 +364,7 @@ int cmd_diff(int argc, const char **argv, const char *prefix)
 		}
 		if (obj->type == OBJ_BLOB) {
 			if (2 <= blobs)
-				die("more than two blobs given: '%s'", name);
+				die(_("more than two blobs given: '%s'"), name);
 			hashcpy(blob[blobs].sha1, obj->sha1);
 			blob[blobs].name = name;
 			blob[blobs].mode = list->mode;
@@ -372,7 +372,7 @@ int cmd_diff(int argc, const char **argv, const char *prefix)
 			continue;
 
 		}
-		die("unhandled object '%s' given.", name);
+		die(_("unhandled object '%s' given."), name);
 	}
 	if (rev.prune_data) {
 		const char **pathspec = rev.prune_data;
-- 
1.7.2.3

^ permalink raw reply related	[flat|nested] 222+ messages in thread

* [PATCH v4 32/73] gettextize: git-fetch basic messages
  2011-02-22 18:11     ` Junio C Hamano
                         ` (31 preceding siblings ...)
  2011-02-22 23:41       ` [PATCH v4 31/73] gettextize: git-diff basic messages Ævar Arnfjörð Bjarmason
@ 2011-02-22 23:41       ` Ævar Arnfjörð Bjarmason
  2011-02-22 23:41       ` [PATCH v4 33/73] gettextize: git-fetch formatting messages Ævar Arnfjörð Bjarmason
                         ` (40 subsequent siblings)
  73 siblings, 0 replies; 222+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2011-02-22 23:41 UTC (permalink / raw)
  To: git
  Cc: Junio C Hamano, Jakub Narebski, Ævar Arnfjörð Bjarmason

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
---
 builtin/fetch.c |   46 +++++++++++++++++++++++-----------------------
 1 files changed, 23 insertions(+), 23 deletions(-)

diff --git a/builtin/fetch.c b/builtin/fetch.c
index 357f3cd..c27c3e9 100644
--- a/builtin/fetch.c
+++ b/builtin/fetch.c
@@ -184,7 +184,7 @@ static struct ref *get_ref_map(struct transport *transport,
 		} else {
 			ref_map = get_remote_ref(remote_refs, "HEAD");
 			if (!ref_map)
-				die("Couldn't find remote ref HEAD");
+				die(_("Couldn't find remote ref HEAD"));
 			ref_map->merge = 1;
 			tail = &ref_map->next;
 		}
@@ -237,7 +237,7 @@ static int update_local_ref(struct ref *ref,
 	*display = 0;
 	type = sha1_object_info(ref->new_sha1, NULL);
 	if (type < 0)
-		die("object %s not found", sha1_to_hex(ref->new_sha1));
+		die(_("object %s not found"), sha1_to_hex(ref->new_sha1));
 
 	if (!hashcmp(ref->old_sha1, ref->new_sha1)) {
 		if (verbosity > 0)
@@ -337,7 +337,7 @@ static int store_updated_refs(const char *raw_url, const char *remote_name,
 
 	fp = fopen(filename, "a");
 	if (!fp)
-		return error("cannot open %s: %s\n", filename, strerror(errno));
+		return error(_("cannot open %s: %s\n"), filename, strerror(errno));
 
 	if (raw_url)
 		url = transport_anonymize_url(raw_url);
@@ -426,9 +426,9 @@ static int store_updated_refs(const char *raw_url, const char *remote_name,
 	free(url);
 	fclose(fp);
 	if (rc & STORE_REF_ERROR_DF_CONFLICT)
-		error("some local refs could not be updated; try running\n"
+		error(_("some local refs could not be updated; try running\n"
 		      " 'git remote prune %s' to remove any old, conflicting "
-		      "branches", remote_name);
+		      "branches"), remote_name);
 	return rc;
 }
 
@@ -476,7 +476,7 @@ static int quickfetch(struct ref *ref_map)
 
 	err = start_command(&revlist);
 	if (err) {
-		error("could not run rev-list");
+		error(_("could not run rev-list"));
 		return err;
 	}
 
@@ -490,14 +490,14 @@ static int quickfetch(struct ref *ref_map)
 		if (write_in_full(revlist.in, sha1_to_hex(ref->old_sha1), 40) < 0 ||
 		    write_str_in_full(revlist.in, "\n") < 0) {
 			if (errno != EPIPE && errno != EINVAL)
-				error("failed write to rev-list: %s", strerror(errno));
+				error(_("failed write to rev-list: %s"), strerror(errno));
 			err = -1;
 			break;
 		}
 	}
 
 	if (close(revlist.in)) {
-		error("failed to close rev-list's stdin: %s", strerror(errno));
+		error(_("failed to close rev-list's stdin: %s"), strerror(errno));
 		err = -1;
 	}
 
@@ -650,8 +650,8 @@ static void check_not_current_branch(struct ref *ref_map)
 	for (; ref_map; ref_map = ref_map->next)
 		if (ref_map->peer_ref && !strcmp(current_branch->refname,
 					ref_map->peer_ref->name))
-			die("Refusing to fetch into current branch %s "
-			    "of non-bare repository", current_branch->refname);
+			die(_("Refusing to fetch into current branch %s "
+			    "of non-bare repository"), current_branch->refname);
 }
 
 static int truncate_fetch_head(void)
@@ -660,7 +660,7 @@ static int truncate_fetch_head(void)
 	FILE *fp = fopen(filename, "w");
 
 	if (!fp)
-		return error("cannot open %s: %s\n", filename, strerror(errno));
+		return error(_("cannot open %s: %s\n"), filename, strerror(errno));
 	fclose(fp);
 	return 0;
 }
@@ -684,7 +684,7 @@ static int do_fetch(struct transport *transport,
 	}
 
 	if (!transport->get_refs_list || !transport->fetch)
-		die("Don't know how to fetch from %s", transport->url);
+		die(_("Don't know how to fetch from %s"), transport->url);
 
 	/* if not appending, truncate FETCH_HEAD */
 	if (!append && !dry_run) {
@@ -738,10 +738,10 @@ static void set_option(const char *name, const char *value)
 {
 	int r = transport_set_option(transport, name, value);
 	if (r < 0)
-		die("Option \"%s\" value \"%s\" is not valid for %s",
+		die(_("Option \"%s\" value \"%s\" is not valid for %s"),
 			name, value, transport->url);
 	if (r > 0)
-		warning("Option \"%s\" is ignored for %s\n",
+		warning(_("Option \"%s\" is ignored for %s\n"),
 			name, transport->url);
 }
 
@@ -838,9 +838,9 @@ static int fetch_multiple(struct string_list *list)
 		argv[argc] = name;
 		argv[argc + 1] = NULL;
 		if (verbosity >= 0)
-			printf("Fetching %s\n", name);
+			printf(_("Fetching %s\n"), name);
 		if (run_command_v_opt(argv, RUN_GIT_CMD)) {
-			error("Could not fetch %s", name);
+			error(_("Could not fetch %s"), name);
 			result = 1;
 		}
 	}
@@ -856,8 +856,8 @@ static int fetch_one(struct remote *remote, int argc, const char **argv)
 	int exit_code;
 
 	if (!remote)
-		die("No remote repository specified.  Please, specify either a URL or a\n"
-		    "remote name from which new revisions should be fetched.");
+		die(_("No remote repository specified.  Please, specify either a URL or a\n"
+		    "remote name from which new revisions should be fetched."));
 
 	transport = transport_get(remote, NULL);
 	transport_set_verbosity(transport, verbosity, progress);
@@ -876,7 +876,7 @@ static int fetch_one(struct remote *remote, int argc, const char **argv)
 				char *ref;
 				i++;
 				if (i >= argc)
-					die("You need to specify a tag name.");
+					die(_("You need to specify a tag name."));
 				ref = xmalloc(strlen(argv[i]) * 2 + 22);
 				strcpy(ref, "refs/tags/");
 				strcat(ref, argv[i]);
@@ -916,9 +916,9 @@ int cmd_fetch(int argc, const char **argv, const char *prefix)
 
 	if (all) {
 		if (argc == 1)
-			die("fetch --all does not take a repository argument");
+			die(_("fetch --all does not take a repository argument"));
 		else if (argc > 1)
-			die("fetch --all does not make sense with refspecs");
+			die(_("fetch --all does not make sense with refspecs"));
 		(void) for_each_remote(get_one_remote_for_fetch, &list);
 		result = fetch_multiple(&list);
 	} else if (argc == 0) {
@@ -929,7 +929,7 @@ int cmd_fetch(int argc, const char **argv, const char *prefix)
 		/* All arguments are assumed to be remotes or groups */
 		for (i = 0; i < argc; i++)
 			if (!add_remote_or_group(argv[i], &list))
-				die("No such remote or remote group: %s", argv[i]);
+				die(_("No such remote or remote group: %s"), argv[i]);
 		result = fetch_multiple(&list);
 	} else {
 		/* Single remote or group */
@@ -937,7 +937,7 @@ int cmd_fetch(int argc, const char **argv, const char *prefix)
 		if (list.nr > 1) {
 			/* More than one remote */
 			if (argc > 1)
-				die("Fetching a group and specifying refspecs does not make sense");
+				die(_("Fetching a group and specifying refspecs does not make sense"));
 			result = fetch_multiple(&list);
 		} else {
 			/* Zero or one remotes */
-- 
1.7.2.3

^ permalink raw reply related	[flat|nested] 222+ messages in thread

* [PATCH v4 33/73] gettextize: git-fetch formatting messages
  2011-02-22 18:11     ` Junio C Hamano
                         ` (32 preceding siblings ...)
  2011-02-22 23:41       ` [PATCH v4 32/73] gettextize: git-fetch " Ævar Arnfjörð Bjarmason
@ 2011-02-22 23:41       ` Ævar Arnfjörð Bjarmason
  2011-02-22 23:41       ` [PATCH v4 34/73] gettextize: git-fetch update_local_ref messages Ævar Arnfjörð Bjarmason
                         ` (39 subsequent siblings)
  73 siblings, 0 replies; 222+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2011-02-22 23:41 UTC (permalink / raw)
  To: git
  Cc: Junio C Hamano, Jakub Narebski, Ævar Arnfjörð Bjarmason

Translate some of the formatting messages that appear on git-fetch
showing how branches/tags etc. were updated.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
---
 builtin/fetch.c             |   20 ++++++++++----------
 t/t5526-fetch-submodules.sh |   40 ++++++++++++++++++++++++++++++++--------
 2 files changed, 42 insertions(+), 18 deletions(-)

diff --git a/builtin/fetch.c b/builtin/fetch.c
index c27c3e9..0a73dff 100644
--- a/builtin/fetch.c
+++ b/builtin/fetch.c
@@ -242,7 +242,7 @@ static int update_local_ref(struct ref *ref,
 	if (!hashcmp(ref->old_sha1, ref->new_sha1)) {
 		if (verbosity > 0)
 			sprintf(display, "= %-*s %-*s -> %s", TRANSPORT_SUMMARY_WIDTH,
-				"[up to date]", REFCOL_WIDTH, remote,
+				_("[up to date]"), REFCOL_WIDTH, remote,
 				pretty_ref);
 		return 0;
 	}
@@ -255,8 +255,8 @@ static int update_local_ref(struct ref *ref,
 		 * If this is the head, and it's not okay to update
 		 * the head, and the old value of the head isn't empty...
 		 */
-		sprintf(display, "! %-*s %-*s -> %s  (can't fetch in current branch)",
-			TRANSPORT_SUMMARY_WIDTH, "[rejected]", REFCOL_WIDTH, remote,
+		sprintf(display, _("! %-*s %-*s -> %s  (can't fetch in current branch)"),
+			TRANSPORT_SUMMARY_WIDTH, _("[rejected]"), REFCOL_WIDTH, remote,
 			pretty_ref);
 		return 1;
 	}
@@ -266,8 +266,8 @@ static int update_local_ref(struct ref *ref,
 		int r;
 		r = s_update_ref("updating tag", ref, 0);
 		sprintf(display, "%c %-*s %-*s -> %s%s", r ? '!' : '-',
-			TRANSPORT_SUMMARY_WIDTH, "[tag update]", REFCOL_WIDTH, remote,
-			pretty_ref, r ? "  (unable to update local ref)" : "");
+			TRANSPORT_SUMMARY_WIDTH, _("[tag update]"), REFCOL_WIDTH, remote,
+			pretty_ref, r ? _("  (unable to update local ref)") : "");
 		return r;
 	}
 
@@ -415,7 +415,7 @@ static int store_updated_refs(const char *raw_url, const char *remote_name,
 				 REFCOL_WIDTH, *what ? what : "HEAD");
 		if (*note) {
 			if (verbosity >= 0 && !shown_url) {
-				fprintf(stderr, "From %.*s\n",
+				fprintf(stderr, _("From %.*s\n"),
 						url_len, url);
 				shown_url = 1;
 			}
@@ -524,16 +524,16 @@ static int prune_refs(struct transport *transport, struct ref *ref_map)
 	int result = 0;
 	struct ref *ref, *stale_refs = get_stale_heads(transport->remote, ref_map);
 	const char *dangling_msg = dry_run
-		? "   (%s will become dangling)\n"
-		: "   (%s has become dangling)\n";
+		? _("   (%s will become dangling)\n")
+		: _("   (%s has become dangling)\n");
 
 	for (ref = stale_refs; ref; ref = ref->next) {
 		if (!dry_run)
 			result |= delete_ref(ref->name, NULL, 0);
 		if (verbosity >= 0) {
 			fprintf(stderr, " x %-*s %-*s -> %s\n",
-				TRANSPORT_SUMMARY_WIDTH, "[deleted]",
-				REFCOL_WIDTH, "(none)", prettify_refname(ref->name));
+				TRANSPORT_SUMMARY_WIDTH, _("[deleted]"),
+				REFCOL_WIDTH, _("(none)"), prettify_refname(ref->name));
 			warn_dangling_symref(stderr, dangling_msg, ref->name);
 		}
 	}
diff --git a/t/t5526-fetch-submodules.sh b/t/t5526-fetch-submodules.sh
index a5f4585..8f12379 100755
--- a/t/t5526-fetch-submodules.sh
+++ b/t/t5526-fetch-submodules.sh
@@ -66,7 +66,10 @@ test_expect_success "fetch --recurse-submodules recurses into submodules" '
 	(
 		cd downstream &&
 		git fetch --recurse-submodules >../actual.out 2>../actual.err
-	) &&
+	)
+'
+
+test_expect_success C_LOCALE_OUTPUT "fetch --recurse-submodules recurses into submodules: output" '
 	test_cmp expect.out actual.out &&
 	test_cmp expect.err actual.err
 '
@@ -95,7 +98,10 @@ test_expect_success "using fetchRecurseSubmodules=true in .gitmodules recurses i
 		cd downstream &&
 		git config -f .gitmodules submodule.submodule.fetchRecurseSubmodules true &&
 		git fetch >../actual.out 2>../actual.err
-	) &&
+	)
+'
+
+test_expect_success C_LOCALE_OUTPUT "using fetchRecurseSubmodules=true in .gitmodules recurses into submodules" '
 	test_cmp expect.out actual.out &&
 	test_cmp expect.err actual.err
 '
@@ -126,7 +132,10 @@ test_expect_success "--recurse-submodules overrides fetchRecurseSubmodules setti
 		git fetch --recurse-submodules >../actual.out 2>../actual.err &&
 		git config --unset -f .gitmodules submodule.submodule.fetchRecurseSubmodules &&
 		git config --unset submodule.submodule.fetchRecurseSubmodules
-	) &&
+	)
+'
+
+test_expect_success C_LOCALE_OUTPUT "--recurse-submodules overrides fetchRecurseSubmodules setting from .git/config: output" '
 	test_cmp expect.out actual.out &&
 	test_cmp expect.err actual.err
 '
@@ -145,13 +154,22 @@ test_expect_success "--dry-run propagates to submodules" '
 	(
 		cd downstream &&
 		git fetch --recurse-submodules --dry-run >../actual.out 2>../actual.err
-	) &&
+	)
+'
+
+test_expect_success C_LOCALE_OUTPUT "--dry-run propagates to submodules: output" '
 	test_cmp expect.out actual.out &&
-	test_cmp expect.err actual.err &&
+	test_cmp expect.err actual.err
+'
+
+test_expect_success "Without --dry-run propagates to submodules" '
 	(
 		cd downstream &&
 		git fetch --recurse-submodules >../actual.out 2>../actual.err
-	) &&
+	)
+'
+
+test_expect_success C_LOCALE_OUTPUT "Without --dry-run propagates to submodules: output" '
 	test_cmp expect.out actual.out &&
 	test_cmp expect.err actual.err
 '
@@ -162,7 +180,10 @@ test_expect_success "recurseSubmodules=true propagates into submodules" '
 		cd downstream &&
 		git config fetch.recurseSubmodules true
 		git fetch >../actual.out 2>../actual.err
-	) &&
+	)
+'
+
+test_expect_success C_LOCALE_OUTPUT "recurseSubmodules=true propagates into submodules: output" '
 	test_cmp expect.out actual.out &&
 	test_cmp expect.err actual.err
 '
@@ -176,7 +197,10 @@ test_expect_success "--recurse-submodules overrides config in submodule" '
 			git config fetch.recurseSubmodules false
 		) &&
 		git fetch --recurse-submodules >../actual.out 2>../actual.err
-	) &&
+	)
+'
+
+test_expect_success C_LOCALE_OUTPUT "--recurse-submodules overrides config in submodule: output" '
 	test_cmp expect.out actual.out &&
 	test_cmp expect.err actual.err
 '
-- 
1.7.2.3

^ permalink raw reply related	[flat|nested] 222+ messages in thread

* [PATCH v4 34/73] gettextize: git-fetch update_local_ref messages
  2011-02-22 18:11     ` Junio C Hamano
                         ` (33 preceding siblings ...)
  2011-02-22 23:41       ` [PATCH v4 33/73] gettextize: git-fetch formatting messages Ævar Arnfjörð Bjarmason
@ 2011-02-22 23:41       ` Ævar Arnfjörð Bjarmason
  2011-02-22 23:41       ` [PATCH v4 35/73] gettextize: git-fetch split up "(non-fast-forward)" message Ævar Arnfjörð Bjarmason
                         ` (38 subsequent siblings)
  73 siblings, 0 replies; 222+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2011-02-22 23:41 UTC (permalink / raw)
  To: git
  Cc: Junio C Hamano, Jakub Narebski, Ævar Arnfjörð Bjarmason

Translate a "[rejected]" message spotted by Jeff King, and other
things in update_local_ref along with it.

Reported-by: Jeff King <peff@peff.net>
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
---
 builtin/fetch.c |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/builtin/fetch.c b/builtin/fetch.c
index 0a73dff..4f622fd 100644
--- a/builtin/fetch.c
+++ b/builtin/fetch.c
@@ -279,17 +279,17 @@ static int update_local_ref(struct ref *ref,
 		int r;
 		if (!strncmp(ref->name, "refs/tags/", 10)) {
 			msg = "storing tag";
-			what = "[new tag]";
+			what = _("[new tag]");
 		}
 		else {
 			msg = "storing head";
-			what = "[new branch]";
+			what = _("[new branch]");
 		}
 
 		r = s_update_ref(msg, ref, 0);
 		sprintf(display, "%c %-*s %-*s -> %s%s", r ? '!' : '*',
 			TRANSPORT_SUMMARY_WIDTH, what, REFCOL_WIDTH, remote, pretty_ref,
-			r ? "  (unable to update local ref)" : "");
+			r ? _("  (unable to update local ref)") : "");
 		return r;
 	}
 
@@ -302,7 +302,7 @@ static int update_local_ref(struct ref *ref,
 		r = s_update_ref("fast-forward", ref, 1);
 		sprintf(display, "%c %-*s %-*s -> %s%s", r ? '!' : ' ',
 			TRANSPORT_SUMMARY_WIDTH, quickref, REFCOL_WIDTH, remote,
-			pretty_ref, r ? "  (unable to update local ref)" : "");
+			pretty_ref, r ? _("  (unable to update local ref)") : "");
 		return r;
 	} else if (force || ref->force) {
 		char quickref[84];
@@ -314,7 +314,7 @@ static int update_local_ref(struct ref *ref,
 		sprintf(display, "%c %-*s %-*s -> %s  (%s)", r ? '!' : '+',
 			TRANSPORT_SUMMARY_WIDTH, quickref, REFCOL_WIDTH, remote,
 			pretty_ref,
-			r ? "unable to update local ref" : "forced update");
+			r ? _("unable to update local ref") : _("forced update"));
 		return r;
 	} else {
 		sprintf(display, "! %-*s %-*s -> %s  (non-fast-forward)",
-- 
1.7.2.3

^ permalink raw reply related	[flat|nested] 222+ messages in thread

* [PATCH v4 35/73] gettextize: git-fetch split up "(non-fast-forward)" message
  2011-02-22 18:11     ` Junio C Hamano
                         ` (34 preceding siblings ...)
  2011-02-22 23:41       ` [PATCH v4 34/73] gettextize: git-fetch update_local_ref messages Ævar Arnfjörð Bjarmason
@ 2011-02-22 23:41       ` Ævar Arnfjörð Bjarmason
  2011-02-22 23:41       ` [PATCH v4 36/73] gettextize: git-grep basic messages Ævar Arnfjörð Bjarmason
                         ` (37 subsequent siblings)
  73 siblings, 0 replies; 222+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2011-02-22 23:41 UTC (permalink / raw)
  To: git
  Cc: Junio C Hamano, Jakub Narebski, Ævar Arnfjörð Bjarmason

Split up the "(non-fast-forward)" message from printf directives and
make it translatable.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
---
 builtin/fetch.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/builtin/fetch.c b/builtin/fetch.c
index 4f622fd..ee2c5f5 100644
--- a/builtin/fetch.c
+++ b/builtin/fetch.c
@@ -317,9 +317,9 @@ static int update_local_ref(struct ref *ref,
 			r ? _("unable to update local ref") : _("forced update"));
 		return r;
 	} else {
-		sprintf(display, "! %-*s %-*s -> %s  (non-fast-forward)",
-			TRANSPORT_SUMMARY_WIDTH, "[rejected]", REFCOL_WIDTH, remote,
-			pretty_ref);
+		sprintf(display, "! %-*s %-*s -> %s  %s",
+			TRANSPORT_SUMMARY_WIDTH, _("[rejected]"), REFCOL_WIDTH, remote,
+			pretty_ref, _("(non-fast-forward)"));
 		return 1;
 	}
 }
-- 
1.7.2.3

^ permalink raw reply related	[flat|nested] 222+ messages in thread

* [PATCH v4 36/73] gettextize: git-grep basic messages
  2011-02-22 18:11     ` Junio C Hamano
                         ` (35 preceding siblings ...)
  2011-02-22 23:41       ` [PATCH v4 35/73] gettextize: git-fetch split up "(non-fast-forward)" message Ævar Arnfjörð Bjarmason
@ 2011-02-22 23:41       ` Ævar Arnfjörð Bjarmason
  2011-02-22 23:41       ` [PATCH v4 37/73] gettextize: git-grep "--open-files-in-pager" message Ævar Arnfjörð Bjarmason
                         ` (36 subsequent siblings)
  73 siblings, 0 replies; 222+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2011-02-22 23:41 UTC (permalink / raw)
  To: git
  Cc: Junio C Hamano, Jakub Narebski, Ævar Arnfjörð Bjarmason

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
---
 builtin/grep.c |   32 ++++++++++++++++----------------
 1 files changed, 16 insertions(+), 16 deletions(-)

diff --git a/builtin/grep.c b/builtin/grep.c
index fdf7131..d35b76c 100644
--- a/builtin/grep.c
+++ b/builtin/grep.c
@@ -245,7 +245,7 @@ static void start_threads(struct grep_opt *opt)
 		err = pthread_create(&threads[i], NULL, run, o);
 
 		if (err)
-			die("grep: failed to create thread: %s",
+			die(_("grep: failed to create thread: %s"),
 			    strerror(err));
 	}
 }
@@ -450,7 +450,7 @@ static void *load_sha1(const unsigned char *sha1, unsigned long *size,
 	void *data = lock_and_read_sha1_file(sha1, &type, size);
 
 	if (!data)
-		error("'%s': unable to read %s", name, sha1_to_hex(sha1));
+		error(_("'%s': unable to read %s"), name, sha1_to_hex(sha1));
 
 	return data;
 }
@@ -501,7 +501,7 @@ static void *load_file(const char *filename, size_t *sz)
 	if (lstat(filename, &st) < 0) {
 	err_ret:
 		if (errno != ENOENT)
-			error("'%s': %s", filename, strerror(errno));
+			error(_("'%s': %s"), filename, strerror(errno));
 		return 0;
 	}
 	if (!S_ISREG(st.st_mode))
@@ -512,7 +512,7 @@ static void *load_file(const char *filename, size_t *sz)
 		goto err_ret;
 	data = xmalloc(*sz + 1);
 	if (st.st_size != read_in_full(i, data, *sz)) {
-		error("'%s': short read %s", filename, strerror(errno));
+		error(_("'%s': short read %s"), filename, strerror(errno));
 		close(i);
 		free(data);
 		return 0;
@@ -574,7 +574,7 @@ static void run_pager(struct grep_opt *opt, const char *prefix)
 	argv[path_list->nr] = NULL;
 
 	if (prefix && chdir(prefix))
-		die("Failed to chdir: %s", prefix);
+		die(_("Failed to chdir: %s"), prefix);
 	status = run_command_v_opt(argv, RUN_USING_SHELL);
 	if (status)
 		exit(status);
@@ -664,7 +664,7 @@ static int grep_tree(struct grep_opt *opt, const char **paths,
 
 			data = lock_and_read_sha1_file(entry.sha1, &type, &size);
 			if (!data)
-				die("unable to read tree (%s)",
+				die(_("unable to read tree (%s)"),
 				    sha1_to_hex(entry.sha1));
 			init_tree_desc(&sub, data, size);
 			hit |= grep_tree(opt, paths, &sub, tree_name, down);
@@ -690,13 +690,13 @@ static int grep_object(struct grep_opt *opt, const char **paths,
 		data = read_object_with_reference(obj->sha1, tree_type,
 						  &size, NULL);
 		if (!data)
-			die("unable to read tree (%s)", sha1_to_hex(obj->sha1));
+			die(_("unable to read tree (%s)"), sha1_to_hex(obj->sha1));
 		init_tree_desc(&tree, data, size);
 		hit = grep_tree(opt, paths, &tree, name, "");
 		free(data);
 		return hit;
 	}
-	die("unable to grep from object of type %s", typename(obj->type));
+	die(_("unable to grep from object of type %s"), typename(obj->type));
 }
 
 static int grep_objects(struct grep_opt *opt, const char **paths,
@@ -748,7 +748,7 @@ static int context_callback(const struct option *opt, const char *arg,
 	}
 	value = strtol(arg, (char **)&endp, 10);
 	if (*endp) {
-		return error("switch `%c' expects a numerical value",
+		return error(_("switch `%c' expects a numerical value"),
 			     opt->short_name);
 	}
 	grep_opt->pre_context = grep_opt->post_context = value;
@@ -764,7 +764,7 @@ static int file_callback(const struct option *opt, const char *arg, int unset)
 
 	patterns = fopen(arg, "r");
 	if (!patterns)
-		die_errno("cannot open '%s'", arg);
+		die_errno(_("cannot open '%s'"), arg);
 	while (strbuf_getline(&sb, patterns, '\n') == 0) {
 		char *s;
 		size_t len;
@@ -1005,11 +1005,11 @@ int cmd_grep(int argc, const char **argv, const char *prefix)
 	}
 
 	if (!opt.pattern_list)
-		die("no pattern given.");
+		die(_("no pattern given."));
 	if (!opt.fixed && opt.ignore_case)
 		opt.regflags |= REG_ICASE;
 	if ((opt.regflags != REG_NEWLINE) && opt.fixed)
-		die("cannot mix --fixed-strings and regexp");
+		die(_("cannot mix --fixed-strings and regexp"));
 
 #ifndef NO_PTHREADS
 	if (online_cpus() == 1 || !grep_threads_ok(&opt))
@@ -1034,7 +1034,7 @@ int cmd_grep(int argc, const char **argv, const char *prefix)
 		if (!get_sha1(arg, sha1)) {
 			struct object *object = parse_object(sha1);
 			if (!object)
-				die("bad object %s", arg);
+				die(_("bad object %s"), arg);
 			add_object_array(object, arg, &list);
 			continue;
 		}
@@ -1086,9 +1086,9 @@ int cmd_grep(int argc, const char **argv, const char *prefix)
 
 	if (!use_index) {
 		if (cached)
-			die("--cached cannot be used with --no-index.");
+			die(_("--cached cannot be used with --no-index."));
 		if (list.nr)
-			die("--no-index cannot be used with revs.");
+			die(_("--no-index cannot be used with revs."));
 		hit = grep_directory(&opt, paths);
 	} else if (!list.nr) {
 		if (!cached)
@@ -1097,7 +1097,7 @@ int cmd_grep(int argc, const char **argv, const char *prefix)
 		hit = grep_cache(&opt, paths, cached);
 	} else {
 		if (cached)
-			die("both --cached and trees are given.");
+			die(_("both --cached and trees are given."));
 		hit = grep_objects(&opt, paths, &list);
 	}
 
-- 
1.7.2.3

^ permalink raw reply related	[flat|nested] 222+ messages in thread

* [PATCH v4 37/73] gettextize: git-grep "--open-files-in-pager" message
  2011-02-22 18:11     ` Junio C Hamano
                         ` (36 preceding siblings ...)
  2011-02-22 23:41       ` [PATCH v4 36/73] gettextize: git-grep basic messages Ævar Arnfjörð Bjarmason
@ 2011-02-22 23:41       ` Ævar Arnfjörð Bjarmason
  2011-02-22 23:41       ` [PATCH v4 38/73] gettextize: git-log basic messages Ævar Arnfjörð Bjarmason
                         ` (35 subsequent siblings)
  73 siblings, 0 replies; 222+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2011-02-22 23:41 UTC (permalink / raw)
  To: git
  Cc: Junio C Hamano, Jakub Narebski, Ævar Arnfjörð Bjarmason

Gettextize the "--open-files-in-pager only works on the worktree"
message. A test in t7811-grep-open.sh explicitly checked for this
message. Change it to skip under GETTEXT_POISON=YesPlease.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
---
 builtin/grep.c       |    2 +-
 t/t7811-grep-open.sh |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/builtin/grep.c b/builtin/grep.c
index d35b76c..dfc32fb 100644
--- a/builtin/grep.c
+++ b/builtin/grep.c
@@ -1061,7 +1061,7 @@ int cmd_grep(int argc, const char **argv, const char *prefix)
 	}
 
 	if (show_in_pager && (cached || list.nr))
-		die("--open-files-in-pager only works on the worktree");
+		die(_("--open-files-in-pager only works on the worktree"));
 
 	if (show_in_pager && opt.pattern_list && !opt.pattern_list->next) {
 		const char *pager = path_list.items[0].string;
diff --git a/t/t7811-grep-open.sh b/t/t7811-grep-open.sh
index 568a6f2..aedf484 100755
--- a/t/t7811-grep-open.sh
+++ b/t/t7811-grep-open.sh
@@ -61,7 +61,7 @@ test_expect_success SIMPLEPAGER 'git grep -O' '
 	test_cmp empty out
 '
 
-test_expect_success 'git grep -O --cached' '
+test_expect_success C_LOCALE_OUTPUT 'git grep -O --cached' '
 	test_must_fail git grep --cached -O GREP_PATTERN >out 2>msg &&
 	grep open-files-in-pager msg
 '
-- 
1.7.2.3

^ permalink raw reply related	[flat|nested] 222+ messages in thread

* [PATCH v4 38/73] gettextize: git-log basic messages
  2011-02-22 18:11     ` Junio C Hamano
                         ` (37 preceding siblings ...)
  2011-02-22 23:41       ` [PATCH v4 37/73] gettextize: git-grep "--open-files-in-pager" message Ævar Arnfjörð Bjarmason
@ 2011-02-22 23:41       ` Ævar Arnfjörð Bjarmason
  2011-02-22 23:41       ` [PATCH v4 39/73] gettextize: git-log "--OPT does not make sense" messages Ævar Arnfjörð Bjarmason
                         ` (34 subsequent siblings)
  73 siblings, 0 replies; 222+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2011-02-22 23:41 UTC (permalink / raw)
  To: git
  Cc: Junio C Hamano, Jakub Narebski, Ævar Arnfjörð Bjarmason

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
---
 builtin/log.c |   62 ++++++++++++++++++++++++++++----------------------------
 1 files changed, 31 insertions(+), 31 deletions(-)

diff --git a/builtin/log.c b/builtin/log.c
index d8c6c28..b36a01e 100644
--- a/builtin/log.c
+++ b/builtin/log.c
@@ -101,7 +101,7 @@ static void cmd_log_init(int argc, const char **argv, const char *prefix,
 			const char *v = skip_prefix(arg, "--decorate=");
 			decoration_style = parse_decoration_style(arg, v);
 			if (decoration_style < 0)
-				die("invalid --decorate option: %s", arg);
+				die(_("invalid --decorate option: %s"), arg);
 			decoration_given = 1;
 		} else if (!strcmp(arg, "--no-decorate")) {
 			decoration_style = 0;
@@ -110,7 +110,7 @@ static void cmd_log_init(int argc, const char **argv, const char *prefix,
 		} else if (!strcmp(arg, "-h")) {
 			usage(builtin_log_usage);
 		} else
-			die("unrecognized argument: %s", arg);
+			die(_("unrecognized argument: %s"), arg);
 	}
 
 	/*
@@ -153,7 +153,7 @@ static void show_early_header(struct rev_info *rev, const char *stage, int nr)
 		if (rev->commit_format != CMIT_FMT_ONELINE)
 			putchar(rev->diffopt.line_termination);
 	}
-	printf("Final output: %d %s\n", nr, stage);
+	printf(_("Final output: %d %s\n"), nr, stage);
 }
 
 static struct itimerval early_output_timer;
@@ -252,7 +252,7 @@ static int cmd_log_walk(struct rev_info *rev)
 		setup_early_output(rev);
 
 	if (prepare_revision_walk(rev))
-		die("revision walk setup failed");
+		die(_("revision walk setup failed"));
 
 	if (rev->early_output)
 		finish_early_output(rev);
@@ -343,7 +343,7 @@ static int show_object(const unsigned char *sha1, int show_tag_object,
 	int offset = 0;
 
 	if (!buf)
-		return error("Could not read object %s", sha1_to_hex(sha1));
+		return error(_("Could not read object %s"), sha1_to_hex(sha1));
 
 	if (show_tag_object)
 		while (offset < size && buf[offset] != '\n') {
@@ -430,7 +430,7 @@ int cmd_show(int argc, const char **argv, const char *prefix)
 				break;
 			o = parse_object(t->tagged->sha1);
 			if (!o)
-				ret = error("Could not read object %s",
+				ret = error(_("Could not read object %s"),
 					    sha1_to_hex(t->tagged->sha1));
 			objects[i].item = o;
 			i--;
@@ -454,7 +454,7 @@ int cmd_show(int argc, const char **argv, const char *prefix)
 			ret = cmd_log_walk(&rev);
 			break;
 		default:
-			ret = error("Unknown type: %d", o->type);
+			ret = error(_("Unknown type: %d"), o->type);
 		}
 	}
 	free(objects);
@@ -554,7 +554,7 @@ static int git_format_config(const char *var, const char *value, void *cb)
 {
 	if (!strcmp(var, "format.headers")) {
 		if (!value)
-			die("format.headers without value");
+			die(_("format.headers without value"));
 		add_header(value);
 		return 0;
 	}
@@ -626,7 +626,7 @@ static int reopen_stdout(struct commit *commit, struct rev_info *rev)
 		strbuf_addstr(&filename, output_directory);
 		if (filename.len >=
 		    PATH_MAX - FORMAT_PATCH_NAME_MAX - suffix_len)
-			return error("name of output directory is too long");
+			return error(_("name of output directory is too long"));
 		if (filename.buf[filename.len - 1] != '/')
 			strbuf_addch(&filename, '/');
 	}
@@ -637,7 +637,7 @@ static int reopen_stdout(struct commit *commit, struct rev_info *rev)
 		fprintf(realstdout, "%s\n", filename.buf + outdir_offset);
 
 	if (freopen(filename.buf, "w", stdout) == NULL)
-		return error("Cannot open patch file %s", filename.buf);
+		return error(_("Cannot open patch file %s"), filename.buf);
 
 	strbuf_release(&filename);
 	return 0;
@@ -651,7 +651,7 @@ static void get_patch_ids(struct rev_info *rev, struct patch_ids *ids, const cha
 	unsigned flags1, flags2;
 
 	if (rev->pending.nr != 2)
-		die("Need exactly one range.");
+		die(_("Need exactly one range."));
 
 	o1 = rev->pending.objects[0].item;
 	flags1 = o1->flags;
@@ -659,7 +659,7 @@ static void get_patch_ids(struct rev_info *rev, struct patch_ids *ids, const cha
 	flags2 = o2->flags;
 
 	if ((flags1 & UNINTERESTING) == (flags2 & UNINTERESTING))
-		die("Not a range.");
+		die(_("Not a range."));
 
 	init_patch_ids(ids);
 
@@ -670,7 +670,7 @@ static void get_patch_ids(struct rev_info *rev, struct patch_ids *ids, const cha
 	add_pending_object(&check_rev, o1, "o1");
 	add_pending_object(&check_rev, o2, "o2");
 	if (prepare_revision_walk(&check_rev))
-		die("revision walk setup failed");
+		die(_("revision walk setup failed"));
 
 	while ((commit = get_revision(&check_rev)) != NULL) {
 		/* ignore merges */
@@ -696,7 +696,7 @@ static void gen_message_id(struct rev_info *info, char *base)
 	const char *email_end = strrchr(committer, '>');
 	struct strbuf buf = STRBUF_INIT;
 	if (!email_start || !email_end || email_start > email_end - 1)
-		die("Could not extract email from committer identity.");
+		die(_("Could not extract email from committer identity."));
 	strbuf_addf(&buf, "%s.%lu.git.%.*s", base,
 		    (unsigned long) time(NULL),
 		    (int)(email_end - email_start - 1), email_start + 1);
@@ -728,7 +728,7 @@ static void make_cover_letter(struct rev_info *rev, int use_stdout,
 	struct commit *commit = NULL;
 
 	if (rev->commit_format != CMIT_FMT_EMAIL)
-		die("Cover letter needs email format");
+		die(_("Cover letter needs email format"));
 
 	committer = git_committer_info(0);
 
@@ -821,7 +821,7 @@ static const char *clean_message_id(const char *msg_id)
 		m++;
 	}
 	if (!z)
-		die("insane in-reply-to: %s", msg_id);
+		die(_("insane in-reply-to: %s"), msg_id);
 	if (++z == m)
 		return a;
 	return xmemdupz(a, z - a);
@@ -894,7 +894,7 @@ static int output_directory_callback(const struct option *opt, const char *arg,
 {
 	const char **dir = (const char **)opt->value;
 	if (*dir)
-		die("Two output directories?");
+		die(_("Two output directories?"));
 	*dir = arg;
 	return 0;
 }
@@ -1082,7 +1082,7 @@ int cmd_format_patch(int argc, const char **argv, const char *prefix)
 		committer = git_committer_info(IDENT_ERROR_ON_NO_NAME);
 		endpos = strchr(committer, '>');
 		if (!endpos)
-			die("bogus committer info %s", committer);
+			die(_("bogus committer info %s"), committer);
 		add_signoff = xmemdupz(committer, endpos - committer + 1);
 	}
 
@@ -1127,13 +1127,13 @@ int cmd_format_patch(int argc, const char **argv, const char *prefix)
 		numbered = 0;
 
 	if (numbered && keep_subject)
-		die ("-n and -k are mutually exclusive.");
+		die (_("-n and -k are mutually exclusive."));
 	if (keep_subject && subject_prefix)
-		die ("--subject-prefix and -k are mutually exclusive.");
+		die (_("--subject-prefix and -k are mutually exclusive."));
 
 	argc = setup_revisions(argc, argv, &rev, &s_r_opt);
 	if (argc > 1)
-		die ("unrecognized argument: %s", argv[1]);
+		die (_("unrecognized argument: %s"), argv[1]);
 
 	if (rev.diffopt.output_format & DIFF_FORMAT_NAME)
 		die("--name-only does not make sense");
@@ -1163,9 +1163,9 @@ int cmd_format_patch(int argc, const char **argv, const char *prefix)
 
 	if (output_directory) {
 		if (use_stdout)
-			die("standard output, or directory, which one?");
+			die(_("standard output, or directory, which one?"));
 		if (mkdir(output_directory, 0777) < 0 && errno != EEXIST)
-			die_errno("Could not create directory '%s'",
+			die_errno(_("Could not create directory '%s'"),
 				  output_directory);
 	}
 
@@ -1219,7 +1219,7 @@ int cmd_format_patch(int argc, const char **argv, const char *prefix)
 		realstdout = xfdopen(xdup(1), "w");
 
 	if (prepare_revision_walk(&rev))
-		die("revision walk setup failed");
+		die(_("revision walk setup failed"));
 	rev.boundary = 1;
 	while ((commit = get_revision(&rev)) != NULL) {
 		if (commit->object.flags & BOUNDARY) {
@@ -1300,7 +1300,7 @@ int cmd_format_patch(int argc, const char **argv, const char *prefix)
 
 		if (!use_stdout && reopen_stdout(numbered_files ? NULL : commit,
 						 &rev))
-			die("Failed to create output files");
+			die(_("Failed to create output files"));
 		shown = log_tree_commit(&rev, commit);
 		free(commit->buffer);
 		commit->buffer = NULL;
@@ -1387,9 +1387,9 @@ int cmd_cherry(int argc, const char **argv, const char *prefix)
 		if (!current_branch || !current_branch->merge
 					|| !current_branch->merge[0]
 					|| !current_branch->merge[0]->dst) {
-			fprintf(stderr, "Could not find a tracked"
+			fprintf(stderr, _("Could not find a tracked"
 					" remote branch, please"
-					" specify <upstream> manually.\n");
+					" specify <upstream> manually.\n"));
 			usage_with_options(cherry_usage, options);
 		}
 
@@ -1403,9 +1403,9 @@ int cmd_cherry(int argc, const char **argv, const char *prefix)
 	DIFF_OPT_SET(&revs.diffopt, RECURSIVE);
 
 	if (add_pending_commit(head, &revs, 0))
-		die("Unknown commit %s", head);
+		die(_("Unknown commit %s"), head);
 	if (add_pending_commit(upstream, &revs, UNINTERESTING))
-		die("Unknown commit %s", upstream);
+		die(_("Unknown commit %s"), upstream);
 
 	/* Don't say anything if head and upstream are the same. */
 	if (revs.pending.nr == 2) {
@@ -1417,11 +1417,11 @@ int cmd_cherry(int argc, const char **argv, const char *prefix)
 	get_patch_ids(&revs, &ids, prefix);
 
 	if (limit && add_pending_commit(limit, &revs, UNINTERESTING))
-		die("Unknown commit %s", limit);
+		die(_("Unknown commit %s"), limit);
 
 	/* reverse the list of commits */
 	if (prepare_revision_walk(&revs))
-		die("revision walk setup failed");
+		die(_("revision walk setup failed"));
 	while ((commit = get_revision(&revs)) != NULL) {
 		/* ignore merges */
 		if (commit->parents && commit->parents->next)
-- 
1.7.2.3

^ permalink raw reply related	[flat|nested] 222+ messages in thread

* [PATCH v4 39/73] gettextize: git-log "--OPT does not make sense" messages
  2011-02-22 18:11     ` Junio C Hamano
                         ` (38 preceding siblings ...)
  2011-02-22 23:41       ` [PATCH v4 38/73] gettextize: git-log basic messages Ævar Arnfjörð Bjarmason
@ 2011-02-22 23:41       ` Ævar Arnfjörð Bjarmason
  2011-02-22 23:41       ` [PATCH v4 40/73] gettextize: git-merge basic messages Ævar Arnfjörð Bjarmason
                         ` (33 subsequent siblings)
  73 siblings, 0 replies; 222+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2011-02-22 23:41 UTC (permalink / raw)
  To: git
  Cc: Junio C Hamano, Jakub Narebski, Ævar Arnfjörð Bjarmason

Gettextize the "--name-only/--name-status/--check does not make sense"
messages. A test in t4014-format-patch.sh explicitly checked for these
messages. Change them to skip under GETTEXT_POISON=YesPlease.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
---
 builtin/log.c           |    6 +++---
 t/t4014-format-patch.sh |    2 +-
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/builtin/log.c b/builtin/log.c
index b36a01e..853f5d0 100644
--- a/builtin/log.c
+++ b/builtin/log.c
@@ -1136,11 +1136,11 @@ int cmd_format_patch(int argc, const char **argv, const char *prefix)
 		die (_("unrecognized argument: %s"), argv[1]);
 
 	if (rev.diffopt.output_format & DIFF_FORMAT_NAME)
-		die("--name-only does not make sense");
+		die(_("--name-only does not make sense"));
 	if (rev.diffopt.output_format & DIFF_FORMAT_NAME_STATUS)
-		die("--name-status does not make sense");
+		die(_("--name-status does not make sense"));
 	if (rev.diffopt.output_format & DIFF_FORMAT_CHECKDIFF)
-		die("--check does not make sense");
+		die(_("--check does not make sense"));
 
 	if (!use_patch_format &&
 		(!rev.diffopt.output_format ||
diff --git a/t/t4014-format-patch.sh b/t/t4014-format-patch.sh
index 027c13d..a46d888 100755
--- a/t/t4014-format-patch.sh
+++ b/t/t4014-format-patch.sh
@@ -614,7 +614,7 @@ echo "fatal: --name-only does not make sense" > expect.name-only
 echo "fatal: --name-status does not make sense" > expect.name-status
 echo "fatal: --check does not make sense" > expect.check
 
-test_expect_success 'options no longer allowed for format-patch' '
+test_expect_success C_LOCALE_OUTPUT 'options no longer allowed for format-patch' '
 	test_must_fail git format-patch --name-only 2> output &&
 	test_cmp expect.name-only output &&
 	test_must_fail git format-patch --name-status 2> output &&
-- 
1.7.2.3

^ permalink raw reply related	[flat|nested] 222+ messages in thread

* [PATCH v4 40/73] gettextize: git-merge basic messages
  2011-02-22 18:11     ` Junio C Hamano
                         ` (39 preceding siblings ...)
  2011-02-22 23:41       ` [PATCH v4 39/73] gettextize: git-log "--OPT does not make sense" messages Ævar Arnfjörð Bjarmason
@ 2011-02-22 23:41       ` Ævar Arnfjörð Bjarmason
  2011-02-22 23:42       ` [PATCH v4 41/73] gettextize: git-merge "Updating %s..%s" message Ævar Arnfjörð Bjarmason
                         ` (32 subsequent siblings)
  73 siblings, 0 replies; 222+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2011-02-22 23:41 UTC (permalink / raw)
  To: git
  Cc: Junio C Hamano, Jakub Narebski, Ævar Arnfjörð Bjarmason

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
---
 builtin/merge.c            |  124 ++++++++++++++++++++++----------------------
 t/t7607-merge-overwrite.sh |   10 +++-
 t/t7611-merge-abort.sh     |   20 ++++++--
 3 files changed, 86 insertions(+), 68 deletions(-)

diff --git a/builtin/merge.c b/builtin/merge.c
index 8c58c3c..0be4dfa 100644
--- a/builtin/merge.c
+++ b/builtin/merge.c
@@ -80,7 +80,7 @@ static int option_parse_message(const struct option *opt,
 		strbuf_addf(buf, "%s%s", buf->len ? "\n\n" : "", arg);
 		have_message = 1;
 	} else
-		return error("switch `m' requires a value");
+		return error(_("switch `m' requires a value"));
 	return 0;
 }
 
@@ -117,13 +117,13 @@ static struct strategy *get_strategy(const char *name)
 		exclude_cmds(&main_cmds, &not_strategies);
 	}
 	if (!is_in_cmdlist(&main_cmds, name) && !is_in_cmdlist(&other_cmds, name)) {
-		fprintf(stderr, "Could not find merge strategy '%s'.\n", name);
-		fprintf(stderr, "Available strategies are:");
+		fprintf(stderr, _("Could not find merge strategy '%s'.\n"), name);
+		fprintf(stderr, _("Available strategies are:"));
 		for (i = 0; i < main_cmds.cnt; i++)
 			fprintf(stderr, " %s", main_cmds.names[i]->name);
 		fprintf(stderr, ".\n");
 		if (other_cmds.cnt) {
-			fprintf(stderr, "Available custom strategies are:");
+			fprintf(stderr, _("Available custom strategies are:"));
 			for (i = 0; i < other_cmds.cnt; i++)
 				fprintf(stderr, " %s", other_cmds.names[i]->name);
 			fprintf(stderr, ".\n");
@@ -224,17 +224,17 @@ static void save_state(void)
 	cp.git_cmd = 1;
 
 	if (start_command(&cp))
-		die("could not run stash.");
+		die(_("could not run stash."));
 	len = strbuf_read(&buffer, cp.out, 1024);
 	close(cp.out);
 
 	if (finish_command(&cp) || len < 0)
-		die("stash failed");
+		die(_("stash failed"));
 	else if (!len)
 		return;
 	strbuf_setlen(&buffer, buffer.len-1);
 	if (get_sha1(buffer.buf, stash))
-		die("not a valid object: %s", buffer.buf);
+		die(_("not a valid object: %s"), buffer.buf);
 }
 
 static void read_empty(unsigned const char *sha1, int verbose)
@@ -252,7 +252,7 @@ static void read_empty(unsigned const char *sha1, int verbose)
 	args[i] = NULL;
 
 	if (run_command_v_opt(args, RUN_GIT_CMD))
-		die("read-tree failed");
+		die(_("read-tree failed"));
 }
 
 static void reset_hard(unsigned const char *sha1, int verbose)
@@ -269,7 +269,7 @@ static void reset_hard(unsigned const char *sha1, int verbose)
 	args[i] = NULL;
 
 	if (run_command_v_opt(args, RUN_GIT_CMD))
-		die("read-tree failed");
+		die(_("read-tree failed"));
 }
 
 static void restore_state(void)
@@ -298,7 +298,7 @@ static void restore_state(void)
 static void finish_up_to_date(const char *msg)
 {
 	if (verbosity >= 0)
-		printf("%s%s\n", squash ? " (nothing to squash)" : "", msg);
+		printf("%s%s\n", squash ? _(" (nothing to squash)") : "", msg);
 	drop_save();
 }
 
@@ -311,10 +311,10 @@ static void squash_message(void)
 	int fd;
 	struct pretty_print_context ctx = {0};
 
-	printf("Squash commit -- not updating HEAD\n");
+	printf(_("Squash commit -- not updating HEAD\n"));
 	fd = open(git_path("SQUASH_MSG"), O_WRONLY | O_CREAT, 0666);
 	if (fd < 0)
-		die_errno("Could not write to '%s'", git_path("SQUASH_MSG"));
+		die_errno(_("Could not write to '%s'"), git_path("SQUASH_MSG"));
 
 	init_revisions(&rev, NULL);
 	rev.ignore_merges = 1;
@@ -329,7 +329,7 @@ static void squash_message(void)
 
 	setup_revisions(0, NULL, &rev, NULL);
 	if (prepare_revision_walk(&rev))
-		die("revision walk setup failed");
+		die(_("revision walk setup failed"));
 
 	ctx.abbrev = rev.abbrev;
 	ctx.date_mode = rev.date_mode;
@@ -342,9 +342,9 @@ static void squash_message(void)
 		pretty_print_commit(rev.commit_format, commit, &out, &ctx);
 	}
 	if (write(fd, out.buf, out.len) < 0)
-		die_errno("Writing SQUASH_MSG");
+		die_errno(_("Writing SQUASH_MSG"));
 	if (close(fd))
-		die_errno("Finishing SQUASH_MSG");
+		die_errno(_("Finishing SQUASH_MSG"));
 	strbuf_release(&out);
 }
 
@@ -364,7 +364,7 @@ static void finish(const unsigned char *new_head, const char *msg)
 		squash_message();
 	} else {
 		if (verbosity >= 0 && !merge_msg.len)
-			printf("No merge message -- not updating HEAD\n");
+			printf(_("No merge message -- not updating HEAD\n"));
 		else {
 			const char *argv_gc_auto[] = { "gc", "--auto", NULL };
 			update_ref(reflog_message.buf, "HEAD",
@@ -386,7 +386,7 @@ static void finish(const unsigned char *new_head, const char *msg)
 		if (diff_use_color_default > 0)
 			DIFF_OPT_SET(&opts, COLOR_DIFF);
 		if (diff_setup_done(&opts) < 0)
-			die("diff_setup_done failed");
+			die(_("diff_setup_done failed"));
 		diff_tree_sha1(head, new_head, "", &opts);
 		diffcore_std(&opts);
 		diff_flush(&opts);
@@ -415,7 +415,7 @@ static void merge_name(const char *remote, struct strbuf *msg)
 	memset(branch_head, 0, sizeof(branch_head));
 	remote_head = peel_to_type(remote, 0, NULL, OBJ_COMMIT);
 	if (!remote_head)
-		die("'%s' does not point to a commit", remote);
+		die(_("'%s' does not point to a commit"), remote);
 
 	if (dwim_ref(remote, strlen(remote), branch_head, &found_ref) > 0) {
 		if (!prefixcmp(found_ref, "refs/heads/")) {
@@ -480,7 +480,7 @@ static void merge_name(const char *remote, struct strbuf *msg)
 
 		fp = fopen(git_path("FETCH_HEAD"), "r");
 		if (!fp)
-			die_errno("could not open '%s' for reading",
+			die_errno(_("could not open '%s' for reading"),
 				  git_path("FETCH_HEAD"));
 		strbuf_getline(&line, fp, '\n');
 		fclose(fp);
@@ -510,7 +510,7 @@ static int git_merge_config(const char *k, const char *v, void *cb)
 		buf = xstrdup(v);
 		argc = split_cmdline(buf, &argv);
 		if (argc < 0)
-			die("Bad branch.%s.mergeoptions string: %s", branch,
+			die(_("Bad branch.%s.mergeoptions string: %s"), branch,
 			    split_cmdline_strerror(argc));
 		argv = xrealloc(argv, sizeof(*argv) * (argc + 2));
 		memmove(argv + 1, argv, sizeof(*argv) * (argc + 1));
@@ -532,7 +532,7 @@ static int git_merge_config(const char *k, const char *v, void *cb)
 		int is_bool;
 		shortlog_len = git_config_bool_or_int(k, v, &is_bool);
 		if (!is_bool && shortlog_len < 0)
-			return error("%s: negative length %s", k, v);
+			return error(_("%s: negative length %s"), k, v);
 		if (is_bool && shortlog_len)
 			shortlog_len = DEFAULT_MERGE_LOG_LEN;
 		return 0;
@@ -579,7 +579,7 @@ static int read_tree_trivial(unsigned char *common, unsigned char *head,
 static void write_tree_trivial(unsigned char *sha1)
 {
 	if (write_cache_as_tree(sha1, 0, NULL))
-		die("git write-tree failed to write a tree");
+		die(_("git write-tree failed to write a tree"));
 }
 
 int try_merge_command(const char *strategy, size_t xopts_nr,
@@ -621,7 +621,7 @@ int try_merge_command(const char *strategy, size_t xopts_nr,
 	free(args);
 	discard_cache();
 	if (read_cache() < 0)
-		die("failed to read the cache");
+		die(_("failed to read the cache"));
 	resolve_undo_clear();
 
 	return ret;
@@ -638,7 +638,7 @@ static int try_merge_strategy(const char *strategy, struct commit_list *common,
 	if (active_cache_changed &&
 			(write_cache(index_fd, active_cache, active_nr) ||
 			 commit_locked_index(lock)))
-		return error("Unable to write index.");
+		return error(_("Unable to write index."));
 	rollback_lock_file(lock);
 
 	if (!strcmp(strategy, "recursive") || !strcmp(strategy, "subtree")) {
@@ -651,7 +651,7 @@ static int try_merge_strategy(const char *strategy, struct commit_list *common,
 		struct commit_list *j;
 
 		if (remoteheads->next) {
-			error("Not handling anything other than two heads merge.");
+			error(_("Not handling anything other than two heads merge."));
 			return 2;
 		}
 
@@ -663,7 +663,7 @@ static int try_merge_strategy(const char *strategy, struct commit_list *common,
 
 		for (x = 0; x < xopts_nr; x++)
 			if (parse_merge_opt(&o, xopts[x]))
-				die("Unknown option for merge-recursive: -X%s", xopts[x]);
+				die(_("Unknown option for merge-recursive: -X%s"), xopts[x]);
 
 		o.branch1 = head_arg;
 		o.branch2 = remoteheads->item->util;
@@ -677,7 +677,7 @@ static int try_merge_strategy(const char *strategy, struct commit_list *common,
 		if (active_cache_changed &&
 				(write_cache(index_fd, active_cache, active_nr) ||
 				 commit_locked_index(lock)))
-			die ("unable to write %s", get_index_file());
+			die (_("unable to write %s"), get_index_file());
 		rollback_lock_file(lock);
 		return clean ? 0 : 1;
 	} else {
@@ -749,7 +749,7 @@ int checkout_fast_forward(const unsigned char *head, const unsigned char *remote
 		return -1;
 	if (write_cache(fd, active_cache, active_nr) ||
 		commit_locked_index(lock_file))
-		die("unable to write new index file");
+		die(_("unable to write new index file"));
 	return 0;
 }
 
@@ -852,7 +852,7 @@ static int suggest_conflicts(int renormalizing)
 
 	fp = fopen(git_path("MERGE_MSG"), "a");
 	if (!fp)
-		die_errno("Could not open '%s' for writing",
+		die_errno(_("Could not open '%s' for writing"),
 			  git_path("MERGE_MSG"));
 	fprintf(fp, "\nConflicts:\n");
 	for (pos = 0; pos < active_nr; pos++) {
@@ -868,8 +868,8 @@ static int suggest_conflicts(int renormalizing)
 	}
 	fclose(fp);
 	rerere(allow_rerere_auto);
-	printf("Automatic merge failed; "
-			"fix conflicts and then commit the result.\n");
+	printf(_("Automatic merge failed; "
+			"fix conflicts and then commit the result.\n"));
 	return 1;
 }
 
@@ -883,7 +883,7 @@ static struct commit *is_old_style_invocation(int argc, const char **argv)
 			return NULL;
 		second_token = lookup_commit_reference_gently(second_sha1, 0);
 		if (!second_token)
-			die("'%s' is not a commit", argv[1]);
+			die(_("'%s' is not a commit"), argv[1]);
 		if (hashcmp(second_token->object.sha1, head))
 			return NULL;
 	}
@@ -951,7 +951,7 @@ int cmd_merge(int argc, const char **argv, const char *prefix)
 		const char *nargv[] = {"reset", "--merge", NULL};
 
 		if (!file_exists(git_path("MERGE_HEAD")))
-			die("There is no merge to abort (MERGE_HEAD missing).");
+			die(_("There is no merge to abort (MERGE_HEAD missing)."));
 
 		/* Invoke 'git reset --merge' */
 		return cmd_reset(nargc, nargv, prefix);
@@ -966,10 +966,10 @@ int cmd_merge(int argc, const char **argv, const char *prefix)
 		 * add/rm <file>', just 'git commit'.
 		 */
 		if (advice_resolve_conflict)
-			die("You have not concluded your merge (MERGE_HEAD exists).\n"
-			    "Please, commit your changes before you can merge.");
+			die(_("You have not concluded your merge (MERGE_HEAD exists).\n"
+				  "Please, commit your changes before you can merge."));
 		else
-			die("You have not concluded your merge (MERGE_HEAD exists).");
+			die(_("You have not concluded your merge (MERGE_HEAD exists)."));
 	}
 	resolve_undo_clear();
 
@@ -978,12 +978,12 @@ int cmd_merge(int argc, const char **argv, const char *prefix)
 
 	if (squash) {
 		if (!allow_fast_forward)
-			die("You cannot combine --squash with --no-ff.");
+			die(_("You cannot combine --squash with --no-ff."));
 		option_commit = 0;
 	}
 
 	if (!allow_fast_forward && fast_forward_only)
-		die("You cannot combine --no-ff with --ff-only.");
+		die(_("You cannot combine --no-ff with --ff-only."));
 
 	if (!argc)
 		usage_with_options(builtin_merge_usage,
@@ -1011,16 +1011,16 @@ int cmd_merge(int argc, const char **argv, const char *prefix)
 		 * We do the same for "git pull".
 		 */
 		if (argc != 1)
-			die("Can merge only exactly one commit into "
-				"empty head");
+			die(_("Can merge only exactly one commit into "
+				"empty head"));
 		if (squash)
-			die("Squash commit into empty head not supported yet");
+			die(_("Squash commit into empty head not supported yet"));
 		if (!allow_fast_forward)
-			die("Non-fast-forward commit does not make sense into "
-			    "an empty head");
+			die(_("Non-fast-forward commit does not make sense into "
+			    "an empty head"));
 		remote_head = peel_to_type(argv[0], 0, NULL, OBJ_COMMIT);
 		if (!remote_head)
-			die("%s - not something we can merge", argv[0]);
+			die(_("%s - not something we can merge"), argv[0]);
 		update_ref("initial pull", "HEAD", remote_head->sha1, NULL, 0,
 				DIE_ON_ERR);
 		read_empty(remote_head->sha1, 0);
@@ -1066,7 +1066,7 @@ int cmd_merge(int argc, const char **argv, const char *prefix)
 
 		o = peel_to_type(argv[i], 0, NULL, OBJ_COMMIT);
 		if (!o)
-			die("%s - not something we can merge", argv[i]);
+			die(_("%s - not something we can merge"), argv[i]);
 		commit = lookup_commit(o->sha1);
 		commit->util = (void *)argv[i];
 		remotes = &commit_list_insert(commit, remotes)->next;
@@ -1158,11 +1158,11 @@ int cmd_merge(int argc, const char **argv, const char *prefix)
 		if (allow_trivial && !fast_forward_only) {
 			/* See if it is really trivial. */
 			git_committer_info(IDENT_ERROR_ON_NO_NAME);
-			printf("Trying really trivial in-index merge...\n");
+			printf(_("Trying really trivial in-index merge...\n"));
 			if (!read_tree_trivial(common->item->object.sha1,
 					head, remoteheads->item->object.sha1))
 				return merge_trivial();
-			printf("Nope.\n");
+			printf(_("Nope.\n"));
 		}
 	} else {
 		/*
@@ -1195,7 +1195,7 @@ int cmd_merge(int argc, const char **argv, const char *prefix)
 	}
 
 	if (fast_forward_only)
-		die("Not possible to fast-forward, aborting.");
+		die(_("Not possible to fast-forward, aborting."));
 
 	/* We are going to make a new commit. */
 	git_committer_info(IDENT_ERROR_ON_NO_NAME);
@@ -1221,11 +1221,11 @@ int cmd_merge(int argc, const char **argv, const char *prefix)
 	for (i = 0; i < use_strategies_nr; i++) {
 		int ret;
 		if (i) {
-			printf("Rewinding the tree to pristine...\n");
+			printf(_("Rewinding the tree to pristine...\n"));
 			restore_state();
 		}
 		if (use_strategies_nr != 1)
-			printf("Trying merge strategy %s...\n",
+			printf(_("Trying merge strategy %s...\n"),
 				use_strategies[i]->name);
 		/*
 		 * Remember which strategy left the state in the working
@@ -1286,17 +1286,17 @@ int cmd_merge(int argc, const char **argv, const char *prefix)
 		restore_state();
 		if (use_strategies_nr > 1)
 			fprintf(stderr,
-				"No merge strategy handled the merge.\n");
+				_("No merge strategy handled the merge.\n"));
 		else
-			fprintf(stderr, "Merge with strategy %s failed.\n",
+			fprintf(stderr, _("Merge with strategy %s failed.\n"),
 				use_strategies[0]->name);
 		return 2;
 	} else if (best_strategy == wt_strategy)
 		; /* We already have its result in the working tree. */
 	else {
-		printf("Rewinding the tree to pristine...\n");
+		printf(_("Rewinding the tree to pristine...\n"));
 		restore_state();
-		printf("Using the %s to prepare resolving by hand.\n",
+		printf(_("Using the %s to prepare resolving by hand.\n"),
 			best_strategy);
 		try_merge_strategy(best_strategy, common, head_arg);
 	}
@@ -1312,35 +1312,35 @@ int cmd_merge(int argc, const char **argv, const char *prefix)
 				sha1_to_hex(j->item->object.sha1));
 		fd = open(git_path("MERGE_HEAD"), O_WRONLY | O_CREAT, 0666);
 		if (fd < 0)
-			die_errno("Could not open '%s' for writing",
+			die_errno(_("Could not open '%s' for writing"),
 				  git_path("MERGE_HEAD"));
 		if (write_in_full(fd, buf.buf, buf.len) != buf.len)
-			die_errno("Could not write to '%s'", git_path("MERGE_HEAD"));
+			die_errno(_("Could not write to '%s'"), git_path("MERGE_HEAD"));
 		close(fd);
 		strbuf_addch(&merge_msg, '\n');
 		fd = open(git_path("MERGE_MSG"), O_WRONLY | O_CREAT, 0666);
 		if (fd < 0)
-			die_errno("Could not open '%s' for writing",
+			die_errno(_("Could not open '%s' for writing"),
 				  git_path("MERGE_MSG"));
 		if (write_in_full(fd, merge_msg.buf, merge_msg.len) !=
 			merge_msg.len)
-			die_errno("Could not write to '%s'", git_path("MERGE_MSG"));
+			die_errno(_("Could not write to '%s'"), git_path("MERGE_MSG"));
 		close(fd);
 		fd = open(git_path("MERGE_MODE"), O_WRONLY | O_CREAT | O_TRUNC, 0666);
 		if (fd < 0)
-			die_errno("Could not open '%s' for writing",
+			die_errno(_("Could not open '%s' for writing"),
 				  git_path("MERGE_MODE"));
 		strbuf_reset(&buf);
 		if (!allow_fast_forward)
 			strbuf_addf(&buf, "no-ff");
 		if (write_in_full(fd, buf.buf, buf.len) != buf.len)
-			die_errno("Could not write to '%s'", git_path("MERGE_MODE"));
+			die_errno(_("Could not write to '%s'"), git_path("MERGE_MODE"));
 		close(fd);
 	}
 
 	if (merge_was_ok) {
-		fprintf(stderr, "Automatic merge went well; "
-			"stopped before committing as requested\n");
+		fprintf(stderr, _("Automatic merge went well; "
+			"stopped before committing as requested\n"));
 		return 0;
 	} else
 		return suggest_conflicts(option_renormalize);
diff --git a/t/t7607-merge-overwrite.sh b/t/t7607-merge-overwrite.sh
index 5f731a1..0a9b90b 100755
--- a/t/t7607-merge-overwrite.sh
+++ b/t/t7607-merge-overwrite.sh
@@ -150,8 +150,14 @@ test_expect_success 'will not overwrite untracked file on unborn branch' '
 	git rm -fr . &&
 	git checkout --orphan new &&
 	cp important c0.c &&
-	test_must_fail git merge c0 2>out &&
-	test_cmp out expect &&
+	test_must_fail git merge c0 2>out
+'
+
+test_expect_success C_LOCALE_OUTPUT 'will not overwrite untracked file on unborn branch: output' '
+	test_cmp out expect
+'
+
+test_expect_success 'will not overwrite untracked file on unborn branch .git/MERGE_HEAD sanity etc.' '
 	test_path_is_missing .git/MERGE_HEAD &&
 	test_cmp important c0.c
 '
diff --git a/t/t7611-merge-abort.sh b/t/t7611-merge-abort.sh
index 61890bc..cdb3f44 100755
--- a/t/t7611-merge-abort.sh
+++ b/t/t7611-merge-abort.sh
@@ -46,8 +46,14 @@ test_expect_success 'setup' '
 pre_merge_head="$(git rev-parse HEAD)"
 
 test_expect_success 'fails without MERGE_HEAD (unstarted merge)' '
-	test_must_fail git merge --abort 2>output &&
-	grep -q MERGE_HEAD output &&
+	test_must_fail git merge --abort 2>output
+'
+
+test_expect_success C_LOCALE_OUTPUT 'fails without MERGE_HEAD (unstarted merge): fatal output' '
+	grep -q MERGE_HEAD output
+'
+
+test_expect_success 'fails without MERGE_HEAD (unstarted merge): .git/MERGE_HEAD sanity' '
 	test ! -f .git/MERGE_HEAD &&
 	test "$pre_merge_head" = "$(git rev-parse HEAD)"
 '
@@ -57,8 +63,14 @@ test_expect_success 'fails without MERGE_HEAD (completed merge)' '
 	test ! -f .git/MERGE_HEAD &&
 	# Merge successfully completed
 	post_merge_head="$(git rev-parse HEAD)" &&
-	test_must_fail git merge --abort 2>output &&
-	grep -q MERGE_HEAD output &&
+	test_must_fail git merge --abort 2>output
+'
+
+test_expect_success C_LOCALE_OUTPUT 'fails without MERGE_HEAD (completed merge): output' '
+	grep -q MERGE_HEAD output
+'
+
+test_expect_success 'fails without MERGE_HEAD (completed merge): .git/MERGE_HEAD sanity' '
 	test ! -f .git/MERGE_HEAD &&
 	test "$post_merge_head" = "$(git rev-parse HEAD)"
 '
-- 
1.7.2.3

^ permalink raw reply related	[flat|nested] 222+ messages in thread

* [PATCH v4 41/73] gettextize: git-merge "Updating %s..%s" message
  2011-02-22 18:11     ` Junio C Hamano
                         ` (40 preceding siblings ...)
  2011-02-22 23:41       ` [PATCH v4 40/73] gettextize: git-merge basic messages Ævar Arnfjörð Bjarmason
@ 2011-02-22 23:42       ` Ævar Arnfjörð Bjarmason
  2011-02-22 23:42       ` [PATCH v4 42/73] gettextize: git-merge "You have not concluded your merge" messages Ævar Arnfjörð Bjarmason
                         ` (31 subsequent siblings)
  73 siblings, 0 replies; 222+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2011-02-22 23:42 UTC (permalink / raw)
  To: git
  Cc: Junio C Hamano, Jakub Narebski, Ævar Arnfjörð Bjarmason

Gettextize the "Updating %s..%s\n" message. A test in
t1200-tutorial.sh explicitly checked for this message. Split it into
two tests to skip the test_cmp test under GETTEXT_POISON=YesPlease.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
---
 builtin/merge.c     |    2 +-
 t/t1200-tutorial.sh |    5 ++++-
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/builtin/merge.c b/builtin/merge.c
index 0be4dfa..4f6b34f 100644
--- a/builtin/merge.c
+++ b/builtin/merge.c
@@ -1124,7 +1124,7 @@ int cmd_merge(int argc, const char **argv, const char *prefix)
 		strcpy(hex, find_unique_abbrev(head, DEFAULT_ABBREV));
 
 		if (verbosity >= 0)
-			printf("Updating %s..%s\n",
+			printf(_("Updating %s..%s\n"),
 				hex,
 				find_unique_abbrev(remoteheads->item->object.sha1,
 				DEFAULT_ABBREV));
diff --git a/t/t1200-tutorial.sh b/t/t1200-tutorial.sh
index bfa2c21..3264fef 100755
--- a/t/t1200-tutorial.sh
+++ b/t/t1200-tutorial.sh
@@ -163,7 +163,10 @@ test_expect_success 'git resolve' '
 	git checkout mybranch &&
 	git merge -m "Merge upstream changes." master |
 		sed -e "1s/[0-9a-f]\{7\}/VARIABLE/g" \
-		-e "s/^Fast[- ]forward /FASTFORWARD /" >resolve.output &&
+		-e "s/^Fast[- ]forward /FASTFORWARD /" >resolve.output
+'
+
+test_expect_success C_LOCALE_OUTPUT 'git resolve output' '
 	test_cmp resolve.expect resolve.output
 '
 
-- 
1.7.2.3

^ permalink raw reply related	[flat|nested] 222+ messages in thread

* [PATCH v4 42/73] gettextize: git-merge "You have not concluded your merge" messages
  2011-02-22 18:11     ` Junio C Hamano
                         ` (41 preceding siblings ...)
  2011-02-22 23:42       ` [PATCH v4 41/73] gettextize: git-merge "Updating %s..%s" message Ævar Arnfjörð Bjarmason
@ 2011-02-22 23:42       ` Ævar Arnfjörð Bjarmason
  2011-02-22 23:42       ` [PATCH v4 43/73] gettextize: git-merge "Wonderful" message Ævar Arnfjörð Bjarmason
                         ` (30 subsequent siblings)
  73 siblings, 0 replies; 222+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2011-02-22 23:42 UTC (permalink / raw)
  To: git
  Cc: Junio C Hamano, Jakub Narebski, Ævar Arnfjörð Bjarmason

Gettextize the "You have not concluded your merge messages. A test in
t3030-merge-recursive.sh explicitly checked for this message. Change
it to skip the test under GETTEXT_POISON=YesPlease.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
---
 t/t3030-merge-recursive.sh |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/t/t3030-merge-recursive.sh b/t/t3030-merge-recursive.sh
index 34794f8..806fdcc 100755
--- a/t/t3030-merge-recursive.sh
+++ b/t/t3030-merge-recursive.sh
@@ -312,7 +312,7 @@ test_expect_success 'merge-recursive result' '
 
 '
 
-test_expect_success 'fail if the index has unresolved entries' '
+test_expect_success C_LOCALE_OUTPUT 'fail if the index has unresolved entries' '
 
 	rm -fr [abcd] &&
 	git checkout -f "$c1" &&
-- 
1.7.2.3

^ permalink raw reply related	[flat|nested] 222+ messages in thread

* [PATCH v4 43/73] gettextize: git-merge "Wonderful" message
  2011-02-22 18:11     ` Junio C Hamano
                         ` (42 preceding siblings ...)
  2011-02-22 23:42       ` [PATCH v4 42/73] gettextize: git-merge "You have not concluded your merge" messages Ævar Arnfjörð Bjarmason
@ 2011-02-22 23:42       ` Ævar Arnfjörð Bjarmason
  2011-02-22 23:42       ` [PATCH v4 44/73] gettextize: git-mv basic messages Ævar Arnfjörð Bjarmason
                         ` (29 subsequent siblings)
  73 siblings, 0 replies; 222+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2011-02-22 23:42 UTC (permalink / raw)
  To: git
  Cc: Junio C Hamano, Jakub Narebski, Ævar Arnfjörð Bjarmason

Gettextize the "Wonderful" message. A test in t7600-merge.sh
explicitly checked for this message. Change it to skip under
GETTEXT_POISON=YesPlease.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
---
 builtin/merge.c  |    2 +-
 t/t7600-merge.sh |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/builtin/merge.c b/builtin/merge.c
index 4f6b34f..f998206 100644
--- a/builtin/merge.c
+++ b/builtin/merge.c
@@ -803,7 +803,7 @@ static int merge_trivial(void)
 	struct commit_list *parent = xmalloc(sizeof(*parent));
 
 	write_tree_trivial(result_tree);
-	printf("Wonderful.\n");
+	printf(_("Wonderful.\n"));
 	parent->item = lookup_commit(head);
 	parent->next = xmalloc(sizeof(*parent->next));
 	parent->next->item = remoteheads->item;
diff --git a/t/t7600-merge.sh b/t/t7600-merge.sh
index b147a1b..87d5d78 100755
--- a/t/t7600-merge.sh
+++ b/t/t7600-merge.sh
@@ -495,7 +495,7 @@ test_expect_success 'merge fast-forward in a dirty tree' '
 
 test_debug 'git log --graph --decorate --oneline --all'
 
-test_expect_success 'in-index merge' '
+test_expect_success C_LOCALE_OUTPUT 'in-index merge' '
 	git reset --hard c0 &&
 	git merge --no-ff -s resolve c1 >out &&
 	grep "Wonderful." out &&
-- 
1.7.2.3

^ permalink raw reply related	[flat|nested] 222+ messages in thread

* [PATCH v4 44/73] gettextize: git-mv basic messages
  2011-02-22 18:11     ` Junio C Hamano
                         ` (43 preceding siblings ...)
  2011-02-22 23:42       ` [PATCH v4 43/73] gettextize: git-merge "Wonderful" message Ævar Arnfjörð Bjarmason
@ 2011-02-22 23:42       ` Ævar Arnfjörð Bjarmason
  2011-02-22 23:42       ` [PATCH v4 45/73] gettextize: git-mv "bad" messages Ævar Arnfjörð Bjarmason
                         ` (28 subsequent siblings)
  73 siblings, 0 replies; 222+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2011-02-22 23:42 UTC (permalink / raw)
  To: git
  Cc: Junio C Hamano, Jakub Narebski, Ævar Arnfjörð Bjarmason

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
---
 builtin/mv.c |   16 ++++++++--------
 1 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/builtin/mv.c b/builtin/mv.c
index 93e8995..18a2218 100644
--- a/builtin/mv.c
+++ b/builtin/mv.c
@@ -74,7 +74,7 @@ int cmd_mv(int argc, const char **argv, const char *prefix)
 
 	newfd = hold_locked_index(&lock_file, 1);
 	if (read_cache() < 0)
-		die("index file corrupt");
+		die(_("index file corrupt"));
 
 	source = copy_pathspec(prefix, argv, argc, 0);
 	modes = xcalloc(argc, sizeof(enum update_mode));
@@ -100,7 +100,7 @@ int cmd_mv(int argc, const char **argv, const char *prefix)
 		const char *bad = NULL;
 
 		if (show_only)
-			printf("Checking rename of '%s' to '%s'\n", src, dst);
+			printf(_("Checking rename of '%s' to '%s'\n"), src, dst);
 
 		length = strlen(src);
 		if (lstat(src, &st) < 0)
@@ -120,7 +120,7 @@ int cmd_mv(int argc, const char **argv, const char *prefix)
 
 			first = cache_name_pos(src_w_slash, len_w_slash);
 			if (first >= 0)
-				die ("Huh? %.*s is in index?",
+				die (_("Huh? %.*s is in index?"),
 						len_w_slash, src_w_slash);
 
 			first = -1 - first;
@@ -172,7 +172,7 @@ int cmd_mv(int argc, const char **argv, const char *prefix)
 				 * check both source and destination
 				 */
 				if (S_ISREG(st.st_mode) || S_ISLNK(st.st_mode)) {
-					warning("%s; will overwrite!", bad);
+					warning(_("%s; will overwrite!"), bad);
 					bad = NULL;
 				} else
 					bad = "Cannot overwrite";
@@ -193,7 +193,7 @@ int cmd_mv(int argc, const char **argv, const char *prefix)
 					i--;
 				}
 			} else
-				die ("%s, source=%s, destination=%s",
+				die (_("%s, source=%s, destination=%s"),
 				     bad, src, dst);
 		}
 	}
@@ -203,10 +203,10 @@ int cmd_mv(int argc, const char **argv, const char *prefix)
 		enum update_mode mode = modes[i];
 		int pos;
 		if (show_only || verbose)
-			printf("Renaming %s to %s\n", src, dst);
+			printf(_("Renaming %s to %s\n"), src, dst);
 		if (!show_only && mode != INDEX &&
 				rename(src, dst) < 0 && !ignore_errors)
-			die_errno ("renaming '%s' failed", src);
+			die_errno (_("renaming '%s' failed"), src);
 
 		if (mode == WORKING_DIRECTORY)
 			continue;
@@ -220,7 +220,7 @@ int cmd_mv(int argc, const char **argv, const char *prefix)
 	if (active_cache_changed) {
 		if (write_cache(newfd, active_cache, active_nr) ||
 		    commit_locked_index(&lock_file))
-			die("Unable to write new index file");
+			die(_("Unable to write new index file"));
 	}
 
 	return 0;
-- 
1.7.2.3

^ permalink raw reply related	[flat|nested] 222+ messages in thread

* [PATCH v4 45/73] gettextize: git-mv "bad" messages
  2011-02-22 18:11     ` Junio C Hamano
                         ` (44 preceding siblings ...)
  2011-02-22 23:42       ` [PATCH v4 44/73] gettextize: git-mv basic messages Ævar Arnfjörð Bjarmason
@ 2011-02-22 23:42       ` Ævar Arnfjörð Bjarmason
  2011-02-22 23:42       ` [PATCH v4 46/73] gettextize: git-rm basic messages Ævar Arnfjörð Bjarmason
                         ` (27 subsequent siblings)
  73 siblings, 0 replies; 222+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2011-02-22 23:42 UTC (permalink / raw)
  To: git
  Cc: Junio C Hamano, Jakub Narebski, Ævar Arnfjörð Bjarmason

Gettextize messages made by assigning to the "bad" char* variable.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
---
 builtin/mv.c |   16 ++++++++--------
 1 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/builtin/mv.c b/builtin/mv.c
index 18a2218..40f33ca 100644
--- a/builtin/mv.c
+++ b/builtin/mv.c
@@ -104,13 +104,13 @@ int cmd_mv(int argc, const char **argv, const char *prefix)
 
 		length = strlen(src);
 		if (lstat(src, &st) < 0)
-			bad = "bad source";
+			bad = _("bad source");
 		else if (!strncmp(src, dst, length) &&
 				(dst[length] == 0 || dst[length] == '/')) {
-			bad = "can not move directory into itself";
+			bad = _("can not move directory into itself");
 		} else if ((src_is_dir = S_ISDIR(st.st_mode))
 				&& lstat(dst, &st) == 0)
-			bad = "cannot move directory over file";
+			bad = _("cannot move directory over file");
 		else if (src_is_dir) {
 			const char *src_w_slash = add_slash(src);
 			int len_w_slash = length + 1;
@@ -132,7 +132,7 @@ int cmd_mv(int argc, const char **argv, const char *prefix)
 			free((char *)src_w_slash);
 
 			if (last - first < 1)
-				bad = "source directory is empty";
+				bad = _("source directory is empty");
 			else {
 				int j, dst_len;
 
@@ -163,9 +163,9 @@ int cmd_mv(int argc, const char **argv, const char *prefix)
 				argc += last - first;
 			}
 		} else if (cache_name_pos(src, length) < 0)
-			bad = "not under version control";
+			bad = _("not under version control");
 		else if (lstat(dst, &st) == 0) {
-			bad = "destination exists";
+			bad = _("destination exists");
 			if (force) {
 				/*
 				 * only files can overwrite each other:
@@ -175,10 +175,10 @@ int cmd_mv(int argc, const char **argv, const char *prefix)
 					warning(_("%s; will overwrite!"), bad);
 					bad = NULL;
 				} else
-					bad = "Cannot overwrite";
+					bad = _("Cannot overwrite");
 			}
 		} else if (string_list_has_string(&src_for_dst, dst))
-			bad = "multiple sources for the same target";
+			bad = _("multiple sources for the same target");
 		else
 			string_list_insert(&src_for_dst, dst);
 
-- 
1.7.2.3

^ permalink raw reply related	[flat|nested] 222+ messages in thread

* [PATCH v4 46/73] gettextize: git-rm basic messages
  2011-02-22 18:11     ` Junio C Hamano
                         ` (45 preceding siblings ...)
  2011-02-22 23:42       ` [PATCH v4 45/73] gettextize: git-mv "bad" messages Ævar Arnfjörð Bjarmason
@ 2011-02-22 23:42       ` Ævar Arnfjörð Bjarmason
  2011-02-22 23:42       ` [PATCH v4 47/73] gettextize: git-reset " Ævar Arnfjörð Bjarmason
                         ` (26 subsequent siblings)
  73 siblings, 0 replies; 222+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2011-02-22 23:42 UTC (permalink / raw)
  To: git
  Cc: Junio C Hamano, Jakub Narebski, Ævar Arnfjörð Bjarmason

Make the basic git-mv messages translatable, but skip things like "rm
'%s'\n" and "git rm '%s'\n" for now.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
---
 builtin/rm.c |   22 +++++++++++-----------
 1 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/builtin/rm.c b/builtin/rm.c
index ff491d7..90c8a50 100644
--- a/builtin/rm.c
+++ b/builtin/rm.c
@@ -106,19 +106,19 @@ static int check_local_mod(unsigned char *head, int index_only)
 		 */
 		if (local_changes && staged_changes) {
 			if (!index_only || !(ce->ce_flags & CE_INTENT_TO_ADD))
-				errs = error("'%s' has staged content different "
+				errs = error(_("'%s' has staged content different "
 					     "from both the file and the HEAD\n"
-					     "(use -f to force removal)", name);
+					     "(use -f to force removal)"), name);
 		}
 		else if (!index_only) {
 			if (staged_changes)
-				errs = error("'%s' has changes staged in the index\n"
+				errs = error(_("'%s' has changes staged in the index\n"
 					     "(use --cached to keep the file, "
-					     "or -f to force removal)", name);
+					     "or -f to force removal)"), name);
 			if (local_changes)
-				errs = error("'%s' has local modifications\n"
+				errs = error(_("'%s' has local modifications\n"
 					     "(use --cached to keep the file, "
-					     "or -f to force removal)", name);
+					     "or -f to force removal)"), name);
 		}
 	}
 	return errs;
@@ -159,7 +159,7 @@ int cmd_rm(int argc, const char **argv, const char *prefix)
 	newfd = hold_locked_index(&lock_file, 1);
 
 	if (read_cache() < 0)
-		die("index file corrupt");
+		die(_("index file corrupt"));
 
 	pathspec = get_pathspec(prefix, argv);
 	refresh_index(&the_index, REFRESH_QUIET, pathspec, NULL, NULL);
@@ -183,7 +183,7 @@ int cmd_rm(int argc, const char **argv, const char *prefix)
 		for (i = 0; (match = pathspec[i]) != NULL ; i++) {
 			if (!seen[i]) {
 				if (!ignore_unmatch) {
-					die("pathspec '%s' did not match any files",
+					die(_("pathspec '%s' did not match any files"),
 					    match);
 				}
 			}
@@ -191,7 +191,7 @@ int cmd_rm(int argc, const char **argv, const char *prefix)
 				seen_any = 1;
 			}
 			if (!recursive && seen[i] == MATCHED_RECURSIVELY)
-				die("not removing '%s' recursively without -r",
+				die(_("not removing '%s' recursively without -r"),
 				    *match ? match : ".");
 		}
 
@@ -227,7 +227,7 @@ int cmd_rm(int argc, const char **argv, const char *prefix)
 			printf("rm '%s'\n", path);
 
 		if (remove_file_from_cache(path))
-			die("git rm: unable to remove %s", path);
+			die(_("git rm: unable to remove %s"), path);
 	}
 
 	if (show_only)
@@ -257,7 +257,7 @@ int cmd_rm(int argc, const char **argv, const char *prefix)
 	if (active_cache_changed) {
 		if (write_cache(newfd, active_cache, active_nr) ||
 		    commit_locked_index(&lock_file))
-			die("Unable to write new index file");
+			die(_("Unable to write new index file"));
 	}
 
 	return 0;
-- 
1.7.2.3

^ permalink raw reply related	[flat|nested] 222+ messages in thread

* [PATCH v4 47/73] gettextize: git-reset basic messages
  2011-02-22 18:11     ` Junio C Hamano
                         ` (46 preceding siblings ...)
  2011-02-22 23:42       ` [PATCH v4 46/73] gettextize: git-rm basic messages Ævar Arnfjörð Bjarmason
@ 2011-02-22 23:42       ` Ævar Arnfjörð Bjarmason
  2011-02-22 23:42       ` [PATCH v4 48/73] gettextize: git-reset reset_type_names messages Ævar Arnfjörð Bjarmason
                         ` (25 subsequent siblings)
  73 siblings, 0 replies; 222+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2011-02-22 23:42 UTC (permalink / raw)
  To: git
  Cc: Junio C Hamano, Jakub Narebski, Ævar Arnfjörð Bjarmason

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
---
 builtin/reset.c |   26 +++++++++++++-------------
 1 files changed, 13 insertions(+), 13 deletions(-)

diff --git a/builtin/reset.c b/builtin/reset.c
index 5de2bce..0823955 100644
--- a/builtin/reset.c
+++ b/builtin/reset.c
@@ -92,20 +92,20 @@ static int reset_index_file(const unsigned char *sha1, int reset_type, int quiet
 	if (reset_type == KEEP) {
 		unsigned char head_sha1[20];
 		if (get_sha1("HEAD", head_sha1))
-			return error("You do not have a valid HEAD.");
+			return error(_("You do not have a valid HEAD."));
 		if (!fill_tree_descriptor(desc, head_sha1))
-			return error("Failed to find tree of HEAD.");
+			return error(_("Failed to find tree of HEAD."));
 		nr++;
 		opts.fn = twoway_merge;
 	}
 
 	if (!fill_tree_descriptor(desc + nr - 1, sha1))
-		return error("Failed to find tree of %s.", sha1_to_hex(sha1));
+		return error(_("Failed to find tree of %s."), sha1_to_hex(sha1));
 	if (unpack_trees(nr, desc, &opts))
 		return -1;
 	if (write_cache(newfd, active_cache, active_nr) ||
 	    commit_locked_index(lock))
-		return error("Could not write new index file.");
+		return error(_("Could not write new index file."));
 
 	return 0;
 }
@@ -115,7 +115,7 @@ static void print_new_head_line(struct commit *commit)
 	const char *hex, *body;
 
 	hex = find_unique_abbrev(commit->object.sha1, DEFAULT_ABBREV);
-	printf("HEAD is now at %s", hex);
+	printf(_("HEAD is now at %s"), hex);
 	body = strstr(commit->buffer, "\n\n");
 	if (body) {
 		const char *eol;
@@ -139,7 +139,7 @@ static int update_index_refresh(int fd, struct lock_file *index_lock, int flags)
 	}
 
 	if (read_cache() < 0)
-		return error("Could not read index");
+		return error(_("Could not read index"));
 
 	result = refresh_index(&the_index, (flags), NULL, NULL,
 			       "Unstaged changes after reset:") ? 1 : 0;
@@ -167,7 +167,7 @@ static void update_index_from_diff(struct diff_queue_struct *q,
 			ce = make_cache_entry(one->mode, one->sha1, one->path,
 				0, 0);
 			if (!ce)
-				die("make_cache_entry failed for path '%s'",
+				die(_("make_cache_entry failed for path '%s'"),
 				    one->path);
 			add_cache_entry(ce, ADD_CACHE_OK_TO_ADD |
 				ADD_CACHE_OK_TO_REPLACE);
@@ -222,7 +222,7 @@ static void prepend_reflog_action(const char *action, char *buf, size_t size)
 	if (!rla)
 		rla = sep = "";
 	if (snprintf(buf, size, "%s%s%s", rla, sep, action) >= size)
-		warning("Reflog action message too long: %.*s...", 50, buf);
+		warning(_("Reflog action message too long: %.*s..."), 50, buf);
 }
 
 static void die_if_unmerged_cache(int reset_type)
@@ -300,16 +300,16 @@ int cmd_reset(int argc, const char **argv, const char *prefix)
 	}
 
 	if (get_sha1(rev, sha1))
-		die("Failed to resolve '%s' as a valid ref.", rev);
+		die(_("Failed to resolve '%s' as a valid ref."), rev);
 
 	commit = lookup_commit_reference(sha1);
 	if (!commit)
-		die("Could not parse object '%s'.", rev);
+		die(_("Could not parse object '%s'."), rev);
 	hashcpy(sha1, commit->object.sha1);
 
 	if (patch_mode) {
 		if (reset_type != NONE)
-			die("--patch is incompatible with --{hard,mixed,soft}");
+			die(_("--patch is incompatible with --{hard,mixed,soft}"));
 		return interactive_reset(rev, argv + i, prefix);
 	}
 
@@ -318,7 +318,7 @@ int cmd_reset(int argc, const char **argv, const char *prefix)
 	 * affecting the working tree nor HEAD. */
 	if (i < argc) {
 		if (reset_type == MIXED)
-			warning("--mixed with paths is deprecated; use 'git reset -- <paths>' instead.");
+			warning(_("--mixed with paths is deprecated; use 'git reset -- <paths>' instead."));
 		else if (reset_type != NONE)
 			die("Cannot do %s reset with paths.",
 					reset_type_names[reset_type]);
@@ -348,7 +348,7 @@ int cmd_reset(int argc, const char **argv, const char *prefix)
 		if (reset_type == KEEP)
 			err = err || reset_index_file(sha1, MIXED, quiet);
 		if (err)
-			die("Could not reset index file to revision '%s'.", rev);
+			die(_("Could not reset index file to revision '%s'."), rev);
 	}
 
 	/* Any resets update HEAD to the head being switched to,
-- 
1.7.2.3

^ permalink raw reply related	[flat|nested] 222+ messages in thread

* [PATCH v4 48/73] gettextize: git-reset reset_type_names messages
  2011-02-22 18:11     ` Junio C Hamano
                         ` (47 preceding siblings ...)
  2011-02-22 23:42       ` [PATCH v4 47/73] gettextize: git-reset " Ævar Arnfjörð Bjarmason
@ 2011-02-22 23:42       ` Ævar Arnfjörð Bjarmason
  2011-02-22 23:42       ` [PATCH v4 49/73] gettextize: git-reset "Unstaged changes after reset" message Ævar Arnfjörð Bjarmason
                         ` (24 subsequent siblings)
  73 siblings, 0 replies; 222+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2011-02-22 23:42 UTC (permalink / raw)
  To: git
  Cc: Junio C Hamano, Jakub Narebski, Ævar Arnfjörð Bjarmason

Make the messages in git-reset that use the reset_type_names static
array to be translatable by marking the array items with N_() and
using _() later.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
---
 builtin/reset.c |   14 +++++++-------
 1 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/builtin/reset.c b/builtin/reset.c
index 0823955..1465174 100644
--- a/builtin/reset.c
+++ b/builtin/reset.c
@@ -30,7 +30,7 @@ static const char * const git_reset_usage[] = {
 
 enum reset_type { MIXED, SOFT, HARD, MERGE, KEEP, NONE };
 static const char *reset_type_names[] = {
-	"mixed", "soft", "hard", "merge", "keep", NULL
+	N_("mixed"), N_("soft"), N_("hard"), N_("merge"), N_("keep"), NULL
 };
 
 static char *args_to_str(const char **argv)
@@ -228,8 +228,8 @@ static void prepend_reflog_action(const char *action, char *buf, size_t size)
 static void die_if_unmerged_cache(int reset_type)
 {
 	if (is_merge() || read_cache() < 0 || unmerged_cache())
-		die("Cannot do a %s reset in the middle of a merge.",
-		    reset_type_names[reset_type]);
+		die(_("Cannot do a %s reset in the middle of a merge."),
+		    _(reset_type_names[reset_type]));
 
 }
 
@@ -320,8 +320,8 @@ int cmd_reset(int argc, const char **argv, const char *prefix)
 		if (reset_type == MIXED)
 			warning(_("--mixed with paths is deprecated; use 'git reset -- <paths>' instead."));
 		else if (reset_type != NONE)
-			die("Cannot do %s reset with paths.",
-					reset_type_names[reset_type]);
+			die(_("Cannot do %s reset with paths."),
+					_(reset_type_names[reset_type]));
 		return read_from_tree(prefix, argv + i, sha1,
 				quiet ? REFRESH_QUIET : REFRESH_IN_PORCELAIN);
 	}
@@ -332,8 +332,8 @@ int cmd_reset(int argc, const char **argv, const char *prefix)
 		setup_work_tree();
 
 	if (reset_type == MIXED && is_bare_repository())
-		die("%s reset is not allowed in a bare repository",
-		    reset_type_names[reset_type]);
+		die(_("%s reset is not allowed in a bare repository"),
+		    _(reset_type_names[reset_type]));
 
 	/* Soft reset does not touch the index file nor the working tree
 	 * at all, but requires them in a good order.  Other resets reset
-- 
1.7.2.3

^ permalink raw reply related	[flat|nested] 222+ messages in thread

* [PATCH v4 49/73] gettextize: git-reset "Unstaged changes after reset" message
  2011-02-22 18:11     ` Junio C Hamano
                         ` (48 preceding siblings ...)
  2011-02-22 23:42       ` [PATCH v4 48/73] gettextize: git-reset reset_type_names messages Ævar Arnfjörð Bjarmason
@ 2011-02-22 23:42       ` Ævar Arnfjörð Bjarmason
  2011-02-22 23:42       ` [PATCH v4 50/73] gettextize: git-tag basic messages Ævar Arnfjörð Bjarmason
                         ` (23 subsequent siblings)
  73 siblings, 0 replies; 222+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2011-02-22 23:42 UTC (permalink / raw)
  To: git
  Cc: Junio C Hamano, Jakub Narebski, Ævar Arnfjörð Bjarmason

Gettextize the ""Unstaged changes after reset:" message. A test in
t7102-reset.sh explicitly checked for this message. Change it to skip
under GETTEXT_POISON=YesPlease.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
---
 builtin/reset.c  |    2 +-
 t/t7102-reset.sh |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/builtin/reset.c b/builtin/reset.c
index 1465174..1fe5b0f 100644
--- a/builtin/reset.c
+++ b/builtin/reset.c
@@ -142,7 +142,7 @@ static int update_index_refresh(int fd, struct lock_file *index_lock, int flags)
 		return error(_("Could not read index"));
 
 	result = refresh_index(&the_index, (flags), NULL, NULL,
-			       "Unstaged changes after reset:") ? 1 : 0;
+			       _("Unstaged changes after reset:")) ? 1 : 0;
 	if (write_cache(fd, active_cache, active_nr) ||
 			commit_locked_index(index_lock))
 		return error ("Could not refresh index");
diff --git a/t/t7102-reset.sh b/t/t7102-reset.sh
index b8cf260..7be2ff3 100755
--- a/t/t7102-reset.sh
+++ b/t/t7102-reset.sh
@@ -423,7 +423,7 @@ Unstaged changes after reset:
 M	file2
 EOF
 
-test_expect_success '--mixed refreshes the index' '
+test_expect_success C_LOCALE_OUTPUT '--mixed refreshes the index' '
 	echo 123 >> file2 &&
 	git reset --mixed HEAD > output &&
 	test_cmp expect output
-- 
1.7.2.3

^ permalink raw reply related	[flat|nested] 222+ messages in thread

* [PATCH v4 50/73] gettextize: git-tag basic messages
  2011-02-22 18:11     ` Junio C Hamano
                         ` (49 preceding siblings ...)
  2011-02-22 23:42       ` [PATCH v4 49/73] gettextize: git-reset "Unstaged changes after reset" message Ævar Arnfjörð Bjarmason
@ 2011-02-22 23:42       ` Ævar Arnfjörð Bjarmason
  2011-02-22 23:42       ` [PATCH v4 51/73] gettextize: git-tag tag_template message Ævar Arnfjörð Bjarmason
                         ` (22 subsequent siblings)
  73 siblings, 0 replies; 222+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2011-02-22 23:42 UTC (permalink / raw)
  To: git
  Cc: Junio C Hamano, Jakub Narebski, Ævar Arnfjörð Bjarmason

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
---
 builtin/tag.c |   60 ++++++++++++++++++++++++++++----------------------------
 1 files changed, 30 insertions(+), 30 deletions(-)

diff --git a/builtin/tag.c b/builtin/tag.c
index 246a2bc..4bed7c2 100644
--- a/builtin/tag.c
+++ b/builtin/tag.c
@@ -118,12 +118,12 @@ static int for_each_tag_name(const char **argv, each_tag_name_fn fn)
 	for (p = argv; *p; p++) {
 		if (snprintf(ref, sizeof(ref), "refs/tags/%s", *p)
 					>= sizeof(ref)) {
-			error("tag name too long: %.*s...", 50, *p);
+			error(_("tag name too long: %.*s..."), 50, *p);
 			had_error = 1;
 			continue;
 		}
 		if (!resolve_ref(ref, sha1, 1, NULL)) {
-			error("tag '%s' not found.", *p);
+			error(_("tag '%s' not found."), *p);
 			had_error = 1;
 			continue;
 		}
@@ -138,7 +138,7 @@ static int delete_tag(const char *name, const char *ref,
 {
 	if (delete_ref(ref, sha1, 0))
 		return 1;
-	printf("Deleted tag '%s' (was %s)\n", name, find_unique_abbrev(sha1, DEFAULT_ABBREV));
+	printf(_("Deleted tag '%s' (was %s)\n"), name, find_unique_abbrev(sha1, DEFAULT_ABBREV));
 	return 0;
 }
 
@@ -150,7 +150,7 @@ static int verify_tag(const char *name, const char *ref,
 	argv_verify_tag[2] = sha1_to_hex(sha1);
 
 	if (run_command_v_opt(argv_verify_tag, RUN_GIT_CMD))
-		return error("could not verify the tag '%s'", name);
+		return error(_("could not verify the tag '%s'"), name);
 	return 0;
 }
 
@@ -165,7 +165,7 @@ static int do_sign(struct strbuf *buffer)
 	if (!*signingkey) {
 		if (strlcpy(signingkey, git_committer_info(IDENT_ERROR_ON_NO_NAME),
 				sizeof(signingkey)) > sizeof(signingkey) - 1)
-			return error("committer info too long.");
+			return error(_("committer info too long."));
 		bracket = strchr(signingkey, '>');
 		if (bracket)
 			bracket[1] = '\0';
@@ -185,20 +185,20 @@ static int do_sign(struct strbuf *buffer)
 	args[3] = NULL;
 
 	if (start_command(&gpg))
-		return error("could not run gpg.");
+		return error(_("could not run gpg."));
 
 	if (write_in_full(gpg.in, buffer->buf, buffer->len) != buffer->len) {
 		close(gpg.in);
 		close(gpg.out);
 		finish_command(&gpg);
-		return error("gpg did not accept the tag data");
+		return error(_("gpg did not accept the tag data"));
 	}
 	close(gpg.in);
 	len = strbuf_read(buffer, gpg.out, 1024);
 	close(gpg.out);
 
 	if (finish_command(&gpg) || !len || len < 0)
-		return error("gpg failed to sign the tag");
+		return error(_("gpg failed to sign the tag"));
 
 	/* Strip CR from the line endings, in case we are on Windows. */
 	for (i = j = 0; i < buffer->len; i++)
@@ -221,7 +221,7 @@ static const char tag_template[] =
 static void set_signingkey(const char *value)
 {
 	if (strlcpy(signingkey, value, sizeof(signingkey)) >= sizeof(signingkey))
-		die("signing key value too long (%.10s...)", value);
+		die(_("signing key value too long (%.10s...)"), value);
 }
 
 static int git_tag_config(const char *var, const char *value, void *cb)
@@ -261,9 +261,9 @@ static void write_tag_body(int fd, const unsigned char *sha1)
 static int build_tag_object(struct strbuf *buf, int sign, unsigned char *result)
 {
 	if (sign && do_sign(buf) < 0)
-		return error("unable to sign the tag");
+		return error(_("unable to sign the tag"));
 	if (write_sha1_file(buf->buf, buf->len, tag_type, result) < 0)
-		return error("unable to write tag file");
+		return error(_("unable to write tag file"));
 	return 0;
 }
 
@@ -278,7 +278,7 @@ static void create_tag(const unsigned char *object, const char *tag,
 
 	type = sha1_object_info(object, NULL);
 	if (type <= OBJ_NONE)
-	    die("bad object type.");
+	    die(_("bad object type."));
 
 	header_len = snprintf(header_buf, sizeof(header_buf),
 			  "object %s\n"
@@ -291,7 +291,7 @@ static void create_tag(const unsigned char *object, const char *tag,
 			  git_committer_info(IDENT_ERROR_ON_NO_NAME));
 
 	if (header_len > sizeof(header_buf) - 1)
-		die("tag header too big.");
+		die(_("tag header too big."));
 
 	if (!message) {
 		int fd;
@@ -300,7 +300,7 @@ static void create_tag(const unsigned char *object, const char *tag,
 		path = git_pathdup("TAG_EDITMSG");
 		fd = open(path, O_CREAT | O_TRUNC | O_WRONLY, 0600);
 		if (fd < 0)
-			die_errno("could not create file '%s'", path);
+			die_errno(_("could not create file '%s'"), path);
 
 		if (!is_null_sha1(prev))
 			write_tag_body(fd, prev);
@@ -310,7 +310,7 @@ static void create_tag(const unsigned char *object, const char *tag,
 
 		if (launch_editor(path, buf, NULL)) {
 			fprintf(stderr,
-			"Please supply the message using either -m or -F option.\n");
+			_("Please supply the message using either -m or -F option.\n"));
 			exit(1);
 		}
 	}
@@ -318,13 +318,13 @@ static void create_tag(const unsigned char *object, const char *tag,
 	stripspace(buf, 1);
 
 	if (!message && !buf->len)
-		die("no tag message?");
+		die(_("no tag message?"));
 
 	strbuf_insert(buf, 0, header_buf, header_len);
 
 	if (build_tag_object(buf, sign, result) < 0) {
 		if (path)
-			fprintf(stderr, "The tag message has been left in %s\n",
+			fprintf(stderr, _("The tag message has been left in %s\n"),
 				path);
 		exit(128);
 	}
@@ -417,9 +417,9 @@ int cmd_tag(int argc, const char **argv, const char *prefix)
 		return list_tags(argv[0], lines == -1 ? 0 : lines,
 				 with_commit);
 	if (lines != -1)
-		die("-n option is only allowed with -l.");
+		die(_("-n option is only allowed with -l."));
 	if (with_commit)
-		die("--contains option is only allowed with -l.");
+		die(_("--contains option is only allowed with -l."));
 	if (delete)
 		return for_each_tag_name(argv, delete_tag);
 	if (verify)
@@ -427,17 +427,17 @@ int cmd_tag(int argc, const char **argv, const char *prefix)
 
 	if (msg.given || msgfile) {
 		if (msg.given && msgfile)
-			die("only one -F or -m option is allowed.");
+			die(_("only one -F or -m option is allowed."));
 		annotate = 1;
 		if (msg.given)
 			strbuf_addbuf(&buf, &(msg.buf));
 		else {
 			if (!strcmp(msgfile, "-")) {
 				if (strbuf_read(&buf, 0, 1024) < 0)
-					die_errno("cannot read '%s'", msgfile);
+					die_errno(_("cannot read '%s'"), msgfile);
 			} else {
 				if (strbuf_read_file(&buf, msgfile, 1024) < 0)
-					die_errno("could not open or read '%s'",
+					die_errno(_("could not open or read '%s'"),
 						msgfile);
 			}
 		}
@@ -447,20 +447,20 @@ int cmd_tag(int argc, const char **argv, const char *prefix)
 
 	object_ref = argc == 2 ? argv[1] : "HEAD";
 	if (argc > 2)
-		die("too many params");
+		die(_("too many params"));
 
 	if (get_sha1(object_ref, object))
-		die("Failed to resolve '%s' as a valid ref.", object_ref);
+		die(_("Failed to resolve '%s' as a valid ref."), object_ref);
 
 	if (snprintf(ref, sizeof(ref), "refs/tags/%s", tag) > sizeof(ref) - 1)
-		die("tag name too long: %.*s...", 50, tag);
+		die(_("tag name too long: %.*s..."), 50, tag);
 	if (check_ref_format(ref))
-		die("'%s' is not a valid tag name.", tag);
+		die(_("'%s' is not a valid tag name."), tag);
 
 	if (!resolve_ref(ref, prev, 1, NULL))
 		hashclr(prev);
 	else if (!force)
-		die("tag '%s' already exists", tag);
+		die(_("tag '%s' already exists"), tag);
 
 	if (annotate)
 		create_tag(object, tag, &buf, msg.given || msgfile,
@@ -468,11 +468,11 @@ int cmd_tag(int argc, const char **argv, const char *prefix)
 
 	lock = lock_any_ref_for_update(ref, prev, 0);
 	if (!lock)
-		die("%s: cannot lock the ref", ref);
+		die(_("%s: cannot lock the ref"), ref);
 	if (write_ref_sha1(lock, object, NULL) < 0)
-		die("%s: cannot update the ref", ref);
+		die(_("%s: cannot update the ref"), ref);
 	if (force && hashcmp(prev, object))
-		printf("Updated tag '%s' (was %s)\n", tag, find_unique_abbrev(prev, DEFAULT_ABBREV));
+		printf(_("Updated tag '%s' (was %s)\n"), tag, find_unique_abbrev(prev, DEFAULT_ABBREV));
 
 	strbuf_release(&buf);
 	return 0;
-- 
1.7.2.3

^ permalink raw reply related	[flat|nested] 222+ messages in thread

* [PATCH v4 51/73] gettextize: git-tag tag_template message
  2011-02-22 18:11     ` Junio C Hamano
                         ` (50 preceding siblings ...)
  2011-02-22 23:42       ` [PATCH v4 50/73] gettextize: git-tag basic messages Ævar Arnfjörð Bjarmason
@ 2011-02-22 23:42       ` Ævar Arnfjörð Bjarmason
  2011-02-22 23:42       ` [PATCH v4 52/73] gettextize: git-push basic messages Ævar Arnfjörð Bjarmason
                         ` (21 subsequent siblings)
  73 siblings, 0 replies; 222+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2011-02-22 23:42 UTC (permalink / raw)
  To: git
  Cc: Junio C Hamano, Jakub Narebski, Ævar Arnfjörð Bjarmason

Mark the tag_template message as translatable with N_() and then use
it later with _(). We need to skip a test under GETTEXT_POISON that
relies on the output having a leading newline.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
---
 builtin/tag.c  |    6 +++---
 t/t7004-tag.sh |    1 +
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/builtin/tag.c b/builtin/tag.c
index 4bed7c2..4242e27 100644
--- a/builtin/tag.c
+++ b/builtin/tag.c
@@ -213,10 +213,10 @@ static int do_sign(struct strbuf *buffer)
 }
 
 static const char tag_template[] =
-	"\n"
+	N_("\n"
 	"#\n"
 	"# Write a tag message\n"
-	"#\n";
+	"#\n");
 
 static void set_signingkey(const char *value)
 {
@@ -305,7 +305,7 @@ static void create_tag(const unsigned char *object, const char *tag,
 		if (!is_null_sha1(prev))
 			write_tag_body(fd, prev);
 		else
-			write_or_die(fd, tag_template, strlen(tag_template));
+			write_or_die(fd, _(tag_template), strlen(_(tag_template)));
 		close(fd);
 
 		if (launch_editor(path, buf, NULL)) {
diff --git a/t/t7004-tag.sh b/t/t7004-tag.sh
index 3e7baaf..1dedfd0 100755
--- a/t/t7004-tag.sh
+++ b/t/t7004-tag.sh
@@ -1121,6 +1121,7 @@ test_expect_success \
 '
 
 test_expect_success \
+	C_LOCALE_OUTPUT \
 	'message in editor has initial comment: first line' '
 	# check the first line --- should be empty
 	echo >first.expect &&
-- 
1.7.2.3

^ permalink raw reply related	[flat|nested] 222+ messages in thread

* [PATCH v4 52/73] gettextize: git-push basic messages
  2011-02-22 18:11     ` Junio C Hamano
                         ` (51 preceding siblings ...)
  2011-02-22 23:42       ` [PATCH v4 51/73] gettextize: git-tag tag_template message Ævar Arnfjörð Bjarmason
@ 2011-02-22 23:42       ` Ævar Arnfjörð Bjarmason
  2011-02-22 23:42       ` [PATCH v4 53/73] gettextize: git-push "prevent you from losing" message Ævar Arnfjörð Bjarmason
                         ` (20 subsequent siblings)
  73 siblings, 0 replies; 222+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2011-02-22 23:42 UTC (permalink / raw)
  To: git
  Cc: Junio C Hamano, Jakub Narebski, Ævar Arnfjörð Bjarmason

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
---
 builtin/push.c |   38 +++++++++++++++++++-------------------
 1 files changed, 19 insertions(+), 19 deletions(-)

diff --git a/builtin/push.c b/builtin/push.c
index e655eb7..513bc57 100644
--- a/builtin/push.c
+++ b/builtin/push.c
@@ -40,7 +40,7 @@ static void set_refspecs(const char **refs, int nr)
 			char *tag;
 			int len;
 			if (nr <= ++i)
-				die("tag shorthand without <tag>");
+				die(_("tag shorthand without <tag>"));
 			len = strlen(refs[i]) + 11;
 			if (deleterefs) {
 				tag = xmalloc(len+1);
@@ -59,7 +59,7 @@ static void set_refspecs(const char **refs, int nr)
 			strcat(delref, ref);
 			ref = delref;
 		} else if (deleterefs)
-			die("--delete only accepts plain target ref names");
+			die(_("--delete only accepts plain target ref names"));
 		add_refspec(ref);
 	}
 }
@@ -69,13 +69,13 @@ static void setup_push_tracking(void)
 	struct strbuf refspec = STRBUF_INIT;
 	struct branch *branch = branch_get(NULL);
 	if (!branch)
-		die("You are not currently on a branch.");
+		die(_("You are not currently on a branch."));
 	if (!branch->merge_nr || !branch->merge)
-		die("The current branch %s is not tracking anything.",
+		die(_("The current branch %s is not tracking anything."),
 		    branch->name);
 	if (branch->merge_nr != 1)
-		die("The current branch %s is tracking multiple branches, "
-		    "refusing to push.", branch->name);
+		die(_("The current branch %s is tracking multiple branches, "
+		    "refusing to push."), branch->name);
 	strbuf_addf(&refspec, "%s:%s", branch->name, branch->merge[0]->src);
 	add_refspec(refspec.buf);
 }
@@ -97,8 +97,8 @@ static void setup_default_push_refspecs(void)
 		break;
 
 	case PUSH_DEFAULT_NOTHING:
-		die("You didn't specify any refspecs to push, and "
-		    "push.default is \"nothing\".");
+		die(_("You didn't specify any refspecs to push, and "
+		    "push.default is \"nothing\"."));
 		break;
 	}
 }
@@ -117,11 +117,11 @@ static int push_with_options(struct transport *transport, int flags)
 		transport_set_option(transport, TRANS_OPT_THIN, "yes");
 
 	if (verbosity > 0)
-		fprintf(stderr, "Pushing to %s\n", transport->url);
+		fprintf(stderr, _("Pushing to %s\n"), transport->url);
 	err = transport_push(transport, refspec_nr, refspec, flags,
 			     &nonfastforward);
 	if (err != 0)
-		error("failed to push some refs to '%s'", transport->url);
+		error(_("failed to push some refs to '%s'"), transport->url);
 
 	err |= transport_disconnect(transport);
 
@@ -146,8 +146,8 @@ static int do_push(const char *repo, int flags)
 
 	if (!remote) {
 		if (repo)
-			die("bad repository '%s'", repo);
-		die("No destination configured to push to.");
+			die(_("bad repository '%s'"), repo);
+		die(_("No destination configured to push to."));
 	}
 
 	if (remote->mirror)
@@ -155,19 +155,19 @@ static int do_push(const char *repo, int flags)
 
 	if ((flags & TRANSPORT_PUSH_ALL) && refspec) {
 		if (!strcmp(*refspec, "refs/tags/*"))
-			return error("--all and --tags are incompatible");
-		return error("--all can't be combined with refspecs");
+			return error(_("--all and --tags are incompatible"));
+		return error(_("--all can't be combined with refspecs"));
 	}
 
 	if ((flags & TRANSPORT_PUSH_MIRROR) && refspec) {
 		if (!strcmp(*refspec, "refs/tags/*"))
-			return error("--mirror and --tags are incompatible");
-		return error("--mirror can't be combined with refspecs");
+			return error(_("--mirror and --tags are incompatible"));
+		return error(_("--mirror can't be combined with refspecs"));
 	}
 
 	if ((flags & (TRANSPORT_PUSH_ALL|TRANSPORT_PUSH_MIRROR)) ==
 				(TRANSPORT_PUSH_ALL|TRANSPORT_PUSH_MIRROR)) {
-		return error("--all and --mirror are incompatible");
+		return error(_("--all and --mirror are incompatible"));
 	}
 
 	if (!refspec && !(flags & TRANSPORT_PUSH_ALL)) {
@@ -232,9 +232,9 @@ int cmd_push(int argc, const char **argv, const char *prefix)
 	argc = parse_options(argc, argv, prefix, options, push_usage, 0);
 
 	if (deleterefs && (tags || (flags & (TRANSPORT_PUSH_ALL | TRANSPORT_PUSH_MIRROR))))
-		die("--delete is incompatible with --all, --mirror and --tags");
+		die(_("--delete is incompatible with --all, --mirror and --tags"));
 	if (deleterefs && argc < 2)
-		die("--delete doesn't make sense without any refs");
+		die(_("--delete doesn't make sense without any refs"));
 
 	if (tags)
 		add_refspec("refs/tags/*");
-- 
1.7.2.3

^ permalink raw reply related	[flat|nested] 222+ messages in thread

* [PATCH v4 53/73] gettextize: git-push "prevent you from losing" message
  2011-02-22 18:11     ` Junio C Hamano
                         ` (52 preceding siblings ...)
  2011-02-22 23:42       ` [PATCH v4 52/73] gettextize: git-push basic messages Ævar Arnfjörð Bjarmason
@ 2011-02-22 23:42       ` Ævar Arnfjörð Bjarmason
  2011-02-22 23:42       ` [PATCH v4 54/73] gettextize: git-status basic messages Ævar Arnfjörð Bjarmason
                         ` (19 subsequent siblings)
  73 siblings, 0 replies; 222+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2011-02-22 23:42 UTC (permalink / raw)
  To: git
  Cc: Junio C Hamano, Jakub Narebski, Ævar Arnfjörð Bjarmason

Gettextize the "To prevent you from losing history" message. A test in
lib-httpd.sh and another in t5541-http-push.sh explicitly checked for
this message. Change them to skip under GETTEXT_POISON=YesPlease.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
---
 builtin/push.c       |    4 ++--
 t/lib-httpd.sh       |    2 +-
 t/t5541-http-push.sh |    7 +++++--
 3 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/builtin/push.c b/builtin/push.c
index 513bc57..8c8d8c7 100644
--- a/builtin/push.c
+++ b/builtin/push.c
@@ -129,9 +129,9 @@ static int push_with_options(struct transport *transport, int flags)
 		return 0;
 
 	if (nonfastforward && advice_push_nonfastforward) {
-		fprintf(stderr, "To prevent you from losing history, non-fast-forward updates were rejected\n"
+		fprintf(stderr, _("To prevent you from losing history, non-fast-forward updates were rejected\n"
 				"Merge the remote changes (e.g. 'git pull') before pushing again.  See the\n"
-				"'Note about fast-forwards' section of 'git push --help' for details.\n");
+				"'Note about fast-forwards' section of 'git push --help' for details.\n"));
 	}
 
 	return 1;
diff --git a/t/lib-httpd.sh b/t/lib-httpd.sh
index 3f24384..d3829b8 100644
--- a/t/lib-httpd.sh
+++ b/t/lib-httpd.sh
@@ -157,7 +157,7 @@ test_http_push_nonff() {
 		grep "^ ! \[rejected\][ ]*$BRANCH -> $BRANCH (non-fast-forward)$" output
 	'
 
-	test_expect_success 'non-fast-forward push shows help message' '
+	test_expect_success C_LOCALE_OUTPUT 'non-fast-forward push shows help message' '
 		grep "To prevent you from losing history, non-fast-forward updates were rejected" \
 			output
 	'
diff --git a/t/t5541-http-push.sh b/t/t5541-http-push.sh
index b0c2a2c..0492877 100755
--- a/t/t5541-http-push.sh
+++ b/t/t5541-http-push.sh
@@ -128,11 +128,14 @@ test_expect_success 'push fails for non-fast-forward refs unmatched by remote he
 
 	# push master too; this ensures there is at least one '"'push'"' command to
 	# the remote helper and triggers interaction with the helper.
-	test_must_fail git push -v origin +master master:retsam >output 2>&1 &&
+	test_must_fail git push -v origin +master master:retsam >output 2>&1'
 
+test_expect_success 'push fails for non-fast-forward refs unmatched by remote helper: remote output' '
 	grep "^ + [a-f0-9]*\.\.\.[a-f0-9]* *master -> master (forced update)$" output &&
-	grep "^ ! \[rejected\] *master -> retsam (non-fast-forward)$" output &&
+	grep "^ ! \[rejected\] *master -> retsam (non-fast-forward)$" output
+'
 
+test_expect_success C_LOCALE_OUTPUT 'push fails for non-fast-forward refs unmatched by remote helper: our output' '
 	grep "To prevent you from losing history, non-fast-forward updates were rejected" \
 		output
 '
-- 
1.7.2.3

^ permalink raw reply related	[flat|nested] 222+ messages in thread

* [PATCH v4 54/73] gettextize: git-status basic messages
  2011-02-22 18:11     ` Junio C Hamano
                         ` (53 preceding siblings ...)
  2011-02-22 23:42       ` [PATCH v4 53/73] gettextize: git-push "prevent you from losing" message Ævar Arnfjörð Bjarmason
@ 2011-02-22 23:42       ` Ævar Arnfjörð Bjarmason
  2011-02-22 23:42       ` [PATCH v4 55/73] gettextize: git-status "nothing to commit" messages Ævar Arnfjörð Bjarmason
                         ` (18 subsequent siblings)
  73 siblings, 0 replies; 222+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2011-02-22 23:42 UTC (permalink / raw)
  To: git
  Cc: Junio C Hamano, Jakub Narebski, Ævar Arnfjörð Bjarmason

Gettextize the most common git-status messages. Many tests checked for
these explicitly. Change them to skip under GETTEXT_POISON=YesPlease.

Some of the tests in t7508-status.sh needed to be split up when I
added C_LOCALE_OUTPUT to them, since parts of them affected later
tests (some of which aren't being skipped) indirectly.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
---
 t/t7060-wtstatus.sh         |    2 +-
 t/t7506-status-submodule.sh |   20 ++++----
 t/t7508-status.sh           |  115 ++++++++++++++++++++++++-------------------
 wt-status.c                 |   86 ++++++++++++++++----------------
 4 files changed, 119 insertions(+), 104 deletions(-)

diff --git a/t/t7060-wtstatus.sh b/t/t7060-wtstatus.sh
index fcac472..b4fcc86 100755
--- a/t/t7060-wtstatus.sh
+++ b/t/t7060-wtstatus.sh
@@ -38,7 +38,7 @@ cat >expect <<EOF
 no changes added to commit (use "git add" and/or "git commit -a")
 EOF
 
-test_expect_success 'M/D conflict does not segfault' '
+test_expect_success C_LOCALE_OUTPUT 'M/D conflict does not segfault' '
 	mkdir mdconflict &&
 	(
 		cd mdconflict &&
diff --git a/t/t7506-status-submodule.sh b/t/t7506-status-submodule.sh
index 3d4f85d..fa473a0 100755
--- a/t/t7506-status-submodule.sh
+++ b/t/t7506-status-submodule.sh
@@ -30,7 +30,7 @@ test_expect_success 'commit --dry-run -a clean' '
 	grep "nothing to commit" output
 '
 
-test_expect_success 'status with modified file in submodule' '
+test_expect_success C_LOCALE_OUTPUT 'status with modified file in submodule' '
 	(cd sub && git reset --hard) &&
 	echo "changed" >sub/foo &&
 	git status >output &&
@@ -46,7 +46,7 @@ test_expect_success 'status with modified file in submodule (porcelain)' '
 	EOF
 '
 
-test_expect_success 'status with added file in submodule' '
+test_expect_success C_LOCALE_OUTPUT 'status with added file in submodule' '
 	(cd sub && git reset --hard && echo >foo && git add foo) &&
 	git status >output &&
 	grep "modified:   sub (modified content)" output
@@ -60,14 +60,14 @@ test_expect_success 'status with added file in submodule (porcelain)' '
 	EOF
 '
 
-test_expect_success 'status with untracked file in submodule' '
+test_expect_success C_LOCALE_OUTPUT 'status with untracked file in submodule' '
 	(cd sub && git reset --hard) &&
 	echo "content" >sub/new-file &&
 	git status >output &&
 	grep "modified:   sub (untracked content)" output
 '
 
-test_expect_success 'status -uno with untracked file in submodule' '
+test_expect_success C_LOCALE_OUTPUT 'status -uno with untracked file in submodule' '
 	git status -uno >output &&
 	grep "^nothing to commit" output
 '
@@ -79,7 +79,7 @@ test_expect_success 'status with untracked file in submodule (porcelain)' '
 	EOF
 '
 
-test_expect_success 'status with added and untracked file in submodule' '
+test_expect_success C_LOCALE_OUTPUT 'status with added and untracked file in submodule' '
 	(cd sub && git reset --hard && echo >foo && git add foo) &&
 	echo "content" >sub/new-file &&
 	git status >output &&
@@ -95,7 +95,7 @@ test_expect_success 'status with added and untracked file in submodule (porcelai
 	EOF
 '
 
-test_expect_success 'status with modified file in modified submodule' '
+test_expect_success C_LOCALE_OUTPUT 'status with modified file in modified submodule' '
 	(cd sub && git reset --hard) &&
 	rm sub/new-file &&
 	(cd sub && echo "next change" >foo && git commit -m "next change" foo) &&
@@ -113,7 +113,7 @@ test_expect_success 'status with modified file in modified submodule (porcelain)
 	EOF
 '
 
-test_expect_success 'status with added file in modified submodule' '
+test_expect_success C_LOCALE_OUTPUT 'status with added file in modified submodule' '
 	(cd sub && git reset --hard && echo >foo && git add foo) &&
 	git status >output &&
 	grep "modified:   sub (new commits, modified content)" output
@@ -127,7 +127,7 @@ test_expect_success 'status with added file in modified submodule (porcelain)' '
 	EOF
 '
 
-test_expect_success 'status with untracked file in modified submodule' '
+test_expect_success C_LOCALE_OUTPUT 'status with untracked file in modified submodule' '
 	(cd sub && git reset --hard) &&
 	echo "content" >sub/new-file &&
 	git status >output &&
@@ -141,7 +141,7 @@ test_expect_success 'status with untracked file in modified submodule (porcelain
 	EOF
 '
 
-test_expect_success 'status with added and untracked file in modified submodule' '
+test_expect_success C_LOCALE_OUTPUT 'status with added and untracked file in modified submodule' '
 	(cd sub && git reset --hard && echo >foo && git add foo) &&
 	echo "content" >sub/new-file &&
 	git status >output &&
@@ -167,7 +167,7 @@ test_expect_success 'setup .git file for sub' '
 	 git commit -m "added .real to .gitignore" .gitignore
 '
 
-test_expect_success 'status with added file in modified submodule with .git file' '
+test_expect_success C_LOCALE_OUTPUT 'status with added file in modified submodule with .git file' '
 	(cd sub && git reset --hard && echo >foo && git add foo) &&
 	git status >output &&
 	grep "modified:   sub (new commits, modified content)" output
diff --git a/t/t7508-status.sh b/t/t7508-status.sh
index f1dc5c3..a93e70f 100755
--- a/t/t7508-status.sh
+++ b/t/t7508-status.sh
@@ -55,7 +55,7 @@ test_expect_success 'setup' '
 	git add dir2/added
 '
 
-test_expect_success 'status (1)' '
+test_expect_success C_LOCALE_OUTPUT 'status (1)' '
 
 	grep "use \"git rm --cached <file>\.\.\.\" to unstage" output
 
@@ -85,7 +85,7 @@ cat >expect <<\EOF
 #	untracked
 EOF
 
-test_expect_success 'status (2)' '
+test_expect_success C_LOCALE_OUTPUT 'status (2)' '
 
 	git status >output &&
 	test_cmp expect output
@@ -111,7 +111,7 @@ EOF
 
 git config advice.statusHints false
 
-test_expect_success 'status (advice.statusHints false)' '
+test_expect_success C_LOCALE_OUTPUT 'status (advice.statusHints false)' '
 
 	git status >output &&
 	test_cmp expect output
@@ -157,6 +157,12 @@ test_expect_success 'status -s -b' '
 
 '
 
+test_expect_success 'setup dir3' '
+	mkdir dir3 &&
+	: >dir3/untracked1 &&
+	: >dir3/untracked2
+'
+
 cat >expect <<EOF
 # On branch master
 # Changes to be committed:
@@ -172,16 +178,14 @@ cat >expect <<EOF
 #
 # Untracked files not listed (use -u option to show untracked files)
 EOF
-test_expect_success 'status -uno' '
-	mkdir dir3 &&
-	: >dir3/untracked1 &&
-	: >dir3/untracked2 &&
+test_expect_success C_LOCALE_OUTPUT 'status -uno' '
 	git status -uno >output &&
 	test_cmp expect output
 '
 
-test_expect_success 'status (status.showUntrackedFiles no)' '
+test_expect_success C_LOCALE_OUTPUT 'status (status.showUntrackedFiles no)' '
 	git config status.showuntrackedfiles no
+	test_when_finished "git config --unset status.showuntrackedfiles" &&
 	git status >output &&
 	test_cmp expect output
 '
@@ -197,7 +201,7 @@ cat >expect <<EOF
 # Untracked files not listed
 EOF
 git config advice.statusHints false
-test_expect_success 'status -uno (advice.statusHints false)' '
+test_expect_success C_LOCALE_OUTPUT 'status -uno (advice.statusHints false)' '
 	git status -uno >output &&
 	test_cmp expect output
 '
@@ -208,7 +212,6 @@ cat >expect << EOF
 A  dir2/added
 EOF
 test_expect_success 'status -s -uno' '
-	git config --unset status.showuntrackedfiles
 	git status -s -uno >output &&
 	test_cmp expect output
 '
@@ -243,13 +246,14 @@ cat >expect <<EOF
 #	output
 #	untracked
 EOF
-test_expect_success 'status -unormal' '
+test_expect_success C_LOCALE_OUTPUT 'status -unormal' '
 	git status -unormal >output &&
 	test_cmp expect output
 '
 
-test_expect_success 'status (status.showUntrackedFiles normal)' '
+test_expect_success C_LOCALE_OUTPUT 'status (status.showUntrackedFiles normal)' '
 	git config status.showuntrackedfiles normal
+	test_when_finished "git config --unset status.showuntrackedfiles" &&
 	git status >output &&
 	test_cmp expect output
 '
@@ -266,7 +270,6 @@ A  dir2/added
 ?? untracked
 EOF
 test_expect_success 'status -s -unormal' '
-	git config --unset status.showuntrackedfiles
 	git status -s -unormal >output &&
 	test_cmp expect output
 '
@@ -302,18 +305,21 @@ cat >expect <<EOF
 #	output
 #	untracked
 EOF
-test_expect_success 'status -uall' '
+test_expect_success C_LOCALE_OUTPUT 'status -uall' '
 	git status -uall >output &&
 	test_cmp expect output
 '
-test_expect_success 'status (status.showUntrackedFiles all)' '
+test_expect_success C_LOCALE_OUTPUT 'status (status.showUntrackedFiles all)' '
 	git config status.showuntrackedfiles all
+	test_when_finished "git config --unset status.showuntrackedfiles" &&
 	git status >output &&
-	rm -rf dir3 &&
-	git config --unset status.showuntrackedfiles &&
 	test_cmp expect output
 '
 
+test_expect_success 'teardown dir3' '
+	rm -rf dir3
+'
+
 cat >expect <<EOF
  M dir1/modified
 A  dir2/added
@@ -361,7 +367,7 @@ cat >expect <<\EOF
 #	../untracked
 EOF
 
-test_expect_success 'status with relative paths' '
+test_expect_success C_LOCALE_OUTPUT 'status with relative paths' '
 
 	(cd dir1 && git status) >output &&
 	test_cmp expect output
@@ -434,18 +440,19 @@ cat >expect <<\EOF
 #	<BLUE>untracked<RESET>
 EOF
 
-test_expect_success 'status with color.ui' '
+test_expect_success C_LOCALE_OUTPUT 'status with color.ui' '
 
 	git config color.ui always &&
+	test_when_finished "git config --unset color.ui" &&
 	git status | test_decode_color >output &&
 	test_cmp expect output
 
 '
 
-test_expect_success 'status with color.status' '
+test_expect_success C_LOCALE_OUTPUT 'status with color.status' '
 
-	git config --unset color.ui &&
 	git config color.status always &&
+	test_when_finished "git config --unset color.status" &&
 	git status | test_decode_color >output &&
 	test_cmp expect output
 
@@ -464,7 +471,6 @@ EOF
 
 test_expect_success 'status -s with color.ui' '
 
-	git config --unset color.status &&
 	git config color.ui always &&
 	git status -s | test_decode_color >output &&
 	test_cmp expect output
@@ -564,9 +570,10 @@ cat >expect <<\EOF
 EOF
 
 
-test_expect_success 'status without relative paths' '
+test_expect_success C_LOCALE_OUTPUT 'status without relative paths' '
 
-	git config status.relativePaths false
+	git config status.relativePaths false &&
+	test_when_finished "git config --unset status.relativePaths" &&
 	(cd dir1 && git status) >output &&
 	test_cmp expect output
 
@@ -585,6 +592,8 @@ EOF
 
 test_expect_success 'status -s without relative paths' '
 
+	git config status.relativePaths false &&
+	test_when_finished "git config --unset status.relativePaths" &&
 	(cd dir1 && git status -s) >output &&
 	test_cmp expect output
 
@@ -607,7 +616,10 @@ cat <<EOF >expect
 #	untracked
 EOF
 test_expect_success 'dry-run of partial commit excluding new file in index' '
-	git commit --dry-run dir1/modified >output &&
+	git commit --dry-run dir1/modified >output
+'
+
+test_expect_success C_LOCALE_OUTPUT 'dry-run of partial commit excluding new file in index: output' '
 	test_cmp expect output
 '
 
@@ -655,13 +667,13 @@ cat >expect <<EOF
 #	output
 #	untracked
 EOF
-test_expect_success 'status submodule summary is disabled by default' '
+test_expect_success C_LOCALE_OUTPUT 'status submodule summary is disabled by default' '
 	git status >output &&
 	test_cmp expect output
 '
 
 # we expect the same as the previous test
-test_expect_success 'status --untracked-files=all does not show submodule' '
+test_expect_success C_LOCALE_OUTPUT 'status --untracked-files=all does not show submodule' '
 	git status --untracked-files=all >output &&
 	test_cmp expect output
 '
@@ -719,7 +731,7 @@ cat >expect <<EOF
 #	output
 #	untracked
 EOF
-test_expect_success 'status submodule summary' '
+test_expect_success C_LOCALE_OUTPUT 'status submodule summary' '
 	git config status.submodulesummary 10 &&
 	git status >output &&
 	test_cmp expect output
@@ -760,8 +772,11 @@ cat >expect <<EOF
 #	untracked
 no changes added to commit (use "git add" and/or "git commit -a")
 EOF
-test_expect_success 'status submodule summary (clean submodule)' '
-	git commit -m "commit submodule" &&
+test_expect_success 'status submodule summary (clean submodule): commit' '
+	git commit -m "commit submodule"
+'
+
+test_expect_success C_LOCALE_OUTPUT 'status submodule summary (clean submodule): output' '
 	git config status.submodulesummary 10 &&
 	test_must_fail git commit --dry-run >output &&
 	test_cmp expect output &&
@@ -812,7 +827,7 @@ cat >expect <<EOF
 #	output
 #	untracked
 EOF
-test_expect_success 'commit --dry-run submodule summary (--amend)' '
+test_expect_success C_LOCALE_OUTPUT 'commit --dry-run submodule summary (--amend)' '
 	git config status.submodulesummary 10 &&
 	git commit --dry-run --amend >output &&
 	test_cmp expect output
@@ -867,13 +882,13 @@ cat > expect << EOF
 #	untracked
 EOF
 
-test_expect_success '--ignore-submodules=untracked suppresses submodules with untracked content' '
+test_expect_success C_LOCALE_OUTPUT '--ignore-submodules=untracked suppresses submodules with untracked content' '
 	echo modified > sm/untracked &&
 	git status --ignore-submodules=untracked > output &&
 	test_cmp expect output
 '
 
-test_expect_success '.gitmodules ignore=untracked suppresses submodules with untracked content' '
+test_expect_success C_LOCALE_OUTPUT '.gitmodules ignore=untracked suppresses submodules with untracked content' '
 	git config diff.ignoreSubmodules dirty &&
 	git status >output &&
 	test_cmp expect output &&
@@ -885,7 +900,7 @@ test_expect_success '.gitmodules ignore=untracked suppresses submodules with unt
 	git config --unset diff.ignoreSubmodules
 '
 
-test_expect_success '.git/config ignore=untracked suppresses submodules with untracked content' '
+test_expect_success C_LOCALE_OUTPUT '.git/config ignore=untracked suppresses submodules with untracked content' '
 	git config --add -f .gitmodules submodule.subname.ignore none &&
 	git config --add -f .gitmodules submodule.subname.path sm &&
 	git config --add submodule.subname.ignore untracked &&
@@ -896,12 +911,12 @@ test_expect_success '.git/config ignore=untracked suppresses submodules with unt
 	git config --remove-section -f .gitmodules submodule.subname
 '
 
-test_expect_success '--ignore-submodules=dirty suppresses submodules with untracked content' '
+test_expect_success C_LOCALE_OUTPUT '--ignore-submodules=dirty suppresses submodules with untracked content' '
 	git status --ignore-submodules=dirty > output &&
 	test_cmp expect output
 '
 
-test_expect_success '.gitmodules ignore=dirty suppresses submodules with untracked content' '
+test_expect_success C_LOCALE_OUTPUT '.gitmodules ignore=dirty suppresses submodules with untracked content' '
 	git config diff.ignoreSubmodules dirty &&
 	git status >output &&
 	! test -s actual &&
@@ -913,7 +928,7 @@ test_expect_success '.gitmodules ignore=dirty suppresses submodules with untrack
 	git config --unset diff.ignoreSubmodules
 '
 
-test_expect_success '.git/config ignore=dirty suppresses submodules with untracked content' '
+test_expect_success C_LOCALE_OUTPUT '.git/config ignore=dirty suppresses submodules with untracked content' '
 	git config --add -f .gitmodules submodule.subname.ignore none &&
 	git config --add -f .gitmodules submodule.subname.path sm &&
 	git config --add submodule.subname.ignore dirty &&
@@ -924,13 +939,13 @@ test_expect_success '.git/config ignore=dirty suppresses submodules with untrack
 	git config -f .gitmodules  --remove-section submodule.subname
 '
 
-test_expect_success '--ignore-submodules=dirty suppresses submodules with modified content' '
+test_expect_success C_LOCALE_OUTPUT '--ignore-submodules=dirty suppresses submodules with modified content' '
 	echo modified > sm/foo &&
 	git status --ignore-submodules=dirty > output &&
 	test_cmp expect output
 '
 
-test_expect_success '.gitmodules ignore=dirty suppresses submodules with modified content' '
+test_expect_success C_LOCALE_OUTPUT '.gitmodules ignore=dirty suppresses submodules with modified content' '
 	git config --add -f .gitmodules submodule.subname.ignore dirty &&
 	git config --add -f .gitmodules submodule.subname.path sm &&
 	git status > output &&
@@ -938,7 +953,7 @@ test_expect_success '.gitmodules ignore=dirty suppresses submodules with modifie
 	git config -f .gitmodules  --remove-section submodule.subname
 '
 
-test_expect_success '.git/config ignore=dirty suppresses submodules with modified content' '
+test_expect_success C_LOCALE_OUTPUT '.git/config ignore=dirty suppresses submodules with modified content' '
 	git config --add -f .gitmodules submodule.subname.ignore none &&
 	git config --add -f .gitmodules submodule.subname.path sm &&
 	git config --add submodule.subname.ignore dirty &&
@@ -981,12 +996,12 @@ cat > expect << EOF
 #	untracked
 EOF
 
-test_expect_success "--ignore-submodules=untracked doesn't suppress submodules with modified content" '
+test_expect_success C_LOCALE_OUTPUT "--ignore-submodules=untracked doesn't suppress submodules with modified content" '
 	git status --ignore-submodules=untracked > output &&
 	test_cmp expect output
 '
 
-test_expect_success ".gitmodules ignore=untracked doesn't suppress submodules with modified content" '
+test_expect_success C_LOCALE_OUTPUT ".gitmodules ignore=untracked doesn't suppress submodules with modified content" '
 	git config --add -f .gitmodules submodule.subname.ignore untracked &&
 	git config --add -f .gitmodules submodule.subname.path sm &&
 	git status > output &&
@@ -994,7 +1009,7 @@ test_expect_success ".gitmodules ignore=untracked doesn't suppress submodules wi
 	git config -f .gitmodules  --remove-section submodule.subname
 '
 
-test_expect_success ".git/config ignore=untracked doesn't suppress submodules with modified content" '
+test_expect_success C_LOCALE_OUTPUT ".git/config ignore=untracked doesn't suppress submodules with modified content" '
 	git config --add -f .gitmodules submodule.subname.ignore none &&
 	git config --add -f .gitmodules submodule.subname.path sm &&
 	git config --add submodule.subname.ignore untracked &&
@@ -1043,12 +1058,12 @@ cat > expect << EOF
 #	untracked
 EOF
 
-test_expect_success "--ignore-submodules=untracked doesn't suppress submodule summary" '
+test_expect_success C_LOCALE_OUTPUT "--ignore-submodules=untracked doesn't suppress submodule summary" '
 	git status --ignore-submodules=untracked > output &&
 	test_cmp expect output
 '
 
-test_expect_success ".gitmodules ignore=untracked doesn't suppress submodule summary" '
+test_expect_success C_LOCALE_OUTPUT ".gitmodules ignore=untracked doesn't suppress submodule summary" '
 	git config --add -f .gitmodules submodule.subname.ignore untracked &&
 	git config --add -f .gitmodules submodule.subname.path sm &&
 	git status > output &&
@@ -1056,7 +1071,7 @@ test_expect_success ".gitmodules ignore=untracked doesn't suppress submodule sum
 	git config -f .gitmodules  --remove-section submodule.subname
 '
 
-test_expect_success ".git/config ignore=untracked doesn't suppress submodule summary" '
+test_expect_success C_LOCALE_OUTPUT ".git/config ignore=untracked doesn't suppress submodule summary" '
 	git config --add -f .gitmodules submodule.subname.ignore none &&
 	git config --add -f .gitmodules submodule.subname.path sm &&
 	git config --add submodule.subname.ignore untracked &&
@@ -1067,11 +1082,11 @@ test_expect_success ".git/config ignore=untracked doesn't suppress submodule sum
 	git config -f .gitmodules  --remove-section submodule.subname
 '
 
-test_expect_success "--ignore-submodules=dirty doesn't suppress submodule summary" '
+test_expect_success C_LOCALE_OUTPUT "--ignore-submodules=dirty doesn't suppress submodule summary" '
 	git status --ignore-submodules=dirty > output &&
 	test_cmp expect output
 '
-test_expect_success ".gitmodules ignore=dirty doesn't suppress submodule summary" '
+test_expect_success C_LOCALE_OUTPUT ".gitmodules ignore=dirty doesn't suppress submodule summary" '
 	git config --add -f .gitmodules submodule.subname.ignore dirty &&
 	git config --add -f .gitmodules submodule.subname.path sm &&
 	git status > output &&
@@ -1079,7 +1094,7 @@ test_expect_success ".gitmodules ignore=dirty doesn't suppress submodule summary
 	git config -f .gitmodules  --remove-section submodule.subname
 '
 
-test_expect_success ".git/config ignore=dirty doesn't suppress submodule summary" '
+test_expect_success C_LOCALE_OUTPUT ".git/config ignore=dirty doesn't suppress submodule summary" '
 	git config --add -f .gitmodules submodule.subname.ignore none &&
 	git config --add -f .gitmodules submodule.subname.path sm &&
 	git config --add submodule.subname.ignore dirty &&
@@ -1111,7 +1126,7 @@ cat > expect << EOF
 no changes added to commit (use "git add" and/or "git commit -a")
 EOF
 
-test_expect_success "--ignore-submodules=all suppresses submodule summary" '
+test_expect_success C_LOCALE_OUTPUT "--ignore-submodules=all suppresses submodule summary" '
 	git status --ignore-submodules=all > output &&
 	test_cmp expect output
 '
diff --git a/wt-status.c b/wt-status.c
index 123582b..f369eba 100644
--- a/wt-status.c
+++ b/wt-status.c
@@ -57,16 +57,16 @@ static void wt_status_print_unmerged_header(struct wt_status *s)
 {
 	const char *c = color(WT_STATUS_HEADER, s);
 
-	color_fprintf_ln(s->fp, c, "# Unmerged paths:");
+	color_fprintf_ln(s->fp, c, _("# Unmerged paths:"));
 	if (!advice_status_hints)
 		return;
 	if (s->in_merge)
 		;
 	else if (!s->is_initial)
-		color_fprintf_ln(s->fp, c, "#   (use \"git reset %s <file>...\" to unstage)", s->reference);
+		color_fprintf_ln(s->fp, c, _("#   (use \"git reset %s <file>...\" to unstage)"), s->reference);
 	else
-		color_fprintf_ln(s->fp, c, "#   (use \"git rm --cached <file>...\" to unstage)");
-	color_fprintf_ln(s->fp, c, "#   (use \"git add/rm <file>...\" as appropriate to mark resolution)");
+		color_fprintf_ln(s->fp, c, _("#   (use \"git rm --cached <file>...\" to unstage)"));
+	color_fprintf_ln(s->fp, c, _("#   (use \"git add/rm <file>...\" as appropriate to mark resolution)"));
 	color_fprintf_ln(s->fp, c, "#");
 }
 
@@ -80,9 +80,9 @@ static void wt_status_print_cached_header(struct wt_status *s)
 	if (s->in_merge)
 		; /* NEEDSWORK: use "git reset --unresolve"??? */
 	else if (!s->is_initial)
-		color_fprintf_ln(s->fp, c, "#   (use \"git reset %s <file>...\" to unstage)", s->reference);
+		color_fprintf_ln(s->fp, c, _("#   (use \"git reset %s <file>...\" to unstage)"), s->reference);
 	else
-		color_fprintf_ln(s->fp, c, "#   (use \"git rm --cached <file>...\" to unstage)");
+		color_fprintf_ln(s->fp, c, _("#   (use \"git rm --cached <file>...\" to unstage)"));
 	color_fprintf_ln(s->fp, c, "#");
 }
 
@@ -92,16 +92,16 @@ static void wt_status_print_dirty_header(struct wt_status *s,
 {
 	const char *c = color(WT_STATUS_HEADER, s);
 
-	color_fprintf_ln(s->fp, c, "# Changes not staged for commit:");
+	color_fprintf_ln(s->fp, c, _("# Changes not staged for commit:"));
 	if (!advice_status_hints)
 		return;
 	if (!has_deleted)
-		color_fprintf_ln(s->fp, c, "#   (use \"git add <file>...\" to update what will be committed)");
+		color_fprintf_ln(s->fp, c, _("#   (use \"git add <file>...\" to update what will be committed)"));
 	else
-		color_fprintf_ln(s->fp, c, "#   (use \"git add/rm <file>...\" to update what will be committed)");
-	color_fprintf_ln(s->fp, c, "#   (use \"git checkout -- <file>...\" to discard changes in working directory)");
+		color_fprintf_ln(s->fp, c, _("#   (use \"git add/rm <file>...\" to update what will be committed)"));
+	color_fprintf_ln(s->fp, c, _("#   (use \"git checkout -- <file>...\" to discard changes in working directory)"));
 	if (has_dirty_submodules)
-		color_fprintf_ln(s->fp, c, "#   (commit or discard the untracked or modified content in submodules)");
+		color_fprintf_ln(s->fp, c, _("#   (commit or discard the untracked or modified content in submodules)"));
 	color_fprintf_ln(s->fp, c, "#");
 }
 
@@ -110,10 +110,10 @@ static void wt_status_print_other_header(struct wt_status *s,
 					 const char *how)
 {
 	const char *c = color(WT_STATUS_HEADER, s);
-	color_fprintf_ln(s->fp, c, "# %s files:", what);
+	color_fprintf_ln(s->fp, c, _("# %s files:"), what);
 	if (!advice_status_hints)
 		return;
-	color_fprintf_ln(s->fp, c, "#   (use \"git %s <file>...\" to include in what will be committed)", how);
+	color_fprintf_ln(s->fp, c, _("#   (use \"git %s <file>...\" to include in what will be committed)"), how);
 	color_fprintf_ln(s->fp, c, "#");
 }
 
@@ -130,18 +130,18 @@ static void wt_status_print_unmerged_data(struct wt_status *s,
 	const char *c = color(WT_STATUS_UNMERGED, s);
 	struct wt_status_change_data *d = it->util;
 	struct strbuf onebuf = STRBUF_INIT;
-	const char *one, *how = "bug";
+	const char *one, *how = _("bug");
 
 	one = quote_path(it->string, -1, &onebuf, s->prefix);
 	color_fprintf(s->fp, color(WT_STATUS_HEADER, s), "#\t");
 	switch (d->stagemask) {
-	case 1: how = "both deleted:"; break;
-	case 2: how = "added by us:"; break;
-	case 3: how = "deleted by them:"; break;
-	case 4: how = "added by them:"; break;
-	case 5: how = "deleted by us:"; break;
-	case 6: how = "both added:"; break;
-	case 7: how = "both modified:"; break;
+	case 1: how = _("both deleted:"); break;
+	case 2: how = _("added by us:"); break;
+	case 3: how = _("deleted by them:"); break;
+	case 4: how = _("added by them:"); break;
+	case 5: how = _("deleted by us:"); break;
+	case 6: how = _("both added:"); break;
+	case 7: how = _("both modified:"); break;
 	}
 	color_fprintf(s->fp, c, "%-20s%s\n", how, one);
 	strbuf_release(&onebuf);
@@ -171,11 +171,11 @@ static void wt_status_print_change_data(struct wt_status *s,
 		if (d->new_submodule_commits || d->dirty_submodule) {
 			strbuf_addstr(&extra, " (");
 			if (d->new_submodule_commits)
-				strbuf_addf(&extra, "new commits, ");
+				strbuf_addf(&extra, _("new commits, "));
 			if (d->dirty_submodule & DIRTY_SUBMODULE_MODIFIED)
-				strbuf_addf(&extra, "modified content, ");
+				strbuf_addf(&extra, _("modified content, "));
 			if (d->dirty_submodule & DIRTY_SUBMODULE_UNTRACKED)
-				strbuf_addf(&extra, "untracked content, ");
+				strbuf_addf(&extra, _("untracked content, "));
 			strbuf_setlen(&extra, extra.len - 2);
 			strbuf_addch(&extra, ')');
 		}
@@ -189,31 +189,31 @@ static void wt_status_print_change_data(struct wt_status *s,
 	color_fprintf(s->fp, color(WT_STATUS_HEADER, s), "#\t");
 	switch (status) {
 	case DIFF_STATUS_ADDED:
-		color_fprintf(s->fp, c, "new file:   %s", one);
+		color_fprintf(s->fp, c, _("new file:   %s"), one);
 		break;
 	case DIFF_STATUS_COPIED:
-		color_fprintf(s->fp, c, "copied:     %s -> %s", one, two);
+		color_fprintf(s->fp, c, _("copied:     %s -> %s"), one, two);
 		break;
 	case DIFF_STATUS_DELETED:
-		color_fprintf(s->fp, c, "deleted:    %s", one);
+		color_fprintf(s->fp, c, _("deleted:    %s"), one);
 		break;
 	case DIFF_STATUS_MODIFIED:
-		color_fprintf(s->fp, c, "modified:   %s", one);
+		color_fprintf(s->fp, c, _("modified:   %s"), one);
 		break;
 	case DIFF_STATUS_RENAMED:
 		color_fprintf(s->fp, c, "renamed:    %s -> %s", one, two);
 		break;
 	case DIFF_STATUS_TYPE_CHANGED:
-		color_fprintf(s->fp, c, "typechange: %s", one);
+		color_fprintf(s->fp, c, _("typechange: %s"), one);
 		break;
 	case DIFF_STATUS_UNKNOWN:
-		color_fprintf(s->fp, c, "unknown:    %s", one);
+		color_fprintf(s->fp, c, _("unknown:    %s"), one);
 		break;
 	case DIFF_STATUS_UNMERGED:
-		color_fprintf(s->fp, c, "unmerged:   %s", one);
+		color_fprintf(s->fp, c, _("unmerged:   %s"), one);
 		break;
 	default:
-		die("bug: unhandled diff status %c", status);
+		die(_("bug: unhandled diff status %c"), status);
 	}
 	if (extra.len) {
 		color_fprintf(s->fp, color(WT_STATUS_HEADER, s), "%s", extra.buf);
@@ -633,14 +633,14 @@ void wt_status_print(struct wt_status *s)
 	const char *branch_status_color = color(WT_STATUS_HEADER, s);
 
 	if (s->branch) {
-		const char *on_what = "On branch ";
+		const char *on_what = _("On branch ");
 		const char *branch_name = s->branch;
 		if (!prefixcmp(branch_name, "refs/heads/"))
 			branch_name += 11;
 		else if (!strcmp(branch_name, "HEAD")) {
 			branch_name = "";
 			branch_status_color = color(WT_STATUS_NOBRANCH, s);
-			on_what = "Not currently on any branch.";
+			on_what = _("Not currently on any branch.");
 		}
 		color_fprintf(s->fp, color(WT_STATUS_HEADER, s), "# ");
 		color_fprintf(s->fp, branch_status_color, "%s", on_what);
@@ -665,29 +665,29 @@ void wt_status_print(struct wt_status *s)
 		wt_status_print_submodule_summary(s, 1);  /* unstaged */
 	}
 	if (s->show_untracked_files) {
-		wt_status_print_other(s, &s->untracked, "Untracked", "add");
+		wt_status_print_other(s, &s->untracked, _("Untracked"), "add");
 		if (s->show_ignored_files)
-			wt_status_print_other(s, &s->ignored, "Ignored", "add -f");
+			wt_status_print_other(s, &s->ignored, _("Ignored"), "add -f");
 	} else if (s->commitable)
-		fprintf(s->fp, "# Untracked files not listed%s\n",
+		fprintf(s->fp, _("# Untracked files not listed%s\n"),
 			advice_status_hints
-			? " (use -u option to show untracked files)" : "");
+			? _(" (use -u option to show untracked files)") : "");
 
 	if (s->verbose)
 		wt_status_print_verbose(s);
 	if (!s->commitable) {
 		if (s->amend)
-			fprintf(s->fp, "# No changes\n");
+			fprintf(s->fp, _("# No changes\n"));
 		else if (s->nowarn)
 			; /* nothing */
 		else if (s->workdir_dirty)
-			printf("no changes added to commit%s\n",
+			printf(_("no changes added to commit%s\n"),
 				advice_status_hints
-				? " (use \"git add\" and/or \"git commit -a\")" : "");
+				? _(" (use \"git add\" and/or \"git commit -a\")") : "");
 		else if (s->untracked.nr)
-			printf("nothing added to commit but untracked files present%s\n",
+			printf(_("nothing added to commit but untracked files present%s\n"),
 				advice_status_hints
-				? " (use \"git add\" to track)" : "");
+				? _(" (use \"git add\" to track)") : "");
 		else if (s->is_initial)
 			printf("nothing to commit%s\n", advice_status_hints
 				? " (create/copy files and use \"git add\" to track)" : "");
-- 
1.7.2.3

^ permalink raw reply related	[flat|nested] 222+ messages in thread

* [PATCH v4 55/73] gettextize: git-status "nothing to commit" messages
  2011-02-22 18:11     ` Junio C Hamano
                         ` (54 preceding siblings ...)
  2011-02-22 23:42       ` [PATCH v4 54/73] gettextize: git-status basic messages Ævar Arnfjörð Bjarmason
@ 2011-02-22 23:42       ` Ævar Arnfjörð Bjarmason
  2011-02-22 23:42       ` [PATCH v4 56/73] gettextize: git-status shortstatus messages Ævar Arnfjörð Bjarmason
                         ` (17 subsequent siblings)
  73 siblings, 0 replies; 222+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2011-02-22 23:42 UTC (permalink / raw)
  To: git
  Cc: Junio C Hamano, Jakub Narebski, Ævar Arnfjörð Bjarmason

Gettextize the "nothing to commit" messages. Many tests explicitly
checked for this message. Change them to skip under
GETTEXT_POISON=YesPlease.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
---
 t/t7506-status-submodule.sh |    8 ++++----
 wt-status.c                 |   12 ++++++------
 2 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/t/t7506-status-submodule.sh b/t/t7506-status-submodule.sh
index fa473a0..c567332 100755
--- a/t/t7506-status-submodule.sh
+++ b/t/t7506-status-submodule.sh
@@ -20,12 +20,12 @@ test_expect_success 'setup' '
 	git commit -m "Add submodule sub"
 '
 
-test_expect_success 'status clean' '
+test_expect_success C_LOCALE_OUTPUT 'status clean' '
 	git status >output &&
 	grep "nothing to commit" output
 '
 
-test_expect_success 'commit --dry-run -a clean' '
+test_expect_success C_LOCALE_OUTPUT 'commit --dry-run -a clean' '
 	test_must_fail git commit --dry-run -a >output &&
 	grep "nothing to commit" output
 '
@@ -177,12 +177,12 @@ test_expect_success 'rm submodule contents' '
 	rm -rf sub/* sub/.git
 '
 
-test_expect_success 'status clean (empty submodule dir)' '
+test_expect_success C_LOCALE_OUTPUT 'status clean (empty submodule dir)' '
 	git status >output &&
 	grep "nothing to commit" output
 '
 
-test_expect_success 'status -a clean (empty submodule dir)' '
+test_expect_success C_LOCALE_OUTPUT 'status -a clean (empty submodule dir)' '
 	test_must_fail git commit --dry-run -a >output &&
 	grep "nothing to commit" output
 '
diff --git a/wt-status.c b/wt-status.c
index f369eba..a975d07 100644
--- a/wt-status.c
+++ b/wt-status.c
@@ -689,14 +689,14 @@ void wt_status_print(struct wt_status *s)
 				advice_status_hints
 				? _(" (use \"git add\" to track)") : "");
 		else if (s->is_initial)
-			printf("nothing to commit%s\n", advice_status_hints
-				? " (create/copy files and use \"git add\" to track)" : "");
+			printf(_("nothing to commit%s\n"), advice_status_hints
+				? _(" (create/copy files and use \"git add\" to track)") : "");
 		else if (!s->show_untracked_files)
-			printf("nothing to commit%s\n", advice_status_hints
-				? " (use -u to show untracked files)" : "");
+			printf(_("nothing to commit%s\n"), advice_status_hints
+				? _(" (use -u to show untracked files)") : "");
 		else
-			printf("nothing to commit%s\n", advice_status_hints
-				? " (working directory clean)" : "");
+			printf(_("nothing to commit%s\n"), advice_status_hints
+				? _(" (working directory clean)") : "");
 	}
 }
 
-- 
1.7.2.3

^ permalink raw reply related	[flat|nested] 222+ messages in thread

* [PATCH v4 56/73] gettextize: git-status shortstatus messages
  2011-02-22 18:11     ` Junio C Hamano
                         ` (55 preceding siblings ...)
  2011-02-22 23:42       ` [PATCH v4 55/73] gettextize: git-status "nothing to commit" messages Ævar Arnfjörð Bjarmason
@ 2011-02-22 23:42       ` Ævar Arnfjörð Bjarmason
  2011-02-22 23:42       ` [PATCH v4 57/73] gettextize: git-status "Changes to be committed" message Ævar Arnfjörð Bjarmason
                         ` (16 subsequent siblings)
  73 siblings, 0 replies; 222+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2011-02-22 23:42 UTC (permalink / raw)
  To: git
  Cc: Junio C Hamano, Jakub Narebski, Ævar Arnfjörð Bjarmason

Make the messages added in v1.7.2-rc0~54^2~1 translatable. Some of
these could use the to be implemented plural support in the gettext
library.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
---
 wt-status.c |   12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/wt-status.c b/wt-status.c
index a975d07..fc38ac2 100644
--- a/wt-status.c
+++ b/wt-status.c
@@ -804,13 +804,13 @@ static void wt_shortstatus_print_tracking(struct wt_status *s)
 	if (!prefixcmp(branch_name, "refs/heads/"))
 		branch_name += 11;
 	else if (!strcmp(branch_name, "HEAD")) {
-		branch_name = "HEAD (no branch)";
+		branch_name = _("HEAD (no branch)");
 		branch_color_local = color(WT_STATUS_NOBRANCH, s);
 	}
 
 	branch = branch_get(s->branch + 11);
 	if (s->is_initial)
-		color_fprintf(s->fp, header_color, "Initial commit on ");
+		color_fprintf(s->fp, header_color, _("Initial commit on "));
 	if (!stat_tracking_info(branch, &num_ours, &num_theirs)) {
 		color_fprintf_ln(s->fp, branch_color_local,
 			"%s", branch_name);
@@ -825,15 +825,15 @@ static void wt_shortstatus_print_tracking(struct wt_status *s)
 
 	color_fprintf(s->fp, header_color, " [");
 	if (!num_ours) {
-		color_fprintf(s->fp, header_color, "behind ");
+		color_fprintf(s->fp, header_color, _("behind "));
 		color_fprintf(s->fp, branch_color_remote, "%d", num_theirs);
 	} else if (!num_theirs) {
-		color_fprintf(s->fp, header_color, "ahead ");
+		color_fprintf(s->fp, header_color, _("ahead "));
 		color_fprintf(s->fp, branch_color_local, "%d", num_ours);
 	} else {
-		color_fprintf(s->fp, header_color, "ahead ");
+		color_fprintf(s->fp, header_color, _("ahead "));
 		color_fprintf(s->fp, branch_color_local, "%d", num_ours);
-		color_fprintf(s->fp, header_color, ", behind ");
+		color_fprintf(s->fp, header_color, _(", behind "));
 		color_fprintf(s->fp, branch_color_remote, "%d", num_theirs);
 	}
 
-- 
1.7.2.3

^ permalink raw reply related	[flat|nested] 222+ messages in thread

* [PATCH v4 57/73] gettextize: git-status "Changes to be committed" message
  2011-02-22 18:11     ` Junio C Hamano
                         ` (56 preceding siblings ...)
  2011-02-22 23:42       ` [PATCH v4 56/73] gettextize: git-status shortstatus messages Ævar Arnfjörð Bjarmason
@ 2011-02-22 23:42       ` Ævar Arnfjörð Bjarmason
  2011-02-22 23:42       ` [PATCH v4 58/73] gettextize: git-status "Initial commit" message Ævar Arnfjörð Bjarmason
                         ` (15 subsequent siblings)
  73 siblings, 0 replies; 222+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2011-02-22 23:42 UTC (permalink / raw)
  To: git
  Cc: Junio C Hamano, Jakub Narebski, Ævar Arnfjörð Bjarmason

Gettextize the "# Changes to be committed:" messages. Several tests
explicitly checked for this message. Change them to skip under
GETTEXT_POISON=YesPlease.

Since these tests didn't check for the rest of the git-status(1)
output this change has been split up from the "git-status basic
messages" patch.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
---
 t/t7502-commit.sh |   20 ++++++++++----------
 wt-status.c       |    2 +-
 2 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/t/t7502-commit.sh b/t/t7502-commit.sh
index 1f29b5c..cfb569e 100755
--- a/t/t7502-commit.sh
+++ b/t/t7502-commit.sh
@@ -384,66 +384,66 @@ try_commit () {
 
 try_commit_status_combo () {
 
-	test_expect_success 'commit' '
+	test_expect_success C_LOCALE_OUTPUT 'commit' '
 		clear_config commit.status &&
 		try_commit "" &&
 		grep "^# Changes to be committed:" .git/COMMIT_EDITMSG
 	'
 
-	test_expect_success 'commit' '
+	test_expect_success C_LOCALE_OUTPUT 'commit' '
 		clear_config commit.status &&
 		try_commit "" &&
 		grep "^# Changes to be committed:" .git/COMMIT_EDITMSG
 	'
 
-	test_expect_success 'commit --status' '
+	test_expect_success C_LOCALE_OUTPUT 'commit --status' '
 		clear_config commit.status &&
 		try_commit --status &&
 		grep "^# Changes to be committed:" .git/COMMIT_EDITMSG
 	'
 
-	test_expect_success 'commit --no-status' '
+	test_expect_success C_LOCALE_OUTPUT 'commit --no-status' '
 		clear_config commit.status &&
 		try_commit --no-status &&
 		! grep "^# Changes to be committed:" .git/COMMIT_EDITMSG
 	'
 
-	test_expect_success 'commit with commit.status = yes' '
+	test_expect_success C_LOCALE_OUTPUT 'commit with commit.status = yes' '
 		clear_config commit.status &&
 		git config commit.status yes &&
 		try_commit "" &&
 		grep "^# Changes to be committed:" .git/COMMIT_EDITMSG
 	'
 
-	test_expect_success 'commit with commit.status = no' '
+	test_expect_success C_LOCALE_OUTPUT 'commit with commit.status = no' '
 		clear_config commit.status &&
 		git config commit.status no &&
 		try_commit "" &&
 		! grep "^# Changes to be committed:" .git/COMMIT_EDITMSG
 	'
 
-	test_expect_success 'commit --status with commit.status = yes' '
+	test_expect_success C_LOCALE_OUTPUT 'commit --status with commit.status = yes' '
 		clear_config commit.status &&
 		git config commit.status yes &&
 		try_commit --status &&
 		grep "^# Changes to be committed:" .git/COMMIT_EDITMSG
 	'
 
-	test_expect_success 'commit --no-status with commit.status = yes' '
+	test_expect_success C_LOCALE_OUTPUT 'commit --no-status with commit.status = yes' '
 		clear_config commit.status &&
 		git config commit.status yes &&
 		try_commit --no-status &&
 		! grep "^# Changes to be committed:" .git/COMMIT_EDITMSG
 	'
 
-	test_expect_success 'commit --status with commit.status = no' '
+	test_expect_success C_LOCALE_OUTPUT 'commit --status with commit.status = no' '
 		clear_config commit.status &&
 		git config commit.status no &&
 		try_commit --status &&
 		grep "^# Changes to be committed:" .git/COMMIT_EDITMSG
 	'
 
-	test_expect_success 'commit --no-status with commit.status = no' '
+	test_expect_success C_LOCALE_OUTPUT 'commit --no-status with commit.status = no' '
 		clear_config commit.status &&
 		git config commit.status no &&
 		try_commit --no-status &&
diff --git a/wt-status.c b/wt-status.c
index fc38ac2..c6295f9 100644
--- a/wt-status.c
+++ b/wt-status.c
@@ -74,7 +74,7 @@ static void wt_status_print_cached_header(struct wt_status *s)
 {
 	const char *c = color(WT_STATUS_HEADER, s);
 
-	color_fprintf_ln(s->fp, c, "# Changes to be committed:");
+	color_fprintf_ln(s->fp, c, _("# Changes to be committed:"));
 	if (!advice_status_hints)
 		return;
 	if (s->in_merge)
-- 
1.7.2.3

^ permalink raw reply related	[flat|nested] 222+ messages in thread

* [PATCH v4 58/73] gettextize: git-status "Initial commit" message
  2011-02-22 18:11     ` Junio C Hamano
                         ` (57 preceding siblings ...)
  2011-02-22 23:42       ` [PATCH v4 57/73] gettextize: git-status "Changes to be committed" message Ævar Arnfjörð Bjarmason
@ 2011-02-22 23:42       ` Ævar Arnfjörð Bjarmason
  2011-02-22 23:42       ` [PATCH v4 59/73] gettextize: git-status "renamed: " message Ævar Arnfjörð Bjarmason
                         ` (14 subsequent siblings)
  73 siblings, 0 replies; 222+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2011-02-22 23:42 UTC (permalink / raw)
  To: git
  Cc: Junio C Hamano, Jakub Narebski, Ævar Arnfjörð Bjarmason

Gettextize the "# Initial commit" message. A test in t7501-commit.sh
explicitly checked for this message. Change it to skip under
GETTEXT_POISON=YesPlease.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
---
 t/t7501-commit.sh |    7 +++++--
 wt-status.c       |    2 +-
 2 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/t/t7501-commit.sh b/t/t7501-commit.sh
index 8980738..a76c474 100755
--- a/t/t7501-commit.sh
+++ b/t/t7501-commit.sh
@@ -14,8 +14,11 @@ test_tick
 test_expect_success \
 	"initial status" \
 	"echo 'bongo bongo' >file &&
-	 git add file && \
-	 git status | grep 'Initial commit'"
+	 git add file"
+
+test_expect_success C_LOCALE_OUTPUT \
+	"Constructing initial commit" \
+	"git status | grep 'Initial commit'"
 
 test_expect_success \
 	"fail initial amend" \
diff --git a/wt-status.c b/wt-status.c
index c6295f9..ad6ef7a 100644
--- a/wt-status.c
+++ b/wt-status.c
@@ -651,7 +651,7 @@ void wt_status_print(struct wt_status *s)
 
 	if (s->is_initial) {
 		color_fprintf_ln(s->fp, color(WT_STATUS_HEADER, s), "#");
-		color_fprintf_ln(s->fp, color(WT_STATUS_HEADER, s), "# Initial commit");
+		color_fprintf_ln(s->fp, color(WT_STATUS_HEADER, s), _("# Initial commit"));
 		color_fprintf_ln(s->fp, color(WT_STATUS_HEADER, s), "#");
 	}
 
-- 
1.7.2.3

^ permalink raw reply related	[flat|nested] 222+ messages in thread

* [PATCH v4 59/73] gettextize: git-status "renamed: " message
  2011-02-22 18:11     ` Junio C Hamano
                         ` (58 preceding siblings ...)
  2011-02-22 23:42       ` [PATCH v4 58/73] gettextize: git-status "Initial commit" message Ævar Arnfjörð Bjarmason
@ 2011-02-22 23:42       ` Ævar Arnfjörð Bjarmason
  2011-02-22 23:42       ` [PATCH v4 60/73] gettextize: git-archive basic messages Ævar Arnfjörð Bjarmason
                         ` (13 subsequent siblings)
  73 siblings, 0 replies; 222+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2011-02-22 23:42 UTC (permalink / raw)
  To: git
  Cc: Junio C Hamano, Jakub Narebski, Ævar Arnfjörð Bjarmason

Gettextize the "renamed: %s -> %s" message which appears as part of
git-status(1) output. Two tests in t4001-diff-rename.sh explicitly
checked for this message. Change them to skip under
GETTEXT_POISON=YesPlease.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
---
 t/t4001-diff-rename.sh |    4 ++--
 wt-status.c            |    2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/t/t4001-diff-rename.sh b/t/t4001-diff-rename.sh
index 71bac83..cad8545 100755
--- a/t/t4001-diff-rename.sh
+++ b/t/t4001-diff-rename.sh
@@ -64,7 +64,7 @@ test_expect_success \
     'validate the output.' \
     'compare_diff_patch current expected'
 
-test_expect_success 'favour same basenames over different ones' '
+test_expect_success C_LOCALE_OUTPUT 'favour same basenames over different ones' '
 	cp path1 another-path &&
 	git add another-path &&
 	git commit -m 1 &&
@@ -73,7 +73,7 @@ test_expect_success 'favour same basenames over different ones' '
 	git mv another-path subdir/path1 &&
 	git status | grep "renamed: .*path1 -> subdir/path1"'
 
-test_expect_success  'favour same basenames even with minor differences' '
+test_expect_success C_LOCALE_OUTPUT  'favour same basenames even with minor differences' '
 	git show HEAD:path1 | sed "s/15/16/" > subdir/path1 &&
 	git status | grep "renamed: .*path1 -> subdir/path1"'
 
diff --git a/wt-status.c b/wt-status.c
index ad6ef7a..ed6bedd 100644
--- a/wt-status.c
+++ b/wt-status.c
@@ -201,7 +201,7 @@ static void wt_status_print_change_data(struct wt_status *s,
 		color_fprintf(s->fp, c, _("modified:   %s"), one);
 		break;
 	case DIFF_STATUS_RENAMED:
-		color_fprintf(s->fp, c, "renamed:    %s -> %s", one, two);
+		color_fprintf(s->fp, c, _("renamed:    %s -> %s"), one, two);
 		break;
 	case DIFF_STATUS_TYPE_CHANGED:
 		color_fprintf(s->fp, c, _("typechange: %s"), one);
-- 
1.7.2.3

^ permalink raw reply related	[flat|nested] 222+ messages in thread

* [PATCH v4 60/73] gettextize: git-archive basic messages
  2011-02-22 18:11     ` Junio C Hamano
                         ` (59 preceding siblings ...)
  2011-02-22 23:42       ` [PATCH v4 59/73] gettextize: git-status "renamed: " message Ævar Arnfjörð Bjarmason
@ 2011-02-22 23:42       ` Ævar Arnfjörð Bjarmason
  2011-02-22 23:42       ` [PATCH v4 61/73] gettextize: git-bundle " Ævar Arnfjörð Bjarmason
                         ` (12 subsequent siblings)
  73 siblings, 0 replies; 222+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2011-02-22 23:42 UTC (permalink / raw)
  To: git
  Cc: Junio C Hamano, Jakub Narebski, Ævar Arnfjörð Bjarmason

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
---
 builtin/archive.c |   14 +++++++-------
 1 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/builtin/archive.c b/builtin/archive.c
index 6a887f5..b14eaba 100644
--- a/builtin/archive.c
+++ b/builtin/archive.c
@@ -14,10 +14,10 @@ static void create_output_file(const char *output_file)
 {
 	int output_fd = open(output_file, O_CREAT | O_WRONLY | O_TRUNC, 0666);
 	if (output_fd < 0)
-		die_errno("could not create archive file '%s'", output_file);
+		die_errno(_("could not create archive file '%s'"), output_file);
 	if (output_fd != 1) {
 		if (dup2(output_fd, 1) < 0)
-			die_errno("could not redirect output");
+			die_errno(_("could not redirect output"));
 		else
 			close(output_fd);
 	}
@@ -33,7 +33,7 @@ static int run_remote_archiver(int argc, const char **argv,
 
 	_remote = remote_get(remote);
 	if (!_remote->url[0])
-		die("git archive: Remote with no URL");
+		die(_("git archive: Remote with no URL"));
 	transport = transport_get(_remote, _remote->url[0]);
 	transport_connect(transport, "git-upload-archive", exec, fd);
 
@@ -43,18 +43,18 @@ static int run_remote_archiver(int argc, const char **argv,
 
 	len = packet_read_line(fd[0], buf, sizeof(buf));
 	if (!len)
-		die("git archive: expected ACK/NAK, got EOF");
+		die(_("git archive: expected ACK/NAK, got EOF"));
 	if (buf[len-1] == '\n')
 		buf[--len] = 0;
 	if (strcmp(buf, "ACK")) {
 		if (len > 5 && !prefixcmp(buf, "NACK "))
-			die("git archive: NACK %s", buf + 5);
-		die("git archive: protocol error");
+			die(_("git archive: NACK %s"), buf + 5);
+		die(_("git archive: protocol error"));
 	}
 
 	len = packet_read_line(fd[0], buf, sizeof(buf));
 	if (len)
-		die("git archive: expected a flush");
+		die(_("git archive: expected a flush"));
 
 	/* Now, start reading from fd[0] and spit it out to stdout */
 	rv = recv_sideband("archive", fd[0], 1);
-- 
1.7.2.3

^ permalink raw reply related	[flat|nested] 222+ messages in thread

* [PATCH v4 61/73] gettextize: git-bundle basic messages
  2011-02-22 18:11     ` Junio C Hamano
                         ` (60 preceding siblings ...)
  2011-02-22 23:42       ` [PATCH v4 60/73] gettextize: git-archive basic messages Ævar Arnfjörð Bjarmason
@ 2011-02-22 23:42       ` Ævar Arnfjörð Bjarmason
  2011-02-22 23:42       ` [PATCH v4 62/73] gettextize: git-clean " Ævar Arnfjörð Bjarmason
                         ` (11 subsequent siblings)
  73 siblings, 0 replies; 222+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2011-02-22 23:42 UTC (permalink / raw)
  To: git
  Cc: Junio C Hamano, Jakub Narebski, Ævar Arnfjörð Bjarmason

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
---
 builtin/bundle.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/builtin/bundle.c b/builtin/bundle.c
index 9b87fb9..81046a9 100644
--- a/builtin/bundle.c
+++ b/builtin/bundle.c
@@ -44,7 +44,7 @@ int cmd_bundle(int argc, const char **argv, const char *prefix)
 		close(bundle_fd);
 		if (verify_bundle(&header, 1))
 			return 1;
-		fprintf(stderr, "%s is okay\n", bundle_file);
+		fprintf(stderr, _("%s is okay\n"), bundle_file);
 		return 0;
 	}
 	if (!strcmp(cmd, "list-heads")) {
@@ -53,11 +53,11 @@ int cmd_bundle(int argc, const char **argv, const char *prefix)
 	}
 	if (!strcmp(cmd, "create")) {
 		if (!startup_info->have_repository)
-			die("Need a repository to create a bundle.");
+			die(_("Need a repository to create a bundle."));
 		return !!create_bundle(&header, bundle_file, argc, argv);
 	} else if (!strcmp(cmd, "unbundle")) {
 		if (!startup_info->have_repository)
-			die("Need a repository to unbundle.");
+			die(_("Need a repository to unbundle."));
 		return !!unbundle(&header, bundle_fd) ||
 			list_bundle_refs(&header, argc, argv);
 	} else
-- 
1.7.2.3

^ permalink raw reply related	[flat|nested] 222+ messages in thread

* [PATCH v4 62/73] gettextize: git-clean basic messages
  2011-02-22 18:11     ` Junio C Hamano
                         ` (61 preceding siblings ...)
  2011-02-22 23:42       ` [PATCH v4 61/73] gettextize: git-bundle " Ævar Arnfjörð Bjarmason
@ 2011-02-22 23:42       ` Ævar Arnfjörð Bjarmason
  2011-02-22 23:42       ` [PATCH v4 63/73] gettextize: git-clean clean.requireForce messages Ævar Arnfjörð Bjarmason
                         ` (10 subsequent siblings)
  73 siblings, 0 replies; 222+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2011-02-22 23:42 UTC (permalink / raw)
  To: git
  Cc: Junio C Hamano, Jakub Narebski, Ævar Arnfjörð Bjarmason

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
---
 builtin/clean.c                  |   20 ++++++++++----------
 t/t7012-skip-worktree-writing.sh |    4 ++--
 t/t7300-clean.sh                 |    6 +++---
 3 files changed, 15 insertions(+), 15 deletions(-)

diff --git a/builtin/clean.c b/builtin/clean.c
index 4a312ab..2d0054b 100644
--- a/builtin/clean.c
+++ b/builtin/clean.c
@@ -75,7 +75,7 @@ int cmd_clean(int argc, const char **argv, const char *prefix)
 		dir.flags |= DIR_SHOW_IGNORED;
 
 	if (ignored && ignored_only)
-		die("-x and -X cannot be used together");
+		die(_("-x and -X cannot be used together"));
 
 	if (!show_only && !force)
 		die("clean.requireForce %s to true and neither -n nor -f given; "
@@ -87,7 +87,7 @@ int cmd_clean(int argc, const char **argv, const char *prefix)
 	dir.flags |= DIR_SHOW_OTHER_DIRECTORIES;
 
 	if (read_cache() < 0)
-		die("index file corrupt");
+		die(_("index file corrupt"));
 
 	if (!ignored)
 		setup_standard_excludes(&dir);
@@ -146,20 +146,20 @@ int cmd_clean(int argc, const char **argv, const char *prefix)
 			qname = quote_path_relative(directory.buf, directory.len, &buf, prefix);
 			if (show_only && (remove_directories ||
 			    (matches == MATCHED_EXACTLY))) {
-				printf("Would remove %s\n", qname);
+				printf(_("Would remove %s\n"), qname);
 			} else if (remove_directories ||
 				   (matches == MATCHED_EXACTLY)) {
 				if (!quiet)
-					printf("Removing %s\n", qname);
+					printf(_("Removing %s\n"), qname);
 				if (remove_dir_recursively(&directory,
 							   rm_flags) != 0) {
-					warning("failed to remove %s", qname);
+					warning(_("failed to remove %s"), qname);
 					errors++;
 				}
 			} else if (show_only) {
-				printf("Would not remove %s\n", qname);
+				printf(_("Would not remove %s\n"), qname);
 			} else {
-				printf("Not removing %s\n", qname);
+				printf(_("Not removing %s\n"), qname);
 			}
 			strbuf_reset(&directory);
 		} else {
@@ -167,13 +167,13 @@ int cmd_clean(int argc, const char **argv, const char *prefix)
 				continue;
 			qname = quote_path_relative(ent->name, -1, &buf, prefix);
 			if (show_only) {
-				printf("Would remove %s\n", qname);
+				printf(_("Would remove %s\n"), qname);
 				continue;
 			} else if (!quiet) {
-				printf("Removing %s\n", qname);
+				printf(_("Removing %s\n"), qname);
 			}
 			if (unlink(ent->name) != 0) {
-				warning("failed to remove %s", qname);
+				warning(_("failed to remove %s"), qname);
 				errors++;
 			}
 		}
diff --git a/t/t7012-skip-worktree-writing.sh b/t/t7012-skip-worktree-writing.sh
index 582d0b5..14fcb1c 100755
--- a/t/t7012-skip-worktree-writing.sh
+++ b/t/t7012-skip-worktree-writing.sh
@@ -124,13 +124,13 @@ cat >expected <<EOF
 Would remove expected
 Would remove result
 EOF
-test_expect_success 'git-clean, absent case' '
+test_expect_success C_LOCALE_OUTPUT 'git-clean, absent case' '
 	setup_absent &&
 	git clean -n > result &&
 	test_cmp expected result
 '
 
-test_expect_success 'git-clean, dirty case' '
+test_expect_success C_LOCALE_OUTPUT 'git-clean, dirty case' '
 	setup_dirty &&
 	git clean -n > result &&
 	test_cmp expected result
diff --git a/t/t7300-clean.sh b/t/t7300-clean.sh
index 02f67b7..7e1be44 100755
--- a/t/t7300-clean.sh
+++ b/t/t7300-clean.sh
@@ -110,7 +110,7 @@ test_expect_success 'git clean with prefix' '
 
 '
 
-test_expect_success 'git clean with relative prefix' '
+test_expect_success C_LOCALE_OUTPUT 'git clean with relative prefix' '
 
 	mkdir -p build docs &&
 	touch a.out src/part3.c docs/manual.txt obj.o build/lib.so &&
@@ -125,7 +125,7 @@ test_expect_success 'git clean with relative prefix' '
 	}
 '
 
-test_expect_success 'git clean with absolute path' '
+test_expect_success C_LOCALE_OUTPUT 'git clean with absolute path' '
 
 	mkdir -p build docs &&
 	touch a.out src/part3.c docs/manual.txt obj.o build/lib.so &&
@@ -377,7 +377,7 @@ test_expect_success 'clean.requireForce and -f' '
 
 '
 
-test_expect_success 'core.excludesfile' '
+test_expect_success C_LOCALE_OUTPUT 'core.excludesfile' '
 
 	echo excludes >excludes &&
 	echo included >included &&
-- 
1.7.2.3

^ permalink raw reply related	[flat|nested] 222+ messages in thread

* [PATCH v4 63/73] gettextize: git-clean clean.requireForce messages
  2011-02-22 18:11     ` Junio C Hamano
                         ` (62 preceding siblings ...)
  2011-02-22 23:42       ` [PATCH v4 62/73] gettextize: git-clean " Ævar Arnfjörð Bjarmason
@ 2011-02-22 23:42       ` Ævar Arnfjörð Bjarmason
  2011-02-22 23:42       ` [PATCH v4 64/73] gettextize: git-describe basic messages Ævar Arnfjörð Bjarmason
                         ` (9 subsequent siblings)
  73 siblings, 0 replies; 222+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2011-02-22 23:42 UTC (permalink / raw)
  To: git
  Cc: Junio C Hamano, Jakub Narebski, Ævar Arnfjörð Bjarmason

Split up the "clean.requireForce set/defaults to true..." die()
message to make it easier to translate.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
---
 builtin/clean.c |   11 ++++++++---
 1 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/builtin/clean.c b/builtin/clean.c
index 2d0054b..75697f7 100644
--- a/builtin/clean.c
+++ b/builtin/clean.c
@@ -77,9 +77,14 @@ int cmd_clean(int argc, const char **argv, const char *prefix)
 	if (ignored && ignored_only)
 		die(_("-x and -X cannot be used together"));
 
-	if (!show_only && !force)
-		die("clean.requireForce %s to true and neither -n nor -f given; "
-		    "refusing to clean", config_set ? "set" : "defaults");
+	if (!show_only && !force) {
+		if (config_set)
+			die(_("clean.requireForce set to true and neither -n nor -f given; "
+				  "refusing to clean"));
+		else
+			die(_("clean.requireForce defaults to true and neither -n nor -f given; "
+				  "refusing to clean"));
+	}
 
 	if (force > 1)
 		rm_flags = 0;
-- 
1.7.2.3

^ permalink raw reply related	[flat|nested] 222+ messages in thread

* [PATCH v4 64/73] gettextize: git-describe basic messages
  2011-02-22 18:11     ` Junio C Hamano
                         ` (63 preceding siblings ...)
  2011-02-22 23:42       ` [PATCH v4 63/73] gettextize: git-clean clean.requireForce messages Ævar Arnfjörð Bjarmason
@ 2011-02-22 23:42       ` Ævar Arnfjörð Bjarmason
  2011-02-26  9:55         ` Jakub Narebski
  2011-02-22 23:42       ` [PATCH v4 65/73] gettextize: git-gc " Ævar Arnfjörð Bjarmason
                         ` (8 subsequent siblings)
  73 siblings, 1 reply; 222+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2011-02-22 23:42 UTC (permalink / raw)
  To: git
  Cc: Junio C Hamano, Jakub Narebski, Ævar Arnfjörð Bjarmason

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
---
 builtin/describe.c  |   36 ++++++++++++++++++------------------
 t/t6120-describe.sh |    2 +-
 2 files changed, 19 insertions(+), 19 deletions(-)

diff --git a/builtin/describe.c b/builtin/describe.c
index 342129f..037691e 100644
--- a/builtin/describe.c
+++ b/builtin/describe.c
@@ -231,13 +231,13 @@ static void display_name(struct commit_name *n)
 	if (n->prio == 2 && !n->tag) {
 		n->tag = lookup_tag(n->sha1);
 		if (!n->tag || parse_tag(n->tag))
-			die("annotated tag %s not available", n->path);
+			die(_("annotated tag %s not available"), n->path);
 	}
 	if (n->tag && !n->name_checked) {
 		if (!n->tag->tag)
-			die("annotated tag %s has no embedded name", n->path);
+			die(_("annotated tag %s has no embedded name"), n->path);
 		if (strcmp(n->tag->tag, all ? n->path + 5 : n->path))
-			warning("tag '%s' is really '%s' here", n->tag->tag, n->path);
+			warning(_("tag '%s' is really '%s' here"), n->tag->tag, n->path);
 		n->name_checked = 1;
 	}
 
@@ -264,10 +264,10 @@ static void describe(const char *arg, int last_one)
 	unsigned int unannotated_cnt = 0;
 
 	if (get_sha1(arg, sha1))
-		die("Not a valid object name %s", arg);
+		die(_("Not a valid object name %s"), arg);
 	cmit = lookup_commit_reference(sha1);
 	if (!cmit)
-		die("%s is not a valid '%s' object", arg, commit_type);
+		die(_("%s is not a valid '%s' object"), arg, commit_type);
 
 	n = find_commit_name(cmit->object.sha1);
 	if (n && (tags || all || n->prio == 2)) {
@@ -284,9 +284,9 @@ static void describe(const char *arg, int last_one)
 	}
 
 	if (!max_candidates)
-		die("no tag exactly matches '%s'", sha1_to_hex(cmit->object.sha1));
+		die(_("no tag exactly matches '%s'"), sha1_to_hex(cmit->object.sha1));
 	if (debug)
-		fprintf(stderr, "searching to describe %s\n", arg);
+		fprintf(stderr, _("searching to describe %s\n"), arg);
 
 	if (!have_util) {
 		for_each_hash(&names, set_util);
@@ -326,7 +326,7 @@ static void describe(const char *arg, int last_one)
 		}
 		if (annotated_cnt && !list) {
 			if (debug)
-				fprintf(stderr, "finished search at %s\n",
+				fprintf(stderr, _("finished search at %s\n"),
 					sha1_to_hex(c->object.sha1));
 			break;
 		}
@@ -350,12 +350,12 @@ static void describe(const char *arg, int last_one)
 			return;
 		}
 		if (unannotated_cnt)
-			die("No annotated tags can describe '%s'.\n"
-			    "However, there were unannotated tags: try --tags.",
+			die(_("No annotated tags can describe '%s'.\n"
+			    "However, there were unannotated tags: try --tags."),
 			    sha1_to_hex(sha1));
 		else
-			die("No tags can describe '%s'.\n"
-			    "Try --always, or create some tags.",
+			die(_("No tags can describe '%s'.\n"
+			    "Try --always, or create some tags."),
 			    sha1_to_hex(sha1));
 	}
 
@@ -375,11 +375,11 @@ static void describe(const char *arg, int last_one)
 				prio_names[t->name->prio],
 				t->depth, t->name->path);
 		}
-		fprintf(stderr, "traversed %lu commits\n", seen_commits);
+		fprintf(stderr, _("traversed %lu commits\n"), seen_commits);
 		if (gave_up_on) {
 			fprintf(stderr,
-				"more than %i tags found; listed %i most recent\n"
-				"gave up search at %s\n",
+				_("more than %i tags found; listed %i most recent\n"
+				"gave up search at %s\n"),
 				max_candidates, max_candidates,
 				sha1_to_hex(gave_up_on->object.sha1));
 		}
@@ -429,7 +429,7 @@ int cmd_describe(int argc, const char **argv, const char *prefix)
 	save_commit_buffer = 0;
 
 	if (longformat && abbrev == 0)
-		die("--long is incompatible with --abbrev=0");
+		die(_("--long is incompatible with --abbrev=0"));
 
 	if (contains) {
 		const char **args = xmalloc((7 + argc) * sizeof(char *));
@@ -455,14 +455,14 @@ int cmd_describe(int argc, const char **argv, const char *prefix)
 	init_hash(&names);
 	for_each_rawref(get_name, NULL);
 	if (!names.nr && !always)
-		die("No names found, cannot describe anything.");
+		die(_("No names found, cannot describe anything."));
 
 	if (argc == 0) {
 		if (dirty && !cmd_diff_index(ARRAY_SIZE(diff_index_args) - 1, diff_index_args, prefix))
 			dirty = NULL;
 		describe("HEAD", 1);
 	} else if (dirty) {
-		die("--dirty is incompatible with committishes");
+		die(_("--dirty is incompatible with committishes"));
 	} else {
 		while (argc-- > 0) {
 			describe(*argv++, argc == 0);
diff --git a/t/t6120-describe.sh b/t/t6120-describe.sh
index 876d1ab..1826996 100755
--- a/t/t6120-describe.sh
+++ b/t/t6120-describe.sh
@@ -123,7 +123,7 @@ cat - >err.expect <<EOF
 warning: tag 'A' is really 'Q' here
 EOF
 check_describe A-* HEAD
-test_expect_success 'warning was displayed for Q' '
+test_expect_success C_LOCALE_OUTPUT 'warning was displayed for Q' '
 	test_cmp err.expect err.actual
 '
 test_expect_success 'rename tag Q back to A' '
-- 
1.7.2.3

^ permalink raw reply related	[flat|nested] 222+ messages in thread

* [PATCH v4 65/73] gettextize: git-gc basic messages
  2011-02-22 18:11     ` Junio C Hamano
                         ` (64 preceding siblings ...)
  2011-02-22 23:42       ` [PATCH v4 64/73] gettextize: git-describe basic messages Ævar Arnfjörð Bjarmason
@ 2011-02-22 23:42       ` Ævar Arnfjörð Bjarmason
  2011-02-22 23:42       ` [PATCH v4 66/73] gettextize: git-gc "Auto packing the repository" message Ævar Arnfjörð Bjarmason
                         ` (7 subsequent siblings)
  73 siblings, 0 replies; 222+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2011-02-22 23:42 UTC (permalink / raw)
  To: git
  Cc: Junio C Hamano, Jakub Narebski, Ævar Arnfjörð Bjarmason

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
---
 builtin/gc.c |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/builtin/gc.c b/builtin/gc.c
index 1a80702..a2be62a 100644
--- a/builtin/gc.c
+++ b/builtin/gc.c
@@ -60,7 +60,7 @@ static int gc_config(const char *var, const char *value, void *cb)
 		if (value && strcmp(value, "now")) {
 			unsigned long now = approxidate("now");
 			if (approxidate(value) >= now)
-				return error("Invalid %s: '%s'", var, value);
+				return error(_("Invalid %s: '%s'"), var, value);
 		}
 		return git_config_string(&prune_expire, var, value);
 	}
@@ -75,7 +75,7 @@ static void append_option(const char **cmd, const char *opt, int max_length)
 		;
 
 	if (i + 2 >= max_length)
-		die("Too many options specified");
+		die(_("Too many options specified"));
 	cmd[i++] = opt;
 	cmd[i] = NULL;
 }
@@ -100,7 +100,7 @@ static int too_many_loose_objects(void)
 		return 0;
 
 	if (sizeof(path) <= snprintf(path, sizeof(path), "%s/17", objdir)) {
-		warning("insanely long object directory %.*s", 50, objdir);
+		warning(_("insanely long object directory %.*s"), 50, objdir);
 		return 0;
 	}
 	dir = opendir(path);
@@ -251,8 +251,8 @@ int cmd_gc(int argc, const char **argv, const char *prefix)
 		return error(FAILED_RUN, argv_rerere[0]);
 
 	if (auto_gc && too_many_loose_objects())
-		warning("There are too many unreachable loose objects; "
-			"run 'git prune' to remove them.");
+		warning(_("There are too many unreachable loose objects; "
+			"run 'git prune' to remove them."));
 
 	return 0;
 }
-- 
1.7.2.3

^ permalink raw reply related	[flat|nested] 222+ messages in thread

* [PATCH v4 66/73] gettextize: git-gc "Auto packing the repository" message
  2011-02-22 18:11     ` Junio C Hamano
                         ` (65 preceding siblings ...)
  2011-02-22 23:42       ` [PATCH v4 65/73] gettextize: git-gc " Ævar Arnfjörð Bjarmason
@ 2011-02-22 23:42       ` Ævar Arnfjörð Bjarmason
  2011-02-22 23:42       ` [PATCH v4 67/73] gettextize: git-notes basic commands Ævar Arnfjörð Bjarmason
                         ` (6 subsequent siblings)
  73 siblings, 0 replies; 222+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2011-02-22 23:42 UTC (permalink / raw)
  To: git
  Cc: Junio C Hamano, Jakub Narebski, Ævar Arnfjörð Bjarmason

Split up the "Auto packing the repository" message into quiet and
verbose variants to make translation easier.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
---
 builtin/gc.c |   14 +++++++-------
 1 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/builtin/gc.c b/builtin/gc.c
index a2be62a..ff5f73b 100644
--- a/builtin/gc.c
+++ b/builtin/gc.c
@@ -219,13 +219,13 @@ int cmd_gc(int argc, const char **argv, const char *prefix)
 		 */
 		if (!need_to_gc())
 			return 0;
-		fprintf(stderr,
-			"Auto packing the repository for optimum performance.%s\n",
-			quiet
-			? ""
-			: (" You may also\n"
-			   "run \"git gc\" manually. See "
-			   "\"git help gc\" for more information."));
+		if (quiet)
+			fprintf(stderr, _("Auto packing the repository for optimum performance.\n"));
+		else
+			fprintf(stderr,
+					_("Auto packing the repository for optimum performance. You may also\n"
+					"run \"git gc\" manually. See "
+					"\"git help gc\" for more information."));
 	} else
 		append_option(argv_repack,
 			      prune_expire && !strcmp(prune_expire, "now")
-- 
1.7.2.3

^ permalink raw reply related	[flat|nested] 222+ messages in thread

* [PATCH v4 67/73] gettextize: git-notes basic commands
  2011-02-22 18:11     ` Junio C Hamano
                         ` (66 preceding siblings ...)
  2011-02-22 23:42       ` [PATCH v4 66/73] gettextize: git-gc "Auto packing the repository" message Ævar Arnfjörð Bjarmason
@ 2011-02-22 23:42       ` Ævar Arnfjörð Bjarmason
  2011-02-22 23:42       ` [PATCH v4 68/73] gettextize: git-notes GIT_NOTES_REWRITE_MODE error message Ævar Arnfjörð Bjarmason
                         ` (5 subsequent siblings)
  73 siblings, 0 replies; 222+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2011-02-22 23:42 UTC (permalink / raw)
  To: git
  Cc: Junio C Hamano, Jakub Narebski, Ævar Arnfjörð Bjarmason

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
---
 builtin/notes.c |  106 +++++++++++++++++++++++++++---------------------------
 1 files changed, 53 insertions(+), 53 deletions(-)

diff --git a/builtin/notes.c b/builtin/notes.c
index 4d5556e..4c6cf85 100644
--- a/builtin/notes.c
+++ b/builtin/notes.c
@@ -146,13 +146,13 @@ static void write_commented_object(int fd, const unsigned char *object)
 	show.err = 0;
 	show.git_cmd = 1;
 	if (start_command(&show))
-		die("unable to start 'show' for object '%s'",
+		die(_("unable to start 'show' for object '%s'"),
 		    sha1_to_hex(object));
 
 	/* Open the output as FILE* so strbuf_getline() can be used. */
 	show_out = xfdopen(show.out, "r");
 	if (show_out == NULL)
-		die_errno("can't fdopen 'show' output fd");
+		die_errno(_("can't fdopen 'show' output fd"));
 
 	/* Prepend "# " to each output line and write result to 'fd' */
 	while (strbuf_getline(&buf, show_out, '\n') != EOF) {
@@ -162,10 +162,10 @@ static void write_commented_object(int fd, const unsigned char *object)
 	}
 	strbuf_release(&buf);
 	if (fclose(show_out))
-		die_errno("failed to close pipe to 'show' for object '%s'",
+		die_errno(_("failed to close pipe to 'show' for object '%s'"),
 			  sha1_to_hex(object));
 	if (finish_command(&show))
-		die("failed to finish 'show' for object '%s'",
+		die(_("failed to finish 'show' for object '%s'"),
 		    sha1_to_hex(object));
 }
 
@@ -182,7 +182,7 @@ static void create_note(const unsigned char *object, struct msg_arg *msg,
 		path = git_pathdup("NOTES_EDITMSG");
 		fd = open(path, O_CREAT | O_TRUNC | O_WRONLY, 0600);
 		if (fd < 0)
-			die_errno("could not create file '%s'", path);
+			die_errno(_("could not create file '%s'"), path);
 
 		if (msg->given)
 			write_or_die(fd, msg->buf.buf, msg->buf.len);
@@ -196,8 +196,8 @@ static void create_note(const unsigned char *object, struct msg_arg *msg,
 		strbuf_reset(&(msg->buf));
 
 		if (launch_editor(path, &(msg->buf), NULL)) {
-			die("Please supply the note contents using either -m" \
-			    " or -F option");
+			die(_("Please supply the note contents using either -m" \
+			    " or -F option"));
 		}
 		stripspace(&(msg->buf), 1);
 	}
@@ -217,14 +217,14 @@ static void create_note(const unsigned char *object, struct msg_arg *msg,
 	}
 
 	if (!msg->buf.len) {
-		fprintf(stderr, "Removing note for object %s\n",
+		fprintf(stderr, _("Removing note for object %s\n"),
 			sha1_to_hex(object));
 		hashclr(result);
 	} else {
 		if (write_sha1_file(msg->buf.buf, msg->buf.len, blob_type, result)) {
-			error("unable to write note object");
+			error(_("unable to write note object"));
 			if (path)
-				error("The note contents has been left in %s",
+				error(_("The note contents has been left in %s"),
 				      path);
 			exit(128);
 		}
@@ -258,9 +258,9 @@ static int parse_file_arg(const struct option *opt, const char *arg, int unset)
 		strbuf_addch(&(msg->buf), '\n');
 	if (!strcmp(arg, "-")) {
 		if (strbuf_read(&(msg->buf), 0, 1024) < 0)
-			die_errno("cannot read '%s'", arg);
+			die_errno(_("cannot read '%s'"), arg);
 	} else if (strbuf_read_file(&(msg->buf), arg, 1024) < 0)
-		die_errno("could not open or read '%s'", arg);
+		die_errno(_("could not open or read '%s'"), arg);
 	stripspace(&(msg->buf), 0);
 
 	msg->given = 1;
@@ -279,10 +279,10 @@ static int parse_reuse_arg(const struct option *opt, const char *arg, int unset)
 		strbuf_addch(&(msg->buf), '\n');
 
 	if (get_sha1(arg, object))
-		die("Failed to resolve '%s' as a valid ref.", arg);
+		die(_("Failed to resolve '%s' as a valid ref."), arg);
 	if (!(buf = read_sha1_file(object, &type, &len)) || !len) {
 		free(buf);
-		die("Failed to read object '%s'.", arg);;
+		die(_("Failed to read object '%s'."), arg);;
 	}
 	strbuf_add(&(msg->buf), buf, len);
 	free(buf);
@@ -306,7 +306,7 @@ void commit_notes(struct notes_tree *t, const char *msg)
 	if (!t)
 		t = &default_notes_tree;
 	if (!t->initialized || !t->ref || !*t->ref)
-		die("Cannot commit uninitialized/unreferenced notes tree");
+		die(_("Cannot commit uninitialized/unreferenced notes tree"));
 	if (!t->dirty)
 		return; /* don't have to commit an unchanged tree */
 
@@ -347,7 +347,7 @@ static int notes_rewrite_config(const char *k, const char *v, void *cb)
 			config_error_nonbool(k);
 		c->combine = parse_combine_notes_fn(v);
 		if (!c->combine) {
-			error("Bad notes.rewriteMode value: '%s'", v);
+			error(_("Bad notes.rewriteMode value: '%s'"), v);
 			return 1;
 		}
 		return 0;
@@ -357,8 +357,8 @@ static int notes_rewrite_config(const char *k, const char *v, void *cb)
 		if (!prefixcmp(v, "refs/notes/"))
 			string_list_add_refs_by_glob(c->refs, v);
 		else
-			warning("Refusing to rewrite notes in %s"
-				" (outside of refs/notes/)", v);
+			warning(_("Refusing to rewrite notes in %s"
+				" (outside of refs/notes/)"), v);
 		return 0;
 	}
 
@@ -446,13 +446,13 @@ int notes_copy_from_stdin(int force, const char *rewrite_cmd)
 
 		split = strbuf_split(&buf, ' ');
 		if (!split[0] || !split[1])
-			die("Malformed input line: '%s'.", buf.buf);
+			die(_("Malformed input line: '%s'."), buf.buf);
 		strbuf_rtrim(split[0]);
 		strbuf_rtrim(split[1]);
 		if (get_sha1(split[0]->buf, from_obj))
-			die("Failed to resolve '%s' as a valid ref.", split[0]->buf);
+			die(_("Failed to resolve '%s' as a valid ref."), split[0]->buf);
 		if (get_sha1(split[1]->buf, to_obj))
-			die("Failed to resolve '%s' as a valid ref.", split[1]->buf);
+			die(_("Failed to resolve '%s' as a valid ref."), split[1]->buf);
 
 		if (rewrite_cmd)
 			err = copy_note_for_rewrite(c, from_obj, to_obj);
@@ -461,7 +461,7 @@ int notes_copy_from_stdin(int force, const char *rewrite_cmd)
 					combine_notes_overwrite);
 
 		if (err) {
-			error("Failed to copy notes from '%s' to '%s'",
+			error(_("Failed to copy notes from '%s' to '%s'"),
 			      split[0]->buf, split[1]->buf);
 			ret = 1;
 		}
@@ -505,20 +505,20 @@ static int list(int argc, const char **argv, const char *prefix)
 				     git_notes_list_usage, 0);
 
 	if (1 < argc) {
-		error("too many parameters");
+		error(_("too many parameters"));
 		usage_with_options(git_notes_list_usage, options);
 	}
 
 	t = init_notes_check("list");
 	if (argc) {
 		if (get_sha1(argv[0], object))
-			die("Failed to resolve '%s' as a valid ref.", argv[0]);
+			die(_("Failed to resolve '%s' as a valid ref."), argv[0]);
 		note = get_note(t, object);
 		if (note) {
 			puts(sha1_to_hex(note));
 			retval = 0;
 		} else
-			retval = error("No note found for object %s.",
+			retval = error(_("No note found for object %s."),
 				       sha1_to_hex(object));
 	} else
 		retval = for_each_note(t, 0, list_each_note, NULL);
@@ -557,26 +557,26 @@ static int add(int argc, const char **argv, const char *prefix)
 			     0);
 
 	if (1 < argc) {
-		error("too many parameters");
+		error(_("too many parameters"));
 		usage_with_options(git_notes_add_usage, options);
 	}
 
 	object_ref = argc ? argv[0] : "HEAD";
 
 	if (get_sha1(object_ref, object))
-		die("Failed to resolve '%s' as a valid ref.", object_ref);
+		die(_("Failed to resolve '%s' as a valid ref."), object_ref);
 
 	t = init_notes_check("add");
 	note = get_note(t, object);
 
 	if (note) {
 		if (!force) {
-			retval = error("Cannot add notes. Found existing notes "
+			retval = error(_("Cannot add notes. Found existing notes "
 				       "for object %s. Use '-f' to overwrite "
-				       "existing notes", sha1_to_hex(object));
+				       "existing notes"), sha1_to_hex(object));
 			goto out;
 		}
-		fprintf(stderr, "Overwriting existing notes for object %s\n",
+		fprintf(stderr, _("Overwriting existing notes for object %s\n"),
 			sha1_to_hex(object));
 	}
 
@@ -618,7 +618,7 @@ static int copy(int argc, const char **argv, const char *prefix)
 
 	if (from_stdin || rewrite_cmd) {
 		if (argc) {
-			error("too many parameters");
+			error(_("too many parameters"));
 			usage_with_options(git_notes_copy_usage, options);
 		} else {
 			return notes_copy_from_stdin(force, rewrite_cmd);
@@ -626,41 +626,41 @@ static int copy(int argc, const char **argv, const char *prefix)
 	}
 
 	if (argc < 2) {
-		error("too few parameters");
+		error(_("too few parameters"));
 		usage_with_options(git_notes_copy_usage, options);
 	}
 	if (2 < argc) {
-		error("too many parameters");
+		error(_("too many parameters"));
 		usage_with_options(git_notes_copy_usage, options);
 	}
 
 	if (get_sha1(argv[0], from_obj))
-		die("Failed to resolve '%s' as a valid ref.", argv[0]);
+		die(_("Failed to resolve '%s' as a valid ref."), argv[0]);
 
 	object_ref = 1 < argc ? argv[1] : "HEAD";
 
 	if (get_sha1(object_ref, object))
-		die("Failed to resolve '%s' as a valid ref.", object_ref);
+		die(_("Failed to resolve '%s' as a valid ref."), object_ref);
 
 	t = init_notes_check("copy");
 	note = get_note(t, object);
 
 	if (note) {
 		if (!force) {
-			retval = error("Cannot copy notes. Found existing "
+			retval = error(_("Cannot copy notes. Found existing "
 				       "notes for object %s. Use '-f' to "
-				       "overwrite existing notes",
+				       "overwrite existing notes"),
 				       sha1_to_hex(object));
 			goto out;
 		}
-		fprintf(stderr, "Overwriting existing notes for object %s\n",
+		fprintf(stderr, _("Overwriting existing notes for object %s\n"),
 			sha1_to_hex(object));
 	}
 
 	from_note = get_note(t, from_obj);
 	if (!from_note) {
-		retval = error("Missing notes on source object %s. Cannot "
-			       "copy.", sha1_to_hex(from_obj));
+		retval = error(_("Missing notes on source object %s. Cannot "
+			       "copy."), sha1_to_hex(from_obj));
 		goto out;
 	}
 
@@ -703,19 +703,19 @@ static int append_edit(int argc, const char **argv, const char *prefix)
 			     PARSE_OPT_KEEP_ARGV0);
 
 	if (2 < argc) {
-		error("too many parameters");
+		error(_("too many parameters"));
 		usage_with_options(usage, options);
 	}
 
 	if (msg.given && edit)
-		fprintf(stderr, "The -m/-F/-c/-C options have been deprecated "
+		fprintf(stderr, _("The -m/-F/-c/-C options have been deprecated "
 			"for the 'edit' subcommand.\n"
-			"Please use 'git notes add -f -m/-F/-c/-C' instead.\n");
+			"Please use 'git notes add -f -m/-F/-c/-C' instead.\n"));
 
 	object_ref = 1 < argc ? argv[1] : "HEAD";
 
 	if (get_sha1(object_ref, object))
-		die("Failed to resolve '%s' as a valid ref.", object_ref);
+		die(_("Failed to resolve '%s' as a valid ref."), object_ref);
 
 	t = init_notes_check(argv[0]);
 	note = get_note(t, object);
@@ -750,20 +750,20 @@ static int show(int argc, const char **argv, const char *prefix)
 			     0);
 
 	if (1 < argc) {
-		error("too many parameters");
+		error(_("too many parameters"));
 		usage_with_options(git_notes_show_usage, options);
 	}
 
 	object_ref = argc ? argv[0] : "HEAD";
 
 	if (get_sha1(object_ref, object))
-		die("Failed to resolve '%s' as a valid ref.", object_ref);
+		die(_("Failed to resolve '%s' as a valid ref."), object_ref);
 
 	t = init_notes_check("show");
 	note = get_note(t, object);
 
 	if (!note)
-		retval = error("No note found for object %s.",
+		retval = error(_("No note found for object %s."),
 			       sha1_to_hex(object));
 	else {
 		const char *show_args[3] = {"show", sha1_to_hex(note), NULL};
@@ -961,22 +961,22 @@ static int remove_cmd(int argc, const char **argv, const char *prefix)
 			     git_notes_remove_usage, 0);
 
 	if (1 < argc) {
-		error("too many parameters");
+		error(_("too many parameters"));
 		usage_with_options(git_notes_remove_usage, options);
 	}
 
 	object_ref = argc ? argv[0] : "HEAD";
 
 	if (get_sha1(object_ref, object))
-		die("Failed to resolve '%s' as a valid ref.", object_ref);
+		die(_("Failed to resolve '%s' as a valid ref."), object_ref);
 
 	t = init_notes_check("remove");
 
 	retval = remove_note(t, object);
 	if (retval)
-		fprintf(stderr, "Object %s has no note\n", sha1_to_hex(object));
+		fprintf(stderr, _("Object %s has no note\n"), sha1_to_hex(object));
 	else {
-		fprintf(stderr, "Removing note for object %s\n",
+		fprintf(stderr, _("Removing note for object %s\n"),
 			sha1_to_hex(object));
 
 		commit_notes(t, "Notes removed by 'git notes remove'");
@@ -999,7 +999,7 @@ static int prune(int argc, const char **argv, const char *prefix)
 			     0);
 
 	if (argc) {
-		error("too many parameters");
+		error(_("too many parameters"));
 		usage_with_options(git_notes_prune_usage, options);
 	}
 
@@ -1069,7 +1069,7 @@ int cmd_notes(int argc, const char **argv, const char *prefix)
 	else if (!strcmp(argv[0], "get-ref"))
 		result = get_ref(argc, argv, prefix);
 	else {
-		result = error("Unknown subcommand: %s", argv[0]);
+		result = error(_("Unknown subcommand: %s"), argv[0]);
 		usage_with_options(git_notes_usage, options);
 	}
 
-- 
1.7.2.3

^ permalink raw reply related	[flat|nested] 222+ messages in thread

* [PATCH v4 68/73] gettextize: git-notes GIT_NOTES_REWRITE_MODE error message
  2011-02-22 18:11     ` Junio C Hamano
                         ` (67 preceding siblings ...)
  2011-02-22 23:42       ` [PATCH v4 67/73] gettextize: git-notes basic commands Ævar Arnfjörð Bjarmason
@ 2011-02-22 23:42       ` Ævar Arnfjörð Bjarmason
  2011-02-22 23:42       ` [PATCH v4 69/73] gettextize: git-revert basic messages Ævar Arnfjörð Bjarmason
                         ` (4 subsequent siblings)
  73 siblings, 0 replies; 222+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2011-02-22 23:42 UTC (permalink / raw)
  To: git
  Cc: Junio C Hamano, Jakub Narebski, Ævar Arnfjörð Bjarmason

Use sprintf format for the error message that's displayed if
GIT_NOTES_REWRITE_MODE is invalid, and leave a note in a TRANSLATORS
comment indicating what the message means.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
---
 builtin/notes.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/builtin/notes.c b/builtin/notes.c
index 4c6cf85..a0aa995 100644
--- a/builtin/notes.c
+++ b/builtin/notes.c
@@ -382,8 +382,10 @@ struct notes_rewrite_cfg *init_copy_notes_for_rewrite(const char *cmd)
 		c->mode_from_env = 1;
 		c->combine = parse_combine_notes_fn(rewrite_mode_env);
 		if (!c->combine)
-			error("Bad " GIT_NOTES_REWRITE_MODE_ENVIRONMENT
-			      " value: '%s'", rewrite_mode_env);
+			/* TRANSLATORS: The first %s is the name of the
+			   environment variable, the second %s is its value */
+			error(_("Bad %s value: '%s'"), GIT_NOTES_REWRITE_MODE_ENVIRONMENT,
+					rewrite_mode_env);
 	}
 	if (rewrite_refs_env) {
 		c->refs_from_env = 1;
-- 
1.7.2.3

^ permalink raw reply related	[flat|nested] 222+ messages in thread

* [PATCH v4 69/73] gettextize: git-revert basic messages
  2011-02-22 18:11     ` Junio C Hamano
                         ` (68 preceding siblings ...)
  2011-02-22 23:42       ` [PATCH v4 68/73] gettextize: git-notes GIT_NOTES_REWRITE_MODE error message Ævar Arnfjörð Bjarmason
@ 2011-02-22 23:42       ` Ævar Arnfjörð Bjarmason
  2011-02-22 23:42       ` [PATCH v4 70/73] gettextize: git-revert "Your local changes" message Ævar Arnfjörð Bjarmason
                         ` (3 subsequent siblings)
  73 siblings, 0 replies; 222+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2011-02-22 23:42 UTC (permalink / raw)
  To: git
  Cc: Junio C Hamano, Jakub Narebski, Ævar Arnfjörð Bjarmason

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
---
 builtin/revert.c |   46 +++++++++++++++++++++++-----------------------
 1 files changed, 23 insertions(+), 23 deletions(-)

diff --git a/builtin/revert.c b/builtin/revert.c
index dc1b702..1ca08da 100644
--- a/builtin/revert.c
+++ b/builtin/revert.c
@@ -96,7 +96,7 @@ static void parse_args(int argc, const char **argv)
 			OPT_END(),
 		};
 		if (parse_options_concat(options, ARRAY_SIZE(options), cp_extra))
-			die("program error");
+			die(_("program error"));
 	}
 
 	commit_argc = parse_options(argc, argv, NULL, options, usage_str,
@@ -168,7 +168,7 @@ static char *get_encoding(const char *message)
 	const char *p = message, *eol;
 
 	if (!p)
-		die ("Could not read commit message of %s",
+		die (_("Could not read commit message of %s"),
 				sha1_to_hex(commit->object.sha1));
 	while (*p && *p != '\n') {
 		for (eol = p + 1; *eol && *eol != '\n'; eol++)
@@ -202,7 +202,7 @@ static void set_author_ident_env(const char *message)
 {
 	const char *p = message;
 	if (!p)
-		die ("Could not read commit message of %s",
+		die (_("Could not read commit message of %s"),
 				sha1_to_hex(commit->object.sha1));
 	while (*p && *p != '\n') {
 		const char *eol;
@@ -216,7 +216,7 @@ static void set_author_ident_env(const char *message)
 			line = xmemdupz(p, eol - p);
 			email = strchr(line, '<');
 			if (!email)
-				die ("Could not extract author email from %s",
+				die (_("Could not extract author email from %s"),
 					sha1_to_hex(commit->object.sha1));
 			if (email == line)
 				pend = line;
@@ -228,7 +228,7 @@ static void set_author_ident_env(const char *message)
 			email++;
 			timestamp = strchr(email, '>');
 			if (!timestamp)
-				die ("Could not extract author time from %s",
+				die (_("Could not extract author time from %s"),
 					sha1_to_hex(commit->object.sha1));
 			*timestamp = '\0';
 			for (timestamp++; *timestamp && isspace(*timestamp);
@@ -244,7 +244,7 @@ static void set_author_ident_env(const char *message)
 		if (*p == '\n')
 			p++;
 	}
-	die ("No author information found in %s",
+	die (_("No author information found in %s"),
 			sha1_to_hex(commit->object.sha1));
 }
 
@@ -281,10 +281,10 @@ static void write_message(struct strbuf *msgbuf, const char *filename)
 	int msg_fd = hold_lock_file_for_update(&msg_file, filename,
 					       LOCK_DIE_ON_ERROR);
 	if (write_in_full(msg_fd, msgbuf->buf, msgbuf->len) < 0)
-		die_errno("Could not write to %s.", filename);
+		die_errno(_("Could not write to %s."), filename);
 	strbuf_release(msgbuf);
 	if (commit_lock_file(&msg_file) < 0)
-		die("Error wrapping up %s", filename);
+		die(_("Error wrapping up %s"), filename);
 }
 
 static struct tree *empty_tree(void)
@@ -420,10 +420,10 @@ static int do_pick_commit(void)
 		 * to work on.
 		 */
 		if (write_cache_as_tree(head, 0, NULL))
-			die ("Your index file is unmerged.");
+			die (_("Your index file is unmerged."));
 	} else {
 		if (get_sha1("HEAD", head))
-			die ("You do not have a valid HEAD");
+			die (_("You do not have a valid HEAD"));
 		if (index_differs_from("HEAD", 0))
 			die_dirty_index(me);
 	}
@@ -431,7 +431,7 @@ static int do_pick_commit(void)
 
 	if (!commit->parents) {
 		if (action == REVERT)
-			die ("Cannot revert a root commit");
+			die (_("Cannot revert a root commit"));
 		parent = NULL;
 	}
 	else if (commit->parents->next) {
@@ -440,7 +440,7 @@ static int do_pick_commit(void)
 		struct commit_list *p;
 
 		if (!mainline)
-			die("Commit %s is a merge but no -m option was given.",
+			die(_("Commit %s is a merge but no -m option was given."),
 			    sha1_to_hex(commit->object.sha1));
 
 		for (cnt = 1, p = commit->parents;
@@ -448,11 +448,11 @@ static int do_pick_commit(void)
 		     cnt++)
 			p = p->next;
 		if (cnt != mainline || !p)
-			die("Commit %s does not have parent %d",
+			die(_("Commit %s does not have parent %d"),
 			    sha1_to_hex(commit->object.sha1), mainline);
 		parent = p->item;
 	} else if (0 < mainline)
-		die("Mainline was specified but commit %s is not a merge.",
+		die(_("Mainline was specified but commit %s is not a merge."),
 		    sha1_to_hex(commit->object.sha1));
 	else
 		parent = commit->parents->item;
@@ -465,7 +465,7 @@ static int do_pick_commit(void)
 		    me, sha1_to_hex(parent->object.sha1));
 
 	if (get_message(commit->buffer, &msg) != 0)
-		die("Cannot get commit message for %s",
+		die(_("Cannot get commit message for %s"),
 				sha1_to_hex(commit->object.sha1));
 
 	/*
@@ -556,10 +556,10 @@ static void prepare_revs(struct rev_info *revs)
 		usage(*revert_or_cherry_pick_usage());
 
 	if (prepare_revision_walk(revs))
-		die("revision walk setup failed");
+		die(_("revision walk setup failed"));
 
 	if (!revs->commits)
-		die("empty commit set passed");
+		die(_("empty commit set passed"));
 }
 
 static void read_and_refresh_cache(const char *me)
@@ -567,12 +567,12 @@ static void read_and_refresh_cache(const char *me)
 	static struct lock_file index_lock;
 	int index_fd = hold_locked_index(&index_lock, 0);
 	if (read_index_preload(&the_index, NULL) < 0)
-		die("git %s: failed to read the index", me);
+		die(_("git %s: failed to read the index"), me);
 	refresh_index(&the_index, REFRESH_QUIET|REFRESH_UNMERGED, NULL, NULL, NULL);
 	if (the_index.cache_changed) {
 		if (write_index(&the_index, index_fd) ||
 		    commit_locked_index(&index_lock))
-			die("git %s: failed to refresh the index", me);
+			die(_("git %s: failed to refresh the index"), me);
 	}
 	rollback_lock_file(&index_lock);
 }
@@ -588,13 +588,13 @@ static int revert_or_cherry_pick(int argc, const char **argv)
 
 	if (allow_ff) {
 		if (signoff)
-			die("cherry-pick --ff cannot be used with --signoff");
+			die(_("cherry-pick --ff cannot be used with --signoff"));
 		if (no_commit)
-			die("cherry-pick --ff cannot be used with --no-commit");
+			die(_("cherry-pick --ff cannot be used with --no-commit"));
 		if (no_replay)
-			die("cherry-pick --ff cannot be used with -x");
+			die(_("cherry-pick --ff cannot be used with -x"));
 		if (edit)
-			die("cherry-pick --ff cannot be used with --edit");
+			die(_("cherry-pick --ff cannot be used with --edit"));
 	}
 
 	read_and_refresh_cache(me);
-- 
1.7.2.3

^ permalink raw reply related	[flat|nested] 222+ messages in thread

* [PATCH v4 70/73] gettextize: git-revert "Your local changes" message
  2011-02-22 18:11     ` Junio C Hamano
                         ` (69 preceding siblings ...)
  2011-02-22 23:42       ` [PATCH v4 69/73] gettextize: git-revert basic messages Ævar Arnfjörð Bjarmason
@ 2011-02-22 23:42       ` Ævar Arnfjörð Bjarmason
  2011-02-22 23:42       ` [PATCH v4 71/73] gettextize: git-revert literal "me" messages Ævar Arnfjörð Bjarmason
                         ` (2 subsequent siblings)
  73 siblings, 0 replies; 222+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2011-02-22 23:42 UTC (permalink / raw)
  To: git
  Cc: Junio C Hamano, Jakub Narebski, Ævar Arnfjörð Bjarmason

Translate the "Your local changes [...]" message without using the
`me' variable, instead split up the two messages so translators can
translate the whole messages as-is.

Reported-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
---
 builtin/revert.c              |   18 +++++++++++++-----
 t/t3501-revert-cherry-pick.sh |    2 +-
 2 files changed, 14 insertions(+), 6 deletions(-)

diff --git a/builtin/revert.c b/builtin/revert.c
index 1ca08da..02c23c9 100644
--- a/builtin/revert.c
+++ b/builtin/revert.c
@@ -302,11 +302,19 @@ static NORETURN void die_dirty_index(const char *me)
 	if (read_cache_unmerged()) {
 		die_resolve_conflict(me);
 	} else {
-		if (advice_commit_before_merge)
-			die("Your local changes would be overwritten by %s.\n"
-			    "Please, commit your changes or stash them to proceed.", me);
-		else
-			die("Your local changes would be overwritten by %s.\n", me);
+		if (advice_commit_before_merge) {
+			if (action == REVERT)
+				die(_("Your local changes would be overwritten by revert.\n"
+					  "Please, commit your changes or stash them to proceed."));
+			else
+				die(_("Your local changes would be overwritten by cherry-pick.\n"
+					  "Please, commit your changes or stash them to proceed."));
+		} else {
+			if (action == REVERT)
+				die(_("Your local changes would be overwritten by revert.\n"));
+			else
+				die(_("Your local changes would be overwritten by cherry-pick.\n"));
+		}
 	}
 }
 
diff --git a/t/t3501-revert-cherry-pick.sh b/t/t3501-revert-cherry-pick.sh
index 0439544..753a6c9 100755
--- a/t/t3501-revert-cherry-pick.sh
+++ b/t/t3501-revert-cherry-pick.sh
@@ -91,7 +91,7 @@ test_expect_success 'cherry-pick on stat-dirty working tree' '
 	)
 '
 
-test_expect_success 'revert forbidden on dirty working tree' '
+test_expect_success C_LOCALE_OUTPUT 'revert forbidden on dirty working tree' '
 
 	echo content >extra_file &&
 	git add extra_file &&
-- 
1.7.2.3

^ permalink raw reply related	[flat|nested] 222+ messages in thread

* [PATCH v4 71/73] gettextize: git-revert literal "me" messages
  2011-02-22 18:11     ` Junio C Hamano
                         ` (70 preceding siblings ...)
  2011-02-22 23:42       ` [PATCH v4 70/73] gettextize: git-revert "Your local changes" message Ævar Arnfjörð Bjarmason
@ 2011-02-22 23:42       ` Ævar Arnfjörð Bjarmason
  2011-02-22 23:42       ` [PATCH v4 72/73] gettextize: git-revert split up "could not revert/apply" message Ævar Arnfjörð Bjarmason
  2011-02-22 23:42       ` [PATCH v4 73/73] gettextize: git-shortlog basic messages Ævar Arnfjörð Bjarmason
  73 siblings, 0 replies; 222+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2011-02-22 23:42 UTC (permalink / raw)
  To: git
  Cc: Junio C Hamano, Jakub Narebski, Ævar Arnfjörð Bjarmason

Translate messages that use the `me' variable. These are all error
messages referencing the command name, so the name shouldn't be
translated.

Reported-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
---
 builtin/revert.c |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/builtin/revert.c b/builtin/revert.c
index 02c23c9..b0a5ffb 100644
--- a/builtin/revert.c
+++ b/builtin/revert.c
@@ -362,7 +362,8 @@ static int do_recursive_merge(struct commit *base, struct commit *next,
 	if (active_cache_changed &&
 	    (write_cache(index_fd, active_cache, active_nr) ||
 	     commit_locked_index(&index_lock)))
-		die("%s: Unable to write new index file", me);
+		/* TRANSLATORS: %s will be "revert" or "cherry-pick" */
+		die(_("%s: Unable to write new index file"), me);
 	rollback_lock_file(&index_lock);
 
 	if (!clean) {
@@ -469,7 +470,9 @@ static int do_pick_commit(void)
 		return fast_forward_to(commit->object.sha1, head);
 
 	if (parent && parse_commit(parent) < 0)
-		die("%s: cannot parse parent commit %s",
+		/* TRANSLATORS: The first %s will be "revert" or
+		   "cherry-pick", the second %s a SHA1 */
+		die(_("%s: cannot parse parent commit %s"),
 		    me, sha1_to_hex(parent->object.sha1));
 
 	if (get_message(commit->buffer, &msg) != 0)
-- 
1.7.2.3

^ permalink raw reply related	[flat|nested] 222+ messages in thread

* [PATCH v4 72/73] gettextize: git-revert split up "could not revert/apply" message
  2011-02-22 18:11     ` Junio C Hamano
                         ` (71 preceding siblings ...)
  2011-02-22 23:42       ` [PATCH v4 71/73] gettextize: git-revert literal "me" messages Ævar Arnfjörð Bjarmason
@ 2011-02-22 23:42       ` Ævar Arnfjörð Bjarmason
  2011-02-22 23:42       ` [PATCH v4 73/73] gettextize: git-shortlog basic messages Ævar Arnfjörð Bjarmason
  73 siblings, 0 replies; 222+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2011-02-22 23:42 UTC (permalink / raw)
  To: git
  Cc: Junio C Hamano, Jakub Narebski, Ævar Arnfjörð Bjarmason

Split up the "could not %s %s... %s" message into "could not revert
%s... %s" and "could not apply %s... %s". This makes it easier for
translators to understand the message.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
---
 builtin/revert.c                |    5 +++--
 t/t3507-cherry-pick-conflict.sh |    2 +-
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/builtin/revert.c b/builtin/revert.c
index b0a5ffb..98dfd4d 100644
--- a/builtin/revert.c
+++ b/builtin/revert.c
@@ -536,8 +536,9 @@ static int do_pick_commit(void)
 	}
 
 	if (res) {
-		error("could not %s %s... %s",
-		      action == REVERT ? "revert" : "apply",
+		error(action == REVERT
+		      ? _("could not revert %s... %s")
+		      : _("could not apply %s... %s"),
 		      find_unique_abbrev(commit->object.sha1, DEFAULT_ABBREV),
 		      msg.subject);
 		print_advice();
diff --git a/t/t3507-cherry-pick-conflict.sh b/t/t3507-cherry-pick-conflict.sh
index 607bf25..f7e4072 100755
--- a/t/t3507-cherry-pick-conflict.sh
+++ b/t/t3507-cherry-pick-conflict.sh
@@ -38,7 +38,7 @@ test_expect_success 'failed cherry-pick does not advance HEAD' '
 	test "$head" = "$newhead"
 '
 
-test_expect_success 'advice from failed cherry-pick' "
+test_expect_success C_LOCALE_OUTPUT 'advice from failed cherry-pick' "
 	git checkout -f initial^0 &&
 	git read-tree -u --reset HEAD &&
 	git clean -d -f -f -q -x &&
-- 
1.7.2.3

^ permalink raw reply related	[flat|nested] 222+ messages in thread

* [PATCH v4 73/73] gettextize: git-shortlog basic messages
  2011-02-22 18:11     ` Junio C Hamano
                         ` (72 preceding siblings ...)
  2011-02-22 23:42       ` [PATCH v4 72/73] gettextize: git-revert split up "could not revert/apply" message Ævar Arnfjörð Bjarmason
@ 2011-02-22 23:42       ` Ævar Arnfjörð Bjarmason
  73 siblings, 0 replies; 222+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2011-02-22 23:42 UTC (permalink / raw)
  To: git
  Cc: Junio C Hamano, Jakub Narebski, Ævar Arnfjörð Bjarmason

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
---
 builtin/shortlog.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/builtin/shortlog.c b/builtin/shortlog.c
index 1a21e4b..f5efc67 100644
--- a/builtin/shortlog.c
+++ b/builtin/shortlog.c
@@ -158,7 +158,7 @@ void shortlog_add_commit(struct shortlog *log, struct commit *commit)
 		buffer = eol;
 	}
 	if (!author)
-		die("Missing author: %s",
+		die(_("Missing author: %s"),
 		    sha1_to_hex(commit->object.sha1));
 	if (log->user_format) {
 		struct pretty_print_context ctx = {0};
@@ -181,7 +181,7 @@ static void get_from_rev(struct rev_info *rev, struct shortlog *log)
 	struct commit *commit;
 
 	if (prepare_revision_walk(rev))
-		die("revision walk setup failed");
+		die(_("revision walk setup failed"));
 	while ((commit = get_revision(rev)) != NULL)
 		shortlog_add_commit(log, commit);
 }
@@ -284,7 +284,7 @@ parse_done:
 	argc = parse_options_end(&ctx);
 
 	if (setup_revisions(argc, argv, &rev, NULL) != 1) {
-		error("unrecognized argument: %s", argv[1]);
+		error(_("unrecognized argument: %s"), argv[1]);
 		usage_with_options(shortlog_usage, options);
 	}
 
@@ -296,7 +296,7 @@ parse_done:
 		add_head_to_pending(&rev);
 	if (rev.pending.nr == 0) {
 		if (isatty(0))
-			fprintf(stderr, "(reading log message from standard input)\n");
+			fprintf(stderr, _("(reading log message from standard input)\n"));
 		read_from_stdin(&log);
 	}
 	else
-- 
1.7.2.3

^ permalink raw reply related	[flat|nested] 222+ messages in thread

* Re: [PATCH v4 00/73] No-op gettextize core Git C programs
  2011-02-22 23:41       ` [PATCH v4 00/73] No-op gettextize core Git C programs Ævar Arnfjörð Bjarmason
@ 2011-02-23  0:49         ` Junio C Hamano
  2011-02-23  1:37           ` Junio C Hamano
  0 siblings, 1 reply; 222+ messages in thread
From: Junio C Hamano @ 2011-02-23  0:49 UTC (permalink / raw)
  To: Ævar Arnfjörð Bjarmason; +Cc: git, Jakub Narebski

Ævar Arnfjörð Bjarmason <avarab@gmail.com> writes:

>   * Reverted back to using the "gettextize" patch subjects I
>     originally used. I'm using these consistetly so I can later git
>     log --grep=gettextize: to find them. I'd like to preserve that
>     attributed.

Can we make that shorter, perhaps just "i18n:"?  In this series, your
first three and Jonathan's are oddballs that do not have "gettexize:"
anyway.

Will give it a whirl.  Thanks.

^ permalink raw reply	[flat|nested] 222+ messages in thread

* Re: [PATCH v4 00/73] No-op gettextize core Git C programs
  2011-02-23  0:49         ` Junio C Hamano
@ 2011-02-23  1:37           ` Junio C Hamano
  2011-02-23 18:30             ` Ævar Arnfjörð Bjarmason
  0 siblings, 1 reply; 222+ messages in thread
From: Junio C Hamano @ 2011-02-23  1:37 UTC (permalink / raw)
  To: Ævar Arnfjörð Bjarmason; +Cc: Jonathan Nieder, git

Junio C Hamano <gitster@pobox.com> writes:

> Ævar Arnfjörð Bjarmason <avarab@gmail.com> writes:
>
>>   * Reverted back to using the "gettextize" patch subjects I
>>     originally used. I'm using these consistetly so I can later git
>>     log --grep=gettextize: to find them. I'd like to preserve that
>>     attributed.
>
> Can we make that shorter, perhaps just "i18n:"?  In this series, your
> first three and Jonathan's are oddballs that do not have "gettexize:"
> anyway.
>
> Will give it a whirl.  Thanks.

It was a slightly unpleasant experience to merge this round to 'pu' (after
excluding the earlier round from it, of course), as a few topics in flight
that reorganized existing functions into smaller helpers had to conflict
with this patch.  I tried to be careful but please double check the result,
perhaps with:

    $ git show --first-parent origin/pu

when it is propagated to mirrors.

Thanks.

^ permalink raw reply	[flat|nested] 222+ messages in thread

* Re: [PATCH v4 00/73] No-op gettextize core Git C programs
  2011-02-23  1:37           ` Junio C Hamano
@ 2011-02-23 18:30             ` Ævar Arnfjörð Bjarmason
  0 siblings, 0 replies; 222+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2011-02-23 18:30 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: Jonathan Nieder, git

On Wed, Feb 23, 2011 at 02:37, Junio C Hamano <gitster@pobox.com> wrote:
> Junio C Hamano <gitster@pobox.com> writes:
>
>> Ævar Arnfjörð Bjarmason <avarab@gmail.com> writes:
>>
>>>   * Reverted back to using the "gettextize" patch subjects I
>>>     originally used. I'm using these consistetly so I can later git
>>>     log --grep=gettextize: to find them. I'd like to preserve that
>>>     attributed.
>>
>> Can we make that shorter, perhaps just "i18n:"?  In this series, your
>> first three and Jonathan's are oddballs that do not have "gettexize:"
>> anyway.
>>
>> Will give it a whirl.  Thanks.
>
> It was a slightly unpleasant experience to merge this round to 'pu' (after
> excluding the earlier round from it, of course), as a few topics in flight
> that reorganized existing functions into smaller helpers had to conflict
> with this patch.  I tried to be careful but please double check the result,
> perhaps with:
>
>    $ git show --first-parent origin/pu
>
> when it is propagated to mirrors.

I've gone over the version in pu. It looks good to me.

^ permalink raw reply	[flat|nested] 222+ messages in thread

* Re: [PATCH v4 02/73] gettext tests: add GETTEXT_POISON to simulate unfriendly translator
  2011-02-22 23:41       ` [PATCH v4 02/73] gettext tests: add GETTEXT_POISON to simulate unfriendly translator Ævar Arnfjörð Bjarmason
@ 2011-02-25  7:08         ` Jonathan Nieder
  2011-02-25 17:52           ` Junio C Hamano
  0 siblings, 1 reply; 222+ messages in thread
From: Jonathan Nieder @ 2011-02-25  7:08 UTC (permalink / raw)
  To: Ævar Arnfjörð Bjarmason
  Cc: git, Junio C Hamano, Jakub Narebski

Hi again,

Ævar Arnfjörð Bjarmason wrote:

> Note that the string we're using ("# GETTEXT POISON #") intentionally
> starts the pound sign.

I think I've caused more grief than it's worth complaining about that.
But here's what a fixup (against 77bc5af, i18n: add GETTEXT_POISON to
simulate unfriendly translator, 2011-02-22) would look like, in case
it's wanted.

If this fixup is applied, the last two paragraphs of the change
description (starting with "Note that the string we're using") could
be removed.

Will comment on how later patches in the series would be affected in
separate messages as I apply them.  Patch 1 (i18n: add no-op _() and
N_() wrappers) and patch 2 (gettext_poison) look good to me, for
what it's worth, with or without this fixup.

-- 8< --
Subject: i18n: make the string used by GETTEXT_POISON less meaningful

The idea of the GETTEXT_POISON facility is to simulate a worst-case
translation, so that strings marked for translation that cause trouble
can be noticed and dealt with.

A string starting with "#" does not seem particularly well suited
for that purpose, since it makes '#' characters that mark a comment
and that translators must be careful not to remove harder to find.
Plus it muddles the issue --- is the poisonous string meant to be a
random worst case or not?

The affected strings with a "# " are in wt-status.c, builtin/commit.c,
and builtin/tag.c.  A proof-of-concept patch moving the # signs
outside the translated strings exists and works well.  If we want to
mark those strings for translation without something like that patch,
we can skip the relevant tests or start returning a string starting
with a hash then.

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
---
 gettext.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/gettext.h b/gettext.h
index 11d82b0..361962e 100644
--- a/gettext.h
+++ b/gettext.h
@@ -23,7 +23,7 @@
 
 static inline FORMAT_PRESERVING(1) const char *_(const char *msgid)
 {
-	return use_gettext_poison() ? "# GETTEXT POISON #" : msgid;
+	return use_gettext_poison() ? " GETTEXT POISON " : msgid;
 }
 
 /* Mark msgid for translation but do not translate it. */
-- 
1.7.4.1

^ permalink raw reply related	[flat|nested] 222+ messages in thread

* Re: [PATCH v4 04/73] Makefile: "pot" target to extract messages marked for translation
  2011-02-22 23:41       ` [PATCH v4 04/73] Makefile: "pot" target to extract messages marked for translation Ævar Arnfjörð Bjarmason
@ 2011-02-25  7:22         ` Jonathan Nieder
  2011-02-25 19:53           ` Ævar Arnfjörð Bjarmason
  0 siblings, 1 reply; 222+ messages in thread
From: Jonathan Nieder @ 2011-02-25  7:22 UTC (permalink / raw)
  To: Ævar Arnfjörð Bjarmason
  Cc: git, Junio C Hamano, Jakub Narebski

Ævar Arnfjörð Bjarmason wrote:

> Add rules to generate a template (po/git.pot) listing messages marked
> for translation in the C portion of git.

A forgotten piece.  Not urgent at all.

-- 8< --
Subject: i18n: "make distclean" should clean up after "make pot"

This is in "make distclean" and not "make clean" to avoid needlessly
changing the POT-Creation-Date in the following scenario:

	make clean;	# cleaning up after an old build
	git pull
	make pot;	# regenerate po template if necessary
	msgmerge po/my_language.po po/git.pot

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
---
 Makefile |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/Makefile b/Makefile
index 1cc6c60..7497835 100644
--- a/Makefile
+++ b/Makefile
@@ -2340,6 +2340,7 @@ dist-doc:
 
 distclean: clean
 	$(RM) configure
+	$(RM) po/git.pot
 
 clean:
 	$(RM) *.o block-sha1/*.o ppc/*.o compat/*.o compat/*/*.o xdiff/*.o vcs-svn/*.o \
-- 
1.7.4.1

^ permalink raw reply related	[flat|nested] 222+ messages in thread

* Re: [PATCH v4 18/73] gettextize: git-branch "git branch -v" messages
  2011-02-22 23:41       ` [PATCH v4 18/73] gettextize: git-branch "git branch -v" messages Ævar Arnfjörð Bjarmason
@ 2011-02-25  7:52         ` Jonathan Nieder
  0 siblings, 0 replies; 222+ messages in thread
From: Jonathan Nieder @ 2011-02-25  7:52 UTC (permalink / raw)
  To: Ævar Arnfjörð Bjarmason
  Cc: git, Junio C Hamano, Jakub Narebski

Ævar Arnfjörð Bjarmason wrote:

> This is possibly a plumbing message.

Luckily it is not one.

Everything up to here looks good still.

^ permalink raw reply	[flat|nested] 222+ messages in thread

* Re: [PATCH v4 17/73] gettextize: git-branch "Deleted branch [...]" message
  2011-02-22 23:41       ` [PATCH v4 17/73] gettextize: git-branch "Deleted branch [...]" message Ævar Arnfjörð Bjarmason
@ 2011-02-25  7:54         ` Jonathan Nieder
  2011-02-25 19:58           ` Ævar Arnfjörð Bjarmason
  0 siblings, 1 reply; 222+ messages in thread
From: Jonathan Nieder @ 2011-02-25  7:54 UTC (permalink / raw)
  To: Ævar Arnfjörð Bjarmason
  Cc: git, Junio C Hamano, Jakub Narebski

Ævar Arnfjörð Bjarmason wrote:

> --- a/builtin/branch.c
> +++ b/builtin/branch.c
> @@ -214,7 +214,7 @@ static int delete_branches(int argc, const char **argv, int force, int kinds)
>  			ret = 1;
>  		} else {
>  			struct strbuf buf = STRBUF_INIT;
> -			printf("Deleted %sbranch %s (was %s).\n", remote,
> +			printf(_("Deleted %sbranch %s (was %s).\n"), remote,

This patch might be might easier to read squashed with the previous
one (both for the sake of providing context to reviewers and avoiding
mixed-language output :)).

^ permalink raw reply	[flat|nested] 222+ messages in thread

* Re: [PATCH v4 23/73] gettextize: git-checkout "HEAD is now at" message
  2011-02-22 23:41       ` [PATCH v4 23/73] gettextize: git-checkout "HEAD is now at" message Ævar Arnfjörð Bjarmason
@ 2011-02-25  8:04         ` Jonathan Nieder
  0 siblings, 0 replies; 222+ messages in thread
From: Jonathan Nieder @ 2011-02-25  8:04 UTC (permalink / raw)
  To: Ævar Arnfjörð Bjarmason
  Cc: git, Junio C Hamano, Jakub Narebski

Ævar Arnfjörð Bjarmason wrote:

> --- a/builtin/checkout.c
> +++ b/builtin/checkout.c
> @@ -571,7 +571,7 @@ static void update_refs_for_switch(struct checkout_opts *opts,
>  		if (!opts->quiet) {
>  			if (old->path && advice_detached_head)
>  				detach_advice(old->path, new->name);
> -			describe_detached_head("HEAD is now at", new->commit);
> +			describe_detached_head(_("HEAD is now at"), new->commit);

It might make sense to squash patches 22 and 23 with the following.

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
---
 builtin/checkout.c |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)

diff --git a/builtin/checkout.c b/builtin/checkout.c
index fb93d63..dca0935 100644
--- a/builtin/checkout.c
+++ b/builtin/checkout.c
@@ -305,7 +305,14 @@ static void describe_detached_head(const char *msg, struct commit *commit)
 	struct pretty_print_context ctx = {0};
 	parse_commit(commit);
 	pretty_print_commit(CMIT_FMT_ONELINE, commit, &sb, &ctx);
-	fprintf(stderr, "%s %s... %s\n", msg,
+
+	/*
+	 * TRANSLATORS: The first '%s' is either "Previous HEAD position was"
+	 * or "HEAD is now at".  The second '%s' is an abbreviated hexadecimal
+	 * commit id for HEAD and the third '%s' is the first line of its
+	 * commit message.
+	 */
+	fprintf(stderr, _("%s %s... %s\n"), msg,
 		find_unique_abbrev(commit->object.sha1, DEFAULT_ABBREV), sb.buf);
 	strbuf_release(&sb);
 }
-- 
1.7.4.1

^ permalink raw reply related	[flat|nested] 222+ messages in thread

* Re: [PATCH v4 24/73] gettextize: git-checkout "Switched to a .. branch" message
  2011-02-22 23:41       ` [PATCH v4 24/73] gettextize: git-checkout "Switched to a .. branch" message Ævar Arnfjörð Bjarmason
@ 2011-02-25  8:10         ` Jonathan Nieder
  2011-02-25 19:33           ` Junio C Hamano
  2011-02-25 19:47           ` Ævar Arnfjörð Bjarmason
  0 siblings, 2 replies; 222+ messages in thread
From: Jonathan Nieder @ 2011-02-25  8:10 UTC (permalink / raw)
  To: Ævar Arnfjörð Bjarmason
  Cc: git, Junio C Hamano, Jakub Narebski

Ævar Arnfjörð Bjarmason wrote:

> --- a/builtin/checkout.c
> +++ b/builtin/checkout.c
> @@ -550,9 +550,10 @@ static void update_refs_for_switch(struct checkout_opts *opts,
>  				fprintf(stderr, _("Already on '%s'\n"),
>  					new->name);
>  			else if (opts->new_branch)
> -				fprintf(stderr, "Switched to%s branch '%s'\n",
> -					opts->branch_exists ? " and reset" : " a new",
> -					new->name);
> +				if (opts->branch_exists)
> +					fprintf(stderr, _("Switched to and reset branch '%s'\n"), new->name);
> +				else
> +					fprintf(stderr, _("Switched to a new branch '%s'\n"), new->name);
>  			else

C grammar is on your side, but the following seems worthwhile for
the sanity of readers and those who might modify the code in the
future.
---
 builtin/checkout.c |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/builtin/checkout.c b/builtin/checkout.c
index 92049cb..fc727ce 100644
--- a/builtin/checkout.c
+++ b/builtin/checkout.c
@@ -553,17 +553,18 @@ static void update_refs_for_switch(struct checkout_opts *opts,
 	if (new->path) {
 		create_symref("HEAD", new->path, msg.buf);
 		if (!opts->quiet) {
-			if (old->path && !strcmp(new->path, old->path))
+			if (old->path && !strcmp(new->path, old->path)) {
 				fprintf(stderr, _("Already on '%s'\n"),
 					new->name);
-			else if (opts->new_branch)
+			} else if (opts->new_branch) {
 				if (opts->branch_exists)
 					fprintf(stderr, _("Switched to and reset branch '%s'\n"), new->name);
 				else
 					fprintf(stderr, _("Switched to a new branch '%s'\n"), new->name);
-			else
+			} else {
 				fprintf(stderr, _("Switched to branch '%s'\n"),
 					new->name);
+			}
 		}
 		if (old->path && old->name) {
 			char log_file[PATH_MAX], ref_file[PATH_MAX];
-- 
1.7.4.1

^ permalink raw reply related	[flat|nested] 222+ messages in thread

* [PATCH] commit: error out for missing commit message template
  2011-02-22 23:41       ` [PATCH v4 27/73] gettextize: git-commit formatting messages Ævar Arnfjörð Bjarmason
@ 2011-02-25  9:07         ` Jonathan Nieder
  2011-02-25 20:14           ` Junio C Hamano
  2011-02-25  9:43         ` [PATCH v4 27/73] gettextize: git-commit formatting messages Jonathan Nieder
  1 sibling, 1 reply; 222+ messages in thread
From: Jonathan Nieder @ 2011-02-25  9:07 UTC (permalink / raw)
  To: Ævar Arnfjörð Bjarmason
  Cc: git, Junio C Hamano, Jakub Narebski

When "git commit" was rewritten in C (v1.5.4-rc0~78^2~30,
2007-11-08), a subtle bug in --template was introduced.  If the
file named by a --template parameter is missing, previously git
would error out with a message:

	Commit template file does not exist.

but in the C version the --template parameter gets ignored and
the default template is used.

t7500 has two tests for this case which would have caught it, except
that with the default $EDITOR, the commit message template is left
unmodified, causing 'git commit' to error out and the test to
succeed.

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
---
Ævar Arnfjörð Bjarmason wrote:

> --- a/builtin/commit.c
> +++ b/builtin/commit.c
> @@ -725,15 +725,15 @@ static int prepare_to_commit(const char *index_file, const char *prefix,
[...]
> -				"%s"
> -				"# Author:    %s\n",
> +				_("%s"
> +				"# Author:    %s\n"),

The above change causes the commit message template to be nonempty,
excluding comments, so bare "git commit" succeeds, exposing this
longstanding bug.

 builtin/commit.c  |    2 +-
 t/t7500-commit.sh |   14 +++++++++++---
 2 files changed, 12 insertions(+), 4 deletions(-)

diff --git a/builtin/commit.c b/builtin/commit.c
index d7f55e3..1a1fb73 100644
--- a/builtin/commit.c
+++ b/builtin/commit.c
@@ -634,7 +634,7 @@ static int prepare_to_commit(const char *index_file, const char *prefix,
 		if (strbuf_read_file(&sb, git_path("SQUASH_MSG"), 0) < 0)
 			die_errno("could not read SQUASH_MSG");
 		hook_arg1 = "squash";
-	} else if (template_file && !stat(template_file, &statbuf)) {
+	} else if (template_file) {
 		if (strbuf_read_file(&sb, template_file, 0) < 0)
 			die_errno("could not read '%s'", template_file);
 		hook_arg1 = "template";
diff --git a/t/t7500-commit.sh b/t/t7500-commit.sh
index d551b77..5976f59 100755
--- a/t/t7500-commit.sh
+++ b/t/t7500-commit.sh
@@ -28,13 +28,21 @@ test_expect_success 'a basic commit in an empty tree should succeed' '
 test_expect_success 'nonexistent template file should return error' '
 	echo changes >> foo &&
 	git add foo &&
-	test_must_fail git commit --template "$PWD"/notexist
+	(
+		GIT_EDITOR="echo hello >\"\$1\"" &&
+		export GIT_EDITOR &&
+		test_must_fail git commit --template "$PWD"/notexist
+	)
 '
 
 test_expect_success 'nonexistent template file in config should return error' '
 	git config commit.template "$PWD"/notexist &&
-	test_must_fail git commit &&
-	git config --unset commit.template
+	test_when_finished "git config --unset commit.template" &&
+	(
+		GIT_EDITOR="echo hello >\"\$1\"" &&
+		export GIT_EDITOR &&
+		test_must_fail git commit
+	)
 '
 
 # From now on we'll use a template file that exists.
-- 
1.7.4.1

^ permalink raw reply related	[flat|nested] 222+ messages in thread

* Re: [PATCH v4 27/73] gettextize: git-commit formatting messages
  2011-02-22 23:41       ` [PATCH v4 27/73] gettextize: git-commit formatting messages Ævar Arnfjörð Bjarmason
  2011-02-25  9:07         ` [PATCH] commit: error out for missing commit message template Jonathan Nieder
@ 2011-02-25  9:43         ` Jonathan Nieder
  2011-02-25 18:46           ` Junio C Hamano
  1 sibling, 1 reply; 222+ messages in thread
From: Jonathan Nieder @ 2011-02-25  9:43 UTC (permalink / raw)
  To: Ævar Arnfjörð Bjarmason
  Cc: git, Junio C Hamano, Jakub Narebski

Ævar Arnfjörð Bjarmason wrote:

> --- a/builtin/commit.c
> +++ b/builtin/commit.c
> @@ -696,12 +696,12 @@ static int prepare_to_commit(const char *index_file, const char *prefix,
>  		char *ai_tmp, *ci_tmp;
>  		if (in_merge)
>  			fprintf(fp,
> -				"#\n"
> +				_("#\n"
[...]

(Everything up to and including patch 26 still looks good.)

Here's a weatherballoon patch to mark the tests affected by patch 27
as "expect failure", in case we want to go that route.  Combined with
"commit: error out for missing commit message template", it passes all
tests.

-- 8< --
Subject: i18n: update expected test results for git-commit formatting messages

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
---
 t/lib-commit-template.sh           |   19 ++++++++
 t/t3404-rebase-interactive.sh      |    3 +-
 t/t4013-diff-various.sh            |   82 +++++++++++++++++++++++-------------
 t/t7500-commit.sh                  |   19 ++++----
 t/t7501-commit.sh                  |    9 ++--
 t/t7505-prepare-commit-msg-hook.sh |    7 ++-
 t/t7507-commit-verbose.sh          |    5 +-
 t/t7509-commit.sh                  |    3 +-
 8 files changed, 97 insertions(+), 50 deletions(-)
 create mode 100644 t/lib-commit-template.sh

diff --git a/t/lib-commit-template.sh b/t/lib-commit-template.sh
new file mode 100644
index 0000000..80ec50c
--- /dev/null
+++ b/t/lib-commit-template.sh
@@ -0,0 +1,19 @@
+#!/bin/sh
+
+# Messages such as
+#
+#      # It looks like you may be committing a MERGE.\n"
+#
+# are now translatable, even though the "# " part probably ought not
+# to be.  Expect some tests to fail when GETTEXT_POISON is enabled.
+
+if test_have_prereq C_LOCALE_OUTPUT
+then
+	test_log_messages_expect_success () {
+		test_expect_success "$@"
+	}
+else
+	test_log_messages_expect_success () {
+		test_expect_failure "$@"
+	}
+fi
diff --git a/t/t3404-rebase-interactive.sh b/t/t3404-rebase-interactive.sh
index 7d8147b..84630e3 100755
--- a/t/t3404-rebase-interactive.sh
+++ b/t/t3404-rebase-interactive.sh
@@ -28,6 +28,7 @@ Initial setup:
 . ./test-lib.sh
 
 . "$TEST_DIRECTORY"/lib-rebase.sh
+. "$TEST_DIRECTORY"/lib-commit-template.sh
 
 test_cmp_rev () {
 	git rev-parse --verify "$1" >expect.rev &&
@@ -390,7 +391,7 @@ D
 ONCE
 EOF
 
-test_expect_success 'squash and fixup generate correct log messages' '
+test_log_messages_expect_success 'squash and fixup generate correct log messages' '
 	git checkout -b squash-fixup E &&
 	base=$(git rev-parse HEAD~4) &&
 	FAKE_COMMIT_AMEND="ONCE" FAKE_LINES="1 fixup 2 squash 3 fixup 4" \
diff --git a/t/t4013-diff-various.sh b/t/t4013-diff-various.sh
index b8f81d0..872c37c 100755
--- a/t/t4013-diff-various.sh
+++ b/t/t4013-diff-various.sh
@@ -6,6 +6,7 @@
 test_description='Various diff formatting options'
 
 . ./test-lib.sh
+. "$TEST_DIRECTORY"/lib-commit-template.sh
 
 LF='
 '
@@ -95,35 +96,42 @@ test_expect_success setup '
 EOF
 
 V=`git version | sed -e 's/^git version //' -e 's/\./\\./g'`
-while read cmd
-do
-	case "$cmd" in
-	'' | '#'*) continue ;;
-	esac
-	test=`echo "$cmd" | sed -e 's|[/ ][/ ]*|_|g'`
-	pfx=`printf "%04d" $test_count`
-	expect="$TEST_DIRECTORY/t4013/diff.$test"
-	actual="$pfx-diff.$test"
 
-	test_expect_success "git $cmd" '
-		{
-			echo "\$ git $cmd"
-			git $cmd |
-			sed -e "s/^\\(-*\\)$V\\(-*\\)\$/\\1g-i-t--v-e-r-s-i-o-n\2/" \
-			    -e "s/^\\(.*mixed; boundary=\"-*\\)$V\\(-*\\)\"\$/\\1g-i-t--v-e-r-s-i-o-n\2\"/"
-			echo "\$"
-		} >"$actual" &&
-		if test -f "$expect"
-		then
-			test_cmp "$expect" "$actual" &&
-			rm -f "$actual"
-		else
-			# this is to help developing new tests.
-			cp "$actual" "$expect"
-			false
-		fi
-	'
-done <<\EOF
+try_cmds () {
+	test_expect_expectation=${1:-test_expect_success}
+
+	while read cmd
+	do
+		case "$cmd" in
+		'' | '#'*) continue ;;
+		esac
+		test=`echo "$cmd" | sed -e 's|[/ ][/ ]*|_|g'`
+		pfx=`printf "%04d" $test_count`
+		expect="$TEST_DIRECTORY/t4013/diff.$test"
+		actual="$pfx-diff.$test"
+
+		$test_expect_expectation "git $cmd" '
+			{
+				echo "\$ git $cmd"
+				git $cmd |
+				sed -e "s/^\\(-*\\)$V\\(-*\\)\$/\\1g-i-t--v-e-r-s-i-o-n\2/" \
+				    -e "s/^\\(.*mixed; boundary=\"-*\\)$V\\(-*\\)\"\$/\\1g-i-t--v-e-r-s-i-o-n\2\"/"
+				echo "\$"
+			} >"$actual" &&
+			if test -f "$expect"
+			then
+				test_cmp "$expect" "$actual" &&
+				rm -f "$actual"
+			else
+				# this is to help developing new tests.
+				cp "$actual" "$expect"
+				false
+			fi
+		'
+	done
+}
+
+try_cmds <<\EOF
 diff-tree initial
 diff-tree -r initial
 diff-tree -r --abbrev initial
@@ -174,25 +182,33 @@ diff-tree --pretty --patch-with-stat side
 
 diff-tree master
 diff-tree -p master
+EOF
+try_cmds test_log_messages_expect_success <<\EOF
 diff-tree -p -m master
 diff-tree -c master
 diff-tree -c --abbrev master
-diff-tree --cc master
 # stat only should show the diffstat with the first parent
 diff-tree -c --stat master
 diff-tree --cc --stat master
 diff-tree -c --stat --summary master
 diff-tree --cc --stat --summary master
+EOF
+try_cmds <<\EOF
 # stat summary should show the diffstat and summary with the first parent
 diff-tree -c --stat --summary side
 diff-tree --cc --stat --summary side
+EOF
+try_cmds test_log_messages_expect_success <<\EOF
 # improved by Timo's patch
 diff-tree --cc --patch-with-stat master
 # improved by Timo's patch
 diff-tree --cc --patch-with-stat --summary master
+EOF
+try_cmds <<\EOF
 # this is correct
 diff-tree --cc --patch-with-stat --summary side
-
+EOF
+try_cmds test_log_messages_expect_success <<\EOF
 log master
 log -p master
 log --root master
@@ -237,14 +253,20 @@ log --patch-with-stat master -- dir/
 whatchanged --patch-with-stat master -- dir/
 log --patch-with-stat --summary master -- dir/
 whatchanged --patch-with-stat --summary master -- dir/
+EOF
+try_cmds <<\EOF
 
 show initial
 show --root initial
 show side
+EOF
+try_cmds test_log_messages_expect_success <<\EOF
 show master
 show -c master
 show -m master
 show --first-parent master
+EOF
+try_cmds <<\EOF
 show --stat side
 show --stat --summary side
 show --patch-with-stat side
diff --git a/t/t7500-commit.sh b/t/t7500-commit.sh
index 5976f59..614d31b 100755
--- a/t/t7500-commit.sh
+++ b/t/t7500-commit.sh
@@ -8,6 +8,7 @@ test_description='git commit
 Tests for selected commit options.'
 
 . ./test-lib.sh
+. "$TEST_DIRECTORY/lib-commit-template.sh"
 
 commit_msg_is () {
 	expect=commit_msg_is.expect
@@ -48,7 +49,7 @@ test_expect_success 'nonexistent template file in config should return error' '
 # From now on we'll use a template file that exists.
 TEMPLATE="$PWD"/template
 
-test_expect_success 'unedited template should not commit' '
+test_log_messages_expect_success 'unedited template should not commit' '
 	echo "template line" > "$TEMPLATE" &&
 	test_must_fail git commit --template "$TEMPLATE"
 '
@@ -72,7 +73,7 @@ test_expect_success 'adding comments to a template should not commit' '
 	)
 '
 
-test_expect_success 'adding real content to a template should commit' '
+test_log_messages_expect_success 'adding real content to a template should commit' '
 	(
 		test_set_editor "$TEST_DIRECTORY"/t7500/add-content &&
 		git commit --template "$TEMPLATE"
@@ -80,7 +81,7 @@ test_expect_success 'adding real content to a template should commit' '
 	commit_msg_is "template linecommit message"
 '
 
-test_expect_success '-t option should be short for --template' '
+test_log_messages_expect_success '-t option should be short for --template' '
 	echo "short template" > "$TEMPLATE" &&
 	echo "new content" >> foo &&
 	git add foo &&
@@ -91,7 +92,7 @@ test_expect_success '-t option should be short for --template' '
 	commit_msg_is "short templatecommit message"
 '
 
-test_expect_success 'config-specified template should commit' '
+test_log_messages_expect_success 'config-specified template should commit' '
 	echo "new template" > "$TEMPLATE" &&
 	git config commit.template "$TEMPLATE" &&
 	echo "more content" >> foo &&
@@ -206,7 +207,7 @@ test_expect_success 'commit -F overrides -t' '
 	commit_msg_is "-F log"
 '
 
-test_expect_success 'Commit without message is allowed with --allow-empty-message' '
+test_log_messages_expect_success 'Commit without message is allowed with --allow-empty-message' '
 	echo "more content" >>foo &&
 	git add foo &&
 	>empty &&
@@ -214,7 +215,7 @@ test_expect_success 'Commit without message is allowed with --allow-empty-messag
 	commit_msg_is ""
 '
 
-test_expect_success 'Commit without message is no-no without --allow-empty-message' '
+test_log_messages_expect_success 'Commit without message is no-no without --allow-empty-message' '
 	echo "more content" >>foo &&
 	git add foo &&
 	>empty &&
@@ -270,7 +271,7 @@ test_expect_success 'commit --squash works with -C' '
 	commit_msg_is "squash! target message subject lineintermediate commit"
 '
 
-test_expect_success 'commit --squash works with -c' '
+test_log_messages_expect_success 'commit --squash works with -c' '
 	commit_for_rebase_autosquash_setup &&
 	test_set_editor "$TEST_DIRECTORY"/t7500/edit-content &&
 	git commit --squash HEAD~1 -c HEAD &&
@@ -283,14 +284,14 @@ test_expect_success 'commit --squash works with -C for same commit' '
 	commit_msg_is "squash! intermediate commit"
 '
 
-test_expect_success 'commit --squash works with -c for same commit' '
+test_log_messages_expect_success 'commit --squash works with -c for same commit' '
 	commit_for_rebase_autosquash_setup &&
 	test_set_editor "$TEST_DIRECTORY"/t7500/edit-content &&
 	git commit --squash HEAD -c HEAD &&
 	commit_msg_is "squash! edited commit"
 '
 
-test_expect_success 'commit --squash works with editor' '
+test_log_messages_expect_success 'commit --squash works with editor' '
 	commit_for_rebase_autosquash_setup &&
 	test_set_editor "$TEST_DIRECTORY"/t7500/add-content &&
 	git commit --squash HEAD~1 &&
diff --git a/t/t7501-commit.sh b/t/t7501-commit.sh
index 8980738..af6a829 100755
--- a/t/t7501-commit.sh
+++ b/t/t7501-commit.sh
@@ -8,6 +8,7 @@
 
 test_description='git commit'
 . ./test-lib.sh
+. "$TEST_DIRECTORY"/lib-commit-template.sh
 
 test_tick
 
@@ -163,7 +164,7 @@ d381ac431806e53f3dd7ac2f1ae0534f36d738b9
 402702b49136e7587daa9280e91e4bb7cb2179f7
 EOF
 
-test_expect_success \
+test_log_messages_expect_success \
     'validate git rev-list output.' \
     'test_cmp expected current'
 
@@ -200,7 +201,7 @@ test_expect_success 'partial commit that involves removal (3)' '
 '
 
 author="The Real Author <someguy@his.email.org>"
-test_expect_success 'amend commit to fix author' '
+test_log_messages_expect_success 'amend commit to fix author' '
 
 	oldtick=$GIT_AUTHOR_DATE &&
 	test_tick &&
@@ -215,7 +216,7 @@ test_expect_success 'amend commit to fix author' '
 
 '
 
-test_expect_success 'amend commit to fix date' '
+test_log_messages_expect_success 'amend commit to fix date' '
 
 	test_tick &&
 	newtick=$GIT_AUTHOR_DATE &&
@@ -329,7 +330,7 @@ test_expect_success 'multiple -m' '
 '
 
 author="The Real Author <someguy@his.email.org>"
-test_expect_success 'amend commit to fix author' '
+test_log_messages_expect_success 'amend commit to fix author' '
 
 	oldtick=$GIT_AUTHOR_DATE &&
 	test_tick &&
diff --git a/t/t7505-prepare-commit-msg-hook.sh b/t/t7505-prepare-commit-msg-hook.sh
index ff18962..2d7ec32 100755
--- a/t/t7505-prepare-commit-msg-hook.sh
+++ b/t/t7505-prepare-commit-msg-hook.sh
@@ -3,6 +3,7 @@
 test_description='prepare-commit-msg hook'
 
 . ./test-lib.sh
+. "$TEST_DIRECTORY"/lib-commit-template.sh
 
 test_expect_success 'with no hook' '
 
@@ -103,7 +104,7 @@ test_expect_success 'with hook (-C)' '
 
 '
 
-test_expect_success 'with hook (editor)' '
+test_log_messages_expect_success 'with hook (editor)' '
 
 	echo "more more" >> file &&
 	git add file &&
@@ -112,7 +113,7 @@ test_expect_success 'with hook (editor)' '
 
 '
 
-test_expect_success 'with hook (--amend)' '
+test_log_messages_expect_success 'with hook (--amend)' '
 
 	head=`git rev-parse HEAD` &&
 	echo "more" >> file &&
@@ -122,7 +123,7 @@ test_expect_success 'with hook (--amend)' '
 
 '
 
-test_expect_success 'with hook (-c)' '
+test_log_messages_expect_success 'with hook (-c)' '
 
 	head=`git rev-parse HEAD` &&
 	echo "more" >> file &&
diff --git a/t/t7507-commit-verbose.sh b/t/t7507-commit-verbose.sh
index da5bd3b..62c42b3 100755
--- a/t/t7507-commit-verbose.sh
+++ b/t/t7507-commit-verbose.sh
@@ -2,6 +2,7 @@
 
 test_description='verbose commit template'
 . ./test-lib.sh
+. "$TEST_DIRECTORY"/lib-commit-template.sh
 
 cat >check-for-diff <<EOF
 #!$SHELL_PATH
@@ -37,12 +38,12 @@ check_message() {
 	test_cmp "$1" actual
 }
 
-test_expect_success 'verbose diff is stripped out' '
+test_log_messages_expect_success 'verbose diff is stripped out' '
 	git commit --amend -v &&
 	check_message message
 '
 
-test_expect_success 'verbose diff is stripped out (mnemonicprefix)' '
+test_log_messages_expect_success 'verbose diff is stripped out (mnemonicprefix)' '
 	git config diff.mnemonicprefix true &&
 	git commit --amend -v &&
 	check_message message
diff --git a/t/t7509-commit.sh b/t/t7509-commit.sh
index 77b6920..2820b89 100755
--- a/t/t7509-commit.sh
+++ b/t/t7509-commit.sh
@@ -6,6 +6,7 @@
 test_description='git commit --reset-author'
 
 . ./test-lib.sh
+. "$TEST_DIRECTORY"/lib-commit-template.sh
 
 author_header () {
 	git cat-file commit "$1" |
@@ -57,7 +58,7 @@ test_expect_success '-c option copies authorship and message' '
 	test_cmp expect actual
 '
 
-test_expect_success '-c option copies only the message with --reset-author' '
+test_log_messages_expect_success '-c option copies only the message with --reset-author' '
 	echo "Test 4" >>foo &&
 	test_tick &&
 	EDITOR=: VISUAL=: git commit -a -c Initial --reset-author &&
-- 
1.7.4.1

^ permalink raw reply related	[flat|nested] 222+ messages in thread

* Re: [PATCH v4 02/73] gettext tests: add GETTEXT_POISON to simulate unfriendly translator
  2011-02-25  7:08         ` Jonathan Nieder
@ 2011-02-25 17:52           ` Junio C Hamano
  2011-02-25 19:50             ` Ævar Arnfjörð Bjarmason
  0 siblings, 1 reply; 222+ messages in thread
From: Junio C Hamano @ 2011-02-25 17:52 UTC (permalink / raw)
  To: Jonathan Nieder
  Cc: Ævar Arnfjörð Bjarmason, git, Jakub Narebski

Jonathan Nieder <jrnieder@gmail.com> writes:

[offtopic: why is Jakub on the CC list? -- I don't recall him saying much
on this topic yet...]

> The idea of the GETTEXT_POISON facility is to simulate a worst-case
> translation, so that strings marked for translation that cause trouble
> can be noticed and dealt with.

I've never thought this was about a "worst-case translation".

Isn't this about emitting all the strings marked for translation in a form
significantly different from the original, in the hope that such an output
would help us find messages that should never be marked for translation by
triggering test failures?  I do not see any "worst-case", just different
enough for the plumbing tests to break.

IOW, I don't think this is about helping translators in l10n, but about
helping coders in i18n department.

> A string starting with "#" does not seem particularly well suited
> for that purpose, since it makes '#' characters that mark a comment
> and that translators must be careful not to remove harder to find.

Hence, I would suggest an alternative phrasing of the above part (and
alternative way of thinking): '... since it easily hides a mistaken
marking of a line that _has_ to always start with "#" followed by a
translatable string.'

^ permalink raw reply	[flat|nested] 222+ messages in thread

* Re: [PATCH v4 27/73] gettextize: git-commit formatting messages
  2011-02-25  9:43         ` [PATCH v4 27/73] gettextize: git-commit formatting messages Jonathan Nieder
@ 2011-02-25 18:46           ` Junio C Hamano
  2011-02-25 20:01             ` Ævar Arnfjörð Bjarmason
  2011-02-25 21:35             ` Jonathan Nieder
  0 siblings, 2 replies; 222+ messages in thread
From: Junio C Hamano @ 2011-02-25 18:46 UTC (permalink / raw)
  To: Jonathan Nieder
  Cc: Ævar Arnfjörð Bjarmason, git, Jakub Narebski

Jonathan Nieder <jrnieder@gmail.com> writes:

> diff --git a/t/lib-commit-template.sh b/t/lib-commit-template.sh
> new file mode 100644
> index 0000000..80ec50c
> --- /dev/null
> +++ b/t/lib-commit-template.sh
> @@ -0,0 +1,19 @@
> +#!/bin/sh
> +
> +# Messages such as
> +#
> +#      # It looks like you may be committing a MERGE.\n"
> +#
> +# are now translatable, even though the "# " part probably ought not
> +# to be.  Expect some tests to fail when GETTEXT_POISON is enabled.

We shouldn't mark "# " part as translatable to begin with.  Perhaps the
underlying code in wt-status.c needs to be changed even before we merge
the i18n _() patches to make it easier?

It might be a good idea to introduce status_print{,_ln,_more} wrapper
functions around color_vfprintf(), and change the existing callers to look
like this:

                const char *c = color(WT_STATUS_HEADER, s);

        -       color_fprintf_ln(s->fp, c, "# Unmerged paths:");
        +       status_printf_ln(s, c, "Unmerged paths:");
                if (!advice_status_hints)
                        return;
                if (s->in_merge)
                        ;
        ...

        -       color_fprintf(s->fp, color(WT_STATUS_HEADER, s), "#\t");
        +       status_printf(s, color(WT_STATUS_HEADER, s), "\t");
                switch (status) {
                case DIFF_STATUS_ADDED:
        -               color_fprintf(s->fp, c, "new file:   %s", one);
        +               status_printf_more(s, c, "new file:   %s", one);
                        break;

Possible semantics for the three wrappers are:

 * status_printf_ln() takes all the parameters necessary to produce a
   single line; it works just like color_fprintf_ln() but adds the "# "
   prefix itself.

 * status_printf_more() is just a synonym for color_fprintf_ln() in the
   above but is not necessary.

 * status_printf() would be like color_printf() but adds the "# " prefix
   itself.

I am Ok with naming "status-printf-more" to just "status-printf" and
renaming "status-printf" to "status-printf-bol", as long as we have two
functions, one that adds "# " and the other that does not.

The adding of "# " done by status_printf() and status_printf_ln() can and
probably should have a bit of twist to adjust to the _real_ contents that
are fed to them.

Ideally, status_printf_ln(s, color, "") should omit the trailing SP and
give "<COLOR>#</COLOR>\n", and status_printf(s, color, "\t") should should
give "<COLOR>#\t</COLOR>" to avoid SP-HT.

Doing this would have two advantages over the current code:

 - The obvious one is to force separation of the "#" from the translatable
   part of the message, which is the topic of this thread.

 - Another advantage is that this makes it easier for us to drop "#"
   prefix in "git status" output in later versions of git if we wanted to.

In "git commit" template, these lines need to be made into comments, but
there is no reason, other than that we are sooooo used to seeing these
lines prefixed with "# ", in "git status" output.

^ permalink raw reply	[flat|nested] 222+ messages in thread

* Re: [PATCH v4 24/73] gettextize: git-checkout "Switched to a .. branch" message
  2011-02-25  8:10         ` Jonathan Nieder
@ 2011-02-25 19:33           ` Junio C Hamano
  2011-02-25 19:47           ` Ævar Arnfjörð Bjarmason
  1 sibling, 0 replies; 222+ messages in thread
From: Junio C Hamano @ 2011-02-25 19:33 UTC (permalink / raw)
  To: Jonathan Nieder
  Cc: Ævar Arnfjörð Bjarmason, git, Jakub Narebski

Jonathan Nieder <jrnieder@gmail.com> writes:

> C grammar is on your side, but the following seems worthwhile for
> the sanity of readers and those who might modify the code in the
> future.

Good point.  Thanks.

^ permalink raw reply	[flat|nested] 222+ messages in thread

* Re: [PATCH v4 24/73] gettextize: git-checkout "Switched to a .. branch" message
  2011-02-25  8:10         ` Jonathan Nieder
  2011-02-25 19:33           ` Junio C Hamano
@ 2011-02-25 19:47           ` Ævar Arnfjörð Bjarmason
  2011-02-25 19:56             ` Junio C Hamano
  1 sibling, 1 reply; 222+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2011-02-25 19:47 UTC (permalink / raw)
  To: Jonathan Nieder; +Cc: git, Junio C Hamano, Jakub Narebski

On Fri, Feb 25, 2011 at 09:10, Jonathan Nieder <jrnieder@gmail.com> wrote:

> C grammar is on your side, but the following seems worthwhile for
> the sanity of readers and those who might modify the code in the
> future.

Agreed, and IIRC GCC and others will warn about nested if's without
{}, even if they're unambiguous[1].

1. IIRC GCC will warn about them being "ambiguous", but they're not
   according to the standard. I think some GCC programmer confused
   "ambiguous" and "potentially misleading".

^ permalink raw reply	[flat|nested] 222+ messages in thread

* Re: [PATCH v4 02/73] gettext tests: add GETTEXT_POISON to simulate unfriendly translator
  2011-02-25 17:52           ` Junio C Hamano
@ 2011-02-25 19:50             ` Ævar Arnfjörð Bjarmason
  0 siblings, 0 replies; 222+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2011-02-25 19:50 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: Jonathan Nieder, git, Jakub Narebski

On Fri, Feb 25, 2011 at 18:52, Junio C Hamano <gitster@pobox.com> wrote:
> Jonathan Nieder <jrnieder@gmail.com> writes:
>
> [offtopic: why is Jakub on the CC list? -- I don't recall him saying much
> on this topic yet...]

I see that I screwed up my J-completion. I meant to include Jonathan,
not Jakub. Oops. Sorry for the spam Jakub.

>> The idea of the GETTEXT_POISON facility is to simulate a worst-case
>> translation, so that strings marked for translation that cause trouble
>> can be noticed and dealt with.
>
> I've never thought this was about a "worst-case translation".
>
> Isn't this about emitting all the strings marked for translation in a form
> significantly different from the original, in the hope that such an output
> would help us find messages that should never be marked for translation by
> triggering test failures?  I do not see any "worst-case", just different
> enough for the plumbing tests to break.
>
> IOW, I don't think this is about helping translators in l10n, but about
> helping coders in i18n department.

Yes, exactly.

^ permalink raw reply	[flat|nested] 222+ messages in thread

* Re: [PATCH v4 04/73] Makefile: "pot" target to extract messages marked for translation
  2011-02-25  7:22         ` Jonathan Nieder
@ 2011-02-25 19:53           ` Ævar Arnfjörð Bjarmason
  2011-02-25 21:20             ` Jonathan Nieder
  0 siblings, 1 reply; 222+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2011-02-25 19:53 UTC (permalink / raw)
  To: Jonathan Nieder; +Cc: git, Junio C Hamano, Jakub Narebski

On Fri, Feb 25, 2011 at 08:22, Jonathan Nieder <jrnieder@gmail.com> wrote:

> A forgotten piece.  Not urgent at all.

Yeah, noticed this. Meant to sent a fixup for it. Thanks for beating
me to it.

There's also one other (future) issue your `mv $i+ $i` trick confuses
xgettext, which complains about invalid CHARSET in a later patch when
there's more than one xgettext call. I.e. it doesn't like to append to
files that don't end in *.pot for some reason.

The output is still the same though, so the warning doesn't have any
real effect.

Just thought I'd mention it.

^ permalink raw reply	[flat|nested] 222+ messages in thread

* Re: [PATCH v4 24/73] gettextize: git-checkout "Switched to a .. branch" message
  2011-02-25 19:47           ` Ævar Arnfjörð Bjarmason
@ 2011-02-25 19:56             ` Junio C Hamano
  2011-02-26 10:01               ` Junio C Hamano
  0 siblings, 1 reply; 222+ messages in thread
From: Junio C Hamano @ 2011-02-25 19:56 UTC (permalink / raw)
  To: Ævar Arnfjörð Bjarmason
  Cc: Jonathan Nieder, git, Jakub Narebski

I've locally amended this, and inserted the distclean-pot, in the series,
so no need to resend only for these two.

If you are re-rolling the series, please don't forget to include them, as
I'd be wholesale replacing in that case.

Thanks.

^ permalink raw reply	[flat|nested] 222+ messages in thread

* Re: [PATCH v4 17/73] gettextize: git-branch "Deleted branch [...]" message
  2011-02-25  7:54         ` Jonathan Nieder
@ 2011-02-25 19:58           ` Ævar Arnfjörð Bjarmason
  2011-02-25 21:16             ` Jonathan Nieder
  0 siblings, 1 reply; 222+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2011-02-25 19:58 UTC (permalink / raw)
  To: Jonathan Nieder; +Cc: git, Junio C Hamano, Jakub Narebski

On Fri, Feb 25, 2011 at 08:54, Jonathan Nieder <jrnieder@gmail.com> wrote:
> Ævar Arnfjörð Bjarmason wrote:
>
>> --- a/builtin/branch.c
>> +++ b/builtin/branch.c
>> @@ -214,7 +214,7 @@ static int delete_branches(int argc, const char **argv, int force, int kinds)
>>                       ret = 1;
>>               } else {
>>                       struct strbuf buf = STRBUF_INIT;
>> -                     printf("Deleted %sbranch %s (was %s).\n", remote,
>> +                     printf(_("Deleted %sbranch %s (was %s).\n"), remote,
>
> This patch might be might easier to read squashed with the previous
> one (both for the sake of providing context to reviewers and avoiding
> mixed-language output :)).

I split it up from the rest because I always tried to group
translations with the tests they broke, and only the tests they broke
and vice versa.

It was often a lot of work figuring out what translation broke what
tests. IIRC splitting this all took me around half a day at the time.

So while it's easy to find out what message is the relevant one in
this case, this is an attribute of the series I'd really like to keep
for future bookkeeping. It's nice to be able to annotate a line in the
test suite and see a patch that changes *just* that message and
related tests, not a lot of other unrelated messages.

^ permalink raw reply	[flat|nested] 222+ messages in thread

* Re: [PATCH v4 27/73] gettextize: git-commit formatting messages
  2011-02-25 18:46           ` Junio C Hamano
@ 2011-02-25 20:01             ` Ævar Arnfjörð Bjarmason
  2011-02-25 21:35             ` Jonathan Nieder
  1 sibling, 0 replies; 222+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2011-02-25 20:01 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: Jonathan Nieder, git, Jakub Narebski

On Fri, Feb 25, 2011 at 19:46, Junio C Hamano <gitster@pobox.com> wrote:
> Jonathan Nieder <jrnieder@gmail.com> writes:
>
>> diff --git a/t/lib-commit-template.sh b/t/lib-commit-template.sh
>> new file mode 100644
>> index 0000000..80ec50c
>> --- /dev/null
>> +++ b/t/lib-commit-template.sh
>> @@ -0,0 +1,19 @@
>> +#!/bin/sh
>> +
>> +# Messages such as
>> +#
>> +#      # It looks like you may be committing a MERGE.\n"
>> +#
>> +# are now translatable, even though the "# " part probably ought not
>> +# to be.  Expect some tests to fail when GETTEXT_POISON is enabled.
>
> We shouldn't mark "# " part as translatable to begin with.  Perhaps the
> underlying code in wt-status.c needs to be changed even before we merge
> the i18n _() patches to make it easier?

Agreed, and Jonathan already implemented this:

    https://github.com/avar/git/commit/394a9d1
    https://github.com/avar/git/commit/da15d84

Perhaps it would be better to modify that patch so it goes in ahead of
the i18n series. It would simplify this going back and forth within
i18n itself.

^ permalink raw reply	[flat|nested] 222+ messages in thread

* Re: [PATCH] commit: error out for missing commit message template
  2011-02-25  9:07         ` [PATCH] commit: error out for missing commit message template Jonathan Nieder
@ 2011-02-25 20:14           ` Junio C Hamano
  0 siblings, 0 replies; 222+ messages in thread
From: Junio C Hamano @ 2011-02-25 20:14 UTC (permalink / raw)
  To: Jonathan Nieder
  Cc: Ævar Arnfjörð Bjarmason, git, Junio C Hamano,
	Jakub Narebski

Jonathan Nieder <jrnieder@gmail.com> writes:

>> --- a/builtin/commit.c
>> +++ b/builtin/commit.c
>> @@ -725,15 +725,15 @@ static int prepare_to_commit(const char *index_file, const char *prefix,
> [...]
>> -				"%s"
>> -				"# Author:    %s\n",
>> +				_("%s"
>> +				"# Author:    %s\n"),
>
> The above change causes the commit message template to be nonempty,
> excluding comments, so bare "git commit" succeeds, exposing this
> longstanding bug.

Thanks; using "#" at the beginning of poison message sometimes has its
uses ;-)

Will queue.

^ permalink raw reply	[flat|nested] 222+ messages in thread

* Re: [PATCH v4 17/73] gettextize: git-branch "Deleted branch [...]" message
  2011-02-25 19:58           ` Ævar Arnfjörð Bjarmason
@ 2011-02-25 21:16             ` Jonathan Nieder
  0 siblings, 0 replies; 222+ messages in thread
From: Jonathan Nieder @ 2011-02-25 21:16 UTC (permalink / raw)
  To: Ævar Arnfjörð Bjarmason; +Cc: git, Junio C Hamano

(-cc: Jakub)

Ævar Arnfjörð Bjarmason wrote:

> I split it up from the rest because I always tried to group
> translations with the tests they broke, and only the tests they broke
> and vice versa.
>
> It was often a lot of work figuring out what translation broke what
> tests. IIRC splitting this all took me around half a day at the time.
>
> So while it's easy to find out what message is the relevant one in
> this case, this is an attribute of the series I'd really like to keep
> for future bookkeeping. It's nice to be able to annotate a line in the
> test suite and see a patch that changes *just* that message and
> related tests, not a lot of other unrelated messages.

Makes sense, and thanks for doing that.  It is nice to see the mass of
messages for each command that don't produce complications separate
from the harder ones.

Cheers,
Jonathan

^ permalink raw reply	[flat|nested] 222+ messages in thread

* Re: [PATCH v4 04/73] Makefile: "pot" target to extract messages marked for translation
  2011-02-25 19:53           ` Ævar Arnfjörð Bjarmason
@ 2011-02-25 21:20             ` Jonathan Nieder
  2011-02-25 21:36               ` Junio C Hamano
  0 siblings, 1 reply; 222+ messages in thread
From: Jonathan Nieder @ 2011-02-25 21:20 UTC (permalink / raw)
  To: Ævar Arnfjörð Bjarmason; +Cc: git, Junio C Hamano

(-cc: Jakub)
Ævar Arnfjörð Bjarmason wrote:

> There's also one other (future) issue your `mv $i+ $i` trick confuses
> xgettext, which complains about invalid CHARSET in a later patch when
> there's more than one xgettext call. I.e. it doesn't like to append to
> files that don't end in *.pot for some reason.

Hmm, I had been wondering where that message came from.  Maybe the
following would help?

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
---
 Makefile      |    4 ++--
 po/.gitignore |    2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/Makefile b/Makefile
index 7497835..781af23 100644
--- a/Makefile
+++ b/Makefile
@@ -2068,8 +2068,8 @@ XGETTEXT_FLAGS_C = $(XGETTEXT_FLAGS) --keyword=_ --keyword=N_ --language=C
 LOCALIZED_C := $(C_OBJ:o=c)
 
 po/git.pot: $(LOCALIZED_C)
-	$(QUIET_XGETTEXT)$(XGETTEXT) -o$@+ $(XGETTEXT_FLAGS_C) $(LOCALIZED_C) && \
-	mv $@+ $@
+	$(QUIET_XGETTEXT)$(XGETTEXT) -ogit-tmp.pot $(XGETTEXT_FLAGS_C) $(LOCALIZED_C) && \
+	mv git-tmp.pot $@
 
 pot: po/git.pot
 
diff --git a/po/.gitignore b/po/.gitignore
index a242a86..e3a8c5d 100644
--- a/po/.gitignore
+++ b/po/.gitignore
@@ -1 +1 @@
-/git.pot
+*.pot
-- 
1.7.4.1

^ permalink raw reply related	[flat|nested] 222+ messages in thread

* Re: [PATCH v4 27/73] gettextize: git-commit formatting messages
  2011-02-25 18:46           ` Junio C Hamano
  2011-02-25 20:01             ` Ævar Arnfjörð Bjarmason
@ 2011-02-25 21:35             ` Jonathan Nieder
  1 sibling, 0 replies; 222+ messages in thread
From: Jonathan Nieder @ 2011-02-25 21:35 UTC (permalink / raw)
  To: Junio C Hamano
  Cc: Ævar Arnfjörð Bjarmason, git, Jakub Narebski

Junio C Hamano wrote:

> It might be a good idea to introduce status_print{,_ln,_more} wrapper
> functions around color_vfprintf()

My main obstacle to sending this was lack of good names for the
relevant functions. :)

>  - Another advantage is that this makes it easier for us to drop "#"
>    prefix in "git status" output in later versions of git if we wanted to.
>
> In "git commit" template, these lines need to be made into comments, but
> there is no reason, other than that we are sooooo used to seeing these
> lines prefixed with "# ", in "git status" output.

Good point.  Expect patches soon (for the status_print*, not "#" removal
from output).

^ permalink raw reply	[flat|nested] 222+ messages in thread

* Re: [PATCH v4 04/73] Makefile: "pot" target to extract messages marked for translation
  2011-02-25 21:20             ` Jonathan Nieder
@ 2011-02-25 21:36               ` Junio C Hamano
  2011-02-25 22:11                 ` Jonathan Nieder
  0 siblings, 1 reply; 222+ messages in thread
From: Junio C Hamano @ 2011-02-25 21:36 UTC (permalink / raw)
  To: Jonathan Nieder
  Cc: Ævar Arnfjörð Bjarmason, git, Junio C Hamano

Jonathan Nieder <jrnieder@gmail.com> writes:

> Hmm, I had been wondering where that message came from.  Maybe the
> following would help?
> ...
>  po/git.pot: $(LOCALIZED_C)
> -	$(QUIET_XGETTEXT)$(XGETTEXT) -o$@+ $(XGETTEXT_FLAGS_C) $(LOCALIZED_C) && \
> -	mv $@+ $@
> +	$(QUIET_XGETTEXT)$(XGETTEXT) -ogit-tmp.pot $(XGETTEXT_FLAGS_C) $(LOCALIZED_C) && \
> +	mv git-tmp.pot $@

Yeah, or "tmp-$@".

In either case, I'd prefer to see the above removed the temporary and the
target before running the command, following the idiom:

	rm -f $@+ $@ && \
        $(command that does not remove its output when killed) -o $@+ && \
        mv $@+ $@

Does xgettext leave output file specified with -o when it gets killed?  If
not, we don't have to use a temporary.  Makefiles in gitk and git-gui do
not seem to protect against it either.

^ permalink raw reply	[flat|nested] 222+ messages in thread

* Re: [PATCH v4 04/73] Makefile: "pot" target to extract messages marked for translation
  2011-02-25 21:36               ` Junio C Hamano
@ 2011-02-25 22:11                 ` Jonathan Nieder
  0 siblings, 0 replies; 222+ messages in thread
From: Jonathan Nieder @ 2011-02-25 22:11 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: Ævar Arnfjörð Bjarmason, git

Junio C Hamano wrote:

> Does xgettext leave output file specified with -o when it gets killed?

I don't think so.  But xgettext collects output and then writes it all
in one swoop, so it's hard to provoke problems that way in practice.

The possibility that had me worried is what hat happens when we start
translating shell scripts:

	xgettext -o$@ $(XGETTEXT_FLAGS_C) $(LOCALIZED_C)
	xgettext -o$@ --add-missing $(XGETTEXT_FLAGS_SH) $(LOCALIZED_SH)
	xgettext -o$@ --add-missing $(XGETTEXT_FLAGS_PERL) $(LOCALIZED_PERL)

If the build is interrupted partway through, the output from the
commands that succeeded will remain and leave out the messages that
would have been added later out of the template.

^ permalink raw reply	[flat|nested] 222+ messages in thread

* Re: [PATCH v4 64/73] gettextize: git-describe basic messages
  2011-02-22 23:42       ` [PATCH v4 64/73] gettextize: git-describe basic messages Ævar Arnfjörð Bjarmason
@ 2011-02-26  9:55         ` Jakub Narebski
  2011-02-26 10:03           ` Junio C Hamano
  2011-02-26 13:16           ` Ævar Arnfjörð Bjarmason
  0 siblings, 2 replies; 222+ messages in thread
From: Jakub Narebski @ 2011-02-26  9:55 UTC (permalink / raw)
  To: Ævar Arnfjörð Bjarmason; +Cc: git, Junio C Hamano

On Wed, 23 Feb 2011, Ævar Arnfjörð Bjarmason wrote:

>                 if (strcmp(n->tag->tag, all ? n->path + 5 : n->path))
> -                       warning("tag '%s' is really '%s' here", n->tag->tag, n->path);
> +                       warning(_("tag '%s' is really '%s' here"), n->tag->tag, n->path);
>                 n->name_checked = 1;
>         }

Don't we need to use order notation to be able to change order of those
two parameters, i.e. use

  +                       warning(_("tag '%1$s' is really '%2$s' here"), n->tag->tag, n->path);

Perhaps also some comment for translators describing placeholders?

-- 
Jakub Narebski
Poland

^ permalink raw reply	[flat|nested] 222+ messages in thread

* Re: [PATCH v4 24/73] gettextize: git-checkout "Switched to a .. branch" message
  2011-02-25 19:56             ` Junio C Hamano
@ 2011-02-26 10:01               ` Junio C Hamano
  0 siblings, 0 replies; 222+ messages in thread
From: Junio C Hamano @ 2011-02-26 10:01 UTC (permalink / raw)
  To: Ævar Arnfjörð Bjarmason, Jonathan Nieder; +Cc: git, Jeff King

Junio C Hamano <gitster@pobox.com> writes:

> I've locally amended this, and inserted the distclean-pot, in the series,
> so no need to resend only for these two.

Tonight's quick status update, just to save everybody's time to avoid
duplicated work:

 - I queued Jonathan's reroll of Jeff's strbuf_vaddf() on jk/strbuf-vaddf
   topic (on top of the 'master');

 - Jonathan's status_color_* work is queued on jn/status-translatable,
   which is forked from (i.e. builds on top of) jk/strbuf-vaddf;

 - Jeff's GIT_TRACE_FROTZ work is on jk/trace-sifter, also building on top
   of jk/strbuf-vaddf; and

 - Ævar's ab/i18n was rebased on jn/status-translatable.

I've merged all of the above to 'pu' and pushed the results out.  It
hopefully will mirror out shortly.

^ permalink raw reply	[flat|nested] 222+ messages in thread

* Re: [PATCH v4 64/73] gettextize: git-describe basic messages
  2011-02-26  9:55         ` Jakub Narebski
@ 2011-02-26 10:03           ` Junio C Hamano
  2011-02-26 13:16           ` Ævar Arnfjörð Bjarmason
  1 sibling, 0 replies; 222+ messages in thread
From: Junio C Hamano @ 2011-02-26 10:03 UTC (permalink / raw)
  To: Jakub Narebski
  Cc: Ævar Arnfjörð Bjarmason, git, Junio C Hamano

Jakub Narebski <jnareb@gmail.com> writes:

> Don't we need to use order notation to be able to change order of those
> two parameters, i.e. use
>
>   +                       warning(_("tag '%1$s' is really '%2$s' here"), n->tag->tag, n->path);

Yes, translators to languages that want to swap orders would need to know
about the placeholder notation; the canonical C locale messages you see in
these patches do not have to have them, though.

^ permalink raw reply	[flat|nested] 222+ messages in thread

* Re: [PATCH v4 64/73] gettextize: git-describe basic messages
  2011-02-26  9:55         ` Jakub Narebski
  2011-02-26 10:03           ` Junio C Hamano
@ 2011-02-26 13:16           ` Ævar Arnfjörð Bjarmason
  1 sibling, 0 replies; 222+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2011-02-26 13:16 UTC (permalink / raw)
  To: Jakub Narebski; +Cc: git, Junio C Hamano

On Sat, Feb 26, 2011 at 10:55, Jakub Narebski <jnareb@gmail.com> wrote:
> On Wed, 23 Feb 2011, Ævar Arnfjörð Bjarmason wrote:
>
>>                 if (strcmp(n->tag->tag, all ? n->path + 5 : n->path))
>> -                       warning("tag '%s' is really '%s' here", n->tag->tag, n->path);
>> +                       warning(_("tag '%s' is really '%s' here"), n->tag->tag, n->path);
>>                 n->name_checked = 1;
>>         }
>
> Don't we need to use order notation to be able to change order of those
> two parameters, i.e. use
>
>  +                       warning(_("tag '%1$s' is really '%2$s' here"), n->tag->tag, n->path);
>
> Perhaps also some comment for translators describing placeholders?

No, the original string doesn't need those. But the translators can
insert them in their PO file if they want.

^ permalink raw reply	[flat|nested] 222+ messages in thread

* Re: [PATCH v4 16/73] gettextize: git-branch "remote branch '%s' not found" message
  2011-02-22 23:41       ` [PATCH v4 16/73] gettextize: git-branch "remote branch '%s' not found" message Ævar Arnfjörð Bjarmason
@ 2011-02-27 19:14         ` Piotr Krukowiecki
  0 siblings, 0 replies; 222+ messages in thread
From: Piotr Krukowiecki @ 2011-02-27 19:14 UTC (permalink / raw)
  To: Ævar Arnfjörð Bjarmason
  Cc: git, Junio C Hamano, Jakub Narebski

W dniu 23.02.2011 00:41, Ævar Arnfjörð Bjarmason pisze:
> This could be done better by splitting it up, but it would change too
> much code, which I'm trying to avoid at this point. Instead add a
> TRANSLATORS comment to explain what "remote " does.

Not sure what you meant by splitting it up. Hopefully not splitting the
text even more?

IMO all such code will have to be rewritten to allow better translation.
Example patch at the bottom.

I remember at least one more such case - it was sth like "%s %s %s" where
first part was translatable but defined somewhere else.

This can be done before or after applying the i18n patches, but if it's going
to be done after, then I think it'd be better to mark such places as "to be
rewritten" instead of just simply marking them for translation.

> 
> Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
> ---
>  builtin/branch.c |    3 ++-
>  1 files changed, 2 insertions(+), 1 deletions(-)
> 
> diff --git a/builtin/branch.c b/builtin/branch.c
> index 6695db4..e9d8a5a 100644
> --- a/builtin/branch.c
> +++ b/builtin/branch.c
> @@ -157,7 +157,8 @@ static int delete_branches(int argc, const char **argv, int force, int kinds)
>  	switch (kinds) {
>  	case REF_REMOTE_BRANCH:
>  		fmt = "refs/remotes/%s";
> -		remote = "remote ";
> +		/* TRANSLATORS: This is "remote " in "remote branch '%s' not found" */
> +		remote = _("remote ");
>  		force = 1;
>  		break;
>  	case REF_LOCAL_BRANCH:


--->8---
From a82add2f0562839e60611e7c3f3409d6cea87ad1 Mon Sep 17 00:00:00 2001
From: Piotr Krukowiecki <piotr.krukowiecki@gmail.com>
Date: Sun, 27 Feb 2011 19:55:48 +0100
Subject: [PATCH] Change how error message is created for easier translation

When a text is split or stiched together from several
texts it's very hard/impossible to do a good translation.

Signed-off-by: Piotr Krukowiecki <piotr.krukowiecki@gmail.com>
---
 builtin/branch.c |   20 ++++++++++++--------
 1 files changed, 12 insertions(+), 8 deletions(-)

diff --git a/builtin/branch.c b/builtin/branch.c
index fe8f2fc..e4adc34 100644
--- a/builtin/branch.c
+++ b/builtin/branch.c
@@ -149,20 +149,20 @@ static int delete_branches(int argc, const char **argv, int force, int kinds)
 	struct commit *rev, *head_rev = NULL;
 	unsigned char sha1[20];
 	char *name = NULL;
-	const char *fmt, *remote;
+	const char *fmt;
 	int i;
 	int ret = 0;
 	struct strbuf bname = STRBUF_INIT;
+	int is_remote = 0;
 
 	switch (kinds) {
 	case REF_REMOTE_BRANCH:
 		fmt = "refs/remotes/%s";
-		remote = "remote ";
+		is_remote = 1;
 		force = 1;
 		break;
 	case REF_LOCAL_BRANCH:
 		fmt = "refs/heads/%s";
-		remote = "";
 		break;
 	default:
 		die("cannot use -a with -d");
@@ -186,8 +186,9 @@ static int delete_branches(int argc, const char **argv, int force, int kinds)
 
 		name = xstrdup(mkpath(fmt, bname.buf));
 		if (!resolve_ref(name, sha1, 1, NULL)) {
-			error("%sbranch '%s' not found.",
-					remote, bname.buf);
+			const char *error_str = is_remote ? "Remote branch '%s' not found." :
+				"Branch '%s' not found.";
+			error(error_str, bname.buf);
 			ret = 1;
 			continue;
 		}
@@ -208,12 +209,15 @@ static int delete_branches(int argc, const char **argv, int force, int kinds)
 		}
 
 		if (delete_ref(name, sha1, 0)) {
-			error("Error deleting %sbranch '%s'", remote,
-			      bname.buf);
+			const char *error_str = is_remote ? "Error deleting remote branch '%s'" :
+				"Error deleting branch '%s'";
+			error(error_str, bname.buf);
 			ret = 1;
 		} else {
 			struct strbuf buf = STRBUF_INIT;
-			printf("Deleted %sbranch %s (was %s).\n", remote,
+			const char *error_str = is_remote ? "Deleted remote branch %s (was %s).\n" :
+				"Deleted branch %s (was %s).\n";
+			printf(error_str,
 			       bname.buf,
 			       find_unique_abbrev(sha1, DEFAULT_ABBREV));
 			strbuf_addf(&buf, "branch.%s", bname.buf);
-- 
1.7.1


-- 
Piotr Krukowiecki

^ permalink raw reply related	[flat|nested] 222+ messages in thread

end of thread, other threads:[~2011-02-27 19:14 UTC | newest]

Thread overview: 222+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-02-19 19:23 [PATCH 00/72] No-op C gettext wrappers Ævar Arnfjörð Bjarmason
2011-02-19 19:23 ` [PATCH 01/72] gettext.h: add no-op _() and N_() wrappers Ævar Arnfjörð Bjarmason
2011-02-20  2:01   ` Jonathan Nieder
2011-02-20 10:13     ` Erik Faye-Lund
2011-02-20 10:34       ` Jonathan Nieder
2011-02-20 21:11     ` Ævar Arnfjörð Bjarmason
2011-02-20 22:03       ` Jonathan Nieder
2011-02-19 19:23 ` [PATCH 02/72] cache.h: include gettext.h Ævar Arnfjörð Bjarmason
2011-02-19 19:23 ` [PATCH 03/72] t/test-lib.sh: add always-set NO_GETTEXT_POISON prerequisite Ævar Arnfjörð Bjarmason
2011-02-20  2:10   ` Jonathan Nieder
2011-02-20 12:42     ` Ævar Arnfjörð Bjarmason
2011-02-20 21:55       ` Jonathan Nieder
2011-02-20 22:05         ` Ævar Arnfjörð Bjarmason
2011-02-20 22:10           ` Jonathan Nieder
2011-02-20 22:31             ` Ævar Arnfjörð Bjarmason
2011-02-20 22:36               ` Jonathan Nieder
2011-02-21  6:56       ` Junio C Hamano
2011-02-19 19:23 ` [PATCH 04/72] gettextize: git-init basic messages Ævar Arnfjörð Bjarmason
2011-02-20  2:21   ` Jonathan Nieder
2011-02-19 19:23 ` [PATCH 05/72] gettextize: git-init "Initialized [...] repository" message Ævar Arnfjörð Bjarmason
2011-02-19 19:23 ` [PATCH 06/72] gettextize: git-clone basic messages Ævar Arnfjörð Bjarmason
2011-02-19 19:23 ` [PATCH 07/72] gettextize: git-clone "Cloning into" message Ævar Arnfjörð Bjarmason
2011-02-21  9:19   ` Jonathan Nieder
2011-02-19 19:23 ` [PATCH 08/72] gettextize: git-add basic messages Ævar Arnfjörð Bjarmason
2011-02-19 19:23 ` [PATCH 09/72] gettextize: git-add "no files added" message Ævar Arnfjörð Bjarmason
2011-02-19 19:23 ` [PATCH 10/72] gettextize: git-add "Use -f if you really want" message Ævar Arnfjörð Bjarmason
2011-02-19 19:23 ` [PATCH 11/72] gettextize: git-add "pathspec [...] did not match" message Ævar Arnfjörð Bjarmason
2011-02-19 19:23 ` [PATCH 12/72] gettextize: git-add "remove '%s'" message Ævar Arnfjörð Bjarmason
2011-02-19 19:23 ` [PATCH 13/72] gettextize: git-add refresh_index message Ævar Arnfjörð Bjarmason
2011-02-19 19:23 ` [PATCH 14/72] gettextize: git-branch basic messages Ævar Arnfjörð Bjarmason
2011-02-19 19:23 ` [PATCH 15/72] gettextize: git-branch "remote branch '%s' not found" message Ævar Arnfjörð Bjarmason
2011-02-19 19:23 ` [PATCH 16/72] gettextize: git-branch "Deleted branch [...]" message Ævar Arnfjörð Bjarmason
2011-02-19 19:24 ` [PATCH 17/72] gettextize: git-branch "git branch -v" messages Ævar Arnfjörð Bjarmason
2011-02-19 19:24 ` [PATCH 18/72] gettextize: git-branch "(no branch)" message Ævar Arnfjörð Bjarmason
2011-02-19 19:24 ` [PATCH 19/72] gettextize: git-checkout basic messages Ævar Arnfjörð Bjarmason
2011-02-19 19:24 ` [PATCH 20/72] gettextize: git-checkout: our/their version message Ævar Arnfjörð Bjarmason
2011-02-19 19:24 ` [PATCH 21/72] gettextize: git-checkout describe_detached_head messages Ævar Arnfjörð Bjarmason
2011-02-19 19:24 ` [PATCH 22/72] gettextize: git-checkout "HEAD is now at" message Ævar Arnfjörð Bjarmason
2011-02-19 19:24 ` [PATCH 23/72] gettextize: git-checkout "Switched to a .. branch" message Ævar Arnfjörð Bjarmason
2011-02-19 19:24 ` [PATCH 24/72] gettextize: git-commit basic messages Ævar Arnfjörð Bjarmason
2011-02-19 19:24 ` [PATCH 25/72] gettextize: git-commit "middle of a merge" message Ævar Arnfjörð Bjarmason
2011-02-19 19:24 ` [PATCH 26/72] gettextize: git-commit formatting messages Ævar Arnfjörð Bjarmason
2011-02-19 19:24 ` [PATCH 27/72] gettextize: git-commit print_summary messages Ævar Arnfjörð Bjarmason
2011-02-19 19:24 ` [PATCH 28/72] gettextize: git-commit "enter the commit message" message Ævar Arnfjörð Bjarmason
2011-02-19 19:24 ` [PATCH 29/72] gettextize: git-commit advice messages Ævar Arnfjörð Bjarmason
2011-02-19 19:24 ` [PATCH 30/72] gettextize: git-diff basic messages Ævar Arnfjörð Bjarmason
2011-02-19 19:24 ` [PATCH 31/72] gettextize: git-fetch " Ævar Arnfjörð Bjarmason
2011-02-19 19:24 ` [PATCH 32/72] gettextize: git-fetch formatting messages Ævar Arnfjörð Bjarmason
2011-02-19 19:24 ` [PATCH 33/72] gettextize: git-fetch update_local_ref messages Ævar Arnfjörð Bjarmason
2011-02-19 19:24 ` [PATCH 34/72] gettextize: git-fetch split up "(non-fast-forward)" message Ævar Arnfjörð Bjarmason
2011-02-19 19:24 ` [PATCH 35/72] gettextize: git-grep basic messages Ævar Arnfjörð Bjarmason
2011-02-19 19:24 ` [PATCH 36/72] gettextize: git-grep "--open-files-in-pager" message Ævar Arnfjörð Bjarmason
2011-02-19 19:24 ` [PATCH 37/72] gettextize: git-log basic messages Ævar Arnfjörð Bjarmason
2011-02-19 19:24 ` [PATCH 38/72] gettextize: git-log "--OPT does not make sense" messages Ævar Arnfjörð Bjarmason
2011-02-19 19:24 ` [PATCH 39/72] gettextize: git-merge basic messages Ævar Arnfjörð Bjarmason
2011-02-19 19:24 ` [PATCH 40/72] gettextize: git-merge "Updating %s..%s" message Ævar Arnfjörð Bjarmason
2011-02-19 19:24 ` [PATCH 41/72] gettextize: git-merge "You have not concluded your merge" messages Ævar Arnfjörð Bjarmason
2011-02-19 19:24 ` [PATCH 42/72] gettextize: git-merge "Wonderful" message Ævar Arnfjörð Bjarmason
2011-02-19 19:24 ` [PATCH 43/72] gettextize: git-mv basic messages Ævar Arnfjörð Bjarmason
2011-02-19 19:24 ` [PATCH 44/72] gettextize: git-mv "bad" messages Ævar Arnfjörð Bjarmason
2011-02-19 19:24 ` [PATCH 45/72] gettextize: git-rm basic messages Ævar Arnfjörð Bjarmason
2011-02-19 19:24 ` [PATCH 46/72] gettextize: git-reset " Ævar Arnfjörð Bjarmason
2011-02-19 19:24 ` [PATCH 47/72] gettextize: git-reset reset_type_names messages Ævar Arnfjörð Bjarmason
2011-02-19 19:24 ` [PATCH 48/72] gettextize: git-reset "Unstaged changes after reset" message Ævar Arnfjörð Bjarmason
2011-02-19 19:24 ` [PATCH 49/72] gettextize: git-tag basic messages Ævar Arnfjörð Bjarmason
2011-02-19 19:24 ` [PATCH 50/72] gettextize: git-tag tag_template message Ævar Arnfjörð Bjarmason
2011-02-19 19:24 ` [PATCH 51/72] gettextize: git-push basic messages Ævar Arnfjörð Bjarmason
2011-02-19 19:24 ` [PATCH 52/72] gettextize: git-push "prevent you from losing" message Ævar Arnfjörð Bjarmason
2011-02-19 19:24 ` [PATCH 53/72] gettextize: git-status basic messages Ævar Arnfjörð Bjarmason
2011-02-19 19:24 ` [PATCH 54/72] gettextize: git-status "nothing to commit" messages Ævar Arnfjörð Bjarmason
2011-02-19 19:24 ` [PATCH 55/72] gettextize: git-status shortstatus messages Ævar Arnfjörð Bjarmason
2011-02-19 19:24 ` [PATCH 56/72] gettextize: git-status "Changes to be committed" message Ævar Arnfjörð Bjarmason
2011-02-19 19:24 ` [PATCH 57/72] gettextize: git-status "Initial commit" message Ævar Arnfjörð Bjarmason
2011-02-19 19:24 ` [PATCH 58/72] gettextize: git-status "renamed: " message Ævar Arnfjörð Bjarmason
2011-02-19 19:24 ` [PATCH 59/72] gettextize: git-archive basic messages Ævar Arnfjörð Bjarmason
2011-02-19 19:24 ` [PATCH 60/72] gettextize: git-bundle " Ævar Arnfjörð Bjarmason
2011-02-19 19:24 ` [PATCH 61/72] gettextize: git-clean " Ævar Arnfjörð Bjarmason
2011-02-19 19:24 ` [PATCH 62/72] gettextize: git-clean clean.requireForce messages Ævar Arnfjörð Bjarmason
2011-02-19 19:24 ` [PATCH 63/72] gettextize: git-describe basic messages Ævar Arnfjörð Bjarmason
2011-02-19 19:24 ` [PATCH 64/72] gettextize: git-gc " Ævar Arnfjörð Bjarmason
2011-02-19 19:24 ` [PATCH 65/72] gettextize: git-gc "Auto packing the repository" message Ævar Arnfjörð Bjarmason
2011-02-19 19:24 ` [PATCH 66/72] gettextize: git-notes basic commands Ævar Arnfjörð Bjarmason
2011-02-19 19:24 ` [PATCH 67/72] gettextize: git-notes GIT_NOTES_REWRITE_MODE error message Ævar Arnfjörð Bjarmason
2011-02-19 19:24 ` [PATCH 68/72] gettextize: git-revert basic messages Ævar Arnfjörð Bjarmason
2011-02-19 19:24 ` [PATCH 69/72] gettextize: git-revert "Your local changes" message Ævar Arnfjörð Bjarmason
2011-02-19 19:24 ` [PATCH 70/72] gettextize: git-revert literal "me" messages Ævar Arnfjörð Bjarmason
2011-02-19 19:24 ` [PATCH 71/72] gettextize: git-revert split up "could not revert/apply" message Ævar Arnfjörð Bjarmason
2011-02-19 19:24 ` [PATCH 72/72] gettextize: git-shortlog basic messages Ævar Arnfjörð Bjarmason
2011-02-21  4:00 ` [PATCH v2 0/3] No-op C gettext wrappers Jonathan Nieder
2011-02-21  4:02   ` [PATCH 1/3] i18n: add no-op _() and N_() wrappers Jonathan Nieder
2011-02-21  4:03   ` [PATCH 2/3] tests: add GETTEXT_POISON to simulate unfriendly translator Jonathan Nieder
2011-02-21  4:05   ` [PATCH 3/3] tests: let GETTEXT_POISON be disabled at run time Jonathan Nieder
2011-02-21 10:12   ` [PATCH v3 00/15] Mark "init", "clone", and "add" output for translation Jonathan Nieder
2011-02-21 10:13     ` [PATCH 01/15] i18n: add no-op _() and N_() wrappers Jonathan Nieder
2011-02-21 10:13     ` [PATCH 02/15] tests: add GETTEXT_POISON to simulate unfriendly translator Jonathan Nieder
2011-02-21 12:41       ` Ævar Arnfjörð Bjarmason
2011-02-21 12:58         ` Jonathan Nieder
2011-02-21 10:14     ` [PATCH 03/15] i18n: do not poison translations unless GIT_GETTEXT_POISON envvar is set Jonathan Nieder
2011-02-21 10:15     ` [PATCH 04/15] Makefile: "pot" target to extract messages marked for translation Jonathan Nieder
2011-02-21 12:35       ` Ævar Arnfjörð Bjarmason
2011-02-21 13:05         ` Jonathan Nieder
2011-02-21 13:14           ` Ævar Arnfjörð Bjarmason
2011-02-21 10:16     ` [PATCH 05/15] init: mark basic messages " Jonathan Nieder
2011-02-21 10:17     ` [PATCH 06/15] init: mark "Initialized [...] repository" " Jonathan Nieder
2011-02-21 10:18     ` [PATCH 07/15] clone: mark basic messages " Jonathan Nieder
2011-02-21 10:18     ` [PATCH 08/15] clone: split "Cloning into" message into two Jonathan Nieder
2011-02-21 10:19     ` [PATCH 09/15] clone: mark "Cloning into" message for translation Jonathan Nieder
2011-02-21 10:24     ` [PATCH 10/15] add: mark basic messages " Jonathan Nieder
2011-02-21 10:25     ` [PATCH 11/15] add: mark "The following paths are ignored" " Jonathan Nieder
2011-02-21 10:25     ` [PATCH 12/15] add: mark "did not match any files" " Jonathan Nieder
2011-02-21 10:26     ` [PATCH 13/15] add -u --verbose: mark "remove '%s'" " Jonathan Nieder
2011-02-21 10:26     ` [PATCH 14/15] update-index --refresh --porcelain: add missing const Jonathan Nieder
2011-02-21 10:29     ` [PATCH 15/15] add --refresh --verbose: mark "Unstaged changes" heading for translation Jonathan Nieder
2011-02-21 12:38     ` [PATCH v3 00/15] Mark "init", "clone", and "add" output " Ævar Arnfjörð Bjarmason
2011-02-22  7:36       ` Junio C Hamano
2011-02-22 11:22         ` Ævar Arnfjörð Bjarmason
2011-02-22 18:11     ` Junio C Hamano
2011-02-22 23:41       ` [PATCH v4 00/73] No-op gettextize core Git C programs Ævar Arnfjörð Bjarmason
2011-02-23  0:49         ` Junio C Hamano
2011-02-23  1:37           ` Junio C Hamano
2011-02-23 18:30             ` Ævar Arnfjörð Bjarmason
2011-02-22 23:41       ` [PATCH v4 01/73] gettext: add no-op _() and N_() wrappers Ævar Arnfjörð Bjarmason
2011-02-22 23:41       ` [PATCH v4 02/73] gettext tests: add GETTEXT_POISON to simulate unfriendly translator Ævar Arnfjörð Bjarmason
2011-02-25  7:08         ` Jonathan Nieder
2011-02-25 17:52           ` Junio C Hamano
2011-02-25 19:50             ` Ævar Arnfjörð Bjarmason
2011-02-22 23:41       ` [PATCH v4 03/73] gettext: do not poison translations unless GIT_GETTEXT_POISON envvar is set Ævar Arnfjörð Bjarmason
2011-02-22 23:41       ` [PATCH v4 04/73] Makefile: "pot" target to extract messages marked for translation Ævar Arnfjörð Bjarmason
2011-02-25  7:22         ` Jonathan Nieder
2011-02-25 19:53           ` Ævar Arnfjörð Bjarmason
2011-02-25 21:20             ` Jonathan Nieder
2011-02-25 21:36               ` Junio C Hamano
2011-02-25 22:11                 ` Jonathan Nieder
2011-02-22 23:41       ` [PATCH v4 05/73] gettextize: git-init basic messages Ævar Arnfjörð Bjarmason
2011-02-22 23:41       ` [PATCH v4 06/73] gettextize: git-init "Initialized [...] repository" message Ævar Arnfjörð Bjarmason
2011-02-22 23:41       ` [PATCH v4 07/73] gettextize: git-clone basic messages Ævar Arnfjörð Bjarmason
2011-02-22 23:41       ` [PATCH v4 08/73] gettextize: git-clone "Cloning into" message Ævar Arnfjörð Bjarmason
2011-02-22 23:41       ` [PATCH v4 09/73] " Ævar Arnfjörð Bjarmason
2011-02-22 23:41       ` [PATCH v4 10/73] gettextize: git-add basic messages Ævar Arnfjörð Bjarmason
2011-02-22 23:41       ` [PATCH v4 11/73] gettextize: git-add "The following paths are ignored" message Ævar Arnfjörð Bjarmason
2011-02-22 23:41       ` [PATCH v4 12/73] gettextize: git-add "did not match any files" message Ævar Arnfjörð Bjarmason
2011-02-22 23:41       ` [PATCH v4 13/73] gettextize: git-add "remove '%s'" message Ævar Arnfjörð Bjarmason
2011-02-22 23:41       ` [PATCH v4 14/73] gettextize: git-add "Unstaged changes" message Ævar Arnfjörð Bjarmason
2011-02-22 23:41       ` [PATCH v4 15/73] gettextize: git-branch basic messages Ævar Arnfjörð Bjarmason
2011-02-22 23:41       ` [PATCH v4 16/73] gettextize: git-branch "remote branch '%s' not found" message Ævar Arnfjörð Bjarmason
2011-02-27 19:14         ` Piotr Krukowiecki
2011-02-22 23:41       ` [PATCH v4 17/73] gettextize: git-branch "Deleted branch [...]" message Ævar Arnfjörð Bjarmason
2011-02-25  7:54         ` Jonathan Nieder
2011-02-25 19:58           ` Ævar Arnfjörð Bjarmason
2011-02-25 21:16             ` Jonathan Nieder
2011-02-22 23:41       ` [PATCH v4 18/73] gettextize: git-branch "git branch -v" messages Ævar Arnfjörð Bjarmason
2011-02-25  7:52         ` Jonathan Nieder
2011-02-22 23:41       ` [PATCH v4 19/73] gettextize: git-branch "(no branch)" message Ævar Arnfjörð Bjarmason
2011-02-22 23:41       ` [PATCH v4 20/73] gettextize: git-checkout basic messages Ævar Arnfjörð Bjarmason
2011-02-22 23:41       ` [PATCH v4 21/73] gettextize: git-checkout: our/their version message Ævar Arnfjörð Bjarmason
2011-02-22 23:41       ` [PATCH v4 22/73] gettextize: git-checkout describe_detached_head messages Ævar Arnfjörð Bjarmason
2011-02-22 23:41       ` [PATCH v4 23/73] gettextize: git-checkout "HEAD is now at" message Ævar Arnfjörð Bjarmason
2011-02-25  8:04         ` Jonathan Nieder
2011-02-22 23:41       ` [PATCH v4 24/73] gettextize: git-checkout "Switched to a .. branch" message Ævar Arnfjörð Bjarmason
2011-02-25  8:10         ` Jonathan Nieder
2011-02-25 19:33           ` Junio C Hamano
2011-02-25 19:47           ` Ævar Arnfjörð Bjarmason
2011-02-25 19:56             ` Junio C Hamano
2011-02-26 10:01               ` Junio C Hamano
2011-02-22 23:41       ` [PATCH v4 25/73] gettextize: git-commit basic messages Ævar Arnfjörð Bjarmason
2011-02-22 23:41       ` [PATCH v4 26/73] gettextize: git-commit "middle of a merge" message Ævar Arnfjörð Bjarmason
2011-02-22 23:41       ` [PATCH v4 27/73] gettextize: git-commit formatting messages Ævar Arnfjörð Bjarmason
2011-02-25  9:07         ` [PATCH] commit: error out for missing commit message template Jonathan Nieder
2011-02-25 20:14           ` Junio C Hamano
2011-02-25  9:43         ` [PATCH v4 27/73] gettextize: git-commit formatting messages Jonathan Nieder
2011-02-25 18:46           ` Junio C Hamano
2011-02-25 20:01             ` Ævar Arnfjörð Bjarmason
2011-02-25 21:35             ` Jonathan Nieder
2011-02-22 23:41       ` [PATCH v4 28/73] gettextize: git-commit print_summary messages Ævar Arnfjörð Bjarmason
2011-02-22 23:41       ` [PATCH v4 29/73] gettextize: git-commit "enter the commit message" message Ævar Arnfjörð Bjarmason
2011-02-22 23:41       ` [PATCH v4 30/73] gettextize: git-commit advice messages Ævar Arnfjörð Bjarmason
2011-02-22 23:41       ` [PATCH v4 31/73] gettextize: git-diff basic messages Ævar Arnfjörð Bjarmason
2011-02-22 23:41       ` [PATCH v4 32/73] gettextize: git-fetch " Ævar Arnfjörð Bjarmason
2011-02-22 23:41       ` [PATCH v4 33/73] gettextize: git-fetch formatting messages Ævar Arnfjörð Bjarmason
2011-02-22 23:41       ` [PATCH v4 34/73] gettextize: git-fetch update_local_ref messages Ævar Arnfjörð Bjarmason
2011-02-22 23:41       ` [PATCH v4 35/73] gettextize: git-fetch split up "(non-fast-forward)" message Ævar Arnfjörð Bjarmason
2011-02-22 23:41       ` [PATCH v4 36/73] gettextize: git-grep basic messages Ævar Arnfjörð Bjarmason
2011-02-22 23:41       ` [PATCH v4 37/73] gettextize: git-grep "--open-files-in-pager" message Ævar Arnfjörð Bjarmason
2011-02-22 23:41       ` [PATCH v4 38/73] gettextize: git-log basic messages Ævar Arnfjörð Bjarmason
2011-02-22 23:41       ` [PATCH v4 39/73] gettextize: git-log "--OPT does not make sense" messages Ævar Arnfjörð Bjarmason
2011-02-22 23:41       ` [PATCH v4 40/73] gettextize: git-merge basic messages Ævar Arnfjörð Bjarmason
2011-02-22 23:42       ` [PATCH v4 41/73] gettextize: git-merge "Updating %s..%s" message Ævar Arnfjörð Bjarmason
2011-02-22 23:42       ` [PATCH v4 42/73] gettextize: git-merge "You have not concluded your merge" messages Ævar Arnfjörð Bjarmason
2011-02-22 23:42       ` [PATCH v4 43/73] gettextize: git-merge "Wonderful" message Ævar Arnfjörð Bjarmason
2011-02-22 23:42       ` [PATCH v4 44/73] gettextize: git-mv basic messages Ævar Arnfjörð Bjarmason
2011-02-22 23:42       ` [PATCH v4 45/73] gettextize: git-mv "bad" messages Ævar Arnfjörð Bjarmason
2011-02-22 23:42       ` [PATCH v4 46/73] gettextize: git-rm basic messages Ævar Arnfjörð Bjarmason
2011-02-22 23:42       ` [PATCH v4 47/73] gettextize: git-reset " Ævar Arnfjörð Bjarmason
2011-02-22 23:42       ` [PATCH v4 48/73] gettextize: git-reset reset_type_names messages Ævar Arnfjörð Bjarmason
2011-02-22 23:42       ` [PATCH v4 49/73] gettextize: git-reset "Unstaged changes after reset" message Ævar Arnfjörð Bjarmason
2011-02-22 23:42       ` [PATCH v4 50/73] gettextize: git-tag basic messages Ævar Arnfjörð Bjarmason
2011-02-22 23:42       ` [PATCH v4 51/73] gettextize: git-tag tag_template message Ævar Arnfjörð Bjarmason
2011-02-22 23:42       ` [PATCH v4 52/73] gettextize: git-push basic messages Ævar Arnfjörð Bjarmason
2011-02-22 23:42       ` [PATCH v4 53/73] gettextize: git-push "prevent you from losing" message Ævar Arnfjörð Bjarmason
2011-02-22 23:42       ` [PATCH v4 54/73] gettextize: git-status basic messages Ævar Arnfjörð Bjarmason
2011-02-22 23:42       ` [PATCH v4 55/73] gettextize: git-status "nothing to commit" messages Ævar Arnfjörð Bjarmason
2011-02-22 23:42       ` [PATCH v4 56/73] gettextize: git-status shortstatus messages Ævar Arnfjörð Bjarmason
2011-02-22 23:42       ` [PATCH v4 57/73] gettextize: git-status "Changes to be committed" message Ævar Arnfjörð Bjarmason
2011-02-22 23:42       ` [PATCH v4 58/73] gettextize: git-status "Initial commit" message Ævar Arnfjörð Bjarmason
2011-02-22 23:42       ` [PATCH v4 59/73] gettextize: git-status "renamed: " message Ævar Arnfjörð Bjarmason
2011-02-22 23:42       ` [PATCH v4 60/73] gettextize: git-archive basic messages Ævar Arnfjörð Bjarmason
2011-02-22 23:42       ` [PATCH v4 61/73] gettextize: git-bundle " Ævar Arnfjörð Bjarmason
2011-02-22 23:42       ` [PATCH v4 62/73] gettextize: git-clean " Ævar Arnfjörð Bjarmason
2011-02-22 23:42       ` [PATCH v4 63/73] gettextize: git-clean clean.requireForce messages Ævar Arnfjörð Bjarmason
2011-02-22 23:42       ` [PATCH v4 64/73] gettextize: git-describe basic messages Ævar Arnfjörð Bjarmason
2011-02-26  9:55         ` Jakub Narebski
2011-02-26 10:03           ` Junio C Hamano
2011-02-26 13:16           ` Ævar Arnfjörð Bjarmason
2011-02-22 23:42       ` [PATCH v4 65/73] gettextize: git-gc " Ævar Arnfjörð Bjarmason
2011-02-22 23:42       ` [PATCH v4 66/73] gettextize: git-gc "Auto packing the repository" message Ævar Arnfjörð Bjarmason
2011-02-22 23:42       ` [PATCH v4 67/73] gettextize: git-notes basic commands Ævar Arnfjörð Bjarmason
2011-02-22 23:42       ` [PATCH v4 68/73] gettextize: git-notes GIT_NOTES_REWRITE_MODE error message Ævar Arnfjörð Bjarmason
2011-02-22 23:42       ` [PATCH v4 69/73] gettextize: git-revert basic messages Ævar Arnfjörð Bjarmason
2011-02-22 23:42       ` [PATCH v4 70/73] gettextize: git-revert "Your local changes" message Ævar Arnfjörð Bjarmason
2011-02-22 23:42       ` [PATCH v4 71/73] gettextize: git-revert literal "me" messages Ævar Arnfjörð Bjarmason
2011-02-22 23:42       ` [PATCH v4 72/73] gettextize: git-revert split up "could not revert/apply" message Ævar Arnfjörð Bjarmason
2011-02-22 23:42       ` [PATCH v4 73/73] gettextize: git-shortlog basic messages Ævar Arnfjörð Bjarmason

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.