git/V
2009-01-23 10:41:41 -08:00

38 lines
906 B
Bash
Executable file
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/bin/sh
for v in maint master next pu jch
do
installed=$($HOME/git-$v/bin/git version)
dirty=
if version=$(expr "$installed" : '.*\.g\([0-9a-f]*\)$')
then
:
elif version=$(expr "$installed" : '.*\.g\([0-9a-f]*\)\.dirty$')
then
dirty=t
elif version=v$(expr "$installed" : \
'git version \(.*\)\.rc[0-9]*$')
then
version="$version"-$(expr "$installed" : \
'git version .*\.\(rc[0-9]*\)$')
else
version=v$(expr "$installed" : 'git version \(.*\)')
fi
version=$(git rev-parse --verify "$version^0" 2>/dev/null)
revision=$(git show-ref -s --verify "refs/heads/$v")
if test "z$version" = "z$revision"
then
in= out=
installed=${dirty:+" (with changes)"}
else
installed=$(git describe $version)
case "$dirty" in
t)
installed="$installed.dirty"
esac
in="" out="" installed=" $installed"
fi
echo "$in$v$out $(git describe refs/heads/$v)$installed"
done