Build: Rework git version detection