4 ms·
Yes, though it should be noted that the reason it's faster is fewer command invocations and ignoring usually unwanted files (like .git/ and files listed in .git
by cyphar 8y ago
Yes, though it should be noted that the reason it's faster is fewer command invocations and ignoring usually unwanted files (like .git/ and files listed in .gitignore).
grep has a -R option which allows you to avoid the first problem, but avoiding the second one is a bit more difficult.
Also there is ripgrep which I've heard is effectively a faster version of ag written in Rust.
- gray_-_wolf 8y ago> Also there is ripgrep which I've heard is effectively a faster version of ag written in Rust. I've tried it but had it crashing on me in some directories so I'm sticking with ag
- burntsushi 8y agoCan you file a bug report? Crashing is a serious bug, and I don't think one has been reported against ripgrep during a search for quite some time, so I'd be very keen on hearing about it.
- phiresky 8y agoI love how you always just instantly appear outta nowhere when someone mentions a problem with ripgrep or makes a false statement about it :)
- djmips 8y agomaybe he has scripts that grep for keywords on hacker news etc. :-)
- shaklee3 8y agoFor what it's worth, I use it extensively on several different platforms, and have never had a crash.
- gray_-_wolf 8y agoI will try to make it crash again, it's like half a year back so my memory is little fuzzy on where exactly it did happen.
- gray_-_wolf 8y agoWell, I did not find a crash (yet), but at least some deadlock (probably). https://github.com/BurntSushi/ripgrep/issues/1231 https://github.com/BurntSushi/ripgrep/issues/1231
- burntsushi 8y agoThanks! Yeah that was the last crashing related bug, due to a problem doing streaming transcoding on one of ruby's utf16 encoded files. It's fixed on master.
- gray_-_wolf 8y agoI do grep ruby sources quite a bit, so if there was a crash it's probably this. Was there a release with a fix?
- burntsushi 8y agoNo. But one should be out soonish.
- Qwertystop 8y agoThe second one isn't that hard for common cases - I've got `grepr` for `grep -r --exclude-dir .git --exclude-dir .mypy_cache --exclude-dir __pycache__`. Adjust as you like for the particular sorts of things you commonly need to ignore.
- cyphar 8y agoExcept you also need to do `--exclude *.o` and whatever else is present in the .gitignore of any subdirectory. I personally use "git grep" when searching in source trees, as it automatically gives you gitignore support.