summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThorsten Behrens <Thorsten.Behrens@CIB.de>2016-02-10 23:46:54 +0100
committerThorsten Behrens <Thorsten.Behrens@CIB.de>2016-02-10 23:46:54 +0100
commitb1573f94b9f865c5a5647bd6f24fdb1c90298b6b (patch)
tree256553b16fbe6ed5d67c962ed937289115c99e7b
parentc38e222fb7c44db359bc5677a86fbbd31c3fc419 (diff)
De-fuzz and rebase gitdm patches to upstream master
-rw-r--r--gitdm-patches/0001-Export-hackers-individual-raw-data-as-CSV.patch59
-rw-r--r--gitdm-patches/0002-Add-exclude-functionality.patch82
2 files changed, 67 insertions, 74 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 d3c9e59c..12c286e0 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
@@ -1,17 +1,17 @@
-From 82cb8cc64e7e2d744bbf65673e61979160a5b767 Mon Sep 17 00:00:00 2001
-From: Cedric Bosdonnat <cedric.bosdonnat.ooo@free.fr>
-Date: Wed, 14 Sep 2011 00:55:30 +0200
+From 848f32d7224a2ca877e95f6815b14f8a9fdd9e21 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?C=C3=A9dric=20Bosdonnat?= <cedricbosdo@openoffice.org>
+Date: Sun, 7 Feb 2016 00:19:08 +0100
Subject: [PATCH 1/2] Export hackers individual raw data as CSV
The data exported for each hacker are the date of the first commit,
the date of the last commit, the commits count. These help distinguish
regular core hackers from one-shot contributors.
---
- README | 3 +++
- csvdump.py | 16 +++++++++++++++-
- database.py | 8 +++++++-
- gitdm | 15 +++++++++++----
- 4 files changed, 36 insertions(+), 6 deletions(-)
+ README | 3 +++
+ csvdump.py | 16 +++++++++++++++-
+ database.py | 8 +++++++-
+ gitdm | 11 ++++++++++-
+ 4 files changed, 35 insertions(+), 3 deletions(-)
diff --git a/README b/README
index dab372e..e60285d 100644
@@ -28,12 +28,12 @@ index dab372e..e60285d 100644
-n Use --numstat instead of generated patches to get the statistics.
diff --git a/csvdump.py b/csvdump.py
-index b76a5f6..66b8a12 100644
+index c3f6b5a..f0f5e6b 100644
--- a/csvdump.py
+++ b/csvdump.py
-@@ -85,4 +85,18 @@ def OutputCSV (file):
+@@ -89,4 +89,18 @@ def OutputCSV (file):
writer.writerow ([author_name, stat.email, empl_name, stat.date,
- stat.added, stat.removed])
+ stat.added, stat.removed, stat.changesets])
-__all__ = [ 'AccumulatePatch', 'OutputCSV', 'store_patch' ]
+def OutputHackersCSV (file, hlist):
@@ -52,10 +52,10 @@ index b76a5f6..66b8a12 100644
+
+
diff --git a/database.py b/database.py
-index d8c8095..a8677e0 100644
+index cb242c1..bf13227 100644
--- a/database.py
+++ b/database.py
-@@ -25,7 +25,9 @@ class Hacker:
+@@ -25,6 +25,8 @@ class Hacker:
self.tested = [ ]
self.reports = [ ]
self.testcred = self.repcred = 0
@@ -64,8 +64,7 @@ index d8c8095..a8677e0 100644
self.versions = [ ]
def addemail (self, email, elist):
- self.email.append (email)
-@@ -33,7 +35,7 @@ class Hacker:
+@@ -34,7 +36,7 @@ class Hacker:
def emailemployer (self, email, date):
for i in range (0, len (self.email)):
@@ -74,9 +73,9 @@ index d8c8095..a8677e0 100644
for edate, empl in self.employer[i]:
if edate > date:
return empl
-@@ -44,6 +46,10 @@ class Hacker:
- self.added += patch.added
+@@ -46,6 +48,10 @@ class Hacker:
self.removed += patch.removed
+ self.changed += max(patch.added, patch.removed)
self.patches.append (patch)
+ if patch.date < self.activity_start:
+ self.activity_start = patch.date
@@ -84,9 +83,9 @@ index d8c8095..a8677e0 100644
+ self.activity_end= patch.date
#
- # There's got to be a better way.
+ # Note that the author is represented in this release.
diff --git a/gitdm b/gitdm
-index 41634e6..774b059 100755
+index c2b20cd..61318ad 100755
--- a/gitdm
+++ b/gitdm
@@ -36,6 +36,7 @@ AuthorSOBs = 1
@@ -97,17 +96,15 @@ index 41634e6..774b059 100755
AkpmOverLt = 0
DumpDB = 0
CFName = 'gitdm.config'
-@@ -53,6 +54,7 @@ ReportByFileType = 0
- # -d Output individual developer stats
+@@ -57,6 +58,7 @@ FileReport = None
# -D Output date statistics
+ # -f file Write touched-files report to <file>
# -h hfile HTML output to hfile
+# -H file Export individual developer raw data as CSV
# -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,11 @@ ReportByFileType = 0
- def ParseOpts ():
- global MapUnknown, DevReports
+@@ -75,8 +77,9 @@ def ParseOpts():
global DateStats, AuthorSOBs, FileFilter, AkpmOverLt, DumpDB
global CFName, CSVFile, CSVPrefix,DirName, Aggregate, Numstat
global ReportByFileType, ReportUnknowns, CompanyFilter, FileReport
@@ -118,20 +115,26 @@ index 41634e6..774b059 100755
for opt in opts:
if opt[0] == '-a':
AkpmOverLt = 1
-@@ -84,4 +86,6 @@ def ParseOpts ():
+@@ -94,6 +97,8 @@ def ParseOpts():
+ FileReport = opt[1]
elif opt[0] == '-h':
reports.SetHTMLOutput(open(opt[1], 'w'))
+ elif opt[0] == '-H':
+ HackersCSV = open (opt[1], 'w')
elif opt[0] == '-l':
reports.SetMaxList(int(opt[1]))
-@@ -480,5 +483,9 @@ if TotalChanged == 0:
+ elif opt[0] == '-n':
+@@ -551,6 +556,10 @@ if TotalChanged == 0:
if DateStats:
- PrintDateStats ()
+ PrintDateStats()
+if HackersCSV:
+ csvdump.OutputHackersCSV (HackersCSV, hlist);
+ HackersCSV.close ()
+
if CSVPrefix:
- csvdump.save_csv (CSVPrefix)
+ csvdump.save_csv(CSVPrefix)
+
+--
+2.1.4
+
diff --git a/gitdm-patches/0002-Add-exclude-functionality.patch b/gitdm-patches/0002-Add-exclude-functionality.patch
index 374e28fd..47d6f566 100644
--- a/gitdm-patches/0002-Add-exclude-functionality.patch
+++ b/gitdm-patches/0002-Add-exclude-functionality.patch
@@ -1,12 +1,12 @@
-From 39a692eaa885629a9a8ed7b7f7e38989591958d4 Mon Sep 17 00:00:00 2001
+From da4fc5c5acb6839dc91cb6174ece03a98464e824 Mon Sep 17 00:00:00 2001
From: Michael Meeks <michael.meeks@novell.com>
Date: Wed, 14 Sep 2011 01:12:00 +0200
Subject: [PATCH 2/2] Add exclude functionality
---
- README | 2 ++
- gitdm | 37 ++++++++++++++++++++++---------------
- 2 files changed, 24 insertions(+), 15 deletions(-)
+ README | 2 ++
+ gitdm | 32 +++++++++++++++++++-------------
+ 2 files changed, 21 insertions(+), 13 deletions(-)
diff --git a/README b/README
index e60285d..44bd4b5 100644
@@ -22,7 +22,7 @@ index e60285d..44bd4b5 100644
CSV file when -x is used.
diff --git a/gitdm b/gitdm
-index 774b059..62a5a57 100755
+index 61318ad..6b7e378 100755
--- a/gitdm
+++ b/gitdm
@@ -34,6 +34,7 @@ DevReports = 1
@@ -33,8 +33,7 @@ index 774b059..62a5a57 100755
CSVFile = None
CSVPrefix = None
HackersCSV = None
-@@ -63,18 +64,19 @@ ReportByFileType = 0
- # -s Ignore author SOB lines
+@@ -68,6 +69,7 @@ FileReport = None
# -u Map unknown employers to '(Unknown)'
# -U Dump unknown hackers in report
# -x file.csv Export raw statistics as CSV
@@ -42,9 +41,7 @@ index 774b059..62a5a57 100755
# -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():
- global MapUnknown, DevReports
+@@ -77,9 +79,9 @@ def ParseOpts():
global DateStats, AuthorSOBs, FileFilter, AkpmOverLt, DumpDB
global CFName, CSVFile, CSVPrefix,DirName, Aggregate, Numstat
global ReportByFileType, ReportUnknowns, CompanyFilter, FileReport
@@ -56,33 +53,25 @@ index 774b059..62a5a57 100755
for opt in opts:
if opt[0] == '-a':
AkpmOverLt = 1
-@@ -108,6 +110,8 @@ def ParseOpts ():
+@@ -121,6 +123,8 @@ def ParseOpts():
elif opt[0] == '-x':
- CSVFile = open (opt[1], 'w')
+ CSVFile = open(opt[1], 'w')
print "open output file " + opt[1] + "\n"
+ elif opt[0] == '-X':
+ ExcludeFilter = re.compile (opt[1])
elif opt [0] == '-w':
Aggregate = 'week'
- elif opt[0] == '-z':
-@@ -223,7 +227,7 @@ def grabpatch(logpatch):
+ elif opt [0] == '-y':
+@@ -266,7 +270,7 @@ def grabpatch(logpatch):
return None
- p = patch(m.group (1))
+ p = patch(m.group(1))
- ignore = (FileFilter is not None)
+ ignore = False;
+ need_bline = False
for Line in logpatch[1:]:
#
- # Maybe it's an author line?
-@@ -274,6 +278,7 @@ def grabpatch(logpatch):
- p.author.reportcredit (patch)
- p.author.testcredit (patch)
- continue
-+
- #
- # If this one is a merge, make note of the fact.
- #
-@@ -294,10 +299,12 @@ def grabpatch(logpatch):
+@@ -338,10 +342,12 @@ def grabpatch(logpatch):
continue
if not Numstat:
#
@@ -90,54 +79,55 @@ index 774b059..62a5a57 100755
+ # If we have file filters, check for file lines.
#
if FileFilter:
-- ignore = ApplyFileFilter (Line, ignore)
-+ ignore = ApplyFilter (Line, ignore, FileFilter, False)
+- ignore = ApplyFileFilter(Line, ignore)
++ ignore = ApplyFilter(Line, ignore, FileFilter, False)
+ if ExcludeFilter:
-+ ignore = ApplyFilter (Line, ignore, ExcludeFilter, True)
++ ignore = ApplyFilter(Line, ignore, ExcludeFilter, True)
#
- # OK, maybe it's part of the diff itself.
+ # If we are tracking files touched, look for a relevant line here.
#
-@@ -327,7 +334,7 @@ def GripeAboutAuthorName (name):
- GripedAuthorNames.append (name)
+@@ -391,7 +397,7 @@ def GripeAboutAuthorName(name):
+ GripedAuthorNames.append(name)
print '%s is an author name, probably not what you want' % (name)
--def ApplyFileFilter (line, ignore):
-+def ApplyFilter (line, ignore, filter, exclude):
+-def ApplyFileFilter(line, ignore):
++def ApplyFilter(line, ignore, filter, exclude):
#
# If this is the first file line (--- a/), set ignore one way
# or the other.
-@@ -335,17 +342,17 @@ def ApplyFileFilter (line, ignore):
- m = patterns['filea'].match (line)
+@@ -399,17 +405,17 @@ def ApplyFileFilter(line, ignore):
+ m = patterns['filea'].match(line)
if m:
- file = m.group (1)
-- if FileFilter.search (file):
+ file = m.group(1)
+- if FileFilter.search(file):
- return 0
- return 1
-+ if filter.search (file):
++ if filter.search(file):
+ return exclude
+ return not exclude
#
# For the second line, we can turn ignore off, but not on
#
- m = patterns['fileb'].match (line)
+ m = patterns['fileb'].match(line)
if m:
- file = m.group (1)
-- if FileFilter.search (file):
+ file = m.group(1)
+- if FileFilter.search(file):
- return 0
-+ if filter.search (file):
++ if filter.search(file):
+ return exclude
return ignore
def is_svntag(logpatch):
-@@ -422,14 +429,14 @@ for logpatch in patches:
+@@ -486,7 +492,7 @@ for logpatch in patches:
# if p.added > 100000 or p.removed > 100000:
# print 'Skipping massive add', p.commit
# continue
- if FileFilter and p.added == 0 and p.removed == 0:
+ if (FileFilter or ExcludeFilter) and p.added == 0 and p.removed == 0:
continue
-
#
+ # Apply the company filter if it exists.
+@@ -503,7 +509,7 @@ for logpatch in patches:
# Record some global information - but only if this patch had
# stuff which wasn't ignored.
#
@@ -145,7 +135,7 @@ index 774b059..62a5a57 100755
+ if ((p.added + p.removed) > 0 or (not FileFilter and not ExcludeFilter) ) and not p.merge:
TotalAdded += p.added
TotalRemoved += p.removed
- TotalChanged += max (p.added, p.removed)
+ TotalChanged += max(p.added, p.removed)
--
-1.7.3.4
+2.1.4