diff options
author | Manav Rathi <mnvrth@gmail.com> | 2017-09-25 13:39:00 +0530 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2017-09-25 17:54:36 +0900 |
commit | 93dbefb389a011c9107a3908fd38e743055be267 (patch) | |
tree | d25857fead15bb1130e89139849c3593a1eb32e0 /t/t6132-pathspec-exclude.sh | |
parent | 7234152e66e52c7601789f6de822bb39590f0595 (diff) | |
download | git-93dbefb389a011c9107a3908fd38e743055be267.tar.gz |
docs: improve discoverability of exclude pathspecmr/doc-negative-pathspec
The ability to exclude paths with a negative pathspec is not mentioned
in the man pages for git grep and other commands where it might be
useful.
Add an example and a pointer to the pathspec glossary entry in the man
page for git grep to help the user to discover this ability.
Add similar pointers from the git-add and git-status man pages.
Additionally,
- Add a test for the behaviour when multiple exclusions are present.
- Add a test for the ^ alias.
- Improve name of existing test.
- Improve grammar in glossary description of the exclude pathspec.
Helped-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Manav Rathi <mnvrth@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t6132-pathspec-exclude.sh')
-rwxr-xr-x | t/t6132-pathspec-exclude.sh | 13 |
1 files changed, 12 insertions, 1 deletions
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 |