From 8334bb579c4e639c0e22fc80ebe94d1e87f69a5d Mon Sep 17 00:00:00 2001 From: Pierre Moreau Date: Sat, 16 Jun 2018 09:29:18 +0200 Subject: [PATCH] Hide commit signature information when fetching commit hash MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit If someone configures git to always show a commit’s signing information, this breaks the definition of GitVersion in revision.h: ``` #ifndef ASSIMP_REVISION_H_INC #define ASSIMP_REVISION_H_INC #define GitVersion 0xgpg: Signature faite le Fri 15 Jun 2018 20:39:53 CEST gpg: avec la clef RSA 4AEE18F83AFDEB23 gpg: Impossible de vérifier la signature : Pas de clef publique 878b4b2c #define GitBranch "master" #endif // ASSIMP_REVISION_H_INC ``` This can be avoided by passing the `--no-show-signature` to the `git log` command for retrieving the hash. --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index d5a7bc278..9d13db57a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -152,7 +152,7 @@ EXECUTE_PROCESS( # Get the latest abbreviated commit hash of the working branch EXECUTE_PROCESS( - COMMAND git log -1 --format=%h + COMMAND git log -1 --format=%h --no-show-signature WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} OUTPUT_VARIABLE GIT_COMMIT_HASH OUTPUT_STRIP_TRAILING_WHITESPACE