stephen-smith wrote on Wednesday, December 08, 2010:
bradymiller
Was hoping to get some git-guru input here. The above rules_develop branch will likely not be part of the official sourceforge master branch for 1-2 months. What is th best way to keep it uptodate with the sourceforge master branch? My plan was to merge the sourceforge master branch every week or so (which will create a merge stub along with some required conflict resolution).
Feature branches shouldn’t have mainline development merged into them. Here’s what Linus says about that type of workflow: “But if I see a lot of ‘Merge branch linus’ in your logs, I’m not going to pull from you, because your tree has obviously had random crap in it that shouldn’t be there…”
bradymiller
I just want to make sure there are no problems when I then want to merge this development branch into sourceforge master in a couple months
The longer you have two branches the larger the list of conflicts will be. There’s a number of ways of reducing the scope of changes that you have to deal with all at the same time. I believe the kernel has gotten into the habit of using {git merge mainline; (if conflicts, fix and commit); git reset -hard HEAD^;} to load up the “rerere” cache so that rerere handles most of the final, recorded, large merge. I use a process and script I made up to weave together an “integration branch” that consists of nothing but merge commits; in roughly a 1:1 ratio with conflicts.
Both these techniques keep both mainline and the feature branch “clean” during development. The kernel method tracks conflict resolution is a rather hidden and non-shared way, and puts all the “dirt” into one merge commit for when the branches come back together. After that, the commit history looks quite simple. If any problems get introduced by the merge, they all get tracked to that single big, “dirty” commit.
My method tracks conflict resolution in a public and shared way and has a separate commit for each piece of “dirt”. Unfortunately, at the end the history looks very complex and has a lot of merge commits. If any problems get introduced, they can often be tracked down to a very small, “dirty” commit.
Regular merges from master is fine for us. Having the feature branch be “clean” isn’t that important, no one is too familiar with rerere, and most of the team is still trying to get comfortable with what a merge commit is.
bradymiller
(ie. will the numerous merge commits from sourceforge master with conflicts fixes screw things up?)?
Some people/ don’t like merge commits. Git is very good at handling them. Multiple merges from master won’t “screw up” Git. It also shouldn’t affect our existing workflows adversely. The only thing I can think that it makes more difficult is separating just-this-feature from general-4.0-development, but I’m not sure that’s a goal for us now. The recommended workflows on the wiki make that hard-to-impossible already.