Expand description
Low-level git operations and wrappers.
This module provides pure git command wrappers without dependencies on
spec, config, or operations modules. For high-level merge orchestration,
see the git module.
Structs§
- Commit
Info - Information about a single git commit.
- Merge
Attempt Result - Result of a merge attempt with conflict details.
- Rebase
Result - Result of a rebase operation
Enums§
- Conflict
Type - Type of merge conflict encountered.
Functions§
- branch_
exists - Check if a branch exists in the repository.
- branches_
have_ diverged - Check if branches have diverged (i.e., fast-forward is not possible).
- can_
fast_ forward_ merge - Check if branch can be fast-forward merged into target branch. Returns true if the merge can be done as a fast-forward (no divergence).
- checkout_
branch - Checkout a specific branch or commit. If branch is “HEAD”, it’s a detached HEAD checkout.
- classify_
conflict_ type - Classify the type of merge conflict from stderr and status output.
- count_
commits - Count number of commits in branch.
- delete_
branch - Delete a branch, removing associated worktrees first. Returns Ok(()) on success, or an error if deletion fails.
- get_
commit_ changed_ files - Get files changed in a specific commit.
- get_
commit_ files_ with_ status - Get files changed in a commit with their status (A/M/D).
- get_
commits_ for_ path - Get commits that modified a specific path.
- get_
commits_ in_ range - Get commits in a range between two refs.
- get_
conflicting_ files - Get list of files with conflicts from git status
- get_
current_ branch - Get the current branch name. Returns the branch name for the current HEAD, including “HEAD” for detached HEAD state.
- get_
file_ at_ commit - Get file content at a specific commit.
- get_
file_ at_ parent - Get file content at parent commit.
- get_
git_ config - Get a git config value by key.
- get_
git_ user_ info - Get git user name and email from config.
- get_
recent_ commits - Get the N most recent commits.
- is_
branch_ behind - Check if branch is behind target branch. Returns true if target has commits that branch doesn’t have.
- is_
branch_ merged - Check if a branch has been merged into a target branch.
- merge_
branch_ ff_ only - Merge a branch using appropriate strategy based on divergence.
- parse_
conflicting_ files - Parse conflicting files from git status –porcelain output.
- rebase_
abort - Abort an in-progress rebase
- rebase_
branch - Rebase a branch onto another branch. Returns RebaseResult with success status and any conflicting files.
- rebase_
continue - Continue a rebase after conflicts have been resolved
- remove_
worktrees_ for_ branch - Remove all worktrees associated with a branch. This is idempotent and won’t fail if no worktrees exist.
- stage_
file - Stage a file for commit