@matheusbsbs / matheus-bagliano / commits / 374dfaa2e3
Fork 0

Make GIT-VERSION-GEN tolerate missing git describe command again

Commit 5c7d3c95 broke that by making the git-describe command part of a pipe. Signed-off-by: Uwe Zeisberger <zeisberg@informatik.uni-freiburg.de> Signed-off-by: Junio C Hamano <junkio@cox.net>

Uwe Zeisberger committed Jan 26, 2006 at 17:39 UTC 374dfaa2e39d04a4f1f63d1cb8d322d9db07c73a
1 file changed +5 -3
GIT-VERSION-GEN
+5 -3
@@ -5,9 +5,11 @@ DEF_VER=v1.1.GIT
5
6 # First try git-describe, then see if there is a version file
7 # (included in release tarballs), then default
8 -VN=$(git-describe --abbrev=4 HEAD 2>/dev/null | sed -e 's/-/./g') ||
9 -VN=$(cat version) ||
10 -VN="$DEF_VER"
8 +if VN=$(git-describe --abbrev=4 HEAD 2>/dev/null); then
9 + VN=$(echo "$VN" | sed -e 's/-/./g');
10 +else
11 + VN=$(cat version) || VN="$DEF_VER"
12 +fi
13
14 VN=$(expr "$VN" : v*'\(.*\)')
15