Repository navigation
Resolve merge conflicts per file with configurable rules and shared r… - #269
Draft
Zubair Maalick (zmaalick) wants to merge 3 commits into
Draft
Zubair Maalick (zmaalick) wants to merge 3 commits into
Zubair Maalick (zmaalick) wants to merge 3 commits into
Conversation
Zubair Maalick (zmaalick)
marked this pull request as draft
December 1, 2026 14:28
Zubair Maalick (zmaalick)
force-pushed
the
merge_conflict_rules
branch
from
December 1, 2026 15:26
cbedf35 to
c64d093
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.
…erere
PR Summary
Sci/Tech Reviewer:
Code Reviewer:
Resolve merge conflicts in
get_git_sources.pyfile by file using configurable rules, fix thecheckout --ourscrash on one-sided files, and add an optional sharedgit rererecache.Sci/Tech Reviewer:
Code Reviewer:
When a suite combines many branches in
dependencies.yaml,handle_merge_conflicts()currently runsgit checkout --ours -- <path>on whole directories from a fixedCONFLICT_IGNORESlist. This has two problems:path '...' does not have our version, and the extract task fails.CONTRIBUTORS.mdcan't combine both sides.Changes
CONFLICT_RULESsetting. It takes comma-separatedpattern=strategyrules, and the first match wins.ours: keep the version merged so far.theirs: take the version from the branch being merged.union: keep the lines from both sides.fail: leave the conflict for the user.*,?or[are globs matched against the whole path (*also matches/). Plain patterns match that file or anything under that directory.CONFLICT_IGNORESstill works. It is applied asours, checked afterCONFLICT_RULES, so existing suites behave the same apart from the crash fix.dependencies.yaml=ours,rose-stem=ours,CONTRIBUTORS.md=union. PreviouslyCONTRIBUTORS.mdwas resolved asours.unionon a one-sided file keeps the version that exists.CONFLICT_RERERE_CACHE. It enablesgit rererewithrr-cachelinked to$CONFLICT_RERERE_CACHE/<dependency>. A resolution someone commits once in an extracted clone is then reused automatically by later extracts.SubprocessRunError.SubprocessRunErrorwas being created with the command and return code swapped, so messages readErrorcode <command> raised when running command '<code>'.RuntimeErrorlisting unresolved files now starts the file list on a new line.get_unmerged().Notes for reviewers
CONFLICT_RULESreplaces the defaults, the same way settingCONFLICT_IGNORESalready does.<
Code Quality Checklist
Testing
Security Considerations
AI Assistance and Attribution
Sci/Tech Review
(Please alert the code reviewer via a tag when you have approved the SR)
Code Review