Compare commits

...

7 Commits

Author SHA1 Message Date
Andrew Gallant
67ad9917ad 14.0.3 2023-11-28 16:18:14 -05:00
Andrew Gallant
daa157b5f9 core: actually implement --sortr=path
This is an embarrassing oversight. A `todo!()` actually made its way
into a release! Oof.

This was working in ripgrep 13, but I had redone some aspects of sorting
and this just got left undone.

Fixes #2664
2023-11-28 16:17:14 -05:00
Andrew Gallant
ca5e294ad6 pkg/brew: update tap 2023-11-27 21:44:06 -05:00
Andrew Gallant
6c7947b819 14.0.2 2023-11-27 21:38:21 -05:00
Andrew Gallant
9acb4a5405 deps: bump grep to 0.3.1 2023-11-27 21:37:41 -05:00
Andrew Gallant
0096c74c11 grep-0.3.1 2023-11-27 21:36:54 -05:00
Andrew Gallant
8c48355b03 deps: bump grep-printer to 0.2.1 2023-11-27 21:36:44 -05:00
7 changed files with 37 additions and 10 deletions

View File

@@ -1,3 +1,13 @@
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.

4
Cargo.lock generated
View File

@@ -134,7 +134,7 @@ dependencies = [
[[package]]
name = "grep"
version = "0.3.0"
version = "0.3.1"
dependencies = [
"grep-cli",
"grep-matcher",
@@ -411,7 +411,7 @@ checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f"
[[package]]
name = "ripgrep"
version = "14.0.1"
version = "14.0.3"
dependencies = [
"anyhow",
"bstr",

View File

@@ -1,6 +1,6 @@
[package]
name = "ripgrep"
version = "14.0.1" #: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
@@ -51,7 +51,7 @@ members = [
[dependencies]
anyhow = "1.0.75"
bstr = "1.7.0"
grep = { version = "0.3.0", 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"

View File

@@ -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()
}

View File

@@ -1,6 +1,6 @@
[package]
name = "grep"
version = "0.3.0" #:version
version = "0.3.1" #:version
authors = ["Andrew Gallant <jamslam@gmail.com>"]
description = """
Fast line oriented regex searching as a library.
@@ -17,7 +17,7 @@ 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.13", path = "../searcher" }

View File

@@ -1,14 +1,14 @@
class RipgrepBin < Formula
version '14.0.1'
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 "927f3f02929ded0bae21e8a93283b5466c8807b38cea94a96bbec0acc6a22786"
sha256 "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"
elsif OS.linux?
url "https://github.com/BurntSushi/ripgrep/releases/download/#{version}/ripgrep-#{version}-x86_64-unknown-linux-musl.tar.gz"
sha256 "e0ca32aabfc3426c00201301fd258c7da2b18431af4edac715c56da5e4326538"
sha256 "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"
end
conflicts_with "ripgrep"

View File

@@ -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");