git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jakub Narebski <jnareb@gmail.com>
To: git@vger.kernel.org
Subject: [PATCH 3/3] gitweb: Add author initials in 'blame' view, a la "git gui blame"
Date: Sat, 11 Jul 2009 00:01:23 +0200	[thread overview]
Message-ID: <200907110001.24093.jnareb@gmail.com> (raw)
In-Reply-To: <200907102354.43232.jnareb@gmail.com>

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 <jnareb@gmail.com>
---
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

  parent reply	other threads:[~2009-07-10 22:01 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-07-10 21:54 [PATCH 0/3] gitweb: 'blame' view improvements Jakub Narebski
2009-07-10 21:55 ` [PATCH 1/3] gitweb: Mark boundary commits in 'blame' view Jakub Narebski
2009-07-10 21:57 ` [PATCH 2/3] gitweb: Use "previous" header of git-blame -p " Jakub Narebski
2009-07-10 22:21   ` Junio C Hamano
2009-07-11  9:17     ` Jakub Narebski
2009-07-12 17:21   ` Luben Tuikov
2009-07-14 19:21   ` Jakub Narebski
2009-07-10 22:01 ` Jakub Narebski [this message]
2009-07-11 16:56 ` [PATCH 0/3] gitweb: 'blame' view improvements Jakub Narebski
2009-07-13 19:08   ` [RFC PATCH 5/3] gitweb: Incremental blame (proof of concept) Jakub Narebski
2009-07-12 22:08 ` [PATCH 4/3] gitweb: Use light/dark class also in 'blame' view Jakub Narebski

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200907110001.24093.jnareb@gmail.com \
    --to=jnareb@gmail.com \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).