What Gives? Single Codebase (Agile & Branching)

28 בדצמבר 2008

תגיות: , ,
4 תגובות

Here is a quote from a book I am reading now:

"To eliminate the need for a branch entirely, automatically migrate your customers and users to the latest version every time you release."

But wait, was is a branch?

Branch

Simply put, to branch your code is to split the repository into two separate lines of
development. You can branch by release, feature, product and so forth.

Back to the first sentence…

This book I am reading is "The Art Of Agile Development", which talk about, well, Agile and uses XP as an example. One of the sections talk about Version Control. According to the book, there are several rules when practicing Agile in regard to version control, and one of them is Single Codebase. A Single Codebase rule, say that you should have only one copy of your code base.

In other words, Branching is not recommended and we can eliminate it…

So, Is it true? Can we eliminate the need for branch entirely?

My Opinion

I have to say that I am having a hard time excepting this sentence:

"To eliminate the need for a branch entirely, automatically migrate your customers and users to the latest version every time you release."

I believe that the elimination depends on the business. Let me explain by an example. Let say that you sale a service for upgrading your product. A customer can choose whether to buy this service. If a customer does not buy it, you will have to maintain a working version that has its own development lifeline which bug fixes are also apply to it. Yes, I know we have an overhead with the merging the fixes, this still, in my opinion, is the best option you have. Having said that, Agile (XP), has another rule that say "No Bugs". "No Bugs" say that there should not be any bugs in your release…Yep, right!!! We can always strive to achieve "No Bugs", but lets face it, there will always be some bugs…

Summary

To sum things up, I would say that branching is something that derives from the business. Having said that, if the business allows it, Agile (XP) can help eliminating the need for branching.

kick it on DotNetKicks.com

הוסף תגובה
facebook linkedin twitter email

כתיבת תגובה

האימייל לא יוצג באתר. (*) שדות חובה מסומנים

4 תגובות

  1. Brandon28 בדצמבר 2008 ב 22:14

    I agree that there may be certain situations where branching makes sense. I would lean towards James and Shane's side of the fence however. They made an oblique statement, I'm certain that if you had the discussion with them they wouldn't be as hard lined about it. Would there be an alternative in your example? For example, should the system have been architected in such a way that the model you're proposing could have been done without just leaving a branch hanging out there to continually have to merge defects into? Branching is definitely a solution, but is it the best solution?

    Nothing is black and white, I definitely see your point.

    Thanks!
    Brandon

    להגיב
  2. James Shore29 בדצמבר 2008 ב 10:58

    Hi Guy,

    Your quote is a bit out of context. The overall point is to avoid duplicating your codebase when you need to customize your software. (We provide other techniques to use instead.)

    I think you misunderstood that section. The sentence you're quoting is just a tip. The section is titled "Appropriate Uses of Branches," and the point is to describe when branching works well. We specifically say, "If you support old versions of your software, a branch for each version is the best place to put bug fixes and minor enhancements for those versions."

    So we're in agreement. :-)

    Cheers,
    Jim

    להגיב
  3. kolbis29 בדצמבר 2008 ב 13:00

    Hi James, Thanks for the response. My point is that the section is incomplete. I think that branching is not subject only to software development process rather also to business requirements. I could not agree more about:

    "If you support old versions of your software, a branch for each version is the best place to put bug fixes and minor enhancements for those versions."

    I believe we are in agreement p-)

    להגיב
  4. James Shore30 בדצמבר 2008 ב 0:08

    Hi Guy,

    Yep, it's incomplete. Actually, just about everything in the book is incomplete in some way. For the reason, see my "Truth or Clarity?" essay at http://jamesshore.com/Blog/Truth-or-Clarity.html .

    In this case, you came to the same conclusion that I recommend (whether to maintain & support old versions is a business decision), so I don't think our incompleteness was too harmful this time. :-)

    להגיב