Thanks to simbabque for pointing me to git_get_last_activity
. My solution (possibly sub-optimal, let me know if it is):
Change git_get_last_activity
to
sub git_get_last_activity {
my ($path) = @_;
my $fd;
$git_dir = "$projectroot/$path";
open($fd, "-|", git_cmd(), 'for-each-ref',
'--format=%(committer)',
'--sort=-committerdate',
'--count=1',
'refs/heads') or return;
my $most_recent = <$fd>;
close $fd or return;
if (defined $most_recent &&
$most_recent =~ / (\d+) [-+][01]\d\d\d$/) {
my $bracket_position = rindex($most_recent, "<");
my $committer_name = substr($most_recent, 0, $bracket_position - 1);
my $timestamp = $1;
my $age = time - $timestamp;
return ($age, age_string($age), $committer_name);
}
return (undef, undef, undef);
}
Then search for where that is called later (should only be once) and change
($pr->{'age'}, $pr->{'age_string'}) = @activity;
to be
($pr->{'age'}, $pr->{'age_string'}, $pr->{'committer'}) = @activity;
Then go to git_project_list_rows
and change
(defined $pr->{'age_string'} ? $pr->{'age_string'} : "No commits") . "</td>\n" .
to
(defined $pr->{'age_string'} ? $pr->{'age_string'} . ' (' . $pr->{'committer'} . ')' : "No commits") . "</td>\n" .