git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Make sure an autogenerated version has at least four parts
@ 2007-05-21  2:52 Sam Vilain
  2007-05-21  7:36 ` Martin Waitz
  0 siblings, 1 reply; 7+ messages in thread
From: Sam Vilain @ 2007-05-21  2:52 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git, Sam Vilain

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

Warning: contains awk.

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

diff --git a/GIT-VERSION-GEN b/GIT-VERSION-GEN
index 06c360b..5eb58c3 100755
--- a/GIT-VERSION-GEN
+++ b/GIT-VERSION-GEN
@@ -18,7 +18,7 @@ elif test -d .git &&
 	v[0-9]*) : happy ;;
 	esac
 then
-	VN=$(echo "$VN" | sed -e 's/-/./g');
+	VN=$(echo "$VN" | awk -F- 'X=$1 { Y=$2; Z=$3; while (!(X ~ /\..*\..*\./)) { X = X ".0" } print X ( Y ? "." Y : "" ) ( Z ? "." Z : "" ) }');
 else
 	VN="$DEF_VER"
 fi
-- 
1.5.1.1.175.g31e4

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

end of thread, other threads:[~2007-05-25  9:47 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
2007-05-25  9:47     ` Martin Waitz

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