afs: Flush vcaches sooner if cache is stressed
[openafs.git] / build-tools / git-version
blobff55b4a403420cbe7792f6498c3073d1aee3d3a0
1 #!/bin/sh
3 srcdir=$1
4 fallback=$2
6 if [ "x$fallback" = "x" ]; then
7 fallback=UNKNOWN
8 fi
10 if [ -f $srcdir/.version ] ; then
11 git_version=`cat $srcdir/.version`
12 else
13 if which git > /dev/null; then
14 cd $srcdir
15 git_version=`git describe --abbrev=4 HEAD 2>/dev/null`
16 if [ $? = 0 ]; then
17 # Is the working tree dirty?
18 if git diff-index --quiet --cached HEAD && \
19 git diff-files --quiet ; then
21 else
22 git_version="$git_version-dirty"
24 else
25 git_version=$fallback
27 else
28 git_version=$fallback
32 echo "$git_version" | sed -e 's/openafs-[^-]*-//' -e 's/_/./g' | tr -d '\012'