|
|
@@ -40,6 +40,7 @@ conf = {
|
|
40
|
40
|
'commit_end': 'HEAD',
|
|
41
|
41
|
'linear_linestats': 1,
|
|
42
|
42
|
'project_name': '',
|
|
|
43
|
+ 'merge_authors': {}
|
|
43
|
44
|
}
|
|
44
|
45
|
|
|
45
|
46
|
def getpipeoutput(cmds, quiet = False):
|
|
|
@@ -286,6 +287,8 @@ class GitDataCollector(DataCollector):
|
|
286
|
287
|
parts = re.split('\s+', line, 2)
|
|
287
|
288
|
commits = int(parts[1])
|
|
288
|
289
|
author = parts[2]
|
|
|
290
|
+ if author in conf['merge_authors']:
|
|
|
291
|
+ author = conf['merge_authors'][author]
|
|
289
|
292
|
self.tags[tag]['commits'] += commits
|
|
290
|
293
|
self.tags[tag]['authors'][author] = commits
|
|
291
|
294
|
|
|
|
@@ -302,6 +305,8 @@ class GitDataCollector(DataCollector):
|
|
302
|
305
|
timezone = parts[3]
|
|
303
|
306
|
author, mail = parts[4].split('<', 1)
|
|
304
|
307
|
author = author.rstrip()
|
|
|
308
|
+ if author in conf['merge_authors']:
|
|
|
309
|
+ author = conf['merge_authors'][author]
|
|
305
|
310
|
mail = mail.rstrip('>')
|
|
306
|
311
|
domain = '?'
|
|
307
|
312
|
if mail.find('@') != -1:
|
|
|
@@ -474,6 +479,8 @@ class GitDataCollector(DataCollector):
|
|
474
|
479
|
if pos != -1:
|
|
475
|
480
|
try:
|
|
476
|
481
|
(stamp, author) = (int(line[:pos]), line[pos+1:])
|
|
|
482
|
+ if author in conf['merge_authors']:
|
|
|
483
|
+ author = conf['merge_authors'][author]
|
|
477
|
484
|
self.changes_by_date[stamp] = { 'files': files, 'ins': inserted, 'del': deleted, 'lines': total_lines }
|
|
478
|
485
|
|
|
479
|
486
|
date = datetime.datetime.fromtimestamp(stamp)
|
|
|
@@ -530,6 +537,8 @@ class GitDataCollector(DataCollector):
|
|
530
|
537
|
try:
|
|
531
|
538
|
oldstamp = stamp
|
|
532
|
539
|
(stamp, author) = (int(line[:pos]), line[pos+1:])
|
|
|
540
|
+ if author in conf['merge_authors']:
|
|
|
541
|
+ author = conf['merge_authors'][author]
|
|
533
|
542
|
if oldstamp > stamp:
|
|
534
|
543
|
# clock skew, keep old timestamp to avoid having ugly graph
|
|
535
|
544
|
stamp = oldstamp
|
|
|
@@ -1344,6 +1353,9 @@ class GitStats:
|
|
1344
|
1353
|
raise KeyError('no such key "%s" in config' % key)
|
|
1345
|
1354
|
if isinstance(conf[key], int):
|
|
1346
|
1355
|
conf[key] = int(value)
|
|
|
1356
|
+ elif isinstance(conf[key], dict):
|
|
|
1357
|
+ kk,vv = value.split(',', 1)
|
|
|
1358
|
+ conf[key][kk] = vv
|
|
1347
|
1359
|
else:
|
|
1348
|
1360
|
conf[key] = value
|
|
1349
|
1361
|
|