3 # version.sh: create a version string for use by configure.ac
7 if head=$(git rev-parse --short --verify HEAD 2>/dev/null); then
9 # If available, use the git commit revision for the package version.
11 # Add a date prefix for easy reading.
12 # date='2010-11-30 16:36:09 -0800'
14 date=$(git log --pretty=format:"%ci" -1 HEAD)
16 date=${date%%:[0-9][0-9] *}
21 version=$(printf '%s-%s%s' ${date} g ${head})
23 # Add a '-dirty' postfix for uncommitted changes.
25 if git diff-index HEAD | read dummy; then
26 version=`printf '%s%s' ${version} -dirty`
29 # Default to current date and time.
31 version="dev-$(date +%y.%m.%d-%H.%M.%S)"