Commit Graph

271 Commits (master)

Author SHA1 Message Date
Ciaran Gultnieks fb0b4bae3c Do not pass backticks from author names into gnuplot command file 2013-11-04 08:47:28 +00:00
Alexander Strasser a664c2eb6b Fix minor documentation issues
* author.txt was renamed to AUTHOR
* use git shortlog instead of git-shortlog
  because the latter is not necessarily in PATH

Signed-off-by: Heikki Hokkanen <hoxu@users.sf.net>
2013-09-29 10:20:52 +03:00
Heikki Hokkanen c447e55a7a Make number of processes configurable.
Default to 8.
2013-07-29 17:42:36 +03:00
Andrey Devyatkin 8647c75d48 Fix performance issue for huge repositories
Problem: gitstats will read every commit and every file in repository in one
thread during initial statistics generation (i.e. no cache available). It may
take much time in case of huge repositories (100 000+ files) Solution: Execute
all read commands in 24 threads instead of one

Signed-off-by: Heikki Hokkanen <hoxu@users.sf.net>
2013-07-29 17:39:13 +03:00
Heikki Hokkanen 31ff072d23 Bump copyright year. 2013-07-26 22:25:00 +03:00
Heikki Hokkanen a923085699 Refer to manual page in usage. 2013-07-23 17:42:29 +03:00
Stephen Gordon 09d4be558d Add support for -h/--help options.
RHBZ#962168. In response to user request added support for invoking with the -h
or --help argument to print usage information. Previously usage was only
printed if the user provided less than two arguments AND did not provide any
invalid arguments, as they were unhandled the commonly used -h and --help
arguments counted as invalid.

https://bugzilla.redhat.com/show_bug.cgi?id=962168

Signed-off-by: Heikki Hokkanen <hoxu@users.sf.net>
2013-07-23 17:39:46 +03:00
Sven van Haastregt 084303928c Add example invocations to documentation
Signed-off-by: Heikki Hokkanen <hoxu@users.sf.net>
2013-02-24 10:02:25 +02:00
Heikki Hokkanen 3405250939 Rename doc files to uppercase for consistency. 2013-02-24 09:48:33 +02:00
Heikki Hokkanen 0e059fc31c Mention sortable.js license (MIT) in doc/license.
Thanks-to: Stephen Gordon <stephen.a.gordon@gmail.com>
2013-02-24 09:48:27 +02:00
Ernesto Jiménez aa77a8915f Fix total lines for multi-repository stats.
Make general stats total LOC show the total aggregate from all projects,
instead of the total LOC from last project.

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

Signed-off-by: Heikki Hokkanen <hoxu@users.sf.net>
2013-01-31 19:25:43 +02:00
Heikki Hokkanen 19e687b96e Fix cachefile corruption when out of disk space.
Avoid corrupt cache by writing it to a temporary file first, and then
overwriting the original one. Should also fix other exceptional cases.

Thanks-to: Alexander Strasser <eclipse7@gmx.net>
2012-12-17 21:44:20 +02:00
Heikki Hokkanen e6b3058337 Document linear_linestats and project_name options. 2012-07-19 13:08:15 +03:00
Ciaran Gultnieks 380b164bc5 Added ability to merge/rename authors
There's a new config field, 'merge_authors', which is a dictionary of
source name to target name. Whenever an author name matches a source
name it will be treated as if it was the target name instead.

Use this if authors have committed under multiple names, to squash their
statistics down to a single author. You can also use it to rename an
author for the purposes of the output.

Additionally, the -c option has been extended so for a dictionary option
you specify -c field=key,value. The key,value pair is then ADDED to the
dictionary.

Putting it all together in an example:

  ./gitstats -c merge_authors=bob,Bob\ Jones    \
      -c merge_authors=bob2,Bob\ Jones          \
      -c merge_authors=erica,Erica\ Smith ....

Signed-off-by: Heikki Hokkanen <hoxu@users.sf.net>
2012-07-19 11:57:47 +03:00
Heikki Hokkanen 09e324e3d1 Merge branch 'master' of https://github.com/svenvh/gitstats
Signed-off-by: Heikki Hokkanen <hoxu@users.sf.net>
2012-07-17 11:39:02 +03:00
Sven van Haastregt 8b475ea3e6 Fix incorrect gitstats version.
If the VERSION variable was not filled in, gitstats would run
'git rev-parse' on the repository being examined instead of the
gitstats repository.

Signed-off-by: Sven van Haastregt <svhaastr@liacs.nl>
2012-07-15 12:39:58 +02:00
Sven van Haastregt a9b3f0f4fe Check for gnuplot before collecting data.
This should address issue:
Check for gnuplot before running - ID: 3062202
http://sourceforge.net/tracker/?func=detail&aid=3062202&group_id=203965&atid=987711

Signed-off-by: Sven van Haastregt <svhaastr@liacs.nl>
2012-07-14 23:07:00 +02:00
Sven van Haastregt f562f98185 Report proper gnuplot version.
If a custom version of gnuplot would be used by setting the GNUPLOT
environment variable, then still the default gnuplot was called to fill
in the gnuplot version number.

Signed-off-by: Sven van Haastregt <svhaastr@liacs.nl>
2012-07-14 23:03:19 +02:00
Heikki Hokkanen 496228fb74 Remove "total_authors = 0" fallback.
When counting authors, do not fall back to 0 if the git call fails. Zero
authors causes ZeroDivisionError later on otherwise. This reverts an old change
for msysgit on win32, introduced in a01045f248.
It should no longer be necessary.
2012-07-13 21:42:05 +03:00
Heikki Hokkanen 2e1aba41e9 Catch ZeroDivisionError in file extension stats.
Otherwise it would not be possible to generate stats for binary-only
repositories.
2012-07-13 18:07:29 +03:00
Heikki Hokkanen 75b53209da Catch ZeroDivisionError in 'Average file size'. 2012-07-13 17:49:15 +03:00
Heikki Hokkanen 910d179c5f Bump copyright year. 2012-05-28 21:43:20 +03:00
Heikki Hokkanen 4438d41363 Set LC_ALL to 'C'.
Parsing of some git outputs relies on the english language being used, so
explicitly set the locale before running any of them.
2012-05-28 21:42:14 +03:00
Alexander Strasser 464bee6a11 Parse git's diff stat summary more flexibly.
Git versions with commit 7f814632f5d4d7af9f4225ece6039dbc44e03079 print the
stat summary output slightly different. There were two changes that affect
GitStats:

a) Singular forms of files/insertions/deletions may be used
b) The number of counts is now variable ranging from 1 to 3:
   1: only files changed if file count is 0
   2: if either insertions or deletions are 0 (not if both are)
   3: where files,insertions and deletions are >0
          or both insertions and deletions are  0

Signed-off-by: Heikki Hokkanen <hoxu@users.sf.net>
2012-05-28 21:27:40 +03:00
Alexander Strasser 4cce497e96 Calculate commit delta days with full days.
Make the units on par with active commit days. Previously a new project
committed to yesterday at 23:00 and today at 1:00 would have an age of 1 day
but 2 active days.

Signed-off-by: Heikki Hokkanen <hoxu@users.sf.net>
2012-05-25 20:19:32 +03:00
Thomas R. Koll ad7efbb939 Fix commits per tag counting.
A hard-to-spot bug where the total number of commits for a tag was always set
to the number of commits that one of the commiters did and not the cumulated
sum over all commiters.

[hoxu@users.sf.net: created a commit from diff and description sent by Thomas]
2012-03-08 22:40:13 +02:00
Heikki Hokkanen 8aebc9ce66 Skip submodules when counting extensions and file sizes. 2011-11-20 09:50:28 +02:00
Heikki Hokkanen 204d905a9f Show sensible-browser command when running interactively. 2011-10-25 18:12:09 +03:00
Heikki Hokkanen 8b7ddc1f1d Be multirepo-compatible by not resetting total_size. 2011-10-25 17:28:47 +03:00
Kirill Chilikin 502b215425 Fixed calculation of number of files.
Signed-off-by: Heikki Hokkanen <hoxu@users.sf.net>
2011-10-25 17:16:20 +03:00
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