Expand description
Ignore pattern helpers for worktree operations.
.heddleignore follows the same syntax as .gitignore: literal
names, leading / for root-anchored rules, trailing / for
directory-only matches, * and ** glob wildcards, character
classes ([abc]), and ! negation (whitelist) rules. The matcher
delegates to the ignore crate’s gitignore implementation so the
semantics are spec-compliant; only the patterns themselves are
sourced from .heddleignore instead of .gitignore.
Three “root-admin” pattern names — .heddle, .heddleignore,
and .git — get an implicit leading / so they match only at
the repo root. This preserves the long-standing invariant that a
nested .heddle/ directory (e.g. an examples/calculator/.heddle
fixture) is captured, not silently dropped. Operators who want
the gitignore-spec “match anywhere” behavior for those names can
write **/<name> explicitly.
Structs§
- Worktree
Ignore Matcher - A compiled
.heddleignorematcher. Compiling the glob set is the expensive part; matching a single path against an already-built matcher is cheap. Callers that test many paths against the same patterns (e.g. counting unignored entries across a large diff) should build the matcher once and reuse it, rather than paying the per-path compile cost that theshould_ignoreconvenience wrapper incurs.
Functions§
- build_
worktree_ ignore - Compile a
WorktreeIgnoreMatcherfrom the given pattern strings, once, for reuse across many path checks. This is the compile-once counterpart toshould_ignore, which rebuilds the matcher on every call. - should_
ignore - Whether
pathis covered by any of the.heddleignorepatterns.