@@ -3505,18 +3505,20 @@ use constant {
3505
3505
LINE => 0,
3506
3506
TEXT => 1,
3507
3507
OWNER => 2,
3508
- DATE => 3,
3509
- AGE => 4,
3510
- COMMIT => 5,
3511
- LINE_TLA => 6,
3512
- BRANCH_TLA => 7,
3513
- FUNCTION_TLA => 8,
3508
+ FULL_NAME => 3,
3509
+ DATE => 4,
3510
+ AGE => 5,
3511
+ COMMIT => 6,
3512
+ LINE_TLA => 7,
3513
+ BRANCH_TLA => 8,
3514
+ FUNCTION_TLA => 9,
3514
3515
};
3515
3516
3516
3517
sub new
3517
3518
{
3518
3519
my $class = shift ;
3519
- my @data = @_ ; # [lineNo, text, owner, date, age, commitID, lineCovTla]
3520
+ my @data = @_
3521
+ ; # [lineNo, text, abbrev_name, full_name, date, age, commitID, lineCovTla]
3520
3522
# [line, text, owner, date, age, commit, lineTLA, branchTLA, functionTLA
3521
3523
my $self = \@data ;
3522
3524
bless $self , $class ;
@@ -3529,6 +3531,12 @@ sub owner
3529
3531
return $# $self >= OWNER ? $self -> [OWNER] : undef ;
3530
3532
}
3531
3533
3534
+ sub full_name
3535
+ {
3536
+ my $self = shift ;
3537
+ return $# $self >= FULL_NAME ? $self -> [FULL_NAME] : undef ;
3538
+ }
3539
+
3532
3540
# line coverage TLA
3533
3541
sub tla
3534
3542
{
@@ -3586,7 +3594,7 @@ sub text
3586
3594
3587
3595
package SourceFile ;
3588
3596
our @annotateScript ;
3589
- our $annotateTooltip = ' Line %l: commit %C on %d' ;
3597
+ our $annotateTooltip = ' Line %l: commit %C on %d by %F ' ;
3590
3598
our $annotatedFiles = 0;
3591
3599
our $totalFiles = 0;
3592
3600
@@ -4378,28 +4386,35 @@ sub _load
4378
4386
4379
4387
my ($commit , $owner , $when , $text ) = split (/ \| / , $line , 4);
4380
4388
my $age = _computeAge($when , $path );
4389
+ # semicolon is not a legal character in email address -
4390
+ # so we use that to delimit the 'abbreviated name' and
4391
+ # the 'full name' - in case they are different.
4392
+ # this is an attempt to be backward-compatible with
4393
+ # existing annotation scripts which return only one name
4394
+ my ($abbrev , $full ) = split (/ ;/ , $owner , 2);
4381
4395
if ($commit ne ' NONE' ) {
4382
4396
die (" inconsistent 'annotate' data for '$repo_path ': both 'commit' and 'no commit' lines"
4383
4397
) if (defined ($found ) && !$found );
4384
4398
$found = 1;
4385
4399
4386
- defined ($owner ) or
4400
+ defined ($abbrev ) or
4387
4401
die (" owner is undef for $repo_path :$lineNum " );
4388
- $self -> [LINE_OWNERS]-> {$owner } = {}
4389
- unless exists ($self -> [LINE_OWNERS]-> {$owner });
4390
- my $dhash = $self -> [LINE_OWNERS]-> {$owner };
4402
+ $self -> [LINE_OWNERS]-> {$abbrev } = {}
4403
+ unless exists ($self -> [LINE_OWNERS]-> {$abbrev });
4404
+ my $dhash = $self -> [LINE_OWNERS]-> {$abbrev };
4391
4405
$dhash -> {lines } = []
4392
4406
unless exists ($dhash -> {lines });
4393
4407
push (@{$dhash -> {lines }}, $lineNum );
4394
4408
} else {
4395
4409
die (" inconsistent 'annotate' data for '$repo_path ': both 'no commit' and 'commit' lines"
4396
4410
) if (defined ($found ) && $found );
4397
- $found = 0;
4398
- $owner = " no.body" ;
4411
+ $found = 0;
4412
+ $abbrev = " no.body" ;
4399
4413
}
4414
+ $full = $abbrev unless defined ($full );
4400
4415
push @{$self -> [LINES]},
4401
- SourceLine-> new($lineNum , $text , $owner , $when , $age ,
4402
- $commit );
4416
+ SourceLine-> new($lineNum , $text , $abbrev , $full ,
4417
+ $when , $age , $ commit );
4403
4418
}
4404
4419
close (HANDLE);
4405
4420
my $status = $? >> 8;
@@ -4513,6 +4528,7 @@ sub _synthesize
4513
4528
DateTime-> from_epoch(epoch => $ENV {SOURCE_DATE_EPOCH }) :
4514
4529
DateTime-> now();
4515
4530
push (@fakeline , ' no.body' , # owner
4531
+ ' fake user' , # full name
4516
4532
$now , # when
4517
4533
_computeAge($now , $self -> path()), # age
4518
4534
' synthesized' ); # commit ID
@@ -8855,6 +8871,7 @@ sub write_source_line(*$$$$)
8855
8871
my $date = $lineData -> date();
8856
8872
$date =~ s / (T.+)$// ; # just the year/month/day part
8857
8873
foreach my $p ([' %U' , $lineData -> owner()],
8874
+ [' %F' , $lineData -> full_name()],
8858
8875
[' %D' , $lineData -> date()],
8859
8876
[' %d' , $date ],
8860
8877
[' %A' , $lineData -> age()],
0 commit comments