Fix git version generation for non-tagged commits