Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to commit with Ruby bindings for libgit2
    primarykey
    data
    text
    <p>Does anyone know how to create a commit using the ruby bindings (the 'rugged' gem) for libgit2? I've tried all the examples I can find, on the libgit2 usage guide and on the rugged gem github page, and none of the exampes for creating or editing a commit are working.</p> <p>This has been helpful in trying to figure out how to commit so far, except it's for libgit2 itself and not the ruby bindings. <a href="http://librelist.com/browser//libgit2/2011/2/19/initing-a-repository-adding-files-to-the-index-and-committing/#d94ce8df18ff0202ce904180286a4a85" rel="nofollow">http://librelist.com/browser//libgit2/2011/2/19/initing-a-repository-adding-files-to-the-index-and-committing/#d94ce8df18ff0202ce904180286a4a85</a></p> <p>When I try and make a commit, following the steps on the Rugged Github page, I get this;</p> <pre><code>pry(main)&gt; Rugged::Commit.create( repo, :author=&gt;author, :message=&gt;"Hello world\n\n", :committer=&gt;author, :parents=&gt;parents, :tree=&gt;tree ) TypeError: wrong argument type nil (expected String) </code></pre> <p>And when I try to follow the libgit2 usage guide, which basically says to get the commit and then just edit it using <code>commit.message=</code> like commands, but then I get noMethodErrors because there is no 'message=' method.</p> <p>libgit2 usage guide: <a href="http://libgit2.github.com/api.html" rel="nofollow">http://libgit2.github.com/api.html</a><br> Rugged documentation 0: <a href="http://rubydoc.info/gems/rugged/0.16.0/frames" rel="nofollow">http://rubydoc.info/gems/rugged/0.16.0/frames</a><br> Rugged Github page: <a href="https://github.com/libgit2/rugged" rel="nofollow">https://github.com/libgit2/rugged</a> </p> <p>Edit: How I reproduce this; <a href="http://pastebin.com/wnta8FWm" rel="nofollow">http://pastebin.com/wnta8FWm</a><br> Edit_n+1: I also tried using the sha of the tree instead of a Rugged::Tree object, by trying </p> <pre><code>x=Rugged::Commit.create( repo, :author=&gt;author, :message=&gt;"Hello world\n\n", :committer=&gt;author, :parents=&gt;parents, :tree=&gt;tree.oid ) </code></pre> <p>But that just produced the exact same error output as before.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload