gitweb: Add author initials in 'blame' view, a la "git gui blame"
[gitweb.git] / gitweb / gitweb.perl
index 128bddd38154fa6fb745f42a5553e5bde9360a2b..ea1ab5f846ec34f41af803d23357fdacac3f9bb5 100755 (executable)
@@ -4855,6 +4855,14 @@ sub git_blame {
                                                     hash=>$full_rev,
                                                     file_name=>$file_name)},
                                      esc_html($short_rev));
+                       if ($group_size >= 2) {
+                               my @author_initials = ($author =~ /\b([[:upper:]])\B/g);
+                               if (@author_initials) {
+                                       print "<br />" .
+                                             esc_html(join('', @author_initials));
+                                       #           or join('.', ...)
+                               }
+                       }
                        print "</td>\n";
                }
                # 'previous' <sha1 of parent commit> <filename at commit>