<commit_before><?xml version="1.0" encoding="UTF-8"?>
<project basedir=".." name="VersionNew" >

	<taskdef resource="net/sf/antcontrib/antcontrib.properties"/>

    <property prefix="base" file="build/umpleversion.txt"/>
    
    <condition property="gitrevtoget" value="origin/master" else="master">
      <equals arg1="${myenv}" arg2="cc" />
    </condition>    

    <!-- Use Git to get the most recent commit -->
    <exec executable="git" outputproperty="git.revision" resultproperty="parseres">
    	<arg value="rev-parse" />
    	<arg value="--short" />
    	<arg value="${gitrevtoget}" />
    </exec>

    <!-- If not in a git repo then set -->
    <condition property="git.revision" value="dev">
      <not>
        <equals arg1="${parseres}" arg2="0" />
      </not>
    </condition>  

    <exec executable="git" outputproperty="git.commitnum" resultproperty="listres">
    	<arg value="rev-list" />
    	<arg value="--count" />
    	<arg value="${gitrevtoget}" />
    </exec>

    <!-- If not in a git repo then set -->
    <condition property="git.commitnum" value="x">
      <not>
        <equals arg1="${listres}" arg2="0" />
      </not>
    </condition>  

    <property name="umple.version" value="${base.version}-${git.revision}-${git.commitnum}" />
    <echo message="Current Version: ${umple.version}" />
  
</project>

<commit_msg>Fixing new version mechanism so works if not in clean git repo<commit_after><?xml version="1.0" encoding="UTF-8"?>
<project basedir=".." name="VersionNew" >

	<taskdef resource="net/sf/antcontrib/antcontrib.properties"/>
    <echo message="running _versionNew to set version based on git"/>
    <property prefix="base" file="build/umpleversion.txt"/>
    
    <condition property="gitrevtoget" value="origin/master" else="master">
      <equals arg1="${myenv}" arg2="cc" />
    </condition>    

    <!-- Use Git to get the most recent commit -->
    <exec executable="git" outputproperty="gr" resultproperty="parseres">
    	<arg value="rev-parse" />
    	<arg value="--short" />
    	<arg value="${gitrevtoget}" />
    </exec>

    <!-- If exec failed; hence not in a git repo then set to dev -->
    <condition property="git.revision" value="dev" else="${gr}">
      <not>
        <equals arg1="${parseres}" arg2="0"/>
      </not>
    </condition>  

    <exec executable="git" outputproperty="gc" resultproperty="listres">
    	<arg value="rev-list" />
    	<arg value="--count" />
    	<arg value="${gitrevtoget}" />
    </exec>

    <!-- If exec failed; hence not in a git repo then set to x -->
    <condition property="git.commitnum" value="x" else="${gc}">
      <not>
        <equals arg1="${listres}" arg2="0" />
      </not>
    </condition>  

    <property name="umple.version" value="${base.version}-${git.revision}-${git.commitnum}" />
    <echo message="Current Version: ${umple.version}" />
  
</project>


{'fraction_non_alphanumeric': 0.19249478804725503, 'fraction_numerical': 0.007644197359277276, 'mean_word_length': 3.0894886363636362, 'pattern_counts': {'":': 0, '<': 70, '<?xml version=': 2, '>': 70, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5484728', 'n_tokens_mistral': 924, 'n_tokens_neox': 903, 'n_words': 214}