external project Hit a bug that needs to be fixed So? Ideal is fix upstream and consume Sometimes the fix is incorrect and risky for upstream Moving forward introduces risk, including changes you haven’t verified Reality: Frequently need to be able to carry local changes [email protected] Tracking Upstream January 16, 2014 2 / 20
(review patches + series file) Allow developers to develop changes without needing to prep the project after clone Be able to forward port changes without requiring devs to perform complex rebase of local branches (no ’rebase –onto’) Be able to re-review all changes Be able to re-test each change Allow porting to be resumed by different developers Automate dropping of local changes that were upstreamed Work with desired toolchain [email protected] Tracking Upstream January 16, 2014 4 / 20
expert maintainer! Changes can become split between original commit and code resolved in the merge conflict http://stackoverflow.com/questions/1461909/evil-merges-in-git Merges can hide regressions Both parents work correctly But one side reworks code that the other expects behaves differently Result breaks at merge but it’s non-trivial to determine where in the history of either side the problem was introduced Discarded as too likely to go wrong and also doesn’t help encouraging upstreaming of changes! [email protected] Tracking Upstream January 16, 2014 7 / 20
simple tests show that it works Encourages tracking of local changes More likely to contribute upstream Would support re-reviewing of changes But Problematic: Results in many hanging branches, or Rebasing already published branch used by team locally -> DANGEROUS [email protected] Tracking Upstream January 16, 2014 8 / 20
is an ’ours’ strategy for git merge If we could merge and replace our mainline with upstream + carried patches Then any git pull would have sufficient information for developer changes to be rebased without a complex rebase [email protected] Tracking Upstream January 16, 2014 9 / 20
first parent is not the original mainline Since git has no ’theirs’ merge strategy, we need to invert the merge git merge -s ours <import-branch> git diff --no-color --binary HEAD^2 | \ git apply -R --index --whitespace=nowarn - git commit --amend -C HEAD [email protected] Tracking Upstream January 16, 2014 12 / 20
into the end of each commit message The combination of project, branch and ChangeId must be unique Regresses mainline first [email protected] Tracking Upstream January 16, 2014 15 / 20
filters to each commit Supports including multiple separate packaging branches when importing from upstream (spec file?) Is not Open Source (Sorry) [email protected] Tracking Upstream January 16, 2014 17 / 20
if they can support this approach in the future This isn’t necessary for every project, but it did help solve our problems I hope that it will be contributed back to the community at some stage [email protected] Tracking Upstream January 16, 2014 19 / 20