This week I wrote a small bash function that run ripgrep only on the files that are tracked by git:
rgg() {
readarray -d '' -t FILES < <(git ls-files -z)
rg "${@}" "${FILES[@]}"
}
It speeds up a lot on directories with many binary files
and committed dot files. To search the dot files, -uu is needed, but that also tells ripgrep to search the binary files.
On repositories with hundreds of files, the git ls-files overhead a bit large.