summaryrefslogtreecommitdiffstats
path: root/complete
diff options
context:
space:
mode:
authorAndrew Gallant <jamslam@gmail.com>2020-02-17 14:43:22 -0500
committerAndrew Gallant <jamslam@gmail.com>2020-02-17 17:16:28 -0500
commit711426a632aee0affb7009cd8e3492c4ff7273e8 (patch)
treec208b97d618f7867a55171fb2d7c2928a6ccfe37 /complete
parent01eeec56bb0a67dd402aed0f5650525076b26657 (diff)
cli: add --no-require-git flag
This flag prevents ripgrep from requiring one to search a git repository in order to respect git-related ignore rules (global, .gitignore and local excludes). This actually corresponds to behavior ripgrep had long ago, but #934 changed that. It turns out that users were relying on this buggy behavior. In most cases, fixing it as simple as converting one's rules to .ignore or .rgignore files. Unfortunately, there are other use cases---like Perforce automatically respecting .gitignore files---that make a strong case for ripgrep to at least support this. The UX of a flag like this is absolutely atrocious. It's so obscure that it's really not worth explicitly calling it out anywhere. Moreover, the error cases that occur when this flag isn't used (but its behavior is desirable) will not be intuitive, do not seem easily detectable and will not guide users to this flag. Nevertheless, the motivation for this is just barely strong enough for me to begrudgingly accept this. Fixes #1414, Closes #1416
Diffstat (limited to 'complete')
-rw-r--r--complete/_rg3
1 files changed, 3 insertions, 0 deletions
diff --git a/complete/_rg b/complete/_rg
index b90d1801..82dc3cdb 100644
--- a/complete/_rg
+++ b/complete/_rg
@@ -144,6 +144,8 @@ _rg() {
+ '(ignore-vcs)' # VCS ignore-file options
"--no-ignore-vcs[don't respect version control ignore files]"
$no'--ignore-vcs[respect version control ignore files]'
+ "--no-require-git[don't require git repository to respect gitignore rules]"
+ $no'--require-git[require git repository to respect gitignore rules]'
+ '(ignore-dot)' # .ignore-file options
"--no-ignore-dot[don't respect .ignore files]"
@@ -284,6 +286,7 @@ _rg() {
'--context-separator=[specify string used to separate non-continuous context lines in output]:separator'
$no"--no-context-separator[don't print context separators]"
'--debug[show debug messages]'
+ '--trace[show more verbose debug messages]'
'--dfa-size-limit=[specify upper size limit of generated DFA]:DFA size (bytes)'
"(1 stats)--files[show each file that would be searched (but don't search)]"
'*--ignore-file=[specify additional ignore file]:ignore file:_files'