From 3d136a28a00ff4ce1c7a5a8c93243fd617e887f5 Mon Sep 17 00:00:00 2001 From: Geoffrey McRae Date: Thu, 28 Mar 2019 12:24:38 +1100 Subject: [PATCH] [all] added pre-commit script and VERSION This script belongs in .git/hooks/ to bump the version each commit. --- VERSION | 2 +- client/CMakeLists.txt | 2 +- pre-commit | 7 +++++++ 3 files changed, 9 insertions(+), 2 deletions(-) create mode 100755 pre-commit diff --git a/VERSION b/VERSION index 6097017a..56851ea5 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -a12-110-g7cbaf8b5be+1 \ No newline at end of file +a12-111-gdb398d41a0+1 \ No newline at end of file diff --git a/client/CMakeLists.txt b/client/CMakeLists.txt index 9532583e..1ad50dbe 100644 --- a/client/CMakeLists.txt +++ b/client/CMakeLists.txt @@ -37,7 +37,7 @@ pkg_check_modules(PKGCONFIG REQUIRED ) execute_process( - COMMAND git describe --always --long --dirty --abbrev=10 --tags + COMMAND cat ../VERSION WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} OUTPUT_VARIABLE BUILD_VERSION OUTPUT_STRIP_TRAILING_WHITESPACE diff --git a/pre-commit b/pre-commit new file mode 100755 index 00000000..a131e831 --- /dev/null +++ b/pre-commit @@ -0,0 +1,7 @@ +#!/bin/bash + +( + git describe --always --long --abbrev=10 --tags | tr -d '\n' + echo -n '+1' +) > VERSION +git add VERSION \ No newline at end of file