mini/describesimple.sh
Sven Peter 5f4015344e fix describe scripts
negative effects: changes to, say, skyeye-starlet will also change the
the git version thing. we should create a seperate repository for each
bootmii part.
2009-05-15 05:35:18 -07:00

18 lines
612 B
Bash
Executable File

#!/bin/sh
# Check for git and a git repo.
if head=`git rev-parse --verify HEAD 2>/dev/null`; then
comm=`git log --pretty=oneline -n1 | awk ' { print $1 }'`
if tagver=`git describe --exact-match --match bootmii-\* $comm 2>/dev/null`; then
printf "%s" "BootMii v"`printf "%s" $tagver | awk '{ sub (/bootmii-/, ""); print;}'`
else
printf "%s" ""`printf "%s" \`git describe --abbrev=4 --match bootmii-\* $comm | awk '{ sub (/bootmii-/, ""); print;}'\``
fi
# Are there uncommitted changes?
git update-index --refresh --unmerged > /dev/null
git diff-index --quiet HEAD ../mini || printf "%s" '*'
fi
echo