git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sam Vilain <sam@vilain.net>
To: Martin Waitz <tali@admingilde.org>
Cc: Junio C Hamano <junkio@cox.net>, git@vger.kernel.org
Subject: Re: [PATCH] Make sure an autogenerated version has at least four parts
Date: Fri, 25 May 2007 13:42:57 +1200	[thread overview]
Message-ID: <46563F21.2060107@vilain.net> (raw)
In-Reply-To: <46563CE1.9020007@vilain.net>

I wrote:
> dpkg uses "-" in version numbers for its own uses - to delimit the
> packager's packaging version from the software version.  The change I
> posted keeps original behaviour - just fills out the .0's.
> 
> Perhaps the munging should go in git-describe instead?
> 
> Subject: [PATCH] describe: add --levels option

...and here's the corresponding GIT-VERSION-GEN patch:

Subject: [PATCH] Make sure an autogenerated version has at least four parts

Otherwise, a custom "v1.5.2.42.gd00b" is considered newer than a
"v1.5.2.1.69.gcafe".

Contains a workaround for the chicken-and-egg problem it would
otherwise introduce.

Signed-off-by: Sam Vilain <sam@vilain.net>
---
 GIT-VERSION-GEN |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/GIT-VERSION-GEN b/GIT-VERSION-GEN
index 06c360b..91e8966 100755
--- a/GIT-VERSION-GEN
+++ b/GIT-VERSION-GEN
@@ -12,7 +12,8 @@ if test -f version
 then
 	VN=$(cat version) || VN="$DEF_VER"
 elif test -d .git &&
-	VN=$(git describe --abbrev=4 HEAD 2>/dev/null) &&
+	VN=$(git describe --abbrev=4 --levels=4 HEAD 2>/dev/null ||
+		git describe --abbrev=4 HEAD 2>/dev/null) &&
 	case "$VN" in
 	*$LF*) (exit 1) ;;
 	v[0-9]*) : happy ;;
-- 
1.5.2.0.45.gfea6d-dirty

  reply	other threads:[~2007-05-25  1:49 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-05-21  2:52 [PATCH] Make sure an autogenerated version has at least four parts Sam Vilain
2007-05-21  7:36 ` Martin Waitz
2007-05-21 19:57   ` Jan Hudec
2007-05-21 20:06     ` Martin Waitz
2007-05-25  1:33   ` Sam Vilain
2007-05-25  1:42     ` Sam Vilain [this message]
2007-05-25  9:47     ` Martin Waitz

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=46563F21.2060107@vilain.net \
    --to=sam@vilain.net \
    --cc=git@vger.kernel.org \
    --cc=junkio@cox.net \
    --cc=tali@admingilde.org \
    /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).