feat: configurable conflict resolver for rebase conflicts#146
Open
abersnaze wants to merge 2 commits intomsiemens:masterfrom
Open
feat: configurable conflict resolver for rebase conflicts#146abersnaze wants to merge 2 commits intomsiemens:masterfrom
abersnaze wants to merge 2 commits intomsiemens:masterfrom
Conversation
When `git up` encounters a rebase conflict, it can now invoke a
configurable command to resolve it automatically. Configure via:
git config git-up.rebase.conflict-resolver "claude -p {prompt}"
git-up builds a rich default prompt with branch names, conflicted
files, and resolution steps, then substitutes it into the {prompt}
placeholder. Environment variables GITUP_BRANCH, GITUP_TARGET, and
GITUP_REPO_PATH are also set.
If the resolver succeeds (exit 0 and rebase completed), git-up
continues to the next branch. If it fails, the repo is left in the
conflicted state for manual resolution.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
583e416 to
ecc5b09
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
git-up.rebase.conflict-resolverconfig setting that specifies a command to invoke when rebase conflicts occur{prompt}placeholderUsage
Changes
git_wrapper.py: Addedsuppress_popflag tostasher()to prevent auto-unstash when leaving conflicted state; addedUnresolvedConflictErrorexceptiongitup.py: New setting,_build_resolver_prompt(),_try_resolve_conflicts(), and integration into the rebase pathtests/test_conflict_resolver.py: 4 tests covering resolver success, failure, no-resolver fallback, and prompt contentTest plan
python -m pytest PyGitUp/tests/test_conflict_resolver.py -xvs— all 4 new tests passpython -m pytest PyGitUp/tests/ -x— full suite (40 tests) passes with no regressionsgit-up.rebase.conflict-resolver, create a conflict, verifygit upinvokes the resolver🤖 Generated with Claude Code