Improve git version detection