]> Sergey Matveev's repositories - public-inbox.git/commitdiff
Merge remote-tracking branch 'origin/manifest' into next
authorEric Wong <e@80x24.org>
Fri, 14 Jun 2019 16:23:13 +0000 (16:23 +0000)
committerEric Wong <e@80x24.org>
Fri, 14 Jun 2019 16:23:13 +0000 (16:23 +0000)
* origin/manifest:
  git: ensure ->modified returns an integer
  www: support $INBOX/git/$EPOCH.git for v2 cloning
  www: wire up /$INBOX/manifest.js.gz, too
  wwwlisting: generate grokmirror-compatible manifest.js.gz
  wwwlisting: allow hiding entries from manifest

1  2 
MANIFEST
lib/PublicInbox/Git.pm

diff --combined MANIFEST
index a44632a98151cfa25bc39efdad2872f097ed3ddc,9a88f13552f58cd5399b4c96a2693bfee39e4078..ae637f24aa91f1d7e569e4f798348102d8bc462f
+++ b/MANIFEST
@@@ -13,7 -13,6 +13,7 @@@ Documentation/public-inbox-compact.po
  Documentation/public-inbox-config.pod
  Documentation/public-inbox-convert.pod
  Documentation/public-inbox-daemon.pod
 +Documentation/public-inbox-edit.pod
  Documentation/public-inbox-httpd.pod
  Documentation/public-inbox-index.pod
  Documentation/public-inbox-mda.pod
@@@ -69,7 -68,6 +69,7 @@@ examples/unsubscribe.psg
  examples/varnish-4.vcl
  lib/PublicInbox/Address.pm
  lib/PublicInbox/Admin.pm
 +lib/PublicInbox/AdminEdit.pm
  lib/PublicInbox/AltId.pm
  lib/PublicInbox/Cgit.pm
  lib/PublicInbox/Config.pm
@@@ -151,7 -149,6 +151,7 @@@ sa_config/root/etc/spamassassin/public-
  sa_config/user/.spamassassin/user_prefs
  script/public-inbox-compact
  script/public-inbox-convert
 +script/public-inbox-edit
  script/public-inbox-httpd
  script/public-inbox-index
  script/public-inbox-init
@@@ -187,7 -184,6 +187,7 @@@ t/content_id.
  t/convert-compact.t
  t/data/0001.patch
  t/ds-leak.t
 +t/edit.t
  t/emergency.t
  t/fail-bin/spamc
  t/feed.t
@@@ -240,7 -236,6 +240,7 @@@ t/psgi_text.
  t/psgi_v2.t
  t/purge.t
  t/qspawn.t
 +t/replace.t
  t/reply.t
  t/search-thr-index.t
  t/search.t
@@@ -263,3 -258,4 +263,4 @@@ t/view.
  t/watch_filter_rubylang.t
  t/watch_maildir.t
  t/watch_maildir_v2.t
+ t/www_listing.t
diff --combined lib/PublicInbox/Git.pm
index 6a87661c290faaa4ea0275f70a1fe23bf15898ba,82510b99641200bd014ffdc9d6a537ae22775220..f5c7a95c34d7aedad7860a1189f8e121167eb1fb
@@@ -145,24 -145,41 +145,24 @@@ again
                fail($self, "Unexpected result from git cat-file: $head");
  
        my $size = $1;
 -      my $ref_type = $ref ? ref($ref) : '';
 -
        my $rv;
        my $left = $size;
 -      $$ref = $size if ($ref_type eq 'SCALAR');
 -      my $cb_err;
 -
 -      if ($ref_type eq 'CODE') {
 -              $rv = eval { $ref->($in, \$left) };
 -              $cb_err = $@;
 -              # drain the rest
 -              my $max = 8192;
 -              while ($left > 0) {
 -                      my $r = read($in, my $x, $left > $max ? $max : $left);
 -                      defined($r) or fail($self, "read failed: $!");
 -                      $r == 0 and fail($self, 'exited unexpectedly');
 -                      $left -= $r;
 -              }
 -      } else {
 -              my $offset = 0;
 -              my $buf = '';
 -              while ($left > 0) {
 -                      my $r = read($in, $buf, $left, $offset);
 -                      defined($r) or fail($self, "read failed: $!");
 -                      $r == 0 and fail($self, 'exited unexpectedly');
 -                      $left -= $r;
 -                      $offset += $r;
 -              }
 -              $rv = \$buf;
 +      $$ref = $size if $ref;
 +
 +      my $offset = 0;
 +      my $buf = '';
 +      while ($left > 0) {
 +              my $r = read($in, $buf, $left, $offset);
 +              defined($r) or fail($self, "read failed: $!");
 +              $r == 0 and fail($self, 'exited unexpectedly');
 +              $left -= $r;
 +              $offset += $r;
        }
 +      $rv = \$buf;
  
 -      my $r = read($in, my $buf, 1);
 +      my $r = read($in, my $lf, 1);
        defined($r) or fail($self, "read failed: $!");
 -      fail($self, 'newline missing after blob') if ($r != 1 || $buf ne "\n");
 -      die $cb_err if $cb_err;
 +      fail($self, 'newline missing after blob') if ($r != 1 || $lf ne "\n");
  
        $rv;
  }
@@@ -303,7 -320,7 +303,7 @@@ sub modified ($) 
                chomp $oid;
                my $buf = cat_file($self, $oid) or next;
                $$buf =~ /^committer .*?> ([0-9]+) [\+\-]?[0-9]+/sm or next;
-               my $cmt_time = $1;
+               my $cmt_time = $1 + 0;
                $modified = $cmt_time if $cmt_time > $modified;
        }
        $modified || time;