Compare commits

..

4 Commits

Author SHA1 Message Date
Andrew Gallant
57c190d56e ignore-0.4.25 2025-10-30 13:30:14 -04:00
Ian McKellar
85edf4c796 ignore: only stat .jj if we actually care
I was comparing the work being done by fd and find and noticed (with
`strace -f -c -S` calls) that fd was doing a ton of failed `statx`
calls. Upon closer inspection it was stating `.jj` even though I
was passing `--no-ignore`. Eventually I turned up this check in
`Ignore::add_child_path` that was doing stat on `.jj` regardless of
whether the options request it.

With this patch it'll only stat `.jj` if that's relevant to the query.

PR #3212
2025-10-30 13:29:58 -04:00
Andrew Gallant
36b7597693 changelog: start next section 2025-10-22 09:02:40 -04:00
Andrew Gallant
a132e56b8c pkg/brew: update tap 2025-10-22 09:01:12 -04:00
5 changed files with 19 additions and 8 deletions

View File

@@ -1,3 +1,13 @@
TBD
===
Unreleased changes. Release notes have not yet been written.
Bug fixes:
* [BUG #3212](https://github.com/BurntSushi/ripgrep/pull/3212):
Don't check for the existence of `.jj` when `--no-ignore` is used.
15.1.0
======
This is a small release that fixes a bug with how ripgrep handles line

2
Cargo.lock generated
View File

@@ -242,7 +242,7 @@ dependencies = [
[[package]]
name = "ignore"
version = "0.4.24"
version = "0.4.25"
dependencies = [
"bstr",
"crossbeam-channel",

View File

@@ -1,6 +1,6 @@
[package]
name = "ignore"
version = "0.4.24" #:version
version = "0.4.25" #:version
authors = ["Andrew Gallant <jamslam@gmail.com>"]
description = """
A fast library for efficiently matching ignore files such as `.gitignore`

View File

@@ -256,14 +256,15 @@ impl Ignore {
/// Like add_child, but takes a full path and returns an IgnoreInner.
fn add_child_path(&self, dir: &Path) -> (IgnoreInner, Option<Error>) {
let git_type = if self.0.opts.require_git
&& (self.0.opts.git_ignore || self.0.opts.git_exclude)
{
let check_vcs_dir = self.0.opts.require_git
&& (self.0.opts.git_ignore || self.0.opts.git_exclude);
let git_type = if check_vcs_dir {
dir.join(".git").metadata().ok().map(|md| md.file_type())
} else {
None
};
let has_git = git_type.is_some() || dir.join(".jj").exists();
let has_git =
check_vcs_dir && (git_type.is_some() || dir.join(".jj").exists());
let mut errs = PartialErrorBuilder::default();
let custom_ig_matcher = if self.0.custom_ignore_filenames.is_empty() {

View File

@@ -5,10 +5,10 @@ class RipgrepBin < Formula
if OS.mac?
url "https://github.com/BurntSushi/ripgrep/releases/download/#{version}/ripgrep-#{version}-x86_64-apple-darwin.tar.gz"
sha256 "44128c733d127ddbda461e01225a68b5f9997cfe7635242a797f645ca674a71a"
sha256 "64811cb24e77cac3057d6c40b63ac9becf9082eedd54ca411b475b755d334882"
elsif OS.linux?
url "https://github.com/BurntSushi/ripgrep/releases/download/#{version}/ripgrep-#{version}-x86_64-unknown-linux-musl.tar.gz"
sha256 "253ad0fd5fef0d64cba56c70dccdacc1916d4ed70ad057cc525fcdb0c3bbd2a7"
sha256 "1c9297be4a084eea7ecaedf93eb03d058d6faae29bbc57ecdaf5063921491599"
end
conflicts_with "ripgrep"