westarete/capistrano-helpers — pull request #9 by Simbul (2012-10-11 15:51:54+00:00)
Title: Abbreviated sha1

This is a very simple change to the Campfire helper.

A bit of background: Capistrano accepts command line parameters that will initialise internal variables. E.g. to deploy a specific commit, one would call something like:

```bash
$ cap deploy -S branch=215409fde5b730ea1319a2ca99de64487ca0aa47 production
```

This will initialise the `:branch` variable, which is one of the components the Campfire helper uses when building the message to post. Showing a full git SHA in a Campfire room, however, is ugly.
This small pull request will convert every SHA to their abbreviated form (i.e. the first 7 chars).

The regexp I used should be restrictive enough to never abbreviate anything that is not an actual git SHA (unless you like your branch names 40-characters long and only containing lowercase letters and numbers, of course :D)