File: gitrev.sh

package info (click to toggle)
kodi 2:17.6+dfsg1-4
  • links: PTS, VCS
  • area: main
  • in suites: buster, sid
  • size: 87,148 kB
  • sloc: cpp: 588,459; xml: 58,591; ansic: 42,735; sh: 12,932; makefile: 4,785; python: 2,803; objc: 1,075; perl: 1,041; cs: 624; java: 500; asm: 294; sed: 16
file content (15 lines) | stat: -rwxr-xr-x 278 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#!/bin/sh
N=0
R=""
MAX=50
while [ $N -le $MAX ] && [ "x$R" = "x" ]
do
  R=$(git log -1 --pretty=format:%b HEAD~$N | awk '$2 ~ /@([0-9]+)$/ {sub(".*@", "", $2); print $2}')
  N=$(($N+1))
done
if [ "x$R" != "x" ]; then
  if [ $N -gt 1 ]; then
    R=$R\+$((N-1))
  fi
  echo $R
fi