<br><br>----- Original Message -----<br>From: David van der Spoel &lt;spoel@xray.bmc.uu.se&gt;<br>Date: Thursday, August 26, 2010 16:59<br>Subject: Re: [gmx-developers] Git master broken<br>To: Discussion list for GROMACS development &lt;gmx-developers@gromacs.org&gt;<br><br>&gt; On 2010-08-26 06.21, Mark Abraham wrote:<br>&gt; &gt;----- Original Message -----<br>&gt; &gt;From: Christoph Junghans &lt;junghans@mpip-mainz.mpg.de&gt;<br>&gt; &gt;Date: Thursday, August 26, 2010 1:57<br>&gt; &gt;Subject: Re: [gmx-developers] Git master broken<br>&gt; &gt;To: Discussion list for GROMACS development &lt;gmx-<br>&gt; developers@gromacs.org&gt;&gt;<br>&gt; &gt; &gt; Hi,<br>&gt; &gt; &gt;<br>&gt; &gt; &gt; the merge was not 100% trivial, there were two simple conflicts<br>&gt; &gt; &gt; due to a define renaming in include/vec.h and a argument <br>&gt; change in<br>&gt; &gt; &gt; split of include/string2.h, which only happened in the <br>&gt; master branch.<br>&gt; &gt; &gt; That is why I committed it with the standard commit message.<br>&gt; &gt;<br>&gt; &gt;"git log -p 5e3473a" has a merge commit message, but has new <br>&gt; content as<br>&gt; &gt;well. This fools some parts of git-log into not showing that new<br>&gt; &gt;content. The graphical depiction in gitk on master branch makes this<br>&gt; &gt;clear too... that commit forms a single thread of development <br>&gt; until DvdS<br>&gt; &gt;tried to merge it.<br>&gt; &gt;<br>&gt; &gt;Anyone who's done development work on either master or<br>&gt; &gt;release-4-5-patches might have this kind of problem at some <br>&gt; point. Only<br>&gt; &gt;if your development footprint interacts with current progress <br>&gt; on will<br>&gt; &gt;you have an issue, and there's no getting around having to <br>&gt; resolve merge<br>&gt; &gt;conflicts regardless of the branch you're on. Things are less <br>&gt; hairy if<br>&gt; &gt;people know which branch is supposed to get updated (currently,<br>&gt; &gt;release-4-5-patches). Having started work from master (say) and<br>&gt; &gt;committed your present work to your private copy of the master <br>&gt; branch,&gt;coping strategies for merging your material into release-<br>&gt; 4-5-patches<br>&gt; &gt;include:<br>&gt; &gt;<br>&gt; &gt;* Use "git rebase release-4-5-patches" to switch the base of that<br>&gt; &gt;private branch from master to release-4-5-patches. You will <br>&gt; still have<br>&gt; &gt;to resolve merge conflicts, but the result will be immediately <br>&gt; ready to<br>&gt; &gt;push into origin/release-4-5-patches. [IMO the most elegant strategy,<br>&gt; &gt;because there's only a single merge, and pulling future updates <br>&gt; will be<br>&gt; &gt;easy]<br>&gt; <br>&gt; Thanks for clarifications Mark.<br>&gt; <br>&gt; Just to make this exquisitely clear (maybe I misunderstood you): <br>&gt; we should NOT merge the master branch into the release-4-5-<br>&gt; patches branch, because there is some new stuff there already.<br><br>You understood me right, but I made a poor starting assumption. If there's stuff in master that does not belong in 4.5, then my second and third strategies are invalid.<br><br>git rebase is an extremely good tool for all many of interesting things (editing local commit history, squashing and expanding commits)<br><br>Mark<br>&nbsp;<br>&gt; About updating the master branch with release-4-5-patches: In <br>&gt; general it seems good if the branches don't diverge more than <br>&gt; necessary due to new code, hence the presumably bug-fix-only <br>&gt; changes in 4.5 should be propagated to master. Rossen has <br>&gt; described this quite clear on the website, including an example <br>&gt; of what to do when you do not want to merge everything.<br><br>Yes.<br><br>Mark<br>&nbsp;<br>&gt; &gt;<br>&gt; &gt;* "git pull master" (resolve conflicts), then "git pull<br>&gt; &gt;release-4-5-patches" (resolve conflicts), then merge into<br>&gt; &gt;release-4-5-patches trivially. [IMO this is more work and <br>&gt; creates a more<br>&gt; &gt;cluttered development history, but depending on the nature of the<br>&gt; &gt;conflicts, the two merging stages might be conceptually simpler <br>&gt; than the<br>&gt; &gt;one-stage merge above.]<br>&gt; &gt;<br>&gt; &gt;* Merge release-4-5-patches into master, then "git pull master" <br>&gt; (resolve&gt;conflicts), then merge into release-4-5-patches. [IMO <br>&gt; ugly, but I can't<br>&gt; &gt;think of a technical flaw]<br>&gt; &gt;<br>&gt; &gt; &gt; I just did the merge, because the master branch missed a header<br>&gt; &gt; &gt; of some kernel, which was fixed in 4.5 branch. After the <br>&gt; merge I<br>&gt; &gt; &gt; did a build check and it worked, so this was not a build break.<br>&gt; &gt; &gt;<br>&gt; &gt; &gt;<br>&gt; &gt; &gt; Concerning the current merge policy:<br>&gt; &gt; &gt; I think the problem by now is that the main work happens on the<br>&gt; &gt; &gt; 4.5 branch and this has to be merged into the master branch<br>&gt; &gt; &gt; immediately. Otherwise the first one, who wants to merge<br>&gt; &gt; &gt; something in the master branch, in the above case me, has to<br>&gt; &gt; &gt; decide about all the 4.5 changes of all the other <br>&gt; developers. At<br>&gt; &gt; &gt; the current point of development this is not a big deal, because<br>&gt; &gt; &gt; master and 4.5 are not very different.<br>&gt; &gt;<br>&gt; &gt;Work on release-4-5-patches doesn't have to be merged into master<br>&gt; &gt;immediately, absent some artificial policy. In fact, if nobody's<br>&gt; &gt;committing to master then there's no reason to merge to master <br>&gt; at all,<br>&gt; &gt;and there's no reason to have branched. However, branching is <br>&gt; easy and<br>&gt; &gt;lightweight and should be encouraged.<br>&gt; &gt;<br>&gt; &gt;It must be noted that the merge conflict problem occurs <br>&gt; independently of<br>&gt; &gt;whether branching occurred. Here, Christoph wanted to do:<br>&gt; &gt;<br>&gt; &gt;diff --git a/include/resall.h b/include/resall.h<br>&gt; &gt;index f4e547e..4349551 100644<br>&gt; &gt;--- a/include/resall.h<br>&gt; &gt;+++ b/include/resall.h<br>&gt; &gt;@@ -45,18 +45,18 @@<br>&gt; &gt;extern "C" {<br>&gt; &gt;#endif<br>&gt; &gt;<br>&gt; &gt;-extern t_restp *search_rtp(const char *key,int nrtp,t_restp rtp[]);<br>&gt; &gt;+t_restp *search_rtp(const char *key,int nrtp,t_restp rtp[]);<br>&gt; &gt;/* Search for an entry in the rtp database */<br>&gt; &gt;<br>&gt; &gt;and Berk wanted to do<br>&gt; &gt;<br>&gt; &gt;diff --git a/include/resall.h b/include/resall.h<br>&gt; &gt;index 4349551..e23f808 100644<br>&gt; &gt;--- a/include/resall.h<br>&gt; &gt;+++ b/include/resall.h<br>&gt; &gt;@@ -45,8 +45,16 @@<br>&gt; &gt;extern "C" {<br>&gt; &gt;#endif<br>&gt; &gt;<br>&gt; &gt;-t_restp *search_rtp(const char *key,int nrtp,t_restp rtp[]);<br>&gt; &gt;-/* Search for an entry in the rtp database */<br>&gt; &gt;+char *search_rtp(const char *key,int nrtp,t_restp rtp[]);<br>&gt; &gt;<br>&gt; &gt;Now that's trivial to merge with a word-based diff (change 'extern<br>&gt; &gt;t_restp *' to 'char *' by the two stages of "remove 'extern'" and<br>&gt; &gt;"change 't_restp' to 'char'"), but the default diff is line-<br>&gt; based. Even<br>&gt; &gt;if there had never been a release-4-5-patches branch, whoever <br>&gt; got their<br>&gt; &gt;commit in first was home free, and the other would have to have <br>&gt; resolved&gt;this merge.<br>&gt; &gt;<br>&gt; &gt; &gt; However, what still puzzles me is the origin of the <br>&gt; conflicts in<br>&gt; &gt; &gt; the case of David's merge. For human eyes most of them look<br>&gt; &gt; &gt; trivial, but git doesn't get it.<br>&gt; &gt;<br>&gt; &gt;I hope I helped there.<br>&gt; &gt;<br>&gt; &gt;Mark<br>&gt; &gt;<br>&gt; <br>&gt; <br>&gt; -- <br>&gt; David van der Spoel, Ph.D., Professor of Biology<br>&gt; Dept. of Cell &amp; Molec. Biol., Uppsala University.<br>&gt; Box 596, 75124 Uppsala, Sweden. Phone:        +46184714205.<br>&gt; spoel@xray.bmc.uu.se&nbsp;&nbsp;&nbsp; http://folding.bmc.uu.se<br>&gt; -- <br>&gt; gmx-developers mailing list<br>&gt; gmx-developers@gromacs.org<br>&gt; http://lists.gromacs.org/mailman/listinfo/gmx-developers<br>&gt; Please don't post (un)subscribe requests to the list. Use the <br>&gt; www interface or send it to gmx-developers-request@gromacs.org.