Module git_helpers

Module git_helpers 

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

CommitResultFallback
Result of commit operation with fallback.
RebaseResult
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_commit marker.
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).