Commit Graph
2261 Commits
Author SHA1 Message Date
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
Yujiang Wang 68b3c9e0d9 ignore: fetch directory entry metadata in batches
On Windows probing the existence of each ignore file is
very heavy. Windows prefers fetching metadata in batches
(FindFirstFileExW/FindNextFileW, which translates to
std::sys::fs::read_dir)

Now, in ignore::Work::read_dir, we read the entire directory at once,
then use the result to determine the existense of ignore files. The
result is saved and visited later. This avoids stat'ing file paths that
don't exist.

Note that this also helps with Linux workloads too. For example, on
the <https://github.com/NightMachinary/r_HPfanfiction> repository:

```
$ hyperfine "rg-base 'with regexes,'" "rg-test 'with regexes,'"
Benchmark 1: rg-base 'with regexes,'
  Time (mean ± σ):     483.1 ms ±   6.4 ms    [User: 2493.1 ms, System: 3192.9 ms]
  Range (min … max):   474.8 ms … 496.0 ms    10 runs

Benchmark 2: rg-test 'with regexes,'
  Time (mean ± σ):     350.4 ms ±   5.2 ms    [User: 1652.6 ms, System: 2324.5 ms]
  Range (min … max):   341.6 ms … 358.5 ms    10 runs

Summary
  rg-test 'with regexes,' ran
    1.38 ± 0.03 times faster than rg-base 'with regexes,'
```

Fixes #3293, Closes #3410
2026-07-09 13:49:32 -04:00
Nipan Das 653d7f5bd1 ignore: add multi-root parent matcher regression tests
Parent ignore matchers are cached by directory across search roots, but
each root must keep its own absolute_base for path rewriting when applying
parent .gitignore / .rgignore rules. Document that invariant and lock it
in with unit and integration tests for the order-dependent multi-root
bugs in #3376, #3419, and #3320.

Closes #3320, Closes #3376, Ref #3419, Closes #3451
2026-07-09 13:49:32 -04:00
kmg0308 068a63ea25 globset: reduce owned path copying in globset
Closes #3454
2026-07-09 13:49:32 -04:00
Saitock 3a570990c4 doc: fix typo
PR #3446
2026-07-09 08:21:01 -04:00
dana f2f3d00df7 _rg: change some compadd -q to -r
it was pointed out to me that i've been using -q a bit too loosely. this
is probably better
2026-07-08 08:55:20 -04:00
dana 2394f72bad test-complete: misc. improvements
- eliminate no_function_argzero. was only needed for old versions of zsh
  that lacked ZSH_ARGZERO

- fix misc. style/convention issues

- improve error messages

- eliminate redundant `diff --label` condition. the gnu diff
  documentation implies that it doesn't support -L, but it does

- test hidden ('!') arg specs. i may have been worried that hidden
  options wouldn't be mentioned in the help output, but this isn't
  actually a problem atm. we can re-assess if it becomes one in the
  future
2026-07-08 08:55:20 -04:00
dana b357caa638 _rg: use _numbers where applicable
available since zsh 5.9 (2022)
2026-07-08 08:55:20 -04:00
dana a709a3be13 _rg: improve existing type functions
- simplify
- fix encodings with a colon in the name
- better complete hyperlink format variables
2026-07-08 08:55:20 -04:00
dana 42e6e85378 _rg: improve colour- and type-spec completion
- move to separate functions. we're already using type functions for the
  other actions so we might as well do it for these. it makes the main
  function a lot cleaner

- improve weird colour-spec conditions

- don't suffix 'none' attribute with colon

- improve completion of second part of type spec. (i don't think my
  comment about it being complex was true, i was either ignorant or
  unimaginative)

- general clean-up etc
2026-07-08 08:55:20 -04:00
dana c4f34e0640 _rg: update $no pattern to account for --require-git and --unicode 2026-07-08 08:55:20 -04:00
dana f168a87f97 _rg: eliminate superfluous group comments
these weren't really necessary, it's self-evident what the groups are
for. rather than add more superfluous comments for the groups added in
my previous commit, we can just get rid of them
2026-07-08 08:55:20 -04:00
dana 365edbfdd0 _rg: misc. spec fixes
- eliminate redundant groups
- eliminate redundant option specs
- use conventional description wording, clarify some descriptions
- complete --pre-glob argument
- offer files for glob patterns (why not)
2026-07-08 08:55:20 -04:00
dana 640ad85eda _rg: add missing groups
i think these options didn't have their own groups because originally
there weren't --no-* variants for them. now there are, and they should
be mutually exclusive
2026-07-08 08:55:20 -04:00
dana cdeff3e6f0 _rg: remove group-stripping functionality
when this function was first written, the _arguments grouping feature
(added in zsh 5.4) was new enough that compatibility with older shells
was a real concern. but it's been almost a decade (!) since then so i
think it's fine to just assume we have it now
2026-07-08 08:55:20 -04:00
max e015672819 doc: fix typos in code comments 2026-07-08 08:27:03 -04:00
Patrick Stöckle b009b5b84b doc: fix typos in comments 2026-07-08 08:26:01 -04:00
Clement Tsang e5f627fc16 doc: update AI policy link to point to ripgrep's document
This was just a copy & paste error.

PR #3465
2026-07-08 08:24:38 -04:00
Thayne McCombs f127579b00 ignore: add depth to more errors
Add depth to the Error objects in more cases where we know the
appropriate depth.

PR #3464
2026-07-07 15:51:45 -04:00
Andrew Gallant 48b0c795f4 ignore-0.4.27 ignore-0.4.27 2026-07-01 08:07:37 -04:00
Thayne McCombs c10f151e44 ignore: always include depth in errors
Include the depth in I/O errors from WalkDir as well, so that the
consumer can handle the error differently depending on depth. For
example, this would allow ignoring broken symlinks that don't match
certain depth criteria.

Note that this could conceivably be a breaking change if callers
were previously relying on down-casting nested errors to specific
types. There weren't any documented API guarantees around this,
but if it breaks too many folks, we'll likely need to back this out.

Fixes #3453
2026-07-01 08:07:21 -04:00
Jorge Gomez dfe4a81d25 ignore/types: add Hurl
PR #3444
2026-06-21 08:48:16 -04:00
Andrew Gallant 82313cf958 ignore-0.4.26 ignore-0.4.26 2026-06-05 07:03:03 -04:00
Micha Reiser 43e2f08ede ignore: fix parent gitignore matching across multiple roots
Parent matchers are cached by directory, but they also stored the
canonicalized path passed to `Ignore::add_parents`. Reusing cached
matchers while walking another root could therefore rewrite paths
relative to the wrong root and apply scoped parent gitignore rules
incorrectly.

Keep the cached matcher chain independent of the walk root. Carry the
absolute base path in `Ignore` instead, and add a regression test that
checks cached parent matchers can be reused across roots without sharing
their path semantics.

Fixes #3419
2026-06-05 07:02:48 -04:00
Micha Reiser 79a23e0841 ignore: use named fields in Ignore 2026-06-05 07:02:48 -04:00
Andrew Gallant 48a6ad93f1 ci: add support for aarch64-unknown-linux-musl
This includes running tests and binary artifacts.

Fixes #2739
2026-06-03 14:29:59 -04:00
Andrew Gallant c28ce760df docs: update GUIDE to use lexopt
... we migrated off of `clap` long ago.
2026-06-03 18:50:44 +02:00