2287 Commits
Author SHA1 Message Date
Andrew Gallant 3fce3b5bb0 ignore-0.4.33 ignore-0.4.33 2026-08-04 10:00:08 -04:00
Andrew Gallant 5055264ae0 globset-0.4.20 globset-0.4.20 2026-08-04 09:59:57 -04:00
Andrew Gallant 020687a77d ignore,globset: increase pool capacity
When do matching inside of `ignore` or `globset`, we sometimes need a
reusable mutable scratch space for matching. To do this, we use a `Pool`
abstraction from `regex-automata` to do this heavy lifting for us.

It turns out that this can be a limiting factor in some scenarios when
gitignore matching dominates. For example, in my checkout of the
Chromium repository:

```
$ hyperfine 'rg-master -j32 --files' 'rg-bigger-pool -j32 --files' 'rg-master -j32 --files --no-ignore'
Benchmark 1: rg-master -j32 --files
  Time (mean ± σ):     156.3 ms ±   5.5 ms    [User: 2356.4 ms, System: 380.8 ms]
  Range (min … max):   147.6 ms … 164.5 ms    19 runs

Benchmark 2: rg-bigger-pool -j32 --files
  Time (mean ± σ):     131.6 ms ±   2.1 ms    [User: 1628.2 ms, System: 310.1 ms]
  Range (min … max):   128.8 ms … 136.3 ms    22 runs

Benchmark 3: rg-master -j32 --files --no-ignore
  Time (mean ± σ):     107.4 ms ±   1.0 ms    [User: 664.7 ms, System: 304.7 ms]
  Range (min … max):   104.9 ms … 109.6 ms    28 runs

Summary
  rg-master -j32 --files --no-ignore ran
    1.22 ± 0.02 times faster than rg-bigger-pool -j32 --files
    1.45 ± 0.05 times faster than rg-master -j32 --files
```

The `--no-ignore` benchmark is our baseline. It doesn't process
gitignore files, so it's quite a bit faster. But with this change,
processing gitignore files gets faster than what is currently on master.
Specifically, re-running the above without the baseline:

```
$ hyperfine 'rg-master -j32 --files' 'rg-bigger-pool -j32 --files'
Benchmark 1: rg-master -j32 --files
  Time (mean ± σ):     154.1 ms ±   5.1 ms    [User: 2287.4 ms, System: 378.2 ms]
  Range (min … max):   144.1 ms … 163.9 ms    19 runs

Benchmark 2: rg-bigger-pool -j32 --files
  Time (mean ± σ):     131.7 ms ±   2.1 ms    [User: 1618.6 ms, System: 314.1 ms]
  Range (min … max):   128.4 ms … 135.3 ms    22 runs

Summary
  rg-bigger-pool -j32 --files ran
    1.17 ± 0.04 times faster than rg-master -j32 --files
```

I've used `-j32` here because this change is best observed as improving
the *scaling* properties. (And my system has 32 cores, so it's the best
case scenario.) If we just let ripgrep use its default thread heuristic
(which caps itself at a lower value), then the improvement here is a
bit more modest:

```
$ hyperfine 'rg-master --files' 'rg-bigger-pool --files'
Benchmark 1: rg-master --files
  Time (mean ± σ):     150.0 ms ±   8.5 ms    [User: 1139.6 ms, System: 237.7 ms]
  Range (min … max):   131.1 ms … 162.4 ms    22 runs

Benchmark 2: rg-bigger-pool --files
  Time (mean ± σ):     136.0 ms ±  12.1 ms    [User: 1034.4 ms, System: 236.0 ms]
  Range (min … max):   117.7 ms … 157.6 ms    22 runs

Summary
  rg-bigger-pool --files ran
    1.10 ± 0.12 times faster than rg-master --files
```

This improves scaling because the underlying change here now uses a
cache line for each available thread instead of limiting itself to a
fixed value of `8`. The cost is that ripgrep may use a bit more memory
storing cached values per thread.
2026-08-04 09:46:53 -04:00
Andrew Gallant 7525479a95 ci: fix binary discovery
It looks like the location of executables is changing in Cargo's test
runner, so use the blessed way of discovering an executable. That is,
for ripgrep, consult the `CARGO_BIN_EXE_rg` environment variable.
2026-08-03 07:38:57 -04:00
Andrew Gallant 5ed408e17e ignore-0.4.32 ignore-0.4.32 2026-08-03 07:15:23 -04:00
jif 435f59fc4b ignore: skip loading unreachable ignore files
When parallelism isn't used (e.g., when sorting results), then
it's possible in some cases for the `ignore` crate to still try and
load gitignore files inside of directories that are never
descended into. This can occur when `--max-depth` is used, or
even just when a directory is skipped for some other reason.

Fixes #2565, PR #3496
2026-07-29 11:00:03 -04:00
Kobi Hikri dffd776a73 ci: attest build provenance for release archives
PR #3495
2026-07-28 18:57:17 -04:00
Andrew Gallant f9c05a949d index: remove incorrect README 2026-07-24 08:03:07 -04:00
Andrew Gallant 8372866810 index: add some initial indexing scaffolding
This gives us some room to actually start writing out some index
operations.
2026-07-22 11:51:56 -04:00
Andrew Gallant d99ac34406 core: add index module 2026-07-22 11:51:56 -04:00
Andrew Gallant d57de83a94 nvim: enable all Cargo features
This makes it convenient to hack on the indexing work, which requires an
opt-in Cargo feature.
2026-07-22 11:51:56 -04:00
Andrew Gallant 2ed0c006fe flags: disable many flags when indexing is enabled
The indexing feature will be born with a lot of restrictions on it in
order to bootstrap and end-to-end working system. For example, getting
the `--pre` flag (and similar) working correctly is somewhat of a
hazard, since you'd need to specify the same transformation during both
indexing and not.

We disable pretty much any kind of filtering or transform related flags
other than what the default provides. Again, we'll relax at least most
of these in the future. But let's start here.
2026-07-22 11:51:56 -04:00
Andrew Gallant 59e318f5ac ignore-0.4.31 ignore-0.4.31 2026-07-20 14:15:07 -04:00
Chris Brown a9dc2228fb cargo: set rust-version on all crates
For the most part, we inherit from the main ripgrep `Cargo.toml`.

But we're a little more conservative with `globset` and `ignore`.
2026-07-20 14:14:32 -04:00
Andrew Gallant be739c7910 index: add grep-index crate
This just contains some prototype code that I wrote years ago at
present. But it sets a base on which to build. It also establishes a
semver boundary between ripgrep's core indexing and a library-version of
that indexing.
2026-07-20 09:16:03 -04:00
Andrew Gallant d958105d41 cargo: add new build-time unstable-index feature
... and add some of the initial flags, spec'd out in #1497, for adding
indexing to ripgrep. These don't do anything yet.

I chose to go this route because indexing will be a big feature, and it
would be better to develop it on master instead of maintaining a
long-lived branch for it.
2026-07-20 07:52:43 -04:00
Andrew Gallant 227381db0e ignore-0.4.30 ignore-0.4.30 2026-07-17 09:14:36 -04:00
Andrew Gallant b621e65b4f ignore: add incremental checking
This adds a new increment checker for ignore files, overrides and file
type selection. This effectively makes it possible to check individual
file paths as to whether they are ignored or not by any ignore file in
the directory tree (including parent gitignores). This is particularly
useful in the context of implementing a file watcher, where one wants to
make a decision about whether a newly added file should be included
*without* doing a full re-traversal of the directory tree.

This implementation reuses pretty much all of the existing gitignore
logic without making any changes to it.
2026-07-17 09:10:32 -04:00
Andrew Gallant c55818fd32 ignore: more pathutil clean-up 2026-07-17 09:10:32 -04:00
Andrew Gallant 6e527e9202 ignore: add routine for checking if a path is hidden or not
This needs to do a bit more work on Windows unfortunately, but this will
only be used in incremental checking.
2026-07-17 09:10:32 -04:00
Andrew Gallant 626b8951ac ignore: refactor is_hidden
This does the more sensible thing of putting the implementation within
the routine instead of repeating the docs.

We also rename this routine since we're going to want a path variant for
incremental checking.
2026-07-17 09:10:32 -04:00
Andrew Gallant c035d23c26 msrv: bump to Rust 1.96 2026-07-17 09:10:32 -04:00
Alex Chen fc3dd04b7c doc: update OpenSubtitles benchmark corpus URL in README
The old OPUS download.php link for the v2018 English monolingual
corpus now 404s. Point the README benchmark section at the live
object-storage URL for the same corpus.

Fixes #3471
2026-07-17 07:36:47 -04:00
Andrew Gallant 0d7054d8e4 ignore: fix deadlock when visitor panics
When a visitor panics and the workers shutdown, we indicate as such and
quit everything. This effectively acts as a sort of poison that will
cause all other workers to stop even when in their idle loop.

Fixes #3009
2026-07-16 17:33:06 -04:00
Andrew Gallant 5e16a5c9e5 changelog: start next section 2026-07-15 12:31:04 -04:00
Andrew Gallant f91cde0582 pkg/brew: update tap 2026-07-15 12:30:25 -04:00
Andrew Gallant e89fff89ac 15.2.0 15.2.0 2026-07-15 12:00:11 -04:00
Andrew Gallant d798261924 deps: bump ignore version 2026-07-15 11:59:38 -04:00
Andrew Gallant 576005b322 grep-searcher-0.1.17 grep-searcher-0.1.17 2026-07-15 11:58:20 -04:00
Andrew Gallant 432976d69c grep-pcre2-0.1.10 grep-pcre2-0.1.10 2026-07-15 11:58:00 -04:00
Andrew Gallant 41e0ae702b grep-matcher-0.1.9 grep-matcher-0.1.9 2026-07-15 11:57:23 -04:00
Andrew Gallant 40ffc6e0bd ignore-0.4.29 ignore-0.4.29 2026-07-15 11:56:30 -04:00
Andrew Gallant 28c687d630 globset-0.4.19 globset-0.4.19 2026-07-15 11:56:16 -04:00
Andrew Gallant f03c67e94f changelog: 15.2.0 2026-07-15 11:55:17 -04:00
Andrew Gallant e988d4b618 deps: update everything 2026-07-15 11:18:35 -04:00
Andrew Gallant d5b85d4405 deps: bump to tikv-jemallocator 0.7.0 2026-07-09 19:47:35 -04:00
Andrew Gallant 324f7efe5c ignore-0.4.28 ignore-0.4.28 2026-07-09 13:50:09 -04:00
Amaan Qureshi 241b87b337 ignore: support GIT_CONFIG_GLOBAL and GIT_CONFIG_SYSTEM for core.excludesFile
`gitconfig_excludes_path()` resolves the global gitignore
by reading `core.excludesFile` from `$HOME/.gitconfig` and
`$XDG_CONFIG_HOME/git/config`, but git 2.32 (June 2021) introduced
`GIT_CONFIG_GLOBAL` and `GIT_CONFIG_SYSTEM` environment variables that
override these locations. The `ignore` crate doesn't check either of
them, so users who point `GIT_CONFIG_GLOBAL` at a non-standard path
(e.g. NixOS managing git config at `/etc/git/config`) have their global
gitignore silently ignored by ripgrep while `git` itself respects it.

This commit checks `GIT_CONFIG_GLOBAL` before the hardcoded paths,
matching git's semantics where it replaces both `$HOME/.gitconfig` and
the XDG config. It also adds system-level config (`GIT_CONFIG_SYSTEM`,
falling back to `/etc/gitconfig`) as a lowest-priority source for
`core.excludesFile`, which the crate previously didn't consult at all.

Fixes #3275, Closes #3276
2026-07-09 13:49:32 -04:00
Sam Altier b6849daee8 ignore/walk: add WalkBuilder::empty and WalkBuilder::from_iter
Closes #1761, Closes #3261
2026-07-09 13:49:32 -04:00
Emilien Breton 8bca2ebfed doc: fix typo in man page
Closes #3216
2026-07-09 13:49:32 -04:00
Michal Fudala 61a9fd8229 doc: fix typo
Closes #3227
2026-07-09 13:49:32 -04:00
xtqqczze e7b0f89e81 lint: use cloned() or copied() when we can
Ref https://rust-lang.github.io/rust-clippy/master/index.html#map_clone

Closes #3230
2026-07-09 13:49:32 -04:00
howmanysmall 767086db4c searcher: hint at sequential memory map reading
Note that we continue to disable memory maps on macOS.

Note also that I've generally been unable to observe a performance
improvement from a change like this. However, I think it's fine to do
this for reasons of "good sense."

Closes #3246
2026-07-09 13:49:32 -04:00
kpcyrd 9548e86b14 ignore/types: add PKGBUILD type
Closes #3299
2026-07-09 13:49:32 -04:00
Alexander Kjäll 3b62573e95 deps: upgrade the lower bound for termcolor from 1.1.0 to 1.4.0
Closes #3308
2026-07-09 13:49:32 -04:00
Will Thomas bc3ad92b34 ignore/types: add Rocq .v files
This used to be Coq, but the language got renamed:
https://rocq-prover.org/about#Name

Interestingly, there is no mention of the pronunciation of the name in
English speaking countries.

Closes #3357
2026-07-09 13:49:32 -04:00
Adhvik Kanagala 93acfe2d47 ignore/types: add proto for filtering to protobuf files
Closes #3445
2026-07-09 13:49:32 -04:00
Fraser Cormack 77d27e82fa ignore/types: add Mojo type
For `*.mojo` files. See: https://mojolang.org/

Closes #3440
2026-07-09 13:49:32 -04:00
Thayne McCombs f55548ba9f globset: fix matches_all false positives
Make sure that we correctly check that all globs are matched, even if
multiple globs use the same strategy.

Previously we only checked that all strategies matched, but didn't
check with the strategies themselves.

This now adds a `matches_all` method to each strategy to check all
globs within a strategy.

This avoids allocating for tracking the number of matches.

Fixes #3290, Closes #3302
2026-07-09 13:49:32 -04:00
Andrew Gallant 2c23e39e02 changelog: bring unreleased changes up to date 2026-07-09 13:49:32 -04:00