3 for v
in maint master next pu jch
5 installed
=$
($HOME/git-
$v/bin
/git version
)
7 if version
=$
(expr "$installed" : '.*\.g\([0-9a-f]*\)$')
10 elif version
=$
(expr "$installed" : '.*\.g\([0-9a-f]*\)\.dirty$')
13 elif version
=v$
(expr "$installed" : \
14 'git version \(.*\)\.rc[0-9]*$')
16 version
="$version"-$
(expr "$installed" : \
17 'git version .*\.\(rc[0-9]*\)$')
19 version
=v$
(expr "$installed" : 'git version \(.*\)')
22 version
=$
(git rev-parse
--verify "$version^0" 2>/dev
/null
)
23 revision
=$
(git show-ref
-s --verify "refs/heads/$v")
24 if test "z$version" = "z$revision"
27 installed
=${dirty:+" (with changes)"}
29 installed
=$
(git describe
$version)
32 installed
="$installed.dirty"
34 in="\e[41;37m" out
="\e[m" installed
=" $installed"
36 echo "$in$v$out $(git describe refs/heads/$v)$installed"