diff --git a/dbms/cmake/version.cmake b/dbms/cmake/version.cmake index b2fb0f2ad71..7165b18bf89 100644 --- a/dbms/cmake/version.cmake +++ b/dbms/cmake/version.cmake @@ -1,6 +1,7 @@ # This strings autochanged from release_lib.sh: set(VERSION_DESCRIBE v1.1.54377-testing) set(VERSION_REVISION 54377) +set(VERSION_GITHASH 8a612c8e939a9ca200a857ffca58d90e56115e21) # end of autochange set (VERSION_MAJOR 1) diff --git a/dbms/src/Common/config_build.cpp.in b/dbms/src/Common/config_build.cpp.in index 6d3a8e21959..fee7c868384 100644 --- a/dbms/src/Common/config_build.cpp.in +++ b/dbms/src/Common/config_build.cpp.in @@ -6,6 +6,7 @@ const char * auto_config_build[] { "VERSION_FULL", "@VERSION_FULL@", "VERSION_DESCRIBE", "@VERSION_DESCRIBE@", + "VERSION_GITHASH", "@VERSION_GITHASH@", "BUILD_DATE", "@BUILD_DATE@", "BUILD_TYPE", "@CMAKE_BUILD_TYPE@", "SYSTEM", "@CMAKE_SYSTEM@", diff --git a/dbms/src/Common/config_version.h.in b/dbms/src/Common/config_version.h.in index 2dd84dd8776..bef46ab3eea 100644 --- a/dbms/src/Common/config_version.h.in +++ b/dbms/src/Common/config_version.h.in @@ -16,3 +16,4 @@ #cmakedefine VERSION_STRING "@VERSION_STRING@" #cmakedefine VERSION_FULL "@VERSION_FULL@" #cmakedefine VERSION_DESCRIBE "@VERSION_DESCRIBE@" +#cmakedefine VERSION_GITHASH "@VERSION_GITHASH@" diff --git a/release_lib.sh b/release_lib.sh index 68af393c5d5..e9c3324db4c 100644 --- a/release_lib.sh +++ b/release_lib.sh @@ -47,7 +47,8 @@ function gen_revision_author { git tag -a "$tag" -m "$tag" git_describe=`git describe` - sed -i -- "s/VERSION_REVISION .*)/VERSION_REVISION $REVISION)/g;s/VERSION_DESCRIBE .*)/VERSION_DESCRIBE $git_describe)/g" dbms/cmake/version.cmake + git_hash=`git rev-parse HEAD` + sed -i -- "s/VERSION_REVISION .*)/VERSION_REVISION $REVISION)/g;s/VERSION_DESCRIBE .*)/VERSION_DESCRIBE $git_describe)/g;s/VERSION_GITHASH .*)/VERSION_GITHASH $git_hash)/g;" dbms/cmake/version.cmake gen_changelog "$REVISION" "" "$AUTHOR" "" git commit -m "$auto_message [$REVISION]" dbms/cmake/version.cmake debian/changelog