7 probed
=${p%/git-active/bin}
8 if test "$probed" != "$p"
17 for v
in maint master next pu jch
20 test -f "$inst_prefix/git-$v/bin/git" &&
21 "$inst_prefix/git-$v/bin/git" version
24 if version
=$
(expr "$installed" : '.*\.g\([0-9a-f]*\)$')
27 elif version
=$
(expr "$installed" : '.*\.g\([0-9a-f]*\)\.dirty$')
29 dirty
=" (with changes)"
30 elif version
=v$
(expr "$installed" : \
31 'git version \(.*\)\.rc[0-9]*$')
33 version
="$version"-$
(expr "$installed" : \
34 'git version .*\.\(rc[0-9]*\)$')
36 version
=v$
(expr "$installed" : 'git version \(.*\)')
39 version
=$
(git rev-parse
--verify "$version^0" 2>/dev
/null
)
40 revision
=$
(git show-ref
-s --verify "refs/heads/$v")
41 if test "z$version" = "z$revision"
45 elif test -z "$version"
47 in="\e[41;37m" out
="\e[m"
50 installed
=$
(git describe
$version)
55 installed
="$installed$dirty"
57 in="\e[41;37m" out
="\e[m" installed
=" $installed"
59 echo "$in$v$out $(git describe refs/heads/$v)$installed"