pub struct Pickaxe { /* private fields */ }Expand description
Compiled pickaxe filter for crate::rev_list::rev_list.
Implementations§
Source§impl Pickaxe
impl Pickaxe
Sourcepub fn occurrences(needle: impl Into<String>) -> Self
pub fn occurrences(needle: impl Into<String>) -> Self
-S / occurrence-count pickaxe (literal string unless Self::pickaxe_regex).
Sourcepub fn line_grep(pattern: &str, ignore_case: bool) -> Result<Self, PickaxeError>
pub fn line_grep(pattern: &str, ignore_case: bool) -> Result<Self, PickaxeError>
-G / line-level regex pickaxe (Git REG_EXTENDED | REG_NEWLINE).
§Errors
Returns PickaxeError::InvalidPattern when the pattern does not compile.
Sourcepub fn ignore_case(self, on: bool) -> Self
pub fn ignore_case(self, on: bool) -> Self
Case-insensitive matching (Git -i / --regexp-ignore-case).
Sourcepub fn pickaxe_regex(self, on: bool) -> Self
pub fn pickaxe_regex(self, on: bool) -> Self
Treat -S needle as an ERE (--pickaxe-regex; only valid with occurrence mode).
Sourcepub fn build(self) -> Result<Self, PickaxeError>
pub fn build(self) -> Result<Self, PickaxeError>
Finalize a pickaxe built with Self::occurrences (compiles ERE when requested).
§Errors
Returns PickaxeError::InvalidPattern when --pickaxe-regex is set and the needle
does not compile as ERE.
Shared handle for crate::rev_list::RevListOptions.
Sourcepub fn matches_commit(
&self,
repo: &Repository,
commit_oid: ObjectId,
paths: &[String],
) -> Result<bool>
pub fn matches_commit( &self, repo: &Repository, commit_oid: ObjectId, paths: &[String], ) -> Result<bool>
Returns true when commit would be kept by git log with this pickaxe vs its first parent.
Merge commits are skipped (Git default without combined merge diffs). Non-merge commits
compare to the first parent only. Pathspecs limit which tree entries are considered.
Binary files are skipped for -G; -S searches binary blobs.
§Errors
Propagates object read and diff errors.