feat: add support for git rerere#545
Merged
sorenlouv merged 3 commits intosorenlouv:mainfrom Sep 17, 2025
Merged
Conversation
When git rerere is enabled and automatically resolves conflicts during cherrypick, the process would previously hang because the tool didn't recognize that conflicts were resolved. Now detects when rerere has staged resolved files and continues the backport process smoothly. - Add getStagedFiles() function to detect rerere-resolved conflicts - Enhance cherrypick() to check for staged files when conflicts occur - Add comprehensive test coverage for rerere scenarios - Maintain backward compatibility when rerere is not used
71965ff to
93d0fff
Compare
- improve logic with more defensive checks against git config - differentiate between rerere.enabled and rerere.autoUpdate - add comprehensive test coverage
93d0fff to
16ac9ff
Compare
Owner
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
Add
rerereuse cases detection by checking forrerereconfig variables and handling them accordingly.Problem
With
rerere.enabledandrerere.autoUpdateon, cherry-pick can fail whilerererereapplies resolutions and stages them, leaving no conflicts but causing the flow to wait unnecessarily.Solution
After a cherry-pick error, if
rerere.enabledandrerere.autoUpdateis enabled and there are no conflicts, proceed whenstaged > 0andunstaged == 0; otherwise require resolution as before.Tests