<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -14,6 +14,8 @@ Revision history for Perl module Git::PurePerl:
        to martijn)
      - allow bare repositories with the gitdir parameter (thanks
        to martijn)
+     - fill new commits with real author, authored_time, committer,
+       committed_time and comment (thanks to martijn)
 
 0.40 Fri Mar 13 15:29:02 GMT 2009
      - Skip protocol tests on Win32 (thanks to fayland)</diff>
      <filename>CHANGES</filename>
    </modified>
    <modified>
      <diff>@@ -2,28 +2,47 @@ package Git::PurePerl::NewObject::Commit;
 use Moose;
 use MooseX::StrictConstructor;
 use Moose::Util::TypeConstraints;
+use DateTime;
 extends 'Git::PurePerl::NewObject';
 
 has 'kind' =&gt;
     ( is =&gt; 'ro', isa =&gt; 'ObjectKind', required =&gt; 1, default =&gt; 'commit' );
-has 'tree'      =&gt; ( is =&gt; 'rw', isa =&gt; 'Str', required =&gt; 1 );
-has 'parent'    =&gt; ( is =&gt; 'rw', isa =&gt; 'Str', required =&gt; 0 );
-has 'author'    =&gt; ( is =&gt; 'rw', isa =&gt; 'Str', required =&gt; 0 );
-has 'committer' =&gt; ( is =&gt; 'rw', isa =&gt; 'Str', required =&gt; 0 );
-has 'comment'   =&gt; ( is =&gt; 'rw', isa =&gt; 'Str', required =&gt; 0 );
+has 'tree'   =&gt; ( is =&gt; 'rw', isa =&gt; 'Str',                  required =&gt; 1 );
+has 'parent' =&gt; ( is =&gt; 'rw', isa =&gt; 'Str',                  required =&gt; 0 );
+has 'author' =&gt; ( is =&gt; 'rw', isa =&gt; 'Git::PurePerl::Actor', required =&gt; 1 );
+has 'authored_time' =&gt; ( is =&gt; 'rw', isa =&gt; 'DateTime', required =&gt; 1 );
+has 'committer' =&gt;
+    ( is =&gt; 'rw', isa =&gt; 'Git::PurePerl::Actor', required =&gt; 1 );
+has 'committed_time' =&gt; ( is =&gt; 'rw', isa =&gt; 'DateTime', required =&gt; 1 );
+has 'comment'        =&gt; ( is =&gt; 'rw', isa =&gt; 'Str',      required =&gt; 1 );
 
 __PACKAGE__-&gt;meta-&gt;make_immutable;
 
 sub _build_content {
     my $self = shift;
     my $content;
+
     $content .= 'tree ' . $self-&gt;tree . &quot;\n&quot;;
     $content .= 'parent ' . $self-&gt;parent . &quot;\n&quot; if $self-&gt;parent;
-    $content .= &quot;author Leon Brocard &lt;acme\@astray.com&gt; 1226651274 +0000\n&quot;;
     $content
-        .= &quot;committer Leon Brocard &lt;acme\@astray.com&gt; 1226651274 +0000\n&quot;;
+        .= &quot;author &quot;
+        . $self-&gt;author-&gt;name . ' &lt;'
+        . $self-&gt;author-&gt;email . &quot;&gt; &quot;
+        . $self-&gt;authored_time-&gt;epoch . &quot; &quot;
+        . DateTime::TimeZone-&gt;offset_as_string( $self-&gt;authored_time-&gt;offset )
+        . &quot;\n&quot;;
+    $content
+        .= &quot;committer &quot;
+        . $self-&gt;committer-&gt;name . ' &lt;'
+        . $self-&gt;author-&gt;email . &quot;&gt; &quot;
+        . $self-&gt;committed_time-&gt;epoch . &quot; &quot;
+        . DateTime::TimeZone-&gt;offset_as_string(
+        $self-&gt;committed_time-&gt;offset )
+        . &quot;\n&quot;;
     $content .= &quot;\n&quot;;
-    $content .= &quot;A comment\n&quot;;
+    my $comment = $self-&gt;comment;
+    chomp $comment;
+    $content .= &quot;$comment\n&quot;;
 
     $self-&gt;content($content);
 }</diff>
      <filename>lib/Git/PurePerl/NewObject/Commit.pm</filename>
    </modified>
    <modified>
      <diff>@@ -1,7 +1,7 @@
 #!perl
 use strict;
 use warnings;
-use Test::More tests =&gt; 61;
+use Test::More tests =&gt; 97;
 use Git::PurePerl;
 use Path::Class;
 
@@ -64,13 +64,33 @@ for my $directory (qw(test-init test-init-bare.git)) {
     is( $directory_entry2-&gt;filename, 'there.txt' );
     is( $directory_entry2-&gt;sha1, 'c78ee1a5bdf46d22da300b68d50bc45c587c3293' );
 
-    my $commit = Git::PurePerl::NewObject::Commit-&gt;new( tree =&gt; $tree-&gt;sha1 );
-    is( $commit-&gt;sha1, 'd75f1437e0c19c36f9b52312eeb6b0200dbd22ac' );
+    my $actor = Git::PurePerl::Actor-&gt;new(
+        name  =&gt; 'Your Name Comes Here',
+        email =&gt; 'you@yourdomain.example.com'
+    );
+    my $commit = Git::PurePerl::NewObject::Commit-&gt;new(
+        tree           =&gt; $tree-&gt;sha1,
+        author         =&gt; $actor,
+        authored_time  =&gt; DateTime-&gt;from_epoch( epoch =&gt; 1240341681 ),
+        committer      =&gt; $actor,
+        committed_time =&gt; DateTime-&gt;from_epoch( epoch =&gt; 1240341682 ),
+        comment        =&gt; 'Fix',
+    );
+    is( $commit-&gt;sha1, '860caea5ba298bb4f1df9a80fad84951fcc7db72' );
     $git-&gt;put_object($commit);
 
     my $commit2
-        = $git-&gt;get_object('d75f1437e0c19c36f9b52312eeb6b0200dbd22ac');
+        = $git-&gt;get_object('860caea5ba298bb4f1df9a80fad84951fcc7db72');
     is( $commit2-&gt;tree_sha1, $tree-&gt;sha1 );
+    isa_ok( $commit2-&gt;author, 'Git::PurePerl::Actor' );
+    is( $commit2-&gt;author-&gt;name,  'Your Name Comes Here' );
+    is( $commit2-&gt;author-&gt;email, 'you@yourdomain.example.com' );
+    isa_ok( $commit2-&gt;committer, 'Git::PurePerl::Actor' );
+    is( $commit2-&gt;committer-&gt;name,       'Your Name Comes Here' );
+    is( $commit2-&gt;committer-&gt;email,      'you@yourdomain.example.com' );
+    is( $commit2-&gt;authored_time-&gt;epoch,  1240341681 );
+    is( $commit2-&gt;committed_time-&gt;epoch, 1240341682 );
+    is( $commit2-&gt;comment,               'Fix' );
 
     if ( $directory eq 'test-init-bare.git' ) {
         $git = Git::PurePerl-&gt;new( gitdir =&gt; $directory );
@@ -121,11 +141,27 @@ for my $directory (qw(test-init test-init-bare.git)) {
         directory_entries =&gt; [ $hello_de, $here_de ] );
     $git-&gt;put_object($tree);
     my $newcommit = Git::PurePerl::NewObject::Commit-&gt;new(
-        tree   =&gt; $tree-&gt;sha1,
-        parent =&gt; $commit-&gt;sha1
+        tree           =&gt; $tree-&gt;sha1,
+        parent         =&gt; $commit-&gt;sha1,
+        author         =&gt; $actor,
+        authored_time  =&gt; DateTime-&gt;from_epoch( epoch =&gt; 1240341683 ),
+        committer      =&gt; $actor,
+        committed_time =&gt; DateTime-&gt;from_epoch( epoch =&gt; 1240341684 ),
+        comment        =&gt; 'Fix again',
     );
     $git-&gt;put_object($newcommit);
 
+    my $newcommit2 = $git-&gt;get_object( $newcommit-&gt;sha1 );
+    isa_ok( $newcommit2-&gt;author, 'Git::PurePerl::Actor' );
+    is( $newcommit2-&gt;author-&gt;name,  'Your Name Comes Here' );
+    is( $newcommit2-&gt;author-&gt;email, 'you@yourdomain.example.com' );
+    isa_ok( $newcommit2-&gt;committer, 'Git::PurePerl::Actor' );
+    is( $newcommit2-&gt;committer-&gt;name,       'Your Name Comes Here' );
+    is( $newcommit2-&gt;committer-&gt;email,      'you@yourdomain.example.com' );
+    is( $newcommit2-&gt;authored_time-&gt;epoch,  1240341683 );
+    is( $newcommit2-&gt;committed_time-&gt;epoch, 1240341684 );
+    is( $newcommit2-&gt;comment,               'Fix again' );
+
     is( $git-&gt;ref('refs/heads/master')-&gt;sha1,
         $newcommit-&gt;sha1, 'master updated' );
 </diff>
      <filename>t/init.t</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>377b00844e5f1e6ce27529e80cf093ef2322116e</id>
    </parent>
  </parents>
  <author>
    <name>Leon Brocard</name>
    <email>acme@astray.com</email>
  </author>
  <url>http://github.com/acme/git-pureperl/commit/beaed08934bfe7d6bac92f14d8913faa675ceb7c</url>
  <id>beaed08934bfe7d6bac92f14d8913faa675ceb7c</id>
  <committed-date>2009-04-21T12:37:36-07:00</committed-date>
  <authored-date>2009-04-21T12:37:36-07:00</authored-date>
  <message>fill new commits with real author, authored_time, committer, committed_time and comment (thanks to martijn)</message>
  <tree>8fc07b70e9d8dc9929de160569314d05605b3d16</tree>
  <committer>
    <name>Leon Brocard</name>
    <email>acme@astray.com</email>
  </committer>
</commit>
