summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 1282988)
raw | patch | inline | side by side (parent: 1282988)
author | Junio C Hamano <gitster@pobox.com> | |
Thu, 2 Jun 2011 16:07:11 +0000 (09:07 -0700) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Thu, 2 Jun 2011 18:59:19 +0000 (11:59 -0700) |
Helped-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Documentation/git-status.txt | patch | blob | history | |
t/t7508-status.sh | patch | blob | history |
index 1cab91b53455e0129e6c4940a2698620e2197624..b663e5144480e915790ca592af3eccb270207dc9 100644 (file)
used to change the default for when the option is not
specified.
+--ignored::
+ Show ignored files as well.
+
-z::
Terminate entries with NUL, instead of LF. This implies
the `--porcelain` output format if no other format is given.
For entries that do not have conflicts, `X` shows the status of the index,
and `Y` shows the status of the work tree. For untracked paths, `XY` are
`??`.
+For ignored paths, `XY` are `!!`; they are shown only when the `--ignored`
+option is in effect.
X Y Meaning
-------------------------------------------------
U U unmerged, both modified
-------------------------------------------------
? ? untracked
+ ! ! ignored
-------------------------------------------------
diff --git a/t/t7508-status.sh b/t/t7508-status.sh
index 556d0faa77e027c8a18e213088fa6bbc5d7e7af5..4856f9eeeaad1d0ffbf88b9371e664edf557119f 100755 (executable)
--- a/t/t7508-status.sh
+++ b/t/t7508-status.sh
'
+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
+ #
+ # Changed but not updated:
+ # (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
+ #
+ # Changed but not updated:
+ # (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
# On branch master
# Changes to be committed: