3 ms·
Very interesting. If you haven't tried grepping the files in your git repository (as opposed to using regular `grep` or your editor's search function, which doe
by loevborg 13y ago
Very interesting. If you haven't tried grepping the files in your git repository (as opposed to using regular `grep` or your editor's search function, which doesn't ignore files outside version control), it's surprisingly powerful.
I wasn't aware that `git grep` was as customizable as is shown in the article. I tend to use `ag` (the silver searcher) instead of regular grep, which besides being fast produces nice colored output. Here's a `zsh` function I put into my ~/.zshrc which allows me to apply ag only to files tracked by git: https://gist.github.com/pesterhazy/9294048 https://gist.github.com/pesterhazy/9294048
- sdfjkl 13y agoI'm also using `ag` over `ack` and `grep` as it seems to combine the speed of grep with the features of ack. In fact, the author used `git grep` to benchmark against: http://geoff.greer.fm/2011/12/27/the-silver-searcher-better-than-ack/ http://geoff.greer.fm/2011/12/27/the-silver-searcher-better-...
- dfc 13y agoIt looks like the author used BSD grep on OSX (despite linking to FSF) which explains the dogshit performance of grep. If you use a mac install grep from Homebrew with the `--default-names` option.