Andrew's git
/
gitweb.git
/ diff
summary
|
log
|
commit
| diff |
tree
commit
grep
author
committer
pickaxe
?
re
gitweb: Change atom, rss actions to use parse_commits.
author
Robert Fitzsimons
<robfitz@273k.net>
Sun, 24 Dec 2006 14:31:47 +0000
(14:31 +0000)
committer
Junio C Hamano
<junkio@cox.net>
Mon, 25 Dec 2006 18:40:44 +0000
(10:40 -0800)
Signed-off-by: Robert Fitzsimons <robfitz@273k.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
gitweb/gitweb.perl
patch
|
blob
|
history
raw
|
patch
|
inline
| side by side (parent:
5ad6608
)
diff --git
a/gitweb/gitweb.perl
b/gitweb/gitweb.perl
index 53dd2251db578fdf3faa5bafeadbebcf8f83c144..f752a6f605dcd39fbdac5f2c14b4c3b03383ce00 100755
(executable)
--- a/
gitweb/gitweb.perl
+++ b/
gitweb/gitweb.perl
@@
-4483,11
+4483,7
@@
sub git_feed {
# log/feed of current (HEAD) branch, log of given branch, history of file/directory
my $head = $hash || 'HEAD';
# log/feed of current (HEAD) branch, log of given branch, history of file/directory
my $head = $hash || 'HEAD';
- open my $fd, "-|", git_cmd(), "rev-list", "--max-count=150",
- $head, "--", (defined $file_name ? $file_name : ())
- or die_error(undef, "Open git-rev-list failed");
- my @revlist = map { chomp; $_ } <$fd>;
- close $fd or die_error(undef, "Reading git-rev-list failed");
+ my @commitlist = parse_commits($head, 150);
my %latest_commit;
my %latest_date;
my %latest_commit;
my %latest_date;
@@
-4497,8
+4493,8
@@
sub git_feed {
# browser (feed reader) prefers text/xml
$content_type = 'text/xml';
}
# browser (feed reader) prefers text/xml
$content_type = 'text/xml';
}
- if (defined($
rev
list[0])) {
- %latest_commit =
parse_commit($revlist[0])
;
+ if (defined($
commit
list[0])) {
+ %latest_commit =
%{$commitlist[0]}
;
%latest_date = parse_date($latest_commit{'author_epoch'});
print $cgi->header(
-type => $content_type,
%latest_date = parse_date($latest_commit{'author_epoch'});
print $cgi->header(
-type => $content_type,
@@
-4588,9
+4584,9
@@
sub git_feed {
}
# contents
}
# contents
- for (my $i = 0; $i <= $#
rev
list; $i++) {
- my
$commit = $revlist[$i]
;
- my
%co = parse_commit($commit)
;
+ for (my $i = 0; $i <= $#
commit
list; $i++) {
+ my
%co = %{$commitlist[$i]}
;
+ my
$commit = $co{'id'}
;
# we read 150, we always show 30 and the ones more recent than 48 hours
if (($i >= 20) && ((time - $co{'author_epoch'}) > 48*60*60)) {
last;
# we read 150, we always show 30 and the ones more recent than 48 hours
if (($i >= 20) && ((time - $co{'author_epoch'}) > 48*60*60)) {
last;
@@
-4598,7
+4594,7
@@
sub git_feed {
my %cd = parse_date($co{'author_epoch'});
# get list of changed files
my %cd = parse_date($co{'author_epoch'});
# get list of changed files
- open $fd, "-|", git_cmd(), "diff-tree", '-r', @diff_opts,
+ open
my
$fd, "-|", git_cmd(), "diff-tree", '-r', @diff_opts,
$co{'parent'}, $co{'id'}, "--", (defined $file_name ? $file_name : ())
or next;
my @difftree = map { chomp; $_ } <$fd>;
$co{'parent'}, $co{'id'}, "--", (defined $file_name ? $file_name : ())
or next;
my @difftree = map { chomp; $_ } <$fd>;