Correct version extraction when tags are missing

Issue: #55
This commit is contained in:
Diomidis Spinellis 2019-03-25 22:16:02 +02:00
parent e5bc6f1f8f
commit 75cc871a10
1 changed files with 5 additions and 5 deletions

View File

@ -21,12 +21,12 @@
<macrodef name="gitversion" description="Get git version.">
<attribute name="outputproperty"/>
<sequential>
<echo message="git describe --abbrev=6 => '@{outputproperty}'"/>
<echo message="git rev-parse --short=6 => '@{outputproperty}'"/>
<exec executable="git"
failonerror="true"
outputproperty="@{outputproperty}">
<arg value="describe"/>
<arg value="--abbrev=6"/>
<arg value="rev-parse"/>
<arg value="--short=6"/>
<arg value="HEAD"/>
<redirector>
<outputfilterchain>
@ -78,8 +78,8 @@
<target name="version">
<exec executable="git"
outputproperty="VERSION">
<arg value="describe"/>
<arg value="--abbrev=6"/>
<arg value="rev-parse"/>
<arg value="--short=6"/>
<arg value="HEAD"/>
</exec>
<echo>Version is ${VERSION}</echo>