Add version to benchmark data

Change-Id: I222089792f178a9ac63b831f14140413a9d1fce1
diff --git a/tools/historic_run.py b/tools/historic_run.py
index 1124f95..9836b1d 100755
--- a/tools/historic_run.py
+++ b/tools/historic_run.py
@@ -71,9 +71,23 @@
         ]).decode('utf-8')
         return result.strip()
 
+    def changed_files(self):
+        result = subprocess.check_output(
+            ['git', 'show', '--name-only', '--no-notes',
+             '--pretty=']).decode('utf-8')
+        return result.strip().splitlines()
+
     def committer_timestamp(self):
         return self.timestamp
 
+    def version(self):
+        title = self.title()
+        if title.startswith(
+                'Version '
+        ) and 'src/main/java/com/android/tools/r8/Version.java' in changes_files:
+            return title[len('Version '):]
+        return None
+
 
 def git_commit_from_hash(hash):
     # If there is a tag for the given commit then the commit timestamp is on the