View on GitHub

Git Fame

A command-line tool that helps you summarize and pretty-print git collaborators based on contributions

Download this project as a .zip file Download this project as a tar.gz file

git-fame

Gem Gitter Travis Coveralls My personal webpage

git-fame is a command-line tool that helps you summarize and pretty-print collaborators in a git repository based on contributions.

Example output

Statistics generated from this git repository using git fame .

Statistics based on master
Active files: 21
Active lines: 967
Total commits: 109

Note: Files matching MIME type image, binary has been ignored

+----------------+-----+---------+-------+---------------------+
| name           | loc | commits | files | distribution (%)    |
+----------------+-----+---------+-------+---------------------+
| Linus Oleander | 914 | 106     | 21    | 94.5 / 97.2 / 100.0 |
| f1yegor        | 47  | 2       | 7     |  4.9 /  1.8 / 33.3  |
| David Selassie | 6   | 1       | 2     |  0.6 /  0.9 /  9.5  |
+----------------+-----+---------+-------+---------------------+

Installation

[sudo] gem install git_fame

Usage

Command-line

From a git repository run git fame .

Options

By type

--by-type adds extra columns file types.

+----------------+-----+---------+-------+---------------------+---------+-----+----+---------+-----+
| name           | loc | commits | files | distribution (%)    | unknown | yml | md | gemspec | rb  |
+----------------+-----+---------+-------+---------------------+---------+-----+----+---------+-----+
| Linus Oleander | 914 | 106     | 21    | 94.5 / 97.2 / 100.0 | 32      | 5   | 61 | 23      | 257 |
| f1yegor        | 47  | 2       | 7     |  4.9 /  1.8 / 33.3  | 3       | 5   | 6  | 1       | 10  |
| David Selassie | 6   | 1       | 2     |  0.6 /  0.9 /  9.5  | 2       | 0   | 3  | 0       | 0   |
+----------------+-----+---------+-------+---------------------+---------+-----+----+---------+-----+

Programmatically

Want to work with the data before using it? Here's how.

Constructor arguments

options is a hash with most of the arguments passed to the binary defined above. Take a look at the bin/git-fame file for more information.

repository = GitFame::Base.new(options)

Print table

repository.pretty_puts outputs the statistics as an ascii table.

Print csv table to console

repository.csv_puts outputs the statistics as csv.

Statistics

GitFame
Author

author = repository.authors.first

Testing

  1. Download fixtures (spec/fixtures) using git submodule update --init.
  2. Run rspec using bundle exec rspec.

Note that puts has been disabled to avoid unnecessary output during testing. Visit spec/spec_helper.rb to enable it again.

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Added some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

Requirements

GitFame should work on all Unix based operating system with Git installed.

License

GitFame is released under the MIT license.