setlocalversion revision 259065
1189136Sdas#!/bin/sh 2189136Sdas# Print additional version information for non-release trees. 3189136Sdas 4189136Sdasusage() { 5189136Sdas echo "Usage: $0 [srctree]" >&2 6189136Sdas exit 1 7189136Sdas} 8189136Sdas 9189136Sdascd "${1:-.}" || usage 10189136Sdas 11189136Sdas# Check for git and a git repo. 12189136Sdasif head=`git rev-parse --verify HEAD 2>/dev/null`; then 13189136Sdas # Do we have an untagged version? 14189136Sdas if git name-rev --tags HEAD | grep -E '^HEAD[[:space:]]+(.*~[0-9]*|undefined)$' > /dev/null; then 15189136Sdas printf '%s%s' -g `echo "$head" | cut -c1-8` 16189136Sdas fi 17189136Sdas 18189136Sdas # Are there uncommitted changes? 19189136Sdas if git diff-index HEAD | read dummy; then 20189136Sdas printf '%s' -dirty 21189136Sdas fi 22189136Sdasfi 23189136Sdas