3 # Generate a database of commits and major versions they went into.
5 # committags [git-args]
7 # This code is part of the LWN git data miner.
9 # Copyright 2007-8 LWN.net
10 # Copyright 2007-8 Jonathan Corbet <corbet@lwn.net>
12 # This file may be distributed under the terms of the GNU General
13 # Public License, version 2.
20 git
= 'git log --decorate '
22 git
+= ' '.join(sys
.argv
[1:])
23 input = os
.popen(git
, 'r')
28 tagline
= re
.compile(r
'^commit ([\da-f]+) .*tag: (v2\.6\.\d\d)')
29 commit
= re
.compile(r
'^commit ([\da-f]+)')
31 for line
in input.readlines():
32 if not line
.startswith('commit'):
33 continue # This makes it go faster
34 m
= tagline
.search(line
)
36 DB
[m
.group(1)] = Tag
= m
.group(2)
38 m
= commit
.search(line
)
42 print 'Found %d commits' % (len(DB
.keys()))
43 out
= open('committags.db', 'w')