+ # If we are on a "dev" tag, we need to check that it is not the same
+ # reference as the a previous version tag (this only happens when we are
+ # working with a release tag).
+ # NB The below trick relies on the $v being an exact tag to work which
+ # will only work when HEAD == tag. When further commits have been made on top
+ # of the tag, the $v will be supplimented with the number of commits since
+ # that tag and the commit ref of the most recent commit and thus will
+ # fail the test below (as intended)
+ v2=`git describe --abbrev=4 --match='v[0-9]\.[0-9]' --contains $v 2>/dev/null | cut -d'^' -f1`
+ [ -n "$v2" ] && v=$v2
+