Giter Site home page Giter Site logo

wh136 / git-fame-rb Goto Github PK

View Code? Open in Web Editor NEW

This project forked from oleander/git-fame-rb

0.0 2.0 0.0 248 KB

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

Home Page: http://oleander.io/git-fame-rb

License: MIT License

Ruby 100.00%

git-fame-rb's Introduction

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

  • git fame --by-type Group line counts by file extension (i.e. .rb, .erb, .yml). See the by type section below.
  • git fame --exclude=path1/*,path2/* Comma separated, glob file path to exclude.
  • git fame --include=path1/*,path2/* Comma separated, glob file path to include.
  • git fame --sort=loc Order table by loc. Available options are: loc, files and commits. Default is loc.
  • git fame --hide-progressbar Hide progressbar.
  • git fame --whitespace Ignore whitespace changes when blaming files. More about git blame and whitespace.
  • git fame --repository=/path/to/repo Git repository to be used. Default is the current folder.
  • git fame --branch=HEAD Branch to run on. Default is what HEAD points to.
  • git fame --format=output Output format. Default is pretty. Additional: csv.
  • git fame --after=2010-01-01 Only use commits after this date. Format: yyyy-mm-dd. Note that the given date is included.
  • git fame --before=2016-02-01 Only use commits before this date. Format: yyyy-mm-dd. Note that the given date is included.
  • git fame --verbose Print shell commands used by git-fame.
  • git fame --everything Images and binaries are ignored by default. Include them as well.
  • git fame --timeout Set timeout in seconds for each git command.

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
  • repository.loc (Fixnum) Total number of lines.
  • repository.commits (Fixnum) Total number of commits.
  • repository.files (Fixnum) Total number of files.
  • repository.authors (Array< Author >) All authors.
Author

author = repository.authors.first

  • Formated
    • author.loc (String) Number of lines.
    • author.commits (String) Number of commits.
    • author.files (String) Number of files changed.
  • Non formated
    • author.distribution (String) Distribution (in %) between users (loc/commits/files)
    • author.raw_loc (Fixnum) Number of lines.
    • author.raw_commits (Fixnum) Number of commits.
    • author.raw_files (Fixnum) Number of files changed.
    • author.file_type_counts (Array) File types (k) and loc (v)

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.

git-fame-rb's People

Contributors

oleander avatar f1yegor avatar stevegal avatar andruby avatar dvdmssmnn avatar tarrasch avatar kilobyte22 avatar mattnedrich avatar kelunik avatar timchepeleff avatar

Watchers

James Cloos avatar Eric avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.