From 8b3d37d3925fcec0abc0b8539724381c9e98c1c3 Mon Sep 17 00:00:00 2001 From: Michael Davidsaver Date: Fri, 10 Jul 2015 14:19:44 -0400 Subject: [PATCH] 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 --- src/tools/genVersionHeader.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tools/genVersionHeader.pl b/src/tools/genVersionHeader.pl index f078ad4f6..5851ea831 100644 --- a/src/tools/genVersionHeader.pl +++ b/src/tools/genVersionHeader.pl @@ -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 '') {