annotate get_version.sh @ 10:6212933b1a83 draft

Uploaded
author petrn
date Thu, 02 Jan 2020 10:23:49 +0000
parents 94877d063270
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
2
94877d063270 Uploaded
petrn
parents:
diff changeset
1 #!/bin/sh
94877d063270 Uploaded
petrn
parents:
diff changeset
2 # this file is copied into ./git/hooks.post-commit and post-checkout
94877d063270 Uploaded
petrn
parents:
diff changeset
3 branch=$(git rev-parse --abbrev-ref HEAD)
94877d063270 Uploaded
petrn
parents:
diff changeset
4 shorthash=$(git log --pretty=format:'%h' -n 1)
94877d063270 Uploaded
petrn
parents:
diff changeset
5 revcount=$(git log --oneline | wc -l)
94877d063270 Uploaded
petrn
parents:
diff changeset
6 tag=$(git describe --tags --abbrev=0)
94877d063270 Uploaded
petrn
parents:
diff changeset
7 echo "version:" ${tag}"-"${revcount}"("$shorthash") branch:" $branch > version_info.txt
94877d063270 Uploaded
petrn
parents:
diff changeset
8