7 probed
=${p%/git-active/bin}
8 if test "$probed" != "$p"
20 for v
in maint master next jch seen
23 test -f "$inst_prefix/git-$v/bin/git" &&
24 "$inst_prefix/git-$v/bin/git" version
27 if version
=$
(expr "$installed" : '.*\.g\([0-9a-f]*\)$')
30 elif version
=$
(expr "$installed" : '.*\.g\([0-9a-f]*\)\.dirty$')
32 dirty
=" (with changes)"
33 elif version
=v$
(expr "$installed" : \
34 'git version \(.*\)\.rc[0-9]*$')
36 version
="$version"-$
(expr "$installed" : \
37 'git version .*\.\(rc[0-9]*\)$')
39 version
=v$
(expr "$installed" : 'git version \(.*\)')
42 version
=$
(git rev-parse
--verify "$version^0" 2>/dev
/null
)
43 revision
=$
(git show-ref
-s --verify "refs/heads/$v")
44 if test "z$version" = "z$revision"
51 installed
=" $installed$dirty"
53 elif test -z "$version"
55 in="\e[41;37m" out
="\e[m"
58 installed
=$
(git describe
--long $version)
63 installed
="$installed$dirty"
65 in="\e[41;37m" out
="\e[m" installed
=" $installed"
67 output
="$output${output:+$LF}"
68 output
="$output$in$v$out$installed $(git describe --long refs/heads/$v)"
72 echo "$output" |
sha1sum |
sed -e 's/ .*//'