mmozuras / poper

Make sure git commit messages are well-formed
MIT License
77 stars 11 forks source link

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

Open TobiasBales opened 4 years ago

TobiasBales commented 4 years ago

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 commented 4 years ago

@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 commented 4 years ago

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 commented 4 years ago

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.

benner commented 1 year ago

I have same issue

hlascelles commented 1 year ago

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

diegobentes commented 1 year ago

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

diegobentes commented 1 year ago

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