Merge branch 'jk/maint-1.7.2-status-ignored' into maint
* jk/maint-1.7.2-status-ignored: git status --ignored: tests and docs status: fix bug with missing --ignore files Conflicts: Documentation/git-status.txt t/t7508-status.sh
This commit is contained in:
commit
3fc44a10f6
@ -70,6 +70,9 @@ configuration variable documented in linkgit:git-config[1].
|
|||||||
(and suppresses the output of submodule summaries when the config option
|
(and suppresses the output of submodule summaries when the config option
|
||||||
`status.submodulesummary` is set).
|
`status.submodulesummary` is set).
|
||||||
|
|
||||||
|
--ignored::
|
||||||
|
Show ignored files as well.
|
||||||
|
|
||||||
-z::
|
-z::
|
||||||
Terminate entries with NUL, instead of LF. This implies
|
Terminate entries with NUL, instead of LF. This implies
|
||||||
the `--porcelain` output format if no other format is given.
|
the `--porcelain` output format if no other format is given.
|
||||||
@ -120,7 +123,8 @@ codes can be interpreted as follows:
|
|||||||
* 'C' = copied
|
* 'C' = copied
|
||||||
* 'U' = updated but unmerged
|
* 'U' = updated but unmerged
|
||||||
|
|
||||||
Ignored files are not listed.
|
Ignored files are not listed, unless `--ignored` option is in effect,
|
||||||
|
in which case `XY` are `!!`.
|
||||||
|
|
||||||
X Y Meaning
|
X Y Meaning
|
||||||
-------------------------------------------------
|
-------------------------------------------------
|
||||||
@ -143,6 +147,7 @@ Ignored files are not listed.
|
|||||||
U U unmerged, both modified
|
U U unmerged, both modified
|
||||||
-------------------------------------------------
|
-------------------------------------------------
|
||||||
? ? untracked
|
? ? untracked
|
||||||
|
! ! ignored
|
||||||
-------------------------------------------------
|
-------------------------------------------------
|
||||||
|
|
||||||
If -b is used the short-format status is preceded by a line
|
If -b is used the short-format status is preceded by a line
|
||||||
|
@ -131,6 +131,127 @@ test_expect_success 'status -s' '
|
|||||||
|
|
||||||
'
|
'
|
||||||
|
|
||||||
|
test_expect_success 'status with gitignore' '
|
||||||
|
{
|
||||||
|
echo ".gitignore" &&
|
||||||
|
echo "expect" &&
|
||||||
|
echo "output" &&
|
||||||
|
echo "untracked"
|
||||||
|
} >.gitignore &&
|
||||||
|
|
||||||
|
cat >expect <<-\EOF &&
|
||||||
|
M dir1/modified
|
||||||
|
A dir2/added
|
||||||
|
?? dir2/modified
|
||||||
|
EOF
|
||||||
|
git status -s >output &&
|
||||||
|
test_cmp expect output &&
|
||||||
|
|
||||||
|
cat >expect <<-\EOF &&
|
||||||
|
M dir1/modified
|
||||||
|
A dir2/added
|
||||||
|
?? dir2/modified
|
||||||
|
!! .gitignore
|
||||||
|
!! dir1/untracked
|
||||||
|
!! dir2/untracked
|
||||||
|
!! expect
|
||||||
|
!! output
|
||||||
|
!! untracked
|
||||||
|
EOF
|
||||||
|
git status -s --ignored >output &&
|
||||||
|
test_cmp expect output &&
|
||||||
|
|
||||||
|
cat >expect <<-\EOF &&
|
||||||
|
# On branch master
|
||||||
|
# Changes to be committed:
|
||||||
|
# (use "git reset HEAD <file>..." to unstage)
|
||||||
|
#
|
||||||
|
# new file: dir2/added
|
||||||
|
#
|
||||||
|
# Changes not staged for commit:
|
||||||
|
# (use "git add <file>..." to update what will be committed)
|
||||||
|
# (use "git checkout -- <file>..." to discard changes in working directory)
|
||||||
|
#
|
||||||
|
# modified: dir1/modified
|
||||||
|
#
|
||||||
|
# Untracked files:
|
||||||
|
# (use "git add <file>..." to include in what will be committed)
|
||||||
|
#
|
||||||
|
# dir2/modified
|
||||||
|
# Ignored files:
|
||||||
|
# (use "git add -f <file>..." to include in what will be committed)
|
||||||
|
#
|
||||||
|
# .gitignore
|
||||||
|
# dir1/untracked
|
||||||
|
# dir2/untracked
|
||||||
|
# expect
|
||||||
|
# output
|
||||||
|
# untracked
|
||||||
|
EOF
|
||||||
|
git status --ignored >output &&
|
||||||
|
test_cmp expect output
|
||||||
|
'
|
||||||
|
|
||||||
|
test_expect_success 'status with gitignore (nothing untracked)' '
|
||||||
|
{
|
||||||
|
echo ".gitignore" &&
|
||||||
|
echo "expect" &&
|
||||||
|
echo "dir2/modified" &&
|
||||||
|
echo "output" &&
|
||||||
|
echo "untracked"
|
||||||
|
} >.gitignore &&
|
||||||
|
|
||||||
|
cat >expect <<-\EOF &&
|
||||||
|
M dir1/modified
|
||||||
|
A dir2/added
|
||||||
|
EOF
|
||||||
|
git status -s >output &&
|
||||||
|
test_cmp expect output &&
|
||||||
|
|
||||||
|
cat >expect <<-\EOF &&
|
||||||
|
M dir1/modified
|
||||||
|
A dir2/added
|
||||||
|
!! .gitignore
|
||||||
|
!! dir1/untracked
|
||||||
|
!! dir2/modified
|
||||||
|
!! dir2/untracked
|
||||||
|
!! expect
|
||||||
|
!! output
|
||||||
|
!! untracked
|
||||||
|
EOF
|
||||||
|
git status -s --ignored >output &&
|
||||||
|
test_cmp expect output &&
|
||||||
|
|
||||||
|
cat >expect <<-\EOF &&
|
||||||
|
# On branch master
|
||||||
|
# Changes to be committed:
|
||||||
|
# (use "git reset HEAD <file>..." to unstage)
|
||||||
|
#
|
||||||
|
# new file: dir2/added
|
||||||
|
#
|
||||||
|
# Changes not staged for commit:
|
||||||
|
# (use "git add <file>..." to update what will be committed)
|
||||||
|
# (use "git checkout -- <file>..." to discard changes in working directory)
|
||||||
|
#
|
||||||
|
# modified: dir1/modified
|
||||||
|
#
|
||||||
|
# Ignored files:
|
||||||
|
# (use "git add -f <file>..." to include in what will be committed)
|
||||||
|
#
|
||||||
|
# .gitignore
|
||||||
|
# dir1/untracked
|
||||||
|
# dir2/modified
|
||||||
|
# dir2/untracked
|
||||||
|
# expect
|
||||||
|
# output
|
||||||
|
# untracked
|
||||||
|
EOF
|
||||||
|
git status --ignored >output &&
|
||||||
|
test_cmp expect output
|
||||||
|
'
|
||||||
|
|
||||||
|
rm -f .gitignore
|
||||||
|
|
||||||
cat >expect <<\EOF
|
cat >expect <<\EOF
|
||||||
## master
|
## master
|
||||||
M dir1/modified
|
M dir1/modified
|
||||||
|
@ -642,7 +642,7 @@ static void wt_status_print_other(struct wt_status *s,
|
|||||||
int i;
|
int i;
|
||||||
struct strbuf buf = STRBUF_INIT;
|
struct strbuf buf = STRBUF_INIT;
|
||||||
|
|
||||||
if (!s->untracked.nr)
|
if (!l->nr)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
wt_status_print_other_header(s, what, how);
|
wt_status_print_other_header(s, what, how);
|
||||||
|
Loading…
Reference in New Issue
Block a user