-
-
Notifications
You must be signed in to change notification settings - Fork 141
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
gitIgnore and negation patterns - not following gitIgnore specs #244
Comments
Hi @yuri-scarbaci-lenio, this is by design, as this project follows bash, extglob, and globstar specs, which differ from gitignore specs in several ways, as you've pointed out. Given that this is expected behavior, I'd be happy to keep this open to discuss ideas for adding gitignore support. Thoughts? On a related note, I'm pretty sure I created a library that uses micromatch to create gitignore-compliant glob patterns. I'll try to see where that is, or if I even published it. All I could find was https://github.com/jonschlinkert/parse-gitignore, which only parses the files (I think). |
I think that if this is meant by design altering the scope of the project would be counter productive on the long run, In my opinion the best thing would be just being as straightforward about this as possible, Since you are already mentioning comparison with similar matching libraries specifically, maybe adding a callout for this there in the comparison table
would help this, I can't imagine being the first one to get confused here :) |
As someone who is quite familiar with most of the matching specs, it took me forever to understand lol. I know exactly what you mean.
Don't be too hard on yourself, lol. I'm sure other people have asked, but even if they haven't, if you've spent enough time around my projects you'll know that I'm more confused than anyone.
That's a good idea. Instead of a table maybe we should just add a brief mention to the readme, probably in the section that mentions bash (I'm pretty sure that's on the readme but don't quote me, I can't look at the moment but I will in a little bit.). We could just say something like, "if you're looking for something to help with matching gitignore patterns, there are some important differences in behavior in how bash and gitignore... etc. etc." I'd be happy to take a PR if you feel like writing something. |
Sure, I will create a PR ASAP Do you know what's the name of the For reference
specifically:
https://man7.org/linux/man-pages/man3/fnmatch.3.html |
Created #245 |
(Thanks for reporting an issue to micromatch! If you haven't already read the contributor guidelines, Please do that now, then proceed to fill out the details below.)
Please describe the minimum necessary steps to reproduce this issue:
https://stackblitz.com/edit/node-61bbcz?file=package.json,micromatch.js,picomatch.js,nanomatch.js,ignore.js
in the console of stackblitz run the
npm run test
command and check the outputWhat is happening that shouldn't be?
I am not sure if this is intended, but if this is,
it may be worth to make it explicit in the docs
given the following
I expect this mean "match everything under the cdn folder except the file readme.md"
What should be happening instead?
everything at all ever results as a match because no matter what (or that's what I understand, I may be wrong, but it's not matching only under cdn folder except the given file)
Notes
I have created a comparison between different libraries because I have seen the Author actually use other libraries as a reference to double-check what other does,
I am personally trying to achieve what
https://www.npmjs.com/package/ignore
does, maybe this library was not even meant to be able to achieve this standardThe text was updated successfully, but these errors were encountered: