Why doesn't ripgrep whitelist special directories (like .github) or blacklist others (like /proc on Linux)?
#3204
-
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
|
It comes up from time to time that users are surprised that either:
Invariably, the suggestion here is that ripgrep should augment its default filtering rules to account for these expectations. ripgrep is already doing some kind of filtering by default, so why not add to it? The problem with this approach is that it makes ripgrep's default filtering more complicated, more special cased and therefore harder to explain. This is critical because people are already sometimes confused or surprised just by the mere act of filtering by default. Making this more complicated is likely to make it even more confusing. The benefit of the status quo is that it is generally very easy to explain why ripgrep doesn't search a file: it's because of gitignore, the file being hidden or it being binary data of some kind. If we start whitelisting things like ripgrep is already facing an uphill battle by enabling filtering by default. It is the thing, more than anything else, that sets ripgrep apart for most other grep implementations. Moreover, it is very easy for end users to add their own special exemptions to ripgrep's default filtering rules. For example, even the ripgrep repository has its own It is unlikely that ripgrep will ever add special exemptions to the default filtering logic. |
Beta Was this translation helpful? Give feedback.
It comes up from time to time that users are surprised that either:
Invariably, the suggestion here is that ripgrep should augment its default filtering rules to account for these expectations. ripgrep is already doing some kind of filtering by default, so why not add to it?
The problem with this approach is that it makes ripgrep's default filtering more complicated, more special cased and therefore harder to explain. This is critical because people are already sometimes confused or surprised just by the mere act of filtering by default. Making this more complica…