Make GIT-VERSION-GEN tolerate missing git describe command
I think it is probably a bug that "git non_existent_command" returns its error message to stdout without an error, where "git-non_existent_command" behaves differently and does return an error. Older versions of git did not implement "git describe" and GIT-VERSION-GEN produces an empty version string if run on a system with such a git installed. The consequence is that "make rpm" fails. This patch fixes GIT-VERSION-GEN so that it works in the absence of a working "git describe" Signed-off-by: John Ellson <ellson@research.att.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
John Ellson committed
Dec 30, 2005 at 11:23 UTC
026351a03507dc3a2e89e068c01234dc55914df2
1 file changed
+1
-1
GIT-VERSION-GEN
+1
-1
@@ -2,7 +2,7 @@
2
3
GVF=GIT-VERSION-FILE
4
5
-VN=$(git describe --abbrev=4 HEAD 2>/dev/null) || VN=v1.0.GIT
5
+VN=$(git-describe --abbrev=4 HEAD 2>/dev/null) || VN=v1.0.GIT
6
VN=$(expr "$VN" : v'\(.*\)')
7
if test -r $GVF
8
then