summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 7f5673d)
raw | patch | inline | side by side (parent: 7f5673d)
author | Ævar Arnfjörð Bjarmason <avarab@gmail.com> | |
Tue, 22 Feb 2011 23:41:48 +0000 (23:41 +0000) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Thu, 10 Mar 2011 07:52:54 +0000 (23:52 -0800) |
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>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
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>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/commit.c | patch | blob | history | |
t/t7500-commit.sh | patch | blob | history | |
t/t7502-commit.sh | patch | blob | history |
diff --git a/builtin/commit.c b/builtin/commit.c
index 4986cd442c42ecb7b6240c9703884a98f7974bae..fc301e7c8cadd76747a1b4810922d125f42894a5 100644 (file)
--- a/builtin/commit.c
+++ b/builtin/commit.c
fprintf(s->fp, "\n");
status_printf(s, GIT_COLOR_NORMAL,
- "Please enter the commit message for your changes.");
+ _("Please enter the commit message for your changes."));
if (cleanup_mode == CLEANUP_ALL)
status_printf_more(s, GIT_COLOR_NORMAL,
- " 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. */
status_printf_more(s, GIT_COLOR_NORMAL,
- " 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)
status_printf_ln(s, GIT_COLOR_NORMAL,
"%s", only_include_assumed);
diff --git a/t/t7500-commit.sh b/t/t7500-commit.sh
index d551b77ce6d94acce80069f2197f0169ee59e6d5..a101256df6205ec37b13c488c7812372df55a869 100755 (executable)
--- a/t/t7500-commit.sh
+++ b/t/t7500-commit.sh
)
'
-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"
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 &&
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 &&
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 dad1b2b80d0754001adde2e09b2a331d0e4207bf..1f29b5cd9456a27bd67df8064bcc6434680dfd7d 100755 (executable)
--- a/t/t7502-commit.sh
+++ b/t/t7502-commit.sh
'
-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 "#
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
'
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
'