-u Group all unknown developers under the "(Unknown)"
employer.
+ -x file Export raw statistics as CSV.
+
+ -w Aggregate the data by weeks instead of months in the
+ CSV file when -x is used.
+
-z Dump out the hacker database to "database.dump".
A typical command line used to generate the "who write 2.6.x" LWN articles
PeriodCommitHash = { }
-def AccumulatePatch (p):
+def AccumulatePatch (p, Aggregate):
date = "%.2d-%.2d-01"%(p.date.year, p.date.month)
+ if (Aggregate == 'week'):
+ date = "%.2d-%.2d"%(p.date.isocalendar()[0], p.date.isocalendar()[1])
authdatekey = "%s-%s"%(p.author.name, date)
if authdatekey not in PeriodCommitHash:
empl = p.author.emailemployer (p.email, p.date)
DumpDB = 0
CFName = 'gitdm.config'
DirName = ''
+Aggregate = 'month'
#
# Options:
# -s Ignore author SOB lines
# -u Map unknown employers to '(Unknown)'
# -x file.csv Export raw statistics as CSV
+# -w Aggregrate the raw statistics by weeks instead of months
# -z Dump out the hacker database at completion
def ParseOpts ():
global MapUnknown, DevReports
global DateStats, AuthorSOBs, FileFilter, AkpmOverLt, DumpDB
- global CFName, CSVFile, DirName
+ global CFName, CSVFile, DirName, Aggregate
- opts, rest = getopt.getopt (sys.argv[1:], 'ab:dc:Dh:l:o:r:sux:z')
+ opts, rest = getopt.getopt (sys.argv[1:], 'a:b:dc:Dh:l:o:r:suwx:z')
for opt in opts:
if opt[0] == '-a':
AkpmOverLt = 1
elif opt[0] == '-x':
CSVFile = open (opt[1], 'w')
print "open output file " + opt[1] + "\n"
+ elif opt [0] == '-w':
+ Aggregate = 'week'
elif opt[0] == '-z':
DumpDB = 1
for hacker in p.reports:
hacker.addreport (p)
CSCount += 1
- csv.AccumulatePatch (p)
+ csv.AccumulatePatch (p, Aggregate)
print >> sys.stderr, 'Grabbing changesets...done '
if DumpDB: