Closed
Description
Is git rev-parse supported?
See https://git-scm.com/docs/git-rev-parse
I see the following line
Lines 571 to 580 in 765df7c
but it's not really well documented.
And when I run an example code I get NoMethodError
irb(main):062:0> Git::Base.new.revparse('HEAD^^')
Traceback (most recent call last):
9: from /local/workplace/aubreyya/EC2-ZIM-JlbRelayConfigUpdater/env/EC2-ZIM-JlbRelayConfigUpdater-1.0/runtime/bin/../ruby2.7.x/bin/irb:30:in `<main>'
8: from /local/workplace/aubreyya/EC2-ZIM-JlbRelayConfigUpdater/env/EC2-ZIM-JlbRelayConfigUpdater-1.0/runtime/bin/../ruby2.7.x/bin/irb:30:in `load'
7: from /local/workplace/aubreyya/EC2-ZIM-JlbRelayConfigUpdater/env/EC2-ZIM-JlbRelayConfigUpdater-1.0/runtime/ruby2.7.x/lib/ruby/gems/2.7.0/gems/irb-1.2.6/exe/irb:11:in `<top (required)>'
6: from (irb):61
5: from (irb):62:in `rescue in irb_binding'
4: from /local/home/aubreyya/brazil-pkg-cache/packages/RubyGem-git/RubyGem-git-1.5.x.1579.0/AL2_x86_64/DEV.STD.PTHREAD/build/ruby2.7.x/lib/ruby/gems/2.7.0/gems/git-1.5.0/lib/git/base.rb:533:in `revparse'
3: from /local/home/aubreyya/brazil-pkg-cache/packages/RubyGem-git/RubyGem-git-1.5.x.1579.0/AL2_x86_64/DEV.STD.PTHREAD/build/ruby2.7.x/lib/ruby/gems/2.7.0/gems/git-1.5.0/lib/git/base.rb:184:in `lib'
2: from /local/home/aubreyya/brazil-pkg-cache/packages/RubyGem-git/RubyGem-git-1.5.x.1579.0/AL2_x86_64/DEV.STD.PTHREAD/build/ruby2.7.x/lib/ruby/gems/2.7.0/gems/git-1.5.0/lib/git/base.rb:184:in `new'
1: from /local/home/aubreyya/brazil-pkg-cache/packages/RubyGem-git/RubyGem-git-1.5.x.1579.0/AL2_x86_64/DEV.STD.PTHREAD/build/ruby2.7.x/lib/ruby/gems/2.7.0/gems/git-1.5.0/lib/git/lib.rb:19:in `initialize'
NoMethodError (undefined method `path' for nil:NilClass)
Edit: okay I see my problem
Lines 6 to 8 in 765df7c
However it would be nice to have revparse
documented here
Your environment
RubyGem-git = 1.5.x;
git version 2.30.1 (Apple Git-130)
ruby 2.6.3p62 (2019-04-16 revision 67580) [universal.x86_64-darwin20]
Steps to reproduce
n/a
Expected behaviour
n/a
Actual behaviour
n/a
Metadata
Metadata
Assignees
Labels
No labels