How to save Subversion (SVN)

In the last few months, Subversion has been heavily criticized by the software development community, with reason. While Subversion was a great replacement to the old versioning systems like CVS and Visual Source Safe, the newer alternatives are really starting to demonstrate how bad Subversion really is.

Merging

This is probably the single most problematic issue with Subversion. Merging often causes headaches, errors and wastes a lot of precious time that could’ve been spent on development. Merging is so bad that many teams avoid branching so that they don’t have to deal with the merge later on. Mercurial (hg) and Git have both improved this aspect tremendously and I’m pretty sure its the reason why most people are moving away from Subversion.

The reason why Subversion has trouble with merging has to do with the way it stores the version history.

Subversion likes to think about revisions. A revision is what the entire file system looked like at some particular point in time.

In Mercurial, you think about changesets. A changeset is a concise list of the changes between one revision and the next revision.

Source: HgInit: Subversion Re-education (an excellent tutorial and guide to Mercurial or other distributed version control systems)

So Subversion compares whole files when merging while Mercurial (or Git) compares each change set individually. Conflicts occur far less frequently when dealing with changesets.

Improving SVN

Use changesets

As I said earlier, the biggest difference between Subversion and Mercurial/Git is the way they each deal with modifications to files. If Subversion started using changesets instead of revisions, a lot of the headaches and problems would disappear.

Local commits

Another advantage of Mercurial and Git over Subversion is their distributed nature. With Mercurial and Git, you can commit changes locally on your drive whenever you want (while you’re offline too) and commit all those local changes to a central repository at the time of your choosing. This improves commit logs since the developers don’t have to worry about breaking anything until they actually commit to the central repository (or push their changes if we use the distributed version control system terminology). You can even have multiple intermediate repositories between the developers and the central repository. For example, all developers could commit to a team lead repository which would review every changes and then commit the reviewed modifications to the central repository.

So, to improve Subversion, I don’t think the multi-stage distributed system is necessary. The real value is in local commits, the rest can be easily emulated by using a simple branching process.

Subversion’s future

Unless Subversion works on these two issues, I don’t think Subversion stands a chance against the newcomers. Slowly but surely, teams will migrate to alternative version control systems because they make branching fun again.

Bonus: Move all the repository information at the root

This one is not as bad as the others, it’s just a regular annoyance that could be improved. Instead of having Subversion meta-data in every single versioned folder, Subversion should keep all the info in a single meta-data folder at the root of the checked out repository.

10 comments
david richards on April 6, 2010

Instead of pontificating why not come and participate in the project? WC-NG enables many of the [bleeding] obvious points you bring up here.

Michel Billard on April 6, 2010

I was not aware of such a project. Could you point me to the project’s page, I could not find any decent information about it (a few emails sent from some developer and that’s about it). This is definately a project worth checking, thanks.

Clinton Begin on April 6, 2010

Why save Subversion? It was great as an intermediate between CVS and [insert next best thing here]. No disrespect to the team that tried to make “a better CVS” — they succeeded. But if Mercurial and Git already do a better job and have made distributed SCM a reality, why mangle SVN into something it wasn’t designed for? Let it die. Really what we’re talking about is saving the companies and tools surrounding subversion — which is a commercial consideration. But really, the community won’t care and people will migrate off of SVN far before it has a chance to react. Unfortunately the companies that have bet the farm on SVN will have to adapt, or die with it.

Michel Billard on April 6, 2010

In my opinion, having those 2 features would cover what most teams are looking for when migrating away from Subversion. We are currently thinking about changing to Mercurial (and looking for any potential side-effects) and if Subversion had those 2 features, we wouldn’t even thought of looking elsewhere (and we wouldn’t have missed much since most of the value of Mercurial and Git is in those 2 features).

I don’t care whether Subversion lives or dies, but if it wants to still be relevant, it needs those 2 features.

Johan on April 7, 2010

Well said!…I also believe that SVN has begun its unavoidable journey to the wally of death. GIT is here to stay…and take over :)
Thank god for Linus Torvald!
J.

Veera on April 7, 2010

I like Subversion because it was better than VSS and CVS. And there were some real cool plug-ins like Subclipse, TortoiseSVN and VisualSVN which made Subversion as my first choice of version controlling.

But the recent developments in version controlling tools made me to re-think about my love of Subversion. Git is the way to go, I think.

Cue on April 7, 2010

Subversion, like any other open-source project, is a meritocracy based on code contribution and lots of discussion. That’s where it derives from, and that’s where the majority of “better” software derive from. Everything has a beginning and an end.

I think it’s adequate to hail Subversion for the impact it’s had, not send it packing with a bad note with a sack of horse pile. They did a good job, now it’s time for others to shine and take it to another level. That’s life.

Michel Billard on April 7, 2010

The bunny hop is interesting, however its a work-around around something that should be easy. The best (and I think the correct) way of merging back a branch into another branch is to first “forward-merge” the target branch into the branch that needs to be merged and then merge back the branch into the target branch.

@Cue, you are right: Subversion was really good AND a savior for a few years so it deserves to be praised. It could have a few more years if it could adapt to the recent breakthroughs in source control.

Ron on February 2, 2011

Don’t bunny hop, you’ll look silly, reintegrate instead. Update to Svn 1.5 or later and read the book http://svnbook.red-bean.com/.

Svn 1.5 see http://svnbook.red-bean.com/en/1.5/svn.branchmerge.basicmerging.html.
Svn 1.6 see http://svnbook.red-bean.com/nightly/en/svn.branchmerge.basicmerging.html#svn.branchemerge.basicmerging.reintegrate

After the branch has been reintegrated the book recommends deleting the branch, and creating a new branch to track future changes. The book also describes how to keep the branch alive after reintegration http://svnbook.red-bean.com/nightly/en/svn.branchmerge.advanced.html#svn.branchmerge.advanced.reintegratetwice.


Leave a comment
Name (required)
Email (will not be shown) (required)
Website