BurntSushi / BurntSushi/ripgrep

add --include/--exclude flags, with correct precedence

Open
#809 15 comments 1 reaction 0 assignees View on GitHub
enhancement
Dominant language
Rust
Stars
68.3k
Forks
2.8k
PR merge metrics
No merged PRs in 30d

Description

On rg 0.8.0 / OS X 10.12.6

When using `rg -Tfiletype -tfiletype foo`, the exclude takes precedence over the include. Is this intentional behavior?

My use case is a `.ripgreprc` which excludes minified files by default, which I do occasionally need to search. I can do `rg --type-add=minified:*.min.{css,js} -tminified --no-config foo` in this case, but this is pretty clunky. I would much rather do `rg -tminified foo` and have my include clobber my config file's default exclude.

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the reported `rg -Tfiletype -tfiletype foo` behavior and compare it with the `.ripgreprc` use case described in the issue. Trace how command-line type includes and excludes are combined with configuration, then add coverage showing the intended precedence and verify the minified-file workflow.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
cli, search
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.