git log -p -M [details] | gitdm [options]
+Alternatively, you can run with:
+
+ git log --numstat -M [details] | gitdm -n [options]
+
The [details] tell git which changesets are of interest; the [options] can
be:
-l num Only list the top <num> entries in each report.
+ -n Use --numstat instead of generated patches to get the statistics.
+
-o file Write text output to the given file (default is stdout).
-r pat Only generate statistics for changes to files whose
git log -p -M v2.6.19..v2.6.20 | \
gitdm -u -s -a -o results -h results.html
+or:
+
+ git log --numstat -M v2.6.19..v2.6.20 | \
+ gitdm -u -s -a -n -o results -h results.html
CONFIGURATION FILE
CFName = 'gitdm.config'
DirName = ''
Aggregate = 'month'
+Numstat = 0
#
# Options:
# -D Output date statistics
# -h hfile HTML output to hfile
# -l count Maximum length for output lists
+# -n Use numstats instead of generated patch from git log
# -o file File for text output
# -r pattern Restrict to files matching pattern
# -s Ignore author SOB lines
def ParseOpts ():
global MapUnknown, DevReports
global DateStats, AuthorSOBs, FileFilter, AkpmOverLt, DumpDB
- global CFName, CSVFile, DirName, Aggregate
+ global CFName, CSVFile, DirName, Aggregate, Numstat
- opts, rest = getopt.getopt (sys.argv[1:], 'ab:dc:Dh:l:o:r:suwx:z')
+ opts, rest = getopt.getopt (sys.argv[1:], 'ab:dc:Dh:l:no:r:suwx:z')
for opt in opts:
if opt[0] == '-a':
AkpmOverLt = 1
reports.SetHTMLOutput (open (opt[1], 'w'))
elif opt[0] == '-l':
reports.SetMaxList (int (opt[1]))
+ elif opt[0] == '-n':
+ Numstat = 1
elif opt[0] == '-o':
reports.SetOutput (open (opt[1], 'w'))
elif opt[0] == '-r':
sys.stderr.write ('Funky date: %s\n' % p.date)
p.date = Today
continue
- #
- # If we have a file filter, check for file lines.
- #
- if FileFilter:
- ignore = ApplyFileFilter (Line, ignore)
- #
- # OK, maybe it's part of the diff itself.
- #
- if not ignore:
- if Padd.match (Line):
- p.added += 1
- continue
- if Prem.match (Line):
- p.removed += 1
+ if not Numstat:
+ #
+ # If we have a file filter, check for file lines.
+ #
+ if FileFilter:
+ ignore = ApplyFileFilter (Line, ignore)
+ #
+ # OK, maybe it's part of the diff itself.
+ #
+ if not ignore:
+ if Padd.match (Line):
+ p.added += 1
+ continue
+ if Prem.match (Line):
+ p.removed += 1
+ else:
+ # Get the statistics (lines added/removes) using numstats
+ # and without requiring a diff (--numstat instead -p)
+ m = Pnumstat.match (Line)
+ if m:
+ # If we have a file filter, check for file lines.
+ if FileFilter and not FileFilter.search (m.group(3)):
+ continue
+
+ try:
+ p.added += int(m.group(1))
+ p.removed += int(m.group(2))
+ except ValueError:
+ # A binary file (image, etc.) is marked with '-'
+ pass
if '@' in p.author.name:
GripeAboutAuthorName (p.author.name)