Skip to content

Commit

Permalink
Don't use the git revision count in the version tag
Browse files Browse the repository at this point in the history
GitHub runners only checkout the particular revision that's going to be built
instead of the whole tree, which results in the revision count always being set
to 1. The short revision checksum is enough anyway.
  • Loading branch information
lighterowl committed Jan 17, 2020
1 parent e8007ad commit 146be40
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 11 deletions.
11 changes: 2 additions & 9 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,6 @@ set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD_REQUIRED TRUE)
set(CMAKE_CXX_EXTENSIONS FALSE)

execute_process(
COMMAND git rev-list --count HEAD
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
RESULT_VARIABLE GIT_REV_COUNT_RV
OUTPUT_VARIABLE GIT_REV_COUNT
OUTPUT_STRIP_TRAILING_WHITESPACE
)
execute_process(
COMMAND git rev-parse --short HEAD
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
Expand All @@ -23,8 +16,8 @@ set(TSMUXER_RELEASE FALSE)
set(VERSION_NUMBER "2.6.16")
if(${TSMUXER_RELEASE})
set(TSMUXER_VERSION ${VERSION_NUMBER})
elseif(${GIT_REV_COUNT_RV} EQUAL 0 AND ${GIT_REV_SHORT_RV} EQUAL 0)
set(TSMUXER_VERSION "r${GIT_REV_COUNT}.${GIT_REV_SHORT}")
elseif(${GIT_REV_SHORT_RV} EQUAL 0)
set(TSMUXER_VERSION "git-${GIT_REV_SHORT}")
else()
set(TSMUXER_VERSION "${VERSION_NUMBER}-dev")
endif()
Expand Down
3 changes: 1 addition & 2 deletions tsMuxerGUI/tsMuxerGUI.pro
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,8 @@ equals(tsmuxer_release, 1) {
tsmuxer_version = $${version_num}
} else {
system(git status >/dev/null 2>&1) {
git_rev_count = $$system(git rev-list --count HEAD)
git_rev_short = $$system(git rev-parse --short HEAD)
tsmuxer_version = r$${git_rev_count}.$${git_rev_short}
tsmuxer_version = git-$${git_rev_short}
} else {
tsmuxer_version = $${version_num}-dev
}
Expand Down

0 comments on commit 146be40

Please sign in to comment.