From 690181426dc9d5b2a6eecb26be376f5a67071758 Mon Sep 17 00:00:00 2001 From: Simon Michael Date: Thu, 3 Sep 2015 12:42:14 -0700 Subject: [PATCH] tools: add "make describe" (#269) A make rule to handle some subtleties in getting an accurate stable git-describe version string. --- Makefile | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 6bf8a1aba..64c6f5dec 100644 --- a/Makefile +++ b/Makefile @@ -148,7 +148,6 @@ VERSIONFILE=.version VERSION:=$(shell cat $(VERSIONFILE)) # the number of commits since the last tag -#DESCRIBE:=$(shell git describe --tags --match 'hledger-[0-9]*' --dirty ) PATCHLEVEL:=$(shell git describe --tags --match 'hledger-[0-9]*' --long | awk -F- '{print $$3}') #PATCHLEVEL:=$(shell git describe --tags --match 'hledger-web-[0-9]*' --long | awk -F- '{print $$4}') # the number of commits since the last_release tag @@ -1074,6 +1073,10 @@ $(call def-help-subsection,RELEASING:) # # ) # # darcs record -m "bump version" $(VERSIONFILE) $(VERSIONSENSITIVEFILES) +describe: \ + $(call def-help,describe, show an accurate git-describe version string ) + @git describe --tags --match 'hledger-[0-9]*' --dirty + setversion: $(VERSIONSENSITIVEFILES) \ $(call def-help,setversion, update all version strings to match $(VERSIONFILE) )