开发者

Multiple repositories or single repository with branches?

I have been working on a project for some time, and it has branched off into several different versions. All versions have some common code base, and each version has specific functionality that is unique, and each version will need to be supported individually.

What SVN structure would you recommend? Right now I am using a separate repository for each project, but the downside of that is that it is impractical for large number of products. The downside of using a single repository with branches is that it would add revision numbers to every branch whether anythi开发者_开发百科ng was committed, regardless from which branch.

What setup do you/would you use in this situation?


Most definitely the same repository. Since there is common functionality, you will commonly move code from one project to the other. Moving files within a repository retains their history, moving them across repositories doesn't.

I don't see why having revisions on a branch skip numbers would be problem.

For reference: At work, all projects from the entire software engineering department (60 coders) are in the same svn repository.


One repository. Branch and tag along the way. It really is not problematic once you get used to it.

Have some good release management practices and will help this (e.g. track which version/branch has which feature, etc.)


The one first thing you should do first is to make sure that your component structure (the way you have structured your program into loosely coupled libraries) mirrors your requirements.

Things go a lot easier when you have the common code in one or more separate libraries, and the other code too (but clearly separated from the common code). Then, you can handle your common code like a separate product, and your different "versions" (as you call them) as separate programs, each one using a specific revision of the common library.

Said this, both approaches (separate repositories or one big single repository) might work. If your different "versions" have to be really separate, because they are for different customers with different support agreements, IMHO separate repositories will work better (one for each product and one for you common library), because you can more easily avoid unwanted side effects between the different versions. On the other hand, if the situation is different, having all things in one repository can save you a lot of administrative work, for example, when you often have to move code from the common libary to one of the other components, or vice versa.

For example, in our company, we have one repository for a software product sold to other companies, and one for our in-house software, Obviously, we have very different support needs between those two types of software. When we got to the point where we needed to reuse a library from our product in the in-house code, we wrote some simple scripts to check out a specific revision of the library and copy it to the build environment of the in-house code. We try to avoid too much influence from the in-house software development to the product development, but when there is a requirement from in-house that belongs clearly to the common library, we add it there, test it in combination with our product, and when it works, we update our script to get the new revision.


If they are all different strains of the same code base, then I would put them in branches (in a single repository)

I generally only use a new repository for different programs.


I use GIT because it handles branching and merging a lot better :) But for SVN it would depend on how many projects and how they are related. If the code is all part of the same program, i'd do different branches.

If they are isolated projects then you'd want to use different repositories.


One way would be to set up a repository for the common, core functionality and a repository for each project that depends on the core where the customizations would be made. You can have your child projects pull the core files in using an svn:externals definition.

This assumes that the core features are modular enough to support this isolation.


Personally, I would suggest using a DVCS (not to deter you from using subversion) and have a separate repository for each project.

If there is common history, then these repositories can be related. If you've never used a DVCS before, I'd suggest Mercurial because it is quite easy to learn and works equally well on Windows and Linux.


In addition to all those that recommend branches rather than multiple repositories, having increasing revision numbers for unaffected branches is not really a downside.


I'd go with a single repository with a number of branches. I don't think you should have to worry about the revision numbers - give your branches good names & use tags to reference different deployments externally. (e.g. - make a tag for build 3 of branch A) That way, you only need to worry about revision numbers when dealing with SVN interally.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜