Skip to content

Commit 3368edd

Browse files
rctaygitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 87a074d commit 3368edd

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

GIT-VERSION-GEN

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ if test -f version
1212
then
1313
VN=$(cat version) || VN="$DEF_VER"
1414
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) &&
1616
case "$VN" in
1717
*$LF*) (exit 1) ;;
1818
v[0-9]*)

0 commit comments

Comments
 (0)