i18n: git-status basic messages

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>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Ævar Arnfjörð Bjarmason
2011-02-22 23:42:13 +00:00
committed by Junio C Hamano
parent b32227e770
commit 355ec7a130
4 changed files with 119 additions and 104 deletions

View File

@ -38,7 +38,7 @@ cat >expect <<EOF
no changes added to commit (use "git add" and/or "git commit -a") no changes added to commit (use "git add" and/or "git commit -a")
EOF EOF
test_expect_success 'M/D conflict does not segfault' ' test_expect_success C_LOCALE_OUTPUT 'M/D conflict does not segfault' '
mkdir mdconflict && mkdir mdconflict &&
( (
cd mdconflict && cd mdconflict &&

View File

@ -30,7 +30,7 @@ test_expect_success 'commit --dry-run -a clean' '
grep "nothing to commit" output 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) && (cd sub && git reset --hard) &&
echo "changed" >sub/foo && echo "changed" >sub/foo &&
git status >output && git status >output &&
@ -46,7 +46,7 @@ test_expect_success 'status with modified file in submodule (porcelain)' '
EOF 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) && (cd sub && git reset --hard && echo >foo && git add foo) &&
git status >output && git status >output &&
grep "modified: sub (modified content)" output grep "modified: sub (modified content)" output
@ -60,14 +60,14 @@ test_expect_success 'status with added file in submodule (porcelain)' '
EOF 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) && (cd sub && git reset --hard) &&
echo "content" >sub/new-file && echo "content" >sub/new-file &&
git status >output && git status >output &&
grep "modified: sub (untracked content)" 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 && git status -uno >output &&
grep "^nothing to commit" output grep "^nothing to commit" output
' '
@ -79,7 +79,7 @@ test_expect_success 'status with untracked file in submodule (porcelain)' '
EOF 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) && (cd sub && git reset --hard && echo >foo && git add foo) &&
echo "content" >sub/new-file && echo "content" >sub/new-file &&
git status >output && git status >output &&
@ -95,7 +95,7 @@ test_expect_success 'status with added and untracked file in submodule (porcelai
EOF 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) && (cd sub && git reset --hard) &&
rm sub/new-file && rm sub/new-file &&
(cd sub && echo "next change" >foo && git commit -m "next change" foo) && (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 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) && (cd sub && git reset --hard && echo >foo && git add foo) &&
git status >output && git status >output &&
grep "modified: sub (new commits, modified content)" 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 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) && (cd sub && git reset --hard) &&
echo "content" >sub/new-file && echo "content" >sub/new-file &&
git status >output && git status >output &&
@ -141,7 +141,7 @@ test_expect_success 'status with untracked file in modified submodule (porcelain
EOF 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) && (cd sub && git reset --hard && echo >foo && git add foo) &&
echo "content" >sub/new-file && echo "content" >sub/new-file &&
git status >output && git status >output &&
@ -167,7 +167,7 @@ test_expect_success 'setup .git file for sub' '
git commit -m "added .real to .gitignore" .gitignore 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) && (cd sub && git reset --hard && echo >foo && git add foo) &&
git status >output && git status >output &&
grep "modified: sub (new commits, modified content)" output grep "modified: sub (new commits, modified content)" output

View File

@ -55,7 +55,7 @@ test_expect_success 'setup' '
git add dir2/added 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 grep "use \"git rm --cached <file>\.\.\.\" to unstage" output
@ -85,7 +85,7 @@ cat >expect <<\EOF
# untracked # untracked
EOF EOF
test_expect_success 'status (2)' ' test_expect_success C_LOCALE_OUTPUT 'status (2)' '
git status >output && git status >output &&
test_cmp expect output test_cmp expect output
@ -111,7 +111,7 @@ EOF
git config advice.statusHints false 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 && git status >output &&
test_cmp expect 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 cat >expect <<EOF
# On branch master # On branch master
# Changes to be committed: # Changes to be committed:
@ -172,16 +178,14 @@ cat >expect <<EOF
# #
# Untracked files not listed (use -u option to show untracked files) # Untracked files not listed (use -u option to show untracked files)
EOF EOF
test_expect_success 'status -uno' ' test_expect_success C_LOCALE_OUTPUT 'status -uno' '
mkdir dir3 &&
: >dir3/untracked1 &&
: >dir3/untracked2 &&
git status -uno >output && git status -uno >output &&
test_cmp expect 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 git config status.showuntrackedfiles no
test_when_finished "git config --unset status.showuntrackedfiles" &&
git status >output && git status >output &&
test_cmp expect output test_cmp expect output
' '
@ -197,7 +201,7 @@ cat >expect <<EOF
# Untracked files not listed # Untracked files not listed
EOF EOF
git config advice.statusHints false 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 && git status -uno >output &&
test_cmp expect output test_cmp expect output
' '
@ -208,7 +212,6 @@ cat >expect << EOF
A dir2/added A dir2/added
EOF EOF
test_expect_success 'status -s -uno' ' test_expect_success 'status -s -uno' '
git config --unset status.showuntrackedfiles
git status -s -uno >output && git status -s -uno >output &&
test_cmp expect output test_cmp expect output
' '
@ -243,13 +246,14 @@ cat >expect <<EOF
# output # output
# untracked # untracked
EOF EOF
test_expect_success 'status -unormal' ' test_expect_success C_LOCALE_OUTPUT 'status -unormal' '
git status -unormal >output && git status -unormal >output &&
test_cmp expect 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 git config status.showuntrackedfiles normal
test_when_finished "git config --unset status.showuntrackedfiles" &&
git status >output && git status >output &&
test_cmp expect output test_cmp expect output
' '
@ -266,7 +270,6 @@ A dir2/added
?? untracked ?? untracked
EOF EOF
test_expect_success 'status -s -unormal' ' test_expect_success 'status -s -unormal' '
git config --unset status.showuntrackedfiles
git status -s -unormal >output && git status -s -unormal >output &&
test_cmp expect output test_cmp expect output
' '
@ -302,18 +305,21 @@ cat >expect <<EOF
# output # output
# untracked # untracked
EOF EOF
test_expect_success 'status -uall' ' test_expect_success C_LOCALE_OUTPUT 'status -uall' '
git status -uall >output && git status -uall >output &&
test_cmp expect 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 git config status.showuntrackedfiles all
test_when_finished "git config --unset status.showuntrackedfiles" &&
git status >output && git status >output &&
rm -rf dir3 &&
git config --unset status.showuntrackedfiles &&
test_cmp expect output test_cmp expect output
' '
test_expect_success 'teardown dir3' '
rm -rf dir3
'
cat >expect <<EOF cat >expect <<EOF
M dir1/modified M dir1/modified
A dir2/added A dir2/added
@ -361,7 +367,7 @@ cat >expect <<\EOF
# ../untracked # ../untracked
EOF EOF
test_expect_success 'status with relative paths' ' test_expect_success C_LOCALE_OUTPUT 'status with relative paths' '
(cd dir1 && git status) >output && (cd dir1 && git status) >output &&
test_cmp expect output test_cmp expect output
@ -434,18 +440,19 @@ cat >expect <<\EOF
# <BLUE>untracked<RESET> # <BLUE>untracked<RESET>
EOF EOF
test_expect_success 'status with color.ui' ' test_expect_success C_LOCALE_OUTPUT 'status with color.ui' '
git config color.ui always && git config color.ui always &&
test_when_finished "git config --unset color.ui" &&
git status | test_decode_color >output && git status | test_decode_color >output &&
test_cmp expect 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 && git config color.status always &&
test_when_finished "git config --unset color.status" &&
git status | test_decode_color >output && git status | test_decode_color >output &&
test_cmp expect output test_cmp expect output
@ -464,7 +471,6 @@ EOF
test_expect_success 'status -s with color.ui' ' test_expect_success 'status -s with color.ui' '
git config --unset color.status &&
git config color.ui always && git config color.ui always &&
git status -s | test_decode_color >output && git status -s | test_decode_color >output &&
test_cmp expect output test_cmp expect output
@ -564,9 +570,10 @@ cat >expect <<\EOF
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 && (cd dir1 && git status) >output &&
test_cmp expect output test_cmp expect output
@ -585,6 +592,8 @@ EOF
test_expect_success 'status -s without relative paths' ' 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 && (cd dir1 && git status -s) >output &&
test_cmp expect output test_cmp expect output
@ -607,7 +616,10 @@ cat <<EOF >expect
# untracked # untracked
EOF EOF
test_expect_success 'dry-run of partial commit excluding new file in index' ' 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 test_cmp expect output
' '
@ -655,13 +667,13 @@ cat >expect <<EOF
# output # output
# untracked # untracked
EOF 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 && git status >output &&
test_cmp expect output test_cmp expect output
' '
# we expect the same as the previous test # 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 && git status --untracked-files=all >output &&
test_cmp expect output test_cmp expect output
' '
@ -719,7 +731,7 @@ cat >expect <<EOF
# output # output
# untracked # untracked
EOF EOF
test_expect_success 'status submodule summary' ' test_expect_success C_LOCALE_OUTPUT 'status submodule summary' '
git config status.submodulesummary 10 && git config status.submodulesummary 10 &&
git status >output && git status >output &&
test_cmp expect output test_cmp expect output
@ -760,8 +772,11 @@ cat >expect <<EOF
# untracked # untracked
no changes added to commit (use "git add" and/or "git commit -a") no changes added to commit (use "git add" and/or "git commit -a")
EOF EOF
test_expect_success 'status submodule summary (clean submodule)' ' test_expect_success 'status submodule summary (clean submodule): commit' '
git commit -m "commit submodule" && git commit -m "commit submodule"
'
test_expect_success C_LOCALE_OUTPUT 'status submodule summary (clean submodule): output' '
git config status.submodulesummary 10 && git config status.submodulesummary 10 &&
test_must_fail git commit --dry-run >output && test_must_fail git commit --dry-run >output &&
test_cmp expect output && test_cmp expect output &&
@ -812,7 +827,7 @@ cat >expect <<EOF
# output # output
# untracked # untracked
EOF 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 config status.submodulesummary 10 &&
git commit --dry-run --amend >output && git commit --dry-run --amend >output &&
test_cmp expect output test_cmp expect output
@ -867,13 +882,13 @@ cat > expect << EOF
# untracked # untracked
EOF 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 && echo modified > sm/untracked &&
git status --ignore-submodules=untracked > output && git status --ignore-submodules=untracked > output &&
test_cmp expect 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 config diff.ignoreSubmodules dirty &&
git status >output && git status >output &&
test_cmp expect output && test_cmp expect output &&
@ -885,7 +900,7 @@ test_expect_success '.gitmodules ignore=untracked suppresses submodules with unt
git config --unset diff.ignoreSubmodules 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.ignore none &&
git config --add -f .gitmodules submodule.subname.path sm && git config --add -f .gitmodules submodule.subname.path sm &&
git config --add submodule.subname.ignore untracked && 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 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 && git status --ignore-submodules=dirty > output &&
test_cmp expect 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 config diff.ignoreSubmodules dirty &&
git status >output && git status >output &&
! test -s actual && ! test -s actual &&
@ -913,7 +928,7 @@ test_expect_success '.gitmodules ignore=dirty suppresses submodules with untrack
git config --unset diff.ignoreSubmodules 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.ignore none &&
git config --add -f .gitmodules submodule.subname.path sm && git config --add -f .gitmodules submodule.subname.path sm &&
git config --add submodule.subname.ignore dirty && 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 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 && echo modified > sm/foo &&
git status --ignore-submodules=dirty > output && git status --ignore-submodules=dirty > output &&
test_cmp expect 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.ignore dirty &&
git config --add -f .gitmodules submodule.subname.path sm && git config --add -f .gitmodules submodule.subname.path sm &&
git status > output && 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 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.ignore none &&
git config --add -f .gitmodules submodule.subname.path sm && git config --add -f .gitmodules submodule.subname.path sm &&
git config --add submodule.subname.ignore dirty && git config --add submodule.subname.ignore dirty &&
@ -981,12 +996,12 @@ cat > expect << EOF
# untracked # untracked
EOF 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 && git status --ignore-submodules=untracked > output &&
test_cmp expect 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.ignore untracked &&
git config --add -f .gitmodules submodule.subname.path sm && git config --add -f .gitmodules submodule.subname.path sm &&
git status > output && 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 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.ignore none &&
git config --add -f .gitmodules submodule.subname.path sm && git config --add -f .gitmodules submodule.subname.path sm &&
git config --add submodule.subname.ignore untracked && git config --add submodule.subname.ignore untracked &&
@ -1043,12 +1058,12 @@ cat > expect << EOF
# untracked # untracked
EOF 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 && git status --ignore-submodules=untracked > output &&
test_cmp expect 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.ignore untracked &&
git config --add -f .gitmodules submodule.subname.path sm && git config --add -f .gitmodules submodule.subname.path sm &&
git status > output && 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 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.ignore none &&
git config --add -f .gitmodules submodule.subname.path sm && git config --add -f .gitmodules submodule.subname.path sm &&
git config --add submodule.subname.ignore untracked && 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 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 && git status --ignore-submodules=dirty > output &&
test_cmp expect 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.ignore dirty &&
git config --add -f .gitmodules submodule.subname.path sm && git config --add -f .gitmodules submodule.subname.path sm &&
git status > output && 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 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.ignore none &&
git config --add -f .gitmodules submodule.subname.path sm && git config --add -f .gitmodules submodule.subname.path sm &&
git config --add submodule.subname.ignore dirty && 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") no changes added to commit (use "git add" and/or "git commit -a")
EOF 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 && git status --ignore-submodules=all > output &&
test_cmp expect output test_cmp expect output
' '

View File

@ -131,16 +131,16 @@ static void wt_status_print_unmerged_header(struct wt_status *s)
{ {
const char *c = color(WT_STATUS_HEADER, s); const char *c = color(WT_STATUS_HEADER, s);
status_printf_ln(s, c, "Unmerged paths:"); status_printf_ln(s, c, _("Unmerged paths:"));
if (!advice_status_hints) if (!advice_status_hints)
return; return;
if (s->in_merge) if (s->in_merge)
; ;
else if (!s->is_initial) else if (!s->is_initial)
status_printf_ln(s, c, " (use \"git reset %s <file>...\" to unstage)", s->reference); status_printf_ln(s, c, _(" (use \"git reset %s <file>...\" to unstage)"), s->reference);
else else
status_printf_ln(s, c, " (use \"git rm --cached <file>...\" to unstage)"); status_printf_ln(s, c, _(" (use \"git rm --cached <file>...\" to unstage)"));
status_printf_ln(s, c, " (use \"git add/rm <file>...\" as appropriate to mark resolution)"); status_printf_ln(s, c, _(" (use \"git add/rm <file>...\" as appropriate to mark resolution)"));
status_printf_ln(s, c, ""); status_printf_ln(s, c, "");
} }
@ -154,9 +154,9 @@ static void wt_status_print_cached_header(struct wt_status *s)
if (s->in_merge) if (s->in_merge)
; /* NEEDSWORK: use "git reset --unresolve"??? */ ; /* NEEDSWORK: use "git reset --unresolve"??? */
else if (!s->is_initial) else if (!s->is_initial)
status_printf_ln(s, c, " (use \"git reset %s <file>...\" to unstage)", s->reference); status_printf_ln(s, c, _(" (use \"git reset %s <file>...\" to unstage)"), s->reference);
else else
status_printf_ln(s, c, " (use \"git rm --cached <file>...\" to unstage)"); status_printf_ln(s, c, _(" (use \"git rm --cached <file>...\" to unstage)"));
status_printf_ln(s, c, ""); status_printf_ln(s, c, "");
} }
@ -166,16 +166,16 @@ static void wt_status_print_dirty_header(struct wt_status *s,
{ {
const char *c = color(WT_STATUS_HEADER, s); const char *c = color(WT_STATUS_HEADER, s);
status_printf_ln(s, c, "Changes not staged for commit:"); status_printf_ln(s, c, _("Changes not staged for commit:"));
if (!advice_status_hints) if (!advice_status_hints)
return; return;
if (!has_deleted) if (!has_deleted)
status_printf_ln(s, c, " (use \"git add <file>...\" to update what will be committed)"); status_printf_ln(s, c, _(" (use \"git add <file>...\" to update what will be committed)"));
else else
status_printf_ln(s, c, " (use \"git add/rm <file>...\" to update what will be committed)"); status_printf_ln(s, c, _(" (use \"git add/rm <file>...\" to update what will be committed)"));
status_printf_ln(s, c, " (use \"git checkout -- <file>...\" to discard changes in working directory)"); status_printf_ln(s, c, _(" (use \"git checkout -- <file>...\" to discard changes in working directory)"));
if (has_dirty_submodules) if (has_dirty_submodules)
status_printf_ln(s, c, " (commit or discard the untracked or modified content in submodules)"); status_printf_ln(s, c, _(" (commit or discard the untracked or modified content in submodules)"));
status_printf_ln(s, c, ""); status_printf_ln(s, c, "");
} }
@ -184,10 +184,10 @@ static void wt_status_print_other_header(struct wt_status *s,
const char *how) const char *how)
{ {
const char *c = color(WT_STATUS_HEADER, s); const char *c = color(WT_STATUS_HEADER, s);
status_printf_ln(s, c, "%s files:", what); status_printf_ln(s, c, _("%s files:"), what);
if (!advice_status_hints) if (!advice_status_hints)
return; return;
status_printf_ln(s, c, " (use \"git %s <file>...\" to include in what will be committed)", how); status_printf_ln(s, c, _(" (use \"git %s <file>...\" to include in what will be committed)"), how);
status_printf_ln(s, c, ""); status_printf_ln(s, c, "");
} }
@ -204,18 +204,18 @@ static void wt_status_print_unmerged_data(struct wt_status *s,
const char *c = color(WT_STATUS_UNMERGED, s); const char *c = color(WT_STATUS_UNMERGED, s);
struct wt_status_change_data *d = it->util; struct wt_status_change_data *d = it->util;
struct strbuf onebuf = STRBUF_INIT; struct strbuf onebuf = STRBUF_INIT;
const char *one, *how = "bug"; const char *one, *how = _("bug");
one = quote_path(it->string, -1, &onebuf, s->prefix); one = quote_path(it->string, -1, &onebuf, s->prefix);
status_printf(s, color(WT_STATUS_HEADER, s), "\t"); status_printf(s, color(WT_STATUS_HEADER, s), "\t");
switch (d->stagemask) { switch (d->stagemask) {
case 1: how = "both deleted:"; break; case 1: how = _("both deleted:"); break;
case 2: how = "added by us:"; break; case 2: how = _("added by us:"); break;
case 3: how = "deleted by them:"; break; case 3: how = _("deleted by them:"); break;
case 4: how = "added by them:"; break; case 4: how = _("added by them:"); break;
case 5: how = "deleted by us:"; break; case 5: how = _("deleted by us:"); break;
case 6: how = "both added:"; break; case 6: how = _("both added:"); break;
case 7: how = "both modified:"; break; case 7: how = _("both modified:"); break;
} }
status_printf_more(s, c, "%-20s%s\n", how, one); status_printf_more(s, c, "%-20s%s\n", how, one);
strbuf_release(&onebuf); strbuf_release(&onebuf);
@ -245,11 +245,11 @@ static void wt_status_print_change_data(struct wt_status *s,
if (d->new_submodule_commits || d->dirty_submodule) { if (d->new_submodule_commits || d->dirty_submodule) {
strbuf_addstr(&extra, " ("); strbuf_addstr(&extra, " (");
if (d->new_submodule_commits) if (d->new_submodule_commits)
strbuf_addf(&extra, "new commits, "); strbuf_addf(&extra, _("new commits, "));
if (d->dirty_submodule & DIRTY_SUBMODULE_MODIFIED) if (d->dirty_submodule & DIRTY_SUBMODULE_MODIFIED)
strbuf_addf(&extra, "modified content, "); strbuf_addf(&extra, _("modified content, "));
if (d->dirty_submodule & DIRTY_SUBMODULE_UNTRACKED) if (d->dirty_submodule & DIRTY_SUBMODULE_UNTRACKED)
strbuf_addf(&extra, "untracked content, "); strbuf_addf(&extra, _("untracked content, "));
strbuf_setlen(&extra, extra.len - 2); strbuf_setlen(&extra, extra.len - 2);
strbuf_addch(&extra, ')'); strbuf_addch(&extra, ')');
} }
@ -263,31 +263,31 @@ static void wt_status_print_change_data(struct wt_status *s,
status_printf(s, color(WT_STATUS_HEADER, s), "\t"); status_printf(s, color(WT_STATUS_HEADER, s), "\t");
switch (status) { switch (status) {
case DIFF_STATUS_ADDED: case DIFF_STATUS_ADDED:
status_printf_more(s, c, "new file: %s", one); status_printf_more(s, c, _("new file: %s"), one);
break; break;
case DIFF_STATUS_COPIED: case DIFF_STATUS_COPIED:
status_printf_more(s, c, "copied: %s -> %s", one, two); status_printf_more(s, c, _("copied: %s -> %s"), one, two);
break; break;
case DIFF_STATUS_DELETED: case DIFF_STATUS_DELETED:
status_printf_more(s, c, "deleted: %s", one); status_printf_more(s, c, _("deleted: %s"), one);
break; break;
case DIFF_STATUS_MODIFIED: case DIFF_STATUS_MODIFIED:
status_printf_more(s, c, "modified: %s", one); status_printf_more(s, c, _("modified: %s"), one);
break; break;
case DIFF_STATUS_RENAMED: case DIFF_STATUS_RENAMED:
status_printf_more(s, c, "renamed: %s -> %s", one, two); status_printf_more(s, c, "renamed: %s -> %s", one, two);
break; break;
case DIFF_STATUS_TYPE_CHANGED: case DIFF_STATUS_TYPE_CHANGED:
status_printf_more(s, c, "typechange: %s", one); status_printf_more(s, c, _("typechange: %s"), one);
break; break;
case DIFF_STATUS_UNKNOWN: case DIFF_STATUS_UNKNOWN:
status_printf_more(s, c, "unknown: %s", one); status_printf_more(s, c, _("unknown: %s"), one);
break; break;
case DIFF_STATUS_UNMERGED: case DIFF_STATUS_UNMERGED:
status_printf_more(s, c, "unmerged: %s", one); status_printf_more(s, c, _("unmerged: %s"), one);
break; break;
default: default:
die("bug: unhandled diff status %c", status); die(_("bug: unhandled diff status %c"), status);
} }
if (extra.len) { if (extra.len) {
status_printf_more(s, color(WT_STATUS_HEADER, s), "%s", extra.buf); status_printf_more(s, color(WT_STATUS_HEADER, s), "%s", extra.buf);
@ -707,14 +707,14 @@ void wt_status_print(struct wt_status *s)
const char *branch_status_color = color(WT_STATUS_HEADER, s); const char *branch_status_color = color(WT_STATUS_HEADER, s);
if (s->branch) { if (s->branch) {
const char *on_what = "On branch "; const char *on_what = _("On branch ");
const char *branch_name = s->branch; const char *branch_name = s->branch;
if (!prefixcmp(branch_name, "refs/heads/")) if (!prefixcmp(branch_name, "refs/heads/"))
branch_name += 11; branch_name += 11;
else if (!strcmp(branch_name, "HEAD")) { else if (!strcmp(branch_name, "HEAD")) {
branch_name = ""; branch_name = "";
branch_status_color = color(WT_STATUS_NOBRANCH, s); branch_status_color = color(WT_STATUS_NOBRANCH, s);
on_what = "Not currently on any branch."; on_what = _("Not currently on any branch.");
} }
status_printf(s, color(WT_STATUS_HEADER, s), ""); status_printf(s, color(WT_STATUS_HEADER, s), "");
status_printf_more(s, branch_status_color, "%s", on_what); status_printf_more(s, branch_status_color, "%s", on_what);
@ -739,29 +739,29 @@ void wt_status_print(struct wt_status *s)
wt_status_print_submodule_summary(s, 1); /* unstaged */ wt_status_print_submodule_summary(s, 1); /* unstaged */
} }
if (s->show_untracked_files) { 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) 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) } else if (s->commitable)
status_printf_ln(s, GIT_COLOR_NORMAL, "Untracked files not listed%s", status_printf_ln(s, GIT_COLOR_NORMAL, _("Untracked files not listed%s"),
advice_status_hints advice_status_hints
? " (use -u option to show untracked files)" : ""); ? _(" (use -u option to show untracked files)") : "");
if (s->verbose) if (s->verbose)
wt_status_print_verbose(s); wt_status_print_verbose(s);
if (!s->commitable) { if (!s->commitable) {
if (s->amend) if (s->amend)
status_printf_ln(s, GIT_COLOR_NORMAL, "No changes"); status_printf_ln(s, GIT_COLOR_NORMAL, _("No changes"));
else if (s->nowarn) else if (s->nowarn)
; /* nothing */ ; /* nothing */
else if (s->workdir_dirty) else if (s->workdir_dirty)
printf("no changes added to commit%s\n", printf(_("no changes added to commit%s\n"),
advice_status_hints advice_status_hints
? " (use \"git add\" and/or \"git commit -a\")" : ""); ? _(" (use \"git add\" and/or \"git commit -a\")") : "");
else if (s->untracked.nr) 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 advice_status_hints
? " (use \"git add\" to track)" : ""); ? _(" (use \"git add\" to track)") : "");
else if (s->is_initial) else if (s->is_initial)
printf("nothing to commit%s\n", advice_status_hints printf("nothing to commit%s\n", advice_status_hints
? " (create/copy files and use \"git add\" to track)" : ""); ? " (create/copy files and use \"git add\" to track)" : "");