Giter Club home page Giter Club logo

Comments (10)

assimovt avatar assimovt commented on July 28, 2024

I got the same problem. Is anyone looking into it?

My environment:

  • ruby-1.8.7-p174, tried also ruby-1.8.7-p249
  • git 1.7.1
  • grit 2.2.0

I got the error with rails source, but when I switched to smaller repository it started to work. Apparently its a memory leak problem in the recursive function rev_list in git-ruby.rb.

Any ideas?

from grit.

utkarshkukreti avatar utkarshkukreti commented on July 28, 2024

I'm also getting the same error for projects with over 3000 commits. Seems to work fine for small projects.

from grit.

igrigorik avatar igrigorik commented on July 28, 2024

Ping. Same issue on larger repos, as documented on igrigorik/bugspots#4.

Easy way to reproduce:

gem install bugspots
bugspots -d 1000 /path/to/rails_repo 

That'll try to load the last 1000 commits from rails, which will trigger this bug.

from grit.

msgerbush avatar msgerbush commented on July 28, 2024

I have been able to work around this by using the native command to call rev-list and then parse the result using Grit.

This is for 24000 commits using:

  • ruby-1.9.3-p0
  • git 1.7.5.1
  • grit 2.4.1

from grit.

cleeland avatar cleeland commented on July 28, 2024

Is the native command to call rev-list in a branch somewhere? I would like to try using it.

from grit.

msgerbush avatar msgerbush commented on July 28, 2024

I hadn't put this in a branch. Try the following:

commit_list = repo.git.rev_list({:max_count => false, :no_merges => true, :pretty => "raw", :timeout => false}, branch_name)
commits = Commit.list_from_string(repo, commit_list)

where branch_name is the name of your branch and repo is your Grit::Repo. You can modify the options as you see fit, except for the format (which must be 'raw' for Commit.list_from_string). I have only tried this with grabbing all the commits, which is why I set :max_count => false. Since this leverages the native call in git.rb's method_missing, you can pass any options here that you could normally pass to git-log, http://linux.die.net/man/1/git-log. This includes --since, which takes a date.

If this doesn't work out for you, let me know. I only took a cursory look at Grit while playing with https://github.com/igrigorik/bugspots, but I can try to look deeper into why this works for me, and maybe setup a branch for you.

from grit.

cleeland avatar cleeland commented on July 28, 2024

Thanks for that clarification. So, your modification to use git rev-list
was in the code that USES grit rather than in grit itself? That's the part
I was missing.

Chris Cleeland

from grit.

cleeland avatar cleeland commented on July 28, 2024

FYI, I added the modification suggested above and committed to my fork at git://github.com/cleeland/bugspots.git. I'll put in a pull request.

from grit.

msgerbush avatar msgerbush commented on July 28, 2024

Correct. Basically there is code inside of git-ruby and git-ruby/repository that processes specific rev_list options by essentially walking the results of git-log without options. commits_since leverages this code instead of using the native git-log command with options. You could either edit the way that commits_since works to not use git-ruby, or you could simply access the Grit::Git CLI directly from your code, like I did above.

from grit.

bkeepers avatar bkeepers commented on July 28, 2024

Grit is no longer maintained. See #183 and check out libgit2/rugged.

from grit.

Related Issues (20)

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.