Added versioning hooks
authorTom Knot <tomasknot@gmail.com>
Mon, 21 May 2018 15:46:40 +0000 (17:46 +0200)
committerTom Knot <tomasknot@gmail.com>
Mon, 21 May 2018 15:46:40 +0000 (17:46 +0200)
.copy_over_.git/hooks/post-checkout [new file with mode: 0644]
.copy_over_.git/hooks/post-commit [new file with mode: 0644]
.copy_over_.git/hooks/post-merge [new file with mode: 0644]
.copy_over_.git/hooks/pre-checkout [new file with mode: 0644]
.copy_over_.git/hooks/pre-commit [new file with mode: 0644]
.copy_over_.git/hooks/pre-merge [new file with mode: 0644]
version.txt [new file with mode: 0644]

diff --git a/.copy_over_.git/hooks/post-checkout b/.copy_over_.git/hooks/post-checkout
new file mode 100644 (file)
index 0000000..8811989
--- /dev/null
@@ -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 (file)
index 0000000..b6888d3
--- /dev/null
@@ -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 (file)
index 0000000..b6888d3
--- /dev/null
@@ -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 (file)
index 0000000..e69de29
diff --git a/.copy_over_.git/hooks/pre-commit b/.copy_over_.git/hooks/pre-commit
new file mode 100644 (file)
index 0000000..298995f
--- /dev/null
@@ -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 (file)
index 0000000..298995f
--- /dev/null
@@ -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 (file)
index 0000000..4573589
--- /dev/null
@@ -0,0 +1 @@
+neuron-kernel Branch:[master] Release: PrecedingRevision:33(0bace6a)