From: Tay Ray Chuan Date: Wed, 12 May 2010 03:29:20 +0000 (+0800) Subject: GIT-VERSION-GEN: restrict tags used X-Git-Tag: v1.7.2-rc0~3^2~26 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=3368edd4cda6306d524e10758e2c5a187dcd4ba6;p=git.git GIT-VERSION-GEN: restrict tags used Restrict the tags used to generate the version string to those that begin with "v", since git's tags for git-core (ie. excluding git-gui) are all of the form "vX.Y...". This is to avoid using private tags by the user in a clone of the git code repository, which may break certain machinery (eg. Makefile, gitk). Signed-off-by: Tay Ray Chuan Signed-off-by: Junio C Hamano --- diff --git a/GIT-VERSION-GEN b/GIT-VERSION-GEN index 0ad39484e..82fd72652 100755 --- a/GIT-VERSION-GEN +++ b/GIT-VERSION-GEN @@ -12,7 +12,7 @@ if test -f version then VN=$(cat version) || VN="$DEF_VER" elif test -d .git -o -f .git && - VN=$(git describe --abbrev=4 HEAD 2>/dev/null) && + VN=$(git describe --match "v[0-9]*" --abbrev=4 HEAD 2>/dev/null) && case "$VN" in *$LF*) (exit 1) ;; v[0-9]*)