From: Tom Knot Date: Mon, 21 May 2018 15:46:40 +0000 (+0200) Subject: Added versioning hooks X-Git-Url: http://git.graph-it.com/?a=commitdiff_plain;h=164904d2c8a9beb075f22a05d398dd4aa1e809f4;p=graphit%2Funipi-kernel.git Added versioning hooks --- 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)