git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH] GIT-VERSION-GEN: restrict tags used

From
Tay Ray Chuan <rctay89@gmail.com>
Date
May 12, 2010, 03:29 UTC
Message-ID
<1273634960-2728-1-git-send-email-rctay89@gmail.com>
In-Reply-To
<AANLkTim8SRUEaNWyBF_iRQstu84r9eAaUd0a9KLj6OtR@mail.gmail.com>

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>
---
  Changes from RFC:
    - used "v[0-9]*" instead of just "v*"
    - mentioned gitk as another piece that may break
 GIT-VERSION-GEN |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/GIT-VERSION-GEN b/GIT-VERSION-GEN
index 59219bd..e45513d 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]*)
--
1.7.1.189.g07419
Previous: Tay Ray ChuanNext: Junio C Hamano
Message 5 of 6 in “GIT-VERSION-GEN: restrict tags used”
  1. GIT-VERSION-GEN: restrict tags usedTay Ray Chuan, May 11, 2010
  2. Jonathan NiederMay 11, 2010
  3. Jonathan NiederMay 11, 2010
  4. Tay Ray ChuanMay 12, 2010
  5. GIT-VERSION-GEN: restrict tags usedTay Ray Chuan, May 12, 2010
  6. Junio C HamanoMay 12, 2010

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.