Skip to content

Commit 1b2bc39

Browse files
jamillgitster
authored andcommitted
status: document options to show matching ignored files
Signed-off-by: Jameson Miller <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 07966ed commit 1b2bc39

File tree

2 files changed

+43
-5
lines changed

2 files changed

+43
-5
lines changed

Documentation/git-status.txt

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,8 +97,27 @@ configuration variable documented in linkgit:git-config[1].
9797
(and suppresses the output of submodule summaries when the config option
9898
`status.submoduleSummary` is set).
9999

100-
--ignored::
100+
--ignored[=<mode>]::
101101
Show ignored files as well.
102+
+
103+
The mode parameter is used to specify the handling of ignored files.
104+
It is optional: it defaults to 'traditional'.
105+
+
106+
The possible options are:
107+
+
108+
- 'traditional' - Shows ignored files and directories, unless
109+
--untracked-files=all is specifed, in which case
110+
individual files in ignored directories are
111+
displayed.
112+
- 'no' - Show no ignored files.
113+
- 'matching' - Shows ignored files and directories matching an
114+
ignore pattern.
115+
+
116+
When 'matching' mode is specified, paths that explicity match an
117+
ignored pattern are shown. If a directory matches an ignore pattern,
118+
then it is shown, but not paths contained in the ignored directory. If
119+
a directory does not match an ignore pattern, but all contents are
120+
ignored, then the directory is not shown, but all contents are shown.
102121

103122
-z::
104123
Terminate entries with NUL, instead of LF. This implies

Documentation/technical/api-directory-listing.txt

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,23 +22,42 @@ The notable options are:
2222

2323
`flags`::
2424

25-
A bit-field of options (the `*IGNORED*` flags are mutually exclusive):
25+
A bit-field of options:
2626

2727
`DIR_SHOW_IGNORED`:::
2828

29-
Return just ignored files in `entries[]`, not untracked files.
29+
Return just ignored files in `entries[]`, not untracked
30+
files. This flag is mutually exclusive with
31+
`DIR_SHOW_IGNORED_TOO`.
3032

3133
`DIR_SHOW_IGNORED_TOO`:::
3234

33-
Similar to `DIR_SHOW_IGNORED`, but return ignored files in `ignored[]`
34-
in addition to untracked files in `entries[]`.
35+
Similar to `DIR_SHOW_IGNORED`, but return ignored files in
36+
`ignored[]` in addition to untracked files in
37+
`entries[]`. This flag is mutually exclusive with
38+
`DIR_SHOW_IGNORED`.
3539

3640
`DIR_KEEP_UNTRACKED_CONTENTS`:::
3741

3842
Only has meaning if `DIR_SHOW_IGNORED_TOO` is also set; if this is set, the
3943
untracked contents of untracked directories are also returned in
4044
`entries[]`.
4145

46+
`DIR_SHOW_IGNORED_TOO_MODE_MATCHING`:::
47+
48+
Only has meaning if `DIR_SHOW_IGNORED_TOO` is also set; if
49+
this is set, returns ignored files and directories that match
50+
an exclude pattern. If a directory matches an exclude pattern,
51+
then the directory is returned and the contained paths are
52+
not. A directory that does not match an exclude pattern will
53+
not be returned even if all of its contents are ignored. In
54+
this case, the contents are returned as individual entries.
55+
+
56+
If this is set, files and directories that explicity match an ignore
57+
pattern are reported. Implicity ignored directories (directories that
58+
do not match an ignore pattern, but whose contents are all ignored)
59+
are not reported, instead all of the contents are reported.
60+
4261
`DIR_COLLECT_IGNORED`:::
4362

4463
Special mode for git-add. Return ignored files in `ignored[]` and

0 commit comments

Comments
 (0)