put git version detection code into a sub