[PATCH] D63657: [benchmark] Change GetGitVersion to only check "dirty" when a tag is found
Andrew Ng via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Sat Jun 22 11:57:02 PDT 2019
andrewng updated this revision to Diff 206125.
andrewng edited the summary of this revision.
andrewng added a comment.
Simplified as suggested by reviewer.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D63657/new/
https://reviews.llvm.org/D63657
Files:
llvm/utils/benchmark/cmake/GetGitVersion.cmake
Index: llvm/utils/benchmark/cmake/GetGitVersion.cmake
===================================================================
--- llvm/utils/benchmark/cmake/GetGitVersion.cmake
+++ llvm/utils/benchmark/cmake/GetGitVersion.cmake
@@ -20,7 +20,7 @@
function(get_git_version var)
if(GIT_EXECUTABLE)
- execute_process(COMMAND ${GIT_EXECUTABLE} describe --match "v[0-9]*.[0-9]*.[0-9]*" --abbrev=8
+ execute_process(COMMAND ${GIT_EXECUTABLE} describe --match "v[0-9]*.[0-9]*.[0-9]*" --abbrev=8 --dirty
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
RESULT_VARIABLE status
OUTPUT_VARIABLE GIT_VERSION
@@ -31,20 +31,6 @@
string(STRIP ${GIT_VERSION} GIT_VERSION)
string(REGEX REPLACE "-[0-9]+-g" "-" GIT_VERSION ${GIT_VERSION})
endif()
-
- # Work out if the repository is dirty
- execute_process(COMMAND ${GIT_EXECUTABLE} update-index -q --refresh
- WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
- OUTPUT_QUIET
- ERROR_QUIET)
- execute_process(COMMAND ${GIT_EXECUTABLE} diff-index --name-only HEAD --
- WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
- OUTPUT_VARIABLE GIT_DIFF_INDEX
- ERROR_QUIET)
- string(COMPARE NOTEQUAL "${GIT_DIFF_INDEX}" "" GIT_DIRTY)
- if (${GIT_DIRTY})
- set(GIT_VERSION "${GIT_VERSION}-dirty")
- endif()
else()
set(GIT_VERSION "v0.0.0")
endif()
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D63657.206125.patch
Type: text/x-patch
Size: 1421 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190622/89eb1d88/attachment.bin>
More information about the llvm-commits
mailing list