git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: "Ævar Arnfjörð Bjarmason" <avarab@gmail.com>
To: git@vger.kernel.org
Cc: "Junio C Hamano" <gitster@pobox.com>,
	"Ævar Arnfjörð Bjarmason" <avarab@gmail.com>
Subject: [PATCH/RFC 1/7] i18n: mark init-db messages for translation
Date: Sun, 10 Apr 2011 19:34:02 +0000	[thread overview]
Message-ID: <1302464048-21806-2-git-send-email-avarab@gmail.com> (raw)
In-Reply-To: <1302464048-21806-1-git-send-email-avarab@gmail.com>

Mark the init-db messages that were added in v1.7.5-rc1~16^2 (init,
clone: support --separate-git-dir for .git file) by Nguyễn Thái Ngọc
Duy for translation.

This requires splitting up the tests that the patch added so that
certain parts of them can be skipped unless the C_LOCALE_OUTPUT
prerequisite is satisfied.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
---
 builtin/init-db.c |   12 ++++++------
 t/t0001-init.sh   |   28 ++++++++++++++++++++--------
 t/t5601-clone.sh  |    7 +++++--
 3 files changed, 31 insertions(+), 16 deletions(-)

diff --git a/builtin/init-db.c b/builtin/init-db.c
index b7370d9..6d0a856 100644
--- a/builtin/init-db.c
+++ b/builtin/init-db.c
@@ -319,10 +319,10 @@ int set_git_dir_init(const char *git_dir, const char *real_git_dir,
 		struct stat st;
 
 		if (!exist_ok && !stat(git_dir, &st))
-			die("%s already exists", git_dir);
+			die(_("%s already exists"), git_dir);
 
 		if (!exist_ok && !stat(real_git_dir, &st))
-			die("%s already exists", real_git_dir);
+			die(_("%s already exists"), real_git_dir);
 
 		/*
 		 * make sure symlinks are resolved because we'll be
@@ -351,16 +351,16 @@ static void separate_git_dir(const char *git_dir)
 		else if (S_ISDIR(st.st_mode))
 			src = git_link;
 		else
-			die("unable to handle file type %d", st.st_mode);
+			die(_("unable to handle file type %d"), st.st_mode);
 
 		if (rename(src, git_dir))
-			die_errno("unable to move %s to %s", src, git_dir);
+			die_errno(_("unable to move %s to %s"), src, git_dir);
 	}
 
 	fp = fopen(git_link, "w");
 	if (!fp)
-		die("Could not create git link %s", git_link);
-	fprintf(fp, "gitdir: %s\n", git_dir);
+		die(_("Could not create git link %s"), git_link);
+	fprintf(fp, _("gitdir: %s\n"), git_dir);
 	fclose(fp);
 }
 
diff --git a/t/t0001-init.sh b/t/t0001-init.sh
index a5816d0..fa31cbd 100755
--- a/t/t0001-init.sh
+++ b/t/t0001-init.sh
@@ -374,22 +374,28 @@ test_expect_success 'init prefers command line to GIT_DIR' '
 test_expect_success 'init with separate gitdir' '
 	rm -rf newdir &&
 	git init --separate-git-dir realgitdir newdir &&
-	echo "gitdir: `pwd`/realgitdir" >expected &&
-	test_cmp expected newdir/.git &&
 	test -d realgitdir/refs
 '
 
+test_expect_success C_LOCALE_OUTPUT 'init with separate gitdir: output' '
+	echo "gitdir: `pwd`/realgitdir" >expected &&
+	test_cmp expected newdir/.git
+'
+
 test_expect_success 're-init to update git link' '
 	(
 	cd newdir &&
 	git init --separate-git-dir ../surrealgitdir
 	) &&
-	echo "gitdir: `pwd`/surrealgitdir" >expected &&
-	test_cmp expected newdir/.git &&
 	test -d surrealgitdir/refs &&
 	! test -d realgitdir/refs
 '
 
+test_expect_success C_LOCALE_OUTPUT 're-init to update git link: output' '
+	echo "gitdir: `pwd`/surrealgitdir" >expected &&
+	test_cmp expected newdir/.git
+'
+
 test_expect_success 're-init to move gitdir' '
 	rm -rf newdir realgitdir surrealgitdir &&
 	git init newdir &&
@@ -397,11 +403,14 @@ test_expect_success 're-init to move gitdir' '
 	cd newdir &&
 	git init --separate-git-dir ../realgitdir
 	) &&
-	echo "gitdir: `pwd`/realgitdir" >expected &&
-	test_cmp expected newdir/.git &&
 	test -d realgitdir/refs
 '
 
+test_expect_success C_LOCALE_OUTPUT 're-init to move gitdir: output' '
+	echo "gitdir: `pwd`/realgitdir" >expected &&
+	test_cmp expected newdir/.git
+'
+
 test_expect_success 're-init to move gitdir symlink' '
 	rm -rf newdir realgitdir &&
 	git init newdir &&
@@ -411,10 +420,13 @@ test_expect_success 're-init to move gitdir symlink' '
 	ln -s here .git &&
 	git init -L ../realgitdir
 	) &&
-	echo "gitdir: `pwd`/realgitdir" >expected &&
-	test_cmp expected newdir/.git &&
 	test -d realgitdir/refs &&
 	! test -d newdir/here
 '
 
+test_expect_success C_LOCALE_OUTPUT 're-init to move gitdir symlink: output' '
+	echo "gitdir: `pwd`/realgitdir" >expected &&
+	test_cmp expected newdir/.git
+'
+
 test_done
diff --git a/t/t5601-clone.sh b/t/t5601-clone.sh
index 5a068b2..a50e36e 100755
--- a/t/t5601-clone.sh
+++ b/t/t5601-clone.sh
@@ -194,11 +194,14 @@ test_expect_success 'do not respect url-encoding of non-url path' '
 test_expect_success 'clone separate gitdir' '
 	rm -rf dst &&
 	git clone --separate-git-dir realgitdir src dst &&
-	echo "gitdir: `pwd`/realgitdir" >expected &&
-	test_cmp expected dst/.git &&
 	test -d realgitdir/refs
 '
 
+test_expect_success C_LOCALE_OUTPUT 'clone separate gitdir: output' '
+	echo "gitdir: `pwd`/realgitdir" >expected &&
+	test_cmp expected dst/.git
+'
+
 test_expect_success 'clone separate gitdir where target already exists' '
 	rm -rf dst &&
 	test_must_fail git clone --separate-git-dir realgitdir src dst
-- 
1.7.4.1

  reply	other threads:[~2011-04-10 19:34 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-10 19:34 [PATCH/RFC 0/7] i18n: mark missing C messages Ævar Arnfjörð Bjarmason
2011-04-10 19:34 ` Ævar Arnfjörð Bjarmason [this message]
2011-04-12  7:12   ` [PATCH/RFC 1/7] i18n: mark init-db messages for translation Junio C Hamano
2011-04-12  7:15     ` Junio C Hamano
2011-04-12  7:44       ` Ævar Arnfjörð Bjarmason
2011-04-12 18:20         ` Junio C Hamano
2011-04-12 22:55           ` Junio C Hamano
2011-04-12 23:04             ` Junio C Hamano
2011-04-14 20:56               ` [PATCH] i18n: use test_i18n{grep,cmp} in t7508 Junio C Hamano
2011-04-10 19:34 ` [PATCH/RFC 2/7] i18n: mark merge "Could not read from" message for translation Ævar Arnfjörð Bjarmason
2011-04-10 19:34 ` [PATCH/RFC 3/7] i18n: mark merge "upstream" messages " Ævar Arnfjörð Bjarmason
2011-04-10 19:34 ` [PATCH/RFC 4/7] i18n: mark merge CHERRY_PICK_HEAD " Ævar Arnfjörð Bjarmason
2011-04-10 19:34 ` [PATCH/RFC 5/7] i18n: mark clone nonexistent repository message " Ævar Arnfjörð Bjarmason
2011-04-10 19:34 ` [PATCH/RFC 6/7] i18n: mark checkout --detach messages " Ævar Arnfjörð Bjarmason
2011-04-10 19:34 ` [PATCH/RFC 7/7] i18n: mark checkout plural warning " Ævar Arnfjörð Bjarmason
2011-04-12  7:19   ` Junio C Hamano
2011-04-12  7:54     ` Ævar Arnfjörð Bjarmason
2011-04-12 20:57       ` Junio C Hamano
2011-04-13  8:30         ` Ævar Arnfjörð Bjarmason
2011-04-13 15:55           ` Junio C Hamano
2011-04-12  7:27 ` [PATCH/RFC 0/7] i18n: mark missing C messages Junio C Hamano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1302464048-21806-2-git-send-email-avarab@gmail.com \
    --to=avarab@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).