Skip to content

Commit

Permalink
makefile: simplify makefile version retrieval for compatibility (#842)
Browse files Browse the repository at this point in the history
  • Loading branch information
wlwilliamx authored Jan 9, 2025
1 parent b3e2a5a commit 71f9b25
Showing 1 changed file with 1 addition and 12 deletions.
13 changes: 1 addition & 12 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -57,18 +57,7 @@ endif

RELEASE_VERSION =
ifeq ($(RELEASE_VERSION),)
RELEASE_VERSION := v8.2.0-master
release_version_regex := ^v[0-9]\..*$$
release_branch_regex := "^release-[0-9]\.[0-9].*$$|^HEAD$$|^.*/*tags/v[0-9]\.[0-9]\..*$$"
ifneq ($(shell git rev-parse --abbrev-ref HEAD | grep -E $(release_branch_regex)),)
# If we are in release branch, try to use tag version.
ifneq ($(shell git describe --tags --dirty | grep -E $(release_version_regex)),)
RELEASE_VERSION := $(shell git describe --tags --dirty)
endif
else ifneq ($(shell git status --porcelain),)
# Add -dirty if the working tree is dirty for non release branch.
RELEASE_VERSION := $(RELEASE_VERSION)-dirty
endif
RELEASE_VERSION := $(shell git describe --tags --dirty)
endif

# Version LDFLAGS.
Expand Down

0 comments on commit 71f9b25

Please sign in to comment.