Over on codeinthehole.com, David Winterbottom has written up a Fabric function for elegantly handling git tagging when running deployments. Such a function is part of all python deployment scripts used at Tangent Labs - it helps ensure that every build is either tagged or has a build number that helps QA determine where in the release cycle an integration build is.
There are two notable bits of commandlinefu worth noting:
- The -V flag used with sort is a useful option for sorting version numbers where 1.10 should come after 1.9.4.
- git describe is a super-useful command for generating a build number without using a tag. It generates the build number based on the number of commits since the last tagged release.