File tree Expand file tree Collapse file tree 5 files changed +24
-2
lines changed Expand file tree Collapse file tree 5 files changed +24
-2
lines changed Original file line number Diff line number Diff line change @@ -61,6 +61,9 @@ OPTIONS
61
61
the working tree. Note that older versions of Git used
62
62
to ignore removed files; use `--no-all` option if you want
63
63
to add modified or new files but ignore removed ones.
64
+ +
65
+ For more details about the <pathspec> syntax, see the 'pathspec' entry
66
+ in linkgit:gitglossary[7].
64
67
65
68
-n::
66
69
--dry-run::
Original file line number Diff line number Diff line change @@ -296,6 +296,9 @@ providing this option will cause it to die.
296
296
<pathspec>...::
297
297
If given, limit the search to paths matching at least one pattern.
298
298
Both leading paths match and glob(7) patterns are supported.
299
+ +
300
+ For more details about the <pathspec> syntax, see the 'pathspec' entry
301
+ in linkgit:gitglossary[7].
299
302
300
303
Examples
301
304
--------
@@ -312,6 +315,9 @@ Examples
312
315
Looks for a line that has `NODE` or `Unexpected` in
313
316
files that have lines that match both.
314
317
318
+ `git grep solution -- :^Documentation`::
319
+ Looks for `solution`, excluding files in `Documentation`.
320
+
315
321
GIT
316
322
---
317
323
Part of the linkgit:git[1] suite
Original file line number Diff line number Diff line change @@ -111,6 +111,8 @@ configuration variable documented in linkgit:git-config[1].
111
111
without options are equivalent to 'always' and 'never'
112
112
respectively.
113
113
114
+ <pathspec>...::
115
+ See the 'pathspec' entry in linkgit:gitglossary[7].
114
116
115
117
OUTPUT
116
118
------
Original file line number Diff line number Diff line change @@ -407,7 +407,7 @@ these forms:
407
407
408
408
exclude;;
409
409
After a path matches any non-exclude pathspec, it will be run
410
- through all exclude pathspec (magic signature: `!` or its
410
+ through all exclude pathspecs (magic signature: `!` or its
411
411
synonym `^`). If it matches, the path is ignored. When there
412
412
is no non-exclude pathspec, the exclusion is applied to the
413
413
result set as if invoked without any pathspec.
Original file line number Diff line number Diff line change 25
25
test_cmp expect actual
26
26
'
27
27
28
- test_expect_success ' exclude only no longer errors out ' '
28
+ test_expect_success ' exclude only pathspec uses default implicit pathspec ' '
29
29
git log --oneline --format=%s -- . ":(exclude)sub" >expect &&
30
30
git log --oneline --format=%s -- ":(exclude)sub" >actual &&
31
31
test_cmp expect actual
183
183
test_cmp expect actual
184
184
'
185
185
186
+ test_expect_success ' multiple exclusions' '
187
+ git ls-files -- ":^*/file2" ":^sub2" >actual &&
188
+ cat <<-\EOF >expect &&
189
+ file
190
+ sub/file
191
+ sub/sub/file
192
+ sub/sub/sub/file
193
+ EOF
194
+ test_cmp expect actual
195
+ '
196
+
186
197
test_done
You can’t perform that action at this time.
0 commit comments