Please tick this box to confirm you have reviewed the above.
What version of ripgrep are you using?
ripgrep 15.1.0
features:+pcre2
simd(compile):+SSE2,-SSSE3,-AVX2
simd(runtime):+SSE2,+SSSE3,+AVX2
PCRE2 10.45 is available (JIT is available)
How did you install ripgrep?
Nixpkgs stable 25.11
What operating system are you using ripgrep on?
NixOs 25.11
Describe your bug.
.gitignore seems to be not taken into account if mutiple search paths are provided
What are the steps to reproduce the behavior?
mkdir tests src
echo "this" > tests/valid && echo "this" > src/valid && echo "this" > src/invalid
git init . && echo "src/invalid" > .gitignore
rg "this" => no src/invalid
rg "this" src/ => no src/invalid
rg "this" src/ tests/ => src/invalid is found
rg "this" tests/ src/ => funnily, src/invalid is not found
What is the actual behavior?
❯ rg --debug "this" src tests
rg: DEBUG|rg::flags::parse|crates/core/flags/parse.rs:97: no extra arguments found from configuration file
rg: DEBUG|rg::flags::hiargs|crates/core/flags/hiargs.rs:954: read CWD from environment: /tmp/reproduce
rg: DEBUG|rg::flags::hiargs|crates/core/flags/hiargs.rs:1092: number of paths given to search: 2
rg: DEBUG|rg::flags::hiargs|crates/core/flags/hiargs.rs:1103: is_one_file? false
rg: DEBUG|rg::flags::hiargs|crates/core/flags/hiargs.rs:1278: found hostname for hyperlink configuration: sunbase
rg: DEBUG|rg::flags::hiargs|crates/core/flags/hiargs.rs:1288: hyperlink format: ""
rg: DEBUG|rg::flags::hiargs|crates/core/flags/hiargs.rs:175: using 12 thread(s)
rg: DEBUG|grep_regex::config|/build/source/crates/regex/src/config.rs:175: assembling HIR from 1 fixed string literals
rg: DEBUG|ignore::gitignore|crates/ignore/src/gitignore.rs:398: opened gitignore file: /tmp/reproduce/.gitignore
rg: DEBUG|globset|crates/globset/src/lib.rs:515: built glob set; 1 literals, 0 basenames, 0 extensions, 0 prefixes, 0 suffixes, 0 required extensions, 0 regexes
rg: DEBUG|ignore::gitignore|crates/ignore/src/gitignore.rs:398: opened gitignore file: /tmp/reproduce/.git/info/exclude
src/valid
1:this
src/invalid
1:this
tests/valid
1:this
What is the expected behavior?
In step 6. of reproduction I feel that I should not find src/invalid
Please tick this box to confirm you have reviewed the above.
What version of ripgrep are you using?
ripgrep 15.1.0
features:+pcre2
simd(compile):+SSE2,-SSSE3,-AVX2
simd(runtime):+SSE2,+SSSE3,+AVX2
PCRE2 10.45 is available (JIT is available)
How did you install ripgrep?
Nixpkgs stable 25.11
What operating system are you using ripgrep on?
NixOs 25.11
Describe your bug.
.gitignoreseems to be not taken into account if mutiple search paths are providedWhat are the steps to reproduce the behavior?
mkdir tests srcecho "this" > tests/valid && echo "this" > src/valid && echo "this" > src/invalidgit init . && echo "src/invalid" > .gitignorerg "this"=> nosrc/invalidrg "this" src/=> nosrc/invalidrg "this" src/ tests/=>src/invalidis foundrg "this" tests/ src/=> funnily,src/invalidis not foundWhat is the actual behavior?
What is the expected behavior?
In step
6.of reproduction I feel that I should not findsrc/invalid