Compare commits
10 Commits
423afb8513
...
0a88cccd51
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0a88cccd51 | ||
|
|
cd1f981bea | ||
|
|
57c190d56e | ||
|
|
85edf4c796 | ||
|
|
36b7597693 | ||
|
|
a132e56b8c | ||
|
|
af60c2de9d | ||
|
|
a63671efb0 | ||
|
|
2ea06d69aa | ||
|
|
85006b08d6 |
10
CHANGELOG.md
10
CHANGELOG.md
@@ -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
|
||||
|
||||
6
Cargo.lock
generated
6
Cargo.lock
generated
@@ -159,7 +159,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "grep"
|
||||
version = "0.4.0"
|
||||
version = "0.4.1"
|
||||
dependencies = [
|
||||
"grep-cli",
|
||||
"grep-matcher",
|
||||
@@ -242,7 +242,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "ignore"
|
||||
version = "0.4.24"
|
||||
version = "0.4.25"
|
||||
dependencies = [
|
||||
"bstr",
|
||||
"crossbeam-channel",
|
||||
@@ -388,7 +388,7 @@ checksum = "7a2d987857b319362043e95f5353c0535c1f58eec5336fdfcf626430af7def58"
|
||||
|
||||
[[package]]
|
||||
name = "ripgrep"
|
||||
version = "15.0.0"
|
||||
version = "15.1.0"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"bstr",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "ripgrep"
|
||||
version = "15.0.0" #:version
|
||||
version = "15.1.0" #:version
|
||||
authors = ["Andrew Gallant <jamslam@gmail.com>"]
|
||||
description = """
|
||||
ripgrep is a line-oriented search tool that recursively searches the current
|
||||
@@ -52,7 +52,7 @@ members = [
|
||||
[dependencies]
|
||||
anyhow = "1.0.75"
|
||||
bstr = "1.7.0"
|
||||
grep = { version = "0.4.0", path = "crates/grep" }
|
||||
grep = { version = "0.4.1", path = "crates/grep" }
|
||||
ignore = { version = "0.4.24", path = "crates/ignore" }
|
||||
lexopt = "0.3.0"
|
||||
log = "0.4.5"
|
||||
|
||||
@@ -229,13 +229,14 @@ pub(crate) enum GenerateMode {
|
||||
}
|
||||
|
||||
/// Indicates how ripgrep should treat binary data.
|
||||
#[derive(Debug, Eq, PartialEq)]
|
||||
#[derive(Debug, Default, Eq, PartialEq)]
|
||||
pub(crate) enum BinaryMode {
|
||||
/// Automatically determine the binary mode to use. Essentially, when
|
||||
/// a file is searched explicitly, then it will be searched using the
|
||||
/// `SearchAndSuppress` strategy. Otherwise, it will be searched in a way
|
||||
/// that attempts to skip binary files as much as possible. That is, once
|
||||
/// a file is classified as binary, searching will immediately stop.
|
||||
#[default]
|
||||
Auto,
|
||||
/// Search files even when they have binary data, but if a match is found,
|
||||
/// suppress it and emit a warning.
|
||||
@@ -251,12 +252,6 @@ pub(crate) enum BinaryMode {
|
||||
AsText,
|
||||
}
|
||||
|
||||
impl Default for BinaryMode {
|
||||
fn default() -> BinaryMode {
|
||||
BinaryMode::Auto
|
||||
}
|
||||
}
|
||||
|
||||
/// Indicates what kind of boundary mode to use (line or word).
|
||||
#[derive(Debug, Eq, PartialEq)]
|
||||
pub(crate) enum BoundaryMode {
|
||||
@@ -269,10 +264,11 @@ pub(crate) enum BoundaryMode {
|
||||
/// Indicates the buffer mode that ripgrep should use when printing output.
|
||||
///
|
||||
/// The default is `Auto`.
|
||||
#[derive(Debug, Eq, PartialEq)]
|
||||
#[derive(Debug, Default, Eq, PartialEq)]
|
||||
pub(crate) enum BufferMode {
|
||||
/// Select the buffer mode, 'line' or 'block', automatically based on
|
||||
/// whether stdout is connected to a tty.
|
||||
#[default]
|
||||
Auto,
|
||||
/// Flush the output buffer whenever a line terminator is seen.
|
||||
///
|
||||
@@ -287,18 +283,13 @@ pub(crate) enum BufferMode {
|
||||
Block,
|
||||
}
|
||||
|
||||
impl Default for BufferMode {
|
||||
fn default() -> BufferMode {
|
||||
BufferMode::Auto
|
||||
}
|
||||
}
|
||||
|
||||
/// Indicates the case mode for how to interpret all patterns given to ripgrep.
|
||||
///
|
||||
/// The default is `Sensitive`.
|
||||
#[derive(Debug, Eq, PartialEq)]
|
||||
#[derive(Debug, Default, Eq, PartialEq)]
|
||||
pub(crate) enum CaseMode {
|
||||
/// Patterns are matched case sensitively. i.e., `a` does not match `A`.
|
||||
#[default]
|
||||
Sensitive,
|
||||
/// Patterns are matched case insensitively. i.e., `a` does match `A`.
|
||||
Insensitive,
|
||||
@@ -308,21 +299,16 @@ pub(crate) enum CaseMode {
|
||||
Smart,
|
||||
}
|
||||
|
||||
impl Default for CaseMode {
|
||||
fn default() -> CaseMode {
|
||||
CaseMode::Sensitive
|
||||
}
|
||||
}
|
||||
|
||||
/// Indicates whether ripgrep should include color/hyperlinks in its output.
|
||||
///
|
||||
/// The default is `Auto`.
|
||||
#[derive(Debug, Eq, PartialEq)]
|
||||
#[derive(Debug, Default, Eq, PartialEq)]
|
||||
pub(crate) enum ColorChoice {
|
||||
/// Color and hyperlinks will never be used.
|
||||
Never,
|
||||
/// Color and hyperlinks will be used only when stdout is connected to a
|
||||
/// tty.
|
||||
#[default]
|
||||
Auto,
|
||||
/// Color will always be used.
|
||||
Always,
|
||||
@@ -335,12 +321,6 @@ pub(crate) enum ColorChoice {
|
||||
Ansi,
|
||||
}
|
||||
|
||||
impl Default for ColorChoice {
|
||||
fn default() -> ColorChoice {
|
||||
ColorChoice::Auto
|
||||
}
|
||||
}
|
||||
|
||||
impl ColorChoice {
|
||||
/// Convert this color choice to the corresponding termcolor type.
|
||||
pub(crate) fn to_termcolor(&self) -> termcolor::ColorChoice {
|
||||
@@ -529,9 +509,10 @@ impl ContextSeparator {
|
||||
/// The encoding mode the searcher will use.
|
||||
///
|
||||
/// The default is `Auto`.
|
||||
#[derive(Debug, Eq, PartialEq)]
|
||||
#[derive(Debug, Default, Eq, PartialEq)]
|
||||
pub(crate) enum EncodingMode {
|
||||
/// Use only BOM sniffing to auto-detect an encoding.
|
||||
#[default]
|
||||
Auto,
|
||||
/// Use an explicit encoding forcefully, but let BOM sniffing override it.
|
||||
Some(grep::searcher::Encoding),
|
||||
@@ -541,21 +522,16 @@ pub(crate) enum EncodingMode {
|
||||
Disabled,
|
||||
}
|
||||
|
||||
impl Default for EncodingMode {
|
||||
fn default() -> EncodingMode {
|
||||
EncodingMode::Auto
|
||||
}
|
||||
}
|
||||
|
||||
/// The regex engine to use.
|
||||
///
|
||||
/// The default is `Default`.
|
||||
#[derive(Debug, Eq, PartialEq)]
|
||||
#[derive(Debug, Default, Eq, PartialEq)]
|
||||
pub(crate) enum EngineChoice {
|
||||
/// Uses the default regex engine: Rust's `regex` crate.
|
||||
///
|
||||
/// (Well, technically it uses `regex-automata`, but `regex-automata` is
|
||||
/// the implementation of the `regex` crate.)
|
||||
#[default]
|
||||
Default,
|
||||
/// Dynamically select the right engine to use.
|
||||
///
|
||||
@@ -566,12 +542,6 @@ pub(crate) enum EngineChoice {
|
||||
PCRE2,
|
||||
}
|
||||
|
||||
impl Default for EngineChoice {
|
||||
fn default() -> EngineChoice {
|
||||
EngineChoice::Default
|
||||
}
|
||||
}
|
||||
|
||||
/// The field context separator to use to between metadata for each contextual
|
||||
/// line.
|
||||
///
|
||||
@@ -651,10 +621,11 @@ pub(crate) enum LoggingMode {
|
||||
/// Indicates when to use memory maps.
|
||||
///
|
||||
/// The default is `Auto`.
|
||||
#[derive(Debug, Eq, PartialEq)]
|
||||
#[derive(Debug, Default, Eq, PartialEq)]
|
||||
pub(crate) enum MmapMode {
|
||||
/// This instructs ripgrep to use heuristics for selecting when to and not
|
||||
/// to use memory maps for searching.
|
||||
#[default]
|
||||
Auto,
|
||||
/// This instructs ripgrep to always try memory maps when possible. (Memory
|
||||
/// maps are not possible to use in all circumstances, for example, for
|
||||
@@ -666,12 +637,6 @@ pub(crate) enum MmapMode {
|
||||
Never,
|
||||
}
|
||||
|
||||
impl Default for MmapMode {
|
||||
fn default() -> MmapMode {
|
||||
MmapMode::Auto
|
||||
}
|
||||
}
|
||||
|
||||
/// Represents a source of patterns that ripgrep should search for.
|
||||
///
|
||||
/// The reason to unify these is so that we can retain the order of `-f/--flag`
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "grep"
|
||||
version = "0.4.0" #:version
|
||||
version = "0.4.1" #:version
|
||||
authors = ["Andrew Gallant <jamslam@gmail.com>"]
|
||||
description = """
|
||||
Fast line oriented regex searching as a library.
|
||||
@@ -17,7 +17,7 @@ edition = "2024"
|
||||
grep-cli = { version = "0.1.12", path = "../cli" }
|
||||
grep-matcher = { version = "0.1.8", path = "../matcher" }
|
||||
grep-pcre2 = { version = "0.1.9", path = "../pcre2", optional = true }
|
||||
grep-printer = { version = "0.3.0", path = "../printer" }
|
||||
grep-printer = { version = "0.3.1", path = "../printer" }
|
||||
grep-regex = { version = "0.1.14", path = "../regex" }
|
||||
grep-searcher = { version = "0.1.16", path = "../searcher" }
|
||||
|
||||
|
||||
@@ -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`
|
||||
|
||||
@@ -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() {
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -922,8 +922,6 @@ be, to a very large extent, the result of luck. Sherlock Holmes
|
||||
eqnice!(expected, cmd.stdout());
|
||||
});
|
||||
|
||||
// lz4 decompression tool doesn't work under RISC-V QEMU emulation in CI
|
||||
#[cfg(not(target_arch = "riscv64"))]
|
||||
rgtest!(compressed_lz4, |dir: Dir, mut cmd: TestCommand| {
|
||||
if !cmd_exists("lz4") {
|
||||
return;
|
||||
@@ -954,8 +952,6 @@ be, to a very large extent, the result of luck. Sherlock Holmes
|
||||
eqnice!(expected, cmd.stdout());
|
||||
});
|
||||
|
||||
// brotli decompression tool doesn't work under RISC-V QEMU emulation in CI
|
||||
#[cfg(not(target_arch = "riscv64"))]
|
||||
rgtest!(compressed_brotli, |dir: Dir, mut cmd: TestCommand| {
|
||||
if !cmd_exists("brotli") {
|
||||
return;
|
||||
@@ -971,8 +967,6 @@ be, to a very large extent, the result of luck. Sherlock Holmes
|
||||
eqnice!(expected, cmd.stdout());
|
||||
});
|
||||
|
||||
// zstd decompression tool doesn't work under RISC-V QEMU emulation in CI
|
||||
#[cfg(not(target_arch = "riscv64"))]
|
||||
rgtest!(compressed_zstd, |dir: Dir, mut cmd: TestCommand| {
|
||||
if !cmd_exists("zstd") {
|
||||
return;
|
||||
|
||||
@@ -45,7 +45,10 @@ pub fn sort_lines(lines: &str) -> String {
|
||||
/// Returns true if and only if the given program can be successfully executed
|
||||
/// with a `--help` flag.
|
||||
pub fn cmd_exists(program: &str) -> bool {
|
||||
Command::new(program).arg("--help").output().is_ok()
|
||||
match Command::new(program).arg("--help").output() {
|
||||
Ok(output) => output.status.success(),
|
||||
Err(_) => false,
|
||||
}
|
||||
}
|
||||
|
||||
/// Dir represents a directory in which tests should be run.
|
||||
|
||||
Reference in New Issue
Block a user