From 525aefdc37ee158a4bfd352de18e846b9a6f5fcc Mon Sep 17 00:00:00 2001 From: Tom Knot Date: Tue, 22 May 2018 16:28:27 +0200 Subject: [PATCH] Updated versioning hooks --- .copy_over_.git/hooks/post-checkout | 14 -------------- .copy_over_.git/hooks/pre-commit | 3 ++- .copy_over_.git/hooks/pre-merge | 3 ++- version.txt | 2 +- 4 files changed, 5 insertions(+), 17 deletions(-) delete mode 100644 .copy_over_.git/hooks/post-checkout diff --git a/.copy_over_.git/hooks/post-checkout b/.copy_over_.git/hooks/post-checkout deleted file mode 100644 index b698e8e..0000000 --- a/.copy_over_.git/hooks/post-checkout +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/bash - -FILENAME='version.txt' - -exec 1>&2 -REPONAME=`basename \`git rev-parse --show-toplevel\`` -BRANCH=`git rev-parse --abbrev-ref HEAD` -SHORTHASH=`git log --pretty=format:'%h' -n 1` -REVCOUNT=`git log --oneline | wc -l` -LATESTTAG=`git describe --tags --abbrev=0` - -VERSION="Repository:$REPONAME ActiveBranch:[$BRANCH] `if [ -n \"$LATESTTAG\" ]; then echo \"PrecedingRelease:$LATESTTAG\"; fi` PrecedingRevision:$REVCOUNT($SHORTHASH)" -echo $VERSION > $FILENAME -git update-index --assume-unchanged $FILENAME \ No newline at end of file diff --git a/.copy_over_.git/hooks/pre-commit b/.copy_over_.git/hooks/pre-commit index 7170dd4..15d1f15 100644 --- a/.copy_over_.git/hooks/pre-commit +++ b/.copy_over_.git/hooks/pre-commit @@ -7,9 +7,10 @@ REPONAME=`basename \`git rev-parse --show-toplevel\`` BRANCH=`git rev-parse --abbrev-ref HEAD` SHORTHASH=`git log --pretty=format:'%h' -n 1` REVCOUNT=`git log --oneline | wc -l` +CURRENTTIME=`date` LATESTTAG=`git describe --tags --abbrev=0` -VERSION="Repository:$REPONAME ActiveBranch:[$BRANCH] `if [ -n \"$LATESTTAG\" ]; then echo \"PrecedingRelease:$LATESTTAG\"; fi` PrecedingRevision:$REVCOUNT($SHORTHASH)" +VERSION="Repository:$REPONAME ActiveBranch:[$BRANCH] `if [ -n \"$LATESTTAG\" ]; then echo \"PrecedingRelease:$LATESTTAG\"; fi` PrecedingRevision:$REVCOUNT($SHORTHASH) LatestCommit:$CURRENTTIME" echo $VERSION > $FILENAME git update-index --no-assume-unchanged $FILENAME git add $FILENAME \ No newline at end of file diff --git a/.copy_over_.git/hooks/pre-merge b/.copy_over_.git/hooks/pre-merge index 7170dd4..15d1f15 100644 --- a/.copy_over_.git/hooks/pre-merge +++ b/.copy_over_.git/hooks/pre-merge @@ -7,9 +7,10 @@ REPONAME=`basename \`git rev-parse --show-toplevel\`` BRANCH=`git rev-parse --abbrev-ref HEAD` SHORTHASH=`git log --pretty=format:'%h' -n 1` REVCOUNT=`git log --oneline | wc -l` +CURRENTTIME=`date` LATESTTAG=`git describe --tags --abbrev=0` -VERSION="Repository:$REPONAME ActiveBranch:[$BRANCH] `if [ -n \"$LATESTTAG\" ]; then echo \"PrecedingRelease:$LATESTTAG\"; fi` PrecedingRevision:$REVCOUNT($SHORTHASH)" +VERSION="Repository:$REPONAME ActiveBranch:[$BRANCH] `if [ -n \"$LATESTTAG\" ]; then echo \"PrecedingRelease:$LATESTTAG\"; fi` PrecedingRevision:$REVCOUNT($SHORTHASH) LatestCommit:$CURRENTTIME" echo $VERSION > $FILENAME git update-index --no-assume-unchanged $FILENAME git add $FILENAME \ No newline at end of file diff --git a/version.txt b/version.txt index b2328ce..54a8e69 100644 --- a/version.txt +++ b/version.txt @@ -1 +1 @@ -Repository:neuron-kernel ActiveBranch:[master] PrecedingRevision:34(6ef8ca8) +Repository:neuron-kernel ActiveBranch:[master] PrecedingRevision:35(f15308f) LatestCommit:Tue May 22 16:28:28 CEST 2018 -- 2.34.1