-
Notifications
You must be signed in to change notification settings - Fork 39
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
files inside an ignored sub-directory are not matched #19
Comments
You're right, there is a discrepancy in the behavior. |
UPDATE: My evaluation in this comment was completely wrong and confused the issue. I suspect the discrepancy is that a .gitignore does additional filtering beyond that of Git's wildmatch algorithm. If I fixed this in my implementation of wildmatch, it could unexpectedly change the results of anyone already using this for a purpose other than emulating .gitingore. The core issue is that blacklisting files from an excluded directory is not currently implemented:
|
Hey is there any workaround? |
While I understand the dilemma above with breaking existing projects, as time goes on more projects are probably using this and probably a good number expect this to match the behavior Git has when trying to exactly match something as a .gitignore file. I've spent a few days on and off scratching my head trying to work out why files weren't being excluded properly (using Git itself as an interactive test to see what matching worked), only to find this open issue. |
This is now fixed and will be available in v0.10.0 when it is released. |
Consider the case of a directory structure like :
The contents of the
.gitignore
file are :Now if we use
pathspec
to match all the files with the specs defined in.gitignore
then here are the responses ofmatch_file(filepath)
function:If you compare it with the behaviour of
.gitignore
inside a git repository, the files insidedirectoryH
should all returnTrue
as a reponse to thematch_file
function. Or am I getting something wrong ?The text was updated successfully, but these errors were encountered: