Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

My company is using Git, and is using a peculiar branching scheme - work is done in master, and branches are reserved for releases. This works fine, so long as all of the work done in an iteration makes it into the branch, but if a critical production issue comes up, we have to ensure that the work somehow makes it into both branches.

Lately, we've been having some "fun" with those branches. It's been an administrative headache, ensuring that all of the work makes it into every branch, and some bugs which have been fixed on one branch don't make it into master until someone points it out, which is concerning.

I came across Git Flow a while back, and I feel that it would be a solution to our problem - code not percolating all the way to the release, or all the way back down. The only catch is that my lead stated that this sort of development was an anti-pattern - developing furiously for two weeks, then spending three to resolve the merge conflicts.

I'm not entirely sure I agree, and since I brought it up, work has resumed like normal. Only recently have we had some major pain points with this.

I'd like to know - why would this sort of development scheme be seen as an anti-pattern? Is it really an anti-pattern?

share|improve this question
1  
The "Rule 3" section from Ted Dziuba's old blogpost might help illustrate how it can be an anti-pattern. –  Isxek Feb 19 '13 at 5:08
2  
IMO, the more actual time you're spending thinking about version control, the more that's gone wrong with the whole user -> tool phenomenon in the first place. –  Erik Reppen Feb 19 '13 at 6:06
    
@ErikReppen: I'd like to take everyone's minds away from version control and have a process that everyone can get used to. This way, we don't have to worry about things like if this is an anti-pattern or not. –  Makoto Feb 19 '13 at 6:09
3  
@Makoto Anything that violates KISS is an anti-pattern, IMO. This is where VCS power users tend to make me crazy. –  Erik Reppen Feb 19 '13 at 15:50
1  
The term "antipattern" is kind of like "best practice", in that it often serves as an excuse for people to turn their brains off. Don't accept this notion if the lead can't tell you clearly what experience he has with it and why it's bad. –  Kyralessa Feb 19 '13 at 21:02
add comment

2 Answers

up vote 16 down vote accepted

He's mostly referring to the feature branches side of the model. Feature branches were declared an anti-pattern a long time ago when the branches lasted for months and version control systems couldn't merge to save their life. Feature branches that last a week or two have much fewer issues, especially if you're continually merging from develop into the feature branch during that time. Anything much longer than that is still not recommended.

Even if you don't use the feature branch side of git flow, the other parts are useful in ensuring you get clean merges and your changes are propagated in the right direction.

share|improve this answer
1  
My experience with feature branches, or the way we've done them, is that there can be heartache with them if they're allowed to live for more than an iteration. A rule that states that all features must be merged into the iteration before release would be nice, to alleviate the heartache of merges - and boy, have we had some serious heartache behind those... –  Makoto Feb 19 '13 at 6:05
3  
My experience is that you can have local stuff lying around for long as long as you keep it merged with recent master and or develop as appropriate. –  Jan Hudec Feb 19 '13 at 10:25
    
@JaHudec ... or until you have two things lying around which are conflicting in some way. You should always have the overview about that being done... –  johannes Feb 19 '13 at 23:01
1  
Doing a bit of reading up on it, and Martin Fowler's reference seems to indicate that feature branches done in a continuous integration flow can work out - if they're done in smaller bites than what most people would consider doing them for. So, in a sense, you're right - less than two weeks as a time-to-live on a feature branch seems suitable. I don't see, however, how feature branches themselves are the anti-pattern. –  Makoto Feb 20 '13 at 1:36
1  
You're right. They are only an anti-pattern when they live too long without being merged. Sometimes people still rail against an idea when they don't remember the underlying reasons. –  Karl Bielefeldt Feb 20 '13 at 2:35
add comment

Merging is a funny thing - the less frequently it's done the harder it will be, the harder it is, the more people will be afraid of it, the less frequently they will do it.

Solution is either do not allow branches to deviate too much, or not to use branches.

If people understand this, you will probably have not much problems with merge, if not - may be branches are not a good idea without some education.

share|improve this answer
    
Nah, not using branches is a non-starter. The other primary issue would be that work can be done in two different places in the same code, so hopefully we can do something to alleviate that, too. –  Makoto Feb 19 '13 at 6:06
8  
@makoto, quite often decoupling things in code makes conflicts less frequent. It can be either plain separation of a functionality into functions/classes or more high-level avoiding of undocumented assumptions between modules. Then changes become more localized. –  maxim1000 Feb 19 '13 at 8:21
2  
+1 for that first paragraph –  Ryan Kinal Mar 5 '13 at 20:40
    
@maxim1000 I agree. I think someone once said something like "A VCS is a poor man's alternative to modular [decoupled] architecture" –  8DH Oct 22 '13 at 8:02
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.