ripgrep
ripgrep copied to clipboard
Add option to ignore nested git repositories
This implements the suggestion made in #23 to provide an option to ignore nested git repositories.
A nested git repository is identified by the presence of a .git file or directory. It's a directory in the regular case, but it's a file for git worktrees and git submodules.
This option is disabled by default.
I'm open to suggestions for better names for things. In particular I'm not sure about the name ignore_nested_git_repo
used in IgnoreOptions
and IgnoreBuilder
because the concept of 'nesting' is outside of that layer; it has no knowledge of the level of a DirEntry
and relies on the calling code to make sure that the level 0 directory is never ignored.
I'm successfully using this in one of my repos with submodules. Thanks!