diff options
author | Jonathan Corbet <corbet@lwn.net> | 2013-02-08 12:42:19 -0700 |
---|---|---|
committer | Jonathan Corbet <corbet@lwn.net> | 2013-02-08 12:42:19 -0700 |
commit | 9305420dd3f9fb2cb50fcb2a0a0b32c830a28eee (patch) | |
tree | cbf91ae439fcbe4b6b2451ae4f7aa03328622d5b | |
parent | 95df707f186d62b8b615481ccdda35be93cdff19 (diff) |
Add company filtering
Add a -C option to only look at patches from a specific company.
The options are getting out of control; it would be good to switch to
optparse and add long names for some of them. Someday.
-rwxr-xr-x | gitdm | 17 |
1 files changed, 13 insertions, 4 deletions
@@ -44,6 +44,7 @@ Aggregate = 'month' Numstat = 0 ReportByFileType = 0 ReportUnknowns = False +CompanyFilter = None # # Options: @@ -51,6 +52,7 @@ ReportUnknowns = False # -a Andrew Morton's signoffs shadow Linus's # -b dir Specify the base directory to fetch the configuration files # -c cfile Specify a configuration file +# -C company Only consider patches from <company> # -d Output individual developer stats # -D Output date statistics # -h hfile HTML output to hfile @@ -71,14 +73,16 @@ def ParseOpts (): global MapUnknown, DevReports global DateStats, AuthorSOBs, FileFilter, AkpmOverLt, DumpDB global CFName, CSVFile, CSVPrefix,DirName, Aggregate, Numstat - global ReportByFileType, ReportUnknowns + global ReportByFileType, ReportUnknowns, CompanyFilter - opts, rest = getopt.getopt (sys.argv[1:], 'ab:dc:Dh:l:no:p:r:stUuwx:yz') + opts, rest = getopt.getopt (sys.argv[1:], 'ab:dC:c:Dh:l:no:p:r:stUuwx:yz') for opt in opts: if opt[0] == '-a': AkpmOverLt = 1 elif opt[0] == '-b': DirName = opt[1] + elif opt[0] == '-C': + CompanyFilter = opt[1] elif opt[0] == '-c': CFName = opt[1] elif opt[0] == '-d': @@ -428,7 +432,13 @@ for logpatch in patches: # continue if FileFilter and p.added == 0 and p.removed == 0: continue - + # + # Apply the company filter if it exists. + # + empl = p.author.emailemployer(p.email, p.date) + print CompanyFilter, empl.name + if CompanyFilter and empl.name != CompanyFilter: + continue # # Record some global information - but only if this patch had # stuff which wasn't ignored. @@ -438,7 +448,6 @@ for logpatch in patches: TotalRemoved += p.removed TotalChanged += max (p.added, p.removed) AddDateLines (p.date, max (p.added, p.removed)) - empl = p.author.emailemployer (p.email, p.date) empl.AddCSet (p) if AkpmOverLt: TrimLTSOBs (p) |