Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 54 additions & 2 deletions gitstats
Original file line number Diff line number Diff line change
Expand Up @@ -979,11 +979,21 @@ class HTMLReportCreator(ReportCreator):
if len(allauthors) > conf['max_authors']:
f.write('<p class="moreauthors">Only top %d authors shown</p>' % conf['max_authors'])

f.write(html_header(2, 'Cumulated Added Lines of Code per Author (log scale)'))
f.write('<img src="lines_of_code_by_author_logscale.png" alt="Lines of code per Author (log scale)">')
if len(allauthors) > conf['max_authors']:
f.write('<p class="moreauthors">Only top %d authors shown</p>' % conf['max_authors'])

f.write(html_header(2, 'Commits per Author'))
f.write('<img src="commits_by_author.png" alt="Commits per Author">')
if len(allauthors) > conf['max_authors']:
f.write('<p class="moreauthors">Only top %d authors shown</p>' % conf['max_authors'])

f.write(html_header(2, 'Commits per Author (log scale)'))
f.write('<img src="commits_by_author_logscale.png" alt="Commits per Author (log scale)">')
if len(allauthors) > conf['max_authors']:
f.write('<p class="moreauthors">Only top %d authors shown</p>' % conf['max_authors'])

fgl = open(path + '/lines_of_code_by_author.dat', 'w')
fgc = open(path + '/commits_by_author.dat', 'w')

Expand Down Expand Up @@ -1309,7 +1319,9 @@ plot 'lines_of_code.dat' using 1:2 w lines

# Lines of Code Added per author
f = open(path + '/lines_of_code_by_author.plot', 'w')
g = open(path + '/lines_of_code_by_author_logscale.plot', 'w')
f.write(GNUPLOT_COMMON)
g.write(GNUPLOT_COMMON)
f.write(
"""
set terminal png transparent size 640,480
Expand All @@ -1324,6 +1336,23 @@ set ylabel "Lines"
set xtics rotate
set bmargin 6
plot """
)
g.write(
"""
set terminal png transparent size 640,480
set output 'lines_of_code_by_author_logscale.png'
set key left top
set yrange [0.1:]
set ytics add("0" 0.1)
set logscale y
set xdata time
set timefmt "%s"
set format x "%Y-%m-%d"
set grid y
set ylabel "Lines"
set xtics rotate
set bmargin 6
plot """
)
i = 1
plots = []
Expand All @@ -1332,13 +1361,17 @@ plot """
author = a.replace("\"", "\\\"").replace("`", "")
plots.append("""'lines_of_code_by_author.dat' using 1:%d title "%s" w lines""" % (i, author))
f.write(", ".join(plots))
g.write(", ".join(plots))
f.write('\n')

g.write('\n')
f.close()
g.close()

# Commits per author
f = open(path + '/commits_by_author.plot', 'w')
g = open(path + '/commits_by_author_logscale.plot', 'w')
f.write(GNUPLOT_COMMON)
g.write(GNUPLOT_COMMON)
f.write(
"""
set terminal png transparent size 640,480
Expand All @@ -1353,6 +1386,23 @@ set ylabel "Commits"
set xtics rotate
set bmargin 6
plot """
)
g.write(
"""
set terminal png transparent size 640,480
set output 'commits_by_author_logscale.png'
set key left top
set yrange [0.1:]
set ytics add("0" 0.1)
set logscale y
set xdata time
set timefmt "%s"
set format x "%Y-%m-%d"
set grid y
set ylabel "Commits"
set xtics rotate
set bmargin 6
plot """
)
i = 1
plots = []
Expand All @@ -1361,9 +1411,11 @@ plot """
author = a.replace("\"", "\\\"").replace("`", "")
plots.append("""'commits_by_author.dat' using 1:%d title "%s" w lines""" % (i, author))
f.write(", ".join(plots))
g.write(", ".join(plots))
f.write('\n')

g.write('\n')
f.close()
g.close()

os.chdir(path)
files = glob.glob(path + '/*.plot')
Expand Down