Bug 740852 - Traceback when iterating over a commit with empty log message
Summary: Traceback when iterating over a commit with empty log message
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: GitPython
Version: 16
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: David Cantrell
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-09-23 14:36 UTC by Mark McLoughlin
Modified: 2013-01-10 06:39 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2012-03-02 23:21:38 UTC


Attachments (Terms of Use)

Description Mark McLoughlin 2011-09-23 14:36:03 UTC
I just hit an issue using GitPython with Openstack Nova in F16 which is fixed upstream

If you clone the repo from here:

  https://github.com/openstack/nova

and then do:

repo = git.Repo(".")
for commit in repo.head.commit.iter_parents():
    print commit.author.email

you get:

Traceback (most recent call last):
  File "./t.py", line 6, in <module>
    for commit in repo.head.commit.iter_parents():
  File "/usr/lib/python2.7/site-packages/git/objects/commit.py", line 253, in _iter_from_process_or_stream
    assert commit_tokens[0] == "commit"
AssertionError

because the commit has an empty commit message, see:

  $> git show --pretty=raw a81547f

Easiest answer would be to update to 0.3.2.RC1

Comment 1 Jesse Keating 2011-09-23 17:41:20 UTC
Thanks for the report!  I'll look into updating it and what changes would be acceptable for f16.

Comment 2 Jesse Keating 2011-09-23 19:14:35 UTC
I've done a build for rawhide: http://koji.fedoraproject.org/koji/buildinfo?buildID=265096 but I'm a bit reluctant to bring it into F16 at this time.  Consumers require some minor porting work from 0.2 to 0.3 and I'm not sure what all consumers are out there.  Would you be willing to install/rebuild the rawhide package from above and test it out for your use case?  You'll also need python-gitdb and python-async as new deps.

Alternatively, do you happen to know which commit fixes this bug, so that I might backport it to the 0.2 branches for earlier Fedoras and EPEL?

Comment 3 Mark McLoughlin 2011-09-23 20:42:36 UTC
Thanks much Jesse

Two things:

  1) I actually tested 0.3 using pip install earlier and it worked fine
     for my usecase

  2) It turns out we were using GitPython for a really stupidly simple
     thing, so I just made us run the command directly and parse the
     output. See:

       https://review.openstack.org/#change,561

So, I'm fine with just having it updated in rawhide


Note You need to log in before you can comment on or make changes to this bug.