Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Source Control – Is a separate branch required for every product?

Let’s say you have four products each with their own release schedule. Each product has 50% shared code (common functionality across all products) and 50% product specific code.

Do you need a separate source control branch for each product? Should common functionalities always be developed in one of the four product branches and merged to the other products later?

Typical Scenario: Product A is being released next month and requires core (shared) enhancement 1, product B is being released in four months and requires core (shared) enhancement 2 (which will take three months to complete).

like image 246
monibius Avatar asked Jul 10 '09 14:07

monibius


2 Answers

I keep shared code in it's own product folder. Then use svn:externals to share the code amongst the other products. It's slightly painful to handle branching and merging, but it's better than having four copies of the shared code in the repository. Something like this (replace trunk with /branches/RB-1.0.0 or /tags/REL-1.0.0 for release branches and tagged releases):

/core/trunk
/product_a/trunk
  /core (svn:externals 'core /core/trunk')
/product_b/trunk
  /core (svn:externals 'core /core/trunk')
/product_c/trunk
  /core (svn:externals 'core /core/trunk')
/product_d/trunk
  /core (svn:externals 'core /core/trunk')

UPDATE0: Note that /product_a/tags/REL-1.0.0 might use /core/tags/REL-1.0.0 while /product_b/tags/REL-1.0.0 might use /core/tags/REL-1.1.0

like image 99
Terry G Lorber Avatar answered Oct 21 '22 03:10

Terry G Lorber


Common functionality can be developed in a separate Platform branch, with each product getting its own branch for the product-specific development.

like image 39
Craig Martek Avatar answered Oct 21 '22 01:10

Craig Martek