From: Jakub Narebski <jnareb@gmail.com>
To: Jonas Fonseca <fonseca@diku.dk>
Cc: git@vger.kernel.org
Subject: [RFC/PATCH 4/3] Simplify naming (versioning) of non-release tig tarball and rpm file
Date: Sat, 2 Jun 2007 19:52:28 +0200 [thread overview]
Message-ID: <200706021952.28426.jnareb@gmail.com> (raw)
In-Reply-To: <20070531131615.GA27044@diku.dk>
Use the tag part of git-describe output, with `tig-' prefix stripped
off, as version number. Use number of commits since given tag as
release number, using 0 if we are at tagged version, and adding
'.dirty' suffix if working directory is dirty. Do not use 'g<sha 1>'
part of git-describe output.
For example, when git-describe output was tig-0.7-8-g26d0386, before
this commit tarball was named tig-0.7.8.g26d0386.tar.gz and rpm was
named tig-0.7.8.g26d0386-1.src.rpm (for dirty tree tarball was
tig-0.7.8.g26d0386.dirty.tar.gz), now tarball is named
tig-0.7-8.tar.gz and rpm is named tig-0.7-8.src.rpm (for dirty tree
tarball is tig-0.7-8.dirty.tar.gz).
Signed-off-by: Jakub Narebski <jnareb@gmail.com>
---
This is proposal to simplify naming of non-release tarballs and rpm file,
both for tig and also for git itself. Instead of using whole git-describe
output as version number in tarball/rpm name (BTW. it would be nice to
have command line switch to git-describe which would return old output,
without number of commits since given tag) use tag part as version number,
and number of commits since (plus optional marking dirty) as release
number.
What do you think about this?
Makefile | 13 ++++++++++---
tig.spec.in | 2 +-
2 files changed, 11 insertions(+), 4 deletions(-)
diff --git a/Makefile b/Makefile
index b49d7f8..1e67586 100644
--- a/Makefile
+++ b/Makefile
@@ -17,7 +17,13 @@ ifdef DIST_VERSION
VERSION = $(DIST_VERSION)
endif
-RPM_VERSION = $(subst -,.,$(VERSION))
+# $(GITDESC) looks like either x.y, or like x.y-z-g<sha1>
+SPLIT_VERSION := $(shell echo $(GITDESC) | \
+ sed -e 's/^\(.*\)-\([0-9]\+\)-\(g[0-9a-f]\+\)$$/\1 \2 \3/g')
+RPM_VERSION = $(subst -,.,$(word 1,$(SPLIT_VERSION)))
+RPM_RELEASE = $(strip \
+ $(subst -,.,$(if $(word 2,$(SPLIT_VERSION)),\
+ $(word 2,$(SPLIT_VERSION)),0)$(WTDIRTY)))
LDLIBS = -lcurses
CFLAGS = -Wall -O2 '-DVERSION="$(VERSION)"'
@@ -26,7 +32,7 @@ PROGS = tig
MANDOC = tig.1 tigrc.5
HTMLDOC = tig.1.html tigrc.5.html manual.html README.html
ALLDOC = $(MANDOC) $(HTMLDOC) manual.html-chunked manual.pdf
-TARNAME = tig-$(RPM_VERSION)
+TARNAME = tig-$(RPM_VERSION)-$(RPM_RELEASE)
all: $(PROGS)
all-debug: $(PROGS)
@@ -104,7 +110,8 @@ release-dist: release-doc
install-doc-man install-doc-html clean spell-check dist rpm
tig.spec: tig.spec.in
- sed -e 's/@@VERSION@@/$(RPM_VERSION)/g' < $< > $@
+ sed -e 's/@@VERSION@@/$(RPM_VERSION)/g' \
+ -e 's/@@RELEASE@@/$(RPM_RELEASE)/g' < $< > $@
tig: tig.c
diff --git a/tig.spec.in b/tig.spec.in
index 2385fb8..8606b23 100644
--- a/tig.spec.in
+++ b/tig.spec.in
@@ -4,7 +4,7 @@
Summary: Tig: text-mode interface for git
Name: tig
Version: @@VERSION@@
-Release: 1%{?dist}
+Release: @@RELEASE@@%{?dist}
License: GPL
Group: Development/Tools
Vendor: Jonas Fonseca <fonseca@diku.dk>
--
1.5.2
next prev parent reply other threads:[~2007-06-02 23:17 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-05-28 8:54 [PATCH (tig)] Infrastructure for tig rpm builds Jakub Narebski
2007-05-29 20:29 ` Jonas Fonseca
2007-05-29 23:31 ` Jakub Narebski
2007-05-31 13:16 ` Jonas Fonseca
2007-06-01 16:24 ` [PATCH 1/3] Remove PDF version of manual from being build and installed Jakub Narebski
2007-06-02 16:08 ` Jonas Fonseca
2007-06-01 16:27 ` [PATCH 2/3] Include documentation sources for rpmbuild with '--without docs' Jakub Narebski
2007-06-01 16:34 ` [PATCH 3/3] Refresh VERSION file when building distribution tarball in "make dist" Jakub Narebski
2007-06-02 16:12 ` Jonas Fonseca
2007-06-02 17:52 ` Jakub Narebski [this message]
2007-06-03 9:11 ` [RFC/PATCH 4/3] Simplify naming (versioning) of non-release tig tarball and rpm file Jonas Fonseca
2007-06-03 21:12 ` Jakub Narebski
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=200706021952.28426.jnareb@gmail.com \
--to=jnareb@gmail.com \
--cc=fonseca@diku.dk \
--cc=git@vger.kernel.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).