Bug 740852

Summary: Traceback when iterating over a commit with empty log message
Product: [Fedora] Fedora Reporter: Mark McLoughlin <markmc>
Component: GitPythonAssignee: David Cantrell <dcantrell>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 16CC: dcantrell
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-03-02 23:21:38 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

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