git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [RFC/PATCH 4/3] Simplify naming (versioning) of non-release tig tarball and rpm file

From
Jonas Fonseca <fonseca@diku.dk>
Date
Jun 3, 2007, 09:11 UTC
Message-ID
<20070603091126.GA1419@diku.dk>
In-Reply-To
<200706021952.28426.jnareb@gmail.com>
Jakub Narebski <jnareb@gmail.com> wrote Sat, Jun 02, 2007:
Show 9 quoted lines
> 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?

I like the simpler and less confusing names. How about the simpler version below?

BTW, I also added `make dist DIST_VERSION=X.Y` to make it easy to force a version. I used it when building the documentation in the release branch.

Show 19 quoted lines
> 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)"'
diff --git a/Makefile b/Makefile
index 91cb097..622a916 100644
--- a/Makefile
+++ b/Makefile
@@ -17,7 +17,11 @@ ifdef DIST_VERSION
 VERSION = $(DIST_VERSION)
 endif
 
-RPM_VERSION = $(subst -,.,$(VERSION))
+# Split the version "TAG-OFFSET-gSHA1-DIRTY" into "TAG OFFSET"
+# and append 0 as a fallback offset for "exact" tagged versions.
+RPM_VERLIST = $(filter-out g% dirty,$(subst -, ,$(VERSION))) 0
+RPM_VERSION = $(word 1,$(RPM_VERLIST))
+RPM_RELEASE = $(word 2,$(RPM_VERLIST))$(if $(WTDIRTY),.dirty)
 
 LDLIBS	= -lcurses
 CFLAGS	= -Wall -O2
-- 
Jonas Fonseca
Previous: Jakub NarebskiNext: Jakub Narebski
Message 11 of 12 in “Infrastructure for tig rpm builds.”
  1. Infrastructure for tig rpm builds.Jakub Narebski, May 28, 2007
  2. Jonas FonsecaMay 29, 2007
  3. Jakub NarebskiMay 29, 2007
  4. Jonas FonsecaMay 31, 2007
  5. 1/3 Remove PDF version of manual from being build and installedJakub Narebski, Jun 1, 2007
  6. Jonas FonsecaJun 2, 2007
  7. 2/3 Include documentation sources for rpmbuild with '--without docs'Jakub Narebski, Jun 1, 2007
  8. 3/3 Refresh VERSION file when building distribution tarball in "make dist"Jakub Narebski, Jun 1, 2007
  9. Jonas FonsecaJun 2, 2007
  10. 4/3 Simplify naming (versioning) of non-release tig tarball and rpm fileJakub Narebski, Jun 2, 2007
  11. Jonas FonsecaJun 3, 2007
  12. Jakub NarebskiJun 3, 2007

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.