scmversion: Add date

This commit is contained in:
Connor McLaughlin
2020-08-20 00:43:07 +10:00
parent 71a38adbc7
commit e3e8e47ffc
3 changed files with 7 additions and 2 deletions

View File

@ -4,8 +4,9 @@ VERSION_FILE="scmversion.cpp"
HASH=$(git rev-parse HEAD)
BRANCH=$(git rev-parse --abbrev-ref HEAD | tr -d '\r\n')
TAG=$(git describe --tags --dirty --exclude latest | tr -d '\r\n')
DATE=$(git log -1 --date=iso8601-strict --format=%cd)
SIGNATURE_LINE="// ${HASH} ${BRANCH} ${TAG}"
SIGNATURE_LINE="// ${HASH} ${BRANCH} ${TAG} ${DATE}"
if [ -f $VERSION_FILE ]; then
EXISTING_LINE=$(head -n1 $VERSION_FILE | tr -d '\n')
@ -22,6 +23,7 @@ ${SIGNATURE_LINE}
const char* g_scm_hash_str = "${HASH}";
const char* g_scm_branch_str = "${BRANCH}";
const char* g_scm_tag_str = "${TAG}";
const char* g_scm_date_str = "${DATE}";
EOF