Giter Club home page Giter Club logo

Comments (12)

bobbywilson0 avatar bobbywilson0 commented on July 28, 2024

It would be helpful to describe what you were doing to create this issue, also what your are trying to get done. Sometimes there is another way to do it. Include relevant code.

from grit.

masukomi avatar masukomi commented on July 28, 2024

sorry about the delay.
the offending line of code:

branch_commits = repo.commits_since(branch.name, @options[:since] ) 

@options[:since] is "Thu Jun 16 00:00:00 -0400 2011"
branch is one of the items from repo.heads() like "master"

the stack trace:

/usr/local/rvm/gems/ruby-1.8.7-p334/gems/grit-2.4.1/lib/grit/git-ruby/internal/pack.rb:200:in `find_object_in_index'
/usr/local/rvm/gems/ruby-1.8.7-p334/gems/grit-2.4.1/lib/grit/git-ruby/internal/pack.rb:233:in `find_object'
/usr/local/rvm/gems/ruby-1.8.7-p334/gems/grit-2.4.1/lib/grit/git-ruby/internal/pack.rb:70:in `with_idx'
/usr/local/rvm/gems/ruby-1.8.7-p334/gems/grit-2.4.1/lib/grit/git-ruby/internal/pack.rb:232:in `find_object'
/usr/local/rvm/gems/ruby-1.8.7-p334/gems/grit-2.4.1/lib/grit/git-ruby/internal/pack.rb:115:in `[]'
/usr/local/rvm/gems/ruby-1.8.7-p334/gems/grit-2.4.1/lib/grit/git-ruby/repository.rb:78:in `get_raw_object_by_sha1'
/usr/local/rvm/gems/ruby-1.8.7-p334/gems/grit-2.4.1/lib/grit/git-ruby/repository.rb:77:in `each'
/usr/local/rvm/gems/ruby-1.8.7-p334/gems/grit-2.4.1/lib/grit/git-ruby/repository.rb:77:in `get_raw_object_by_sha1'
/usr/local/rvm/gems/ruby-1.8.7-p334/gems/grit-2.4.1/lib/grit/git-ruby/repository.rb:105:in `get_object_by_sha1'
/usr/local/rvm/gems/ruby-1.8.7-p334/gems/grit-2.4.1/lib/grit/git-ruby/repository.rb:372:in `walk_log'
/usr/local/rvm/gems/ruby-1.8.7-p334/gems/grit-2.4.1/lib/grit/git-ruby/repository.rb:371:in `each'
/usr/local/rvm/gems/ruby-1.8.7-p334/gems/grit-2.4.1/lib/grit/git-ruby/repository.rb:371:in `walk_log'
/usr/local/rvm/gems/ruby-1.8.7-p334/gems/grit-2.4.1/lib/grit/git-ruby/repository.rb:376:in `walk_log'
/usr/local/rvm/gems/ruby-1.8.7-p334/gems/grit-2.4.1/lib/grit/git-ruby/repository.rb:371:in `each'
/usr/local/rvm/gems/ruby-1.8.7-p334/gems/grit-2.4.1/lib/grit/git-ruby/repository.rb:371:in `walk_log'
/usr/local/rvm/gems/ruby-1.8.7-p334/gems/grit-2.4.1/lib/grit/git-ruby/repository.rb:376:in `walk_log'
/usr/local/rvm/gems/ruby-1.8.7-p334/gems/grit-2.4.1/lib/grit/git-ruby/repository.rb:371:in `each'
    --- the above 3 lines repeated MANY times ----
/usr/local/rvm/gems/ruby-1.8.7-p334/gems/grit-2.4.1/lib/grit/git-ruby/repository.rb:371:in `walk_log'
/usr/local/rvm/gems/ruby-1.8.7-p334/gems/grit-2.4.1/lib/grit/git-ruby/repository.rb:287:in `log'
/usr/local/rvm/gems/ruby-1.8.7-p334/gems/grit-2.4.1/lib/grit/git-ruby/repository.rb:306:in `rev_list'
/usr/local/rvm/gems/ruby-1.8.7-p334/gems/grit-2.4.1/lib/grit/git-ruby.rb:68:in `rev_list'
/usr/local/rvm/gems/ruby-1.8.7-p334/gems/grit-2.4.1/lib/grit/git-ruby.rb:224:in `try_run'
/usr/local/rvm/rubies/ruby-1.8.7-p334/lib/ruby/1.8/timeout.rb:67:in `timeout'

from grit.

masukomi avatar masukomi commented on July 28, 2024

i should note that it doesn't always happen. every now and then it just hits an offensive branch in a particular repo... sadly it's "master" and not a public repo that you could test on. if i run something roughly equivalent on the command line

git log --since="Thu Jun 16 00:00:00 -0400 2011" --format=oneline

I only get 9 commits. Just checking on the off chance it was somehow related to a large # of commits (doubtful since it's a stack depth issue).

I'm happy to run anything that would help diagnose this.

from grit.

bobbywilson0 avatar bobbywilson0 commented on July 28, 2024

I actually noticed a few issues with the same commits_since method. I submitted a patch and it is still in the queue. I don't know what will happen with it, but I would appreciate it if you wanted to test my patch (https://[email protected]/bobbyw/grit.git) against your code to see if it fixes your situation. I worked specifically on the commits_since method.

from grit.

masukomi avatar masukomi commented on July 28, 2024

Commit
cdbb0f534ae615378bcfbfeb07cc2aef7e258b76 (in your branch... ignore the link)
fixed commits_since on repo
does not fix this problem. I also tested your branch with all of your commits and the bug was still there.

from grit.

bobbywilson0 avatar bobbywilson0 commented on July 28, 2024

Ah, I should have noticed this earlier, is @options[:since] a String or a Time object? Part of what I was working on was that the documentation and the default parameter are a String, but later in commits_since logic it checks to make sure that what was passed in is a Time object.

from grit.

masukomi avatar masukomi commented on July 28, 2024

it's a time object
options[:since] = Time.parse((Date.today() - options[:days]).to_s)

These errors are being generated via the git-status-report tool in https://github.com/masukomi/git_accessories if you want to attempt to replicate. Simplest way would be to cd into a git repo and run it with -a option. Won't require configuring anything. Full usage instructions are in the readme.

75: options[:since] = Time.parse((Date.today() - options[:days]).to_s)
257: branch_commits = repo.commits_since(branch.name, @options[:since] )

sadly it takes a very particular repo / branch to actually make the error show up. Used it for over a year without problem. had to move to a new company to find a repo that could make this happen.

from grit.

bobbywilson0 avatar bobbywilson0 commented on July 28, 2024

Do you happen to know of an open-source repo that will raise the error? I am interested in troubleshooting this with you but I feel like it will take me a while to even find a repo that raises the error you are getting.

from grit.

masukomi avatar masukomi commented on July 28, 2024

Alas, I do not. I'd been using that tool for quite some time without hitting that problem. I'll give it a whack on the linux kernel. if there's anything big and complex enough to trigger it I bet it's that.

from grit.

bobbywilson0 avatar bobbywilson0 commented on July 28, 2024

I was trying to help debug #74 and he was using this repo: git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-2.6.38.y.git

I just out of curiosity I tried your git-status-report tool using the linux kernel and was able to replicate your issue! I managed to get a bit better output with rubinius https://gist.github.com/1081288. I had to truncate some of the output as the original paste was too large, but I don't think it is missing anything crucial. I actually think that this is related to issue #2, which is basically grit swallowing a non-zero exit code but not reporting it. It then just times out because it can't get passed that error.

CC @rhaamo

from grit.

masukomi avatar masukomi commented on July 28, 2024

Excellent! I thought the kernel would have a good chance of reproducing it. I went and cloned the repo then got sidetracked with that stuff they pay me for.

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.