Compare commits

...

14 Commits

Author SHA1 Message Date
Andrew Gallant
86e0ab12ef grep-searcher-0.1.16 2025-10-22 08:25:01 -04:00
Andrew Gallant
7189950799 deps: bump to globset 0.4.18 2025-10-22 08:24:51 -04:00
Andrew Gallant
0b0e013f5a globset-0.4.18 2025-10-22 08:23:57 -04:00
Andrew Gallant
cac9870a02 doc: update date in man page template 2025-10-22 08:23:05 -04:00
Andrew Gallant
bee13375ed deps: update everything 2025-10-22 08:21:56 -04:00
Andrew Gallant
f5be160839 changelog: 15.1.0 2025-10-22 08:21:34 -04:00
Jorge Gomez
24e88dc15b ignore/types: add ssa type
This PR adds support for [.ssa](https://en.wikipedia.org/wiki/Static_single-assignment_form) files as read by [qbe](https://c9x.me/compile/):

See: https://c9x.me/compile/doc/il.html#Input-Files
2025-10-22 08:18:30 -04:00
Andrew Gallant
5748f81bb1 printer: use doc_cfg instead of doc_auto_cfg
Fixes #3202
2025-10-22 07:47:07 -04:00
Andrew Gallant
d47663b1b4 searcher: fix regression with --line-buffered flag
In my fix for #3184, I actually had two fixes. One was a tweak to how we
read data and the other was a tweak to how we determined how much of the
buffer we needed to keep around. It turns out that fixing #3184 only
required the latter fix, found in commit
d4b77a8d89. The former fix also helped the
specific case of #3184, but it ended up regressing `--line-buffered`.

Specifically, previous to 8c6595c215 (the
first fix), we would do one `read` syscall. This call might not fill our
caller provided buffer. And in particular, `stdin` seemed to fill fewer
bytes than reading from a file. So the "fix" was to put `read` in a loop
and keep calling it until the caller provided buffer was full or until
the stream was exhausted. This helped alleviate #3184 by amortizing
`read` syscalls better.

But of course, in retrospect, this change is clearly contrary to how
`--line-buffered` works. We specifically do _not_ want to wait around
until the buffer is full. We want to read what we can, search it and
move on.

So this reverts the first fix but leaves the second, which still
keeps #3184 fixed and also fixes #3194 (the regression).

This reverts commit 8c6595c215.

Fixes #3194
2025-10-19 11:06:39 -04:00
Enoch
38d630261a printer: add Cursor hyperlink alias
This is similar to the other aliases used by
VS Code forks.

PR #3192
2025-10-17 14:59:17 -04:00
Andrew Gallant
b3dc4b0998 globset: improve debug log
This shows the regex that the glob was compiled to.
2025-10-17 10:27:19 -04:00
Andrew Gallant
f09b55b8e7 changelog: start next section 2025-10-15 23:32:00 -04:00
Andrew Gallant
0551c6b931 pkg/brew: update tap 2025-10-15 23:31:35 -04:00
Andrew Gallant
3a612f88b8 15.0.0
Some checks failed
release / create-release (push) Has been cancelled
release / build-release (linux, ubuntu-latest, nightly, x86_64-linux-musl-strip, x86_64-unknown-linux-musl) (push) Has been cancelled
release / build-release (macos, macos-latest, nightly, aarch64-apple-darwin) (push) Has been cancelled
release / build-release (macos, macos-latest, nightly, x86_64-apple-darwin) (push) Has been cancelled
release / build-release (stable-aarch64, ubuntu-latest, qemu-aarch64, stable, aarch64-linux-gnu-strip, aarch64-unknown-linux-gnu) (push) Has been cancelled
release / build-release (stable-arm-gnueabihf, ubuntu-latest, qemu-arm, stable, arm-linux-gnueabihf-strip, armv7-unknown-linux-gnueabihf) (push) Has been cancelled
release / build-release (stable-arm-musleabi, ubuntu-latest, qemu-arm, stable, arm-linux-musleabi-strip, armv7-unknown-linux-musleabi) (push) Has been cancelled
release / build-release (stable-arm-musleabihf, ubuntu-latest, qemu-arm, stable, arm-linux-musleabihf-strip, armv7-unknown-linux-musleabihf) (push) Has been cancelled
release / build-release (stable-s390x, ubuntu-latest, qemu-s390x, stable, s390x-linux-gnu-strip, s390x-unknown-linux-gnu) (push) Has been cancelled
release / build-release (stable-x86, ubuntu-latest, i386, stable, x86_64-linux-gnu-strip, i686-unknown-linux-gnu) (push) Has been cancelled
release / build-release (win-gnu, windows-latest, nightly-x86_64-gnu, x86_64-pc-windows-gnu) (push) Has been cancelled
release / build-release (win-msvc, windows-latest, nightly, x86_64-pc-windows-msvc) (push) Has been cancelled
release / build-release (win32-msvc, windows-latest, nightly, i686-pc-windows-msvc) (push) Has been cancelled
release / build-release (winaarch64-msvc, windows-11-arm, nightly, aarch64-pc-windows-msvc) (push) Has been cancelled
release / build-release-deb (push) Has been cancelled
2025-10-15 23:07:50 -04:00
16 changed files with 63 additions and 42 deletions

View File

@@ -1,3 +1,21 @@
15.1.0
======
This is a small release that fixes a bug with how ripgrep handles line
buffering. This might manifest as ripgrep printing output later than you
expect or not working correctly with `tail -f` (even if you're using the
`--line-buffered` flag).
Bug fixes:
* [BUG #3194](https://github.com/BurntSushi/ripgrep/issues/3194):
Fix a regression with `--line-buffered` introduced in ripgrep 15.0.0.
Feature enhancements:
* [FEATURE #3192](https://github.com/BurntSushi/ripgrep/pull/3192):
Add hyperlink alias for Cursor.
15.0.0 (2025-10-15)
===================
ripgrep 15 is a new major version release of ripgrep that mostly has bug fixes,
@@ -32,8 +50,6 @@ Performance improvements:
Don't resolve helper binaries on Windows when `-z/--search-zip` isn't used.
* [PERF #2865](https://github.com/BurntSushi/ripgrep/pull/2865):
Avoid using path canonicalization on Windows when emitting hyperlinks.
* [PERF #3184](https://github.com/BurntSushi/ripgrep/pull/3184):
Improve performance of large values with `-A/--after-context`.
Bug fixes:

26
Cargo.lock generated
View File

@@ -144,7 +144,7 @@ checksum = "0cc23270f6e1808e30a928bdc84dea0b9b4136a8bc82338574f23baf47bbd280"
[[package]]
name = "globset"
version = "0.4.17"
version = "0.4.18"
dependencies = [
"aho-corasick",
"arbitrary",
@@ -227,7 +227,7 @@ dependencies = [
[[package]]
name = "grep-searcher"
version = "0.1.15"
version = "0.1.16"
dependencies = [
"bstr",
"encoding_rs",
@@ -298,9 +298,9 @@ checksum = "f52b00d39961fc5b2736ea853c9cc86238e165017a493d1d5c8eac6bdc4cc273"
[[package]]
name = "memmap2"
version = "0.9.8"
version = "0.9.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "843a98750cd611cc2965a8213b53b43e715f13c37a9e096c6408e69990961db7"
checksum = "744133e4a0e0a658e1374cf3bf8e415c4052a15a111acd372764c55b4177d490"
dependencies = [
"libc",
]
@@ -388,7 +388,7 @@ checksum = "7a2d987857b319362043e95f5353c0535c1f58eec5336fdfcf626430af7def58"
[[package]]
name = "ripgrep"
version = "14.1.1"
version = "15.0.0"
dependencies = [
"anyhow",
"bstr",
@@ -470,9 +470,9 @@ checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64"
[[package]]
name = "syn"
version = "2.0.106"
version = "2.0.107"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ede7c438028d4436d71104916910f5bb611972c5cfd7f89b8300a8186e6fada6"
checksum = "2a26dbd934e5451d21ef060c018dae56fc073894c5a7896f882928a76e6d081b"
dependencies = [
"proc-macro2",
"quote",
@@ -496,9 +496,9 @@ checksum = "c13547615a44dc9c452a8a534638acdf07120d4b6847c8178705da06306a3057"
[[package]]
name = "tikv-jemalloc-sys"
version = "0.6.0+5.3.0-1-ge13ca993e8ccb9ba9847cc330696e02839f328f7"
version = "0.6.1+5.3.0-1-ge13ca993e8ccb9ba9847cc330696e02839f328f7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cd3c60906412afa9c2b5b5a48ca6a5abe5736aec9eb48ad05037a677e52e4e2d"
checksum = "cd8aa5b2ab86a2cefa406d889139c162cbb230092f7d1d7cbc1716405d852a3b"
dependencies = [
"cc",
"libc",
@@ -506,9 +506,9 @@ dependencies = [
[[package]]
name = "tikv-jemallocator"
version = "0.6.0"
version = "0.6.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4cec5ff18518d81584f477e9bfdf957f5bb0979b0bac3af4ca30b5b3ae2d2865"
checksum = "0359b4327f954e0567e69fb191cf1436617748813819c94b8cd4a431422d053a"
dependencies = [
"libc",
"tikv-jemalloc-sys",
@@ -516,9 +516,9 @@ dependencies = [
[[package]]
name = "unicode-ident"
version = "1.0.19"
version = "1.0.20"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f63a545481291138910575129486daeaf8ac54aee4387fe7906919f7830c7d9d"
checksum = "462eeb75aeb73aea900253ce739c8e18a67423fadf006037cd3ff27e82748a06"
[[package]]
name = "walkdir"

View File

@@ -1,6 +1,6 @@
[package]
name = "ripgrep"
version = "14.1.1" #:version
version = "15.0.0" #:version
authors = ["Andrew Gallant <jamslam@gmail.com>"]
description = """
ripgrep is a line-oriented search tool that recursively searches the current

View File

@@ -15,7 +15,7 @@ edition = "2024"
[dependencies]
bstr = { version = "1.6.2", features = ["std"] }
globset = { version = "0.4.17", path = "../globset" }
globset = { version = "0.4.18", path = "../globset" }
log = "0.4.20"
termcolor = "1.3.0"

View File

@@ -1,4 +1,4 @@
.TH RG 1 2025-10-15 "!!VERSION!!" "User Commands"
.TH RG 1 2025-10-22 "!!VERSION!!" "User Commands"
.
.
.SH NAME

View File

@@ -1,6 +1,6 @@
[package]
name = "globset"
version = "0.4.17" #:version
version = "0.4.18" #:version
authors = ["Andrew Gallant <jamslam@gmail.com>"]
description = """
Cross platform single glob and glob set matching. Glob set matching is the

View File

@@ -503,7 +503,11 @@ impl GlobSet {
required_exts.add(i, ext, p.regex().to_owned());
}
MatchStrategy::Regex => {
debug!("glob converted to regex: {:?}", p);
debug!(
"glob `{:?}` converted to regex: `{:?}`",
p,
p.regex()
);
regexes.add(i, p.regex().to_owned());
}
}

View File

@@ -20,7 +20,7 @@ bench = false
[dependencies]
crossbeam-deque = "0.8.3"
globset = { version = "0.4.17", path = "../globset" }
globset = { version = "0.4.18", path = "../globset" }
log = "0.4.20"
memchr = "2.6.3"
same-file = "1.0.6"

View File

@@ -274,6 +274,7 @@ pub(crate) const DEFAULT_TYPES: &[(&[&str], &[&str])] = &[
(&["spark"], &["*.spark"]),
(&["spec"], &["*.spec"]),
(&["sql"], &["*.sql", "*.psql"]),
(&["ssa"], &["*.ssa"]),
(&["stylus"], &["*.styl"]),
(&["sv"], &["*.v", "*.vg", "*.sv", "*.svh", "*.h"]),
(&["svelte"], &["*.svelte", "*.svelte.ts"]),

View File

@@ -35,7 +35,7 @@ grep-regex = { version = "0.1.14", path = "../regex" }
all-features = true
# This opts into a nightly unstable option to show the features that need to be
# enabled for public API items. To do that, we set 'docsrs', and when that's
# enabled, we enable the 'doc_auto_cfg' feature.
# enabled, we enable the 'doc_cfg' feature.
#
# To test this locally, run:
#

View File

@@ -4,6 +4,11 @@ use crate::hyperlink::HyperlinkAlias;
///
/// These need to be sorted by name.
pub(super) const HYPERLINK_PATTERN_ALIASES: &[HyperlinkAlias] = &[
alias(
"cursor",
"Cursor scheme (cursor://)",
"cursor://file{path}:{line}:{column}",
),
prioritized_alias(
0,
"default",

View File

@@ -58,7 +58,7 @@ assert_eq!(output, expected);
*/
#![deny(missing_docs)]
#![cfg_attr(docsrs, feature(doc_auto_cfg))]
#![cfg_attr(docsrs, feature(doc_cfg))]
pub use crate::{
color::{ColorError, ColorSpecs, UserColorSpec, default_color_specs},

View File

@@ -1,6 +1,6 @@
[package]
name = "grep-searcher"
version = "0.1.15" #:version
version = "0.1.16" #:version
authors = ["Andrew Gallant <jamslam@gmail.com>"]
description = """
Fast line oriented regex searching as a library.

View File

@@ -415,26 +415,21 @@ impl LineBuffer {
assert_eq!(self.pos, 0);
loop {
self.ensure_capacity()?;
let oldend = self.end;
while !self.free_buffer().is_empty() {
let readlen = rdr.read(self.free_buffer())?;
let readlen = rdr.read(self.free_buffer().as_bytes_mut())?;
if readlen == 0 {
break;
}
self.end += readlen;
// We're only done reading for good once the caller has
// consumed everything.
self.last_lineterm = self.end;
return Ok(!self.buffer().is_empty());
}
// Get a mutable view into the bytes we've just read. These are
// the bytes that we do binary detection on, and also the bytes we
// search to find the last line terminator. We need a mutable slice
// in the case of binary conversion.
let oldend = self.end;
self.end += readlen;
let newbytes = &mut self.buf[oldend..self.end];
if newbytes.is_empty() {
self.last_lineterm = self.end;
// We're only done reading for good once the caller has
// consumed everything.
return Ok(!self.buffer().is_empty());
}
// Binary detection.
match self.config.binary {

View File

@@ -737,7 +737,7 @@ d
// Namely, it will *always* detect binary data in the current buffer
// before searching it. Thus, the total number of bytes searched is
// smaller than below.
let exp = "0:a\n\nbyte count:262142\nbinary offset:262153\n";
let exp = "0:a\n\nbyte count:262146\nbinary offset:262153\n";
// In contrast, the slice readers (for multi line as well) will only
// look for binary data in the initial chunk of bytes. After that
// point, it only looks for binary data in matches. Note though that
@@ -771,7 +771,7 @@ d
haystack.push_str("a\x00a\n");
haystack.push_str("a\n");
let exp = "0:a\n\nbyte count:262142\nbinary offset:262149\n";
let exp = "0:a\n\nbyte count:262146\nbinary offset:262149\n";
// The binary offset for the Slice readers corresponds to the binary
// data in `a\x00a\n` since the first line with binary data
// (`b\x00b\n`) isn't part of a match, and is therefore undetected.

View File

@@ -1,14 +1,14 @@
class RipgrepBin < Formula
version '14.1.1'
version '15.0.0'
desc "Recursively search directories for a regex pattern."
homepage "https://github.com/BurntSushi/ripgrep"
if OS.mac?
url "https://github.com/BurntSushi/ripgrep/releases/download/#{version}/ripgrep-#{version}-x86_64-apple-darwin.tar.gz"
sha256 "fc87e78f7cb3fea12d69072e7ef3b21509754717b746368fd40d88963630e2b3"
sha256 "44128c733d127ddbda461e01225a68b5f9997cfe7635242a797f645ca674a71a"
elsif OS.linux?
url "https://github.com/BurntSushi/ripgrep/releases/download/#{version}/ripgrep-#{version}-x86_64-unknown-linux-musl.tar.gz"
sha256 "4cf9f2741e6c465ffdb7c26f38056a59e2a2544b51f7cc128ef28337eeae4d8e"
sha256 "253ad0fd5fef0d64cba56c70dccdacc1916d4ed70ad057cc525fcdb0c3bbd2a7"
end
conflicts_with "ripgrep"