Added lines page.
[gitstats.git] / statgit
blob7137b5eb80a1e0579efe5db771627dc8034aa880
1 #!/usr/bin/python
2 # Copyright (c) 2007 Heikki Hokkanen <hoxu@users.sf.net>
3 # GPLv2
4 import commands
5 import datetime
6 import glob
7 import os
8 import re
9 import sys
10 import time
12 GNUPLOT_COMMON = 'set terminal png transparent\nset size 0.5,0.5\n'
14 def getoutput(cmd, quiet = False):
15 if not quiet:
16 print '>> %s' % cmd
17 output = commands.getoutput(cmd)
18 return output
20 def getkeyssortedbyvalues(dict):
21 return map(lambda el : el[1], sorted(map(lambda el : (el[1], el[0]), dict.items())))
23 # TODO getdictkeyssortedbyvaluekey(dict, key) - eg. dict['author'] = { 'commits' : 512 } - ...key(dict, 'commits')
25 class DataCollector:
26 def __init__(self):
27 self.stamp_created = time.time()
28 pass
31 # This should be the main function to extract data from the repository.
32 def collect(self, dir):
33 self.dir = dir
36 # : get a dictionary of author
37 def getAuthorInfo(self, author):
38 return None
40 def getActivityByDayOfWeek(self):
41 return {}
43 def getActivityByHourOfDay(self):
44 return {}
47 # Get a list of authors
48 def getAuthors(self):
49 return []
51 def getFirstCommitDate(self):
52 return datetime.datetime.now()
54 def getLastCommitDate(self):
55 return datetime.datetime.now()
57 def getStampCreated(self):
58 return self.stamp_created
60 def getTags(self):
61 return []
63 def getTotalAuthors(self):
64 return -1
66 def getTotalCommits(self):
67 return -1
69 def getTotalFiles(self):
70 return -1
72 def getTotalLOC(self):
73 return -1
75 class GitDataCollector(DataCollector):
76 def collect(self, dir):
77 DataCollector.collect(self, dir)
79 self.total_authors = int(getoutput('git-log |git-shortlog -s |wc -l'))
80 self.total_commits = int(getoutput('git-rev-list HEAD |wc -l'))
81 self.total_files = int(getoutput('git-ls-files |wc -l'))
82 self.total_lines = int(getoutput('git-ls-files -z |xargs -0 cat |wc -l'))
84 self.activity_by_hour_of_day = {} # hour -> commits
85 self.activity_by_day_of_week = {} # day -> commits
86 self.activity_by_month_of_year = {} # month [1-12] -> commits
88 self.authors = {} # name -> {commits, first_commit_stamp, last_commit_stamp}
90 # author of the month
91 self.author_of_month = {} # month -> author -> commits
92 self.author_of_year = {} # year -> author -> commits
93 self.commits_by_month = {} # month -> commits
94 self.commits_by_year = {} # year -> commits
95 self.first_commit_stamp = 0
96 self.last_commit_stamp = 0
98 # tags
99 self.tags = {}
100 lines = getoutput('git-show-ref --tags').split('\n')
101 for line in lines:
102 if len(line) == 0:
103 continue
104 (hash, tag) = line.split(' ')
105 tag = tag.replace('refs/tags/', '')
106 output = getoutput('git-log "%s" --pretty=format:"%%at %%an" -n 1' % hash)
107 if len(output) > 0:
108 parts = output.split(' ')
109 stamp = 0
110 try:
111 stamp = int(parts[0])
112 except ValueError:
113 stamp = 0
114 self.tags[tag] = { 'stamp': stamp, 'hash' : hash, 'date' : datetime.datetime.fromtimestamp(stamp).strftime('%Y-%m-%d') }
115 pass
117 # TODO also collect statistics for "last 30 days"/"last 12 months"
118 lines = getoutput('git-rev-list --pretty=format:"%at %an" HEAD |grep -v ^commit').split('\n')
119 for line in lines:
120 # linux-2.6 says "<unknown>" for one line O_o
121 parts = line.split(' ')
122 author = ''
123 try:
124 stamp = int(parts[0])
125 except ValueError:
126 stamp = 0
127 if len(parts) > 1:
128 author = ' '.join(parts[1:])
129 date = datetime.datetime.fromtimestamp(float(stamp))
131 # First and last commit stamp
132 if self.last_commit_stamp == 0:
133 self.last_commit_stamp = stamp
134 self.first_commit_stamp = stamp
136 # activity
137 # hour
138 hour = date.hour
139 if hour in self.activity_by_hour_of_day:
140 self.activity_by_hour_of_day[hour] += 1
141 else:
142 self.activity_by_hour_of_day[hour] = 1
144 # day
145 day = date.weekday()
146 if day in self.activity_by_day_of_week:
147 self.activity_by_day_of_week[day] += 1
148 else:
149 self.activity_by_day_of_week[day] = 1
151 # month of year
152 month = date.month
153 if month in self.activity_by_month_of_year:
154 self.activity_by_month_of_year[month] += 1
155 else:
156 self.activity_by_month_of_year[month] = 1
158 # author stats
159 if author not in self.authors:
160 self.authors[author] = {}
161 # TODO commits
162 if 'last_commit_stamp' not in self.authors[author]:
163 self.authors[author]['last_commit_stamp'] = stamp
164 self.authors[author]['first_commit_stamp'] = stamp
165 if 'commits' in self.authors[author]:
166 self.authors[author]['commits'] += 1
167 else:
168 self.authors[author]['commits'] = 1
170 # author of the month/year
171 yymm = datetime.datetime.fromtimestamp(stamp).strftime('%Y-%m')
172 if yymm in self.author_of_month:
173 if author in self.author_of_month[yymm]:
174 self.author_of_month[yymm][author] += 1
175 else:
176 self.author_of_month[yymm][author] = 1
177 else:
178 self.author_of_month[yymm] = {}
179 self.author_of_month[yymm][author] = 1
180 if yymm in self.commits_by_month:
181 self.commits_by_month[yymm] += 1
182 else:
183 self.commits_by_month[yymm] = 1
185 yy = datetime.datetime.fromtimestamp(stamp).year
186 if yy in self.author_of_year:
187 if author in self.author_of_year[yy]:
188 self.author_of_year[yy][author] += 1
189 else:
190 self.author_of_year[yy][author] = 1
191 else:
192 self.author_of_year[yy] = {}
193 self.author_of_year[yy][author] = 1
194 if yy in self.commits_by_year:
195 self.commits_by_year[yy] += 1
196 else:
197 self.commits_by_year[yy] = 1
199 # outputs "<stamp> <files>" for each revision
200 self.files_by_stamp = {} # stamp -> files
201 lines = getoutput('git-rev-list --pretty=format:"%at %H" HEAD |grep -v ^commit |while read line; do set $line; echo "$1 $(git-ls-tree -r "$2" |wc -l)"; done').split('\n')
202 for line in lines:
203 parts = line.split(' ')
204 if len(parts) != 2:
205 continue
206 (stamp, files) = parts[0:2]
207 self.files_by_stamp[int(stamp)] = int(files)
209 # extensions
210 self.extensions = {} # extension -> files, lines
211 lines = getoutput('git-ls-files').split('\n')
212 for line in lines:
213 base = os.path.basename(line)
214 if base.find('.') == -1:
215 ext = ''
216 else:
217 ext = base[(base.rfind('.') + 1):]
219 if ext not in self.extensions:
220 self.extensions[ext] = {'files': 0, 'lines': 0}
222 self.extensions[ext]['files'] += 1
223 self.extensions[ext]['lines'] += int(getoutput('wc -l < %s' % line, quiet = True))
225 def getActivityByDayOfWeek(self):
226 return self.activity_by_day_of_week
228 def getActivityByHourOfDay(self):
229 return self.activity_by_hour_of_day
231 def getAuthorInfo(self, author):
232 a = self.authors[author]
234 commits = a['commits']
235 commits_frac = (100 * float(commits)) / self.getTotalCommits()
236 date_first = datetime.datetime.fromtimestamp(a['first_commit_stamp']).strftime('%Y-%m-%d')
237 date_last = datetime.datetime.fromtimestamp(a['last_commit_stamp']).strftime('%Y-%m-%d')
239 res = { 'commits': commits, 'commits_frac': commits_frac, 'date_first': date_first, 'date_last': date_last }
240 return res
242 def getAuthors(self):
243 return self.authors.keys()
245 def getFirstCommitDate(self):
246 return datetime.datetime.fromtimestamp(self.first_commit_stamp)
248 def getLastCommitDate(self):
249 return datetime.datetime.fromtimestamp(self.last_commit_stamp)
251 def getTags(self):
252 lines = getoutput('git-show-ref --tags |cut -d/ -f3')
253 return lines.split('\n')
255 def getTagDate(self, tag):
256 return self.revToDate('tags/' + tag)
258 def getTotalAuthors(self):
259 return self.total_authors
261 def getTotalCommits(self):
262 return self.total_commits
264 def getTotalFiles(self):
265 return self.total_files
267 def getTotalLOC(self):
268 return self.total_lines
270 def revToDate(self, rev):
271 stamp = int(getoutput('git-log --pretty=format:%%at "%s" -n 1' % rev))
272 return datetime.datetime.fromtimestamp(stamp).strftime('%Y-%m-%d')
274 class ReportCreator:
275 def __init__(self):
276 pass
278 def create(self, data, path):
279 self.data = data
280 self.path = path
282 class HTMLReportCreator(ReportCreator):
283 def create(self, data, path):
284 ReportCreator.create(self, data, path)
286 f = open(path + "/index.html", 'w')
287 format = '%Y-%m-%d %H:%m:%S'
288 self.printHeader(f)
290 f.write('<h1>StatGit</h1>')
292 self.printNav(f)
294 f.write('<dl>');
295 f.write('<dt>Generated</dt><dd>%s (in %d seconds)</dd>' % (datetime.datetime.now().strftime(format), time.time() - data.getStampCreated()));
296 f.write('<dt>Report Period</dt><dd>%s to %s</dd>' % (data.getFirstCommitDate().strftime(format), data.getLastCommitDate().strftime(format)))
297 f.write('<dt>Total Files</dt><dd>%s</dd>' % data.getTotalFiles())
298 f.write('<dt>Total Lines of Code</dt><dd>%s</dd>' % data.getTotalLOC())
299 f.write('<dt>Total Commits</dt><dd>%s</dd>' % data.getTotalCommits())
300 f.write('<dt>Authors</dt><dd>%s</dd>' % data.getTotalAuthors())
301 f.write('</dl>');
303 f.write('</body>\n</html>');
304 f.close()
307 # Activity
308 f = open(path + '/activity.html', 'w')
309 self.printHeader(f)
310 f.write('<h1>Activity</h1>')
311 self.printNav(f)
313 f.write('<h2>Last 30 days</h2>')
315 f.write('<h2>Last 12 months</h2>')
317 # Hour of Day
318 f.write('\n<h2>Hour of Day</h2>\n\n')
319 hour_of_day = data.getActivityByHourOfDay()
320 f.write('<table><tr><th>Hour</th>')
321 for i in range(1, 25):
322 f.write('<th>%d</th>' % i)
323 f.write('</tr>\n<tr><th>Commits</th>')
324 fp = open(path + '/hour_of_day.dat', 'w')
325 for i in range(0, 24):
326 if i in hour_of_day:
327 f.write('<td>%d</td>' % hour_of_day[i])
328 fp.write('%d %d\n' % (i, hour_of_day[i]))
329 else:
330 f.write('<td>0</td>')
331 fp.write('%d 0\n' % i)
332 fp.close()
333 f.write('</tr>\n<tr><th>%</th>')
334 totalcommits = data.getTotalCommits()
335 for i in range(0, 24):
336 if i in hour_of_day:
337 f.write('<td>%.2f</td>' % ((100.0 * hour_of_day[i]) / totalcommits))
338 else:
339 f.write('<td>0.00</td>')
340 f.write('</tr></table>')
341 f.write('<img src="hour_of_day.png" alt="Hour of Day" />')
342 fg = open(path + '/hour_of_day.dat', 'w')
343 for i in range(0, 24):
344 if i in hour_of_day:
345 fg.write('%d %d\n' % (i + 1, hour_of_day[i]))
346 else:
347 fg.write('%d 0\n' % (i + 1))
348 fg.close()
350 # Day of Week
351 # TODO show also by hour of weekday?
352 f.write('\n<h2>Day of Week</h2>\n\n')
353 day_of_week = data.getActivityByDayOfWeek()
354 f.write('<div class="vtable"><table>')
355 f.write('<tr><th>Day</th><th>Total (%)</th></tr>')
356 fp = open(path + '/day_of_week.dat', 'w')
357 for d in range(0, 7):
358 fp.write('%d %d\n' % (d + 1, day_of_week[d]))
359 f.write('<tr>')
360 f.write('<th>%d</th>' % (d + 1))
361 if d in day_of_week:
362 f.write('<td>%d (%.2f%%)</td>' % (day_of_week[d], (100.0 * day_of_week[d]) / totalcommits))
363 else:
364 f.write('<td>0</td>')
365 f.write('</tr>')
366 f.write('</table></div>')
367 f.write('<img src="day_of_week.png" alt="Day of Week" />')
368 fp.close()
370 # Month of Year
371 f.write('\n<h2>Month of Year</h2>\n\n')
372 f.write('<div class="vtable"><table>')
373 f.write('<tr><th>Month</th><th>Commits (%)</th></tr>')
374 fp = open (path + '/month_of_year.dat', 'w')
375 for mm in range(1, 13):
376 commits = 0
377 if mm in data.activity_by_month_of_year:
378 commits = data.activity_by_month_of_year[mm]
379 f.write('<tr><td>%d</td><td>%d (%.2f %%)</td></tr>' % (mm, commits, (100.0 * commits) / data.getTotalCommits()))
380 fp.write('%d %d\n' % (mm, commits))
381 fp.close()
382 f.write('</table></div>')
383 f.write('<img src="month_of_year.png" alt="Month of Year" />')
385 # Commits by year/month
386 f.write('<h2>Commits by year/month</h2>')
387 f.write('<div class="vtable"><table><tr><th>Month</th><th>Commits</th></tr>')
388 for yymm in reversed(sorted(data.commits_by_month.keys())):
389 f.write('<tr><td>%s</td><td>%d</td></tr>' % (yymm, data.commits_by_month[yymm]))
390 f.write('</table></div>')
391 f.write('<img src="commits_by_year_month.png" alt="Commits by year/month" />')
392 fg = open(path + '/commits_by_year_month.dat', 'w')
393 for yymm in sorted(data.commits_by_month.keys()):
394 fg.write('%s %s\n' % (yymm, data.commits_by_month[yymm]))
395 fg.close()
397 # Commits by year
398 f.write('<h2>Commits by year</h2>')
399 f.write('<div class="vtable"><table><tr><th>Year</th><th>Commits (% of all)</th></tr>')
400 for yy in reversed(sorted(data.commits_by_year.keys())):
401 f.write('<tr><td>%s</td><td>%d (%.2f%%)</td></tr>' % (yy, data.commits_by_year[yy], (100.0 * data.commits_by_year[yy]) / data.getTotalCommits()))
402 f.write('</table></div>')
403 f.write('<img src="commits_by_year.png" alt="Commits by Year" />')
404 fg = open(path + '/commits_by_year.dat', 'w')
405 for yy in sorted(data.commits_by_year.keys()):
406 fg.write('%d %d\n' % (yy, data.commits_by_year[yy]))
407 fg.close()
409 f.write('</body></html>')
410 f.close()
413 # Authors
414 f = open(path + '/authors.html', 'w')
415 self.printHeader(f)
417 f.write('<h1>Authors</h1>')
418 self.printNav(f)
420 f.write('\n<h2>List of authors</h2>\n\n')
422 f.write('<table class="authors">')
423 f.write('<tr><th>Author</th><th>Commits (%)</th><th>First commit</th><th>Last commit</th></tr>')
424 for author in sorted(data.getAuthors()):
425 info = data.getAuthorInfo(author)
426 f.write('<tr><td>%s</td><td>%d (%.2f%%)</td><td>%s</td><td>%s</td></tr>' % (author, info['commits'], info['commits_frac'], info['date_first'], info['date_last']))
427 f.write('</table>')
429 f.write('\n<h2>Author of Month</h2>\n\n')
430 f.write('<table>')
431 f.write('<tr><th>Month</th><th>Author</th><th>Commits (%)</th></tr>')
432 for yymm in reversed(sorted(data.author_of_month.keys())):
433 authordict = data.author_of_month[yymm]
434 authors = getkeyssortedbyvalues(authordict)
435 authors.reverse()
436 commits = data.author_of_month[yymm][authors[0]]
437 f.write('<tr><td>%s</td><td>%s</td><td>%d (%.2f%% of %d)</td></tr>' % (yymm, authors[0], commits, (100 * commits) / data.commits_by_month[yymm], data.commits_by_month[yymm]))
439 f.write('</table>')
441 f.write('\n<h2>Author of Year</h2>\n\n')
442 f.write('<table><tr><th>Year</th><th>Author</th><th>Commits (%)</th></tr>')
443 for yy in reversed(sorted(data.author_of_year.keys())):
444 authordict = data.author_of_year[yy]
445 authors = getkeyssortedbyvalues(authordict)
446 authors.reverse()
447 commits = data.author_of_year[yy][authors[0]]
448 f.write('<tr><td>%s</td><td>%s</td><td>%d (%.2f%% of %d)</td></tr>' % (yy, authors[0], commits, (100 * commits) / data.commits_by_year[yy], data.commits_by_year[yy]))
449 f.write('</table>')
451 f.write('</body></html>')
452 f.close()
455 # Files
456 f = open(path + '/files.html', 'w')
457 self.printHeader(f)
458 f.write('<h1>Files</h1>')
459 self.printNav(f)
461 f.write('<dl>\n')
462 f.write('<dt>Total files</dt><dd>%d</dd>' % data.getTotalFiles())
463 f.write('<dt>Total lines</dt><dd>%d</dd>' % data.getTotalLOC())
464 f.write('<dt>Average file size</dt><dd>%.2f bytes</dd>' % ((100.0 * data.getTotalLOC()) / data.getTotalFiles()))
465 f.write('</dl>\n')
467 # Files :: File count by date
468 f.write('<h2>File count by date</h2>')
470 fg = open(path + '/files_by_date.dat', 'w')
471 for stamp in sorted(data.files_by_stamp.keys()):
472 fg.write('%s %d\n' % (datetime.datetime.fromtimestamp(stamp).strftime('%Y-%m-%d'), data.files_by_stamp[stamp]))
473 fg.close()
475 f.write('<img src="files_by_date.png" alt="Files by Date" />')
477 #f.write('<h2>Average file size by date</h2>')
479 # Files :: Extensions
480 f.write('\n<h2>Extensions</h2>\n\n')
481 f.write('<table><tr><th>Extension</th><th>Files (%)</th><th>Lines (%)</th><th>Lines/file</th></tr>')
482 for ext in sorted(data.extensions.keys()):
483 files = data.extensions[ext]['files']
484 lines = data.extensions[ext]['lines']
485 f.write('<tr><td>%s</td><td>%d (%.2f%%)</td><td>%d (%.2f%%)</td><td>%d</td></tr>' % (ext, files, (100.0 * files) / data.getTotalFiles(), lines, (100.0 * lines) / data.getTotalLOC(), lines / files))
486 f.write('</table>')
488 f.write('</body></html>')
489 f.close()
492 # Lines
493 f = open(path + '/lines.html', 'w')
494 self.printHeader(f)
495 f.write('<h1>Lines</h1>')
496 self.printNav(f)
498 f.write('<dl>\n')
499 f.write('<dt>Total lines</dt><dd>%d</dd>' % data.getTotalLOC())
500 f.write('</dl>\n')
502 f.write('</body></html>')
503 f.close()
506 # tags.html
507 f = open(path + '/tags.html', 'w')
508 self.printHeader(f)
509 f.write('<h1>Tags</h1>')
510 self.printNav(f)
512 f.write('<dl>')
513 f.write('<dt>Total tags</dt><dd>%d</dd>' % len(data.tags))
514 if len(data.tags) > 0:
515 f.write('<dt>Average commits per tag</dt><dd>%.2f</dd>' % (data.getTotalCommits() / len(data.tags)))
516 f.write('</dl>')
518 f.write('<table>')
519 f.write('<tr><th>Name</th><th>Date</th></tr>')
520 # sort the tags by date desc
521 tags_sorted_by_date_desc = map(lambda el : el[1], reversed(sorted(map(lambda el : (el[1]['date'], el[0]), data.tags.items()))))
522 for tag in tags_sorted_by_date_desc:
523 f.write('<tr><td>%s</td><td>%s</td></tr>' % (tag, data.tags[tag]['date']))
524 f.write('</table>')
526 f.write('</body></html>')
527 f.close()
529 self.createGraphs(path)
530 pass
532 def createGraphs(self, path):
533 print 'Generating graphs...'
535 # hour of day
536 f = open(path + '/hour_of_day.plot', 'w')
537 f.write(GNUPLOT_COMMON)
538 f.write(
540 set output 'hour_of_day.png'
541 unset key
542 set xrange [0.5:24.5]
543 set xtics 4
544 set ylabel "Commits"
545 plot 'hour_of_day.dat' using 1:2:(0.5) w boxes fs solid
546 """)
547 f.close()
549 # day of week
550 f = open(path + '/day_of_week.plot', 'w')
551 f.write(GNUPLOT_COMMON)
552 f.write(
554 set output 'day_of_week.png'
555 unset key
556 set xrange [0.5:7.5]
557 set xtics 1
558 set ylabel "Commits"
559 plot 'day_of_week.dat' using 1:2:(0.5) w boxes fs solid
560 """)
561 f.close()
563 # Month of Year
564 f = open(path + '/month_of_year.plot', 'w')
565 f.write(GNUPLOT_COMMON)
566 f.write(
568 set output 'month_of_year.png'
569 unset key
570 set xrange [0.5:12.5]
571 set xtics 1
572 set ylabel "Commits"
573 plot 'month_of_year.dat' using 1:2:(0.5) w boxes fs solid
574 """)
575 f.close()
577 # commits_by_year_month
578 f = open(path + '/commits_by_year_month.plot', 'w')
579 f.write(GNUPLOT_COMMON)
580 f.write(
581 # TODO rotate xtic labels by 90 degrees
583 set output 'commits_by_year_month.png'
584 unset key
585 set xdata time
586 set timefmt "%Y-%m"
587 set format x "%Y-%m"
588 set xtics 15768000
589 set ylabel "Commits"
590 plot 'commits_by_year_month.dat' using 1:2:(0.5) w boxes fs solid
591 """)
592 f.close()
594 # commits_by_year
595 f = open(path + '/commits_by_year.plot', 'w')
596 f.write(GNUPLOT_COMMON)
597 f.write(
599 set output 'commits_by_year.png'
600 unset key
601 set xtics 1
602 set ylabel "Commits"
603 plot 'commits_by_year.dat' using 1:2:(0.5) w boxes fs solid
604 """)
605 f.close()
607 # Files by date
608 f = open(path + '/files_by_date.plot', 'w')
609 f.write(GNUPLOT_COMMON)
610 f.write(
612 set output 'files_by_date.png'
613 unset key
614 set xdata time
615 set timefmt "%Y-%m-%d"
616 set format x "%Y-%m-%d"
617 set ylabel "Files"
618 set xtics rotate by 90
619 plot 'files_by_date.dat' using 1:2 smooth csplines
620 """)
621 f.close()
623 os.chdir(path)
624 files = glob.glob(path + '/*.plot')
625 for f in files:
626 print '>> gnuplot %s' % os.path.basename(f)
627 os.system('gnuplot %s' % f)
629 def printHeader(self, f):
630 f.write(
631 """<?xml version="1.0" encoding="UTF-8"?>
632 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
633 <html xmlns="http://www.w3.org/1999/xhtml">
634 <head>
635 <title>StatGit</title>
636 <link rel="stylesheet" href="statgit.css" type="text/css" />
637 <meta name="generator" content="statgit" />
638 </head>
639 <body>
640 """)
642 def printNav(self, f):
643 f.write("""
644 <div class="nav">
645 <ul>
646 <li><a href="index.html">General</a></li>
647 <li><a href="activity.html">Activity</a></li>
648 <li><a href="authors.html">Authors</a></li>
649 <li><a href="files.html">Files</a></li>
650 <li><a href="lines.html">Lines</a></li>
651 <li><a href="tags.html">Tags</a></li>
652 </ul>
653 </div>
654 """)
657 usage = """
658 Usage: statgit [options] <gitpath> <outputpath>
660 Options:
663 if len(sys.argv) < 3:
664 print usage
665 sys.exit(0)
667 gitpath = sys.argv[1]
668 outputpath = os.path.abspath(sys.argv[2])
670 print 'Git path: %s' % gitpath
671 print 'Output path: %s' % outputpath
673 os.chdir(gitpath)
675 print 'Collecting data...'
676 data = GitDataCollector()
677 data.collect(gitpath)
679 print 'Generating report...'
680 report = HTMLReportCreator()
681 report.create(data, outputpath)