The Hugin community is a warm and welcoming place. From our community’s charter: We often encourage users to become contributors by proactively offering them SVN write access. Such access to Subversion (SVN) can be intimidating. Fear not, version control systems are the tool to avoid irreversible unintentional damage. When a potential contributor asked the question again I did not find an answer on the web, so I set out to write this article.
Repository Areas and Policy
The best-practice SVN repositories are divided in three areas: trunk, branches and tags, each of them with different purpose.
That’s enough for Hugin. Combined with the intrinsic characteristics of version control it makes our repository a safe place to experiment. So far we did not need repository policies, just use good old common sense.
Larger projects may have written policies about repository status. Some depend critically on areas of their repository building at all the time and at every revision. Before committing to such repositories, changes must undergo all sorts of tests, often specified in written documents as well.
Trunk
Trunk is the famous bleeding edge. Most developers will be active on trunk, fixing bugs and adding features incrementally. Mistake happens where people work. No blame. Bugs can be often identified by stepping back a few revisions and comparing to HEAD (the latest revision).
Branches
Branches are copies, mostly of trunk, that started at a specific revision. From that point on, the branch differs from the original. They can have many purposes, and the specific dos and don’ts depend on that purpose.
- If a branch is meant for release do fix bugs and don’t add new feature.
- If it was started by a developer to develop a new feature, ask him first before fiddling with his work.
- When in doubt, start your own branch. Branches are cheap in Subversion. Most Google Summer of Code projects start their life as a separate branch.
Development branches eventually merge into trunk and become obsolete. Release branches are superseded by later release branches. On occasions parallel branches make sense and are maintained either over a transition period or indefinitely, and sometimes a branch takes a completely different meaning and becomes a fork.
Tags
Tags are moments in time that have particular meaning. As a general rule, don’t touch existing tags. Create new ones.
Repository Status and Release Lifecycle
Some projects have different repository status during the release life cycle. A temporary freeze on new features might apply to allow for the polishing of code toward release, in which case do commit translations and bug fixes but don’t commit new features. If you are unsure of the current lifecycle status of the project you contribute to, just ask. On Hugin we are currently in a freeze, working toward 0.8.0. But we tend to be tolerant and won’t refuse other contributions. We might adopt a more formal process in the future, branching out the feature-frozen code for release, but at the moment we lack the resources and don’t feel the need to maintain separate release and development branches.
The Dos and Dont’s
Dos |
Don’ts |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Last but not least: do use your common sense and don’t be shy to question the current way of doing things. You might have a point, and neither you nor we will know it unless you bring it to our attention. If you feel something important is missing in the above list, you are invited to comment.
Filed under: Google Summer of Code, development, hugin

The only thing I’d add is that in addition to keeping unrelated code changes in separate commits, keeping formatting changes separate is just as important.
i.e. although it seems like a good idea to tidy up as you go along (fixing formatting, whitespace, empty lines etc…), this makes the commits really difficult to read.
So: tiding up is a separate job, when needed it should be done independently of code changes.
A good habit is to look at each change before you commit, on the command-line this is easy:
svn diff | vim -
@Bruno: indeed, your addition is an important one and looking at the diff should be mandatory before committing. TortoiseSVN has it easily accessible from the context menu. I added it in a Do/Don’t line.
Oh, and if committing somebody elses work, credit them in the commit message, something like this in brackets:
Fix for incorrect value of pi (Mronjink Plognholisk)
These messages end up in the ChangeLog which is the only place where most contributions get noted. Feel free to credit anyone even if they just commented in a bug report (not very diligent about this myself).
@Bruno: added “give credit where credit is due”.
You write “Branches are cheap in Subversion”. They are not. I needed Git to come along to see why I hardly branched with Subversion before.
@Sebastian: Git, Mercurial and the other distributed version control system are cool indeed, although I find the user interface and the cross-platform support still lack maturity.
While there is some overlap, it is not 100%. There are plenty of applications for which a combination of distributed and traditional version control system is a superior solution to using either of them.
When judging the choice of tools one need to understand the past. Hugin has grown with CVS first and then with SVN as Sourceforge graciously offered that too in its free infrastructure. I don’t think that the project has a need to migrate to Git or Mercurial.