Surprisingly hard to override default ignores in config file #2538
-
(I'm using ripgrep 13.0.0 on macOS; I verified that the behavior hasn't changed on When using ripgrep, I want to ignore some paths by default, such as Currently, I do this by putting
Another way to accomplish this might be to put an Anyway, both types of ignores can be disabled at the command line. The problem (to the extent there is a problem) is that disabling them is surprisingly hard. Both of these arguments are relatively hard to type ( Most of the other long "don't ignore this" arguments can be abbreviated with some number of
As for solutions: There are many possible design approaches, including deciding that this isn't a bug and doing nothing. But for discussion's sake, here is what I'd do: Add variations of the |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
It is. The problem is that you aren't using But that's for
I just can't really stomach these additions personally. The problem is that ripgrep's file filtering logic has a ridiculous number of options already. And adding stuff like this is just going to make it even harder to reason about. Short of re-thinking ripgrep's file filtering logic, it feels to me like it's roughly at its carrying capacity. Additions are possible, but they need to be really well justified. I don't think this one is enough of a problem to justify more flags. I think there are other work-arounds you could explore:
I realize none of these things are probably ideal. You can find problems with all of them. (I myself can see problems with each of them.) But they might be good enough to improve the situation. Not sure. |
Beta Was this translation helpful? Give feedback.
It is. The problem is that you aren't using
rg -uuu
. You're usingrg -g '!build.ninja' -uuu
. None of the-u
flags override explicit globs. Explicit globs always have priority. I imagine, for example, that some folks might put-uuu
in their ripgrep config file and use, e.g.,-g '*.toml'
to achieve something similar to grep's--include
.But that's for
-g/--glob
... What about--no-ignore-files
? Ah, the man page says: