Created
July 9, 2012 13:15
-
-
Save poke/3076489 to your computer and use it in GitHub Desktop.
[PATCH] GitWeb: Include committer name in last change.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
From: Patrick Westerhoff <PatrickWesterhoff@gmail.com> | |
Date: Mon, 9 Jul 2012 14:07:28 +0200 | |
Subject: [PATCH] Include committer name in last change. | |
diff --git a/gitweb.cgi b/gitweb.cgi | |
index 2bd0d29..fbb1659 100755 | |
--- a/gitweb.cgi | |
+++ b/gitweb.cgi | |
@@ -3170,9 +3170,10 @@ sub git_get_last_activity { | |
close $fd or return; | |
if (defined $most_recent && | |
$most_recent =~ / (\d+) [-+][01]\d\d\d$/) { | |
+ my $committer = substr($most_recent, 0, rindex($most_recent, "<") - 1); | |
my $timestamp = $1; | |
my $age = time - $timestamp; | |
- return ($age, age_string($age)); | |
+ return ($age, age_string($age), $committer); | |
} | |
return (undef, undef); | |
} | |
@@ -5334,7 +5335,7 @@ sub fill_project_list_info { | |
unless (@activity) { | |
next PROJECT; | |
} | |
- ($pr->{'age'}, $pr->{'age_string'}) = @activity; | |
+ ($pr->{'age'}, $pr->{'age_string'}, $pr->{'committer'}) = @activity; | |
} | |
if (project_info_needs_filling($pr, $filter_set->('descr', 'descr_long'))) { | |
my $descr = git_get_project_description($pr->{'path'}) || ""; | |
@@ -5467,7 +5468,7 @@ sub git_project_list_rows { | |
"</td>\n" . | |
"<td><i>" . chop_and_escape_str($pr->{'owner'}, 15) . "</i></td>\n"; | |
print "<td class=\"". age_class($pr->{'age'}) . "\">" . | |
- (defined $pr->{'age_string'} ? $pr->{'age_string'} : "No commits") . "</td>\n" . | |
+ (defined $pr->{'age_string'} ? $pr->{'age_string'} . " (" . $pr->{'committer'} . ")" : "No commits") . "</td>\n" . | |
"<td class=\"link\">" . | |
$cgi->a({-href => href(project=>$pr->{'path'}, action=>"summary")}, "summary") . " | " . | |
$cgi->a({-href => href(project=>$pr->{'path'}, action=>"shortlog")}, "shortlog") . " | " . |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment