Expand description
Git rebase operations using libgit2 with Git CLI fallback.
This module provides functionality to:
- Perform rebase operations onto a specified upstream branch
- Detect and report conflicts during rebase
- Abort an in-progress rebase
- Continue a rebase after conflict resolution
- Get lists of conflicted files
- Handle all rebase failure modes with fault tolerance
§Architecture
This module uses a hybrid approach:
- libgit2: For repository state detection, validation, and queries
- Git CLI: For the actual rebase operation (more reliable)
- Fallback patterns: For operations that may fail with libgit2
The Git CLI is used for rebase operations because:
- Better error messages for classification
- More robust edge case handling
- Better tested across Git versions
- Supports autostash and other features reliably
Enums§
- Rebase
Error Kind - Detailed classification of rebase failure modes.
- Rebase
Result - Result of a rebase operation.
Functions§
- abort_
rebase - Abort the current rebase operation.
- classify_
rebase_ error - Parse Git CLI output to classify rebase errors.
- continue_
rebase - Continue a rebase after conflict resolution.
- get_
conflict_ markers_ for_ file - Extract conflict markers from a file.
- get_
conflicted_ files - Get a list of files that have merge conflicts.
- rebase_
in_ progress - Check if a rebase is currently in progress.
- rebase_
onto - Perform a rebase onto the specified upstream branch.