I'm trying to determine which matcher to use for a few different use cases we have. Most importantly we want to replicate the behaviour that the gitignore parser has.
We were considering using globby fast-glob or node-glob. But they all seem to have extended functionality that .gitignore default parsing doesn't provide.
I.e. globby uses fast-glob and fast-glob uses micromatch, which exposes custom functionality. And node-glob also seems extend the default syntax. Hence I've started investigating a little lower down the chain.
I'm a bit confused why there are so many packages that all seem to be doing the same/very similar things.
Observations / Questions:
- All of them seem to do file path wildcard matching one way or another (expect anymatch possibly being more generic)
- Minimatch is apparently slower than Micromatch, but has the same/similar functionality?
- Multimatch seems to be a simple wrapper around minimatch allowing for multiple patterns. Not sure if this is optimised in any way.
- Anymatch seems to be very generic. It doesn't seem to know about file path matching?
- Picomatch has "full support for standard and extended Bash glob features". I would assume this matches the gitignore processing closely?
- Nanomatch seems to extend functionality of Picomatch. Is this more functionality than what the gitignore processor provides?
- Micromatch seems to extend functionality of Nanomatch and appears to be a replacement for Minimatch? It claims to be a "drop-in" replacement, however that doesn't seem to be the case looking at the functionality they expose?
- Anymatch, Picomatch, Nanomatch and Micromatch are all published under the github organization Micromatch (naming confusion anyone?)
- There doesn't seem to be the equivalent of Multimatch for the "Micromatch organization" suite? Or did I just not find it?
The first question to answer is what standard git actually uses to process it's gitignore. And then figure out which package would match that most closely.