Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Access to CVS



At 13:11 +0100 05 Dec 2012, Frank Terbeck <ft@xxxxxxxxxxxxxxxxxxx> wrote:
I think the most important outstanding issue is to put something useful
into $ZSH_PATCHLEVEL. `git-describe' can produce reasonable values.

The following patch seems to produce decent results.  Such as:

1004$ echo $ZSH_PATCHLEVEL
zsh-5.0.0-91-g2c149d7

Contrary to a previous comment this does give some indication of relationships between different patch levels. The "91" in that string is the number of commits since the named tag (zsh-5.0.0) in this case.

--- 8< ---
Subject: [PATCH] Generate patch level using `git describe`

Generate the patch level using `git describe` rather than relying on the
CVS $Revision$.  Need to use the `--tags` option, since currently there
are no annotated tags.

Since changes to the patchlevel could now be caused by changes to any
file, force the rule to be called every time that `make` is run.  But,
only update the file when there are actually changes to prevent
unnecessary rebuilding of other build products (currently just
`params.o` and `zsh`).
---
Src/zsh.mdd |    8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/Src/zsh.mdd b/Src/zsh.mdd
index 6e90776..5d9460d 100644
--- a/Src/zsh.mdd
+++ b/Src/zsh.mdd
@@ -39,10 +39,10 @@ params.o: patchlevel.h
version.h: $(sdir_top)/Config/version.mk zshcurses.h zshterm.h
	echo '#define ZSH_VERSION "'$(VERSION)'"' > $@

-patchlevel.h: $(sdir_top)/ChangeLog
-	sed -ne \
-	's/^\* *\$$''Revision: \(.*\) ''\$$/#define ZSH_PATCHLEVEL "\1"/p' \
-	$(sdir_top)/ChangeLog >patchlevel.h
+patchlevel.h: FORCE
+	echo '#define ZSH_PATCHLEVEL "'`git describe --tags`'"' > $@.tmp
+	cmp $@ $@.tmp && rm -f $@.tmp || mv $@.tmp $@
+FORCE:

zshcurses.h: ../config.h
	@if test x$(ZSH_CURSES_H) != x; then \
--
1.7.10.4



Messages sorted by: Reverse Date, Date, Thread, Author