Skip to content

Commit

Permalink
Modify the version number format to make it more easily understandabl…
Browse files Browse the repository at this point in the history
…e for humans.
  • Loading branch information
ColdWaterLW committed Dec 18, 2024
1 parent f0bcb90 commit 1f4be11
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
################################## Parameter Definition And Check ##########################################
override GIT_VERSION = $(shell git rev-parse --abbrev-ref HEAD)${CUSTOM} $(shell git rev-parse HEAD)
# 1. 如果HEAD存在tag,则GIT_VERSION=<tag> <commit>
# e.g. 3.2411.0 a6355ff4cf8d181315a2b30341bc954b29576b11
# e.g. 3.2412.0-pre1-1 f0bcb90e712cbdb6e16f122c1ebd623e90f9a905
# 2. 如果HEAD没有tag,则GIT_VERSION=<分支名> <commit>
# e.g. main a6355ff4cf8d181315a2b30341bc954b29576b11
# e.g. release-3.2411.x a6355ff4cf8d181315a2b30341bc954b29576b11
override GIT_VERSION = $(shell if git describe --exact-match --tags >/dev/null 2>&1; then git describe --exact-match --tags | sed 's/^v//'; else git rev-parse --abbrev-ref HEAD; fi)${CUSTOM} $(shell git rev-parse HEAD)
override GIT_COMMIT = $(shell git rev-parse HEAD)
override PROJECT_NAME = sqle
override LDFLAGS = -ldflags "-X 'main.version=${GIT_VERSION}'"
Expand Down

0 comments on commit 1f4be11

Please sign in to comment.