git describe --match=NeVeRmAtCh --always --abbrev=7 --dirty | Return the current commit hash | 
git describe --abbrev=0 | Return the most recent tag name | 
git show -s --format=%cd --date=format:'-%y-%m-%d' | Return the current commit date | 
git rev-parse --abbrev-ref HEAD | Return current branch name | 
1 
2 
3 
4 
 | 
GIT_HASH := $(shell git describe --match=NeVeRmAtCh --always --abbrev=7 --dirty) 
GIT_BRANCH:=$(shell git rev-parse --abbrev-ref HEAD) 
GIT_TAG:= $(shell git describe --abbrev=0) 
COMMIT_DATE := $(shell git show -s --format=%cd --date=format:'-%y-%m-%d' $(GIT_HASH)) 
 | 
.i.e: ‘fw-v.1.13.0-8c0ab15-master-10_1_2020.hex’. 
沒有留言:
張貼留言