Skip to content

Commit

Permalink
Add git hash to version info
Browse files Browse the repository at this point in the history
  • Loading branch information
proller committed Apr 13, 2018
1 parent 8a612c8 commit 5b19d89
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions dbms/cmake/version.cmake
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
1 change: 1 addition & 0 deletions dbms/src/Common/config_build.cpp.in
Original file line number Diff line number Diff line change
Expand Up @@ -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@",
Expand Down
1 change: 1 addition & 0 deletions dbms/src/Common/config_version.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,4 @@
#cmakedefine VERSION_STRING "@VERSION_STRING@"
#cmakedefine VERSION_FULL "@VERSION_FULL@"
#cmakedefine VERSION_DESCRIBE "@VERSION_DESCRIBE@"
#cmakedefine VERSION_GITHASH "@VERSION_GITHASH@"
3 changes: 2 additions & 1 deletion release_lib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 5b19d89

Please sign in to comment.