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