From 0bb43d98c7e02fbb87596a2c9ffa1f0936f91cf2 Mon Sep 17 00:00:00 2001 From: cathugger Date: Wed, 6 May 2020 14:26:15 +0000 Subject: [PATCH] fix GenVersion.cmake * rev-parse --short without any argument defaults to 8 chars * truncation is absolutely moot here * rev-list --abbrev-commit also uses 8 chars by default because of length mismatch (COMMIT - 9 chars, TAGGEDCOMMIT - 8 chars) it always was mismatching them even when it should've been detecting that it's at release tag. cut out explicit lengths and leave everything to use defaults, because they work (they both rely on the same core.abbrev setting so no length mismatch should happen). --- cmake/GenVersion.cmake | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/cmake/GenVersion.cmake b/cmake/GenVersion.cmake index 0e561de40..21aeab9df 100644 --- a/cmake/GenVersion.cmake +++ b/cmake/GenVersion.cmake @@ -30,14 +30,13 @@ # Parts of this file are originally copyright (c) 2012-2013 The Cryptonote developers # Check what commit we're on -execute_process(COMMAND "${GIT}" rev-parse --short=9 HEAD RESULT_VARIABLE RET OUTPUT_VARIABLE COMMIT OUTPUT_STRIP_TRAILING_WHITESPACE) +execute_process(COMMAND "${GIT}" rev-parse --short HEAD RESULT_VARIABLE RET OUTPUT_VARIABLE COMMIT OUTPUT_STRIP_TRAILING_WHITESPACE) if(RET) # Something went wrong, set the version tag to -unknown message(WARNING "Cannot determine current commit. Make sure that you are building either from a Git working tree or from a source archive.") set(VERSIONTAG "unknown") else() - string(SUBSTRING ${COMMIT} 0 9 COMMIT) message(STATUS "You are currently on commit ${COMMIT}") # Get all the tags