Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is a good idea to put all projects in the same trunk?

We understand the default and usually recommended svn repository organization, in case of having multiple projects, is something like this:

root/projectA/(trunk, branches, tags)
root/projectB/(trunk, branches, tags)
...

Our projects have a lot of interdependence, and that would demand an extense use of svn:externals between them, considering we don't do dll referencing to internal projects, we'd prefer to view their source code instead of working with binaries.

Using externals too much, when branching repositores, syncing changes, can become a complex and error-prone experience, so the team didn't trust this solution at all.

So a team member suggested something that we all think this could be a better solution: put all projects in the same trunk.

At first, we recognized some problems with this approach, but as a whole we agree these problems are based on hypotethical situations that very probably we'd never experience.

Do you see some serious problems we may have with this solution?

like image 575
Victor Rodrigues Avatar asked Apr 28 '09 19:04

Victor Rodrigues


2 Answers

We do this at our company and have had a lot of success.

We have 3 top level directories:

  • tags
  • branches
  • trunk

And then we have each project as a sub-directory of those.

We still branch at the project level though and still use svn:externals. But if we had a smaller source tree we would branch at the trunk level and not use svn:extenrals.

It's nice to be able to have all projects' trunk at the same place. You can back it up, you can check it all out and you have all the most recent stuff together. You don't lose the single location for all branches nor single location for all tags either because they are all in subdirectories of /branches/projectX and /tags/projectX

Problems with svn:externals:

If your projects are not extermely HUGE then you could just branch the whole trunk each time and avoid all of the problems with svn:externals.

The problem with svn:externals is that when you make a branch, it doesn't automatically create a branch for each of the svn:externals for you. This is a problem because then over time all of your old branches won't be able to compile as your trunk gets more updated. Another problem is that if you make a fix in any branch to an svn:external, all your other branches break.

Another problem with svn externals is that when you do an svn:log at the root level, you don't see any changes from svn externals.

Hopefully one day svn externals will be fixed to address the above problems, but until that day branching and svn:externals is an absolute nightmare.

like image 184
Brian R. Bondy Avatar answered Sep 22 '22 00:09

Brian R. Bondy


What you've done is what I've set up at my company, and it is also referenced as a "very common layout" in the svnbook topic, Strategies for Repository Deployment.

Nothing wrong with it.

like image 22
crashmstr Avatar answered Sep 22 '22 00:09

crashmstr