241 Commits

Author SHA1 Message Date
Kirill Chilikin
68d17b105b Fixed calculation of total size of files.
Signed-off-by: Heikki Hokkanen <hoxu@users.sf.net>
2011-10-25 17:16:11 +03:00
Chris Cormack
750ddfe35a Fix for KeyError being generated if a month has commits but for some reason no lines changed
Example of exception

[1.17747] >> gnuplot --version
Traceback (most recent call last):
  File "./gitstats", line 1373, in <module>
      g.run(sys.argv[1:]
  File "./gitstats", line 1365, in run
     report.create(data, outputpath)
  File "./gitstats", line 841, in create
     f.write('<tr><td>%s</td><td>%d</td><td>%d</td><td>%d</td></tr>' % (yymm, data.commits_by_month[yymm], data.lines_added_by_month[yymm],
   data.lines_removed_by_month[yymm]))
KeyError: '2010-08'

Signed-off-by: Heikki Hokkanen <hoxu@users.sf.net>
2011-09-28 19:27:06 +03:00
Karel Rank
2acf4392ad Add statistics about changed lines in time
Stats are calculated for months of year and years. Activity page in
sections 'Commits by year/month' and 'Commits by Year' are enhanced by
this statistic.

Signed-off-by: Heikki Hokkanen <hoxu@users.sf.net>
2011-09-21 19:34:12 +03:00
Stefano Mosconi
c3d67a7e5b Fixing commit_begin conf option
If you tried to pass only -c commit_begin=something this would
always return HEAD in any case since commit_end was set to ''.

Defaulting commit_end to HEAD makes getcommitrange() function work as it
should.

Signed-off-by: Heikki Hokkanen <hoxu@users.sf.net>
2011-04-08 22:41:25 +03:00
Heikki Hokkanen
09f1307a85 Do not consider a dot in path a filename extension.
'highlight.js/LICENSE' was recognized as 'js/LICENSE' extension erroneously.

Fixes SourceForge bug #3221520.

Thanks-to: Alexander Gladysh <agladysh@users.sourceforge.net>
2011-03-21 19:46:09 +02:00
Heikki Hokkanen
04d459ac81 todo: updated. 2011-02-18 17:33:36 +02:00
Matthieu Moy
f1ab9e8373 Don't create ugly graphs on clock skew
We collect and accumulate data based on the order of the output of "git
log", which is not necessarily ordered by timestamp. Adding --date-order
should improve the situation, but isn't sufficient at least on git.git's
repository.

In addition, when encountering a date that is prior to the last one
encountered, we change it to be the last encountered date. A better
solution would be to actually order the lines before starting to count.

Signed-off-by: Heikki Hokkanen <hoxu@users.sf.net>
2011-01-19 18:25:48 +02:00
Heikki Hokkanen
3f0bcc6871 Remove debug print. 2011-01-19 18:07:51 +02:00
Heikki Hokkanen
5722b75c2b Fix author active days calculation.
A set of dates is used now instead of an incremented value. This is the same as
what has been used for General -> active days already.
2011-01-19 17:24:29 +02:00
Heikki Hokkanen
377e7f32e5 Fix first/last commit finding.
Because of cherry-pick and patches, commits may be in any order. This also
improves the support for generating statistics for multiple repositories.
2011-01-18 19:46:46 +02:00
Heikki Hokkanen
19588b9302 Make negative author timedelta positive.
Commit timestamps can be in backwards order (when applying patches &
cherry-picking in reverse order), so we don't want author age to be negative
(was in gitstats case too :)
2011-01-17 20:02:00 +02:00
Heikki Hokkanen
bfd32fdce1 Trivial change to Wulf's patch. 2011-01-17 20:01:25 +02:00
Wulf C. Krueger
beaf16168a Initial changes for multi-repo awareness.
Initial attempt to make gitstats create cumulative statistics for multiple
repos (the case of a single project consisting of more than just one git
repository.)

Signed-off-by: Heikki Hokkanen <hoxu@users.sf.net>
2011-01-17 19:48:54 +02:00
Heikki Hokkanen
6283b0e5b0 Cleanup: whitespace changes & removed extra ';'. 2011-01-17 19:37:30 +02:00
Heikki Hokkanen
079ed2c866 Bump copyright year. 2011-01-17 18:35:51 +02:00
Matthieu Moy
a554942c01 Per-author commit count graph
Signed-off-by: Heikki Hokkanen <hoxu@users.sf.net>
2011-01-16 11:03:02 +02:00
Matthieu Moy
591bad8ac2 Per-author added lines graph
Old versions of gnuplot produce garbage if the author's name contain
non-ascii, but gnuplot 4.4 seems to handle it just fine.

Signed-off-by: Heikki Hokkanen <hoxu@users.sf.net>
2011-01-16 11:02:53 +02:00
Matthieu Moy
117165dd5f Don't compute per-author information with --first-parent
While it's fine to compute project-wide informations (LOC) on a linear
history, we don't want to assign added lines of code to the user doing
a merge when the code was initially written by someone else on a
branch.

Signed-off-by: Heikki Hokkanen <hoxu@users.sf.net>
2011-01-16 10:56:46 +02:00
Heikki Hokkanen
e9a527cb8c Include git and gnuplot version on general page. 2011-01-15 09:00:32 +02:00
Matthieu Moy
872bbedab7 Portable syntax for "set xtics rotate"
Gnuplot version 4.4 renders text within the drawing area with "set
xtics rotate angle 90". According to

http://newsgroups.derkeiler.com/Archive/Comp/comp.graphics.apps.gnuplot/2010-08/msg00079.html
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=586513

this is a feature, not a bug, but "set xtics rotate" give the expected
behavior everywhere (text from down to top, below the graph).

Signed-off-by: Heikki Hokkanen <hoxu@users.sf.net>
2011-01-14 23:07:03 +02:00
Matthieu Moy
5bebafd179 Set image size with "set terminal size", not "set size".
Recent versions of gnuplot understand "set size" as the amount of
space to use within the canava size. "set size 1,0.5" was therefore
creating large images with the top half being blank.

set terminal size works as expected at least with gnuplot 4.4 and 4.2.

Signed-off-by: Heikki Hokkanen <hoxu@users.sf.net>
2011-01-14 23:05:23 +02:00
Heikki Hokkanen
db7fa31293 README: s/GPLv2 or older/GPLv2 or later/.
gitstats is dual-licensed under GPLv2/GPLv3, so naturally the contributions are
asked to be GPLv2+.

Thanks-to: Matthieu Moy <Matthieu.Moy@grenoble-inp.fr>
2011-01-10 20:44:52 +02:00
Heikki Hokkanen
8c0032c63b Make project name configurable (-c project_name=foo). 2011-01-08 11:03:51 +02:00
Heikki Hokkanen
5662647332 Wrap run() inside if __name__. 2011-01-08 10:44:19 +02:00
Heikki Hokkanen
5e11dfbe32 Fix running gitstats with a non-tty stdin.
The following command used to fail because git shortlog has some witty magic to
decide the behaviour based on whether stdin is a terminal:

./gitstats /repo /dst < /dev/null

effectively causing a lot of shell scripts calling gitstats to fail with
"Division by zero" in author statistics.

Thanks-to: Bertrand Jacquin <beber@meleeweb.net>
Thanks-to: Sylvain Rabot <sylvain@abstraction.fr>
2010-10-20 22:14:47 +03:00
Heikki Hokkanen
0656ac9578 Add a new option 'linear_linestats' (default on).
When enabled, the lines of code statistics are collected from linear history.
The downside is that commits of feature long feature branches appear only at
the point where a merge commit is made.

If disabled (old behaviour), the problem is that if two branches contain the
same changes (for example, removal of same lines), the statistics get skewed.

Fixes line count statistics for this example repository:
git://github.com/septract/jstar.git

Thanks-to: Radu Grigore <radugrigore@users.sourceforge.net>
2010-10-17 20:27:21 +03:00
Pekka Enberg
dc0bbb2957 Use perl for version number replacement.
This patch changes Makefile to use perl for version number replacement to fix
'make install' on Darwin. The problem is that GNU sed and sed on Darwin (and
probably on BSDs) behave differently with regards to the '-i' command line
option.

Signed-off-by: Pekka Enberg <penberg@kernel.org>
Signed-off-by: Heikki Hokkanen <hoxu@users.sf.net>
2010-09-28 18:04:46 +03:00
Heikki Hokkanen
9473138e28 Cover options in the manpage. 2010-08-07 10:25:36 +03:00
Heikki Hokkanen
70c7bd5ccc Add a simple manpage.
The manpage is in pod format, and pod2man can be used to convert it.
2010-08-07 10:06:55 +03:00
Heikki Hokkanen
e98d2c9350 Commits by Domains: start yrange from 0.
Will show more truthful graphs when all domains have a lot of commits.
2010-07-23 22:20:29 +03:00
Wulf C. Krueger
1e70f827af Fix potential KeyError with 'lines_added' in 55e46db.
[hoxu@users.sf.net: rewrote commit message]

Signed-off-by: Heikki Hokkanen <hoxu@users.sf.net>
2010-07-02 14:36:08 +03:00
Bo Ørsted Andresen
55e46db71b Respect .mailmap.
Signed-off-by: Heikki Hokkanen <hoxu@users.sf.net>
2010-06-23 16:38:42 +03:00
Heikki Hokkanen
2c38acfd05 Raise KeyError instead of a string exception.
Fixes debian bug #585225:
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=585225
2010-06-10 07:51:50 +03:00
Heikki Hokkanen
bb75f25beb Add options for limiting stats to begin..end range.
Bit hackish and not fully supported, but -c commit_end=HEAD~10 allows limiting
statistics generation to before HEAD~10 for example.
2010-06-08 16:56:38 +03:00
Heikki Hokkanen
cc0f94fd1a Remove extra 'git log' call.
No idea why this was used in the first place, apart from performance hit, it
had no effect.
2010-06-08 16:27:11 +03:00
Heikki Hokkanen
c74f099913 Show average number of commits per author. 2010-04-02 16:12:01 +03:00
Heikki Hokkanen
1567223e98 Show number of authors for each month/year. 2010-04-02 16:07:38 +03:00
Heikki Hokkanen
8bffbaa87e Make "Next top 5" configurable.
"-c authors_top=N" changes how many authors are shown on "Author of month" and
"Author of year".
2010-04-02 16:06:24 +03:00
Heikki Hokkanen
1a00daffc7 Style: white background for table cells. 2010-04-02 16:01:25 +03:00
Tyler Nielsen
6f5314e993 Properly handle empty commits with no changes.
Clear files, inserted and deleted after storing them for the preceding commit.

git-svn, for example, can have empty commits (when a directory is created),
causing the statistics to get skewed.

[hoxu@users.sf.net: rewrote commit message based on Tyler's mail]

Signed-off-by: Heikki Hokkanen <hoxu@users.sf.net>
2010-03-24 07:03:58 +02:00
Tyler Nielsen
1dd89a2322 Open the cache in binary mode.
This fixes an issue where the cache fails to load on Windows machines.
EOL characters were getting modified, causing zlib uncompression to fail.

[hoxu@users.sf.net: slightly modified the commit message]

Signed-off-by: Heikki Hokkanen <hoxu@users.sf.net>
2010-03-24 06:58:56 +02:00
Tobias Gruetzmacher
cef3478bec Name weekdays.
Signed-off-by: Heikki Hokkanen <hoxu@users.sf.net>
2010-02-27 12:55:43 +02:00
Heikki Hokkanen
80ee0af3f1 todo: bug on linux-2.6 repo. 2010-01-31 09:23:09 +02:00
Wulf C. Krueger
d2b5b32071 Don't revert getAuthors' sorting by commits by sorting again.
getAuthors sorts by commits, sorting it again negates that and instead
sorts the list alphabetically again which kind of defeats the purpose.

Signed-off-by: Heikki Hokkanen <hoxu@users.sf.net>
2010-01-18 19:09:11 +02:00
Wulf C. Krueger
b54e19c8c0 Activate grids on y for all graphs.
Signed-off-by: Heikki Hokkanen <hoxu@users.sf.net>

[hoxu@users.sf.net: removed some unrelated changes]
2010-01-18 18:49:28 +02:00
Heikki Hokkanen
572c2b774f Don't choke on one day old repositories. 2010-01-17 09:26:05 +02:00
Heikki Hokkanen
c5cdf5750e Limit author table to 20, and list only name for rest.
Can be overriden with -c max_authors=N
2010-01-17 08:48:22 +02:00
Heikki Hokkanen
13b04c093a Override conf values with right type.
If the value overridden is int, convert new value to int as well.
2010-01-17 08:20:46 +02:00
Heikki Hokkanen
df24a48ce4 Allow overriding of some config variables.
gitstats -c key=value overrides config values.
2010-01-16 16:07:04 +02:00
Heikki Hokkanen
dffb3ca0fa Cleanup: moved rest of the code to a new class. 2010-01-16 15:21:38 +02:00