-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
AutoRevision: Pick the latest tag in branch, not overall
AutoRevision.cmake was using the latest tag created by git, which is problematic when running two branches in parallel. Always use the latest tag in the current branch instead. (cherry picked from commit 6e41925)
- Loading branch information
Showing
1 changed file
with
5 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,7 @@ | ||
# SPDX-License-Identifier: GPLv3-or-later | ||
# SPDX-FileCopyrightText: James Robertson <[email protected]> | ||
# SPDX-FileCopyrightText: Louis Moureaux <[email protected]> | ||
|
||
# This file runs a collection of git commands to help automate the process | ||
# of generating the build revision. It takes an update to 3 files by hand | ||
# to do it manually and automates it. | ||
|
@@ -30,28 +34,10 @@ if (ok) | |
endif() | ||
endif() | ||
|
||
if (ok) | ||
# Get a temp value of the full commit hash of the latest tag that is active | ||
execute_process( | ||
COMMAND ${GIT_EXECUTABLE} --git-dir=${CMAKE_SOURCE_DIR}/.git rev-list --tags --max-count=1 | ||
OUTPUT_VARIABLE hash | ||
OUTPUT_STRIP_TRAILING_WHITESPACE | ||
RESULT_VARIABLE STATUS | ||
ERROR_QUIET) | ||
|
||
if (STATUS EQUAL 0) | ||
message(STATUS "Last tag commit hash: ${hash}") | ||
else() | ||
# Can't use git | ||
message(STATUS "Could not find a git tag") | ||
set(ok false) | ||
endif() | ||
endif() | ||
|
||
if (ok) | ||
# Use the temp value to get the latest revision tag | ||
execute_process( | ||
COMMAND ${GIT_EXECUTABLE} --git-dir=${CMAKE_SOURCE_DIR}/.git describe --tags ${hash} | ||
COMMAND ${GIT_EXECUTABLE} --git-dir=${CMAKE_SOURCE_DIR}/.git describe --tags --abbrev=0 | ||
OUTPUT_VARIABLE FC21_REV_TAG | ||
OUTPUT_STRIP_TRAILING_WHITESPACE | ||
RESULT_VARIABLE STATUS | ||
|