From 9a81272a89ff1b88d16f048d3f665a409041d7a3 Mon Sep 17 00:00:00 2001 From: xl-sec <31486311+xl-sec@users.noreply.github.com> Date: Wed, 10 Jul 2024 16:24:50 +0200 Subject: [PATCH] cmake: Correctly fetch FLB_GIT_HASH from signed commit If git is configured to show the signature in `git log` then the extraction of the commit hash breaks. So instead call `git log` with the `-c log.showSignature=false` config options. Signed-off-by: xl-sec <31486311+xl-sec@users.noreply.github.com> --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index f96bd0c2b91..d328b910bf4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -285,7 +285,7 @@ endif () find_package(Git) # If we do not have Git or this is not a Git repo or another error this just is ignored and we have no output at runtime. execute_process(COMMAND - "${GIT_EXECUTABLE}" log -1 --format=%H + "${GIT_EXECUTABLE}" -c log.showSignature=false log -1 --format=%H WORKING_DIRECTORY "${FLB_ROOT}" OUTPUT_VARIABLE FLB_GIT_HASH ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE)