pub struct IgnoreSpec {
pub gitignore: bool,
pub dot_ignore: bool,
pub exclude_git: bool,
pub patterns: Vec<String>,
}Expand description
What a sync excludes. Part of the shared root’s identity (crate::RootKey):
two syncs indexing different trees cannot share a reconciler, exactly as
for recursive — so this derives Hash/Eq over the normalized
pattern list rather than over a compiled matcher.
Fields§
§gitignore: boolHonor .gitignore in and above the root, plus the governing
repository’s $GIT_DIR/info/exclude and the user’s
core.excludesFile.
dot_ignore: boolHonor .ignore in and above the root — ripgrep’s convention,
which a project can use to hide things from tooling without
telling git to stop tracking them.
exclude_git: boolOmit every entry whose final component is exactly .git.
patterns: Vec<String>Extra gitignore-syntax patterns, root-anchored, highest precedence.
Implementations§
Source§impl IgnoreSpec
impl IgnoreSpec
Sourcepub fn is_empty(&self) -> bool
pub fn is_empty(&self) -> bool
Nothing to exclude: the reconciler skips building a matcher at all, so an unfiltered sync pays exactly what it paid before.
Sourcepub fn reads_ignore_files(&self) -> bool
pub fn reads_ignore_files(&self) -> bool
Whether any per-directory ignore file is consulted.
Sourcepub fn file_names(&self) -> Vec<&'static str>
pub fn file_names(&self) -> Vec<&'static str>
Per-directory ignore file names this spec reads, ascending precedence within one directory.
Sourcepub fn parse_patterns(text: &str) -> Vec<String>
pub fn parse_patterns(text: &str) -> Vec<String>
Normalize the wire form — one gitignore line per \n — into the
pattern list. Blank lines and # comments are dropped here rather
than at compile time so that two specs differing only in whitespace
share one shared root.
Order carries meaning only when a negation is present, since
gitignore’s rule is last-match-wins and a list of pure exclusions
commutes. Such a list is therefore sorted and deduplicated, so two
clients that asked for the same thing in a different order share
one root instead of building two identical indexes. A list with a
! in it is left exactly as written — reordering it would change
what it means.
Trait Implementations§
Source§impl Clone for IgnoreSpec
impl Clone for IgnoreSpec
Source§fn clone(&self) -> IgnoreSpec
fn clone(&self) -> IgnoreSpec
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more