Skip to content
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

Support both gitignore and minimatch ignore type #1

Closed
pvdlg opened this issue Jan 8, 2018 · 6 comments
Closed

Support both gitignore and minimatch ignore type #1

pvdlg opened this issue Jan 8, 2018 · 6 comments

Comments

@pvdlg
Copy link

pvdlg commented Jan 8, 2018

It seems this library replace the node-glob ignore option with one that is compatible with the .gitignore format, but we loose the ability to use regular minimatch ignore.

Would it be possible to have instead the options:

  • ignore: works like the regular node-glob ignore options
  • gitignore: works with gitignore format

That would to support cases in which we have both a .gitignore file and minimatch pattern to ignore.

@kaelzhang
Copy link
Owner

Maybe globby is a good choice which also depends on node-ignore now

@kaelzhang
Copy link
Owner

I'd be thinking to deprecate this module for globby supports .gitignore in the latest version.

@pvdlg
Copy link
Author

pvdlg commented Jan 8, 2018

Well actually I was looking at node-glob-gitignore as a way to improve the performances of globby.

Currently globby uses node-glob to retrieve all the files, and use the regular ignore options and then filter them with with the exclusion of the .gitignore.

Performances could maybe be improved by doing all that at once (like avoid to retrieve files to filter them after)

@kaelzhang
Copy link
Owner

Yep, that is the only reason to use glob-gitignore for now.

That is a good question. Let me explain that.

But actually, the behavior of gitignore is differrent from and even conflicting with minimatch, especially for negative patterns (rules).

It is not possible to re-include a file if a parent directory of that file is excluded.

while minimatch is only a pattern but not a rule definition for group of patterns, and there is no explicit standard or spec about that.

So, IMO it is better not to use minimatch and gitignore simultaneously unless we have to. Or, at least, maybe gitignore rules should comes first, then minimatch.

@kaelzhang
Copy link
Owner

Maybe we'd move this topic to sindresorhus/globby#50

@kaelzhang
Copy link
Owner

Close for now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants