git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH/RFC 1/7] i18n: mark init-db messages for translation

From
Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Date
Apr 10, 2011, 19:34 UTC
Message-ID
<1302464048-21806-2-git-send-email-avarab@gmail.com>
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
Previous: Ævar Arnfjörð BjarmasonNext: Junio C Hamano
Message 2 of 21 in “i18n: mark missing C messages”
  1. 0/7 i18n: mark missing C messagesÆvar Arnfjörð Bjarmason, Apr 10, 2011
  2. 1/7 i18n: mark init-db messages for translationÆvar Arnfjörð Bjarmason, Apr 10, 2011
  3. Junio C HamanoApr 12, 2011
  4. Junio C HamanoApr 12, 2011
  5. Ævar Arnfjörð BjarmasonApr 12, 2011
  6. Junio C HamanoApr 12, 2011
  7. Junio C HamanoApr 12, 2011
  8. Junio C HamanoApr 12, 2011
  9. i18n: use test_i18n{grep,cmp} in t7508Junio C Hamano, Apr 14, 2011
  10. 2/7 i18n: mark merge "Could not read from" message for translationÆvar Arnfjörð Bjarmason, Apr 10, 2011
  11. 3/7 i18n: mark merge "upstream" messages for translationÆvar Arnfjörð Bjarmason, Apr 10, 2011
  12. 4/7 i18n: mark merge CHERRY_PICK_HEAD messages for translationÆvar Arnfjörð Bjarmason, Apr 10, 2011
  13. 5/7 i18n: mark clone nonexistent repository message for translationÆvar Arnfjörð Bjarmason, Apr 10, 2011
  14. 6/7 i18n: mark checkout --detach messages for translationÆvar Arnfjörð Bjarmason, Apr 10, 2011
  15. 7/7 i18n: mark checkout plural warning for translationÆvar Arnfjörð Bjarmason, Apr 10, 2011
  16. Junio C HamanoApr 12, 2011
  17. Ævar Arnfjörð BjarmasonApr 12, 2011
  18. Junio C HamanoApr 12, 2011
  19. Ævar Arnfjörð BjarmasonApr 13, 2011
  20. Junio C HamanoApr 13, 2011
  21. Junio C HamanoApr 12, 2011

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.