[go: nahoru, domu]

Skip to content
This repository has been archived by the owner on May 30, 2024. It is now read-only.

Commit

Permalink
common: add ability to provide glob to match tags during version calc…
Browse files Browse the repository at this point in the history
…ulation

Signed-off-by: Muvaffak Onus <me@muvaf.com>
  • Loading branch information
muvaf committed Jun 10, 2022
1 parent e234cc3 commit 23c90b1
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion makelib/common.mk
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,9 @@ ifeq ($(shell git tag),)
VERSION := $(shell echo "v0.0.0-$$(git rev-list HEAD --count)-g$$(git describe --dirty --always)" | sed 's/-/./2' | sed 's/-/./2' | sed 's/-/./2')
else
# use tags
VERSION := $(shell git describe --dirty --always --tags | sed 's/-/./2' | sed 's/-/./2' | sed 's/-/./2' )
# set if you want to consider only the tags matching your glob, e.g. "aws/*".
VERSION_TAG_MATCH ?= '*'
VERSION := $(shell git describe --dirty --always --tags --match '$(VERSION_TAG_MATCH)' | sed 's|.*/||' | sed 's/-/./2' | sed 's/-/./2' | sed 's/-/./2')
endif
endif
export VERSION
Expand Down

0 comments on commit 23c90b1

Please sign in to comment.