Linux: cache bypass: remove warning print before panic
[openafs.git] / build-tools / git-version
1 #!/bin/sh
2
3 version_file=$1
4
5 if [ -f $version_file ] ; then
6   git_version=`cat $version_file`
7 else
8   if which git > /dev/null; then
9     git_version=`git describe --abbrev=4 HEAD 2>/dev/null`
10
11     # Is the working tree dirty?
12     if ! git diff-index --quiet --cached HEAD --ignore-submodules || \
13        ! git diff-files --quiet --ignore-submodules ; then
14       git_version="$git_version-dirty"
15     fi
16   else
17     git_version=UNKNOWN
18   fi
19 fi
20
21 echo "$git_version" | sed -e 's/openafs-[^-]*-//' -e 's/_/./g' | tr -d '\012'