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]
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>
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>
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.
Bump copyright year.
Catch ZeroDivisionError in 'Average file size'.
Catch ZeroDivisionError in file extension stats.

Otherwise it would not be possible to generate stats for binary-only
repositories.
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 a01045f2480a21f28dd90e278b4f560020a97b9e.
It should no longer be necessary.
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>
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>
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>
Merge branch 'master' of https://github.com/svenvh/gitstats

Signed-off-by: Heikki Hokkanen <hoxu@users.sf.net>
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>
Document linear_linestats and project_name options.