genVersionHeader: work with git repo w/o tags

--always is necessary for (new) repositories w/o any tags.
--abbrev=20 to get more than the default 7 characters of the hash
This commit is contained in:
Michael Davidsaver
2015-07-10 14:19:44 -04:00
parent ed4bcd831f
commit 8b3d37d392

View File

@@ -72,7 +72,7 @@ if (!$vcs && -d "$opt_t/.git") { # Git
# v1-4-abcdef-dirty
# is 4 commits after tag 'v1' with short hash abcdef
# with uncommited modifications
my $result = `git describe --tags --dirty`;
my $result = `git describe --always --tags --dirty --abbrev=20`;
chomp $result;
print "== git describe:\n$result\n==\n" if $opt_v;
if (!$? && $result ne '') {