git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH] gitweb: Move git_get_last_activity subroutine earlier

From
Jakub Narebski <jnareb@gmail.com>
Date
Oct 28, 2006, 17:43 UTC
Message-ID
<200610281943.40456.jnareb@gmail.com>
Signed-off-by: Jakub Narebski <jnareb@gmail.com>
---
Good test for git-pickaxe (git-blame2).
 gitweb/gitweb.perl |   36 ++++++++++++++++++------------------
 1 files changed, 18 insertions(+), 18 deletions(-)
diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index 5f6a562..cbab3c9 100755
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
@@ -976,6 +976,24 @@ sub git_get_project_owner {
 	return $owner;
 }
 
+sub git_get_last_activity {
+	my ($path) = @_;
+	my $fd;
+
+	$git_dir = "$projectroot/$path";
+	open($fd, "-|", git_cmd(), 'for-each-ref',
+	     '--format=%(refname) %(committer)',
+	     '--sort=-committerdate',
+	     'refs/heads') or return;
+	my $most_recent = <$fd>;
+	close $fd or return;
+	if ($most_recent =~ / (\d+) [-+][01]\d\d\d$/) {
+		my $timestamp = $1;
+		my $age = time - $timestamp;
+		return ($age, age_string($age));
+	}
+}
+
 sub git_get_references {
 	my $type = shift || "";
 	my %refs;
@@ -1082,24 +1100,6 @@ sub parse_tag {
 	return %tag
 }
 
-sub git_get_last_activity {
-	my ($path) = @_;
-	my $fd;
-
-	$git_dir = "$projectroot/$path";
-	open($fd, "-|", git_cmd(), 'for-each-ref',
-	     '--format=%(refname) %(committer)',
-	     '--sort=-committerdate',
-	     'refs/heads') or return;
-	my $most_recent = <$fd>;
-	close $fd or return;
-	if ($most_recent =~ / (\d+) [-+][01]\d\d\d$/) {
-		my $timestamp = $1;
-		my $age = time - $timestamp;
-		return ($age, age_string($age));
-	}
-}
-
 sub parse_commit {
 	my $commit_id = shift;
 	my $commit_text = shift;
-- 
1.4.3.3
Next: Junio C Hamano
Message 1 of 5 in “gitweb: Move git_get_last_activity subroutine earlier”
  1. gitweb: Move git_get_last_activity subroutine earlierJakub Narebski, Oct 28, 2006
  2. Junio C HamanoOct 28, 2006
  3. Jakub NarebskiOct 28, 2006
  4. Junio C HamanoOct 28, 2006
  5. Junio C HamanoOct 28, 2006

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.