]> Lady’s Gitweb - Gitweb/commitdiff
gitweb: Move git_get_last_activity subroutine earlier
authorJakub Narebski <redacted>
Sat, 28 Oct 2006 17:43:40 +0000 (19:43 +0200)
committerLady <redacted>
Mon, 6 Apr 2026 04:07:11 +0000 (00:07 -0400)
This is purely cosmetic.  Having git_get_* between two parse_* subroutines
violated a good convention to group related things together.

Signed-off-by: Jakub Narebski <redacted>
Signed-off-by: Junio C Hamano <redacted>
gitweb.perl

index d1a4fb8444380ead9b25d84d5c3ce97512766f758916cb37f703b1fb720897ef..08b945759458a02d0d00f5fc576b9258478c57206b32c9c111fea40a7f0c36dc 100755 (executable)
@@ -1001,6 +1001,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;
@@ -1107,24 +1125,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;
This page took 0.235406 seconds and 4 git commands to generate.