* [PATCH] gitweb: Move git_get_last_activity subroutine earlier
@ 2006-10-28 17:43 Jakub Narebski
2006-10-28 19:01 ` Junio C Hamano
2006-10-28 20:57 ` Junio C Hamano
0 siblings, 2 replies; 5+ messages in thread
From: Jakub Narebski @ 2006-10-28 17:43 UTC (permalink / raw)
To: git
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
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] gitweb: Move git_get_last_activity subroutine earlier
2006-10-28 17:43 [PATCH] gitweb: Move git_get_last_activity subroutine earlier Jakub Narebski
@ 2006-10-28 19:01 ` Junio C Hamano
2006-10-28 19:20 ` Jakub Narebski
2006-10-28 20:57 ` Junio C Hamano
1 sibling, 1 reply; 5+ messages in thread
From: Junio C Hamano @ 2006-10-28 19:01 UTC (permalink / raw)
To: Jakub Narebski; +Cc: git
Why is this needed?
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] gitweb: Move git_get_last_activity subroutine earlier
2006-10-28 19:01 ` Junio C Hamano
@ 2006-10-28 19:20 ` Jakub Narebski
2006-10-28 19:24 ` Junio C Hamano
0 siblings, 1 reply; 5+ messages in thread
From: Jakub Narebski @ 2006-10-28 19:20 UTC (permalink / raw)
To: git
Junio C Hamano wrote:
> Why is this needed?
This is purely cosmetic, and originally was to be first patch in series
converting git_summary, git_heads and git_tags to use of git-for-each-ref...
but unfortunately git-for-each-ref lacks sorting on taggerdate OR
committerdate (i.e. use taggerdate if applicable, committerdate otherwise).
I'd rather not have git_get_last_activity between two parse_* subroutines...
--
Jakub Narebski
Warsaw, Poland
ShadeHawk on #git
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] gitweb: Move git_get_last_activity subroutine earlier
2006-10-28 19:20 ` Jakub Narebski
@ 2006-10-28 19:24 ` Junio C Hamano
0 siblings, 0 replies; 5+ messages in thread
From: Junio C Hamano @ 2006-10-28 19:24 UTC (permalink / raw)
To: Jakub Narebski; +Cc: git
Jakub Narebski <jnareb@gmail.com> writes:
> Junio C Hamano wrote:
>
>> Why is this needed?
>
> This is purely cosmetic, and originally was to be first patch in series
> converting git_summary, git_heads and git_tags to use of git-for-each-ref...
> but unfortunately git-for-each-ref lacks sorting on taggerdate OR
> committerdate (i.e. use taggerdate if applicable, committerdate otherwise).
>
> I'd rather not have git_get_last_activity between two parse_* subroutines...
Ok, will apply but the last line of your response _should_ have
been in the proposed commit log message without being asked.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] gitweb: Move git_get_last_activity subroutine earlier
2006-10-28 17:43 [PATCH] gitweb: Move git_get_last_activity subroutine earlier Jakub Narebski
2006-10-28 19:01 ` Junio C Hamano
@ 2006-10-28 20:57 ` Junio C Hamano
1 sibling, 0 replies; 5+ messages in thread
From: Junio C Hamano @ 2006-10-28 20:57 UTC (permalink / raw)
To: Jakub Narebski; +Cc: git
Jakub Narebski <jnareb@gmail.com> writes:
> Signed-off-by: Jakub Narebski <jnareb@gmail.com>
> ---
> Good test for git-pickaxe (git-blame2).
"git pickaxe -M v1.4.3.. -- gitweb/gitweb.perl" finds copies by
you just fine (It is interesting to compare it with output
without -M), thanks.
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2006-10-28 20:58 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-10-28 17:43 [PATCH] gitweb: Move git_get_last_activity subroutine earlier Jakub Narebski
2006-10-28 19:01 ` Junio C Hamano
2006-10-28 19:20 ` Jakub Narebski
2006-10-28 19:24 ` Junio C Hamano
2006-10-28 20:57 ` Junio C Hamano
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).