Live data from Hacker News

Ripgrep 14 Released

github.com

51–60 of 73 posts

Re: Ripgrep 14 Released

#51
post #8

rg is great, I use it a lot. Recently I have also used [ambr]( https://github.com/dalance/amber ) which can do both search (ambs) and replace (ambr) recursively in your codebase. The only problem as of yet is that it does not support globbing so I cannot filter on certain filetypes only.

This use case is a killer feature of emacs. Rg supports wgrep (writable grep). `rg` to match lines, and then in the resulting buffer, `e` to edit the results and save the changes back to the matched files.

Re: Ripgrep 14 Released

#53

Earlier quoted context omitted.

I wanted to like sd but it doesn't support my main use case of recursive search/replace. Imagine if every time you wanted to grep some files you had to build a find -print0 | xargs | rg pipeline... it just takes me out of the flow too much. I'm glad people are posting other options here, I'm looking forward to trying them. https://github.com/chmln/sd/issues/62

If you haven't discovered recursive path expansion with `**` yet, which is supported by a number of popular shells, including bash, it is about to improve your shell life.

Agreed, doing sd 'search' 'replace' **.py is common in my history. I only mention fd + xargs as a backup for when you need to do something that a simple shell expansion won't cover.

Also, for a "confirm your changes" type workflow, I like git add -p after running the sd command just to review all of the changes.

Re: Ripgrep 14 Released

#54
post #7

What's the improvement this time? Translate DFAs to microcode?

https://blog.burntsushi.net/regex-internals/

I appreciated the Sherlock Holmes joke:

> $ regex-cli find match pikevm --no-table -p '\b\w+\b' -y 'Σέρλοκ Χολμς'

0:0:12:Σέρλοκ

0:13:23:Χολμς

Re: Ripgrep 14 Released

#55

There is a distinct joy in showing someone rg who has never seen it before and then seeing them immediately adopt it as a daily tool. Recently a colleague had a bug. He told me it was related to the "X" that was weirdly behaving like a "Y". I fd'd "X" and then rg'd the resulting files for "Y" and found a place where some copy/pasted code was treating "X" as a "Y". Big monorepo codebase, absolutely just tore through i…

This happened to me. The codebase I work with is hundreds of gigabytes and I was using find --exec grep, and my coworker showed me rg and I couldn't believe what I was seeing. It's a beautiful and amazing tool.

Re: Ripgrep 14 Released

#56

Earlier quoted context omitted.

I wanted to like sd but it doesn't support my main use case of recursive search/replace. Imagine if every time you wanted to grep some files you had to build a find -print0 | xargs | rg pipeline... it just takes me out of the flow too much. I'm glad people are posting other options here, I'm looking forward to trying them. https://github.com/chmln/sd/issues/62

If you haven't discovered recursive path expansion with `**` yet, which is supported by a number of popular shells, including bash, it is about to improve your shell life.

How does that work?

Re: Ripgrep 14 Released

#57

There is a distinct joy in showing someone rg who has never seen it before and then seeing them immediately adopt it as a daily tool. Recently a colleague had a bug. He told me it was related to the "X" that was weirdly behaving like a "Y". I fd'd "X" and then rg'd the resulting files for "Y" and found a place where some copy/pasted code was treating "X" as a "Y". Big monorepo codebase, absolutely just tore through i…

Since Visual Studio Code is using ripgrep for search one can also open the repo in the editor and use find in files to search for such things similar performance. It’s one of my favorite tools for searching specific expressions in codebases.

Re: Ripgrep 14 Released

#58

There is a distinct joy in showing someone rg who has never seen it before and then seeing them immediately adopt it as a daily tool. Recently a colleague had a bug. He told me it was related to the "X" that was weirdly behaving like a "Y". I fd'd "X" and then rg'd the resulting files for "Y" and found a place where some copy/pasted code was treating "X" as a "Y". Big monorepo codebase, absolutely just tore through i…

Since Visual Studio Code is using ripgrep for search one can also open the repo in the editor and use find in files to search for such things similar performance. It’s one of my favorite tools for searching specific expressions in codebases.

That's why I initially jumped on the VSCode bandwagon. I'm slightly miffed that nowadays the search is much slower than ripgrep. I see myself using ripgrep from the VSCode console.

I don't think it's ripgrep itself, it's something with the way VSCode manages extensions, and doesn't give you enough information to debug which extension is blocking it.

Re: Ripgrep 14 Released

#60
Extra life hack for Mac users — you can use mdfind first and then pipe those results into rg with xargs. Even faster. Mdfind has an index already so the results are almost instant even across huge numbers of files. Major qol improvement.
Post reply on HN