Live data from Hacker News

Ripgrep 15.0

github.com

21–30 of 119 posts

Re: Ripgrep 15.0

#21
post #11

rg is a first for me in that it's a CLI tool that an LLM taught me about -- it's a go-to tool for Claude and codex, and since I got most of my bash skills pre-dotcom-one-boom I'm historically just a grep user. Anyway I'm trying to retrain the fingers these days, rg is super cool.

I switched to `ack` in 2017 because it handles recursive searches better. I didn't bother switching to `ag` when it came around because of having to retrain. But eventually I did switch to `rg` because it just has so many conveniences. I even switched to `fd` recently instead of `find` because it's easier and less typing for common use-cases. I've been using the terminal since 1997, so I'm happy I can still learn new…

Sell me on fd. I occasionally use find, mostly with the -name or -iname flags.

Re: Ripgrep 15.0

#23

[flagged]

People write scripts that call ripgrep. That makes the arguments an API.

Semver is useful to indicate breaking API changes.

Not sure if they are following semver, but that is the argument for using semver in a cli tool.

Re: Ripgrep 15.0

#24
post #11

Earlier quoted context omitted.

I switched to `ack` in 2017 because it handles recursive searches better. I didn't bother switching to `ag` when it came around because of having to retrain. But eventually I did switch to `rg` because it just has so many conveniences. I even switched to `fd` recently instead of `find` because it's easier and less typing for common use-cases. I've been using the terminal since 1997, so I'm happy I can still learn new…

Sell me on fd. I occasionally use find, mostly with the -name or -iname flags.

It feels nearly instant by comparison to find. That's been enough for me.

Re: Ripgrep 15.0

#25
post #5

Just like fd, I actually enjoy using rg and like these new set of command line tools.

What I like about both is their defaults without any parameters are what i would need them for 99% of the time. Huge time saver.

rg

fd

Re: Ripgrep 15.0

#26

[flagged]

The most important part of semver is that breaking changes are indicated by incrementing the major version. semver does not say that the major version must only be incremented when a breaking change is present.

Re: Ripgrep 15.0

#27
post #8

Great tool, and incredibly easy to use. Started with it on Linux, and now use on 'doze too. Probably the singular reason why I finally use regex as the first search option, rather than turning to it after bruting thru a search with standard wildcards.

It’s better than the normal grep, and there’s also the handy rg —-files.

Re: Ripgrep 15.0

#29
post #11

Earlier quoted context omitted.

I switched to `ack` in 2017 because it handles recursive searches better. I didn't bother switching to `ag` when it came around because of having to retrain. But eventually I did switch to `rg` because it just has so many conveniences. I even switched to `fd` recently instead of `find` because it's easier and less typing for common use-cases. I've been using the terminal since 1997, so I'm happy I can still learn new…

Sell me on fd. I occasionally use find, mostly with the -name or -iname flags.

You don't have to type -name for the 1000th time.

Re: Ripgrep 15.0

#30
post #19
post #14

Earlier quoted context omitted.

I'm so happy ripgrep has a different interface to grep. I don't typically need ripgrep's better performance, I just use it because 'rg foo' does what I want 99% of the time while 'grep foo' does what I want 1% of the time.

This is pretty much flipped from my experience, so I'm curious if you could expand on this. I use grep a lot to filter command output or maybe search all my txt file notes at once when I can't remember which file contained something. I use rg rarely, one example in recent memory is searching the source code for the game Barony to try to find some lesser-known console commands or behaviors (like what all drops a parti…

`some-command | grep pattern` and `some-command | rg pattern` both work fine. You can chain `rg` commands in a shell pipeline just like you do `grep`.

What the GP is suggesting is that their most common use case for grep is recursive search. That's what ripgrep does by default. With `grep`, you need the non-POSIX `-r` flag.

The other bit that the GP didn't mention but is critical to ripgrep's default behavior is that ripgrep will ignore files by default. Specifically, it respects gitignore files, ignores hidden files and ignores binary files. IMO, this is what most people mean by "ripgrep does the right thing by default." Because ripgrep will ignore most of the stuff you probably don't care about by default. Of course, you can disable this filtering easily: `rg -uuu`. This is also why ripgrep has never been intended to be POSIX compatible, despite people whinging about "backwards compatibility." That's a goal they are ascribing to the project that I have never professed. Indeed, I've been clear since the beginning that if you want a POSIX compatible grep, then you should just use a POSIX compatible grep. The existence of ripgrep does not prevent that.

Indeed, before I wrote ripgrep, I had a bunch of shell scripts in my ~/bin that wrapped grep for various use cases. I had one shell script for Python projects. Another for Go projects. And so on. These wrappers specifically excluded certain directories, because otherwise `grep -r` would search them. For big git repositories, this would in particular cause it to waste not only a bunch of time searching `.git`, but it would also often return irrelevant results from inside that directory.

Once I wrote ripgrep (I had never been turned on to `ack` or `ag`), all of those shell scripts disappeared. I didn't need them any more.

My understanding is that many other users have this same experience. I personally found it very freeing to get rid of all my little shell wrappers and just use the same tool everywhere. (`git grep` doesn't work nearly as well outside of git repositories for example. And it has, last I checked, some very steep performance cliffs.)

Some users don't like the default filtering. Or it surprises them so much that they are horrified by it. They can use `rg -uuu` or use one of the many other POSIX greps out there.

Post reply on HN