0

Divide by Zero Runtime Error while executing gitstats .Please find the error screenshot below:

With a git repository which contains binary files only, it seems that getTotalLOC() yields zero and leads to a division-by-zero error:

File "/usr/bin/gitstats", line 1034, in create
f.write('<tr><td>%s</td><td>%d (%.2f%%)</td><td>%d (%.2f%%)</td><td>%d</td></tr>' % (ext, files, (100.0 * files) / data.getTotalFiles(), lines, (100.0 * lines) / data.getTotalLOC(), lines / files))
ZeroDivisionError: float division by zero
1
  • 1
    The bug has already been reported here: sourceforge.net/tracker/… (actually your post is a copy&paste of it). It's better to continue discussion on project's site (the author was asking for an example repo)
    – CharlesB
    Jul 10, 2012 at 9:03

1 Answer 1

0

Error occurred when gitstats was installed with apt-get

Download the sourcecode from http://repo.or.cz/w/gitstats.git/snapshot/910d179c5f116254cef7440b8511f97a99b3c277.tar.gz or from the latest master and install.

tar -xzvf gitstats-910d179c5f116254cef7440b8511f97a99b3c277.tar.gz -C .

cd gitstats

sudo make install

run as

sudo gitstats repo_path path_to_store_the_created_stats_results

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.