From d722ee15b153848ec4677949927d7a3c53806faf Mon Sep 17 00:00:00 2001 From: Marc Herbert Date: Tue, 18 Jan 2022 20:02:28 +0000 Subject: [PATCH] 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 --- scripts/cmake/version.cmake | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/scripts/cmake/version.cmake b/scripts/cmake/version.cmake index 2156ad0a3..bc0e5214b 100644 --- a/scripts/cmake/version.cmake +++ b/scripts/cmake/version.cmake @@ -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 )