6 ms·
Hah! TIL. I had no idea someone did this. But it's smart. I should have thought of it! (I'm the author of ripgrep.)
by burntsushi 4y ago
Hah! TIL. I had no idea someone did this. But it's smart. I should have thought of it!
(I'm the author of ripgrep.)
- nicce 4y agoIt is smart, in multiple ways. For some guys who don’t know why, it prevents supply chain attacks.
- aryik 4y agoUnrelated, but thank you for your work! You’ve saved me tens if not hundreds of hours with ripgrep, and I’ve become a huge evangelist of it at my workplace. When I’m helping someone understand how to debug customer issues, the first thing I tell them is to install ripgrep. Truly a fantastic piece of software.
- burntsushi 4y agow00t! Thanks for the kind words. :-)
- lillecarl 4y ago"gron | rg", because life is too short to learn jq. Amazing work on rg!
- tambourine_man 4y agoOMG, thank you. jq is great but its syntax is impossible to memorize. This is so much better.
- lillecarl 4y agoAny time! Yeah jq is great, but my usecase is covered better by these two together. Truly the Unix philosophy at it's finest. It's the only way I search JSON these days! (or YAML with "yq | gron | rg" to get results, pop into (n)vim and to my thing :)
- pmarreck 4y agoWait, does ripgrep understand json or something??
- burntsushi 4y agoNo. `gron` understands JSON and flattens it, effectively turning it into line oriented data.
- ncmncm 4y agoSorry, how does ripgrep save you tens of hours? I get that it is faster than regular grep, but that doesn't really answer the question; I don't find myself stalled waiting for grep. The only reasonable explanation would be something ripgrep does that grep actually doesn't. I could try to guess, but have no confidence I would guess right.
- crdrost 4y ago1. Available on Windows without WSL, possibly the biggest time saver for those affected 2. Auto ignores .gitignore files, so does not search node_modules or build/ etc., huge noise reduction there. 3. -t/-T gates on file extension which is a very nice feature, again signal to noise 4. The combo of speed and the above and the recursive-by-default mean that you search much larger corpuses by default, like “all the microservices in the cluster” or “my entire home dir”, because you know it's some .xml file mentioning “jackson” where you saw this config you need before. 5. For some reason I never remember which regex features are grep vs egrep, so I end up just testing on a bunch of strings to see if I have to like backslash the plus operator or whatever. With rg it's like “oh this is going to have the same syntax as JS regex.” 6. Unicode compatibility by default could save you that sort of time maybe on specific workloads?
- 3np 4y ago7. Options like -g, --max-depth, and --max-filesize make chaining with `find` or (trigger warning) grepping your grep output redundant.
- deleted 4y ago[deleted]
- thelibrarian 4y agoTotally anecdotal, but I have found ripgrep orders of magnitude faster than grep when searching a large corpus of data (in my case, many multi-hundred megabyte to gigabyte XML files). As in, ripgrep completed the search in seconds, grep took multiple minutes. I'm sure I could have done some research to optimise/parallelise grep, but ripgrep worked doing the "dumb" search.
- darksaints 4y agoJust want to thank you for ripgrep and your other rust contributions. Ripgrep is insanely powerful and is absolutely indispensable for me.
- laughingbovine 4y agoLove your tool. Use it all the time. Thanks!!
- salawat 4y agoYou should not have done this unless you want to further normalize the practice of namespace squatting. This is the same type of behavior leads to domain squatting. While arguably being slightly more benign in the sense of hedging against typosquatting, if everyone started going things like that, we'd quickly begin to run into namespace exhaustion problems as people started ballooning their package namespace footprint. Before you do something like that, always ask yourself: "What if everyone else started doing this?" If the result feels like a nightmare in the making, don't do it.
- woodruffw 4y agoI've worked on various package management ecosystems for close to a decade now, and I wouldn't qualify this (if 'burntsushi had done it) as namespace squatting. It's clearly not an attempt to reserve a name for unspecified future use (or as a potential typosquatting target); it's the name of the binary installed by the crate and an obvious mistake for an installing user to make. Even flat namespaces are virtually infinite; a couple of extra names that correct user error do not pose a serious exhaustion risk.
- meowface 4y agoI think this is akin to saying nytimes.com buying nyt.com and redirecting it to nytimes.com is domain squatting.
- OJFord 4y agoSomeone else already has 'nyt.com' ('rg'), GP is saying (not saying I agree) 'nytimes.com' ('ripgrep') behaviour encourages other someone elses to do that sort of squatting, where they don't own the thing that is clearly intended.
- meowface 4y agoFair. "I think this is akin to saying nytimes.com buying nyt.com and redirecting it to nytimes.com encourages domain squatting."
- 4y ago
- BossingAround 4y agoWould you consider taking the "rg" package and redirecting people to ripgrep? I mean, asking the current owner to kindly donate it to you.
- burntsushi 4y agoYes, I'd be fine with that. I just spent a few minutes looking for their contact info, but I can't find it. EDIT: Found their email via git. Always forget about that one.
- Jenk 4y agoThere's a pun about finding to be had here.
- ivanche 4y agoI love HN because of this :) Thank you so much for making ripgrep! You made people's lives easier.
- wincy 4y agoI use ripgrep on git bash for Windows, and my team members act like I’ve got searching superpowers. Searching on windows is such a pain and this makes it easy. Thanks so much for making this fantastic tool!
- stjohnswarts 4y agoI use ripgrep and "everything" all the time on windows to find files and where I put stuff :) . My filing system leaves something to be desired, as does my many idea test folders.
- locusofself 4y agodoesn't vscode use ripgrep under the hood when you search your open files/repos?
- burntsushi 4y agoYes. But you might not be using VS Code. :-)
- wincy 4y agoHaha that’s cool, I do use vs code often but our myriad code bases sometimes I want to search EVERY repo we’ve got at once.
- pjmlp 4y agoMaybe it has been Stockholm syndrom, but findstr/PowerShell have served perfectly alright.
- burntsushi 4y agoHah, w00t. Have your teammates figured out that your superpowers are teachable? :-)
- wincy 4y agoI’m working on it! Most Windows devs have this strange aversion to “old confusing command lines”.
- skunkworker 4y ago`ripgrep` is my favorite of the "new" linux utilities, it makes searching for a single string across all of my cloned repos extremely easy, and especially for diving into multiple versions of vendored dependencies.
- stinos 4y ago`ripgrep` is my favorite of the "new" linux utilities Yeah, but only when used together with fzf, the other favorite new cross-platform shell utility. I mean, after rg spits out a list you do want to narrow it down and then do something with the files in that list, right? https://github.com/junegunn/fzf/blob/master/ADVANCED.md#ripgrep-integration https://github.com/junegunn/fzf/blob/master/ADVANCED.md#ripg...