ripgrep
15.2.0ripgrep recursively searches directories for a regex pattern while respecting your gitignore
- Maintenance
- Active17 commits in 3 months · bus factor 1
- License
- UnlicensePublic domain · OSI-approved
- Security
- No advisories publishedScorecard 5.0/10
- Supported versions
- No scheduleendoflife.date does not track this project
70k stars · 3.5k forks · 226 open issues · last release 4 months ago · data checked 4 hours ago
Breaking changes
What to check before upgrading, taken from the notes of the last 30 releases.
- 14.0.0Nov 26, 2023
BREAKING CHANGES
rg -C1 -A2used to be equivalent torg -A2, but now it is equivalent to
rg -B1 -A2. That is,-Aand-Bno longer completely override-C.Instead, they only partially override
-C.Build process changes:
- ripgrep's shell completions and man page are now created by running ripgrep
with a new
--generateflag. For example,rg --generate manwill write aman page in
roffformat on stdout. The release archives have not changed.- The optional build dependency on
asciidocorasciidoctorhas been
dropped. Previously, it was used to produce ripgrep's man page. ripgrep now
owns this process itself by writing
roffdirectly.Performance improvements:
Make some cases with inner literals faster.
Make most searches with
\blook-arounds (among others) much faster.Parallel directory traversal now uses work stealing for faster searches.
Parallel directory traversal has some contention reduced.
Feature enhancements:
- Added or improved file type filtering for Ada, DITA, Elixir, Fuchsia, Gentoo,
Gradle, GraphQL, Markdown, Prolog, Raku, TypeScript, USD, V
- 11.0.0Apr 15, 2019
BREAKING CHANGES
- ripgrep has tweaked its exit status codes to be more like GNU grep's. Namely,
if a non-fatal error occurs during a search, then ripgrep will now always
emit a
2exit status code, regardless of whether a match is found or not.Previously, ripgrep would only emit a
2exit status code for a catastrophicerror (e.g., regex syntax error). One exception to this is if ripgrep is run
with
-q/--quiet. In that case, if an error occurs and a match is found,then ripgrep will exit with a
0exit status code.- Supplying the
-u/--unrestrictedflag three times is now equivalent to
supplying
--no-ignore --hidden --binary. Previously,-uuuwas equivalentto
--no-ignore --hidden --text. The difference is that--binarydisablesbinary file filtering without potentially dumping binary data into your
terminal. That is,
rg -uuu fooshould now be equivalent togrep -r foo.- The
avx-accelfeature of ripgrep has been removed since it is no longer
necessary. All uses of AVX in ripgrep are now enabled automatically via
runtime CPU feature detection. The
simd-accelfeature does remain available(only for enabling SIMD for transcoding), however, it does increase
compilation times substantially at the moment.
Performance improvements:
Make
rg -F -f dictionary-of-literalsmuch faster.Feature enhancements:
- Added or improved file type filtering for Apache Thrift, ASP, Bazel, Brotli,
- 0.10.0Sep 7, 2018
BREAKING CHANGES
- The minimum version required to compile Rust has now changed to track the
latest stable version of Rust. Patch releases will continue to compile with
the same version of Rust as the previous patch release, but new minor
versions will use the current stable version of the Rust compile as its
minimum supported version.
- The match semantics of
-w/--word-regexphave changed slightly. They used
to be
\b(?:)\b, but now it's(?:^|\W)(?:)(?:$|\W). This matches the behavior of GNU grepand is believed to be closer to the intended semantics of the flag. See
#389 for more details.
Feature enhancements:
libripgrep is now a thing. The primary crate is
grep.Add
-U/--multilineflag that permits matching over multiple lines.Add
-P/--pcre2flag that gives support for look-around and backreferences.Add
--jsonflag that prints results in a JSON Lines format.Add
--one-file-systemflag to skip directories on different file systems. - 0.9.0Aug 3, 2018
BREAKING CHANGES
- When
--countand--only-matchingare provided simultaneously, the
behavior of ripgrep is as if the
--count-matchesflag was given. That is,the total number of matches is reported, where there may be multiple matches
per line. Previously, the behavior of ripgrep was to report the total number
of matching lines. (Note that this behavior diverges from the behavior of
GNU grep.)
- Octal syntax is no longer supported. ripgrep previously accepted expressions
like
\1as syntax for matchingU+0001, but ripgrep will now report anerror instead.
- The
--line-number-widthflag has been removed. Its functionality was not
carefully considered with all ripgrep output formats.
See #795 for more
details.
Feature enhancements:
- Added or improved file type filtering for Android, Bazel, Fuschia, Haskell,
Java and Puppet.
Add a
--statsflag, which emits aggregate statistics after search results.Add a
--no-ignore-messagesflag, which suppresses parse errors from reading.ignoreand.gitignorefiles.Support
\u{..}Unicode escape sequences. - When
- 0.8.0Feb 12, 2018
BREAKING CHANGES
Note that these are all very minor and unlikely to impact most users.
- In order to support configuration files, flag overrides needed to be
rethought. In some cases, this changed ripgrep's behavior. For example,
in ripgrep 0.7.1,
rg foo -s -iwill perform a case sensitive searchsince the
-s/--case-sensitiveflag was defined to always take precedenceover the
-i/--ignore-caseflag, regardless of position. In ripgrep 0.8.0however, the override rule for all flags has changed to "the most recent
flag wins among competing flags." That is,
rg foo -s -inow performs acase insensitive search.
- The
-M/--max-columnsflag was tweaked so that specifying a value of0
now makes ripgrep behave as if the flag was absent. This makes it possible
to set a default value in a configuration file and then override it. The
previous ripgrep behavior was to suppress all matching non-empty lines.
- In all globs,
[^...]is now equivalent to[!...](indicating class
negation). Previously,
^had no special significance in a character class.- For downstream packagers, the directory hierarchy in ripgrep's archive
releases has changed. The root directory now only contains the executable,
README and license. There is now a new directory called
docwhich containsthe man page (previously in the root), a user guide (new), a FAQ (new) and
the CHANGELOG (previously not included in release). The
completedirectory remains the same.
Feature enhancements:
- Added or improved file type filtering for
- 0.4.0Jan 14, 2017
BREAKING CHANGE: The
--columnflag now implies--line-number.BREAKING CHANGE: Completely remove
^Chandling from ripgrep.
Release history
All releases on GitHubThis release fixes a number of bugs related to gitignore matching as well as
some performance improvements in directory tree traversal.
> In case you haven't heard of it before, ripgrep is a line-oriented search
> tool that recursively searches the current directory for a regex pattern.
> By default, ripgrep will respect gitignore rules and automatically skip
> hidden files/directories and binary files.
Platform support:
aarch64-unknown-linux-muslis now included in the release binaries for
ripgrep.
Performance improvements:
Improves directory traversal time on very large corpora.
Feature enhancements:
ripgrep now respects GIT_CONFIG_GLOBAL and GIT_CONFIG_SYSTEM.
Bug fixes:
Don't check for the existence of .jj when --no-ignore is used.
Fix gitignore matching bug when searching across multiple directories.