librelist archives

« back to archive

pygit2 questions?

pygit2 questions?

From:
Han-Wen Nienhuys
Date:
2012-03-03 @ 04:16
Hi there,

I am toying with pygit2, commit
c6ebc98930cc337ce03cb5d715a1add4b3663743, and are stumbling on some
bugs:

* When I do

        e = pygit2.TreeEntry(0100644, r.write(pygit2.GIT_OBJ_BLOB, v), k)

it barfs for any attribute I try to access, and I can't find an
implementation of a constructor for a TreeEntry. Am I missing
something?

* Passing a None arg as message to create_commit() results in a crash:

#4  0x496fc757 in __GI___assert_fail (assertion=0x16bf4d "string",
    file=0x16bf28 "/home/hanwen/vc/libgit2/src/buffer.c", line=152,
    function=0x16bfbc "git_buf_puts") at assert.c:103
#5  0x0014311d in git_buf_puts (buf=0xbfffe9bc, string=0x0)
    at /home/hanwen/vc/libgit2/src/buffer.c:152
#6  0x0013f9be in git_commit_create (oid=0xbfffea48, repo=0x8069308,
    update_ref=0x0, author=0x80b7278, committer=0x80b7278,
    message_encoding=0x0, message=0x0, tree=0x80cf050, parent_count=1,
    parents=0x80d2100) at /home/hanwen/vc/libgit2/src/commit.c:129

-- 
Han-Wen Nienhuys - hanwen@xs4all.nl - http://www.xs4all.nl/~hanwen

Re: [libgit2] pygit2 questions?

From:
J. David Ibanez
Date:
2012-03-03 @ 11:04
On Sat, 3 Mar 2012 01:16:30 -0300
Han-Wen Nienhuys <hanwenn@gmail.com> wrote:

> * Passing a None arg as message to create_commit() results in a crash:
> 
> #4  0x496fc757 in __GI___assert_fail (assertion=0x16bf4d "string",
>     file=0x16bf28 "/home/hanwen/vc/libgit2/src/buffer.c", line=152,
>     function=0x16bfbc "git_buf_puts") at assert.c:103
> #5  0x0014311d in git_buf_puts (buf=0xbfffe9bc, string=0x0)
>     at /home/hanwen/vc/libgit2/src/buffer.c:152
> #6  0x0013f9be in git_commit_create (oid=0xbfffea48, repo=0x8069308,
>     update_ref=0x0, author=0x80b7278, committer=0x80b7278,
>     message_encoding=0x0, message=0x0, tree=0x80cf050, parent_count=1,
>     parents=0x80d2100) at /home/hanwen/vc/libgit2/src/commit.c:129
> 

This is a pygit2 bug, it does not check whether 'py_str_to_c_str'
returned an error.


-- 
J. David Ibáñez
Itaapy <http://www.itaapy.com>         Tel +33 (0)1 42 23 67 45
9 rue Darwin, 75018 Paris              Fax +33 (0)1 53 28 27 88

Re: [libgit2] pygit2 questions?

From:
Han-Wen Nienhuys
Date:
2012-03-03 @ 12:15
On Sat, Mar 3, 2012 at 8:04 AM, J. David Ibanez <jdavid@itaapy.com> wrote:
> This is a pygit2 bug, it does not check whether 'py_str_to_c_str'
> returned an error.

I wouldn't mind contributing, but my employer makes me jump through
some burocratic hoops which take a few days of delay. I was hoping
someone would step up to do such a simple fix :)

-- 
Han-Wen Nienhuys - hanwen@xs4all.nl - http://www.xs4all.nl/~hanwen

Re: [libgit2] pygit2 questions?

From:
J. David Ibanez
Date:
2012-03-03 @ 15:27
On Sat, 3 Mar 2012 09:15:34 -0300
Han-Wen Nienhuys <hanwenn@gmail.com> wrote:

> On Sat, Mar 3, 2012 at 8:04 AM, J. David Ibanez <jdavid@itaapy.com>
> wrote:
> > This is a pygit2 bug, it does not check whether 'py_str_to_c_str'
> > returned an error.
> 
> I wouldn't mind contributing, but my employer makes me jump through
> some burocratic hoops which take a few days of delay. I was hoping
> someone would step up to do such a simple fix :)
> 

The bug I will fix, the feature (TreeEntry_init), I will wait :)


-- 
J. David Ibáñez
Itaapy <http://www.itaapy.com>         Tel +33 (0)1 42 23 67 45
9 rue Darwin, 75018 Paris              Fax +33 (0)1 53 28 27 88

Re: [libgit2] pygit2 questions?

From:
J. David Ibanez
Date:
2012-03-03 @ 16:39
On Sat, 3 Mar 2012 12:04:58 +0100
"J. David Ibanez" <jdavid@itaapy.com> wrote:

> On Sat, 3 Mar 2012 01:16:30 -0300
> Han-Wen Nienhuys <hanwenn@gmail.com> wrote:
> 
> > * Passing a None arg as message to create_commit() results in a
> > crash:
> > 
> > #4  0x496fc757 in __GI___assert_fail (assertion=0x16bf4d "string",
> >     file=0x16bf28 "/home/hanwen/vc/libgit2/src/buffer.c", line=152,
> >     function=0x16bfbc "git_buf_puts") at assert.c:103
> > #5  0x0014311d in git_buf_puts (buf=0xbfffe9bc, string=0x0)
> >     at /home/hanwen/vc/libgit2/src/buffer.c:152
> > #6  0x0013f9be in git_commit_create (oid=0xbfffea48, repo=0x8069308,
> >     update_ref=0x0, author=0x80b7278, committer=0x80b7278,
> >     message_encoding=0x0, message=0x0, tree=0x80cf050,
> > parent_count=1, parents=0x80d2100)
> > at /home/hanwen/vc/libgit2/src/commit.c:129
> > 
> 
> This is a pygit2 bug, it does not check whether 'py_str_to_c_str'
> returned an error.
> 
> 

Fixed, could you check?


-- 
J. David Ibáñez
Itaapy <http://www.itaapy.com>         Tel +33 (0)1 42 23 67 45
9 rue Darwin, 75018 Paris              Fax +33 (0)1 53 28 27 88

Re: [libgit2] pygit2 questions?

From:
J. David Ibanez
Date:
2012-03-03 @ 10:35
On Sat, 3 Mar 2012 01:16:30 -0300
Han-Wen Nienhuys <hanwenn@gmail.com> wrote:

> Hi there,
> 
> I am toying with pygit2, commit
> c6ebc98930cc337ce03cb5d715a1add4b3663743, and are stumbling on some
> bugs:
> 
> * When I do
> 
>         e = pygit2.TreeEntry(0100644, r.write(pygit2.GIT_OBJ_BLOB,
> v), k)
> 
> it barfs for any attribute I try to access, and I can't find an
> implementation of a constructor for a TreeEntry. Am I missing
> something?
> 

TreeEntry_init is not yet implemented, you can contribute it if you
like.

The TreeBuilder is in progress, check
https://github.com/libgit2/pygit2/pull/56


-- 
J. David Ibáñez
Itaapy <http://www.itaapy.com>         Tel +33 (0)1 42 23 67 45
9 rue Darwin, 75018 Paris              Fax +33 (0)1 53 28 27 88