diff --git a/cmake/modules/GitInfo.cmake b/cmake/modules/GitInfo.cmake index 3907760d385b..e83b23501519 100644 --- a/cmake/modules/GitInfo.cmake +++ b/cmake/modules/GitInfo.cmake @@ -1,7 +1,7 @@ # Get the current commit ref if(NOT GIT_DESCRIBE) execute_process( - COMMAND git describe --tags --always --dirty=-modified + COMMAND git describe --tags --always --first-parent --dirty=-modified WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}" OUTPUT_VARIABLE GIT_DESCRIBE OUTPUT_STRIP_TRAILING_WHITESPACE diff --git a/tools/deploy.py b/tools/deploy.py index 7b2861480cd1..1ddf72898e22 100644 --- a/tools/deploy.py +++ b/tools/deploy.py @@ -68,7 +68,13 @@ def git_info(info, path="."): elif info == "describe": # A dirty git state should only be possible on local builds, but since # this script may be used locally we'll add it here. - cmd = ("git", "describe", "--always", "--dirty=-modified") + cmd = ( + "git", + "describe", + "--always", + "--first-parent", + "--dirty=-modified", + ) else: raise ValueError("Invalid git info type!")