Subject: [PATCH 3/3] gitweb: Add author initials in 'blame' view, a la "git gui blame"

From: Jakub Narebski <[email-masked]>
Date: Sat, 11 Jul 2009 00:01:23 +0200

For example for "Junio C Hamano" initials would be "JH".  Of course
initials are added (below shortened SHA-1 of blamed commit) only if
group of lines has 2 lines or more in it.

Signed-off-by: Jakub Narebski <[email-masked]>
---
Let the bikeshedding begin!

Should it be "JH" or perhaps "J.H." for "Junio C Hamano"?  Or perhaps
username part of author email would be better solution than initials?
Should we use different style for those initials?

This patch was inspired by me adding the same feature in similar 
'blame_incremental' view in
  http://thread.gmane.org/gmane.comp.version-control.git/102657/focus=102712

 gitweb/gitweb.perl |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index 36b1ce5..5336c92 100755
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
@@ -4860,6 +4860,14 @@ HTML
 			                             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>
-- 
1.6.3.3