summaryrefslogtreecommitdiff
path: root/committags
diff options
context:
space:
mode:
Diffstat (limited to 'committags')
-rwxr-xr-xcommittags37
1 files changed, 37 insertions, 0 deletions
diff --git a/committags b/committags
new file mode 100755
index 0000000..f1c8fc3
--- /dev/null
+++ b/committags
@@ -0,0 +1,37 @@
+#!/usr/bin/python
+#
+# Generate a database of commits and major versions they went into.
+#
+# committags [git-args]
+#
+import sys
+import re
+import os
+import pickle
+
+git = 'git log --decorate '
+if len(sys.argv) > 1:
+ git += ' '.join(sys.argv[1:])
+input = os.popen(git, 'r')
+
+DB = { }
+Tag = 'None'
+
+tagline = re.compile(r'^commit ([\da-f]+) .*tag: (v2\.6\.\d\d)')
+commit = re.compile(r'^commit ([\da-f]+)')
+
+for line in input.readlines():
+ if not line.startswith('commit'):
+ continue # This makes it go faster
+ m = tagline.search(line)
+ if m:
+ DB[m.group(1)] = Tag = m.group(2)
+ else:
+ m = commit.search(line)
+ if m:
+ DB[m.group(1)] = Tag
+
+print 'Found %d commits' % (len(DB.keys()))
+out = open('committags.db', 'w')
+pickle.dump(DB, out)
+out.close()