You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by nk...@apache.org on 2016/02/09 00:07:46 UTC

[5/7] lucene-solr git commit: LUCENE-6938: Improve output of Git Hash if no GIT available or no GIT checkout (this restores previous behaviour)

LUCENE-6938: Improve output of Git Hash if no GIT available or no GIT checkout (this restores previous behaviour)


Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/d4a8bbbf
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/d4a8bbbf
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/d4a8bbbf

Branch: refs/heads/branch_5_4
Commit: d4a8bbbf2b1effc2f166530fcd4720127eafc9a9
Parents: 016b266
Author: Uwe Schindler <us...@apache.org>
Authored: Sun Jan 24 00:03:25 2016 +0100
Committer: nknize <nk...@apache.org>
Committed: Mon Feb 8 17:04:18 2016 -0600

----------------------------------------------------------------------
 lucene/common-build.xml | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/d4a8bbbf/lucene/common-build.xml
----------------------------------------------------------------------
diff --git a/lucene/common-build.xml b/lucene/common-build.xml
index d6167c1..890a50b 100644
--- a/lucene/common-build.xml
+++ b/lucene/common-build.xml
@@ -632,13 +632,22 @@
     <attribute name="manifest.file" default="${manifest.file}"/>
     <element name="additional-manifest-attributes" optional="true"/>
     <sequential>
-      <exec dir="." executable="${git.exe}" outputproperty="checkoutid" failifexecutionfails="false">
+      <local name="-checkoutid"/>
+      <local name="-giterr"/>
+      <local name="checkoutid"/>
+      
+      <!-- If possible, include the GIT hash into manifest: -->
+      <exec dir="." executable="${git.exe}" outputproperty="-checkoutid" errorproperty="-giterr" failifexecutionfails="false">
         <arg value="log"/>
-        <arg value="--format='%H'"/>
+        <arg value="--format=%H"/>
         <arg value="-n"/>
         <arg value="1"/>
       </exec>
+      <condition property="checkoutid" value="${-checkoutid}" else="unknown">
+        <matches pattern="^[0-9a-z]+$" string="${-checkoutid}" casesensitive="false" multiline="true"/>
+      </condition>
 
+      <!-- create manifest: -->
       <manifest file="@{manifest.file}">
         <!--
         http://java.sun.com/j2se/1.5.0/docs/guide/jar/jar.html#JAR%20Manifest