<div dir="ltr">From my past experience, if a commit caused a conflict when merging, we always asked the author to fix it and do the merge.<div><br></div><div>After a while it became a habit that each dev who submitted a code that could result in conflicts, did all the merges. </div></div><br><div class="gmail_quote"><div dir="ltr">On Mon, Mar 27, 2017 at 12:37 PM Radim Vansa &lt;<a href="mailto:rvansa@redhat.com">rvansa@redhat.com</a>&gt; wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">If you can&#39;t merge a commit (based on 9.0.x) to master clearly, do you<br class="gmail_msg">
need to file another PR anyway? Then the lag to get some code to master<br class="gmail_msg">
increases a lot. I am not sure how useful is git tag --contains &lt;sha1&gt;<br class="gmail_msg">
if you cannot be sure that you&#39;ll find all occurrences due to this kind<br class="gmail_msg">
of issues.<br class="gmail_msg">
<br class="gmail_msg">
R.<br class="gmail_msg">
<br class="gmail_msg">
On 03/27/2017 11:33 AM, Sebastian Laskawiec wrote:<br class="gmail_msg">
&gt; Hey!<br class="gmail_msg">
&gt;<br class="gmail_msg">
&gt; We are about to start working on 9.1.x and 9.2.y branches so I would<br class="gmail_msg">
&gt; like to propose alternative merging strategy.<br class="gmail_msg">
&gt;<br class="gmail_msg">
&gt; Our current workflow looks like this:<br class="gmail_msg">
&gt;<br class="gmail_msg">
&gt; X - new commit<br class="gmail_msg">
&gt; X` - cherry pick to maintenance branch<br class="gmail_msg">
&gt; --+-------------------+-------X----- master<br class="gmail_msg">
&gt;   |                    \------X`---- 9.2.x<br class="gmail_msg">
&gt;   \---------------------------X``--- 9.1.x<br class="gmail_msg">
&gt;<br class="gmail_msg">
&gt; Each commit needs to be reviewed in master branch and backported to<br class="gmail_msg">
&gt; the maintenance branches. From maintenance perspective this is a bit<br class="gmail_msg">
&gt; painful, since in above example we need to get 3 times through PR<br class="gmail_msg">
&gt; queue. Also it&#39;s worth to mention that X is not X` nor X``.<br class="gmail_msg">
&gt; Cherry-picking creates a copy of a commit. This makes some useful<br class="gmail_msg">
&gt; tricks (like git tag --contains &lt;sha1&gt;) a bit harder to use. Finally,<br class="gmail_msg">
&gt; this approach allows the codebase to diverge from maintenance branches<br class="gmail_msg">
&gt; very fast (someone might just forget to backport some of the<br class="gmail_msg">
&gt; refactoring stuff).<br class="gmail_msg">
&gt;<br class="gmail_msg">
&gt; The proposal:<br class="gmail_msg">
&gt;<br class="gmail_msg">
&gt; X, Y - new commits<br class="gmail_msg">
&gt; / - merge commits<br class="gmail_msg">
&gt; --+---------+------/----/--- master<br class="gmail_msg">
&gt;   |          \----/---Y/---- 9.2.x<br class="gmail_msg">
&gt;   \-------------X/---------- 9.1.x<br class="gmail_msg">
&gt;<br class="gmail_msg">
&gt; With the proposal, a developer should always implement a given feature<br class="gmail_msg">
&gt; in the lowest possible maintenance branch. Then we will run a set of<br class="gmail_msg">
&gt; merges from 9.1.x into 9.2.x and finally into master. The biggest<br class="gmail_msg">
&gt; advantage of this approach is that given functionality (identified by<br class="gmail_msg">
&gt; a commit) will have the same SHA1 for all branches. This will allow<br class="gmail_msg">
&gt; all tools like (mentioned before) `git tag --contains &lt;sha1&gt;` to work.<br class="gmail_msg">
&gt; There are also some further implications of this approach:<br class="gmail_msg">
&gt;<br class="gmail_msg">
&gt;   * Merging commits should be performed very often (even automatically<br class="gmail_msg">
&gt;     in the night (if merged without any problems)).<br class="gmail_msg">
&gt;   * After releasing each maintenance release, someone will need to do<br class="gmail_msg">
&gt;     a merge with strategy `ours` (`git merge -s ours upstream/9.2.x`).<br class="gmail_msg">
&gt;     This way we will not have to solve version conflicts in poms.<br class="gmail_msg">
&gt;   * Since there is no nice way to rebase a merge commit, they should<br class="gmail_msg">
&gt;     be pushed directly into the master branch (without review, without<br class="gmail_msg">
&gt;     CI). After the merge, HEAD will change and CI will<br class="gmail_msg">
&gt;     automatically pick the build. Remember, merges should be done very<br class="gmail_msg">
&gt;     often. So I assume there won&#39;t be any problems most of the times.<br class="gmail_msg">
&gt;   * Finally, with this approach the code diverges slight slower (at<br class="gmail_msg">
&gt;     least from my experience). Mainly because we don&#39;t need to<br class="gmail_msg">
&gt;     remember to cherry-pick individual commits. They are automatically<br class="gmail_msg">
&gt;     &quot;taken&quot; by a merge.<br class="gmail_msg">
&gt;<br class="gmail_msg">
&gt; From my past experience, this strategy works pretty nice and can be<br class="gmail_msg">
&gt; almost fully automated. It significantly lowers the maintenance pain<br class="gmail_msg">
&gt; around cherry-picks. However there is nothing for free, and we would<br class="gmail_msg">
&gt; need to get used to pushing merged directly into master (which is fine<br class="gmail_msg">
&gt; to me but some of you might not like it).<br class="gmail_msg">
&gt;<br class="gmail_msg">
&gt; Thanks,<br class="gmail_msg">
&gt; Sebastian<br class="gmail_msg">
&gt;<br class="gmail_msg">
&gt;<br class="gmail_msg">
&gt; _______________________________________________<br class="gmail_msg">
&gt; infinispan-dev mailing list<br class="gmail_msg">
&gt; <a href="mailto:infinispan-dev@lists.jboss.org" class="gmail_msg" target="_blank">infinispan-dev@lists.jboss.org</a><br class="gmail_msg">
&gt; <a href="https://lists.jboss.org/mailman/listinfo/infinispan-dev" rel="noreferrer" class="gmail_msg" target="_blank">https://lists.jboss.org/mailman/listinfo/infinispan-dev</a><br class="gmail_msg">
<br class="gmail_msg">
<br class="gmail_msg">
--<br class="gmail_msg">
Radim Vansa &lt;<a href="mailto:rvansa@redhat.com" class="gmail_msg" target="_blank">rvansa@redhat.com</a>&gt;<br class="gmail_msg">
JBoss Performance Team<br class="gmail_msg">
<br class="gmail_msg">
_______________________________________________<br class="gmail_msg">
infinispan-dev mailing list<br class="gmail_msg">
<a href="mailto:infinispan-dev@lists.jboss.org" class="gmail_msg" target="_blank">infinispan-dev@lists.jboss.org</a><br class="gmail_msg">
<a href="https://lists.jboss.org/mailman/listinfo/infinispan-dev" rel="noreferrer" class="gmail_msg" target="_blank">https://lists.jboss.org/mailman/listinfo/infinispan-dev</a><br class="gmail_msg">
</blockquote></div>