mirror of
https://github.com/BurntSushi/ripgrep.git
synced 2025-07-25 17:21:57 -07:00
Compare commits
22 Commits
grep-print
...
14.0.3
Author | SHA1 | Date | |
---|---|---|---|
|
67ad9917ad | ||
|
daa157b5f9 | ||
|
ca5e294ad6 | ||
|
6c7947b819 | ||
|
9acb4a5405 | ||
|
0096c74c11 | ||
|
8c48355b03 | ||
|
f9b86de963 | ||
|
d23b74975a | ||
|
a5cbdb3dfe | ||
|
b6bac8484e | ||
|
805fa32d18 | ||
|
2d518dd1f9 | ||
|
8575d26179 | ||
|
2e81a7adfe | ||
|
cd5440fb62 | ||
|
2ee690e87a | ||
|
59f86a45d3 | ||
|
2d31af38a2 | ||
|
0da1176e7d | ||
|
eeffcd50b7 | ||
|
625743d7c8 |
12
.github/workflows/release.yml
vendored
12
.github/workflows/release.yml
vendored
@@ -332,14 +332,15 @@ jobs:
|
||||
run: |
|
||||
cargo deb --profile deb --target ${{ env.TARGET }}
|
||||
version="${{ needs.create-release.outputs.version }}"
|
||||
deb="target/${{ env.TARGET }}/debian/ripgrep_$version-1_amd64.deb"
|
||||
echo "DEB=$deb" >> $GITHUB_ENV
|
||||
echo "DEB_DIR=target/${{ env.TARGET }}/debian" >> $GITHUB_ENV
|
||||
echo "DEB_NAME=ripgrep_$version-1_amd64.deb" >> $GITHUB_ENV
|
||||
|
||||
- name: Create sha256 sum of deb file
|
||||
shell: bash
|
||||
run: |
|
||||
sum="$DEB.sha256"
|
||||
shasum -a 256 "$DEB" > "$sum"
|
||||
cd "$DEB_DIR"
|
||||
sum="$DEB_NAME.sha256"
|
||||
shasum -a 256 "$DEB_NAME" > "$sum"
|
||||
echo "SUM=$sum" >> $GITHUB_ENV
|
||||
|
||||
- name: Upload release archive
|
||||
@@ -347,5 +348,6 @@ jobs:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
shell: bash
|
||||
run: |
|
||||
cd "$DEB_DIR"
|
||||
version="${{ needs.create-release.outputs.version }}"
|
||||
gh release upload "$version" ${{ env.DEB }} ${{ env.SUM }}
|
||||
gh release upload "$version" "$DEB_NAME" "$SUM"
|
||||
|
46
CHANGELOG.md
46
CHANGELOG.md
@@ -1,9 +1,45 @@
|
||||
14.0.3 (2023-11-28)
|
||||
===================
|
||||
This is a patch release with a bug fix for the `--sortr` flag.
|
||||
|
||||
Bug fixes:
|
||||
|
||||
* [BUG #2664](https://github.com/BurntSushi/ripgrep/issues/2664):
|
||||
Fix `--sortr=path`. I left a `todo!()` in the source. Oof.
|
||||
|
||||
|
||||
14.0.2 (2023-11-27)
|
||||
===================
|
||||
This is a patch release with a few small bug fixes.
|
||||
|
||||
Bug fixes:
|
||||
|
||||
* [BUG #2654](https://github.com/BurntSushi/ripgrep/issues/2654):
|
||||
Fix `deb` release sha256 sum file.
|
||||
* [BUG #2658](https://github.com/BurntSushi/ripgrep/issues/2658):
|
||||
Fix partial regression in the behavior of `--null-data --line-regexp`.
|
||||
* [BUG #2659](https://github.com/BurntSushi/ripgrep/issues/2659):
|
||||
Fix Fish shell completions.
|
||||
* [BUG #2662](https://github.com/BurntSushi/ripgrep/issues/2662):
|
||||
Fix typo in documentation for `-i/--ignore-case`.
|
||||
|
||||
|
||||
14.0.1 (2023-11-26)
|
||||
===================
|
||||
This a patch release meant to fix `cargo install ripgrep` on Windows.
|
||||
|
||||
Bug fixes:
|
||||
|
||||
* [BUG #2653](https://github.com/BurntSushi/ripgrep/issues/2653):
|
||||
Include `pkg/windows/Manifest.xml` in crate package.
|
||||
|
||||
|
||||
14.0.0 (2023-11-26)
|
||||
===================
|
||||
ripgrep 14 is a new major version release of ripgrep that has some new
|
||||
features, performance improvements and a lot of bug fixes.
|
||||
|
||||
The headling feature in this release is hyperlink support. In this release,
|
||||
The headlining feature in this release is hyperlink support. In this release,
|
||||
they are an opt-in feature but may change to an opt-out feature in the future.
|
||||
To enable them, try passing `--hyperlink-format default`. If you use [VS Code],
|
||||
then try passing `--hyperlink-format vscode`. Please [report your experience
|
||||
@@ -12,10 +48,10 @@ with hyperlinks][report-hyperlinks], positive or negative.
|
||||
[VS Code]: https://code.visualstudio.com/
|
||||
[report-hyperlinks]: https://github.com/BurntSushi/ripgrep/discussions/2611
|
||||
|
||||
Another headling development in this release is that it contains a rewrite of
|
||||
its regex engine. You generally shouldn't notice any changes, except for some
|
||||
searches may get faster. You can read more about the [regex engine rewrite on
|
||||
my blog][regex-internals]. Please [report your performance improvements or
|
||||
Another headlining development in this release is that it contains a rewrite
|
||||
of its regex engine. You generally shouldn't notice any changes, except for
|
||||
some searches may get faster. You can read more about the [regex engine rewrite
|
||||
on my blog][regex-internals]. Please [report your performance improvements or
|
||||
regressions that you notice][report-perf].
|
||||
|
||||
[report-perf]: https://github.com/BurntSushi/ripgrep/discussions/2652
|
||||
|
8
Cargo.lock
generated
8
Cargo.lock
generated
@@ -134,7 +134,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "grep"
|
||||
version = "0.2.13"
|
||||
version = "0.3.1"
|
||||
dependencies = [
|
||||
"grep-cli",
|
||||
"grep-matcher",
|
||||
@@ -177,7 +177,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "grep-printer"
|
||||
version = "0.2.0"
|
||||
version = "0.2.1"
|
||||
dependencies = [
|
||||
"bstr",
|
||||
"grep-matcher",
|
||||
@@ -202,7 +202,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "grep-searcher"
|
||||
version = "0.1.12"
|
||||
version = "0.1.13"
|
||||
dependencies = [
|
||||
"bstr",
|
||||
"encoding_rs",
|
||||
@@ -411,7 +411,7 @@ checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f"
|
||||
|
||||
[[package]]
|
||||
name = "ripgrep"
|
||||
version = "14.0.0"
|
||||
version = "14.0.3"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"bstr",
|
||||
|
18
Cargo.toml
18
Cargo.toml
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "ripgrep"
|
||||
version = "14.0.0" #:version
|
||||
version = "14.0.3" #:version
|
||||
authors = ["Andrew Gallant <jamslam@gmail.com>"]
|
||||
description = """
|
||||
ripgrep is a line-oriented search tool that recursively searches the current
|
||||
@@ -17,7 +17,7 @@ exclude = [
|
||||
"HomebrewFormula",
|
||||
"/.github/",
|
||||
"/ci/",
|
||||
"/pkg/",
|
||||
"/pkg/brew",
|
||||
"/benchsuite/",
|
||||
"/scripts/",
|
||||
]
|
||||
@@ -51,7 +51,7 @@ members = [
|
||||
[dependencies]
|
||||
anyhow = "1.0.75"
|
||||
bstr = "1.7.0"
|
||||
grep = { version = "0.2.13", path = "crates/grep" }
|
||||
grep = { version = "0.3.1", path = "crates/grep" }
|
||||
ignore = { version = "0.4.21", path = "crates/ignore" }
|
||||
lexopt = "0.3.0"
|
||||
log = "0.4.5"
|
||||
@@ -74,6 +74,18 @@ pcre2 = ["grep/pcre2"]
|
||||
[profile.release]
|
||||
debug = 1
|
||||
|
||||
[profile.release-lto]
|
||||
inherits = "release"
|
||||
opt-level = 3
|
||||
debug = "none"
|
||||
strip = "symbols"
|
||||
debug-assertions = false
|
||||
overflow-checks = false
|
||||
lto = "fat"
|
||||
panic = "abort"
|
||||
incremental = false
|
||||
codegen-units = 1
|
||||
|
||||
# This is the main way to strip binaries in the deb package created by
|
||||
# 'cargo deb'. For other release binaries, we (currently) call 'strip'
|
||||
# explicitly in the release process.
|
||||
|
@@ -27,6 +27,7 @@
|
||||
`cargo update -p ripgrep` so that the `Cargo.lock` is updated. Commit the
|
||||
changes and create a new signed tag. Alternatively, use
|
||||
`cargo-up --no-push --no-release Cargo.toml {VERSION}` to automate this.
|
||||
* Run `cargo package` and ensure it succeeds.
|
||||
* Push changes to GitHub, NOT including the tag. (But do not publish a new
|
||||
version of ripgrep to crates.io yet.)
|
||||
* Once CI for `master` finishes successfully, push the version tag. (Trying to
|
||||
|
@@ -35,10 +35,11 @@ pub(crate) fn generate() -> String {
|
||||
.replace("!DOC!", &doc),
|
||||
);
|
||||
if let Some(negated) = flag.name_negated() {
|
||||
let long = format!("-l '{}'", negated.replace("'", "\\'"));
|
||||
out.push_str(
|
||||
&template
|
||||
&TEMPLATE
|
||||
.replace("!SHORT!", "")
|
||||
.replace("!LONG!", &negated)
|
||||
.replace("!LONG!", &long)
|
||||
.replace("!DOC!", &doc),
|
||||
);
|
||||
}
|
||||
|
@@ -3078,7 +3078,7 @@ Individual patterns can still be matched case sensitively by using
|
||||
inline regex flags. For example, \fB(?\-i)abc\fP will match \fBabc\fP
|
||||
case sensitively even when this flag is used.
|
||||
.sp
|
||||
This flag overrides \flag{case-sensitive} and flag{smart-case}.
|
||||
This flag overrides \flag{case-sensitive} and \flag{smart-case}.
|
||||
"#
|
||||
}
|
||||
|
||||
|
@@ -771,7 +771,13 @@ impl HiArgs {
|
||||
let Some(ref sort) = self.sort else { return Box::new(haystacks) };
|
||||
let mut with_timestamps: Vec<_> = match sort.kind {
|
||||
SortModeKind::Path if !sort.reverse => return Box::new(haystacks),
|
||||
SortModeKind::Path => todo!(),
|
||||
SortModeKind::Path => {
|
||||
let mut haystacks = haystacks.collect::<Vec<Haystack>>();
|
||||
haystacks.sort_by(|ref h1, ref h2| {
|
||||
h1.path().cmp(h2.path()).reverse()
|
||||
});
|
||||
return Box::new(haystacks.into_iter());
|
||||
}
|
||||
SortModeKind::LastModified => {
|
||||
attach_timestamps(haystacks, |md| md.modified()).collect()
|
||||
}
|
||||
|
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "grep"
|
||||
version = "0.2.13" #:version
|
||||
version = "0.3.1" #:version
|
||||
authors = ["Andrew Gallant <jamslam@gmail.com>"]
|
||||
description = """
|
||||
Fast line oriented regex searching as a library.
|
||||
@@ -17,9 +17,9 @@ edition = "2021"
|
||||
grep-cli = { version = "0.1.10", path = "../cli" }
|
||||
grep-matcher = { version = "0.1.7", path = "../matcher" }
|
||||
grep-pcre2 = { version = "0.1.7", path = "../pcre2", optional = true }
|
||||
grep-printer = { version = "0.2.0", path = "../printer" }
|
||||
grep-printer = { version = "0.2.1", path = "../printer" }
|
||||
grep-regex = { version = "0.1.12", path = "../regex" }
|
||||
grep-searcher = { version = "0.1.12", path = "../searcher" }
|
||||
grep-searcher = { version = "0.1.13", path = "../searcher" }
|
||||
|
||||
[dev-dependencies]
|
||||
termcolor = "1.0.4"
|
||||
|
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "grep-printer"
|
||||
version = "0.2.0" #:version
|
||||
version = "0.2.1" #:version
|
||||
authors = ["Andrew Gallant <jamslam@gmail.com>"]
|
||||
description = """
|
||||
An implementation of the grep crate's Sink trait that provides standard
|
||||
@@ -21,7 +21,7 @@ serde = ["dep:serde", "dep:serde_json"]
|
||||
[dependencies]
|
||||
bstr = "1.6.2"
|
||||
grep-matcher = { version = "0.1.7", path = "../matcher" }
|
||||
grep-searcher = { version = "0.1.12", path = "../searcher" }
|
||||
grep-searcher = { version = "0.1.13", path = "../searcher" }
|
||||
log = "0.4.5"
|
||||
termcolor = "1.3.0"
|
||||
serde = { version = "1.0.193", optional = true }
|
||||
|
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "grep-searcher"
|
||||
version = "0.1.12" #:version
|
||||
version = "0.1.13" #:version
|
||||
authors = ["Andrew Gallant <jamslam@gmail.com>"]
|
||||
description = """
|
||||
Fast line oriented regex searching as a library.
|
||||
|
@@ -612,6 +612,17 @@ impl<'s, M: Matcher, S: Sink> Core<'s, M, S> {
|
||||
return false;
|
||||
}
|
||||
if let Some(line_term) = self.matcher.line_terminator() {
|
||||
// FIXME: This works around a bug in grep-regex where it does
|
||||
// not set the line terminator of the regex itself, and thus
|
||||
// line anchors like `(?m:^)` and `(?m:$)` will not match
|
||||
// anything except for `\n`. So for now, we just disable the fast
|
||||
// line-by-line searcher which requires the regex to be able to
|
||||
// deal with line terminators correctly. The slow line-by-line
|
||||
// searcher strips line terminators and thus absolves the regex
|
||||
// engine from needing to care about whether they are `\n` or NUL.
|
||||
if line_term.as_byte() == b'\x00' {
|
||||
return false;
|
||||
}
|
||||
if line_term == self.config.line_term {
|
||||
return true;
|
||||
}
|
||||
|
@@ -1,14 +1,14 @@
|
||||
class RipgrepBin < Formula
|
||||
version '13.0.0'
|
||||
version '14.0.2'
|
||||
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 "585c18350cb8d4392461edd6c921e6edd5a97cbfc03b567d7bd440423e118082"
|
||||
sha256 "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"
|
||||
elsif OS.linux?
|
||||
url "https://github.com/BurntSushi/ripgrep/releases/download/#{version}/ripgrep-#{version}-x86_64-unknown-linux-musl.tar.gz"
|
||||
sha256 "ee4e0751ab108b6da4f47c52da187d5177dc371f0f512a7caaec5434e711c091"
|
||||
sha256 "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"
|
||||
end
|
||||
|
||||
conflicts_with "ripgrep"
|
||||
|
@@ -356,6 +356,17 @@ rgtest!(f263_sort_files, |dir: Dir, mut cmd: TestCommand| {
|
||||
eqnice!(expected, cmd.arg("--sort-files").arg("test").stdout());
|
||||
});
|
||||
|
||||
// See: https://github.com/BurntSushi/ripgrep/issues/263
|
||||
rgtest!(f263_sort_files_reverse, |dir: Dir, mut cmd: TestCommand| {
|
||||
dir.create("foo", "test");
|
||||
dir.create("abc", "test");
|
||||
dir.create("zoo", "test");
|
||||
dir.create("bar", "test");
|
||||
|
||||
let expected = "zoo:test\nfoo:test\nbar:test\nabc:test\n";
|
||||
eqnice!(expected, cmd.arg("--sortr=path").arg("test").stdout());
|
||||
});
|
||||
|
||||
// See: https://github.com/BurntSushi/ripgrep/issues/275
|
||||
rgtest!(f275_pathsep, |dir: Dir, mut cmd: TestCommand| {
|
||||
dir.create_dir("foo");
|
||||
|
@@ -1210,3 +1210,10 @@ rgtest!(r2574, |dir: Dir, mut cmd: TestCommand| {
|
||||
.stdout();
|
||||
eqnice!("some.domain.com\nsome.domain.com\n", got);
|
||||
});
|
||||
|
||||
// See: https://github.com/BurntSushi/ripgrep/issues/2658
|
||||
rgtest!(r2658_null_data_line_regexp, |dir: Dir, mut cmd: TestCommand| {
|
||||
dir.create("haystack", "foo\0bar\0quux\0");
|
||||
let got = cmd.args(&["--null-data", "--line-regexp", r"bar"]).stdout();
|
||||
eqnice!("haystack:bar\0", got);
|
||||
});
|
||||
|
Reference in New Issue
Block a user