From 164904d2c8a9beb075f22a05d398dd4aa1e809f4 Mon Sep 17 00:00:00 2001 From: Tom Knot Date: Mon, 21 May 2018 17:46:40 +0200 Subject: [PATCH] Added versioning hooks --- .copy_over_.git/hooks/post-checkout | 14 ++++++++++++++ .copy_over_.git/hooks/post-commit | 3 +++ .copy_over_.git/hooks/post-merge | 3 +++ .copy_over_.git/hooks/pre-checkout | 0 .copy_over_.git/hooks/pre-commit | 15 +++++++++++++++ .copy_over_.git/hooks/pre-merge | 15 +++++++++++++++ version.txt | 1 + 7 files changed, 51 insertions(+) create mode 100644 .copy_over_.git/hooks/post-checkout create mode 100644 .copy_over_.git/hooks/post-commit create mode 100644 .copy_over_.git/hooks/post-merge create mode 100644 .copy_over_.git/hooks/pre-checkout create mode 100644 .copy_over_.git/hooks/pre-commit create mode 100644 .copy_over_.git/hooks/pre-merge create mode 100644 version.txt diff --git a/.copy_over_.git/hooks/post-checkout b/.copy_over_.git/hooks/post-checkout new file mode 100644 index 0000000..8811989 --- /dev/null +++ b/.copy_over_.git/hooks/post-checkout @@ -0,0 +1,14 @@ +#!/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="$REPONAME Branch:[$BRANCH] Release:$LATESTTAG 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/post-commit b/.copy_over_.git/hooks/post-commit new file mode 100644 index 0000000..b6888d3 --- /dev/null +++ b/.copy_over_.git/hooks/post-commit @@ -0,0 +1,3 @@ +#!/bin/bash + +git update-index --assume-unchanged $FILENAME \ No newline at end of file diff --git a/.copy_over_.git/hooks/post-merge b/.copy_over_.git/hooks/post-merge new file mode 100644 index 0000000..b6888d3 --- /dev/null +++ b/.copy_over_.git/hooks/post-merge @@ -0,0 +1,3 @@ +#!/bin/bash + +git update-index --assume-unchanged $FILENAME \ No newline at end of file diff --git a/.copy_over_.git/hooks/pre-checkout b/.copy_over_.git/hooks/pre-checkout new file mode 100644 index 0000000..e69de29 diff --git a/.copy_over_.git/hooks/pre-commit b/.copy_over_.git/hooks/pre-commit new file mode 100644 index 0000000..298995f --- /dev/null +++ b/.copy_over_.git/hooks/pre-commit @@ -0,0 +1,15 @@ +#!/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="$REPONAME Branch:[$BRANCH] Release:$LATESTTAG PrecedingRevision:$REVCOUNT($SHORTHASH)" +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 new file mode 100644 index 0000000..298995f --- /dev/null +++ b/.copy_over_.git/hooks/pre-merge @@ -0,0 +1,15 @@ +#!/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="$REPONAME Branch:[$BRANCH] Release:$LATESTTAG PrecedingRevision:$REVCOUNT($SHORTHASH)" +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 new file mode 100644 index 0000000..4573589 --- /dev/null +++ b/version.txt @@ -0,0 +1 @@ +neuron-kernel Branch:[master] Release: PrecedingRevision:33(0bace6a) -- 2.34.1