aboutsummaryrefslogtreecommitdiff
path: root/IkiWiki/Plugin/git.pm
diff options
context:
space:
mode:
authorJoey Hess <joey@kitenet.net>2010-06-23 15:32:27 -0400
committerJoey Hess <joey@kitenet.net>2010-06-23 15:54:52 -0400
commitc46bcb425af0948ac59581d6ba7b477826d83ae3 (patch)
treefed9af5634ba9e74b5284ea44eb1a63a6755cf40 /IkiWiki/Plugin/git.pm
parent0580cbbf40873a2d20da96b41f4b14f642cb108d (diff)
downloadikiwiki-c46bcb425af0948ac59581d6ba7b477826d83ae3.tar
ikiwiki-c46bcb425af0948ac59581d6ba7b477826d83ae3.tar.gz
Add new optional field usershort to rcs_recentchanges.
Now the git plugin supports commits with author fields that look like: Author: http://my.openid/ <me@web> Then in recentchanges, the short username will be displayed, linking to the openid. Particularly useful for the horrible google openids, of course.
Diffstat (limited to 'IkiWiki/Plugin/git.pm')
-rw-r--r--IkiWiki/Plugin/git.pm15
1 files changed, 11 insertions, 4 deletions
diff --git a/IkiWiki/Plugin/git.pm b/IkiWiki/Plugin/git.pm
index 222692eda..a43b85920 100644
--- a/IkiWiki/Plugin/git.pm
+++ b/IkiWiki/Plugin/git.pm
@@ -342,8 +342,9 @@ sub parse_diff_tree ($) {
$ci{ "${who}_epoch" } = $epoch;
$ci{ "${who}_tz" } = $tz;
- if ($name =~ m/^[^<]+\s+<([^@>]+)/) {
- $ci{"${who}_username"} = $1;
+ if ($name =~ m/^([^<]+)\s+<([^@>]+)/) {
+ $ci{"${who}_name"} = $1;
+ $ci{"${who}_username"} = $2;
}
elsif ($name =~ m/^([^<]+)\s+<>$/) {
$ci{"${who}_username"} = $1;
@@ -588,9 +589,14 @@ sub rcs_recentchanges ($) {
push @messages, { line => $line };
}
- my $user=$ci->{'author_username'};
+ my $user=$ci->{'author_name'};
+ my $usershort=$ci->{'author_username'};
my $web_commit = ($ci->{'author'} =~ /\@web>/);
-
+
+ if ($usershort =~ /:\/\//) {
+ $usershort=undef; # url; not really short
+ }
+
# compatability code for old web commit messages
if (! $web_commit &&
defined $messages[0] &&
@@ -603,6 +609,7 @@ sub rcs_recentchanges ($) {
push @rets, {
rev => $sha1,
user => $user,
+ usershort => $usershort,
committype => $web_commit ? "web" : "git",
when => $when,
message => [@messages],