-
-
Notifications
You must be signed in to change notification settings - Fork 105
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
New feature: Negative ignore patterns #298
Merged
deadc0de6
merged 19 commits into
deadc0de6:master
from
jtt9340:negative-ignore-patterns
Dec 31, 2020
Merged
New feature: Negative ignore patterns #298
deadc0de6
merged 19 commits into
deadc0de6:master
from
jtt9340:negative-ignore-patterns
Dec 31, 2020
Conversation
This file contains 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
On macOS, creating a temporary directory creates a hard link to a file with a different name, which causes dotdrop to think it is importing a symlink. This causes the unit tests to fail as dotdrop attempts to ask the user if it should dereference the symlink, but dotdrop is not connected to stdin when the shell script tests are running so dotdrop crashes with an EOFError. The solution is to pass the -f flag when invoking `dotdrop import` in tests.
See explanation in commit a73cfc2 for explanation
Accidentally used a hard tab instead of spaces when indenting a YAML code snippet
Very nice, thanks a lot for your contribution! Awesome job 👍 |
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.
This PR adds a feature that I felt was missing in dotdrop, so I decided to try implementing this feature myself. I'm calling it "negative ignore patterns," and it basically allows you to prepend
!
s to ignore patterns to "un-ignore" any previously-ignored files, similar to how!
s work in.gitignore
files. In other words, if a file matches a negative-ignore pattern, and it previously matched a (normal) ignore pattern, then that file will not be ignored.My motivation for wanting this feature was, at first, wanting to ignore every file in a certain directory,
$ZDOTDIR/zfunc
, except one,$ZDOTDIR/zfunc/_python-workon-cwd
. Without the negative-ignore-patterns feature I would have to include an ignore pattern for every file in$ZDOTDIR/zfunc
except for$ZDOTDIR/zfunc/_python-workon-cwd
, and if I ever added any more files to$ZDOTDIR/zfunc
, I would have to remember to add the ignore pattern for them too. With the negative-ignore-patterns feature, I would be able to add a blanket ignore pattern,*/zfunc/*
, and then add the negative-ignore pattern!*/zfunc/_python-workon-cwd
after that to instruct dotdrop to ignore everything in any directory calledzfunc
except for_python-workon-cwd
.I tried to find all the places where there is logic for matching ignore patterns to add this feature. Additionally, I have added several Bash script unit tests in the
tests-ng
directory.Hopefully this feature is useful and thank you for making dotdrop!