#!/bin/sh # # (c) 2006 Bertrand Jacquin # if [ -d .git ]; then head=$(git rev-parse --verify HEAD 2>/dev/null) if [ "`git name-rev --tags HEAD`" = "HEAD undefined" ]; then version="g$(echo "${head}" | cut -c 1-8)" fi if [ -n "$(git diff-files)" ]; then version="${version}-dirty" fi else version=$(date +%Y%m%d) fi echo ${version} exit 0