Merge branch 'mr/doc-negative-pathspec' into maint
authorJunio C Hamano <gitster@pobox.com>
Wed, 18 Oct 2017 05:19:12 +0000 (14:19 +0900)
committerJunio C Hamano <gitster@pobox.com>
Wed, 18 Oct 2017 05:19:12 +0000 (14:19 +0900)
Doc updates.

* mr/doc-negative-pathspec:
docs: improve discoverability of exclude pathspec

Documentation/git-add.txt
Documentation/git-grep.txt
Documentation/git-status.txt
Documentation/glossary-content.txt
t/t6132-pathspec-exclude.sh
index f4169fb1ec4c61068cc70756c31a5abcc31496f6..b700beaff5ad2eaa407bfb3818e016a5bb27d87c 100644 (file)
@@ -61,6 +61,9 @@ OPTIONS
        the working tree.  Note that older versions of Git used
        to ignore removed files; use `--no-all` option if you want
        to add modified or new files but ignore removed ones.
++
+For more details about the <pathspec> syntax, see the 'pathspec' entry
+in linkgit:gitglossary[7].
 
 -n::
 --dry-run::
index 5033483db496286910dd24507f3374e18ff6c2b5..5edb1da46fe0a7ccca2608807c28305be72483b5 100644 (file)
@@ -296,6 +296,9 @@ providing this option will cause it to die.
 <pathspec>...::
        If given, limit the search to paths matching at least one pattern.
        Both leading paths match and glob(7) patterns are supported.
++
+For more details about the <pathspec> syntax, see the 'pathspec' entry
+in linkgit:gitglossary[7].
 
 Examples
 --------
@@ -312,6 +315,9 @@ Examples
        Looks for a line that has `NODE` or `Unexpected` in
        files that have lines that match both.
 
+`git grep solution -- :^Documentation`::
+       Looks for `solution`, excluding files in `Documentation`.
+
 GIT
 ---
 Part of the linkgit:git[1] suite
index d47f198f15cd4c767b03c14580b816bf750e9ee1..9f3a78a36c48c55318ee0eea8e96a64ccce5bfa2 100644 (file)
@@ -111,6 +111,8 @@ configuration variable documented in linkgit:git-config[1].
        without options are equivalent to 'always' and 'never'
        respectively.
 
+<pathspec>...::
+       See the 'pathspec' entry in linkgit:gitglossary[7].
 
 OUTPUT
 ------
index b71b943b12eda2eab1792dfc910e405ad2ad540c..6b8888d123826179ace38660f5043d897eb5ce70 100644 (file)
@@ -407,7 +407,7 @@ these forms:
 
 exclude;;
        After a path matches any non-exclude pathspec, it will be run
-       through all exclude pathspec (magic signature: `!` or its
+       through all exclude pathspecs (magic signature: `!` or its
        synonym `^`). If it matches, the path is ignored.  When there
        is no non-exclude pathspec, the exclusion is applied to the
        result set as if invoked without any pathspec.
index 9dd5cde5fc53deb365234e815d7142de9a975005..eb829fce97dc7067cbb502b9f5fd2b14c4e74e10 100755 (executable)
@@ -25,7 +25,7 @@ EOF
        test_cmp expect actual
 '
 
-test_expect_success 'exclude only no longer errors out' '
+test_expect_success 'exclude only pathspec uses default implicit pathspec' '
        git log --oneline --format=%s -- . ":(exclude)sub" >expect &&
        git log --oneline --format=%s -- ":(exclude)sub" >actual &&
        test_cmp expect actual
@@ -183,4 +183,15 @@ EOF
        test_cmp expect actual
 '
 
+test_expect_success 'multiple exclusions' '
+       git ls-files -- ":^*/file2" ":^sub2" >actual &&
+       cat <<-\EOF >expect &&
+       file
+       sub/file
+       sub/sub/file
+       sub/sub/sub/file
+       EOF
+       test_cmp expect actual
+'
+
 test_done