PageRenderTime 5ms CodeModel.GetById 2ms app.highlight 1ms RepoModel.GetById 1ms app.codeStats 0ms

/gitrev.sh

http://github.com/xbmc/xbmc
Shell | 15 lines | 14 code | 0 blank | 1 comment | 5 complexity | 6dcf67ef8b7d3312cade3f3c847c1694 MD5 | raw file
 1#!/bin/sh
 2N=0
 3R=""
 4MAX=50
 5while [ $N -le $MAX ] && [ "x$R" = "x" ]
 6do
 7  R=$(git log -1 --pretty=format:%b HEAD~$N | awk '$2 ~ /@([0-9]+)$/ {sub(".*@", "", $2); print $2}')
 8  N=$(($N+1))
 9done
10if [ "x$R" != "x" ]; then
11  if [ $N -gt 1 ]; then
12    R=$R\+$((N-1))
13  fi
14  echo $R
15fi