aboutsummaryrefslogtreecommitdiff
path: root/Documentation/GEN-DOC-VERSION
blob: 973bfa8d273a9c2b118c482c25bf675a6bbeb244 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#!/bin/sh

V=$(git describe HEAD)

case "$V" in
'')
	echo >&2 "fatal: no annotated tags, cannot determine version"
	exit 1
	;;

*-g*)
	echo >&2 "fatal: snapshot $V, cannot determine version"
	exit 1
	;;

v*)
	echo "$V" | perl -lne 'print $1 if /^v(\d+\.\d+(?:\.\d+)?)/'
	;;
esac