Skip to main content

Module git

Module git 

Source
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--daemon processes.
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.
BranchRef
Reference to a branch for parallel task execution.
CommandError
Typed leaf error for a command (e.g., git) that exited non-zero with captured stdout/stderr.
CommitMessageDetail
Subject and body for one commit in a range.
CompletionBranch
Branch information for shell completions
FailedCommand
Information about a failed command, for display in error messages.
GitRemoteUrl
Parsed git remote URL with host, owner (namespace), and repository components.
GitRepoInfo
Parsed, provider-neutral repository metadata.
HookErrorWithHint
Wrapper that displays a WorktrunkError::HookCommandFailed with a --no-hooks hint. Created by add_hook_skip_hint for commands that support --no-hooks.
HookTypeIter
An iterator over the variants of HookType
IntegrationSignals
Integration signals for checking if a branch is integrated into target.
IntegrationTargets
Integration targets for wt list’s status column.
LineDiff
Line-level diff totals (added/deleted counts) used across git operations.
LocalBranch
A single local branch entry from the branch inventory.
RefSnapshot
An immutable snapshot of repository ref state.
RemoteBranch
A single remote-tracking branch entry from the branch inventory.
Repository
Repository state for git operations.
SwitchSuggestionCtx
Extra CLI context for enriching wt switch suggestions in error hints.
TempIndex
A temporary copy of a worktree’s index, plus the bits needed to run git commands against it.
WorkingTree
A borrowed handle for running git commands in a specific worktree.
WorktreeInfo
Parsed worktree data from git worktree list --porcelain.

Enums§

BranchCategory
Category of branch for completion display
CiPlatform
The forge a repository’s CI runs on.
GitError
Domain errors for git and worktree operations.
GitRepoProvider
Supported forge providers for repository metadata.
HookType
Hook types for git operations
IntegrationReason
Why branch content is considered integrated into the target branch.
RefType
Platform-specific reference type (PR vs MR).
ResolvedWorktree
Result of resolving a worktree name.
WorktrunkError
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 HEAD on an unborn branch).

Traits§

Diagnostic
Multi-line styled rendering for terminal display.
ErrorExt
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 with HookErrorWithHint to surface a --no-hooks hint 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 -z output into a list of affected filenames.
parse_untracked_files
Parse untracked files from git status --porcelain -z output.
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 err via Diagnostic if it’s a typed diagnostic, else None.