You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by ja...@apache.org on 2018/07/13 15:44:19 UTC
[couchdb] 02/06: build: ease pattern matching to be less pedantic
about RC
This is an automated email from the ASF dual-hosted git repository.
jan pushed a commit to branch fix/2.1.2-sec
in repository https://gitbox.apache.org/repos/asf/couchdb.git
commit ed21a53b3e5a4868b2e0f183e6b4d8a608988c5f
Author: Dave Cottlehuber <dc...@skunkwerks.at>
AuthorDate: Wed May 2 08:13:33 2018 +0000
build: ease pattern matching to be less pedantic about RC
git-describe may have changed output formats. The previous regex doesn't
allow any trailing content, and git-describe always appends -g<SHA> unless
abbrev=0 is added.
This approach pulls out only the matching tag, leaving behind any
trailing garbage from git-describe, and as a bonus allows tagging a
commit from within a branch, and running a release directly from the
branch without needing to re-check out the tag itself.
---
Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Makefile b/Makefile
index 1e0ea82..727872f 100644
--- a/Makefile
+++ b/Makefile
@@ -17,7 +17,7 @@ IN_RELEASE = $(shell if [ ! -d .git ]; then echo true; fi)
ifeq ($(IN_RELEASE), true)
COUCHDB_VERSION = $(vsn_major).$(vsn_minor).$(vsn_patch)
else
-RELTAG = $(shell git describe | grep -E '^[0-9]+\.[0-9]\.[0-9]+(-RC[0-9]+)?$$')
+RELTAG = $(shell git describe --dirty --abbrev=0 --tags --always --first-parent | grep -Eo '^[0-9]+\.[0-9]\.[0-9]+(-RC[0-9]+)?')
ifeq ($(RELTAG),)
COUCHDB_VERSION_SUFFIX = $(shell git rev-parse --short --verify HEAD)
COUCHDB_VERSION = $(vsn_major).$(vsn_minor).$(vsn_patch)-$(COUCHDB_VERSION_SUFFIX)