Index: trunk/build.xml
===================================================================
--- trunk/build.xml	(revision 6539)
+++ trunk/build.xml	(revision 6540)
@@ -37,8 +37,7 @@
     </target>
     <!--
-      ** Creates the REVISION file to be included in the distribution
-    -->
-    <target name="create-revision">
-        <property name="revision.dir" value="${build.dir}"/>
+      ** Initializes the REVISION.XML file from SVN information
+    -->
+    <target name="init-svn-revision-xml" unless="git_revision">
         <exec append="false" output="REVISION.XML" executable="svn" failifexecutionfails="false">
             <env key="LANG" value="C"/>
@@ -47,4 +46,26 @@
             <arg value="."/>
         </exec>
+    </target>
+    <!--
+      ** Initializes the REVISION.XML file from git information
+    -->
+    <target name="init-git-revision-xml" if="git_revision">
+        <exec append="false" output="REVISION.TMP" executable="git" failifexecutionfails="false">
+            <arg value="log"/>
+            <arg value="-1"/>
+            <arg value="--grep=git-svn-id"/>
+            <arg value="--pretty=format:%ai%n%B"/>
+            <arg value="HEAD"/>
+        </exec>
+        <exec append="false" input="REVISION.TMP" output="REVISION.XML" executable="perl" failifexecutionfails="false">
+            <arg value="tools/gitcommit2xml.pl"/>
+        </exec>
+        <delete file="REVISION.TMP"/>
+    </target>
+    <!--
+      ** Creates the REVISION file to be included in the distribution
+    -->
+    <target name="create-revision" depends="init-svn-revision-xml, init-git-revision-xml">
+        <property name="revision.dir" value="${build.dir}"/>
         <xmlproperty file="REVISION.XML" prefix="version" keepRoot="false" collapseAttributes="true"/>
         <delete file="REVISION.XML"/>
@@ -53,4 +74,5 @@
         </tstamp>
         <property name="version.entry.commit.revision" value="UNKNOWN"/>
+        <property name="version.entry.commit.date" value="UNKNOWN"/>
         <mkdir dir="${revision.dir}"/>
         <!-- add Build-Name: ... when making special builds, e.g. DEBIAN -->
@@ -62,4 +84,7 @@
 </echo>
     </target>
+    <!--
+      ** Check internal XML files against their XSD
+    -->
     <target name="check-schemas">
         <schemavalidate file="data/defaultpresets.xml" >
@@ -70,15 +95,8 @@
         </schemavalidate>
     </target>
+    <!--
+      ** Main target that builds JOSM and checks XML against schemas
+    -->
     <target name="dist" depends="compile,create-revision,check-schemas">
-        <exec append="false" output="REVISION" executable="svn" failifexecutionfails="false">
-            <env key="LANG" value="C"/>
-            <arg value="info"/>
-            <arg value="--xml"/>
-            <arg value="."/>
-        </exec>
-        <xmlproperty file="REVISION" prefix="version" keepRoot="false" collapseAttributes="true"/>
-        <delete file="REVISION"/>
-        <property name="version.entry.commit.revision" value="UNKNOWN"/>
-        <property name="version.entry.commit.date" value="UNKNOWN"/>
         <echo>Revision ${version.entry.commit.revision}</echo>
         <copy file="CONTRIBUTION" todir="build"/>
Index: trunk/tools/gitcommit2xml.pl
===================================================================
--- trunk/tools/gitcommit2xml.pl	(revision 6540)
+++ trunk/tools/gitcommit2xml.pl	(revision 6540)
@@ -0,0 +1,13 @@
+#!perl -w
+
+$l=<>;
+if ($l =~ /([-+: .\w]+)/) {
+    $date=$1;
+}
+
+while (<>) {
+    if (/git-svn-id: [^@]*@([0-9]+)\s/) {
+        $rev=$1;
+    }
+}
+print "<info><entry><commit". ($rev?" revision=\"$rev\"":"") .">". ($date?"<date>$date</date>":"") ."</commit></entry></info>\n";
