|
|
@@ -183,7 +183,26 @@ class GitDataCollector(DataCollector):
|
|
183
|
183
|
stamp = int(parts[0])
|
|
184
|
184
|
except ValueError:
|
|
185
|
185
|
stamp = 0
|
|
186
|
|
- self.tags[tag] = { 'stamp': stamp, 'hash' : hash, 'date' : datetime.datetime.fromtimestamp(stamp).strftime('%Y-%m-%d') }
|
|
|
186
|
+ self.tags[tag] = { 'stamp': stamp, 'hash' : hash, 'date' : datetime.datetime.fromtimestamp(stamp).strftime('%Y-%m-%d'), 'commits': 0, 'authors': {} }
|
|
|
187
|
+
|
|
|
188
|
+ # collect info on tags, starting from latest
|
|
|
189
|
+ tags_sorted_by_date_desc = map(lambda el : el[1], reversed(sorted(map(lambda el : (el[1]['date'], el[0]), data.tags.items()))))
|
|
|
190
|
+ prev = None
|
|
|
191
|
+ for tag in reversed(tags_sorted_by_date_desc):
|
|
|
192
|
+ #print prev, tag
|
|
|
193
|
+ cmd = 'git shortlog -s "%s"' % tag
|
|
|
194
|
+ if prev != None:
|
|
|
195
|
+ cmd += ' "^%s"' % prev
|
|
|
196
|
+ output = getpipeoutput([cmd])
|
|
|
197
|
+ prev = tag
|
|
|
198
|
+ for line in output.split('\n'):
|
|
|
199
|
+ parts = re.split('\s+', line, 2)
|
|
|
200
|
+ #print parts
|
|
|
201
|
+ commits = int(parts[1])
|
|
|
202
|
+ author = parts[2]
|
|
|
203
|
+ self.tags[tag]['commits'] += commits
|
|
|
204
|
+ self.tags[tag]['authors'][author] = commits
|
|
|
205
|
+ #print self.tags
|
|
187
|
206
|
|
|
188
|
207
|
# Collect revision statistics
|
|
189
|
208
|
# Outputs "<stamp> <author>"
|
|
|
@@ -740,11 +759,15 @@ class HTMLReportCreator(ReportCreator):
|
|
740
|
759
|
f.write('</dl>')
|
|
741
|
760
|
|
|
742
|
761
|
f.write('<table>')
|
|
743
|
|
- f.write('<tr><th>Name</th><th>Date</th></tr>')
|
|
|
762
|
+ f.write('<tr><th>Name</th><th>Date</th><th>Commits</th><th>Authors</th></tr>')
|
|
744
|
763
|
# sort the tags by date desc
|
|
745
|
764
|
tags_sorted_by_date_desc = map(lambda el : el[1], reversed(sorted(map(lambda el : (el[1]['date'], el[0]), data.tags.items()))))
|
|
746
|
765
|
for tag in tags_sorted_by_date_desc:
|
|
747
|
|
- f.write('<tr><td>%s</td><td>%s</td></tr>' % (tag, data.tags[tag]['date']))
|
|
|
766
|
+ authorinfo = []
|
|
|
767
|
+ authors_by_commits = getkeyssortedbyvalues(data.tags[tag]['authors'])
|
|
|
768
|
+ for i in reversed(authors_by_commits):
|
|
|
769
|
+ authorinfo.append('%s (%d)' % (i, data.tags[tag]['authors'][i]))
|
|
|
770
|
+ f.write('<tr><td>%s</td><td>%s</td><td>%d</td><td>%s</td></tr>' % (tag, data.tags[tag]['date'], data.tags[tag]['commits'], ', '.join(authorinfo)))
|
|
748
|
771
|
f.write('</table>')
|
|
749
|
772
|
|
|
750
|
773
|
f.write('</body></html>')
|