-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Ignoring files based on their size #369
Comments
No. Can you use some other attribute of the text files? You can specify paths to ignore at the command line with |
Hello @BurntSushi. Thank you for such fast reaction. Unfortunately I can't. I use rg as a part in a "chain" where I get some locations and I need to do search based on that. If it is not possible, I will just wrap it around with a shell script with a list of dirs/files to ignore. |
It is indeed not possible right now. It would have to be explicitly added to ripgrep as a new flag. Which I'd be OK with, since it should be relatively easy to add. It will have a performance cost, but that seems fine since the end user would have to specifically ask for it anyway. |
@BurntSushi - yes it would have a perf. impact but only when needed which shouldn't be that bad. For now I will just find those files on my own and exclude them. Thank you |
I'll probably end up looking at implementing this over the next few days. Just to outline the intended approach from a quick glance before beginning.
There probably should be some nice intuitive values expected for the command line option, too (i.e. |
I think the
That seems like nice extra credit. Feel free to punt on that if you like. :-) |
The --max-filesize option allows filtering files which are larger than the specified limit. This is potentially useful if one is attempting to search a number of large files without common file-types/suffixes. See BurntSushi#369.
The --max-filesize option allows filtering files which are larger than the specified limit. This is potentially useful if one is attempting to search a number of large files without common file-types/suffixes. See #369.
Fixed in #385 |
Hey, is there an option to use ripgrep and exclude files based on their size? I have a lot of +10MB text files that I don't want to grep and would love to be able to exclude them all. Thank you.
The text was updated successfully, but these errors were encountered: