diff options
author | Junio C Hamano <gitster@pobox.com> | 2017-10-03 15:42:50 +0900 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2017-10-03 15:42:50 +0900 |
commit | 9124cca61f7edfed70dc5d8bced7fb7cb9fe2221 (patch) | |
tree | e4846bbf73f9bffa34938081fcb839f646153d42 | |
parent | Merge branch 'sb/submodule-diff-header-fix' (diff) | |
parent | docs: improve discoverability of exclude pathspec (diff) | |
download | tgif-9124cca61f7edfed70dc5d8bced7fb7cb9fe2221.tar.xz |
Merge branch 'mr/doc-negative-pathspec'
Doc updates.
* mr/doc-negative-pathspec:
docs: improve discoverability of exclude pathspec
-rw-r--r-- | Documentation/git-add.txt | 3 | ||||
-rw-r--r-- | Documentation/git-grep.txt | 6 | ||||
-rw-r--r-- | Documentation/git-status.txt | 2 | ||||
-rw-r--r-- | Documentation/glossary-content.txt | 2 | ||||
-rwxr-xr-x | t/t6132-pathspec-exclude.sh | 13 |
5 files changed, 24 insertions, 2 deletions
diff --git a/Documentation/git-add.txt b/Documentation/git-add.txt index f4169fb1ec..b700beaff5 100644 --- a/Documentation/git-add.txt +++ b/Documentation/git-add.txt @@ -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:: diff --git a/Documentation/git-grep.txt b/Documentation/git-grep.txt index 720c7850e2..18b494731f 100644 --- a/Documentation/git-grep.txt +++ b/Documentation/git-grep.txt @@ -289,6 +289,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 -------- @@ -305,6 +308,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 diff --git a/Documentation/git-status.txt b/Documentation/git-status.txt index d47f198f15..9f3a78a36c 100644 --- a/Documentation/git-status.txt +++ b/Documentation/git-status.txt @@ -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 ------ diff --git a/Documentation/glossary-content.txt b/Documentation/glossary-content.txt index b71b943b12..6b8888d123 100644 --- a/Documentation/glossary-content.txt +++ b/Documentation/glossary-content.txt @@ -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. diff --git a/t/t6132-pathspec-exclude.sh b/t/t6132-pathspec-exclude.sh index 9dd5cde5fc..eb829fce97 100755 --- a/t/t6132-pathspec-exclude.sh +++ b/t/t6132-pathspec-exclude.sh @@ -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 |