|
|
@@ -36,6 +36,7 @@ conf = {
|
|
36
|
36
|
'authors_top': 5,
|
|
37
|
37
|
'commit_begin': '',
|
|
38
|
38
|
'commit_end': '',
|
|
|
39
|
+ 'linear_linestats': 1,
|
|
39
|
40
|
}
|
|
40
|
41
|
|
|
41
|
42
|
def getpipeoutput(cmds, quiet = False):
|
|
|
@@ -400,7 +401,10 @@ class GitDataCollector(DataCollector):
|
|
400
|
401
|
# N files changed, N insertions (+), N deletions(-)
|
|
401
|
402
|
# <stamp> <author>
|
|
402
|
403
|
self.changes_by_date = {} # stamp -> { files, ins, del }
|
|
403
|
|
- lines = getpipeoutput(['git log --shortstat --pretty=format:"%%at %%aN" %s' % getcommitrange('HEAD')]).split('\n')
|
|
|
404
|
+ extra = ''
|
|
|
405
|
+ if conf['linear_linestats']:
|
|
|
406
|
+ extra = '--first-parent -m'
|
|
|
407
|
+ lines = getpipeoutput(['git log --shortstat %s --pretty=format:"%%at %%aN" %s' % (extra, getcommitrange('HEAD'))]).split('\n')
|
|
404
|
408
|
lines.reverse()
|
|
405
|
409
|
files = 0; inserted = 0; deleted = 0; total_lines = 0
|
|
406
|
410
|
author = None
|
|
|
@@ -455,6 +459,8 @@ class GitDataCollector(DataCollector):
|
|
455
|
459
|
a['date_first'] = date_first.strftime('%Y-%m-%d')
|
|
456
|
460
|
a['date_last'] = date_last.strftime('%Y-%m-%d')
|
|
457
|
461
|
a['timedelta'] = delta
|
|
|
462
|
+ if 'lines_added' not in a: a['lines_added'] = 0
|
|
|
463
|
+ if 'lines_removed' not in a: a['lines_removed'] = 0
|
|
458
|
464
|
|
|
459
|
465
|
def getActiveDays(self):
|
|
460
|
466
|
return self.active_days
|