<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -20,12 +20,12 @@ namespace CrissCross
 	{
 		const char *ShortVersion()
 		{
-			return CC_LIB_VERSION;
+			return CC_LIB_VERSION_TAG;
 		}
 
 		const char *LongVersion()
 		{
-			return CC_LIB_VERSION_STRING;
+			return CC_LIB_VERSION_LONG;
 		}
 
 		int Major()</diff>
      <filename>source/version.cpp</filename>
    </modified>
    <modified>
      <diff>@@ -49,49 +49,67 @@ if (!$verstring) {
 
 chomp($verstring);
 
-my $pattern = &quot;([0-9]+).([0-9]+).([0-9]+)(?:(?:-([a-zA-Z]+[0-9]+))?(?:-([0-9]+)-g[a-fA-F0-9]+)?)?&quot;;
+# This gets us:
+#  $1.$2.$3.$4-$5-$6
+my $component_pattern = &quot;([0-9]+)[.]([0-9]+)[.]([0-9]+)(?:[.]([0-9]+))?(?:(?:-([a-zA-Z]+[0-9]+))?(?:-([0-9]+)-g[a-fA-F0-9]+)?)?&quot;;
 
-if ($verstring =~ $pattern) {
+if ($verstring =~ $component_pattern) {
 } else {
 	die &quot;Version string '$verstring' is malformed...\n&quot;;
 }
 
-my $major = $1;
-my $minor = $2;
-my $revis = $3;
-my $build = $5;
-my $pre   = $4;
+my $major  = $1;
+my $minor  = $2;
+my $revis  = $3;
+my $build  = $4;
+my $commit = $6;
 
-if ( !$build ) {
-	$build = &quot;0&quot;;
+# Git didn't give us a --long format?
+if ( !$commit ) {
+	$commit = 0;
 }
 
-if ( $pre ) {
-	# We have a prerelease version.
-	$pre = &quot;-$pre&quot;;
+# This gets us just the tag:
+my $tag_pattern = &quot;([0-9]+[.][0-9]+[.][0-9]+(?:[.][0-9]+)?(?:(?:-[a-zA-Z]+[0-9]+)?))&quot;;
+
+if ($verstring =~ $tag_pattern) {
 } else {
-	$pre = &quot;&quot;;
+	die &quot;Version string '$verstring' is malformed...\n&quot;;
+}
+
+my $tag    = $1;
+
+# We assume here that we must be using a different
+# version number convention.
+if ( !$build ) {
+	$build = $commit;
+}
+
+# If we're at the tag, don't make the long
+# version longer than necessary.
+if ( $commit == 0 ) {
+	$verstring = $tag;
 }
 
 unlink(&quot;$outfile.tmp&quot;);
 
-my $prefix = &quot;CC_LIB&quot;;
-my $tag    = &quot;cc&quot;;
+my $prefix   = &quot;CC_LIB&quot;;
+my $smprefix = &quot;cc&quot;;
 
 open OUT, &quot;&gt;&quot;, &quot;$outfile.tmp&quot; or die $!;
 print OUT &lt;&lt;__eof__;
-#ifndef __included_${tag}_build_number_h
-#define __included_${tag}_build_number_h
+#ifndef __included_${smprefix}_build_number_h
+#define __included_${smprefix}_build_number_h
 
 #define ${prefix}_VERSION_MAJOR ${major}
 #define ${prefix}_VERSION_MINOR ${minor}
 #define ${prefix}_VERSION_REVISION ${revis}
 #define ${prefix}_VERSION_BUILD ${build}
-#define ${prefix}_VERSION \&quot;${major}.${minor}.${revis}${pre}\&quot;
-#define ${prefix}_VERSION_STRING &quot;${verstring}&quot;
+#define ${prefix}_VERSION_TAG &quot;${tag}&quot;
+#define ${prefix}_VERSION_LONG &quot;${verstring}&quot;
 
 #define ${prefix}_RESOURCE_VERSION ${major},${minor},${revis},${build}
-#define ${prefix}_RESOURCE_VERSION_STRING \&quot;${major}, ${minor}, ${revis}, ${build}\&quot;
+#define ${prefix}_RESOURCE_VERSION_STRING &quot;${major}, ${minor}, ${revis}, ${build}&quot;
 
 #endif
 </diff>
      <filename>tools/gen_buildnum_h.pl</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>ac98a981fb3de1bfe2ba1501f3f2f885d5569e51</id>
    </parent>
  </parents>
  <author>
    <name>Steven Noonan</name>
    <email>steven@uplinklabs.net</email>
  </author>
  <url>http://github.com/tycho/crisscross/commit/709868c09c287401f9fe29b72c4a297b94dfcafc</url>
  <id>709868c09c287401f9fe29b72c4a297b94dfcafc</id>
  <committed-date>2009-07-06T01:55:45-07:00</committed-date>
  <authored-date>2009-07-06T01:55:45-07:00</authored-date>
  <message>gen_buildnum_h.pl: simplify header generation

Signed-off-by: Steven Noonan &lt;steven@uplinklabs.net&gt;</message>
  <tree>e6b87258809b81a6aa54110dc5a7e6b653739db3</tree>
  <committer>
    <name>Steven Noonan</name>
    <email>steven@uplinklabs.net</email>
  </committer>
</commit>
