about summary refs log tree commit homepage
path: root/lib/PublicInbox/Feed.pm
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2014-04-08 21:57:53 +0000
committerEric Wong <e@80x24.org>2014-04-08 21:57:53 +0000
commit399081a7c4424ede7155cebd8f5ac1bbb69bb436 (patch)
tree78e1e2065f28cbb8071a37e14aed1d0c05e4cf8b /lib/PublicInbox/Feed.pm
parent7bca74b9c81e041981e59dde7fbdf904dbd67914 (diff)
downloadpublic-inbox-399081a7c4424ede7155cebd8f5ac1bbb69bb436.tar.gz
We will need it for HTML indices, too.
Diffstat (limited to 'lib/PublicInbox/Feed.pm')
-rw-r--r--lib/PublicInbox/Feed.pm17
1 files changed, 12 insertions, 5 deletions
diff --git a/lib/PublicInbox/Feed.pm b/lib/PublicInbox/Feed.pm
index 3ac77174..b77bbdfb 100644
--- a/lib/PublicInbox/Feed.pm
+++ b/lib/PublicInbox/Feed.pm
@@ -36,12 +36,21 @@ sub generate {
                 updated => strftime(DATEFMT, gmtime),
         );
 
-        my @entries;
+        each_recent_blob($max, sub {
+                my ($add) = @_;
+                add_to_feed($feed_opts, $feed, $add, $top);
+        });
+        $feed->as_string;
+
+}
+
+sub each_recent_blob {
+        my ($max, $cb) = @_;
 
         # get recent messages
         # we could use git log -z, but, we already know ssoma will not
         # leave us with filenames with spaces in them..
-        my $cmd = "git log --no-color --raw -r --no-abbrev HEAD |";
+        my $cmd = "git log --no-notes --no-color --raw -r --no-abbrev HEAD |";
         my $pid = open my $log, $cmd or die "open `$cmd' pipe failed: $!\n";
         my %deleted;
         my $nr = 0;
@@ -49,7 +58,7 @@ sub generate {
                 if ($line =~ /^:000000 100644 0{40} ([a-f0-9]{40})/) {
                         my $add = $1;
                         next if $deleted{$add};
-                        $nr += add_to_feed($feed_opts, $feed, $add, $top);
+                        $nr += $cb->($add);
                         last if $nr >= $max;
                 } elsif ($line =~ /^:100644 000000 ([a-f0-9]{40}) 0{40}/) {
                         $deleted{$1} = 1;
@@ -57,8 +66,6 @@ sub generate {
         }
 
         close $log;
-
-        $feed->as_string;
 }
 
 # private functions below