Expand description
Git Helper Functions
Provides git hooks management, a git wrapper for blocking commits during the agent phase, and basic repository utilities.
All git operations use libgit2 directly - no git CLI required.
§Module Structure
hooks- Git hooks installation and removalidentity- Git identity resolution with comprehensive fallback chainrepo- Basic git repository operations (add, commit, snapshot)start_commit- Starting commit tracking for incremental diffsreview_baseline- Per-review-cycle baseline trackingwrapper- Agent phase git wrapper for safe concurrent executionbranch- Branch detection and default branch resolutionrebase- Rebase operations with fault tolerance
Re-exports§
pub use branch::get_default_branch;pub use branch::is_main_or_master_branch;
Modules§
- branch
- Git branch detection and default branch resolution.
- identity
- Git identity resolution with fallback chain.
Structs§
- Diff
Review Content - The result of diff truncation for review purposes.
- GitHelpers
- Git helper state.
Enums§
- Commit
Result Fallback - Result of commit operation with fallback.
- Diff
Truncation Level - The level of truncation applied to a diff for review.
- Rebase
Error Kind - Detailed classification of rebase failure modes.
- Rebase
Result - Result of a rebase operation.
- Review
Baseline - Start
Point
Functions§
- abort_
rebase - Abort the current rebase operation.
- cleanup_
agent_ phase_ silent - Best-effort cleanup for unexpected exits (Ctrl+C, early-return, panics).
- cleanup_
orphaned_ marker - Clean up orphaned .
no_agent_commitmarker. - cleanup_
orphaned_ marker_ with_ workspace - Clean up orphaned marker file using workspace abstraction.
- continue_
rebase - Continue a rebase after conflict resolution.
- create_
marker_ with_ workspace - Create the agent phase marker file using workspace abstraction.
- disable_
git_ wrapper - Disable git wrapper.
- end_
agent_ phase - End agent phase (removes marker file).
- get_
baseline_ summary - Get a summary of the baseline state for display.
- get_
conflict_ markers_ for_ file - Extract conflict markers from a file.
- get_
conflicted_ files - Get a list of files that have merge conflicts.
- get_
current_ head_ oid - Get the current HEAD commit OID.
- get_
git_ diff_ for_ review_ with_ workspace - Get the diff content that should be shown to reviewers.
- get_
git_ diff_ from_ start - Get the git diff from the starting commit.
- get_
git_ diff_ from_ start_ with_ workspace - Get the git diff from the starting commit (workspace-aware).
- get_
repo_ root - Get the git repository root.
- get_
review_ baseline_ info - Get review baseline info: (baseline_oid, commits_since, is_stale).
- get_
start_ commit_ summary - Get a summary of the start commit state for display.
- git_
add_ all - Stage all changes.
- git_
add_ all_ in_ repo - Stage all changes in the repository discovered from
repo_root. - git_
commit - Create a commit.
- git_
commit_ in_ repo - Create a commit in the repository discovered from
repo_root. - git_
diff - Get the diff of all changes (unstaged and staged).
- git_
diff_ from - Generate a diff from a specific starting commit.
- git_
snapshot - Get a snapshot of the current git status.
- load_
review_ baseline - Load the review baseline from the working directory.
- load_
start_ point - Load the starting commit OID from the file.
- marker_
exists_ with_ workspace - Check if the agent phase marker file exists using workspace abstraction.
- rebase_
in_ progress - Check if a rebase is currently in progress.
- rebase_
onto - Perform a rebase onto the specified upstream branch.
- remove_
marker_ with_ workspace - Remove the agent phase marker file using workspace abstraction.
- require_
git_ repo - Check if we’re in a git repository.
- reset_
start_ commit - Reset the starting commit to merge-base with the default branch.
- save_
start_ commit - Save the current HEAD commit as the starting commit.
- save_
start_ commit_ with_ workspace - Save start commit using workspace abstraction.
- start_
agent_ phase - Start agent phase (creates marker file, installs hooks, enables wrapper).
- uninstall_
hooks - Uninstall all Ralph-managed hooks.
- update_
review_ baseline - Update the review baseline to the current HEAD.
- update_
review_ baseline_ with_ workspace - Update the review baseline using the workspace abstraction.