schacon/ruby-git — Issue #36: Multiline commits are not parsed correctly
Author: talbright
Created: 2011-12-01 03:05:19+00:00
State: open

Given a commit like this:

commit 4431b6b764e80d1db038857dbb699948268d1f84
Author: Brian xxxxx
Date: Mon Nov 28 13:14:57 2011 -0500

Adding a modified post-receive script for extensibility

The post-recieve script should allow for adding multiple
sub-scripts as necessary though iteritive invocation.

o = repo.object('4431b6b764e80d1db038857dbb699948268d1f84')
o.message
=> "Adding a modified post-receive script for extensibility"

The problem is in lib.rb#process_commit_data. The assumption in the current code is if line.empty? then this should mark the beginning or ending of processing of the commit message. I tried patching it, but even without my code changes tests are not passing on trunk. My changes make the tests break more, so it's not solid, but here's a start:

https://gist.github.com/1412804