Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Doc suggestion for stdin and .gitingore behavior #1439

Closed
JohnC32 opened this issue Dec 4, 2019 · 0 comments
Closed

Doc suggestion for stdin and .gitingore behavior #1439

JohnC32 opened this issue Dec 4, 2019 · 0 comments
Labels
doc An issue with or an improvement to documentation. rollup A PR that has been merged with many others in a rollup.

Comments

@JohnC32
Copy link

JohnC32 commented Dec 4, 2019

Using ripgrep 11.0.2 I ran into a hang using ripgrep from GNU Emacs via helm-rg on Windows. Window creates a stdin and ripgrep detects that stdin exists and waits for data, making it look like ripgrep is hung. I was able to easily work around the issue once I saw that I could explicitly specify the directory to search. Having this in the doc may save others confusion. Also having the note about .gitignore's are only respected if .git exists.

The man page intro currently contains:

   ripgrep (rg) recursively searches your current directory for a regex pattern. By default,
   ripgrep will respect your .gitignore and automatically skip hidden files/directories and
   binary files.

Could it be updated to:

   ripgrep (rg) recursively searches your current directory for a regex pattern. By default,
   ripgrep will respect your .gitignore files when a .git directory exists and automatically skip
   hidden files/directories and binary files.

   ripgrep will automatically detect if stdin exists and search stdin for a regex pattern, e.g.
   "ls | rg foo". In some environments, stdin may exist when it shouldn't. To turn off stdin
   detection explicitly specify the directory to search, e.g. "rg foo ./".

It would also be nice to mention why you need a .git directory to have .gitignores but that may be lost in time?

Thanks

@BurntSushi BurntSushi added doc An issue with or an improvement to documentation. rollup A PR that has been merged with many others in a rollup. labels Mar 15, 2020
BurntSushi added a commit that referenced this issue Mar 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
doc An issue with or an improvement to documentation. rollup A PR that has been merged with many others in a rollup.
Projects
None yet
Development

No branches or pull requests

2 participants