Extracting the top contributor
Git has a few built-in stats you can get instantaneously. The git log
command has different options, such as --numstat
, that will show the number of files added and lines deleted for each file since each commit. However, for finding the top committer in the repository, we can just use the git shortlog
command.
Â
Getting ready
For all the examples throughout the book, we are using the jgit
repository; you can either clone it or go to one of the clones you might already have.
Clone the jgit
repository as follows:
$ git clone https://git.eclipse.org/r/jgit/jgit chapter6
$ cd chapter6
How to do it...
The shortlog
Git command is very simple and does not have a lot of options or flags to use with it. It can show the log but in a boiled-down version, and then it can summarize it for us as follows:
- Â Start by showing the last five commits with
shortlog
. We can use-5
to limit the amount of output:
$ git shortlog -5
Jonathan Nieder (1):
Update commons-compress to 1.6
...