Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(cmake): properly exclude prereleases when fetching latest tag from cmake #2550

Merged
merged 2 commits into from
May 17, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions cmake/modules/GetGitRevisionDescription.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -91,15 +91,16 @@ function(git_get_latest_tag _var)
find_package(Git QUIET)
endif()

# We use git describe --tags `git rev-list --tags --max-count=1`
# We use git describe --tags `git rev-list --exclude "*.*.*-*" --tags --max-count=1`
# Note how we eclude prereleases tags (the ones with "-alphaX")
execute_process(COMMAND
"${GIT_EXECUTABLE}"
rev-list
--exclude "*.*.*-*"
--tags
--max-count=1
WORKING_DIRECTORY
"${CMAKE_CURRENT_SOURCE_DIR}"
COMMAND tail -n1
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we ever needed it since we use max-count=1; it was probably a leftover.

RESULT_VARIABLE
res
OUTPUT_VARIABLE
Expand Down