Addresses part of #1182 by implementing this snippet.
I'm not sure, whether this is the right place for the change, would it have been better to implement this purescript/registry-dev since that's where Glob.match' is implemented? Although then again, Glob.match' is just a wrapper for fast-glob.
On my laptop and repo mentioned in #1182 this change reduces the time spent globbing for spago.yaml from 600ms to 30ms :)
Description of the change
Instead of globbing everything for **/spago.yaml and then filtering the matches against .gitignore files, use every entry in the root .gitignore as a negative match (ignore) while globbing.
The resulting matches still need to be checked seperately using Git.isIgnored, because the new function only considers the root .gitignore file, .gitignore files in subdirectories are ignored.
Checklist:
[ ] Added the change to the "Unreleased" section of the changelog
[ ] Added some example of the new feature to the README
[ ] Added a test for the contribution (if applicable)
Addresses part of #1182 by implementing this snippet.
I'm not sure, whether this is the right place for the change, would it have been better to implement this purescript/registry-dev since that's where Glob.match' is implemented? Although then again, Glob.match' is just a wrapper for fast-glob.
On my laptop and repo mentioned in #1182 this change reduces the time spent globbing for spago.yaml from 600ms to 30ms :)
Description of the change
Instead of globbing everything for **/spago.yaml and then filtering the matches against .gitignore files, use every entry in the root .gitignore as a negative match (ignore) while globbing.
The resulting matches still need to be checked seperately using
Git.isIgnored
, because the new function only considers the root .gitignore file, .gitignore files in subdirectories are ignored.Checklist:
README