git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC PATCH] GIT-VERSION-GEN: restrict tags used
@ 2010-05-11 17:33 Tay Ray Chuan
  2010-05-11 23:01 ` Jonathan Nieder
  0 siblings, 1 reply; 6+ messages in thread
From: Tay Ray Chuan @ 2010-05-11 17:33 UTC (permalink / raw)
  To: Git Mailing List; +Cc: Junio C Hamano, Jonathan Nieder, Jeff King

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).

Signed-off-by: Tay Ray Chuan <rctay89@gmail.com>
---

  Ran into this after tagging a topic branch and running make.

  Although a "v.*" match does not guarantee the non-usage of private
  tags, I feel it's an acceptable level of accuracy.

  After this patch, perhaps we could advertise somewhere to git hackers
  that tags beginning with "v" should be avoided.

 GIT-VERSION-GEN |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/GIT-VERSION-GEN b/GIT-VERSION-GEN
index 59219bd..28b4d56 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*" --abbrev=4 HEAD 2>/dev/null) &&
 	case "$VN" in
 	*$LF*) (exit 1) ;;
 	v[0-9]*)
--
1.7.1.189.g07419

^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2010-05-12  5:54 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-05-11 17:33 [RFC PATCH] GIT-VERSION-GEN: restrict tags used Tay Ray Chuan
2010-05-11 23:01 ` Jonathan Nieder
2010-05-11 23:05   ` Jonathan Nieder
2010-05-12  3:23   ` Tay Ray Chuan
2010-05-12  3:29     ` [PATCH] " Tay Ray Chuan
2010-05-12  5:54       ` Junio C Hamano

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).