Linking to Codebase tickets from Cornerstone

This is for anyone that is using Zennaware's Cornerstone as a Subversion GUI, and Codebase for SVN and issue tracking.

Codebase and commit messages

Codebase has a great feature where you can change the status of a ticket right from your commit message, using a special syntax.

Say you have a ticket in Codebase, for example #9, and you've just updated some code, and consider the ticket resolved.

All you need to do is include [completed: 9] in your commit message, and Codebase takes care of the rest.

For more on this, see the Codebase Knowledge Base.

Taking advantages of Cornerstone's features

So where does Cornerstone come in?

Well, first of all, Cornerstone is a great Mac OS X GUI for Subversion.

Cornerstone gives you the ability to create hyperlinks to your issue tracker in its Log view. There are a handful of presets built-in to Cornerstone to handle this for common systems like Trac, but nothing that would work for Codebase's syntax. It took me a bit of digging in the Help to realize that if you're not using one of their presets, you need to set up a Regular Expression.

Sidenote: As of this writing, Versions, the main competitor for Cornerstone, does not support this kind of linking customization. It only allows you to link to your issue tracker in the more standard form of #9. Just one of the things that swayed me over to Cornerstone.

How it's done

Here's how to link Cornerstone to Codebase for issue tracking.

NOTE: I'm assuming here that you're only touching/completing a single ticket per commit. This method doesn't support the syntax for multiple tickets i.e. [completed: 3,9,81]. That would have to be done differently.

First, open the Issue Tracking dialog for your Codebase repository:

  1. Right click on the relevant Codebase repository in Cornerstone
  2. Select "Issue Tracking…" and a dialog should come up similar to the screenshot below.

Set up the link for completed:

Issue # Pattern: \[completed: ([0-9]+)\]  
URL Format:{1}

Set up the link for touch:

Issue # Pattern: \[touch: ([0-9]+)\]  
URL Format:{1}

Of course, you'll need to substitute your own Codebase account and project.

Click Save.

Cornerstone issue tracking settings

That's it.

Now, if you have any entries in your log where you've used the special syntax for completed or touch, you should see them hyperlinked. Click them to go straight to the ticket in Codebase.

Cornerstone linked commit message

Bonus Tip: I also found it helpful to set up snippets in TextExpander for easily inserting the complete/touch syntax into my commit messages.