GitStats – check your git statistics

After about a 2 year working on a project (huh, it’s pretty much time, am I doing something wrong?!) I got interested in stats how much code lines I did write or commits made. From the very beginning of project we have used Git, which I think is an excellent choice as CVS. Only what I needed is a tool which can create some statistics to view.

Googling around I found a Git statistics generator named GitStats. What’s it doing is examining the repository and produces some interesting statistics from history which is represented in a HTML format. It has several categories created:

  • General – represents info from repository as when was it initiated, how many lines of code it has, total files, age (in days), total commits, authors etc.
  • Activity – weekly, hour of day, day of week, hour of week, month of year, commit by year/month
  • Authors – lists all the authors with number of commits, + lines, – lines, first commit, last commit, age, active days; author of month, author of year
  • Files – list of file extensions, number of files by extension
  • Tags – list tags and it’s info like name, date, commits and authors

I founded very interesting the activity part, which can represent you some of your working behaviors like I done most of my commits on Wednesday.

Day of Week Commits

It’s also pretty easy to use it, after you got your version and met all the requirements of application, you have to run it and only specify the path to directory where is your repository and path where to generate the reports.

$ ./gitstats /var/www/project /var/www/project-stats

GitStats looks like it’s made well, maybe there could be added some statistics also for branches if they exist in repository.