git_stats
git_stats copied to clipboard
Currently it works only under linux, add windows support
With Ubuntu, Ruby 1.9.3 and git_stat 1.0.3 I got many errors like error: wrong index v2 file size in .git/objects/pack/pack-7f8cc50b1fbf80a6e90046c6d0785ad96492f950.idx
The git repository is from Bitbucket.
Sounds like corrupted repository, verify it with
$ git fsck --full
If it doesn't help maybe try cloning it again from bitbucket.
Thanks for helping! Indeed the repository was corrupted. After fixing it git_stats worked like a charm.
@tomgi I would be willing to help add Windows support, do you already have a list of items that need to be fixed?
I have no idea, just try to run it and see where it crashes ;) The main problem are unix commands like grep used in some places.
:+1: Brilliant tool, cheers. I just wish I saved my self 90 minutes of pain by spotting the header for this issue :)
Hi,
I try to use it on windows and i get this
fatal: |: no such path in the working tree.
Use 'git rescue in files_by_extension_count': GitStats::GitData::Repo#files_by_exte nsion_count delegated to last_commit.files_by_extension_count, but last_commit i(...) from C:in
files_by_extension_count'
from C:/Ruby200/lib/ruby/gems/2.0.0/gems/git_stats-1.0.14/lib/git_stats/
stats_view/charts/repo_charts.rb:13:in block in files_by_extension' from C:/Ruby200/lib/ruby/gems/2.0.0/gems/git_stats-1.0.14/lib/git_stats/ stats_view/charts/chart.rb:13:in
initialize'
from C:/Ruby200/lib/ruby/gems/2.0.0/gems/git_stats-1.0.14/lib/git_stats/
stats_view/charts/repo_charts.rb:11:in new' from C:/Ruby200/lib/ruby/gems/2.0.0/gems/git_stats-1.0.14/lib/git_stats/ stats_view/charts/repo_charts.rb:11:in
files_by_extension'
from C:in files_by_extension' from C:/Ruby200/lib/ruby/gems/2.0.0/gems/git_stats-1.0.14/templates/file s/_files.haml:15:in
block in singleton class'
from C:/Ruby200/lib/ruby/gems/2.0.0/gems/git_stats-1.0.14/templates/file
s/_files.haml:131063:in instance_eval' from C:/Ruby200/lib/ruby/gems/2.0.0/gems/git_stats-1.0.14/templates/file s/_files.haml:131063:in
singleton class'
from C:/Ruby200/lib/ruby/gems/2.0.0/gems/git_stats-1.0.14/templates/file
s/_files.haml:131061:in __tilt_17639604' from C:/Ruby200/lib/ruby/gems/2.0.0/gems/tilt-2.0.1/lib/tilt/template.rb :155:in
call'
from C:/Ruby200/lib/ruby/gems/2.0.0/gems/tilt-2.0.1/lib/tilt/template.rb
:155:in evaluate' from C:/Ruby200/lib/ruby/gems/2.0.0/gems/tilt-2.0.1/lib/tilt/haml.rb:17: in
evaluate'
from C:/Ruby200/lib/ruby/gems/2.0.0/gems/tilt-2.0.1/lib/tilt/template.rb
:96:in render' from C:/Ruby200/lib/ruby/gems/2.0.0/gems/git_stats-1.0.14/lib/git_stats/ stats_view/template.rb:15:in
render'
from C:/Ruby200/lib/ruby/gems/2.0.0/gems/git_stats-1.0.14/lib/git_stats/
stats_view/view_data.rb:18:in render_partial' from C:/Ruby200/lib/ruby/gems/2.0.0/gems/git_stats-1.0.14/templates/file s/by_extension.haml:1:in
block in singleton class'
from C:/Ruby200/lib/ruby/gems/2.0.0/gems/git_stats-1.0.14/templates/file
s/by_extension.haml:131062:in instance_eval' from C:/Ruby200/lib/ruby/gems/2.0.0/gems/git_stats-1.0.14/templates/file s/by_extension.haml:131062:in
singleton class'
from C:/Ruby200/lib/ruby/gems/2.0.0/gems/git_stats-1.0.14/templates/file
s/by_extension.haml:131060:in __tilt_17639604' from C:/Ruby200/lib/ruby/gems/2.0.0/gems/tilt-2.0.1/lib/tilt/template.rb :155:in
call'
from C:/Ruby200/lib/ruby/gems/2.0.0/gems/tilt-2.0.1/lib/tilt/template.rb
:155:in evaluate' from C:/Ruby200/lib/ruby/gems/2.0.0/gems/tilt-2.0.1/lib/tilt/haml.rb:17: in
evaluate'
from C:/Ruby200/lib/ruby/gems/2.0.0/gems/tilt-2.0.1/lib/tilt/template.rb
:96:in render' from C:/Ruby200/lib/ruby/gems/2.0.0/gems/git_stats-1.0.14/lib/git_stats/ stats_view/template.rb:13:in
block in render'
from C:/Ruby200/lib/ruby/gems/2.0.0/gems/git_stats-1.0.14/templates/layo
ut.haml:30:in block in singleton class' from C:/Ruby200/lib/ruby/gems/2.0.0/gems/git_stats-1.0.14/templates/layo ut.haml:131062:in
instance_eval'
from C:/Ruby200/lib/ruby/gems/2.0.0/gems/git_stats-1.0.14/templates/layo
ut.haml:131062:in singleton class' from C:/Ruby200/lib/ruby/gems/2.0.0/gems/git_stats-1.0.14/templates/layo ut.haml:131060:in
__tilt_17639604'
from C:/Ruby200/lib/ruby/gems/2.0.0/gems/tilt-2.0.1/lib/tilt/template.rb
:155:in call' from C:/Ruby200/lib/ruby/gems/2.0.0/gems/tilt-2.0.1/lib/tilt/template.rb :155:in
evaluate'
from C:/Ruby200/lib/ruby/gems/2.0.0/gems/tilt-2.0.1/lib/tilt/haml.rb:17:
in evaluate' from C:/Ruby200/lib/ruby/gems/2.0.0/gems/tilt-2.0.1/lib/tilt/template.rb :96:in
render'
from C:/Ruby200/lib/ruby/gems/2.0.0/gems/git_stats-1.0.14/lib/git_stats/
stats_view/template.rb:13:in render' from C:/Ruby200/lib/ruby/gems/2.0.0/gems/git_stats-1.0.14/lib/git_stats/ stats_view/view.rb:15:in
block in render_all'
from C:/Ruby200/lib/ruby/gems/2.0.0/gems/git_stats-1.0.14/lib/git_stats/
stats_view/view.rb:14:in each' from C:/Ruby200/lib/ruby/gems/2.0.0/gems/git_stats-1.0.14/lib/git_stats/ stats_view/view.rb:14:in
render_all'
from C:in render_all' from C:/Ruby200/lib/ruby/gems/2.0.0/gems/git_stats-1.0.14/lib/git_stats/ cli.rb:20:in
generate'
from C:/Ruby200/lib/ruby/gems/2.0.0/gems/thor-0.19.1/lib/thor/command.rb
:27:in run' from C:/Ruby200/lib/ruby/gems/2.0.0/gems/thor-0.19.1/lib/thor/invocation .rb:126:in
invoke_command'
from C:/Ruby200/lib/ruby/gems/2.0.0/gems/thor-0.19.1/lib/thor.rb:359:in
dispatch' from C:/Ruby200/lib/ruby/gems/2.0.0/gems/thor-0.19.1/lib/thor/base.rb:44 0:in
start'
from C:/Ruby200/lib/ruby/gems/2.0.0/gems/git_stats-1.0.14/bin/git_stats:
10:in <top (required)>' from C:/Ruby200/bin/git_stats:23:in
load'
from C:/Ruby200/bin/git_stats:23:in `
Regards, Pierre
Same Problem here. How can I solve this problem?
Thanks for your help Chrishe
i got the same error as above
I am able to run git_stats on Windows after I installed git bash and gnu grep, and after I made a couple of modifications to the code. I don't know how to make it running on both Linux, and Windows yet.
@SebastianCelejewski could you please share with us your code ?
It is on this branch: https://github.com/SebastianCelejewski/git_stats/tree/bug_undefined_method_files_by_extension_count_for_nil_NilClass
To make it work under Windows I had to make some changes to the code, and install some Unix-like tools under Windows. Unfortunately I don't remember any details, but diff should explain everything.
@SebastianCelejewski thank you so much !
I've applied your changes and it worked like a charm !
Except I wasn't able to see full Total lines info:
@tomgi could you please add diffs from this commit to master branch ?
@SebastianCelejewski Thank you very much, you have saved me a lot of time.