Gitweb – name of last person to commit

I’m looking to add the name of the person who made the last commit to each project on the GitWeb project list, so instead of

14 min ago

it says something like

14 min ago (Someone's Name)

I’ve had a look through gitweb.cgi and found the point where the string is written (line 5488 in mine), but I don’t really know how to proceed.

Has anyone already done this? Or can anyone offer a quick solution?

  • git svn clone fails on Mac OS X: “Temp file with moniker 'svn_delta' already in use”
  • git-svn fetch fails on file whose size > LONG_MAX
  • How can I access the commited file from a Subversion pre-commit hook in Perl?
  • How to find word count in each git commit in a repository's history?
  • XML parsing error when trying to configure gitweb after installing BugZilla perl dependencies
  • organizing a git repo for a huge legacy code base
  • How to separate local from shared code using git repos
  • Performing second SSH within SSH in perl
  • One Solution collect form web for “Gitweb – name of last person to commit”

    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',
         '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" .


    (defined $pr->{'age_string'} ? $pr->{'age_string'} . ' (' . $pr->{'committer'} . ')' : "No commits") . "</td>\n" .
    Git Baby is a git and github fan, let's start git clone.