Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Make "Next top 5" configurable.

"-c authors_top=N" changes how many authors are shown on "Author of month" and
"Author of year".
  • Loading branch information...
commit 8bffbaa87e5cfd5c7a86b7631a95c64d2a5731dd 1 parent 1a00daf
Heikki Hokkanen hoxu authored

Showing 1 changed file with 5 additions and 4 deletions. Show diff stats Hide diff stats

  1. +5 4 gitstats
9 gitstats
@@ -33,6 +33,7 @@ conf = {
33 33 'max_ext_length': 10,
34 34 'style': 'gitstats.css',
35 35 'max_authors': 20,
  36 + 'authors_top': 5,
36 37 }
37 38
38 39 def getpipeoutput(cmds, quiet = False):
@@ -786,25 +787,25 @@ class HTMLReportCreator(ReportCreator):
786 787 # Authors :: Author of Month
787 788 f.write(html_header(2, 'Author of Month'))
788 789 f.write('<table class="sortable" id="aom">')
789   - f.write('<tr><th>Month</th><th>Author</th><th>Commits (%)</th><th class="unsortable">Next top 5</th></tr>')
  790 + f.write('<tr><th>Month</th><th>Author</th><th>Commits (%%)</th><th class="unsortable">Next top %d</th></tr>' % conf['authors_top'])
790 791 for yymm in reversed(sorted(data.author_of_month.keys())):
791 792 authordict = data.author_of_month[yymm]
792 793 authors = getkeyssortedbyvalues(authordict)
793 794 authors.reverse()
794 795 commits = data.author_of_month[yymm][authors[0]]
795   - next = ', '.join(authors[1:5])
  796 + next = ', '.join(authors[1:conf['authors_top']+1])
796 797 f.write('<tr><td>%s</td><td>%s</td><td>%d (%.2f%% of %d)</td><td>%s</td></tr>' % (yymm, authors[0], commits, (100.0 * commits) / data.commits_by_month[yymm], data.commits_by_month[yymm], next))
797 798
798 799 f.write('</table>')
799 800
800 801 f.write(html_header(2, 'Author of Year'))
801   - f.write('<table class="sortable" id="aoy"><tr><th>Year</th><th>Author</th><th>Commits (%)</th><th class="unsortable">Next top 5</th></tr>')
  802 + f.write('<table class="sortable" id="aoy"><tr><th>Year</th><th>Author</th><th>Commits (%%)</th><th class="unsortable">Next top %d</th></tr>' % conf['authors_top'])
802 803 for yy in reversed(sorted(data.author_of_year.keys())):
803 804 authordict = data.author_of_year[yy]
804 805 authors = getkeyssortedbyvalues(authordict)
805 806 authors.reverse()
806 807 commits = data.author_of_year[yy][authors[0]]
807   - next = ', '.join(authors[1:5])
  808 + next = ', '.join(authors[1:conf['authors_top']+1])
808 809 f.write('<tr><td>%s</td><td>%s</td><td>%d (%.2f%% of %d)</td><td>%s</td></tr>' % (yy, authors[0], commits, (100.0 * commits) / data.commits_by_year[yy], data.commits_by_year[yy], next))
809 810 f.write('</table>')
810 811

0 comments on commit 8bffbaa

Please sign in to comment.
Something went wrong with that request. Please try again.