@matheusbsbs / matheus-bagliano / commits / 3368edd4cd
Fork 0

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 <rctay89@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Tay Ray Chuan committed May 12, 2010 at 11:29 UTC 3368edd4cda6306d524e10758e2c5a187dcd4ba6
1 file changed +1 -1
GIT-VERSION-GEN
+1 -1
@@ -12,7 +12,7 @@ if test -f version
12 then
13 VN=$(cat version) || VN="$DEF_VER"
14 elif test -d .git -o -f .git &&
15 - VN=$(git describe --abbrev=4 HEAD 2>/dev/null) &&
15 + VN=$(git describe --match "v[0-9]*" --abbrev=4 HEAD 2>/dev/null) &&
16 case "$VN" in
17 *$LF*) (exit 1) ;;
18 v[0-9]*)