<div dir="ltr">Hey!<div><br></div><div>We are about to start working on 9.1.x and 9.2.y branches so I would like to propose alternative merging strategy.</div><div><br></div><div>Our current workflow looks like this:</div><div><br></div><div><font face="monospace">X - new commit<br></font></div><div><font face="monospace">X` - cherry pick to maintenance branch</font></div><div><font face="monospace">--+-------------------+-------X----- master</font></div><div><font face="monospace">  |                    \------X`---- 9.2.x</font></div><div><font face="monospace">  \---------------------------X``--- 9.1.x</font></div><div><font face="monospace"><br></font></div><div>Each commit needs to be reviewed in master branch and backported to the maintenance branches. From maintenance perspective this is a bit painful, since in above example we need to get 3 times through PR queue. Also it&#39;s worth to mention that X is not X` nor X``. Cherry-picking creates a copy of a commit. This makes some useful tricks (like git tag --contains &lt;sha1&gt;) a bit harder to use. Finally, this approach allows the codebase to diverge from maintenance branches very fast (someone might just forget to backport some of the refactoring stuff).</div><div><br></div><div>The proposal:</div><div><font face="monospace"><br></font></div><div><font face="monospace">X, Y - new commits</font></div><div><font face="monospace">/ - merge commits</font></div><div><div><font face="monospace">--+---------+------/----/--- master</font></div><div><font face="monospace">  |          \----/---Y/---- 9.2.x</font></div><div><font face="monospace">  \-------------X/---------- 9.1.x</font></div></div><div><font face="monospace"><br></font></div><div>With the proposal, a developer should always implement a given feature in the lowest possible maintenance branch. Then we will run a set of merges from 9.1.x into 9.2.x and finally into master. The biggest advantage of this approach is that given functionality (identified by a commit) will have the same SHA1 for all branches. This will allow all tools like (mentioned before) `git tag --contains &lt;sha1&gt;` to work. There are also some further implications of this approach:</div><div><ul><li>Merging commits should be performed very often (even automatically in the night (if merged without any problems)).</li><li>After releasing each maintenance release, someone will need to do a merge with strategy `ours` (`git merge -s ours upstream/9.2.x`). This way we will not have to solve version conflicts in poms.</li><li>Since there is no nice way to rebase a merge commit, they should be pushed directly into the master branch (without review, without CI). After the merge, HEAD will change and CI will automatically pick the build. Remember, merges should be done very often. So I assume there won&#39;t be any problems most of the times.</li><li>Finally, with this approach the code diverges slight slower (at least from my experience). Mainly because we don&#39;t need to remember to cherry-pick individual commits. They are automatically &quot;taken&quot; by a merge.</li></ul><div>From my past experience, this strategy works pretty nice and can be almost fully automated. It significantly lowers the maintenance pain around cherry-picks. However there is nothing for free, and we would need to get used to pushing merged directly into master (which is fine to me but some of you might not like it).</div></div><div><br></div><div>Thanks,</div><div>Sebastian</div></div>