Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crash when running git-fame in a specific repo #96

Open
waldyrious opened this issue Mar 29, 2020 · 10 comments
Open

Crash when running git-fame in a specific repo #96

waldyrious opened this issue Mar 29, 2020 · 10 comments

Comments

@waldyrious
Copy link
Contributor

waldyrious commented Mar 29, 2020

I can consistently reproduce the following crash by running git fame in the alif-type/libertinus repository.

The command starts executing normally, then stops for several seconds at 68%:

$ git fame
Git Fame:       68% |ooooooooooooooooooooooo            | ETA:   0:00:04

It then crashes with the following output:

#<Thread:0x00007fa8c29868a0@/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/open3.rb:287 run> terminated with exception (report_on_exception is true):
Traceback (most recent call last):
	1: from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/open3.rb:287:in `block (2 levels) in capture3'
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/open3.rb:287:in `read': stream closed in another thread (IOError)

#<Thread:0x00007fa8c2986468@/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/open3.rb:288 run> terminated with exception (report_on_exception is true):
Traceback (most recent call last):
	1: from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/open3.rb:288:in `block (2 levels) in capture3'
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/open3.rb:288:in `read': stream closed in another thread (IOError)

The full stack trace is printed after I hit Ctrl+C:

Traceback (most recent call last):
	23: from /usr/local/bin/git-fame:23:in `<main>'
	22: from /usr/local/bin/git-fame:23:in `load'
	21: from /Library/Ruby/Gems/2.6.0/gems/git_fame-2.5.3/bin/git-fame:36:in `<top (required)>'
	20: from /Library/Ruby/Gems/2.6.0/gems/git_fame-2.5.3/bin/git-fame:36:in `new'
	19: from /Library/Ruby/Gems/2.6.0/gems/git_fame-2.5.3/lib/git_fame/base.rb:92:in `initialize'
	18: from /Library/Ruby/Gems/2.6.0/gems/memoist-0.14.0/lib/memoist.rb:165:in `populate'
	17: from /Library/Ruby/Gems/2.6.0/gems/git_fame-2.5.3/lib/git_fame/base.rb:179:in `populate'
	16: from /Library/Ruby/Gems/2.6.0/gems/git_fame-2.5.3/lib/git_fame/base.rb:179:in `each'
	15: from /Library/Ruby/Gems/2.6.0/gems/git_fame-2.5.3/lib/git_fame/base.rb:188:in `block in populate'
	14: from /Library/Ruby/Gems/2.6.0/gems/git_fame-2.5.3/lib/git_fame/base.rb:314:in `execute'
	13: from /Library/Ruby/Gems/2.6.0/gems/memoist-0.14.0/lib/memoist.rb:209:in `run_with_timeout'
	12: from /Library/Ruby/Gems/2.6.0/gems/git_fame-2.5.3/lib/git_fame/base.rb:327:in `run_with_timeout'
	11: from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/timeout.rb:108:in `timeout'
	10: from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/timeout.rb:33:in `catch'
	 9: from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/timeout.rb:33:in `catch'
	 8: from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/timeout.rb:33:in `block in catch'
	 7: from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/timeout.rb:93:in `block in timeout'
	 6: from /Library/Ruby/Gems/2.6.0/gems/git_fame-2.5.3/lib/git_fame/base.rb:327:in `block in run_with_timeout'
	 5: from /Library/Ruby/Gems/2.6.0/gems/git_fame-2.5.3/lib/git_fame/base.rb:334:in `run_no_timeout'
	 4: from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/open3.rb:281:in `capture3'
	 3: from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/open3.rb:101:in `popen3'
	 2: from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/open3.rb:222:in `popen_run'
	 1: from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/open3.rb:222:in `ensure in popen_run'
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/open3.rb:222:in `join': Interrupt
	17: from /usr/local/bin/git-fame:23:in `<main>'
	16: from /usr/local/bin/git-fame:23:in `load'
	15: from /Library/Ruby/Gems/2.6.0/gems/git_fame-2.5.3/bin/git-fame:36:in `<top (required)>'
	14: from /Library/Ruby/Gems/2.6.0/gems/git_fame-2.5.3/bin/git-fame:36:in `new'
	13: from /Library/Ruby/Gems/2.6.0/gems/git_fame-2.5.3/lib/git_fame/base.rb:92:in `initialize'
	12: from /Library/Ruby/Gems/2.6.0/gems/memoist-0.14.0/lib/memoist.rb:165:in `populate'
	11: from /Library/Ruby/Gems/2.6.0/gems/git_fame-2.5.3/lib/git_fame/base.rb:179:in `populate'
	10: from /Library/Ruby/Gems/2.6.0/gems/git_fame-2.5.3/lib/git_fame/base.rb:179:in `each'
	 9: from /Library/Ruby/Gems/2.6.0/gems/git_fame-2.5.3/lib/git_fame/base.rb:188:in `block in populate'
	 8: from /Library/Ruby/Gems/2.6.0/gems/git_fame-2.5.3/lib/git_fame/base.rb:314:in `execute'
	 7: from /Library/Ruby/Gems/2.6.0/gems/memoist-0.14.0/lib/memoist.rb:209:in `run_with_timeout'
	 6: from /Library/Ruby/Gems/2.6.0/gems/git_fame-2.5.3/lib/git_fame/base.rb:327:in `run_with_timeout'
	 5: from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/timeout.rb:108:in `timeout'
	 4: from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/timeout.rb:33:in `catch'
	 3: from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/timeout.rb:33:in `catch'
	 2: from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/timeout.rb:33:in `block in catch'
	 1: from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/timeout.rb:97:in `block in timeout'
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/timeout.rb:in `ensure in block in timeout': Interrupt

Happy to provide any additional information that may help debug the issue.

@ORESoftware
Copy link

ORESoftware commented Mar 30, 2020

try using this instead

$ npm i -g fame
$ fame 

it's probably a data problem in the git log output, but the NPM package is written to avoid such data issues.

@waldyrious
Copy link
Contributor Author

@ORESoftware that's indeed faster (thanks for the pointer!), but probably because it's counting something different: it seems to show only the total added/deleted/net lines, rather than the number of current code lines last touched by each author.

Don't get me wrong: the total added/deleted/net counts are still valid and useful metrics — just not interchangeable with what git fame does.

@ORESoftware
Copy link

ORESoftware commented Apr 14, 2020

what do you mean by current code lines versus total code lines? perhaps you mean just for the most recent commit?

the NPM package is going to total everything that comes out of git log for a given branch.

@waldyrious
Copy link
Contributor Author

Yes, git fame uses the same information that git blame outputs (i.e. the last person to have touched each line of code) and summarizes that for the entire repository (or specific files/folders).

@oleander
Copy link
Owner

@waldyrious Thanks for the clarification.

@ORESoftware git-fame only looks at HEAD using git blame to generate its statistics, a snapshot of contributions to a project–if you will. That's why it's considerably slower then the library you recommended which uses git log.

@waldyrious
Copy link
Contributor Author

@oleander I did notice that the README does not make this very clear, btw. It would be nice to add a clarification to prevent this mixup, WDYT?

@oleander
Copy link
Owner

@waldyrious Feel free to add it to the README ツ

@ORESoftware
Copy link

ORESoftware commented Apr 16, 2020

so it uses git blame for every commit or just the most recent commit? if its just the most recent commit, then that does not seem very comprehensive.

fame via NPM looks at all the commits on a branch and looks at lines changed for each commit by author.

@oleander
Copy link
Owner

oleander commented Apr 16, 2020 via email

@oleander
Copy link
Owner

@ORESoftware Just read your edit. The difference is that this tool only looks at active contributions. Let's say you wrote 5 LOC. 4 of them were later overridden, deleted or changed**. Now your contribution is only 1 LOC as 4 of them were overridden, deleted or changed.

It's questionable wherever this is a good approach or not. I used it to evaluate a few private projects of mine about 8 years ago. For some reason, people kept on using it.

** Whitespace, newlines, and whatnot does not count

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants