Add support for bare git repos

Also replaced the porcelaine "git show" with "git parse-rev"
and tweaked the version selector.

Only casually tested...