ripgrep breaking changes

homebrew

40 curated breaking changes across major versions of ripgrep. Use this as a migration checklist before bumping dependencies.

40
changes
Breaking changes by transition
  • 13.0.0 \u2192 14.0.0breaking

    `rg -C1 -A2` used to be equivalent to `rg -A2`, but now it is equivalent to `rg -B1 -A2`. That is, `-A` and `-B` no longer completely override `-C`. Instead, they only partially override `-C`. Build process changes:

  • 13.0.0 \u2192 14.0.0breaking

    ripgrep's shell completions and man page are now created by running ripgrep with a new `--generate` flag. For example, `rg --generate man` will write a man page in `roff` format on stdout. The release archives have not changed.

  • 13.0.0 \u2192 14.0.0breaking

    The optional build dependency on `asciidoc` or `asciidoctor` has been dropped. Previously, it was used to produce ripgrep's man page. ripgrep now owns this process itself by writing `roff` directly. Performance improvements:

  • 13.0.0 \u2192 14.0.0breaking

    [PERF #1746](https://github.com/BurntSushi/ripgrep/issues/1746): Make some cases with inner literals faster.

  • 13.0.0 \u2192 14.0.0breaking

    [PERF #1760](https://github.com/BurntSushi/ripgrep/issues/1760): Make most searches with `\b` look-arounds (among others) much faster.

  • 12.1.1 \u2192 13.0.0breaking

    [CVE-2021-3013](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-3013): Fixes a security hole on Windows where running ripgrep with either the `-z/--search-zip` or `--pre` flags can result in running arbitrary executables from the current directory.

  • 12.1.1 \u2192 13.0.0breaking

    [VULN #1773](https://github.com/BurntSushi/ripgrep/issues/1773): This is the public facing issue tracking CVE-2021-3013. ripgrep's README now contains a section describing how to report a vulnerability. Performance improvements:

  • 12.1.1 \u2192 13.0.0breaking

    [PERF #1657](https://github.com/BurntSushi/ripgrep/discussions/1657): Check if a file should be ignored first before issuing stat calls.

  • 12.1.1 \u2192 13.0.0breaking

    [PERF memchr#82](https://github.com/BurntSushi/memchr/pull/82): ripgrep now uses a new vectorized implementation of `memmem`. Feature enhancements:

  • 12.1.1 \u2192 13.0.0breaking

    Added or improved file type filtering for ASP, Bazel, dvc, FlatBuffers, Futhark, minified files, Mint, pofiles (from GNU gettext) Racket, Red, Ruby, VCL, Yang.

  • 0.10.0 \u2192 11.0.0breaking

    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 `2` exit status code, regardless of whether a match is found or not. Previously, ripgrep would only emit a `2` exit status code for a catastrophic error (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 `0` exit stat

  • 0.10.0 \u2192 11.0.0breaking

    Supplying the `-u/--unrestricted` flag three times is now equivalent to supplying `--no-ignore --hidden --binary`. Previously, `-uuu` was equivalent to `--no-ignore --hidden --text`. The difference is that `--binary` disables binary file filtering without potentially dumping binary data into your terminal. That is, `rg -uuu foo` should now be equivalent to `grep -r foo`.

  • 0.10.0 \u2192 11.0.0breaking

    The `avx-accel` feature 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-accel` feature does remain available (only for enabling SIMD for transcoding), however, it does increase compilation times substantially at the moment.

  • 0.10.0 \u2192 11.0.0breaking

    [PERF #497](https://github.com/BurntSushi/ripgrep/issues/497), [PERF #838](https://github.com/BurntSushi/ripgrep/issues/838): Make `rg -F -f dictionary-of-literals` much faster.

  • 0.10.0 \u2192 11.0.0breaking

    Added or improved file type filtering for Apache Thrift, ASP, Bazel, Brotli, BuildStream, bzip2, C, C++, Cython, gzip, Java, Make, Postscript, QML, Tex, XML, xz, zig and zstd.

  • 0.8.1 \u2192 0.9.0breaking

    When `--count` and `--only-matching` are provided simultaneously, the behavior of ripgrep is as if the `--count-matches` flag 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.)

  • 0.8.1 \u2192 0.9.0breaking

    Octal syntax is no longer supported. ripgrep previously accepted expressions like `\1` as syntax for matching `U+0001`, but ripgrep will now report an error instead.

  • 0.8.1 \u2192 0.9.0breaking

    The `--line-number-width` flag has been removed. Its functionality was not carefully considered with all ripgrep output formats. See [#795](https://github.com/BurntSushi/ripgrep/issues/795) for more details. Feature enhancements:

  • 0.8.1 \u2192 0.9.0breaking

    Added or improved file type filtering for Android, Bazel, Fuschia, Haskell, Java and Puppet.

  • 0.8.1 \u2192 0.9.0breaking

    [FEATURE #411](https://github.com/BurntSushi/ripgrep/issues/411): Add a `--stats` flag, which emits aggregate statistics after search results.

  • 0.7.1 \u2192 0.8.0breaking

    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 -i` will perform a case sensitive search since the `-s/--case-sensitive` flag was defined to always take precedence over the `-i/--ignore-case` flag, regardless of position. In ripgrep 0.8.0 however, the override rule for all flags has changed to "the most recent flag wins among competing flags." That is, `rg foo -s -i` now perf

  • 0.7.1 \u2192 0.8.0breaking

    Added or improved file type filtering for Apache Avro, C++, GN, Google Closure Templates, Jupyter notebooks, man pages, Protocol Buffers, Smarty and Web IDL.

  • 0.7.1 \u2192 0.8.0breaking

    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 `doc` which contains the man page (previously in the root), a user guide (new), a FAQ (new) and the CHANGELOG (previously not included in release). The `complete` directory remains the same. Feature enhancements:

  • 0.7.1 \u2192 0.8.0breaking

    In all globs, `[^...]` is now equivalent to `[!...]` (indicating class negation). Previously, `^` had no special significance in a character class.

  • 0.7.1 \u2192 0.8.0breaking

    The `-M/--max-columns` flag was tweaked so that specifying a value of `0` 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.

  • 0.3.2 \u2192 0.4.0breaking

    [BUG #262](https://github.com/BurntSushi/ripgrep/issues/262): Document how to install shell completion files.

  • 0.3.2 \u2192 0.4.0breaking

    [FEATURE #263](https://github.com/BurntSushi/ripgrep/issues/263): Add a new `--sort-files` flag.

  • 0.3.2 \u2192 0.4.0breaking

    [FEATURE #275](https://github.com/BurntSushi/ripgrep/issues/275): Add a new `--path-separator` flag. Useful in cygwin.

  • 0.3.2 \u2192 0.4.0breaking

    [BUG #182](https://github.com/BurntSushi/ripgrep/issues/182): Redux: use more portable ANSI color escape sequences when possible.

  • 0.3.2 \u2192 0.4.0breaking

    [BUG #258](https://github.com/BurntSushi/ripgrep/issues/258): Fix bug that caused ripgrep's parallel iterator to spin and burn CPU.

  • unknown \u2192 0.3.0breaking

    ripgrep now requires Rust 1.11 to compile. Previously, it could build on Rust 1.9. The cause of this was the move from [Docopt to Clap](https://github.com/BurntSushi/ripgrep/pull/233) for argument parsing.

  • unknown \u2192 0.3.0breaking

    Added or improved file type filtering for Elixir.

  • unknown \u2192 0.3.0breaking

    [PERF #136](https://github.com/BurntSushi/ripgrep/issues/136): ripgrep no longer slows down because of argument parsing when given a large argument list.

  • unknown \u2192 0.3.0breaking

    [PERF #33](https://github.com/BurntSushi/ripgrep/issues/33): ripgrep now performs similar to GNU grep on small corpora.

  • unknown \u2192 0.3.0breaking

    The `-e/--regexp` flag can no longer accept a pattern starting with a `-`. There are two work-arounds: `rg -- -foo` and `rg [-]foo` or `rg -e [-]foo` will all search for the same `-foo` pattern. The cause of this was the move from [Docopt to Clap](https://github.com/BurntSushi/ripgrep/pull/233) for argument parsing. [This may get fixed in the future.](https://github.com/kbknapp/clap-rs/issues/742).

  • 0.9.0 \u2192 0.10.0breaking

    [FEATURE #188](https://github.com/BurntSushi/ripgrep/issues/188): Add `-P/--pcre2` flag that gives support for look-around and backreferences.

  • 0.9.0 \u2192 0.10.0breaking

    The match semantics of `-w/--word-regexp` have changed slightly. They used to be `\b(?:<your pattern>)\b`, but now it's `(?:^|\W)(?:<your pattern>)(?:$|\W)`. This matches the behavior of GNU grep and is believed to be closer to the intended semantics of the flag. See [#389](https://github.com/BurntSushi/ripgrep/issues/389) for more details. Feature enhancements:

  • 0.9.0 \u2192 0.10.0breaking

    [FEATURE #162](https://github.com/BurntSushi/ripgrep/issues/162): libripgrep is now a thing. The primary crate is [`grep`](https://docs.rs/grep).

  • 0.9.0 \u2192 0.10.0breaking

    [FEATURE #176](https://github.com/BurntSushi/ripgrep/issues/176): Add `-U/--multiline` flag that permits matching over multiple lines.

  • 0.9.0 \u2192 0.10.0breaking

    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.

API access

Get this data programmatically \u2014 free, no authentication.

curl https://depscope.dev/api/breaking/homebrew/ripgrep
ripgrep breaking changes — Homebrew migration guide | DepScope