Expand description
Git Helper Functions
Provides git hooks management, a git wrapper for blocking commits during the agent phase, and basic repository utilities.
§Module Structure
- [
hooks] - Git hooks installation and removal identity- Git identity resolution with comprehensive fallback chain- [
repo] - Basic git repository operations (add, commit, snapshot) - [
start_commit] - Starting commit tracking for incremental diffs - [
wrapper] - Agent phase git wrapper for safe concurrent execution branch- Branch detection and default branch resolution- Rebase operations are provided via the
rebasemodule functions
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§
- GitHelpers
- Git helper state.
Enums§
- Commit
Result Fallback - Result of commit operation with fallback.
- Rebase
Result - Result of a rebase operation.
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. - continue_
rebase - Continue a rebase after conflict resolution.
- disable_
git_ wrapper - Disable git wrapper.
- end_
agent_ phase - End agent phase (removes marker file).
- get_
conflict_ markers_ for_ file - Extract conflict markers from a file.
- get_
conflicted_ files - Get a list of files that have merge conflicts.
- get_
git_ diff_ from_ start - Get the git diff from the starting commit.
- get_
repo_ root - Get the git repository root.
- git_
add_ all - Stage all changes.
- git_
commit - Create a commit.
- git_
diff - Get the diff of all changes (unstaged and staged).
- git_
snapshot - Get a snapshot of the current git status.
- rebase_
onto - Perform a rebase onto the specified upstream branch.
- require_
git_ repo - Check if we’re in a git repository.
- reset_
start_ commit - Reset the starting commit to current HEAD.
- save_
start_ commit - Save the current HEAD commit as the starting commit.
- start_
agent_ phase - Start agent phase (creates marker file, installs hooks, enables wrapper).
- uninstall_
hooks - Uninstall all Ralph-managed hooks.
- validate_
and_ truncate_ diff - Validate and optionally truncate a diff for LLM consumption (for reviewers).