git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Tay Ray Chuan <rctay89@gmail.com>
To: "Git Mailing List" <git@vger.kernel.org>
Cc: "Junio C Hamano" <gitster@pobox.com>,
	"Jonathan Nieder" <jrnieder@gmail.com>,
	"Jeff King" <peff@peff.net>
Subject: [RFC PATCH] GIT-VERSION-GEN: restrict tags used
Date: Wed, 12 May 2010 01:33:18 +0800	[thread overview]
Message-ID: <1273599198-1008-1-git-send-email-rctay89@gmail.com> (raw)

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

             reply	other threads:[~2010-05-11 17:37 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-05-11 17:33 Tay Ray Chuan [this message]
2010-05-11 23:01 ` [RFC PATCH] GIT-VERSION-GEN: restrict tags used 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1273599198-1008-1-git-send-email-rctay89@gmail.com \
    --to=rctay89@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=jrnieder@gmail.com \
    --cc=peff@peff.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).