Skip to content

Support .jj as well as .git#2842

Closed
fowles wants to merge 1 commit intoBurntSushi:masterfrom
fowles:main
Closed

Support .jj as well as .git#2842
fowles wants to merge 1 commit intoBurntSushi:masterfrom
fowles:main

Conversation

@fowles
Copy link
Contributor

@fowles fowles commented Jun 22, 2024

  • Allow .jj dirs to count as vcs directories.
  • Simplify the control flow around resolving info/exclude

@fowles
Copy link
Contributor Author

fowles commented Jun 22, 2024

I totally understand if you don't want to expand things to support every oddball VCS, but so many tools I like (cargo watch, rg, fzf, fd) are all built on this common library that adding a bit of support at the core gets a lot of things to just work.

@fowles
Copy link
Contributor Author

fowles commented Jul 2, 2024

any chance I can get this considered?

@BurntSushi
Copy link
Owner

I think my main concerns here are:

  1. I don't even know what .jj is referring to. You didn't give a link or explain anything.
  2. This patch seems to assume that .jj and .git have identical semantics. Do they? There are literally no differences?
  3. This doubles the number of stat calls for every directory ripgrep searches. This is a rather annoying hurdle because I don't want this to be used as a bludgeon to forever fix ourselves to git. But at the same time, there is a cost here that needs to be weighed with the benefit.

@fowles
Copy link
Contributor Author

fowles commented Jul 2, 2024

Sorry about the lack of link, that is my bad. https://martinvonz.github.io/jj/latest/ is the best spot to read. It is a version control system like git, so .jj is a directory that contains metadata for it (just like .git).

As an alternate suggestion, I would recommend respecting .gitignore files even when there is no .git directory. Then you can cut the stat calls down from 1 to zero.

@BurntSushi
Copy link
Owner

As an alternate suggestion, I would recommend respecting .gitignore files even when there is no .git directory. Then you can cut the stat calls down from 1 to zero.

That already exists today with --no-require-git. But vcs directory detection is in general required for correctness so that you don't let gitignore files cross repository boundaries.

@fowles
Copy link
Contributor Author

fowles commented Jul 2, 2024

The problem that I run into with --no-require-git is that every tool built on the library exposes it differently (and some don't). Is there a way to make that controlled via env variable or something?

@BurntSushi
Copy link
Owner

No. I personally think that would be wildly inappropriate. ignore isn't a "standard," and trying to reach out into the environment in a library to do an end-runaround on the CLI interface just seems really bad to me. Like, there would, by construction, be no coupling between the environment variable and the CLI, which means there would be no way for ignore to know when to respect the environment variable versus some other option (which might override the environment variable). The only way to solve that would be to introduce more API machinery to deal with it. Sounds awful.

I'm not saying No to this PR, but it's going to require that I or someone goes and understands jj to ensure this is implemented correctly. At minimum. And I'll also need to make a judgment of whether the cost is worth it.

@fowles fowles force-pushed the main branch 2 times, most recently from 8dda96b to bb1f30f Compare July 3, 2024 16:51
@fowles
Copy link
Contributor Author

fowles commented Jul 3, 2024

I checked with folks on the jj discord to make sure that I was getting all the corners. I have updated the PR with that and also moved things around a tiny bit to minimize the number of stat calls as well as the number of allocations.

I absolutely understand that this is a judgement call on your end about complexity versus general utility. If there is any data I can provide to make that case, I would be happy to try, but I recognize that jj is a niche VCS. (I have hopes it will grow, but realistically I am not sure it will.)

@fowles
Copy link
Contributor Author

fowles commented Jul 16, 2024

Did you have a chance to come to a conclusion here?

@fowles
Copy link
Contributor Author

fowles commented Sep 4, 2024

Following up, I have verified this PR with jj's owner (and I am also a committer on it). So I think this is ready for review (pending your actual acceptance of the direction).

Thanks!

@jaybosamiya
Copy link

jaybosamiya commented Mar 7, 2025

Some musings:

Jujutsu is a neat VCS, and is quite git compatible. It has a lot of positives for it, and the biggest negative for it I've found in the past ~2 months I've been using it come from the (understandable, given it being relatively newer and more niche) lack of recognition of it by some tools, so I was considering making a PR to ripgrep to add support, and lo and behold, this PR already exists ❤️

As a quick note: jj's only way (currently?) to ignore files is to use a .gitignore (it even looks at $GIT_DIR/info/exclude as git would), and while the ignore format is itself not a standard, I would be hard-pressed to accept that any tool that uses .gitignore (i.e., with the git in the file name) with a departure in semantics from what git already uses to not be considered a bug in the tool. Thus, I would expect jj to maintain the same semantics as git for their usage of .gitignore.

Personally, I was using ripgrep suboptimally for some time, because I wasn't aware of --no-require-git, since at least as of ripgrep 14.1.1, it is not easy to realize that .gitignores are ignored unless a .git exists. Obviously, once I found --no-require-git (via this PR, funnily), I took a gander through rg --help, and the only mention of the .git directory being necessary is in the --no-require-git option's docs (which does mention the defaults). However, I wonder if people might be happier with the opposite default (I am somewhat biased here, so maybe I am not accounting for some other common use case where a .gitignore file should be ignored). I will note that literally the second line of --help states:

By default, ripgrep will respect gitignore rules and automatically skip hidden files/directories and binary files.

So I don't think people would be annoyed by a default that respects gitignore rules (even if .git is absent).

If the flipped version becomes the default, then we would not need to double the number of stat calls (indeed, number of stat calls would drop for most people), at which point, we might actually be able to afford having some --require-vcs git,jj,...-style flag (again, this is just me musing) where the user is opting in for which VCSs they want the requirements checked, allowing for more stat calls (obviously, --require-git is already a flag right now, so more thought would be needed into such a future flag), but nonetheless, a flipped default would probably fix the issue, and not even need a .jj/ check.

Sidenote: I now have --no-require-git as part of my CLI default for rg now; happy to report back if it'd help with (one person) anecdotal data if you find it useful.

Another alternative to consider: if a .gitignore file is found, but a .git is not, telling the user that --no-require-git exists could be nice. Clearly I am not the only one who missed that this option exists :)


With all the above, I also want to add: I don't want to increase maintainer burden, and I understand things like defaults are a hard decision. The existence of --no-require-git is great, and I am very glad that @BurntSushi you place such a laser focus on having a fast and awesome tool! ❤️

@devnoname120
Copy link

devnoname120 commented Mar 17, 2025

So I don't think people would be annoyed by a default that respects gitignore rules (even if .git is absent).

That's a problem for globally-defined .gitignores that people tend to place in ~.

@strega-nil
Copy link

Ping on this, it would be awesome to get this in, although for now --no-require-git is a fine temporary solution :)

@BurntSushi
Copy link
Owner

And yes, there's no way that --no-require-git is going to become a ripgrep default. That would allow gitignore files to cross pollinate into other repos. And nesting git repos inside other git repos is a very common pattern.

@BurntSushi
Copy link
Owner

The next step here is for me to try this out and do some ad hoc perf testing to ensure the extra stat call isn't too big of a perf hit. If it is, we can brainstorm how to mitigate it (or just accept it). My guess is that it will be acceptable.

- Allow `.jj` dirs to count as vcs directories.
- Simplify the control flow around resolving info/exclude
Copy link
Owner

@BurntSushi BurntSushi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm unsure of how this patch is supposed to work. And it looks like there are unrelated changes here?

Some(Ok(line)) => line,
Some(Err(err)) => {
return Err(Some(Error::Io(err).with_path(git_dir_path())));
return Err(Some(Error::Io(err).with_path(git_dir)));
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are these changes necessary?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You had expressed concern about number of allocations and these changes eliminate some extra allocations. Happy to separate them to a different PR if you prefer

Gitignore::empty()
} else {
match resolve_git_commondir(dir, git_type) {
match resolve_git_commondir(dir.join(".git"), git_type) {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why don't we need to also do dir.join(".jj") here?

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh I see, as @martinvonz said above, it looks like we are punting on handling clone-specific excludes.

@BurntSushi BurntSushi added the rollup A PR that has been merged with many others in a rollup. label Jul 12, 2025
BurntSushi pushed a commit that referenced this pull request Jul 27, 2025
This makes it so the presence of `.jj` will cause ripgrep to treat it
as a VCS directory, just as if `.git` were present. This is useful for
ripgrep's default behavior when working with jj repositories that don't
have a `.git` but do have `.gitignore`. Namely, ripgrep requires the
presence of a VCS repository in order to respect `.gitignore`.

We don't handle clone-specific exclude rules for jj repositories without
`.git` though. It seems it isn't 100% set yet where we can find
those[1].

Closes #2842

[1]: #2842 (comment)
BurntSushi pushed a commit that referenced this pull request Sep 10, 2025
This makes it so the presence of `.jj` will cause ripgrep to treat it
as a VCS directory, just as if `.git` were present. This is useful for
ripgrep's default behavior when working with jj repositories that don't
have a `.git` but do have `.gitignore`. Namely, ripgrep requires the
presence of a VCS repository in order to respect `.gitignore`.

We don't handle clone-specific exclude rules for jj repositories without
`.git` though. It seems it isn't 100% set yet where we can find
those[1].

Closes #2842

[1]: #2842 (comment)
tmeijn pushed a commit to tmeijn/dotfiles that referenced this pull request Oct 17, 2025
⚠️ **CAUTION: this is a major update, indicating a breaking change!** ⚠️

This MR contains the following updates:

| Package | Update | Change |
|---|---|---|
| [BurntSushi/ripgrep](https://github.com/BurntSushi/ripgrep) | major | `14.1.1` -> `15.0.0` |

MR created with the help of [el-capitano/tools/renovate-bot](https://gitlab.com/el-capitano/tools/renovate-bot).

**Proposed changes to behavior should be submitted there as MRs.**

---

### Release Notes

<details>
<summary>BurntSushi/ripgrep (BurntSushi/ripgrep)</summary>

### [`v15.0.0`](https://github.com/BurntSushi/ripgrep/blob/HEAD/CHANGELOG.md#1500-2025-10-15)

[Compare Source](BurntSushi/ripgrep@14.1.1...15.0.0)

\===================
ripgrep 15 is a new major version release of ripgrep that mostly has bug fixes,
some minor performance improvements and minor new features. Here are some
highlights:

- Several bugs around gitignore matching have been fixed. This includes
  a commonly reported bug related to applying gitignore rules from parent
  directories.
- A memory usage regression when handling very large gitignore files has been
  fixed.
- `rg -vf file`, where `file` is empty, now matches everything.
- The `-r/--replace` flag now works with `--json`.
- A subset of Jujutsu (`jj`) repositories are now treated as if they were git
  repositories. That is, ripgrep will respect `jj`'s gitignores.
- Globs can now use nested curly braces.

Platform support:

- `aarch64` for Windows now has release artifacts.
- `powerpc64` no longer has release artifacts generated for it. The CI
  release workflow stopped working, and I didn't deem it worth my time to
  debug it. If someone wants this and can test it, I'd be happy to add it
  back.
- ripgrep binaries are now compiled with full LTO enabled. You may notice
  small performance improvements from this and a modest decrease in binary
  size.

Performance improvements:

- [PERF #&#8203;2111](BurntSushi/ripgrep#2111):
  Don't resolve helper binaries on Windows when `-z/--search-zip` isn't used.
- [PERF #&#8203;2865](BurntSushi/ripgrep#2865):
  Avoid using path canonicalization on Windows when emitting hyperlinks.
- [PERF #&#8203;3184](BurntSushi/ripgrep#3184):
  Improve performance of large values with `-A/--after-context`.

Bug fixes:

- [BUG #&#8203;829](BurntSushi/ripgrep#829),
  [BUG #&#8203;2731](BurntSushi/ripgrep#2731),
  [BUG #&#8203;2747](BurntSushi/ripgrep#2747),
  [BUG #&#8203;2770](BurntSushi/ripgrep#2770),
  [BUG #&#8203;2778](BurntSushi/ripgrep#2778),
  [BUG #&#8203;2836](BurntSushi/ripgrep#2836),
  [BUG #&#8203;2933](BurntSushi/ripgrep#2933),
  [BUG #&#8203;3067](BurntSushi/ripgrep#3067):
  Fix bug related to gitignores from parent directories.
- [BUG #&#8203;1332](BurntSushi/ripgrep#1332),
  [BUG #&#8203;3001](BurntSushi/ripgrep#3001):
  Make `rg -vf file` where `file` is empty match everything.
- [BUG #&#8203;2177](BurntSushi/ripgrep#2177):
  Ignore a UTF-8 BOM marker at the start of `.gitignore` (and similar files).
- [BUG #&#8203;2750](BurntSushi/ripgrep#2750):
  Fix memory usage regression for some truly large gitignore files.
- [BUG #&#8203;2944](BurntSushi/ripgrep#2944):
  Fix a bug where the "bytes searched" in `--stats` output could be incorrect.
- [BUG #&#8203;2990](BurntSushi/ripgrep#2990):
  Fix a bug where ripgrep would mishandle globs that ended with a `.`.
- [BUG #&#8203;2094](BurntSushi/ripgrep#2094),
  [BUG #&#8203;3076](BurntSushi/ripgrep#3076):
  Fix bug with `-m/--max-count` and `-U/--multiline` showing too many matches.
- [BUG #&#8203;3100](BurntSushi/ripgrep#3100):
  Preserve line terminators when using `-r/--replace` flag.
- [BUG #&#8203;3108](BurntSushi/ripgrep#3108):
  Fix a bug where `-q --files-without-match` inverted the exit code.
- [BUG #&#8203;3131](BurntSushi/ripgrep#3131):
  Document inconsistency between `-c/--count` and `--files-with-matches`.
- [BUG #&#8203;3135](BurntSushi/ripgrep#3135):
  Fix rare panic for some classes of large regexes on large haystacks.
- [BUG #&#8203;3140](BurntSushi/ripgrep#3140):
  Ensure hyphens in flag names are escaped in the roff text for the man page.
- [BUG #&#8203;3155](BurntSushi/ripgrep#3155):
  Statically compile PCRE2 into macOS release artifacts on `aarch64`.
- [BUG #&#8203;3173](BurntSushi/ripgrep#3173):
  Fix ancestor ignore filter bug when searching whitelisted hidden files.
- [BUG #&#8203;3178](BurntSushi/ripgrep#3178):
  Fix bug causing incorrect summary statistics with `--json` flag.
- [BUG #&#8203;3179](BurntSushi/ripgrep#3179):
  Fix gitignore bug when searching absolute paths with global gitignores.
- [BUG #&#8203;3180](BurntSushi/ripgrep#3180):
  Fix a panicking bug when using `-U/--multiline` and `-r/--replace`.

Feature enhancements:

- Many enhancements to the default set of file types available for filtering.
- [FEATURE #&#8203;1872](BurntSushi/ripgrep#1872):
  Make `-r/--replace` work with `--json`.
- [FEATURE #&#8203;2708](BurntSushi/ripgrep#2708):
  Completions for the fish shell take ripgrep's config file into account.
- [FEATURE #&#8203;2841](BurntSushi/ripgrep#2841):
  Add `italic` to the list of available style attributes in `--color`.
- [FEATURE #&#8203;2842](BurntSushi/ripgrep#2842):
  Directories containing `.jj` are now treated as git repositories.
- [FEATURE #&#8203;2849](BurntSushi/ripgrep#2849):
  When using multithreading, schedule files to search in order given on CLI.
- [FEATURE #&#8203;2943](BurntSushi/ripgrep#2943):
  Add `aarch64` release artifacts for Windows.
- [FEATURE #&#8203;3024](BurntSushi/ripgrep#3024):
  Add `highlight` color type, for styling non-matching text in a matching line.
- [FEATURE #&#8203;3048](BurntSushi/ripgrep#3048):
  Globs in ripgrep (and the `globset` crate) now support nested alternates.
- [FEATURE #&#8203;3096](BurntSushi/ripgrep#3096):
  Improve completions for `--hyperlink-format` in bash and fish.
- [FEATURE #&#8203;3102](BurntSushi/ripgrep#3102):
  Improve completions for `--hyperlink-format` in zsh.

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever MR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this MR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this MR, check this box

---

This MR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0MS4xNDguNiIsInVwZGF0ZWRJblZlciI6IjQxLjE0OC42IiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJSZW5vdmF0ZSBCb3QiXX0=-->
netbsd-srcmastr pushed a commit to NetBSD/pkgsrc that referenced this pull request Oct 17, 2025
15.0.0 (2025-10-15)
===================
ripgrep 15 is a new major version release of ripgrep that mostly has bug fixes,
some minor performance improvements and minor new features. Here are some
highlights:

* Several bugs around gitignore matching have been fixed. This includes
  a commonly reported bug related to applying gitignore rules from parent
  directories.
* A memory usage regression when handling very large gitignore files has been
  fixed.
* `rg -vf file`, where `file` is empty, now matches everything.
* The `-r/--replace` flag now works with `--json`.
* A subset of Jujutsu (`jj`) repositories are now treated as if they were git
  repositories. That is, ripgrep will respect `jj`'s gitignores.
* Globs can now use nested curly braces.

Platform support:

* `aarch64` for Windows now has release artifacts.
* `powerpc64` no longer has release artifacts generated for it. The CI
  release workflow stopped working, and I didn't deem it worth my time to
  debug it. If someone wants this and can test it, I'd be happy to add it
  back.
* ripgrep binaries are now compiled with full LTO enabled. You may notice
  small performance improvements from this and a modest decrease in binary
  size.

Performance improvements:

* [PERF #2111](BurntSushi/ripgrep#2111):
  Don't resolve helper binaries on Windows when `-z/--search-zip` isn't used.
* [PERF #2865](BurntSushi/ripgrep#2865):
  Avoid using path canonicalization on Windows when emitting hyperlinks.
* [PERF #3184](BurntSushi/ripgrep#3184):
  Improve performance of large values with `-A/--after-context`.

Bug fixes:

* [BUG #829](BurntSushi/ripgrep#829),
  [BUG #2731](BurntSushi/ripgrep#2731),
  [BUG #2747](BurntSushi/ripgrep#2747),
  [BUG #2770](BurntSushi/ripgrep#2770),
  [BUG #2778](BurntSushi/ripgrep#2778),
  [BUG #2836](BurntSushi/ripgrep#2836),
  [BUG #2933](BurntSushi/ripgrep#2933),
  [BUG #3067](BurntSushi/ripgrep#3067):
  Fix bug related to gitignores from parent directories.
* [BUG #1332](BurntSushi/ripgrep#1332),
  [BUG #3001](BurntSushi/ripgrep#3001):
  Make `rg -vf file` where `file` is empty match everything.
* [BUG #2177](BurntSushi/ripgrep#2177):
  Ignore a UTF-8 BOM marker at the start of `.gitignore` (and similar files).
* [BUG #2750](BurntSushi/ripgrep#2750):
  Fix memory usage regression for some truly large gitignore files.
* [BUG #2944](BurntSushi/ripgrep#2944):
  Fix a bug where the "bytes searched" in `--stats` output could be incorrect.
* [BUG #2990](BurntSushi/ripgrep#2990):
  Fix a bug where ripgrep would mishandle globs that ended with a `.`.
* [BUG #2094](BurntSushi/ripgrep#2094),
  [BUG #3076](BurntSushi/ripgrep#3076):
  Fix bug with `-m/--max-count` and `-U/--multiline` showing too many matches.
* [BUG #3100](BurntSushi/ripgrep#3100):
  Preserve line terminators when using `-r/--replace` flag.
* [BUG #3108](BurntSushi/ripgrep#3108):
  Fix a bug where `-q --files-without-match` inverted the exit code.
* [BUG #3131](BurntSushi/ripgrep#3131):
  Document inconsistency between `-c/--count` and `--files-with-matches`.
* [BUG #3135](BurntSushi/ripgrep#3135):
  Fix rare panic for some classes of large regexes on large haystacks.
* [BUG #3140](BurntSushi/ripgrep#3140):
  Ensure hyphens in flag names are escaped in the roff text for the man page.
* [BUG #3155](BurntSushi/ripgrep#3155):
  Statically compile PCRE2 into macOS release artifacts on `aarch64`.
* [BUG #3173](BurntSushi/ripgrep#3173):
  Fix ancestor ignore filter bug when searching whitelisted hidden files.
* [BUG #3178](BurntSushi/ripgrep#3178):
  Fix bug causing incorrect summary statistics with `--json` flag.
* [BUG #3179](BurntSushi/ripgrep#3179):
  Fix gitignore bug when searching absolute paths with global gitignores.
* [BUG #3180](BurntSushi/ripgrep#3180):
  Fix a panicking bug when using `-U/--multiline` and `-r/--replace`.

Feature enhancements:

* Many enhancements to the default set of file types available for filtering.
* [FEATURE #1872](BurntSushi/ripgrep#1872):
  Make `-r/--replace` work with `--json`.
* [FEATURE #2708](BurntSushi/ripgrep#2708):
  Completions for the fish shell take ripgrep's config file into account.
* [FEATURE #2841](BurntSushi/ripgrep#2841):
  Add `italic` to the list of available style attributes in `--color`.
* [FEATURE #2842](BurntSushi/ripgrep#2842):
  Directories containing `.jj` are now treated as git repositories.
* [FEATURE #2849](BurntSushi/ripgrep#2849):
  When using multithreading, schedule files to search in order given on CLI.
* [FEATURE #2943](BurntSushi/ripgrep#2943):
  Add `aarch64` release artifacts for Windows.
* [FEATURE #3024](BurntSushi/ripgrep#3024):
  Add `highlight` color type, for styling non-matching text in a matching line.
* [FEATURE #3048](BurntSushi/ripgrep#3048):
  Globs in ripgrep (and the `globset` crate) now support nested alternates.
* [FEATURE #3096](BurntSushi/ripgrep#3096):
  Improve completions for `--hyperlink-format` in bash and fish.
* [FEATURE #3102](BurntSushi/ripgrep#3102):
  Improve completions for `--hyperlink-format` in zsh.
netbsd-srcmastr pushed a commit to NetBSD/pkgsrc that referenced this pull request Oct 23, 2025
15.0.0 (2025-10-15)
===================
ripgrep 15 is a new major version release of ripgrep that mostly has bug fixes,
some minor performance improvements and minor new features. Here are some
highlights:

* Several bugs around gitignore matching have been fixed. This includes
  a commonly reported bug related to applying gitignore rules from parent
  directories.
* A memory usage regression when handling very large gitignore files has been
  fixed.
* `rg -vf file`, where `file` is empty, now matches everything.
* The `-r/--replace` flag now works with `--json`.
* A subset of Jujutsu (`jj`) repositories are now treated as if they were git
  repositories. That is, ripgrep will respect `jj`'s gitignores.
* Globs can now use nested curly braces.

Platform support:

* `aarch64` for Windows now has release artifacts.
* `powerpc64` no longer has release artifacts generated for it. The CI
  release workflow stopped working, and I didn't deem it worth my time to
  debug it. If someone wants this and can test it, I'd be happy to add it
  back.
* ripgrep binaries are now compiled with full LTO enabled. You may notice
  small performance improvements from this and a modest decrease in binary
  size.

Performance improvements:

* [PERF #2111](BurntSushi/ripgrep#2111):
  Don't resolve helper binaries on Windows when `-z/--search-zip` isn't used.
* [PERF #2865](BurntSushi/ripgrep#2865):
  Avoid using path canonicalization on Windows when emitting hyperlinks.
* [PERF #3184](BurntSushi/ripgrep#3184):
  Improve performance of large values with `-A/--after-context`.

Bug fixes:

* [BUG #829](BurntSushi/ripgrep#829),
  [BUG #2731](BurntSushi/ripgrep#2731),
  [BUG #2747](BurntSushi/ripgrep#2747),
  [BUG #2770](BurntSushi/ripgrep#2770),
  [BUG #2778](BurntSushi/ripgrep#2778),
  [BUG #2836](BurntSushi/ripgrep#2836),
  [BUG #2933](BurntSushi/ripgrep#2933),
  [BUG #3067](BurntSushi/ripgrep#3067):
  Fix bug related to gitignores from parent directories.
* [BUG #1332](BurntSushi/ripgrep#1332),
  [BUG #3001](BurntSushi/ripgrep#3001):
  Make `rg -vf file` where `file` is empty match everything.
* [BUG #2177](BurntSushi/ripgrep#2177):
  Ignore a UTF-8 BOM marker at the start of `.gitignore` (and similar files).
* [BUG #2750](BurntSushi/ripgrep#2750):
  Fix memory usage regression for some truly large gitignore files.
* [BUG #2944](BurntSushi/ripgrep#2944):
  Fix a bug where the "bytes searched" in `--stats` output could be incorrect.
* [BUG #2990](BurntSushi/ripgrep#2990):
  Fix a bug where ripgrep would mishandle globs that ended with a `.`.
* [BUG #2094](BurntSushi/ripgrep#2094),
  [BUG #3076](BurntSushi/ripgrep#3076):
  Fix bug with `-m/--max-count` and `-U/--multiline` showing too many matches.
* [BUG #3100](BurntSushi/ripgrep#3100):
  Preserve line terminators when using `-r/--replace` flag.
* [BUG #3108](BurntSushi/ripgrep#3108):
  Fix a bug where `-q --files-without-match` inverted the exit code.
* [BUG #3131](BurntSushi/ripgrep#3131):
  Document inconsistency between `-c/--count` and `--files-with-matches`.
* [BUG #3135](BurntSushi/ripgrep#3135):
  Fix rare panic for some classes of large regexes on large haystacks.
* [BUG #3140](BurntSushi/ripgrep#3140):
  Ensure hyphens in flag names are escaped in the roff text for the man page.
* [BUG #3155](BurntSushi/ripgrep#3155):
  Statically compile PCRE2 into macOS release artifacts on `aarch64`.
* [BUG #3173](BurntSushi/ripgrep#3173):
  Fix ancestor ignore filter bug when searching whitelisted hidden files.
* [BUG #3178](BurntSushi/ripgrep#3178):
  Fix bug causing incorrect summary statistics with `--json` flag.
* [BUG #3179](BurntSushi/ripgrep#3179):
  Fix gitignore bug when searching absolute paths with global gitignores.
* [BUG #3180](BurntSushi/ripgrep#3180):
  Fix a panicking bug when using `-U/--multiline` and `-r/--replace`.

Feature enhancements:

* Many enhancements to the default set of file types available for filtering.
* [FEATURE #1872](BurntSushi/ripgrep#1872):
  Make `-r/--replace` work with `--json`.
* [FEATURE #2708](BurntSushi/ripgrep#2708):
  Completions for the fish shell take ripgrep's config file into account.
* [FEATURE #2841](BurntSushi/ripgrep#2841):
  Add `italic` to the list of available style attributes in `--color`.
* [FEATURE #2842](BurntSushi/ripgrep#2842):
  Directories containing `.jj` are now treated as git repositories.
* [FEATURE #2849](BurntSushi/ripgrep#2849):
  When using multithreading, schedule files to search in order given on CLI.
* [FEATURE #2943](BurntSushi/ripgrep#2943):
  Add `aarch64` release artifacts for Windows.
* [FEATURE #3024](BurntSushi/ripgrep#3024):
  Add `highlight` color type, for styling non-matching text in a matching line.
* [FEATURE #3048](BurntSushi/ripgrep#3048):
  Globs in ripgrep (and the `globset` crate) now support nested alternates.
* [FEATURE #3096](BurntSushi/ripgrep#3096):
  Improve completions for `--hyperlink-format` in bash and fish.
* [FEATURE #3102](BurntSushi/ripgrep#3102):
  Improve completions for `--hyperlink-format` in zsh.
t1mlange pushed a commit to lmu-plai/buggy-ripgrep that referenced this pull request Nov 4, 2025
This makes it so the presence of `.jj` will cause ripgrep to treat it
as a VCS directory, just as if `.git` were present. This is useful for
ripgrep's default behavior when working with jj repositories that don't
have a `.git` but do have `.gitignore`. Namely, ripgrep requires the
presence of a VCS repository in order to respect `.gitignore`.

We don't handle clone-specific exclude rules for jj repositories without
`.git` though. It seems it isn't 100% set yet where we can find
those[1].

Closes #2842

[1]: BurntSushi/ripgrep#2842 (comment)
riastradh pushed a commit to riastradh/pkgsrc-test20250901 that referenced this pull request Feb 8, 2026
15.0.0 (2025-10-15)
===================
ripgrep 15 is a new major version release of ripgrep that mostly has bug fixes,
some minor performance improvements and minor new features. Here are some
highlights:

* Several bugs around gitignore matching have been fixed. This includes
  a commonly reported bug related to applying gitignore rules from parent
  directories.
* A memory usage regression when handling very large gitignore files has been
  fixed.
* `rg -vf file`, where `file` is empty, now matches everything.
* The `-r/--replace` flag now works with `--json`.
* A subset of Jujutsu (`jj`) repositories are now treated as if they were git
  repositories. That is, ripgrep will respect `jj`'s gitignores.
* Globs can now use nested curly braces.

Platform support:

* `aarch64` for Windows now has release artifacts.
* `powerpc64` no longer has release artifacts generated for it. The CI
  release workflow stopped working, and I didn't deem it worth my time to
  debug it. If someone wants this and can test it, I'd be happy to add it
  back.
* ripgrep binaries are now compiled with full LTO enabled. You may notice
  small performance improvements from this and a modest decrease in binary
  size.

Performance improvements:

* [PERF #2111](BurntSushi/ripgrep#2111):
  Don't resolve helper binaries on Windows when `-z/--search-zip` isn't used.
* [PERF #2865](BurntSushi/ripgrep#2865):
  Avoid using path canonicalization on Windows when emitting hyperlinks.
* [PERF #3184](BurntSushi/ripgrep#3184):
  Improve performance of large values with `-A/--after-context`.

Bug fixes:

* [BUG #829](BurntSushi/ripgrep#829),
  [BUG #2731](BurntSushi/ripgrep#2731),
  [BUG #2747](BurntSushi/ripgrep#2747),
  [BUG #2770](BurntSushi/ripgrep#2770),
  [BUG #2778](BurntSushi/ripgrep#2778),
  [BUG #2836](BurntSushi/ripgrep#2836),
  [BUG #2933](BurntSushi/ripgrep#2933),
  [BUG #3067](BurntSushi/ripgrep#3067):
  Fix bug related to gitignores from parent directories.
* [BUG #1332](BurntSushi/ripgrep#1332),
  [BUG #3001](BurntSushi/ripgrep#3001):
  Make `rg -vf file` where `file` is empty match everything.
* [BUG #2177](BurntSushi/ripgrep#2177):
  Ignore a UTF-8 BOM marker at the start of `.gitignore` (and similar files).
* [BUG #2750](BurntSushi/ripgrep#2750):
  Fix memory usage regression for some truly large gitignore files.
* [BUG #2944](BurntSushi/ripgrep#2944):
  Fix a bug where the "bytes searched" in `--stats` output could be incorrect.
* [BUG #2990](BurntSushi/ripgrep#2990):
  Fix a bug where ripgrep would mishandle globs that ended with a `.`.
* [BUG #2094](BurntSushi/ripgrep#2094),
  [BUG #3076](BurntSushi/ripgrep#3076):
  Fix bug with `-m/--max-count` and `-U/--multiline` showing too many matches.
* [BUG #3100](BurntSushi/ripgrep#3100):
  Preserve line terminators when using `-r/--replace` flag.
* [BUG #3108](BurntSushi/ripgrep#3108):
  Fix a bug where `-q --files-without-match` inverted the exit code.
* [BUG #3131](BurntSushi/ripgrep#3131):
  Document inconsistency between `-c/--count` and `--files-with-matches`.
* [BUG #3135](BurntSushi/ripgrep#3135):
  Fix rare panic for some classes of large regexes on large haystacks.
* [BUG #3140](BurntSushi/ripgrep#3140):
  Ensure hyphens in flag names are escaped in the roff text for the man page.
* [BUG #3155](BurntSushi/ripgrep#3155):
  Statically compile PCRE2 into macOS release artifacts on `aarch64`.
* [BUG #3173](BurntSushi/ripgrep#3173):
  Fix ancestor ignore filter bug when searching whitelisted hidden files.
* [BUG #3178](BurntSushi/ripgrep#3178):
  Fix bug causing incorrect summary statistics with `--json` flag.
* [BUG #3179](BurntSushi/ripgrep#3179):
  Fix gitignore bug when searching absolute paths with global gitignores.
* [BUG #3180](BurntSushi/ripgrep#3180):
  Fix a panicking bug when using `-U/--multiline` and `-r/--replace`.

Feature enhancements:

* Many enhancements to the default set of file types available for filtering.
* [FEATURE #1872](BurntSushi/ripgrep#1872):
  Make `-r/--replace` work with `--json`.
* [FEATURE #2708](BurntSushi/ripgrep#2708):
  Completions for the fish shell take ripgrep's config file into account.
* [FEATURE #2841](BurntSushi/ripgrep#2841):
  Add `italic` to the list of available style attributes in `--color`.
* [FEATURE #2842](BurntSushi/ripgrep#2842):
  Directories containing `.jj` are now treated as git repositories.
* [FEATURE #2849](BurntSushi/ripgrep#2849):
  When using multithreading, schedule files to search in order given on CLI.
* [FEATURE #2943](BurntSushi/ripgrep#2943):
  Add `aarch64` release artifacts for Windows.
* [FEATURE #3024](BurntSushi/ripgrep#3024):
  Add `highlight` color type, for styling non-matching text in a matching line.
* [FEATURE #3048](BurntSushi/ripgrep#3048):
  Globs in ripgrep (and the `globset` crate) now support nested alternates.
* [FEATURE #3096](BurntSushi/ripgrep#3096):
  Improve completions for `--hyperlink-format` in bash and fish.
* [FEATURE #3102](BurntSushi/ripgrep#3102):
  Improve completions for `--hyperlink-format` in zsh.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

rollup A PR that has been merged with many others in a rollup.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants