git-gui: Skip nicknames when selecting author initials
Our blame viewer only grabbed the first initial of the git.git author string "Simon 'corecode' Schubert". Here the problem was we looked at Simon, pulled the S into the author initials, then saw the single quote as the start of the next name and did not like this character as it was not an uppercase letter. We now skip over single quoted nicknames placed within the author name field and grab the initials following it. So the above name will get the initials SS, rather than just S. Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Shawn O. Pearce committed
Jul 8, 2007 at 21:06 UTC
88dce86f38bed84abadd73bbc40d9df92b7519db
1 file changed
+4
lib/blame.tcl
+4
@@ -547,6 +547,10 @@ method _read_blame {fd cur_w cur_d cur_s} {
547
set a_name {}
548
catch {set a_name $header($cmit,author)}
549
while {$a_name ne {}} {
550
+ if {$author_abbr ne {}
551
+ && [string index $a_name 0] eq {'}} {
552
+ regsub {^'[^']+'\s+} $a_name {} a_name
553
+ }
554
if {![regexp {^([[:upper:]])} $a_name _a]} break
555
append author_abbr $_a
556
unset _a