diff get_version.sh @ 8:3bc73f5dc785 draft

Uploaded
author petrn
date Fri, 20 Dec 2019 14:17:59 +0000
parents 94877d063270
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/get_version.sh	Fri Dec 20 14:17:59 2019 +0000
@@ -0,0 +1,8 @@
+#!/bin/sh
+# this file is copied into ./git/hooks.post-commit and post-checkout
+branch=$(git rev-parse --abbrev-ref HEAD)
+shorthash=$(git log --pretty=format:'%h' -n 1)
+revcount=$(git log --oneline | wc -l)
+tag=$(git describe --tags --abbrev=0)
+echo  "version:" ${tag}"-"${revcount}"("$shorthash") branch:" $branch > version_info.txt
+