more robust approach to revision switching in git, and misc clean-ups