mirror of
https://github.com/opencontainers/runc.git
synced 2026-07-11 06:03:57 +08:00
Makefile: use git describe for $COMMIT
Use "git describe --dirty --long" instead of "git rev-parse". As a
result, the commit ID will contain the closest tag, the number of commits
since the tag, and the (abbreviated) git commit sha (see example below).
NOTE that this tag is still unique and can be used instead of bare sha
for all git commands.
Example output of "runc -v | grep commit".
Before:
commit: 4d87573871
After:
commit: v1.0.0-rc95-9-g6f55d074
This means that
- the closest tag is v1.0.0-rc95
- there were 9 commits after the tag
- the abbreviated sha is 6f55d074
Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
This commit is contained in:
@@ -10,8 +10,7 @@ GIT_BRANCH_CLEAN := $(shell echo $(GIT_BRANCH) | sed -e "s/[^[:alnum:]]/-/g")
|
|||||||
RUNC_IMAGE := runc_dev$(if $(GIT_BRANCH_CLEAN),:$(GIT_BRANCH_CLEAN))
|
RUNC_IMAGE := runc_dev$(if $(GIT_BRANCH_CLEAN),:$(GIT_BRANCH_CLEAN))
|
||||||
PROJECT := github.com/opencontainers/runc
|
PROJECT := github.com/opencontainers/runc
|
||||||
BUILDTAGS ?= seccomp
|
BUILDTAGS ?= seccomp
|
||||||
COMMIT_NO := $(shell git rev-parse HEAD 2> /dev/null || true)
|
COMMIT ?= $(shell git describe --dirty --long --always)
|
||||||
COMMIT ?= $(if $(shell git status --porcelain --untracked-files=no),"$(COMMIT_NO)-dirty","$(COMMIT_NO)")
|
|
||||||
VERSION := $(shell cat ./VERSION)
|
VERSION := $(shell cat ./VERSION)
|
||||||
|
|
||||||
# TODO: rm -mod=vendor once go 1.13 is unsupported
|
# TODO: rm -mod=vendor once go 1.13 is unsupported
|
||||||
|
|||||||
Reference in New Issue
Block a user