Giter VIP home page Giter VIP logo

git-fame-rb's Introduction

git-fame git-fame Gem Test Coverage Maintainability

git-fame

git-fame is a command-line tool that helps you summarize and pretty-print collaborators, based on the number of contributions.

The statistics are mostly based on the output of git blame on the current branch. git fame counts the total number of current lines of code (and files) that were last touched by each author, and prints out these totals, along with the number of commits per author, as a sorted table.

Installation

gem install git_fame

Usage

Usage: git fame [OPTIONS] [PATH]

GitFame is a tool to generate a contributor list from git history

Arguments:
  PATH  Path or sub path to the git repository

Options:
  -A, --after [DATE]       Only changes made after this date
  -B, --before [DATE]      Only changes made before this date
      --branch [NAME]      Branch to be used as starting point (default
                           "HEAD")
  -E, --exclude [GLOB]     Exclude files matching the given glob pattern
  -e, --extensions [EXT]   File extensions to be included starting with a
                           period
  -h, --help               Print usage
  -I, --include [GLOB]     Include files matching the given glob pattern
      --log-level [LEVEL]  Log level (permitted: debug,info,warn,error,fatal)

Examples:
  Include commits made since 2010
  git fame --after 2010-01-01

  Include commits made before 2015
  git fame --before 2015-01-01

  Include commits made since 2010 and before 2015
  git fame --after 2010-01-01 --before 2015-01-01

  Only changes made to the main branch
  git fame --branch main

  Only ruby and javascript files
  git fame --extensions .rb .js

  Exclude spec files and the README
  git fame --exclude */**/*_spec.rb README.md

  Only spec files and markdown files
  git fame --include */**/*_spec.rb */**/*.md

  A parent directory of the current directory
  git fame ../other/git/repo

Development

  1. git clone https://github.com/oleander/git-fame-rb.git
  2. bundle install
  3. bundle exec rspec

New release

  1. Update version in lib/git_fame/version.rb
  2. bundle exec rake release
  3. Done!

git-fame-rb's People

Contributors

andruby avatar dependabot[bot] avatar dvdmssmnn avatar f1yegor avatar kelunik avatar kilobyte22 avatar mattnedrich avatar oleander avatar ryecroft avatar sarna avatar stevegal avatar tarrasch avatar timchepeleff avatar waldyrious avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

git-fame-rb's Issues

Invalid byte sequence in US-ASCII (ArgumentError)

Hi,

While trying to run git fame on DragonFly BSD git repo (from that OS too) it fails with the following:

leaf:/home/tuxillo/temp> cat git_fame.log
/usr/local/lib/ruby/gems/1.9/gems/git_fame-1.2.1/lib/git_fame/base.rb:149:in `split': invalid byte sequence in US-ASCII (ArgumentError)
        from /usr/local/lib/ruby/gems/1.9/gems/git_fame-1.2.1/lib/git_fame/base.rb:149:in `block in populate'
        from /usr/local/lib/ruby/gems/1.9/gems/git_fame-1.2.1/lib/git_fame/base.rb:125:in `call'
        from /usr/local/lib/ruby/gems/1.9/gems/git_fame-1.2.1/lib/git_fame/base.rb:125:in `populate'
        from /usr/local/lib/ruby/gems/1.9/gems/git_fame-1.2.1/lib/git_fame/base.rb:44:in `files'
        from /usr/local/lib/ruby/gems/1.9/gems/git_fame-1.2.1/lib/git_fame/base.rb:31:in `pretty_puts'
        from /usr/local/lib/ruby/gems/1.9/gems/git_fame-1.2.1/bin/git-fame:19:in `<top (required)>'
        from /usr/local/bin/git-fame:23:in `load'
        from /usr/local/bin/git-fame:23:in `<main>'
leaf:/home/tuxillo/temp> uname -a
DragonFly leaf.dragonflybsd.org 3.7-DEVELOPMENT DragonFly v3.7.1.1110.g06363-DEVELOPMENT #19: Mon Apr 21 02:22:23 PDT 2014     [email protected]:/usr/obj/usr/src/sys/X86_64_GENERIC  x86_64
leaf:/home/tuxillo/temp> ruby --version
ruby 1.9.3p484 (2013-11-22 revision 43786) [x86_64-dragonfly3]

You can get the repo from: git://git.dragonflybsd.org/dragonfly.git

Let me know if you need more info.

Cheers,
Antonio Huete

Wrong data in by type

I ran
git fame --branch=develop --by-type

screen shot 2016-06-30 at 11 48 45 am

The numbers of all different file types are not adding up to the total loc , and the data seems to be wrong.

I am not sure if I remember it correctly but it used to work fine in some previous version

Add --include flag

It would be great to have an --include flag that would allow a user to only specific certain directories/files to run the report on.

Overall, great gem. Thanks for your work on this.

[Feature Request] Include instead of exclude

Use Case: I would like the ability to chart which members of my team are actively contributing to the test suite.

  • Something along the lines of git fame --include=spec
  • Bonus points for restricting by a date! I'm not sure what the convention here is.
  • Double bonus points (but maybe not worthwhile) for somehow splitting out the lines of code based on passed in criteria. i.e., 'git fame --split=spec' yielding results like so:
+----------------------+-------------+--------------+---------+-------+-------------------+
| name                 | loc (all)   | loc (spec)   | commits | files | distribution      |
+----------------------+-------------+--------------+---------+-------+-------------------+
| Luke Deniston        | 858         | 120          | 57      | 82    | 16.4 / 6.9 / 35.6 |

Note: I'm currently using git fame --exclude=<...big long list of folders that aren't '/spec'>. This gives me some insight, but it includes files in the root (which are too numerous too easily exclude).

Bad users

git fame has incorrectly found a couple of users which don't exist with zero commits in my repo (sorry, can't share the repo).

| "Hello | 1 | 0 | 0 | 0.0 / 0.0 / 0.0 |
| GMT) timestamp with seco... | 1 | 0 | 0 | 0.0 / 0.0 / 0.0 |

Add support for Submodules

Hi, thanks for this awesome tool. But can somebody please add feature for including submodules for statistics as well?

Ruby 2.0 Support

It's coming, and is the default in the next O.S. Would be cool to check my infamy on that too:

ERROR:  Error installing git_fame:
    git_fame requires Ruby version ~> 1.9.0.

Broken for Umlaut in author name

Calling git fame in one of my repos results in:

[…]/gems/git_fame-0.1.0/lib/git_fame/base.rb:122:in `split':
invalid byte sequence in UTF-8 (ArgumentError)

I tried different combinations of encode and force_encoding in the line mentioned, but all I managed to do was replacing the Umlaut ("\x94") by something that shows up as a question mark in the terminal:

execute("git shortlog -se").force_encoding('binary').encode('utf-8', :invalid => :replace, :undef => :replace).split("\n").map do |l| 

Help would be highly appreciated.

Hangs on 82%, constantly

I ran git fame. It runs up until 82%, then hangs. The progress bar doesn't update any more. When I force quite with with Ctrl+C, it gave me the following stack:

$ git fame
Blame:          82% |oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo                | ETA:   0:00:56
from /var/lib/gems/1.9.1/gems/git_fame-0.1.0/lib/git_fame/base.rb:114:in `scan'
from /var/lib/gems/1.9.1/gems/git_fame-0.1.0/lib/git_fame/base.rb:114:in `block (2 levels) in populate'
from /var/lib/gems/1.9.1/gems/git_fame-0.1.0/lib/git_fame/base.rb:110:in `each'
from /var/lib/gems/1.9.1/gems/git_fame-0.1.0/lib/git_fame/base.rb:110:in `block in populate'
from /var/lib/gems/1.9.1/gems/git_fame-0.1.0/lib/git_fame/base.rb:107:in `call'
from /var/lib/gems/1.9.1/gems/git_fame-0.1.0/lib/git_fame/base.rb:107:in `populate'
from /var/lib/gems/1.9.1/gems/git_fame-0.1.0/lib/git_fame/base.rb:33:in `files'
from /var/lib/gems/1.9.1/gems/git_fame-0.1.0/lib/git_fame/base.rb:23:in `pretty_puts'
from /var/lib/gems/1.9.1/gems/git_fame-0.1.0/bin/git-fame:16:in `<top (required)>'
from /usr/local/bin/git-fame:19:in `load'
from /usr/local/bin/git-fame:19:in `<main>'

Does not work in subdirectories

given the following folderstructure

+ project
  + .git
  + subfolder

I can run git fame only in project while I do get Error: Branch 'master' does not exist. in any subfolder. It worked pretty well with 1.7.3 where I got a fame-table of the corresponding subfolder exclusively.

Doesn't work when branch name has some characters

hi,
i ran the following command but it is not giving me correct output because of branch name.
git fame --branch="feature/something-394-409-387-table-major-update"

fatal: Not a valid object name feature/something-394-409-387-table-major-update
fatal: ambiguous argument 'feature/something-394-409-387-table-major-update': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git [...] -- [...]'
Blame: 100% |oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo| Time: 0:00:00

Total number of files: 0
Total number of lines: 0
Total number of commits: 0
0 rows in set

Enable date ranges

Very useful tool. Thank you!

I would like to be able to run this with date ranges, like the git log options: since, before, etc.

Per branch?

Super awesome. best of the tools/techniques tried. Can you limit it per branch? We have people who do major refactorings and other large lines of code changes and this throws off the true accounting. Each branch is the work for a project; so, that would be perfect!

Wrong percentage of files?

I run the command agains a small repo that was recently refactored and found got this table:

Total number of files: 27
Total number of lines: 1,025
Total number of commits: 69
+--------------------+-----+---------+-------+--------------------+
| name               | loc | commits | files | distribution       |
+--------------------+-----+---------+-------+--------------------+
| xxxxxxxxxxxxxx     | 558 | 38      | 25    | 54.4 / 55.1 / 92.6 |
| xxxxxxxxx          | 452 | 12      | 13    | 44.1 / 17.4 / 48.1 |
| xxxxx              | 8   | 12      | 2     | 0.8 / 17.4 / 7.4   |
| xxxxxxxxxxxxxxxxxx | 4   | 3       | 1     | 0.4 / 4.3 / 3.7    |
| xxxxxxxxxx         | 2   | 2       | 1     | 0.2 / 2.9 / 3.7    |
| xxxxx              | 1   | 1       | 1     | 0.1 / 1.4 / 3.7    |
| xxxxxxxxxxxxxxx    | 0   | 1       | 0     | 0.0 / 1.4 / 0.0    |
+--------------------+-----+---------+-------+--------------------+

As can be seen there, the distribution of files is not totalling 100% but more because, I guess, many files were added/removed.

Is that the case? How the correct percentage can be shown? Thanks!!

Does not work on repositories with sub-modules

If scanning a repository that is using git sub-modules, the process will fail.

Assuming the submodule is named SubModule the following error will be thrown.

Error: Could not run 'git --git-dir='.../ExampleRepo/.git' --work-tree='.../ExampleRepo' blame --encoding=UTF-8 -p -M --date=local master  -- 'SubModule'' => fatal: no such path SubModule in master.

v2.5.1 does not work on files with spaces in name

Hi,
I got an error when git contains a file with white space in the name.
Here are simple reproduction steps:

# git touch "a b"
# git add "a b"
# git commit -m "a b"
# git fame
Error: Could not run 'git --git-dir='/tmp/test.git/.git' --work-tree='/tmp/test.git' blame --encoding=UTF-8 -p -M --date=local master  -- 'b'' => fatal: no such path b in master.TA:   0:00:00
Try --help for help.

Thanks
Piotr

Progressbar does not show ETA

but It did before upgrading.

I checked 1.7.3 which happened to be still in 1.9.3 gemset, which has ETA on progressbar, and also checked 2.3.1 which happens to be the most current one.

Argument to --timeout needs to be positiv

Reproduce

linux-kernel$ git fame
Error: Maximum timeout of 10 sec exceed. Try passing --timeout=<sec> or -1 for no timeout.
Try --help for help.

linux-kernel$ git fame --help
git-fame 2.2.0 (c) 2012-2016 Linus Oleander
[...]
  -m, --timeout=<i>         Set timeout in seconds for each git command. Turn off by using -1 (default: 10)
[...]

linux-kernel$ git-fame --timeout=-1
Error: argument --timeout must be positive.
Try --help for help.

Expected behaviour

Do not error and do not timeout when called with --timeout=-1 or do not mention -1 for no timeout in help at all, but I'd really prefer to have an option to put off time outs.

No manual entry for `git-fame`

It worked with 2.2 IIRC but now:

$ git fame --help
No manual entry for git-fame
See 'man 7 undocumented' for help when manual pages are not available.

Error: could not run...

13:37 $ git fame --verbose --after=2015-08-01

git log --encoding=UTF-8 --pretty=format:'%cd' --date=local master | head -1
git log --encoding=UTF-8 --pretty=format:'%cd' --date=local master | tail -1
git rev-list --before='2015-07-31 23:59:59' --date=local 'master' | head -1
git diff --name-status --encoding=UTF-8 --date=local a5b6899fb93809eefd3f377ef8e1f1315e5e0834..master | grep -v '^D' | cut -f2-
git show master:'warning: inexact rename detection was skipped due to too many files.' | LC_ALL=C file --mime-type -
Error: Could not run 'git blame --encoding=UTF-8 -p -M --date=local a5b6899fb93809eefd3f377ef8e1f1315e5e0834..master  -- 'warning: inexact rename detection was skipped due to too many files.'' => fatal: no such path warning: inexact rename detection was skipped due to too many files. in master
13:37 $ git --version

git version 2.8.1

--exclude does not work on debian 8.0 with ruby 2.1

git fame --whitespace --exclude=./bower_components
outputs the exact same as
git fame --whitespace

changing the path to be absolute has no effect.
changing the path to point directly to a folder with no subfolders and only src files has no effect.

Use current branch as default branch

I like git-fame, but I noticed one big limitation right from the start:

$ git fame
/var/lib/gems/2.1.0/gems/git_fame-1.5.0/lib/git_fame/base.rb:185:in `populate': Does 'master' exist? (GitFame::BranchNotFound)

This is on 'dev' branch, on a repository which doesn't have a 'master' branch at all.

Now I can fix this by using git fame -a dev, but I'm surprised git fame just doesn't use the current branch as default, instead of 'master'. This would be just natural to me...

Tested with: git-fame 1.5.0 (c) 2015 Linus Oleander

--bytype option gives error

git fame works fine, but --bytype raises exception

$ git fame --bytype
Blame:         100% |oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo| Time:   0:01:07

Total number of files: 1,524
Total number of lines: 158,853
Total number of commits: 1,001
/Users/anton/.rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/gems/hirb-0.7.2/lib/hirb/helpers/object_table.rb:10:in `test': wrong number of arguments (0 for 2..3) (ArgumentError)
    from /Users/anton/.rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/gems/hirb-0.7.2/lib/hirb/helpers/object_table.rb:10:in `block (2 levels) in render'
    from /Users/anton/.rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/gems/hirb-0.7.2/lib/hirb/helpers/object_table.rb:10:in `each'
    from /Users/anton/.rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/gems/hirb-0.7.2/lib/hirb/helpers/object_table.rb:10:in `inject'
    from /Users/anton/.rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/gems/hirb-0.7.2/lib/hirb/helpers/object_table.rb:10:in `block in render'
    from /Users/anton/.rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/gems/hirb-0.7.2/lib/hirb/helpers/object_table.rb:9:in `each'
    from /Users/anton/.rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/gems/hirb-0.7.2/lib/hirb/helpers/object_table.rb:9:in `inject'
    from /Users/anton/.rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/gems/hirb-0.7.2/lib/hirb/helpers/object_table.rb:9:in `render'
    from /Users/anton/.rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/gems/hirb-0.7.2/lib/hirb/helpers/auto_table.rb:22:in `render'
    from /Users/anton/.rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/gems/hirb-0.7.2/lib/hirb/formatter.rb:73:in `_format_output'
    from /Users/anton/.rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/gems/hirb-0.7.2/lib/hirb/formatter.rb:56:in `format_output'
    from /Users/anton/.rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/gems/hirb-0.7.2/lib/hirb/view.rb:204:in `render_output'
    from /Users/anton/.rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/gems/hirb-0.7.2/lib/hirb/console.rb:18:in `render_output'
    from /Users/anton/.rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/gems/hirb-0.7.2/lib/hirb/console.rb:30:in `table'
    from /Users/anton/.rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/gems/git_fame-1.2.1/lib/git_fame/base.rb:37:in `pretty_puts'
    from /Users/anton/.rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/gems/git_fame-1.2.1/bin/git-fame:26:in `<top (required)>'
    from /Users/anton/.rbenv/versions/2.0.0-p353/bin/git-fame:23:in `load'
    from /Users/anton/.rbenv/versions/2.0.0-p353/bin/git-fame:23:in `<main>'

submodules appear to break my fame

I have a submodule and getting an error for its directory. Any hints? Thanks!

▶ git fame

Error: Could not run 'git --git-dir='/x/y/z/.git' --work-tree='/x/y/z' blame --encoding=UTF-8 -p -M --date=local master  -- 'my-submodule'' => fatal: no such path my-submodule in master.
Try --help for help.

Installation instructions not working

I tried gem install git_fame, with and without sudo, and it seemed to succeed, but git fame is not a valid command (git_fame doesn't do anything either). Any ideas?

❯ gem install git_fame                                                                                                                                                          ⏎
Fetching: string-scrub-0.0.5.gem (100%)
Building native extensions.  This could take a while...
Successfully installed string-scrub-0.0.5
Fetching: mimer_plus-0.0.4.gem (100%)
Successfully installed mimer_plus-0.0.4
Fetching: hirb-0.7.3.gem (100%)
Successfully installed hirb-0.7.3
Fetching: trollop-2.1.2.gem (100%)
Successfully installed trollop-2.1.2
Fetching: progressbar-0.21.0.gem (100%)
Successfully installed progressbar-0.21.0
Fetching: git_fame-1.3.0.gem (100%)
Successfully installed git_fame-1.3.0
Parsing documentation for string-scrub-0.0.5
Installing ri documentation for string-scrub-0.0.5
Parsing documentation for mimer_plus-0.0.4
Installing ri documentation for mimer_plus-0.0.4
Parsing documentation for hirb-0.7.3
Installing ri documentation for hirb-0.7.3
Parsing documentation for trollop-2.1.2
Installing ri documentation for trollop-2.1.2
Parsing documentation for progressbar-0.21.0
Installing ri documentation for progressbar-0.21.0
Parsing documentation for git_fame-1.3.0
Installing ri documentation for git_fame-1.3.0
Done installing documentation for string-scrub, mimer_plus, hirb, trollop, progressbar, git_fame after 2 seconds
6 gems installed
❯ git fame
git: 'fame' is not a git command. See 'git --help'.

Did you mean this?
    blame
❯ git_fame                                                                                                                                                                      ⏎
zsh: command not found: git_fame
❯ ruby --version                                                                                                                                                                ⏎
ruby 2.2.2p95 (2015-04-13 revision 50295) [x86_64-darwin14]

undefined method `strip' for nil:NilClass (NoMethodError)

Hi.
On Arch Linux, I am getting this error:

/home/phillip/.gem/ruby/2.3.0/gems/git_fame-2.3.1/lib/git_fame/base.rb:368:in `author_by_email': undefined method `strip' for nil:NilClass (NoMethodError)
        from /home/phillip/.gem/ruby/2.3.0/gems/git_fame-2.3.1/lib/git_fame/base.rb:212:in `block (2 levels) in populate'
        from /home/phillip/.gem/ruby/2.3.0/gems/git_fame-2.3.1/lib/git_fame/base.rb:210:in `map'
        from /home/phillip/.gem/ruby/2.3.0/gems/git_fame-2.3.1/lib/git_fame/base.rb:210:in `block in populate'
        from /home/phillip/.gem/ruby/2.3.0/gems/git_fame-2.3.1/lib/git_fame/base.rb:319:in `execute'
        from /home/phillip/.gem/ruby/2.3.0/gems/git_fame-2.3.1/lib/git_fame/base.rb:209:in `populate'
        from /home/phillip/.gem/ruby/2.3.0/gems/memoist-0.14.0/lib/memoist.rb:165:in `populate'
        from /home/phillip/.gem/ruby/2.3.0/gems/git_fame-2.3.1/lib/git_fame/base.rb:93:in `initialize'
        from /home/phillip/.gem/ruby/2.3.0/gems/git_fame-2.3.1/bin/git-fame:36:in `new'
        from /home/phillip/.gem/ruby/2.3.0/gems/git_fame-2.3.1/bin/git-fame:36:in `<top (required)>'
        from /home/phillip/.gem/ruby/2.3.0/bin/git-fame:23:in `load'
        from /home/phillip/.gem/ruby/2.3.0/bin/git-fame:23:in `<main>'

Any idea how to solve this ?

Invalid byte sequence in UTF-8

/var/lib/gems/1.9.1/gems/git_fame-1.2.1/lib/git_fame/base.rb:149:in `split': invalid byte sequence in UTF-8 (ArgumentError)ooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo| ETA:   0:00:00
    from /var/lib/gems/1.9.1/gems/git_fame-1.2.1/lib/git_fame/base.rb:149:in `block in populate'
    from /var/lib/gems/1.9.1/gems/git_fame-1.2.1/lib/git_fame/base.rb:125:in `call'
    from /var/lib/gems/1.9.1/gems/git_fame-1.2.1/lib/git_fame/base.rb:125:in `populate'
    from /var/lib/gems/1.9.1/gems/git_fame-1.2.1/lib/git_fame/base.rb:44:in `files'
    from /var/lib/gems/1.9.1/gems/git_fame-1.2.1/lib/git_fame/base.rb:31:in `pretty_puts'
    from /var/lib/gems/1.9.1/gems/git_fame-1.2.1/bin/git-fame:19:in `<top (required)>'
    from /usr/local/bin/git-fame:23:in `load'
    from /usr/local/bin/git-fame:23:in `<main>'

Cannot install

After running sudo gem install git_fame on OS X El Capitan, I receive the following error

Building native extensions.  This could take a while...
ERROR:  Error installing git_fame:
    ERROR: Failed to build gem native extension.

    /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby extconf.rb
mkmf.rb can't find header files for ruby at /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/include/ruby.h


Gem files will remain installed in /Library/Ruby/Gems/2.0.0/gems/string-scrub-0.0.5 for inspection.
Results logged to /Library/Ruby/Gems/2.0.0/gems/string-scrub-0.0.5/ext/string/gem_make.out

any thoughts?

can not install when ruby version > 2.1

$ gem install git_fame
Fetching: mimer_plus-0.0.4.gem (100%)
Successfully installed mimer_plus-0.0.4
Fetching: progressbar-0.21.0.gem (100%)
Successfully installed progressbar-0.21.0
Fetching: string-scrub-0.1.1.gem (100%)
ERROR:  Error installing git_fame:
    string-scrub requires Ruby version < 2.1, >= 1.9.3.
$ rvm current
ruby-2.2.5

the gem string-scrub only install with ruby 1.9.3 ~ 2.0.x

Add a % after the distribution stats

My current git fame shows:

+----------------------+-----+---------+-------+--------------------+
| name                 | loc | commits | files | distribution       |
+----------------------+-----+---------+-------+--------------------+
| Jalem Raj Rohit      | 148 | 16      | 10    | 96.1 / 94.1 / 90.9 |
| [email protected] | 6   | 1       | 1     | 3.9 / 5.9 / 9.1    |
+----------------------+-----+---------+-------+--------------------+

Wouldn't it be nice and more clear, if the %age values have a % after them? Like:

+----------------------+-----+---------+-------+--------------------+
| name                 | loc | commits | files | distribution       |
+----------------------+-----+---------+-------+--------------------+
| Jalem Raj Rohit      | 148 | 16      | 10    | 96.1% / 94.1% / 90.9% |
| [email protected] | 6   | 1       | 1     | 3.9% / 5.9 %/ 9.1%    |
+----------------------+-----+---------+-------+--------------------+

ArgumentError

I got this error with the --bytype option.

/var/lib/gems/1.9.1/gems/git_fame-1.7.3/lib/git_fame/author.rb:54:in `inc': wrong number of arguments (0 for 2) (ArgumentError)
        from /var/lib/gems/1.9.1/gems/hirb-0.7.3/lib/hirb/helpers/object_table.rb:10:in `block (2 levels) in render'
        from /var/lib/gems/1.9.1/gems/hirb-0.7.3/lib/hirb/helpers/object_table.rb:10:in `each'
        from /var/lib/gems/1.9.1/gems/hirb-0.7.3/lib/hirb/helpers/object_table.rb:10:in `inject'
        from /var/lib/gems/1.9.1/gems/hirb-0.7.3/lib/hirb/helpers/object_table.rb:10:in `block in render'
        from /var/lib/gems/1.9.1/gems/hirb-0.7.3/lib/hirb/helpers/object_table.rb:9:in `each'
        from /var/lib/gems/1.9.1/gems/hirb-0.7.3/lib/hirb/helpers/object_table.rb:9:in `inject'
        from /var/lib/gems/1.9.1/gems/hirb-0.7.3/lib/hirb/helpers/object_table.rb:9:in `render'
        from /var/lib/gems/1.9.1/gems/hirb-0.7.3/lib/hirb/helpers/auto_table.rb:22:in `render'
        from /var/lib/gems/1.9.1/gems/hirb-0.7.3/lib/hirb/formatter.rb:73:in `_format_output'
        from /var/lib/gems/1.9.1/gems/hirb-0.7.3/lib/hirb/formatter.rb:56:in `format_output'
        from /var/lib/gems/1.9.1/gems/hirb-0.7.3/lib/hirb/view.rb:205:in `render_output'
        from /var/lib/gems/1.9.1/gems/hirb-0.7.3/lib/hirb/console.rb:18:in `render_output'
        from /var/lib/gems/1.9.1/gems/hirb-0.7.3/lib/hirb/console.rb:30:in `table'
        from /var/lib/gems/1.9.1/gems/git_fame-1.7.3/lib/git_fame/base.rb:77:in `pretty_puts'
        from /var/lib/gems/1.9.1/gems/git_fame-1.7.3/bin/git-fame:35:in `<top (required)>'
        from /usr/local/bin/git-fame:23:in `load'
        from /usr/local/bin/git-fame:23:in `<main>'

Hope that helps.

Update README

I suggest moving the Requirements section upward and place it right below the Installation step. There is no sense on hiding it underneath. I've tried to install git-fame but failed, then I've found out that the version of my ruby is not compatible.

Exclude not working on 2.3.1 on El Capitan

Always getting: Tim Broder | 15,231 which is wrong. The pod directory was committed at one point, then removed

Any other info I can give?

Thanks!

bash-3.2$ ruby -v
ruby 2.3.0p0 (2015-12-25 revision 53290) [x86_64-darwin15]
bash-3.2$ git fame
Git Fame: |=============================================================================================================================================================================================|

Statistics based on master
Active files: 392
Active lines: 58,633
Total commits: 696

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

+--------------------+--------+---------+-------+--------------------+
| name               | loc    | commits | files | distribution (%)   |
+--------------------+--------+---------+-------+--------------------+
| Yannick Cahn       | 30,744 | 37      | 158   | 52.4 /  5.3 / 40.3 |
| Tim Broder         | 15,231 | 528     | 296   | 26.0 / 75.9 / 75.5 |
| Michael Helmbrecht | 11,101 | 122     | 151   | 18.9 / 17.5 / 38.5 |
| Simon Weingand     | 1,557  | 1       | 26    |  2.7 /  0.1 /  6.6 |
| SimonWeingand      | 0      | 8       | 0     |  0.0 /  1.1 /  0.0 |
+--------------------+--------+---------+-------+--------------------+
5 rows in set
bash-3.2$ git fame --exclude=KidFund/Pods*
Git Fame: |=============================================================================================================================================================================================|

Statistics based on master
Active files: 392
Active lines: 58,633
Total commits: 696

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

+--------------------+--------+---------+-------+--------------------+
| name               | loc    | commits | files | distribution (%)   |
+--------------------+--------+---------+-------+--------------------+
| Yannick Cahn       | 30,744 | 37      | 158   | 52.4 /  5.3 / 40.3 |
| Tim Broder         | 15,231 | 528     | 296   | 26.0 / 75.9 / 75.5 |
| Michael Helmbrecht | 11,101 | 122     | 151   | 18.9 / 17.5 / 38.5 |
| Simon Weingand     | 1,557  | 1       | 26    |  2.7 /  0.1 /  6.6 |
| SimonWeingand      | 0      | 8       | 0     |  0.0 /  1.1 /  0.0 |
+--------------------+--------+---------+-------+--------------------+
5 rows in set
bash-3.2$ git fame --exclude=KidFund/Pods**
Git Fame: |=============================================================================================================================================================================================|

Statistics based on master
Active files: 392
Active lines: 58,633
Total commits: 696

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

+--------------------+--------+---------+-------+--------------------+
| name               | loc    | commits | files | distribution (%)   |
+--------------------+--------+---------+-------+--------------------+
| Yannick Cahn       | 30,744 | 37      | 158   | 52.4 /  5.3 / 40.3 |
| Tim Broder         | 15,231 | 528     | 296   | 26.0 / 75.9 / 75.5 |
| Michael Helmbrecht | 11,101 | 122     | 151   | 18.9 / 17.5 / 38.5 |
| Simon Weingand     | 1,557  | 1       | 26    |  2.7 /  0.1 /  6.6 |
| SimonWeingand      | 0      | 8       | 0     |  0.0 /  1.1 /  0.0 |
+--------------------+--------+---------+-------+--------------------+
5 rows in set

bash-3.2$ git fame --exclude=KidFund/Pods/*
Git Fame: |=============================================================================================================================================================================================|

Statistics based on master
Active files: 392
Active lines: 58,633
Total commits: 696

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

+--------------------+--------+---------+-------+--------------------+
| name               | loc    | commits | files | distribution (%)   |
+--------------------+--------+---------+-------+--------------------+
| Yannick Cahn       | 30,744 | 37      | 158   | 52.4 /  5.3 / 40.3 |
| Tim Broder         | 15,231 | 528     | 296   | 26.0 / 75.9 / 75.5 |
| Michael Helmbrecht | 11,101 | 122     | 151   | 18.9 / 17.5 / 38.5 |
| Simon Weingand     | 1,557  | 1       | 26    |  2.7 /  0.1 /  6.6 |
| SimonWeingand      | 0      | 8       | 0     |  0.0 /  1.1 /  0.0 |
+--------------------+--------+---------+-------+--------------------+
5 rows in set

Doesn't work at all on Ruby 1.9.3

Fresh install. OS X doesn't support / include Ruby 1.9.2, minimal version you can upgrade to is 1.9.3-p125 (first version to support clang).

Doesn't work on 1.9.3-p125:

git fame

git-fame:19:in `load': /Users/adam/.rvm/gems/ruby-1.9.3-p125/gems/git_fame-0.1.0/bin/git-fame:9: syntax error, unexpected ':', expecting kEND (SyntaxError)
opt :repository, "What git repository should be used?", default: "."
^
git_fame-0.1.0/bin/git-fame:10: syntax error, unexpected ':', expecting kEND
... #{sort.join(", ")}", default: "loc", type: String
^
git_fame-0.1.0/bin/git-fame:10: syntax error, unexpected ',', expecting kEND
....join(", ")}", default: "loc", type: String
^
git_fame-0.1.0/bin/git-fame:11: syntax error, unexpected ':', expecting kEND
... during calculation", default: 1, type: Integer
^
git_fame-0.1.0/bin/git-fame:17: odd number list for Hash
repository: opts[:repository],
^
git_fame-0.1.0/bin/git-fame:17: syntax error, unexpected ':', expecting '}'
repository: opts[:repository],
^
git_fame-0.1.0/bin/git-fame:18: syntax error, unexpected ':', expecting '='
progressbar: opts[:progressbar] == 1,
^
git_fame-0.1.0/bin/git-fame:18: syntax error, unexpected ',', expecting $end
from bin/git-fame:19
from bin/ruby_noexec_wrapper:14

CSV output

It would be nice to have CSV output, so we can use these metrics in easily in other programs, like Excel for example.

Commit counts don't match up for email address changes

I ran git fame and git shortlog -s -n --all on a project at work. I expected the commit counts to match, but they don't -

> git fame 
+------------------+---------+---------+-------+--------------------+
| name             | loc     | commits | files | distribution (%)   |
+------------------+---------+---------+-------+--------------------+
| *redacted*       | 122,555 | 983     | 250   | 63.2 / 58.8 / 40.8 |
| Joshua Kramer    | 59,593  | 207     | 543   | 30.7 / 12.4 / 88.6 |
| *redacted*       | 4,952   | 179     | 76    |  2.6 / 10.7 / 12.4 |
| *redacted*       | 2,642   | 31      | 103   |  1.4 /  1.9 / 16.8 |
| Josh Kramer      | 2,136   | 121     | 103   |  1.1 /  7.2 / 16.8 |
| *redacted*       | 926     | 17      | 16    |  0.5 /  1.0 /  2.6 |
| *redacted*       | 675     | 35      | 45    |  0.3 /  2.1 /  7.3 |
| *redacted*       | 297     | 52      | 24    |  0.2 /  3.1 /  3.9 |
| *redacted*       | 140     | 38      | 11    |  0.1 /  2.3 /  1.8 |
| *redacted*       | 0       | 2       | 0     |  0.0 /  0.1 /  0.0 |
| *redacted*       | 0       | 8       | 0     |  0.0 /  0.5 /  0.0 |
+------------------+---------+---------+-------+--------------------+
> git shortlog -s -n
  1928  Josh Kramer
   983  *redacted*
   362  *redacted*
   222  *redacted*
   207  Joshua Kramer
    52  *redacted*
    39  *redacted*
    38  *redacted*
    37  *redacted*
    35  *redacted*
    18  *redacted*
     8  *redacted*
     7  *redacted*
     2  *redacted*

The repo has almost 4k commits, so I would believe the git shortlog counts more than the git fame counts.

(the "Joshua Kramer" commits are due to how my name is in BitBucket vs my git config. However, I always commit with "Josh Kramer" locally)

When I started committing to this project my email address was my personal Github email address. It wasn't for a long time that I realized it wasn't my work email address and I changed it to that. However, I kept my name "Josh Kramer". It looks like git fame is ignoring a bunch of my commits!

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.