Previously I have enjoyed TortoiseSvn's ability to generate simple commit stats for a given SVN repository. I wonder what is available in Git and am particularly interested in :
- Number of commits per user
- Number of lines changed per user
- activity over time (for instance aggregated weekly changes)
Any ideas?
The best tool so far I identfied is gitinspector. It give the set report per user, per week etc
You can install like below with npm
Details to get the links are below
example commands are
etc
Note that, if your repo is on GitHub, you now (May 2013) have a new set of GitHub API to get interesting statistics.
See "File CRUD and repository statistics now available in the API"
That would include:
Here is a simple ruby script that I used to get author, lines added, lines removed, and commit count from git. It does not cover commits over time.
Note that I have a trick where it ignores any commit that adds/removes more than 10,000 lines because I assume that this is a code import of some sort, feel free to modify the logic for your needs. You can put the below into a file called gitstats-simple.rb and then run
contents of gitstats-simple.rb
I've written a small shell script that calculates merge statistics (useful when dealing with a feature-branch-based workflow). Here's an example output on a small repository:
You can use gitlogged gem (https://github.com/dexcodeinc/gitlogged) to get activities by author and date. This will give you report like this:
which returns the following output
First, you don't have to pull anything (as in network pull), because you have the whole repository and the whole history locally. I'm pretty sure there are tools that will give you statistics, but sometimes you can just be creative with the command lines. For instance, this (just out of my head) will give you the number of commits per user:
Other statistics you asked for may need more thought put into it. You may want to see the tools available. Googling for
git statistics
points to theGitStats
tool, which I have no experience with and even less idea of what it takes to get it run on windows, but you can try.