aboutsummaryrefslogtreecommitdiff
path: root/gitrev.sh
diff options
context:
space:
mode:
Diffstat (limited to 'gitrev.sh')
-rwxr-xr-xgitrev.sh15
1 files changed, 15 insertions, 0 deletions
diff --git a/gitrev.sh b/gitrev.sh
new file mode 100755
index 0000000000..a1ade00a18
--- /dev/null
+++ b/gitrev.sh
@@ -0,0 +1,15 @@
+#!/bin/sh
+N=0
+R=""
+MAX=1
+while [[ $N -le $MAX && "x$R" == "x" ]]
+do
+ R=$(git log -1 --pretty=format:%b HEAD~$N | sed -e 's/.*@\([0-9]\+\) .*/\1/')
+ N=$[$N+1]
+done
+if [[ "x$R" != "x" ]]; then
+ if [[ $N > 1 ]]; then
+ R=$R\+$((N-1))
+ fi
+ echo $R
+fi