Expand description
Git operations and repository management
Re-exports§
pub use recover::current_or_recover;pub use recover::cwd_removed_hint;pub use remove::BranchDeletionMode;pub use remove::BranchDeletionOutcome;pub use remove::BranchDeletionResult;pub use remove::RemovalOutput;pub use remove::RemoveOptions;pub use remove::delete_branch_if_safe;pub use remove::remove_worktree_with_cleanup;pub use remove::stage_worktree_removal;pub use remove::stop_fsmonitor_daemon;
Modules§
- fsmonitor
- Identify and reap orphaned
git fsmonitor--daemonprocesses. - recover
- Recovery from a deleted current working directory.
- remote_
ref - Unified PR/MR reference resolution.
- remove
- Worktree removal with fast-path trash staging and safe branch deletion.
- sha_
cache - Persistent cache for SHA-keyed git command results.
Structs§
- Branch
- A handle for running git commands on a specific branch.
- Branch
Ref - Reference to a branch for parallel task execution.
- Command
Error - Typed leaf error for a command (e.g.,
git) that exited non-zero with captured stdout/stderr. - Commit
Message Detail - Subject and body for one commit in a range.
- Completion
Branch - Branch information for shell completions
- Failed
Command - Information about a failed command, for display in error messages.
- GitRemote
Url - Parsed git remote URL with host, owner (namespace), and repository components.
- GitRepo
Info - Parsed, provider-neutral repository metadata.
- Hook
Error With Hint - Wrapper that displays a
WorktrunkError::HookCommandFailedwith a--no-hookshint. Created byadd_hook_skip_hintfor commands that support--no-hooks. - Hook
Type Iter - An iterator over the variants of HookType
- Integration
Signals - Integration signals for checking if a branch is integrated into target.
- Integration
Targets - Integration targets for
wt list’s status column. - Line
Diff - Line-level diff totals (added/deleted counts) used across git operations.
- Local
Branch - A single local branch entry from the branch inventory.
- RefSnapshot
- An immutable snapshot of repository ref state.
- Remote
Branch - A single remote-tracking branch entry from the branch inventory.
- Repository
- Repository state for git operations.
- Switch
Suggestion Ctx - Extra CLI context for enriching
wt switchsuggestions in error hints. - Temp
Index - A temporary copy of a worktree’s index, plus the bits needed to run
gitcommands against it. - Working
Tree - A borrowed handle for running git commands in a specific worktree.
- Worktree
Info - Parsed worktree data from
git worktree list --porcelain.
Enums§
- Branch
Category - Category of branch for completion display
- CiPlatform
- The forge a repository’s CI runs on.
- GitError
- Domain errors for git and worktree operations.
- GitRepo
Provider - Supported forge providers for repository metadata.
- Hook
Type - Hook types for git operations
- Integration
Reason - Why branch content is considered integrated into the target branch.
- RefType
- Platform-specific reference type (PR vs MR).
- Resolved
Worktree - Result of resolving a worktree name.
- Worktrunk
Error - Semantic errors that require special handling in main.rs
Constants§
- NULL_
OID - The null OID returned by git when no commits exist (e.g.,
git rev-parse HEADon an unborn branch).
Traits§
- Diagnostic
- Multi-line styled rendering for terminal display.
- Error
Ext - Worktrunk-specific extension methods on
anyhow::Error. - RefContext
- Common display fields for PR/MR context.
Functions§
- add_
hook_ skip_ hint - If the error wraps a
WorktrunkError::HookCommandFailed, wrap it withHookErrorWithHintto surface a--no-hookshint when rendered. Pass-through for any other error. - branch_
tracks_ ref - Check if a local branch is tracking a specific remote ref.
- check_
integration - Canonical integration check using pre-computed signals.
- compute_
integration_ lazy - Compute integration signals lazily with short-circuit evaluation.
- parse_
numstat_ line - Parse a git numstat line and extract insertions/deletions.
- parse_
owner_ repo - Extract owner and repository name from a git remote URL.
- parse_
porcelain_ z - Parse
git status --porcelain -zoutput into a list of affected filenames. - parse_
untracked_ files - Parse untracked files from
git status --porcelain -zoutput. - path_
dir_ name - Extract the directory name from a path for display purposes.
- set_
base_ path - Initialize the global base path for repository operations.
- try_
render_ diagnostic - Render
errviaDiagnosticif it’s a typed diagnostic, elseNone.