git_stats icon indicating copy to clipboard operation
git_stats copied to clipboard

Currently it works only under linux, add windows support

Open tomgi opened this issue 12 years ago • 14 comments

tomgi avatar Oct 24 '12 13:10 tomgi

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.

lucaminudel avatar Nov 04 '12 19:11 lucaminudel

Sounds like corrupted repository, verify it with

$ git fsck --full

If it doesn't help maybe try cloning it again from bitbucket.

tomgi avatar Nov 04 '12 19:11 tomgi

Thanks for helping! Indeed the repository was corrupted. After fixing it git_stats worked like a charm.

lucaminudel avatar Nov 04 '12 20:11 lucaminudel

@tomgi I would be willing to help add Windows support, do you already have a list of items that need to be fixed?

petersondrew avatar Apr 16 '13 14:04 petersondrew

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.

tomgi avatar Apr 21 '13 19:04 tomgi

:+1: Brilliant tool, cheers. I just wish I saved my self 90 minutes of pain by spotting the header for this issue :)

chrisloughnane avatar Apr 01 '14 16:04 chrisloughnane

Hi, I try to use it on windows and i get this fatal: |: no such path in the working tree. Use 'git -- ...' to specify paths that do not exist locally. git rev-list --pretty=format:'%h|%at|%ai|%aE' HEAD . | grep -v commit git shortlog -se HEAD . C:in 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:infiles_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:ininitialize' 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:infiles_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:inblock 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:insingleton 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:incall' 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: inevaluate' 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:inrender' 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:inblock 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:insingleton 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:incall' 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: inevaluate' 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:inblock 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:ininstance_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:inevaluate' 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:inrender' 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:inblock 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:inrender_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:ingenerate' 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:ininvoke_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:instart' 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:inload' from C:/Ruby200/bin/git_stats:23:in `

'

Regards, Pierre

pierreldff avatar Aug 20 '14 10:08 pierreldff

Same Problem here. How can I solve this problem?

Thanks for your help Chrishe

circleart avatar Nov 19 '14 12:11 circleart

i got the same error as above

nysander avatar Nov 22 '14 22:11 nysander

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 avatar Jan 08 '15 10:01 SebastianCelejewski

@SebastianCelejewski could you please share with us your code ?

eko24 avatar Sep 29 '15 08:09 eko24

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 avatar Sep 29 '15 17:09 SebastianCelejewski

@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: image @tomgi could you please add diffs from this commit to master branch ?

eko24 avatar Sep 30 '15 12:09 eko24

@SebastianCelejewski Thank you very much, you have saved me a lot of time.

Jameszjhe avatar Aug 24 '16 15:08 Jameszjhe