sindresorhus / globby

User-friendly glob matching
MIT License
2.49k stars 126 forks source link

Respect `gitignore` from above #86

Open vonagam opened 6 years ago

vonagam commented 6 years ago

Issuehunt badges

Currently only gitignores from cwd and down are taken into account for gitignore filtering. What about those who are higher in a hierarchy?

Use case: monorepo repositories (like babel for example), where gitignore is placed in root and individual packages do not have their own.

There is a $80.00 open bounty on this issue. Add more on Issuehunt.

callumlocke commented 5 years ago

Another example is stuff you might have in a global .gitignore, like .DS_Store files or personal conventions like IDEAS.md.

IssueHuntBot commented 5 years ago

@issuehuntfest has funded $80.00 to this issue. See it on IssueHunt

sindresorhus commented 3 years ago

If anyone wants to work on this, see the initial attempt and feedback in https://github.com/sindresorhus/globby/pull/107. This issue is blocked by https://github.com/mrmlnc/fast-glob/issues/265.

fisker commented 2 years ago

I may have a solution for this, we can find root .git directory, and glob .gitignore from there.

gilisho commented 5 days ago

@sindresorhus is doing what @fisker suggested can be done in globby itself? I am not familiar with your codebase, but I am using globby and did it myself in my codebase instead. If this mechanism was in globby itself that would be awesome. I am willing to look into it if you are up for it.