version.cmake: --no-abbrev-commit cause github has allowAnySHA1InWant

Some git servers like Github allow fetching by full length SHA so this
useful information to share.

(Others forbid this entirely, see last page of `git help fetch-pack`)

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
This commit is contained in:
Marc Herbert 2022-01-18 20:02:28 +00:00 committed by Liam Girdwood
parent 23d2a01777
commit d722ee15b1
1 changed files with 7 additions and 4 deletions

View File

@ -24,14 +24,17 @@ string(TIMESTAMP build_start_time UTC)
message(STATUS "SOF version.cmake starting at ${build_start_time} UTC")
# Most CI engines test a temporary merge of the pull request with a
# moving target: the latest target branch. In that case the SHA version
# gathered by git describe is disposable hence useless. Only the
# --parents SHA are useful.
# moving target: the latest target branch. In that case the HEAD SHA is
# very volatile and the --parents are much more relevant and useful.
#
# --no-abbrev-commit because some git servers like github allow fetching
# by full length SHA (others forbid this entirely, see last page of
# `git help fetch-pack`)
message(STATUS "Building SOF git commit with parent(s):")
# Note execute_process() failures are ignored by default (missing git...)
execute_process(
COMMAND git -C "${CMAKE_CURRENT_SOURCE_DIR}"
log --parents --oneline --decorate -n 1 HEAD
log --parents --no-abbrev-commit --decorate -n 1 HEAD
)