230 Commits

Author SHA1 Message Date
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
Heikki Hokkanen
419243008a Fixed two variable references.
No functional effect at this point.
2010-01-16 15:20:37 +02:00
Heikki Hokkanen
c5d1d33693 Bump copyright year :) 2010-01-16 15:03:39 +02:00
Heikki Hokkanen
cd53ecdcf2 Cache line count in blobs as well. 2010-01-16 14:42:02 +02:00
Heikki Hokkanen
59eb18b413 Wider gnuplot graphs.
Use 1.0,0.5 size for now.
2010-01-16 12:36:25 +02:00
Heikki Hokkanen
7cbace764f Rotate x label for 'Commits by Year'. 2010-01-15 22:41:05 +02:00
Heikki Hokkanen
576f887d59 Oops, actually fix the handling of mails without '@'. 2010-01-15 22:40:14 +02:00
Heikki Hokkanen
48e0acd6fb Fixed handling of weird author e-mails.
Commit e5fc428ecf3b23ed6b1a640bbddff9a59b251969 broke for linux-2.6 repository
for example, so we make a little bit more effort in handling weird e-mail
addresses. The linux-2.6 repository contains quite a few of these, some can be
found with the following command:

git rev-list --pretty=format:"%H %an <%aE>" HEAD | grep -v ^commit |grep -v '@'
2010-01-14 17:53:42 +02:00
Heikki Hokkanen
d4ae9a07a5 Moved 'Commits by Domains' to 'Authors' page.
The activity page is about the date/time of commits, and authors about commit
authorship-related information.
2010-01-11 19:35:57 +02:00
Wulf C. Krueger
e5fc428ecf Add a graph for commits per domain.
Signed-off-by: Heikki Hokkanen <hoxu@users.sf.net>
2010-01-11 17:43:48 +02:00
Wulf C. Krueger
18cc2ebc5b Fix ordering of fields for the list of authors.
commits_frac was used in date_first's place in f.write and, thus, completely
wrong in the resulting HTML report.

Signed-off-by: Heikki Hokkanen <hoxu@users.sf.net>
2010-01-08 17:57:10 +02:00
Heikki Hokkanen
db3ad67b96 todo: analysis. 2010-01-06 10:38:34 +02:00