summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThorsten Behrens <Thorsten.Behrens@CIB.de>2016-01-23 03:07:12 +0100
committerThorsten Behrens <Thorsten.Behrens@CIB.de>2016-01-23 03:07:12 +0100
commit8a358d7c419428eb518b1520a2be47ff4207d5c2 (patch)
tree7432d262795c9b42963b54991676e6a763d71b43
parent3d47f7f866b1437fafa30746a7dc3c9bc3222134 (diff)
Rebase gitdm patches to recent gitdm master
-rw-r--r--gitdm-patches/0001-Export-hackers-individual-raw-data-as-CSV.patch38
-rw-r--r--gitdm-patches/0002-Add-exclude-functionality.patch24
-rw-r--r--gitdm-patches/0003-dump-commit-counts-as-well.patch59
3 files changed, 22 insertions, 99 deletions
diff --git a/gitdm-patches/0001-Export-hackers-individual-raw-data-as-CSV.patch b/gitdm-patches/0001-Export-hackers-individual-raw-data-as-CSV.patch
index 4fa81e68..d3c9e59c 100644
--- a/gitdm-patches/0001-Export-hackers-individual-raw-data-as-CSV.patch
+++ b/gitdm-patches/0001-Export-hackers-individual-raw-data-as-CSV.patch
@@ -55,12 +55,13 @@ diff --git a/database.py b/database.py
index d8c8095..a8677e0 100644
--- a/database.py
+++ b/database.py
-@@ -25,6 +25,8 @@ class Hacker:
+@@ -25,7 +25,9 @@ class Hacker:
self.tested = [ ]
self.reports = [ ]
self.testcred = self.repcred = 0
+ self.activity_start = datetime.date.max
+ self.activity_end = datetime.date.min
+ self.versions = [ ]
def addemail (self, email, elist):
self.email.append (email)
@@ -104,38 +105,27 @@ index 41634e6..774b059 100755
# -l count Maximum length for output lists
# -n Use numstats instead of generated patch from git log
# -o file File for text output
-@@ -67,10 +69,10 @@ ReportByFileType = 0
+@@ -67,10 +69,11 @@ ReportByFileType = 0
def ParseOpts ():
global MapUnknown, DevReports
global DateStats, AuthorSOBs, FileFilter, AkpmOverLt, DumpDB
-- global CFName, CSVFile, CSVPrefix,DirName, Aggregate, Numstat
-- global ReportByFileType
-+ global CFName, CSVFile, CSVPrefix, HackersCSV, DirName,
-+ global Aggregate, Numstat, ReportByFileType
+ global CFName, CSVFile, CSVPrefix,DirName, Aggregate, Numstat
+ global ReportByFileType, ReportUnknowns, CompanyFilter, FileReport
++ global HackersCSV
-- opts, rest = getopt.getopt (sys.argv[1:], 'ab:dc:Dh:l:no:p:r:stuwx:z')
-+ opts, rest = getopt.getopt (sys.argv[1:], 'ab:dc:Dh:H:l:no:p:r:stuwx:z')
+- opts, rest = getopt.getopt(sys.argv[1:], 'ab:dC:c:Df:h:l:no:p:r:stUuwx:yz')
++ opts, rest = getopt.getopt(sys.argv[1:], 'ab:dC:c:Df:H:h:l:no:p:r:stUuwx:yz')
for opt in opts:
if opt[0] == '-a':
AkpmOverLt = 1
-@@ -84,6 +86,8 @@ def ParseOpts ():
- DateStats = 1
+@@ -84,4 +86,6 @@ def ParseOpts ():
elif opt[0] == '-h':
- reports.SetHTMLOutput (open (opt[1], 'w'))
+ reports.SetHTMLOutput(open(opt[1], 'w'))
+ elif opt[0] == '-H':
+ HackersCSV = open (opt[1], 'w')
elif opt[0] == '-l':
- reports.SetMaxList (int (opt[1]))
- elif opt[0] == '-n':
-@@ -108,7 +112,6 @@ def ParseOpts ():
- Aggregate = 'week'
- elif opt[0] == '-z':
- DumpDB = 1
--
-
-
- def LookupStoreHacker (name, email):
-@@ -480,6 +483,10 @@ if TotalChanged == 0:
+ reports.SetMaxList(int(opt[1]))
+@@ -480,5 +483,9 @@ if TotalChanged == 0:
if DateStats:
PrintDateStats ()
@@ -145,7 +135,3 @@ index 41634e6..774b059 100755
+
if CSVPrefix:
csvdump.save_csv (CSVPrefix)
-
---
-1.7.3.4
-
diff --git a/gitdm-patches/0002-Add-exclude-functionality.patch b/gitdm-patches/0002-Add-exclude-functionality.patch
index 51799fe4..374e28fd 100644
--- a/gitdm-patches/0002-Add-exclude-functionality.patch
+++ b/gitdm-patches/0002-Add-exclude-functionality.patch
@@ -25,12 +25,6 @@ diff --git a/gitdm b/gitdm
index 774b059..62a5a57 100755
--- a/gitdm
+++ b/gitdm
-@@ -1,4 +1,4 @@
--#!/usr/bin/pypy
-+#!/usr/bin/python
- #-*- coding:utf-8 -*-
- #
-
@@ -34,6 +34,7 @@ DevReports = 1
DateStats = 0
AuthorSOBs = 1
@@ -39,24 +33,26 @@ index 774b059..62a5a57 100755
CSVFile = None
CSVPrefix = None
HackersCSV = None
-@@ -63,16 +64,17 @@ ReportByFileType = 0
+@@ -63,18 +64,19 @@ ReportByFileType = 0
# -s Ignore author SOB lines
# -u Map unknown employers to '(Unknown)'
+ # -U Dump unknown hackers in report
# -x file.csv Export raw statistics as CSV
+# -X pattern Exclude matching files
# -w Aggregrate the raw statistics by weeks instead of months
+ # -y Aggregrate the raw statistics by years instead of months
# -z Dump out the hacker database at completion
- def ParseOpts ():
+ def ParseOpts():
global MapUnknown, DevReports
global DateStats, AuthorSOBs, FileFilter, AkpmOverLt, DumpDB
-- global CFName, CSVFile, CSVPrefix, HackersCSV, DirName,
-- global Aggregate, Numstat, ReportByFileType
-+ global CFName, CSVFile, CSVPrefix, HackersCSV, DirName
-+ global Aggregate, Numstat, ReportByFileType, ExcludeFilter
+ global CFName, CSVFile, CSVPrefix,DirName, Aggregate, Numstat
+ global ReportByFileType, ReportUnknowns, CompanyFilter, FileReport
+- global HackersCSV
++ global HackersCSV, ExcludeFilter
-- opts, rest = getopt.getopt (sys.argv[1:], 'ab:dc:Dh:H:l:no:p:r:stuwx:z')
-+ opts, rest = getopt.getopt (sys.argv[1:], 'ab:dc:Dh:H:l:no:p:r:stuwx:X:z')
+- opts, rest = getopt.getopt(sys.argv[1:], 'ab:dC:c:Df:H:h:l:no:p:r:stUuwx:yz')
++ opts, rest = getopt.getopt(sys.argv[1:], 'ab:dC:c:Df:H:h:l:no:p:r:stUuwx:X:yz')
for opt in opts:
if opt[0] == '-a':
AkpmOverLt = 1
diff --git a/gitdm-patches/0003-dump-commit-counts-as-well.patch b/gitdm-patches/0003-dump-commit-counts-as-well.patch
deleted file mode 100644
index 693bbcb7..00000000
--- a/gitdm-patches/0003-dump-commit-counts-as-well.patch
+++ /dev/null
@@ -1,59 +0,0 @@
-From 32259eeefb866fc3236ddf88332872a5caa80af6 Mon Sep 17 00:00:00 2001
-From: Michael Meeks <michael.meeks@suse.com>
-Date: Thu, 20 Dec 2012 12:17:53 +0000
-Subject: [PATCH] dump commit counts as well.
-
----
- csvdump.py | 6 ++++--
- gitdm | 2 +-
- 2 files changed, 5 insertions(+), 3 deletions(-)
-
-diff --git a/csvdump.py b/csvdump.py
-index 66b8a12..038c6a6 100644
---- a/csvdump.py
-+++ b/csvdump.py
-@@ -10,10 +10,12 @@ class CSVStat:
- self.email = email
- self.employer = employer
- self.added = self.removed = 0
-+ self.commits = 0;
- self.date = date
- def accumulate (self, p):
- self.added = self.added + p.added
- self.removed = self.removed + p.removed
-+ self.commits = self.commits + 1
-
- PeriodCommitHash = { }
-
-@@ -77,13 +79,13 @@ def OutputCSV (file):
- return
- writer = csv.writer (file, quoting=csv.QUOTE_NONNUMERIC)
- writer.writerow (['Name', 'Email', 'Affliation', 'Date',
-- 'Added', 'Removed'])
-+ 'Added', 'Removed', 'Commits'])
- for date, stat in PeriodCommitHash.items():
- # sanitise names " is common and \" sometimes too
- empl_name = stat.employer.name.replace ('"', '.').replace ('\\', '.')
- author_name = stat.name.replace ('"', '.').replace ('\\', '.')
- writer.writerow ([author_name, stat.email, empl_name, stat.date,
-- stat.added, stat.removed])
-+ stat.added, stat.removed, stat.commits])
-
- def OutputHackersCSV (file, hlist):
- if file is None:
-diff --git a/gitdm b/gitdm
-index 62a5a57..e52167c 100755
---- a/gitdm
-+++ b/gitdm
-@@ -491,7 +491,7 @@ if DateStats:
- PrintDateStats ()
-
- if HackersCSV:
-- csv.OutputHackersCSV (HackersCSV, hlist);
-+ csvdump.OutputHackersCSV (HackersCSV, hlist);
- HackersCSV.close ()
-
- if CSVPrefix:
---
-1.7.10.4
-