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

Poper fails with wrong argument type Rugged::Commit (expected Data) (TypeError) #15

Open
TobiasBales opened this issue Jul 9, 2020 · 7 comments · May be fixed by #18
Open

Poper fails with wrong argument type Rugged::Commit (expected Data) (TypeError) #15

TobiasBales opened this issue Jul 9, 2020 · 7 comments · May be fixed by #18

Comments

@TobiasBales
Copy link

Hey,
I just stumbled across this gem and like it a lot. So I tried to get started with it (in combination with pronto).
Sadly when running it manually (e.g. poper run HEAD~2 it fails with wrong argument type Rugged::Commit (expected Data) (TypeError)

Stack trace:

Traceback (most recent call last):
        12: from /Users/tobias/.rvm/gems/ruby-2.6.3/bin/ruby_executable_hooks:24:in `<main>'
        11: from /Users/tobias/.rvm/gems/ruby-2.6.3/bin/ruby_executable_hooks:24:in `eval'
        10: from /Users/tobias/.rvm/gems/ruby-2.6.3/bin/poper:23:in `<main>'
         9: from /Users/tobias/.rvm/gems/ruby-2.6.3/bin/poper:23:in `load'
         8: from /Users/tobias/.rvm/gems/ruby-2.6.3/gems/poper-0.2.3/bin/poper:6:in `<top (required)>'
         7: from /Users/tobias/.rvm/gems/ruby-2.6.3/gems/thor-0.20.3/lib/thor/base.rb:466:in `start'
         6: from /Users/tobias/.rvm/gems/ruby-2.6.3/gems/thor-0.20.3/lib/thor.rb:387:in `dispatch'
         5: from /Users/tobias/.rvm/gems/ruby-2.6.3/gems/thor-0.20.3/lib/thor/invocation.rb:126:in `invoke_command'
         4: from /Users/tobias/.rvm/gems/ruby-2.6.3/gems/thor-0.20.3/lib/thor/command.rb:27:in `run'
         3: from /Users/tobias/.rvm/gems/ruby-2.6.3/gems/poper-0.2.3/lib/poper/cli.rb:19:in `run'
         2: from /Users/tobias/.rvm/gems/ruby-2.6.3/gems/poper-0.2.3/lib/poper/runner.rb:12:in `run'
         1: from /Users/tobias/.rvm/gems/ruby-2.6.3/gems/poper-0.2.3/lib/poper/runner.rb:35:in `commits'
/Users/tobias/.rvm/gems/ruby-2.6.3/gems/poper-0.2.3/lib/poper/runner.rb:35:in `push': wrong argument type Rugged::Commit (expected Data) (TypeError)

Versions:
Ruby 2.6.3p62
rugged 0.99.0
poper 0.2.3

I noticed that there is a huge discrepancy between what poper expects in terms of rugged versions (~> 0.23, >= 0.23.0) vs 0.99.0
I have no idea what changed, given the not very high activity here at the moment I would be willing to have a look if that is wanted.

@ulyssesrex
Copy link

@TobiasBales I'm also looking at this. Do you understand why bundle install will install rugged 0.99.0 when poper.gemspec contains the following line?

s.add_runtime_dependency('rugged', '~> 0.23', '>= 0.23.0') # line 23

To me, that says 0.23.0 <= RUGGED_VERSION < 0.24.0... and 0.99.0 is out of that range...

@ulyssesrex
Copy link

I was getting that same error in the test suite with version 0.99.0. When I pin rugged to version 0.23.1, the errors go away.

s.add_runtime_dependency('rugged', '0.23.1') # line 23

@ulyssesrex
Copy link

Looks like rugged 0.99.0 is incompatible with lib/poper/runner.rb.

When 'any_gem', '~> 0.23' is specified, the pessimistic operator will actually allow the final series of digits in the version string to climb as high as possible without bumping the major version.

Since rugged 0.99.0 is available, the 23 is incremented to 99.

bak1an added a commit to bak1an/poper that referenced this issue Dec 9, 2020
Recent versions of rugged are not accepting Rugged::Commit as an
argument to Rugged::Walker#push. We can workaround this by passing
string oid.

Closes mmozuras#15
Refs. libgit2/rugged#860
@bak1an bak1an linked a pull request Dec 9, 2020 that will close this issue
@benner
Copy link

benner commented Feb 2, 2023

I have same issue

@hlascelles
Copy link

We're on rugged 1.x. We could do with a relaxing of the pin on it too.

@diegobentes
Copy link

I have the same problem, the PR we have open solves very well. Waiting for the merge.

@diegobentes
Copy link

I created a gem called poper2 that solves this problem and that I will keep updated against bugs and improvements.
Please open issues.

https://github.com/diegobentes/poper2

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

Successfully merging a pull request may close this issue.

5 participants