]> Lady’s Gitweb - Gitweb/blobdiff - gitweb.perl
gitweb: Add author and committer email extraction to parse_commit
[Gitweb] / gitweb.perl
index 0fac8e25f2d91302e77b173ce4ad1cf9d22c74de3ff475e70731df5b8089ff9c..6e727c8b914956005da4a0522f56d49c3bafc952c5633fa2b8f46ab248e2635b 100755 (executable)
@@ -1295,8 +1295,9 @@ sub parse_commit {
                        $co{'author'} = $1;
                        $co{'author_epoch'} = $2;
                        $co{'author_tz'} = $3;
-                       if ($co{'author'} =~ m/^([^<]+) </) {
-                               $co{'author_name'} = $1;
+                       if ($co{'author'} =~ m/^([^<]+) <([^>]*)>/) {
+                               $co{'author_name'}  = $1;
+                               $co{'author_email'} = $2;
                        } else {
                                $co{'author_name'} = $co{'author'};
                        }
@@ -1305,7 +1306,12 @@ sub parse_commit {
                        $co{'committer_epoch'} = $2;
                        $co{'committer_tz'} = $3;
                        $co{'committer_name'} = $co{'committer'};
-                       $co{'committer_name'} =~ s/ <.*//;
+                       if ($co{'committer'} =~ m/^([^<]+) <([^>]*)>/) {
+                               $co{'committer_name'}  = $1;
+                               $co{'committer_email'} = $2;
+                       } else {
+                               $co{'committer_name'} = $co{'committer'};
+                       }
                }
        }
        if (!defined $co{'tree'}) {
This page took 0.272425 seconds and 4 git commands to generate.