Repository strategy for multiple interconnected components with small differences

At my work we have multiple products.. productA, productB, … these products reference multiple components. componentA, componentB.. there are also shared components sharedA, sharedB… etc.. which are either shared by multiple components, multiple products or by a product and a component.

We are currently moving all these things to separate Git repositories however, we have a hard time find a way to set up repositories in such a way that everything stays manageable.

We have two problems that make setting up repositories hard.

  1. There are a lot of hard dependencies. When I want to work on ProductA I need to have the source code for ProductA, componentA, componentB, and sharedComponentC on my computer, since I might be changing code in all of them. For ProductB I need componentA, sharedComponentC and… this makes it hard to choose what to store in what repository.

  2. Say componentA is an interface library, this interface library is used by ProductA and ProductB. For ProductA it needs to work normally but in ProductB it needs to show an extra button. We have a lot of these very small differences in components should we make a branch per product and sometimes integrate the branches to make sure they have the same new features? Maybe develop on a ‘general’ branch and push changes to each ‘small difference’ branch? Is it bad to have a lot of active branches in a project?

Are there any rules of thumb that help to decide how to split software over multiple repositories? What are good ways to work on software that is in multiple repositories, or tooling that helps in this regard? What is proper repository set-up for components with a lot of small differences? In the end these are all the same question. What is a good repository strategy for multiple interconnected components with small differences?

Some more information that might help. We develop solely on Windows, 99% of the code we write is C#, the other 1% is C++/CLI. All our developers have access to Visual Studio 2013 Pro. We are willing to buy software to help us with this problem but we are a small company so we do not have infinite budget :).

Of course a part of the problems we are having are due to (bad) design decisions in the past. (No design decision can completely safeguard against the future development of your software/company 😉 ) We are working on changing that. But for the time being we would like to decide on a modern repository strategy that makes things a bit more manageable.

4

With git you can use git submodule.

ProductA can have specific commit_ids (which can be a branch) of some submodules (for example ComponentA, ComponentB, SharedComponentC).

To add a component to ProductA, from the ProductA directory on your development machine do:

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
<code>C:projectsProductA.git> git submodule add --branch master --name ComponentA http://reposerver.ourcompany.com/ComponentA components/ComponentA
C:projectsProductA.git> git submodule add --branch master --name ComponentB http://reposerver.ourcompany.com/ComponentB components/ComponentB
C:projectsProductA.git> git submodule add --branch ProjectA --name sharedComponentC http://reposerver.ourcompany.com/ComponentC components/sharedComponentC
</code>
<code>C:projectsProductA.git> git submodule add --branch master --name ComponentA http://reposerver.ourcompany.com/ComponentA components/ComponentA C:projectsProductA.git> git submodule add --branch master --name ComponentB http://reposerver.ourcompany.com/ComponentB components/ComponentB C:projectsProductA.git> git submodule add --branch ProjectA --name sharedComponentC http://reposerver.ourcompany.com/ComponentC components/sharedComponentC </code>
C:projectsProductA.git> git submodule add --branch master --name ComponentA http://reposerver.ourcompany.com/ComponentA components/ComponentA
C:projectsProductA.git> git submodule add --branch master --name ComponentB http://reposerver.ourcompany.com/ComponentB components/ComponentB
C:projectsProductA.git> git submodule add --branch ProjectA --name sharedComponentC http://reposerver.ourcompany.com/ComponentC components/sharedComponentC

Other developers can use:

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
<code>C:projectsProductA.git> git submodule init
C:projectsProductA.git> git submodule update
</code>
<code>C:projectsProductA.git> git submodule init C:projectsProductA.git> git submodule update </code>
C:projectsProductA.git> git submodule init
C:projectsProductA.git> git submodule update

to receive the correct versions of the submodules in their working directory.

When you make some changes to a submodule, you commit the changes of the submodule and you commit the new version of the submodule in the project, i.e.:

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
<code>C:projectsProductA.gitcomponentssharedComponentC> git add ...
C:projectsProductA.gitcomponentssharedComponentC> git commit
C:projectsProductA.gitcomponentssharedComponentC> cd ....
C:projectsProductA.git> git add components/sharedComponent
C:projectsProductA.git> git commit
</code>
<code>C:projectsProductA.gitcomponentssharedComponentC> git add ... C:projectsProductA.gitcomponentssharedComponentC> git commit C:projectsProductA.gitcomponentssharedComponentC> cd .... C:projectsProductA.git> git add components/sharedComponent C:projectsProductA.git> git commit </code>
C:projectsProductA.gitcomponentssharedComponentC> git add ...
C:projectsProductA.gitcomponentssharedComponentC> git commit
C:projectsProductA.gitcomponentssharedComponentC> cd ....
C:projectsProductA.git> git add components/sharedComponent
C:projectsProductA.git> git commit

Remarks

  • I used command-line syntax to explain how to use git; you are free to use any graphical tool or visual studio plugin that you like.
  • I checked the syntax and parameters under Linux and translated the examples to Windows command prompt, so there might some mistakes (e.g. slashes instead of dashes); refer to the git reference manual for the exact syntax.
  • The project directory (C:projectsProductA.git), branch name (ComponentA), repository location (http://reposerver.ourcompany.com/ComponentA), and submodule directory (components/ComponentA) can vary independently.

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa

Repository strategy for multiple interconnected components with small differences

At my work we have multiple products.. productA, productB, … these products reference multiple components. componentA, componentB.. there are also shared components sharedA, sharedB… etc.. which are either shared by multiple components, multiple products or by a product and a component.

We are currently moving all these things to separate Git repositories however, we have a hard time find a way to set up repositories in such a way that everything stays manageable.

We have two problems that make setting up repositories hard.

  1. There are a lot of hard dependencies. When I want to work on ProductA I need to have the source code for ProductA, componentA, componentB, and sharedComponentC on my computer, since I might be changing code in all of them. For ProductB I need componentA, sharedComponentC and… this makes it hard to choose what to store in what repository.

  2. Say componentA is an interface library, this interface library is used by ProductA and ProductB. For ProductA it needs to work normally but in ProductB it needs to show an extra button. We have a lot of these very small differences in components should we make a branch per product and sometimes integrate the branches to make sure they have the same new features? Maybe develop on a ‘general’ branch and push changes to each ‘small difference’ branch? Is it bad to have a lot of active branches in a project?

Are there any rules of thumb that help to decide how to split software over multiple repositories? What are good ways to work on software that is in multiple repositories, or tooling that helps in this regard? What is proper repository set-up for components with a lot of small differences? In the end these are all the same question. What is a good repository strategy for multiple interconnected components with small differences?

Some more information that might help. We develop solely on Windows, 99% of the code we write is C#, the other 1% is C++/CLI. All our developers have access to Visual Studio 2013 Pro. We are willing to buy software to help us with this problem but we are a small company so we do not have infinite budget :).

Of course a part of the problems we are having are due to (bad) design decisions in the past. (No design decision can completely safeguard against the future development of your software/company 😉 ) We are working on changing that. But for the time being we would like to decide on a modern repository strategy that makes things a bit more manageable.

4

With git you can use git submodule.

ProductA can have specific commit_ids (which can be a branch) of some submodules (for example ComponentA, ComponentB, SharedComponentC).

To add a component to ProductA, from the ProductA directory on your development machine do:

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
<code>C:projectsProductA.git> git submodule add --branch master --name ComponentA http://reposerver.ourcompany.com/ComponentA components/ComponentA
C:projectsProductA.git> git submodule add --branch master --name ComponentB http://reposerver.ourcompany.com/ComponentB components/ComponentB
C:projectsProductA.git> git submodule add --branch ProjectA --name sharedComponentC http://reposerver.ourcompany.com/ComponentC components/sharedComponentC
</code>
<code>C:projectsProductA.git> git submodule add --branch master --name ComponentA http://reposerver.ourcompany.com/ComponentA components/ComponentA C:projectsProductA.git> git submodule add --branch master --name ComponentB http://reposerver.ourcompany.com/ComponentB components/ComponentB C:projectsProductA.git> git submodule add --branch ProjectA --name sharedComponentC http://reposerver.ourcompany.com/ComponentC components/sharedComponentC </code>
C:projectsProductA.git> git submodule add --branch master --name ComponentA http://reposerver.ourcompany.com/ComponentA components/ComponentA
C:projectsProductA.git> git submodule add --branch master --name ComponentB http://reposerver.ourcompany.com/ComponentB components/ComponentB
C:projectsProductA.git> git submodule add --branch ProjectA --name sharedComponentC http://reposerver.ourcompany.com/ComponentC components/sharedComponentC

Other developers can use:

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
<code>C:projectsProductA.git> git submodule init
C:projectsProductA.git> git submodule update
</code>
<code>C:projectsProductA.git> git submodule init C:projectsProductA.git> git submodule update </code>
C:projectsProductA.git> git submodule init
C:projectsProductA.git> git submodule update

to receive the correct versions of the submodules in their working directory.

When you make some changes to a submodule, you commit the changes of the submodule and you commit the new version of the submodule in the project, i.e.:

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
<code>C:projectsProductA.gitcomponentssharedComponentC> git add ...
C:projectsProductA.gitcomponentssharedComponentC> git commit
C:projectsProductA.gitcomponentssharedComponentC> cd ....
C:projectsProductA.git> git add components/sharedComponent
C:projectsProductA.git> git commit
</code>
<code>C:projectsProductA.gitcomponentssharedComponentC> git add ... C:projectsProductA.gitcomponentssharedComponentC> git commit C:projectsProductA.gitcomponentssharedComponentC> cd .... C:projectsProductA.git> git add components/sharedComponent C:projectsProductA.git> git commit </code>
C:projectsProductA.gitcomponentssharedComponentC> git add ...
C:projectsProductA.gitcomponentssharedComponentC> git commit
C:projectsProductA.gitcomponentssharedComponentC> cd ....
C:projectsProductA.git> git add components/sharedComponent
C:projectsProductA.git> git commit

Remarks

  • I used command-line syntax to explain how to use git; you are free to use any graphical tool or visual studio plugin that you like.
  • I checked the syntax and parameters under Linux and translated the examples to Windows command prompt, so there might some mistakes (e.g. slashes instead of dashes); refer to the git reference manual for the exact syntax.
  • The project directory (C:projectsProductA.git), branch name (ComponentA), repository location (http://reposerver.ourcompany.com/ComponentA), and submodule directory (components/ComponentA) can vary independently.

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật