Keep folders open when the ignore file takes a path back out - #3448
Merged
Conversation
A `.fantomasignore` that matches a folder has that folder closed rather than opened and rejected file by file, which is what the pattern means and is not what it can mean when a later line negates something. `sub/*` followed by `!sub/keep` is how `.gitignore` spells "all of it but that one", and closing `sub` decides that `sub/keep` is not there, so the line taking it back out is never reached. The files were not reported as ignored, they were never found, so `--check` covered a smaller scope than the ignore file describes while `doctor`, which asks about one file and answers correctly, disagreed with the run about that same file. An ignore file that negates anything now leaves every folder open, which is what every version up to 8.0.0-alpha-015 did. One with no `!` line in it still closes the folders it names. The question is about the file as a whole, so it is asked once per ignore file rather than once per folder the walk meets.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A
.fantomasignorethat matches a folder has that folder closed rather than opened and rejected file by file, which is what the pattern means and is not what it can mean when a later line negates something.sub/*followed by!sub/keepis how.gitignorespells "all of it but that one", and closingsubdecides thatsub/keepis not there, so the line taking it back out is never reached. The files were not reported as ignored, they were never found, so--checkcovered a smaller scope than the ignore file describes whiledoctor, which asks about one file and answers correctly, disagreed with the run about that same file.An ignore file that negates anything now leaves every folder open, which is what every version up to 8.0.0-alpha-015 did. One with no
!line in it still closes the folders it names. The question is about the file as a whole, so it is asked once per ignore file rather than once per folder the walk meets.Fixes #3447