diff --git a/drupalorg_project/plugins/release_packager/DrupalorgProjectPackageRelease.class.php b/drupalorg_project/plugins/release_packager/DrupalorgProjectPackageRelease.class.php
index 7cb6859..7a4e942 100644
--- a/drupalorg_project/plugins/release_packager/DrupalorgProjectPackageRelease.class.php
+++ b/drupalorg_project/plugins/release_packager/DrupalorgProjectPackageRelease.class.php
@@ -60,7 +60,7 @@ class DrupalorgProjectPackageRelease implements ProjectReleasePackagerInterface
     $this->filenames['file_path_zip'] = $file_destination_subdir . '/' . $this->release_file_id . '.zip';
     $this->filenames['full_dest_zip'] = $file_destination_root . '/' . $this->filenames['file_path_zip'];
   }
-  
+
   /**
    * One-time initialization shared across all instances of this class.
    */
@@ -68,9 +68,9 @@ class DrupalorgProjectPackageRelease implements ProjectReleasePackagerInterface
     if (self::$shared_init) {
       return;
     }
-    
+
     putenv("TERM=vt100");  // drush requires a terminal.
-    
+
     self::$shared_init = TRUE;
   }
 
@@ -192,6 +192,32 @@ class DrupalorgProjectPackageRelease implements ProjectReleasePackagerInterface
   protected function fixInfoFileVersion($file, $project_short_name, $version) {
     global $site_name;
 
+    // Dev releases get a really spiffy version number.
+    if (!empty($this->release_node->project_release['rebuild'])) {
+      $git = $this->conf['git'] . ' --git-dir=' . escapeshellcmd($this->project_node->versioncontrol_project['repo']->root);
+      // This is called tag but in reality this is the branch for dev
+      // releases.
+      $branch = $this->release_node->project_release['tag'];
+      // Prepare for preg later.
+      $branch_preg = preg_quote(substr($branch, 0, -1));
+      // Prepare for execution now.
+      $branch = escapeshellcmd($branch);
+      // Try to find a tag.
+      exec("$git rev-list --topo-order --max-count=1 $branch 2>&1", $last_tag_hash);
+      if ($last_tag_hash) {
+        exec("$git describe  --tags $last_tag_hash[0] 2>&1", $last_tag);
+        if ($last_tag) {
+          $last_tag = $last_tag[0];
+          // Make sure the tag starts as Drupal formatted (for eg.
+          // 7.x-1.0-alpha1) and if we are on a proper branch (ie. not
+          // master) then it's on that branch.
+          if (preg_match('/^(?<drupalversion>' . $branch_preg . '\d+(?:-[^-]+)?)(?<gitextra>-(?<numberofcommits>\d+-)g[0-9a-f]{7})?$/', $last_tag, $matches)) {
+            $this->release_version = isset($matches['gitextra']) ? $matches['drupalversion'] . '+' . $matches['numberofcommits'] . 'dev' : $last_tag;
+          }
+        }
+      }
+    }
+
     $info = "\n; Information added by $site_name packaging script on " . gmdate('Y-m-d') . "\n";
     $info .= 'version = "' . $this->release_version . "\"\n";
 
