3 if ! which git
>/dev
/null
2>&1 ||
4 ! cd "$(dirname "$0")" ||
5 ! git rev-parse
--git-dir >/dev
/null
2>&1
7 # XXX get version from newvers.sh?
12 v
=$
(git describe
--abbrev=4 HEAD
2>/dev
/null || git rev-parse
--short HEAD
)
13 git update-index
-q --refresh
14 [ -z "$(git diff-index --name-only HEAD --)" ] || v
="$v-dirty"
16 v
=$
(echo "$v" |
sed -e 's/-/./g;s/^v//;')