<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -41,7 +41,7 @@ module SourceControl
 
     def latest_revision
       load_new_changesets_from_origin
-      git_output = git('log', ['-1', '--pretty=raw', 'origin/master'])
+      git_output = git('log', ['-1', '--pretty=raw', '--name-status', 'origin/master'])
       Git::LogParser.new.parse(git_output).first
     end
 
@@ -73,7 +73,7 @@ module SourceControl
 
     def new_revisions
       load_new_changesets_from_origin
-      git_output = git('log', ['--pretty=raw', 'HEAD..origin/master'])
+      git_output = git('log', ['--pretty=raw', '--name-status', 'HEAD..origin/master'])
       Git::LogParser.new.parse(git_output)
     end
 </diff>
      <filename>lib/source_control/git.rb</filename>
    </modified>
    <modified>
      <diff>@@ -7,35 +7,34 @@ module SourceControl
 
         log.each do |line|
           line.chomp!
-          line == &quot;&quot; ? next : process_line(line)
+          parse_line(line) unless line.blank?
         end
 
-        @result &lt;&lt; Git::Revision.new(@id, @author, @time) if @commit_message
+        add_current_revision_to_result if @id
 
-        return @result
+        @result
       end
 
       private
 
-      def process_line(line)
-        if commit_message?(line)
-          @commit_message ||= true
-# TODO: we are not parsing out the commit message, and not displaying changesets on the dashboard for Git yet
-#          @commit_message += line.sub('    ', '')
-        else
-          add_current_revision_to_result
-          parse_line(line)
-        end
-      end
-
       def parse_line(line)
-        match = line.match(/^(\w+) (.*)$/)
-        key, value = match[1,2]
-
-        case key
-        when 'commit' then @id = value
-        when 'author' then parse_author(value)
-        else  # ignore other keys
+        if match = line.match(/^(\w\w+) (.*)$/)
+          key, value = match[1, 2]
+
+          case key
+          when 'commit'
+            add_current_revision_to_result if @id
+            @id = value
+          when 'author'
+            parse_author(value)
+          else  # ignore other keys
+          end
+        else
+          if commit_message?(line)
+            @commit_message = &quot;#{@commit_message}#{line.sub('    ', '')}\n&quot;
+          else
+            (@changeset ||= []) &lt;&lt; parse_changeset_entry(line)
+          end
         end
       end
 
@@ -47,12 +46,14 @@ module SourceControl
       def commit_message?(line)
         line[0, 4] == '    '
       end
+      
+      def parse_changeset_entry(line)
+        ChangesetEntry.new(*line.split(/\s+/, 2))
+      end
 
       def add_current_revision_to_result
-        if @commit_message
-          @result &lt;&lt; Git::Revision.new(@id, @author, @time)
-          @id = @author = @time = nil
-        end
+        @result &lt;&lt; Git::Revision.new(@id, @author, @time, @commit_message.chomp, @changeset)
+        @id = @author = @time = @commit_message = @changeset = nil
       end
 
     end</diff>
      <filename>lib/source_control/git/log_parser.rb</filename>
    </modified>
    <modified>
      <diff>@@ -8,8 +8,8 @@ module SourceControl
         @id, @committed_by, @time, @message, @changeset = id, committed_by, time, message, changeset
       end
       
-      # the shortened version of the ID, used in the UI - note that we need the full long UIs to
-      # guarantee we can do git operations without running into multiple matching revisions
+      # the shortened version of the ID, used in the UI - note that we keep the full long IDs
+      # to guarantee we can do git operations without running into multiple matching commits.
       def number
         id[0, 7]
       end</diff>
      <filename>lib/source_control/git/revision.rb</filename>
    </modified>
    <modified>
      <diff>@@ -10,7 +10,12 @@ parent bb52b2f82fea03b7531496c77db01f9348edbbdb
 author Alexey Verkhovsky &lt;alexey.verkhovsky@gmail.com&gt; 1209921867 -0600
 committer Alexey Verkhovsky &lt;alexey.verkhovsky@gmail.com&gt; 1209921867 -0600
 
-    a comment
+    my comment
+    it haz multiple lines
+
+M\tsome/file.txt
+D\told file with spaces
+A\tnew_file
 EOF
 
     def test_parse_to_revision
@@ -18,9 +23,21 @@ EOF
 
       assert_equal 1, revisions.length
       assert_equal 'e51d66aa4f708fff1c87eb9afc9c48eaa8d5ffce', revisions.first.id
-      assert_equal 'e51d66a', revisions.first.number
+      assert_equal 'e51d66a', revisions.first.number # truncated to 7 characters
       assert_equal 'Alexey Verkhovsky &lt;alexey.verkhovsky@gmail.com&gt;', revisions.first.committed_by
       assert_equal Time.at(1209921867), revisions.first.time
+      assert_equal &quot;my comment\nit haz multiple lines&quot;, revisions.first.message
+      assert_equal [ ChangesetEntry.new(&quot;M&quot;, &quot;some/file.txt&quot;),
+                     ChangesetEntry.new(&quot;D&quot;, &quot;old file with spaces&quot;),
+                     ChangesetEntry.new(&quot;A&quot;, &quot;new_file&quot;) ], revisions.first.changeset
+      assert_equal &lt;&lt;EOF, revisions.first.to_s
+Revision e51d66a committed by Alexey Verkhovsky &lt;alexey.verkhovsky@gmail.com&gt; on 2008-05-05 05:24:27
+my comment
+it haz multiple lines
+  M some/file.txt
+  D old file with spaces
+  A new_file
+EOF
     end
 
     def test_parse_line_should_recognize_author</diff>
      <filename>test/unit/source_control/git/log_parser_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -35,7 +35,7 @@ class SourceControl::GitTest &lt; Test::Unit::TestCase
     in_sandbox do
       git = new_git
       git.expects(:git).with(&quot;remote&quot;, [&quot;update&quot;])
-      git.expects(:git).with(&quot;log&quot;, [&quot;--pretty=raw&quot;, &quot;HEAD..origin/master&quot;]).returns(&quot;a log output&quot;)
+      git.expects(:git).with(&quot;log&quot;, [&quot;--pretty=raw&quot;, &quot;--name-status&quot;, &quot;HEAD..origin/master&quot;]).returns(&quot;a log output&quot;)
 
       mock_parser = Object.new
       mock_parser.expects(:parse).with(&quot;a log output&quot;).returns([:new_revision])
@@ -51,7 +51,7 @@ class SourceControl::GitTest &lt; Test::Unit::TestCase
     in_sandbox do
       git = new_git
       git.expects(:git).with(&quot;remote&quot;, [&quot;update&quot;])
-      git.expects(:git).with(&quot;log&quot;, [&quot;--pretty=raw&quot;, &quot;HEAD..origin/master&quot;]).returns(&quot;\n&quot;)
+      git.expects(:git).with(&quot;log&quot;, [&quot;--pretty=raw&quot;, &quot;--name-status&quot;, &quot;HEAD..origin/master&quot;]).returns(&quot;\n&quot;)
 
       mock_parser = Object.new
       mock_parser.expects(:parse).with(&quot;\n&quot;).returns([])
@@ -87,7 +87,7 @@ class SourceControl::GitTest &lt; Test::Unit::TestCase
   def test_latest_revision_should_call_git_log_and_send_it_to_parser
     in_sandbox do
       git = new_git
-      git.expects(:git).with(&quot;log&quot;, [&quot;-1&quot;, '--pretty=raw', 'origin/master']).returns('')
+      git.expects(:git).with(&quot;log&quot;, [&quot;-1&quot;, &quot;--pretty=raw&quot;, &quot;--name-status&quot;, &quot;origin/master&quot;]).returns(&quot;&quot;)
       git.expects(:git).with('fetch', ['origin'])
       stub_parser = Object.new
       stub_parser.stubs(:parse).returns([:foo])</diff>
      <filename>test/unit/source_control/git_test.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>3dab53071780b410b3435d178872a32664c92adb</id>
    </parent>
  </parents>
  <author>
    <name>Will Bryant</name>
    <email>will.bryant@gmail.com</email>
  </author>
  <url>http://github.com/willbryant/cruisecontrolrb/commit/299c70d30ab3fb607de058def5163f5fafe3bb39</url>
  <id>299c70d30ab3fb607de058def5163f5fafe3bb39</id>
  <committed-date>2008-06-08T17:40:26-07:00</committed-date>
  <authored-date>2008-06-08T16:13:13-07:00</authored-date>
  <message>implemented full git log parsing, including message and changeset</message>
  <tree>389969b37f5383e6fd84f0d81b983b79b91f30b1</tree>
  <committer>
    <name>Will Bryant</name>
    <email>will.bryant@gmail.com</email>
  </committer>
</commit>
