X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FGitalist%2FGit%2FProject.pm;h=60a813b87a02607da967dcd7345c83a611c22f09;hb=d8abdf1cd357564b8e9e7b2c766feb9990a941fb;hp=844dcf31163275f76ad043c4c41783bb36aa9f7d;hpb=74af77a336a18f3f46d0ebe723e1495d12faacd1;p=catagits%2FGitalist.git diff --git a/lib/Gitalist/Git/Project.pm b/lib/Gitalist/Git/Project.pm index 844dcf3..60a813b 100644 --- a/lib/Gitalist/Git/Project.pm +++ b/lib/Gitalist/Git/Project.pm @@ -382,6 +382,50 @@ The keys for each item will be: return @ret; } + method reflog (@logargs) { + my @entries + = $self->run_cmd(qw(log -g), @logargs) + =~ /(^commit.+?(?:(?=^commit)|(?=\z)))/msg; + +=pod + commit 02526fc15beddf2c64798a947fecdd8d11bf993d + Reflog: HEAD@{14} (The Git Server ) + Reflog message: push + Author: Foo Barsby + Date: Thu Sep 17 12:26:05 2009 +0100 + + Merge branch 'abc123' + +=cut + + return map { + # XXX Stuff like this makes me want to switch to Git::PurePerl + my($sha1, $type, $author, $date) + = m{ + ^ commit \s+ ($SHA1RE)$ + .*? + Reflog[ ]message: \s+ (.+?)$ \s+ + Author: \s+ ([^<]+) <.*?$ \s+ + Date: \s+ (.+?)$ + }xms; + + pos($_) = index($_, $date) + length $date; + + # Yeah, I just did that. + my($msg) = /\G\s+(\S.*)/sg; + { + hash => $sha1, + type => $type, + author => $author, + + # XXX Add DateTime goodness. + date => $date, + message => $msg, + } + ; + } @entries; + } + # Compatibility =head2 info