librelist archives

« back to archive

Rugged Issues creating commits

Rugged Issues creating commits

From:
Stephanie Collett
Date:
2011-12-20 @ 22:55
Hi,

I'm still having trouble creating commits. I'm using the Rugged version 
0.16.0 with libgit2 v0.15.0.

I receive this error when I try to create a commit…

obj = Rugged::Commit.new(@repo)
ArgumentError: wrong number of arguments(1 for 2)

And this error when I try to create a signature…

person = Rugged::Signature.new('Scott', 'schacon@gmail.com', Time.now)
NameError: uninitialized constant Rugged::Signature

Has the API changed? I also tried using libgit2 (3eaf34f), since it was 
the current head when Rugged 0.16.0 was created. Am I using the right 
versions?

Thanks,
Stephanie

From: Stephanie Collett 
<Stephanie.Collett@ucop.edu<mailto:Stephanie.Collett@ucop.edu>>
Reply-To: <libgit2@librelist.com<mailto:libgit2@librelist.com>>
Date: Thu, 15 Dec 2011 23:33:48 +0000
To: <libgit2@librelist.com<mailto:libgit2@librelist.com>>
Subject: Re: [libgit2] Tree from index for commit (Rugged)


Hi,

I'm following up on an use case for Rugged/Libgit2. I'd like to be able to
add a file to an index and then commit. I noticed the index.write_tree 
method has been implement. This now works great…

> repo = Rugged::Repository.new('.git')
> index = repo.index
> index.reload
> index.add('test.txt')
> index.write
> index.write_tree

However, I'm having trouble creating a commit object. Is this API 
documentation up-to-date?


person = Rugged::Signature.new('Scott', 
'schacon@gmail.com<mailto:'schacon@gmail.com>', Time.now)

gobjc = Rugged::Commit.new(@repo)
gobjc.message = "my message"
gobjc.author = person
gobjc.tree = gobjt
gobjc.write

-Stephanie

From: Stephanie Collett 
<Stephanie.Collett@ucop.edu<mailto:Stephanie.Collett@ucop.edu>>
Reply-To: <libgit2@librelist.com<mailto:libgit2@librelist.com>>
Date: Fri, 19 Aug 2011 18:34:43 +0000
To: <libgit2@librelist.com<mailto:libgit2@librelist.com>>
Subject: [libgit2] Tree from index for commit (Rugged)


Hi,

Last March I was creating a script that adds and commit files through 
Rugged. At the time there was no way to write the tree from the index to 
create a commit. Is there a way to move from an index to a commit now?

I'm using the latest Rugged (7d6fdce from Aug 4th) and Libgit2 v0.14.0

Thanks,
Stephanie

Re: [libgit2] Rugged Issues creating commits

From:
Vicent Marti
Date:
2011-12-22 @ 19:28
Hey Stephanie,

yes, the API did change as part of the porting progress. Unfortunately
I haven't had time to update the Ruby docs, but you can see pretty
clearly the changes in the C code.

Here's an example on how to create a commit:

    person = {:name => 'Scott', :email => 'schacon@gmail.com', :time
=> Time.now }

    commit = Rugged::Commit.create(@repo,
      :message => "This is the commit message\n\nThis commit is
created from Rugged",
      :committer => person,
      :author => person,
      :parents => [@repo.head],
      :tree => "c4dc1555e4d4fa0e0c9c3fc46734c7c35b3ce90b")

    rm_loose(commit.oid)

I'm going to be updating and stabilizing the API a lot the following
days. Stay tuned, and sorry for the inconvenience.

Cheers,
Vicent

On Tue, Dec 20, 2011 at 11:55 PM, Stephanie Collett
<Stephanie.Collett@ucop.edu> wrote:
>
> Hi,
>
> I'm still having trouble creating commits. I'm using the Rugged
> version 0.16.0 with libgit2 v0.15.0.
>
> I receive this error when I try to create a commit…
>
> obj = Rugged::Commit.new(@repo)
> ArgumentError: wrong number of arguments(1 for 2)
>
> And this error when I try to create a signature…
>
> person = Rugged::Signature.new('Scott', 'schacon@gmail.com', Time.now)
> NameError: uninitialized constant Rugged::Signature
>
> Has the API changed? I also tried using libgit2 (3eaf34f), since it was the
> current head when Rugged 0.16.0 was created. Am I using the right versions?
>
> Thanks,
> Stephanie
>
> From: Stephanie Collett <Stephanie.Collett@ucop.edu>
> Reply-To: <libgit2@librelist.com>
> Date: Thu, 15 Dec 2011 23:33:48 +0000
> To: <libgit2@librelist.com>
> Subject: Re: [libgit2] Tree from index for commit (Rugged)
>
>
> Hi,
>
> I'm following up on an use case for Rugged/Libgit2. I'd like to be able to
> add a file to an index and then commit. I noticed the index.write_tree
> method has been implement. This now works great…
>
>> repo = Rugged::Repository.new('.git')
>> index = repo.index
>> index.reload
>> index.add('test.txt')
>> index.write
>> index.write_tree
>
> However, I'm having trouble creating a commit object. Is this API
> documentation up-to-date?
>
> person = Rugged::Signature.new('Scott', 'schacon@gmail.com', Time.now)
>
> gobjc = Rugged::Commit.new(@repo)
> gobjc.message = "my message"
> gobjc.author = person
> gobjc.tree = gobjt
> gobjc.write
>
>
> -Stephanie
>
> From: Stephanie Collett <Stephanie.Collett@ucop.edu>
> Reply-To: <libgit2@librelist.com>
> Date: Fri, 19 Aug 2011 18:34:43 +0000
> To: <libgit2@librelist.com>
> Subject: [libgit2] Tree from index for commit (Rugged)
>
>
> Hi,
>
> Last March I was creating a script that adds and commit files through
> Rugged. At the time there was no way to write the tree from the index to
> create a commit. Is there a way to move from an index to a commit now?
>
> I'm using the latest Rugged (7d6fdce from Aug 4th) and Libgit2 v0.14.0
>
> Thanks,
> Stephanie

Re: [libgit2] Rugged Issues creating commits

From:
Stephanie Collett
Date:
2011-12-23 @ 19:20
Hi Vicent,

Thanks for the API update, I was having trouble reading libgit2 library.

I'm now seg-faulting when I try to create the commit
(Rugged::Commit.create).

I'm using Mac OSX 10.6.8, RVM Ruby 1.9.3-p0, Libgit2 v0.15.0, and Rugged
0.16.0. I'll try to get access to a Linux machine over the next couple of
weeks and see if I can get this to work without the seg-fault.

-Stephanie

On 12/22/11 11:28 AM, "Vicent Marti" <vicent@github.com> wrote:

>Hey Stephanie,
>
>yes, the API did change as part of the porting progress. Unfortunately
>I haven't had time to update the Ruby docs, but you can see pretty
>clearly the changes in the C code.
>
>Here's an example on how to create a commit:
>
>    person = {:name => 'Scott', :email => 'schacon@gmail.com', :time
>=> Time.now }
>
>    commit = Rugged::Commit.create(@repo,
>      :message => "This is the commit message\n\nThis commit is
>created from Rugged",
>      :committer => person,
>      :author => person,
>      :parents => [@repo.head],
>      :tree => "c4dc1555e4d4fa0e0c9c3fc46734c7c35b3ce90b")
>
>    rm_loose(commit.oid)
>
>I'm going to be updating and stabilizing the API a lot the following
>days. Stay tuned, and sorry for the inconvenience.
>
>Cheers,
>Vicent
>
>On Tue, Dec 20, 2011 at 11:55 PM, Stephanie Collett
><Stephanie.Collett@ucop.edu> wrote:
>>
>> Hi,
>>
>> I'm still having trouble creating commits. I'm using the Rugged
>> version 0.16.0 with libgit2 v0.15.0.
>>
>> I receive this error when I try to create a commitŠ
>>
>> obj = Rugged::Commit.new(@repo)
>> ArgumentError: wrong number of arguments(1 for 2)
>>
>> And this error when I try to create a signatureŠ
>>
>> person = Rugged::Signature.new('Scott', 'schacon@gmail.com', Time.now)
>> NameError: uninitialized constant Rugged::Signature
>>
>> Has the API changed? I also tried using libgit2 (3eaf34f), since it was
>>the
>> current head when Rugged 0.16.0 was created. Am I using the right
>>versions?
>>
>> Thanks,
>> Stephanie
>>
>> From: Stephanie Collett <Stephanie.Collett@ucop.edu>
>> Reply-To: <libgit2@librelist.com>
>> Date: Thu, 15 Dec 2011 23:33:48 +0000
>> To: <libgit2@librelist.com>
>> Subject: Re: [libgit2] Tree from index for commit (Rugged)
>>
>>
>> Hi,
>>
>> I'm following up on an use case for Rugged/Libgit2. I'd like to be able
>>to
>> add a file to an index and then commit. I noticed the index.write_tree
>> method has been implement. This now works greatŠ
>>
>>> repo = Rugged::Repository.new('.git')
>>> index = repo.index
>>> index.reload
>>> index.add('test.txt')
>>> index.write
>>> index.write_tree
>>
>> However, I'm having trouble creating a commit object. Is this API
>> documentation up-to-date?
>>
>> person = Rugged::Signature.new('Scott', 'schacon@gmail.com', Time.now)
>>
>> gobjc = Rugged::Commit.new(@repo)
>> gobjc.message = "my message"
>> gobjc.author = person
>> gobjc.tree = gobjt
>> gobjc.write
>>
>>
>> -Stephanie
>>
>> From: Stephanie Collett <Stephanie.Collett@ucop.edu>
>> Reply-To: <libgit2@librelist.com>
>> Date: Fri, 19 Aug 2011 18:34:43 +0000
>> To: <libgit2@librelist.com>
>> Subject: [libgit2] Tree from index for commit (Rugged)
>>
>>
>> Hi,
>>
>> Last March I was creating a script that adds and commit files through
>> Rugged. At the time there was no way to write the tree from the index to
>> create a commit. Is there a way to move from an index to a commit now?
>>
>> I'm using the latest Rugged (7d6fdce from Aug 4th) and Libgit2 v0.14.0
>>
>> Thanks,
>> Stephanie

Re: [libgit2] Rugged Issues creating commits

From:
Jonathan \"Duke\" Leto
Date:
2011-12-23 @ 20:27
Howdy,

Providing a backtrace of the segault would greatly help to debug this issue.

Duke

On Fri, Dec 23, 2011 at 11:20 AM, Stephanie Collett
<Stephanie.Collett@ucop.edu> wrote:
>
> Hi Vicent,
>
> Thanks for the API update, I was having trouble reading libgit2 library.
>
> I'm now seg-faulting when I try to create the commit
> (Rugged::Commit.create).
>
> I'm using Mac OSX 10.6.8, RVM Ruby 1.9.3-p0, Libgit2 v0.15.0, and Rugged
> 0.16.0. I'll try to get access to a Linux machine over the next couple of
> weeks and see if I can get this to work without the seg-fault.
>
> -Stephanie
>
> On 12/22/11 11:28 AM, "Vicent Marti" <vicent@github.com> wrote:
>
>>Hey Stephanie,
>>
>>yes, the API did change as part of the porting progress. Unfortunately
>>I haven't had time to update the Ruby docs, but you can see pretty
>>clearly the changes in the C code.
>>
>>Here's an example on how to create a commit:
>>
>>    person = {:name => 'Scott', :email => 'schacon@gmail.com', :time
>>=> Time.now }
>>
>>    commit = Rugged::Commit.create(@repo,
>>      :message => "This is the commit message\n\nThis commit is
>>created from Rugged",
>>      :committer => person,
>>      :author => person,
>>      :parents => [@repo.head],
>>      :tree => "c4dc1555e4d4fa0e0c9c3fc46734c7c35b3ce90b")
>>
>>    rm_loose(commit.oid)
>>
>>I'm going to be updating and stabilizing the API a lot the following
>>days. Stay tuned, and sorry for the inconvenience.
>>
>>Cheers,
>>Vicent
>>
>>On Tue, Dec 20, 2011 at 11:55 PM, Stephanie Collett
>><Stephanie.Collett@ucop.edu> wrote:
>>>
>>> Hi,
>>>
>>> I'm still having trouble creating commits. I'm using the Rugged
>>> version 0.16.0 with libgit2 v0.15.0.
>>>
>>> I receive this error when I try to create a commitŠ
>>>
>>> obj = Rugged::Commit.new(@repo)
>>> ArgumentError: wrong number of arguments(1 for 2)
>>>
>>> And this error when I try to create a signatureŠ
>>>
>>> person = Rugged::Signature.new('Scott', 'schacon@gmail.com', Time.now)
>>> NameError: uninitialized constant Rugged::Signature
>>>
>>> Has the API changed? I also tried using libgit2 (3eaf34f), since it was
>>>the
>>> current head when Rugged 0.16.0 was created. Am I using the right
>>>versions?
>>>
>>> Thanks,
>>> Stephanie
>>>
>>> From: Stephanie Collett <Stephanie.Collett@ucop.edu>
>>> Reply-To: <libgit2@librelist.com>
>>> Date: Thu, 15 Dec 2011 23:33:48 +0000
>>> To: <libgit2@librelist.com>
>>> Subject: Re: [libgit2] Tree from index for commit (Rugged)
>>>
>>>
>>> Hi,
>>>
>>> I'm following up on an use case for Rugged/Libgit2. I'd like to be able
>>>to
>>> add a file to an index and then commit. I noticed the index.write_tree
>>> method has been implement. This now works greatŠ
>>>
>>>> repo = Rugged::Repository.new('.git')
>>>> index = repo.index
>>>> index.reload
>>>> index.add('test.txt')
>>>> index.write
>>>> index.write_tree
>>>
>>> However, I'm having trouble creating a commit object. Is this API
>>> documentation up-to-date?
>>>
>>> person = Rugged::Signature.new('Scott', 'schacon@gmail.com', Time.now)
>>>
>>> gobjc = Rugged::Commit.new(@repo)
>>> gobjc.message = "my message"
>>> gobjc.author = person
>>> gobjc.tree = gobjt
>>> gobjc.write
>>>
>>>
>>> -Stephanie
>>>
>>> From: Stephanie Collett <Stephanie.Collett@ucop.edu>
>>> Reply-To: <libgit2@librelist.com>
>>> Date: Fri, 19 Aug 2011 18:34:43 +0000
>>> To: <libgit2@librelist.com>
>>> Subject: [libgit2] Tree from index for commit (Rugged)
>>>
>>>
>>> Hi,
>>>
>>> Last March I was creating a script that adds and commit files through
>>> Rugged. At the time there was no way to write the tree from the index to
>>> create a commit. Is there a way to move from an index to a commit now?
>>>
>>> I'm using the latest Rugged (7d6fdce from Aug 4th) and Libgit2 v0.14.0
>>>
>>> Thanks,
>>> Stephanie
>



-- 
Jonathan "Duke" Leto <jonathan@leto.net>
Leto Labs LLC
209.691.DUKE // http://labs.leto.net
NOTE: Personal email is only checked twice a day at 10am/2pm PST,
please call/text for time-sensitive matters.