fixed: whoops, might want to actually look back a few commits
[vuplus_xbmc] / gitrev.sh
1 #!/bin/sh
2 N=0
3 R=""
4 MAX=50
5 while [[ $N -le $MAX && "x$R" == "x" ]]
6 do
7   R=$(git log -1 --pretty=format:%b HEAD~$N | sed -e 's/.*@\([0-9]\+\) .*/\1/')
8   N=$[$N+1]
9 done
10 if [[ "x$R" != "x" ]]; then
11   if [[ $N > 1 ]]; then
12     R=$R\+$((N-1))
13   fi
14   echo $R
15 fi