github.com/axw/juju@v0.0.0-20161005053422-4bd6544d08d4/doc/contributions/fixing-bugs.md (about) 1 juju and Bug Fixes 2 ================== 3 4 When fixing a bug that affects more than a single branch the prefered 5 process for fixing the bug is to perform the work against the oldest 6 branch (back porting) and then apply that patch up to each release branch 7 and finally in to master. 8 9 For example, if a bug is reported to impact R1, R2, and master. You 10 would perform the work against a branch of R1. When your fix is ready 11 you would use the pull request and review process. See: [reviewboard] 12 Then you would apply your fix to R2, and finally once your fix 13 was merged in to R2, you would apply the fix to current master. 14 15 How To Backport 16 ================ 17 Once your inital fix has been merged by the bot (the back port) the process 18 of applying your patch can be done with a few git commands. In this example I will show 19 you applying the fix in to master. 20 21 You will want to locate the SHA for the merge commit that was generated 22 by jujubot. This will be viewable on github or in your git log output. 23 Copy the SHA since we will use it to cherry-pick the fix in to master. 24 25 git checkout master 26 git checkout -b <fixed-branch-name> 27 git cherry-pick -m 1 <merge-commit-sha> 28 29 You may have some minor merge conflicts with the cherry-pick that need 30 to be fixed, this is rare when back porting the change first, but occasionally it 31 does happen. 32 33 git push your-remote <fixed-branch-name> 34 35 Now your new branch is ready to follow the same pull request and review 36 process as the original fix. Be sure to note that this is a patch 37 from a backport and link to the previous review.