Skip to main content

Module git_ops

Module git_ops 

Source
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§

CommitInfo
Information about a single git commit.
MergeAttemptResult
Result of a merge attempt with conflict details.
RebaseResult
Result of a rebase operation

Enums§

ConflictType
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