Eric Wong [Sat, 10 Sep 2022 08:17:29 +0000 (08:17 +0000)]
viewvcs: switch to `print $zfh'
Again, ->zmore has proven expensive due to the overhead of
calling ->deflate on small strings, so print directly to the
file handle and let the PerlIO::scalar layer take care of
buffering. One of the ->zmore calls was a no-op, even, so
drop that entirely.
Eric Wong [Sat, 10 Sep 2022 08:17:28 +0000 (08:17 +0000)]
www_listing: switch to `print $zfh'
Again, ->deflate (and thus ->zmore) calls are relatively
expensive compared to `print' ops using PerlIO::scalar
behind-the-scenes. While I can likely optimize the `join' away
here, too, that will happen in a future commit.
Eric Wong [Sat, 10 Sep 2022 08:17:27 +0000 (08:17 +0000)]
mbox*: use multi-arg ->translate and ->write
No need to make multiple method calls from here,
now that ->translate and GzipFilter->write both support
multiple args.
Eric Wong [Sat, 10 Sep 2022 08:17:26 +0000 (08:17 +0000)]
feed: new_html_i: switch from zmore to `print $zfh'
eml_entry will enable zfh (PerlIO::scalar) buffering, anyways,
so there's no point in calling ->zmore to compress small
strings. The use of zfh for the skeleton is debatable, but
probably of no consequence given html_footer will hit it,
anyways.
Eric Wong [Sat, 10 Sep 2022 08:17:25 +0000 (08:17 +0000)]
gzip_filter: write: use multi-arg translate
While we must name this function ->write for PSGI compatibility,
our own uses of it can make it operate more like writev(2)
or `print' in Perl.
Eric Wong [Sat, 10 Sep 2022 08:17:24 +0000 (08:17 +0000)]
translate: support multiple buffer args
This will let us drop some calls to zmore in subsequent commits.
Eric Wong [Sat, 10 Sep 2022 08:17:23 +0000 (08:17 +0000)]
httpd/async: describe which ->write subs it can call
I initially wanted to rename GzipFilter->write to
GzipFilter->writev to reflect the multi-argument nature of the
sub, and it wasn't worth the memory to maintain an alias.
Eric Wong [Sat, 10 Sep 2022 08:17:22 +0000 (08:17 +0000)]
www_static: switch to `print $zfh', and optimize
->zmore isn't cheap, and we can be smarter about how
we place newlines to avoid a `join' operation, now.
We can also drop some unused variables, here.
Eric Wong [Sat, 10 Sep 2022 08:17:21 +0000 (08:17 +0000)]
viewdiff: diff_header: shorten function, slightly
It makes for easier reading with gigantic fonts.
Eric Wong [Sat, 10 Sep 2022 08:17:20 +0000 (08:17 +0000)]
viewdiff: diff_before_or_after: avoid extra capture
/(.*?)\z/ will capture the "$X insertions(+), $Y deletions(-)"
bit anyways, along with whatever extra notes before the
/^diff --git / line. So just rely on /(.*?)\z/ and avoid
the special case before it.
Eric Wong [Sat, 10 Sep 2022 08:17:19 +0000 (08:17 +0000)]
www: use PerlIO::scalar (zfh) for buffering
Calling Compress::Raw::Zlib::deflate is fairly expensive.
Relying on the `.=' (concat) operator inside ->zadd operator is
faster, but the method dispatch overhead is noticeable compared
to the original code where we had bare `.=' littered throughout.
Fortunately, `print' and `say' with the PerlIO::scalar IO layer
appears to offer better performance without high method dispatch
overhead. This doesn't allow us to save as much memory as I
originally hoped, but does allow us to rely less on concat
operators in other places and just pass a list of args to
`print' and `say' as a appropriate.
This does reduce scratchpad use, however, allowing for large
memory savings, and we still ->deflate every single $eml.
Eric Wong [Sat, 10 Sep 2022 08:17:18 +0000 (08:17 +0000)]
www: switch to zadd for the majority of buffering
This allows us to focus string concatenations in one place to
allow Perl internal scratchpad optimizations to reuse memory.
Calling Compress::Raw::Zlib::deflate repeatedly proves too
expensive in terms of CPU cycles.
Eric Wong [Sat, 10 Sep 2022 08:17:17 +0000 (08:17 +0000)]
www: drop {obuf} use entirely, for now
This may help us identify hot spots and reduce pad space
as needed.
Eric Wong [Sat, 10 Sep 2022 08:17:16 +0000 (08:17 +0000)]
view: switch a few things to ctx->zmore
Unfortunately, this is actually slower. However, this
hopefully makes it easier to improve the internals and
make performance improvements down the line.
Eric Wong [Sat, 10 Sep 2022 08:17:15 +0000 (08:17 +0000)]
viewdiff: diff_hunk: shorten conditionals, slightly
I'm not sure if Devel::Size::total_size can be trusted due
to the regexps and crashes[1], but when it works, it's showing
around a 900 byte size reduction, too.
[1] https://rt.cpan.org/Public/Bug/Display.html?id=96421
Eric Wong [Sat, 10 Sep 2022 08:17:14 +0000 (08:17 +0000)]
view: html_footer: avoid escaping " in a few places
qq() is a nice alternative to "" when there's embedded "
characters in HTML entities.
Eric Wong [Sat, 10 Sep 2022 08:17:13 +0000 (08:17 +0000)]
view: html_footer: remove obuf dependency
Another step towards giving us more options for speedups and
memory reductions.
Eric Wong [Sat, 10 Sep 2022 08:17:12 +0000 (08:17 +0000)]
view: html_footer: golf out a few lines
We can build `$u' in one line, and drop an unnecessary empty
line to reduce the amount of scrolling required to read this
sub.
Eric Wong [Sat, 10 Sep 2022 08:17:11 +0000 (08:17 +0000)]
view: reduce ascii_html calls and {obuf} use
We can rely on {-html_tip} for some things at the top of the
page, and reduce ascii_html and obfuscate_addrs calls by
working on the whole buffer at once.
Eric Wong [Sat, 10 Sep 2022 08:17:10 +0000 (08:17 +0000)]
view: _th_index_lite: use `//' defined-or op
Just something I noticed while evaluating this subroutine
for the buffering overhaul.
Eric Wong [Sat, 10 Sep 2022 08:17:09 +0000 (08:17 +0000)]
view: _th_index_lite: avoid one s///, improve symmetry
We can replace an expensive `s///' substitution with a simpler
`chop'. Furthermore, we can delay the "</b>\n" replacement
to ensure it's on the same line of Perl code as the `<b>'
opening tag for readability.
Eric Wong [Sat, 10 Sep 2022 08:17:08 +0000 (08:17 +0000)]
viewdiff: reuse existing string in diff_before_or_after
Instead of appending to an ever-growing {obuf}, we'll reuse
the existing string (which already has pre-allocated memory).
Eric Wong [Sat, 10 Sep 2022 08:17:07 +0000 (08:17 +0000)]
view: attach_link: reduce obuf manipulation
This is another steep towards reducing the maximum size of
an obuf by eventually doing compression earlier while we
render messages as HTML.
And do some golfing while we're at it...
Eric Wong [Sat, 10 Sep 2022 08:17:06 +0000 (08:17 +0000)]
view: reduce subroutine calls for submsg_hdr
Favor fewer, yet more expensive operations than many smaller
ones. While we're still directly manipulating ctx->{obuf} after
this, this change makes it easier for us to avoid doing so in
the future.
Eric Wong [Sat, 10 Sep 2022 08:17:05 +0000 (08:17 +0000)]
view: remove multipart_text_as_html
It seems like a pointless wrapper function that's not saving us
a whole lot. Drop some direct {obuf} manipulation while we're
at it.
Eric Wong [Sat, 10 Sep 2022 08:17:04 +0000 (08:17 +0000)]
gzip_filter: ->translate can reuse zmore/zflush
We can work towards delaying zlib context allocations in future
commits, too.
Eric Wong [Sat, 10 Sep 2022 08:17:03 +0000 (08:17 +0000)]
view: eml_entry: reduce manipulation of ctx->{obuf}
This is another step towards avoid unnecessary copies
and pad space waste.
Eric Wong [Sat, 10 Sep 2022 08:17:02 +0000 (08:17 +0000)]
view: simplify _parent_headers
Having References but lacking In-Reply-To is an uncommon case
with email, nowadays. So just rely on ->linkify_mids to handle
linkification and HTML escaping Furthermore, headers are short
enough to return as-is (and rely on CoW improvements in Perl
5.1x) since linkify_mids needs to operate on an independent
string, anyways.
Eric Wong [Sat, 10 Sep 2022 08:17:01 +0000 (08:17 +0000)]
www: viewdiff: use return value for diff_hunk
It's only a short string, so there's not much copy overhead,
and it'll make future changes easier to reason about.
Eric Wong [Sat, 10 Sep 2022 08:17:00 +0000 (08:17 +0000)]
www_listing: avoid unnecessary work for common cases
We need to branch for non-empty `q=' parameters anyways, but
`q=' is usually empty/unset. While we're in the area, `chomp'
reads `$/' while `chop' is simpler. Furthermore, we can shave
a few bytes off the form HTML by omitting spaces before `/>'
and placing `\n' to wrap long lines before attribute names.
Eric Wong [Sat, 10 Sep 2022 08:16:59 +0000 (08:16 +0000)]
www_listing: consolidate some ->zmore dispatches
`.' concatenation is still faster for small strings, but
passing an array to ->zmore is more efficient for large
search results and full listings.
Eric Wong [Sat, 10 Sep 2022 08:16:58 +0000 (08:16 +0000)]
viewvcs: use shorter and simpler ctx->html_done
We only return 200s for any response large enough to warrant
->html_done, so we can just assume it. ViewVCS can also take
advantage of it with some tweaking to avoid an extra method
dispatch.
Eric Wong [Sat, 10 Sep 2022 08:16:57 +0000 (08:16 +0000)]
www_text: reduce parameter passing for response header
This is a tiny step in making the code slightly less confusing
by reusing common field names and reducing dependencies on
argument ordering.
Eric Wong [Sat, 10 Sep 2022 08:16:56 +0000 (08:16 +0000)]
www_stream: aresponse assumes 200, too
There's no reason to be streaming large amounts of HTML for
anything other than a 200 response.
Eric Wong [Sat, 10 Sep 2022 08:16:55 +0000 (08:16 +0000)]
www_atom_stream: require 200 response
This simplifies parameter passing at the moment. I can't
imagine an Atom feed reader would be parsing XML for 404s or
other error codes.
Eric Wong [Sat, 10 Sep 2022 08:16:54 +0000 (08:16 +0000)]
view: rework single message page to compress earlier
We can rely on deflate to compress large thread skeletons on
single message pages. Subsequent commits will compress bodies,
as well.
Eric Wong [Sat, 10 Sep 2022 08:16:53 +0000 (08:16 +0000)]
www: gzip_filter: implicitly flush {obuf} on zmore/zflush
This seems like the least disruptive way to allow more use of
->zmore when streaming large messages to sockets.
Eric Wong [Sat, 10 Sep 2022 08:16:52 +0000 (08:16 +0000)]
xt: fold perf-obfuscate into perf-msgview, future-proof
perf-obfuscate was close enough to perf-msgview that it only
required setting the `obfuscate' field of the inbox.
Then update perf-msgview to account for upcoming internal
changes. The current use of {obuf} and concat ops results in
excessive scratchpad space and I may be able to even get
speedups by avoiding concat ops.
Eric Wong [Sat, 10 Sep 2022 01:35:51 +0000 (01:35 +0000)]
lei: fix --help for --jobs with `up' and `q'
The help needs to match on the short option, too, and that
`lei q' option is (like most options) shared with `lei up'.
Eric Wong [Sat, 10 Sep 2022 01:18:59 +0000 (01:18 +0000)]
lei: bail out earlier on IMAP writer failures
Excessive IMAP connections can overload IMAP servers and cause
clients to be disconnected without diagnostic messages.
Use $lei->fail on these exceptions to propagate errors to the
CLI ASAP to avoid further errors down the line.
This ought to make problems more apparent for users using IMAP
destinations.
Reported-by: Ricardo Ribalda <ribalda@chromium.org>
Link: https://public-inbox.org/meta/CANiDSCsDfutAUMBLPZbxdyka+_jnhv+4YNYdL9QPRoC=wNUGCQ@mail.gmail.com/
Eric Wong [Fri, 9 Sep 2022 17:58:25 +0000 (17:58 +0000)]
doc: document --jobs for `lei q' and `lei up'
These may be helpful for users on slow disks or have
IMAP server limitations.
Ricardo Ribalda [Thu, 8 Sep 2022 19:57:31 +0000 (21:57 +0200)]
Gcf2: Create cache folder if missing
The code expects that the folder is already present, this patch creates
it if missing.
Without this path the test fails with:
open(/home/debci/.cache/public-inbox/inline-c/.public-inbox.lock): No such file or directory at /usr/share/perl5/PublicInbox/Gcf2.pm line 20
Signed-off-by: Ricardo Ribalda <ricardo@ribalda.com>
Eric Wong [Thu, 8 Sep 2022 08:16:45 +0000 (08:16 +0000)]
t/v2mirror: increase timeout for plackup bind+listen
This test tends to fail sometimes, likely due to plackup
startup being slow on a cold page cache and having an
overloaded rotational HDD.
Eric Wong [Sun, 4 Sep 2022 16:09:45 +0000 (16:09 +0000)]
view: drop unnecessary comma in date range note
I'm not sure how it got there, but it seems out-of-place in
retrospect.
Eric Wong [Fri, 2 Sep 2022 18:26:23 +0000 (18:26 +0000)]
import: pass --quiet to `git gc' if STDERR isn't a tty
No need to pollute non-interactive output for gc use. This
suppresses notifications from my `lei up --all -q' cronjob.
Eric Wong [Fri, 2 Sep 2022 18:26:22 +0000 (18:26 +0000)]
lei/store: do not write info/refs file
That file is meant for dumb HTTP servers, so avoid wasting two
inodes on something that should never be served for private
email.
Eric Wong [Sun, 4 Sep 2022 04:27:49 +0000 (04:27 +0000)]
prepare HTML rendering maintainer tests for upcoming changes
There'll be a number of upcoming changes to HTML rendering
of messages to hopefully reduce memory usage and speedups
by writing out to the gzip buffer earlier.
Update the tests now so it'll be easier to test before
and after results.
Eric Wong [Fri, 2 Sep 2022 10:11:48 +0000 (10:11 +0000)]
solver: do not count duplicates in patch count
We're considering duplicate patches from cross-posted lists
identical, so don't double-count them when displaying the
"applying [X/Y]" message since (successful) duplicates get
skipped.
Eric Wong [Fri, 2 Sep 2022 10:11:47 +0000 (10:11 +0000)]
solver: handle copies properly
At least enough to get 66 patches applied to handle
/lore/all/
34d644a519c/s/?b=target/arm/helper-mve.h
properly.
I noticed this bug due to a:
E: BUG: extra files in index: <100644
e91f526a1a83edb2b56798388a355b1c3729b4bd 0#011target/arm/translate-mve.c>
line in my syslog
However, the $TOTAL in "applying [X/$TOTAL]" in the debug log
is seems off...
Eric Wong [Fri, 2 Sep 2022 09:12:54 +0000 (09:12 +0000)]
extmsg: shorten partial Message-IDs minimum to 14
Gnus seems to start Message-IDs with 10 random characters
followed by ".fsf@$DOMAIN". In case of mis-linkification or
mis-selection from stopping at the `@', ensuring the first 14
characters are accepted as a search parameter for the truncated
Message-ID improves usability.
Eric Wong [Fri, 2 Sep 2022 09:10:54 +0000 (09:10 +0000)]
www: omit [thread overview] link for unindexed v1
Unindexed v1 inboxes do not have the thread overview skeleton
at the bottom of /$MSGID/ pages, so do not link to it.
And for rare messages without a Date: header (or any headers!),
this also ensures the [thread overview] is shown regardless.
Eric Wong [Fri, 2 Sep 2022 09:10:53 +0000 (09:10 +0000)]
www: fix top nav bar for unindexed v1 inboxes
For /$INBOX/$MSGID/ pages, we need to point all nav bar links
../ regardless of whether ->over exists. I've also verified
this doesn't affect /$INBOX/new.html at all.
Eric Wong [Thu, 1 Sep 2022 08:42:55 +0000 (08:42 +0000)]
www: always show subject for root of thread skeleton
For users with short attention spans, the root message of should
have the Subject, since <title> is often truncated in most browsers.
Eric Wong [Thu, 1 Sep 2022 18:58:29 +0000 (18:58 +0000)]
TODO: add item for RFC 3676 (format=flowed + DelSP)
I noticed some messages looked wonky in HTML (via w3m) compared
to mutt; and neither Email::MIME, Mail::Box nor gmime seem to
handle this standard...
However, mflow (part of mblaze) seems to be good standalone
C implementation that we can check a Perl5 implementation
against.
Eric Wong [Tue, 30 Aug 2022 09:10:23 +0000 (09:10 +0000)]
INSTALL: update for Perl 5.12 dependency and 2022
AFAIK, there's no new distro packages this year...
Eric Wong [Tue, 30 Aug 2022 09:10:22 +0000 (09:10 +0000)]
Makefile.PL: update version for upcoming 2.x
"1.10" seems awkward and may confuse ASCII-betical sorting, so I
think "2.0" is more appropriate.
Eric Wong [Tue, 30 Aug 2022 09:10:21 +0000 (09:10 +0000)]
Makefile.PL: add lei-reindex manpage
I forgot to add this when I added the new command :x
Eric Wong [Mon, 29 Aug 2022 09:26:47 +0000 (09:26 +0000)]
viewvcs: show "blob $OID" rather than "$OID blob"
This is more consistent with the rest of the output where it's
"$TYPE $OID" rather than "$OID $TYPE". The former also allows
easy copy+pasting into commands for both "git cat-file blob $OID"
and "lei blob $OID".
Eric Wong [Mon, 29 Aug 2022 09:26:46 +0000 (09:26 +0000)]
viewvcs: add glossary for commit
IMHO, it's important to let users know on how commits tie trees
and parent commits together.
Eric Wong [Mon, 29 Aug 2022 09:26:45 +0000 (09:26 +0000)]
viewvcs: reduce hash assignments for commit info
This makes some of the associated code less verbose and
easier-to-read IMHO.
Eric Wong [Mon, 29 Aug 2022 09:26:44 +0000 (09:26 +0000)]
viewvcs: add tree view
This also includes some glossary definitions to help users
unfamiliar with git understand the relationship between
trees and blobs.
Eric Wong [Mon, 29 Aug 2022 09:26:43 +0000 (09:26 +0000)]
solver: early make hints detection more robust
Hints fields can change, so we'll use a simple boolean rather
than checking a static count. We'll also short-circuit out
reliably regardless of hints when a full OID is given.
Eric Wong [Mon, 29 Aug 2022 09:26:42 +0000 (09:26 +0000)]
www: provide text/help/#search anchor
This allows jumping to the appropriate section of the "help"
from under the dfblob textarea search.
Eric Wong [Mon, 29 Aug 2022 09:26:41 +0000 (09:26 +0000)]
www: atom: fix "changed" href to nowhere
The HTML generated for the Atom feed doesn't have the footer
of /T/ and /t/ HTML-only views, so just make "changed" in
the diffstat go directly to the permalink #related anchor.
Fixes: 66512e177390 ("view: generate query in single-message and commit views")
Eric Wong [Mon, 29 Aug 2022 09:26:40 +0000 (09:26 +0000)]
view: cleanups and reuse for {obuf} preparation
{obuf} will eventually go away and we'll write directly to
{zbuf}, but as an intermediate step we'll make some changes
to rely less on return values.
While we're in the area, reuse Linkify objects in more places
where possible to save some allocations.
Eric Wong [Mon, 29 Aug 2022 09:26:39 +0000 (09:26 +0000)]
view: /$INBOX/: show "messages from $old to $new"
With the ViewVCS commit view using /$INBOX/?t=YYYYMMDDhhmmss-
links, the use of `t=' may not be immediately obvious to a
reader and confuse them into thinking the inbox hasn't been
updated in a while.
So add a header to the top of the page whenever the `t=' query
parameter is used.
And kill a couple of redundant variable assignments while we're
at it.
Eric Wong [Mon, 29 Aug 2022 09:26:38 +0000 (09:26 +0000)]
treewide: ditch inbox->recent method
It's a needless wrapper, nowadays. Originally, ->over was added
on experimental basis to optimize for /$INBOX/ where Xapian
->search is slower on gigantic (LKML-sized) inboxes.
Nowadays with extindex, ->over is here to stay given NNTP and
IMAP both benefit from it. So reduce the interpreter stack
overhead and just access ->over directly.
lxs->recent was never used outside of tests, anyways.
And while we're in the area, avoid needlessly bumping the
refcount of $ctx->{ibx} in View::paginate_recent.
Eric Wong [Mon, 29 Aug 2022 09:26:37 +0000 (09:26 +0000)]
view: speed up /$INBOX/ landing page by 0.5-1.0%
Array lookups and extra arithmetic in Perl is slower than
bumping the internal array offset inside the interpreter.
Fwiw, using: my ($level, $subj) = splice(@extra, 0, 2)
did not result in a performance improvement.
Eric Wong [Mon, 29 Aug 2022 09:26:36 +0000 (09:26 +0000)]
viewvcs: author date links to contemporary messages
Sometimes it can be useful to figure out what's going in on the
associated inbox around the time the patch was authored.
Eric Wong [Mon, 29 Aug 2022 09:26:35 +0000 (09:26 +0000)]
viewvcs: add patch download link for single-parent commits
The email signature field will echo the format-patch arguments
used so it can be used as hint for users learning to more of
the git CLI.
Eric Wong [Mon, 29 Aug 2022 09:26:34 +0000 (09:26 +0000)]
viewvcs: use array for highlighted blob display
This can avoid at least one expensive copy for displaying
large blobs with syntax highlighting.
However, we cannot blindly change everything to arrays, either:
the cost of invoking Compress::Raw::Zlib->deflate must be taken
into account. Joining short strings via `.=', `.', `join' or
interpolation is typically faster since it avoids ->deflate
method calls (and non-magic perlops are the fastest dispatches
in Perl).
Eric Wong [Mon, 29 Aug 2022 09:26:33 +0000 (09:26 +0000)]
www: allow html_oneshot to take an array arg
Another step towards making our internal APIs more writev-like
and reducing the copies needed for `join' or `.=' concatenation.
Eric Wong [Mon, 29 Aug 2022 09:26:32 +0000 (09:26 +0000)]
viewvcs: delay stringification of solver debug log
This will make future changes easier to work on as we pass more
stuff through $ctx and reduce parameter passing on the Perl stack.
Eric Wong [Mon, 29 Aug 2022 09:26:31 +0000 (09:26 +0000)]
viewvcs: share File::Temp::Dir with solver
This allows reusing inodes for /$COMMIT_OID/s/ requests.
We'll also replace `log' with `lh' in the field name to
avoid confusion with the `log' perlop.
Eric Wong [Mon, 29 Aug 2022 09:26:30 +0000 (09:26 +0000)]
solver: create tmpdir lazily
"lei blob" doesn't currently need it at all in some cases, and
the next commit will allow viewvcs to share tmpdirs to show
commits as HTML.
Eric Wong [Fri, 26 Aug 2022 18:29:13 +0000 (18:29 +0000)]
TODO: add some Xapian-related stuff
Just to more clearly spell out what needs to be done on
the search side.
Eric Wong [Sun, 28 Aug 2022 03:59:50 +0000 (03:59 +0000)]
linkify: avoid digits and dashes in placeholders
The `highlight' module seems to highlight every digit in
YAML (and possibly other) source files. This causes problems
in linkify_2 which replaces the placeholders with proper URIs.
I suspect `-' and other punctuation characters will cause
similar problems, so we must stick to [A-Za-z].
Thus transliterate 0-9 to A-J in the hex key to ensure highlight
doesn't see digit characters, and rename the prefix to be
project-name independent.
Eric Wong [Fri, 26 Aug 2022 10:15:45 +0000 (10:15 +0000)]
www: fix unindexed v1 inboxes w/ public-inbox-httpd
Unindexed v1 inboxes were leaving $smsg objects unpopulated when
using public-inbox-httpd (but not generic PSGI servers) and
causing missing HTML content and uninitialized value warnings.
Our existing tests for unindexed v1 inboxes only assumed generic
PSGI servers and synchronous blob retrieval. Due to changes
several years ago to make git blob retrieval async for slow
storage using public-inbox-httpd, our tests were insufficient to
detect this regression.
So ensure $smsg->populate runs in a few places and rewrite
t/plack.t to test against both generic PSGI and -httpd
implementations.
Fortunately, unindexed v1 inboxes are uncommon, and this
bug was only (finally) discovered while developing other
features.
For ensuring we can test (and not blindly follow) redirects with
-httpd, we now provide our own LWP::UserAgent (used internally
by Plack::Test::ExternalServer) with redirect following
disabled to P:T:ES::test_psgi.
Eric Wong [Fri, 26 Aug 2022 03:20:20 +0000 (03:20 +0000)]
view: add "this message" link above dfblob: textarea
When jumping to #related from /T/ or /t/ views, it could be
disconcerting to not have the current message as context.
So add a "this message" link back up to #t as we have always
done with the reply instructions.
Eric Wong [Tue, 23 Aug 2022 08:32:03 +0000 (08:32 +0000)]
viewvcs: don't wait on slow disks for git commit titles
We can easily wire into the DS event loop to take advantage
of epoll/kevent notifications and serve other clients in
the mean time.
Eric Wong [Tue, 23 Aug 2022 08:32:02 +0000 (08:32 +0000)]
gzip_filter: ->zmore and ->zflush support multiple args
This will make writev-like use easier for the next commit,
and also future changes where I'll rely more on zlib for
buffering.
Eric Wong [Tue, 23 Aug 2022 08:32:01 +0000 (08:32 +0000)]
ibx_async_cat: access ->{git} directly
This will enable callers to pass non-Inbox-ish hashrefs as the
arg. This benefits existing Inbox-ish objects, too, as it
avoids a slow method dispatch for both ExtSearch and Inbox.
Eric Wong [Tue, 23 Aug 2022 08:32:00 +0000 (08:32 +0000)]
viewvcs: separate email and date with spaces
Horizontal tabs can be too much for narrow displays, so just add
an extra space to keep the date separate from the email address.
Eric Wong [Tue, 23 Aug 2022 08:31:59 +0000 (08:31 +0000)]
viewvcs: show commit titles for parent commits
It's hard to know which commit I'm following a link to without
having the title of the commit handy.
Eric Wong [Tue, 23 Aug 2022 08:31:58 +0000 (08:31 +0000)]
viewvcs: remove patchid line from commit header
I'm considering dropping this entirely since dfpre:, dfpost:
dfn:, and s: can be just as powerful, if not more. patchid: is
inaccurate if either non-standard diff generation options are
used (e.g. -W or -U6); or if a MUAs mangle whitespace.
We'll keep patchid: at the top search input box for now, but the
textarea at the bottom (and possibly another textarea for a more
exact match) is probably more useful and flexible.
Eric Wong [Tue, 23 Aug 2022 08:31:57 +0000 (08:31 +0000)]
viewdiff: linkify diffstats for non-format-patch emails
Some folks unfortunately use "git diff --stat -p" to generate
patches. These messages lack the /^---$/ line and causing
diffstats to not get linkified properly. We now treat the
/^---$/ as optional and rely on the presence of file lines with
/ \| / proceeding a /\d+ files? changed,/ line.
Eric Wong [Tue, 23 Aug 2022 08:31:56 +0000 (08:31 +0000)]
view: generate query in single-message and commit views
The dfblob: search prefix is probably under-utilized, but is
extremely powerful IMHO. To make it easier-to-use, add a search
textarea with it prefilled with values for the existing patch
message. This allows users to easily run a query for all
patches which alter or result in either pre or post-image
blobs in the current patch.
Behavior changes are as follows: "changed" in the diffstat
jumps to the bottom of the message. For /T/ and /t/, it
goes to the "related" anchor which is just above the reply
instructions in the single-message view. For the single
message view, it'll jump to the textarea search form.
I initially wanted to use a normal `<a href=' link, but
figured the textarea is advantageous for two reasons:
1) users should be able to edit the query before submitting
2) crawlers are less likely to waste CPU/disk on forms
It's probably too noisy to add this directly to the /T/ and /t/
views, but seems like a good place to put above the reply
instructions in the single message view.
Note that the queries used by the /$COMMIT_OID/s/ view is
subtly different than the /$MSGID/ view since git will lengthen
its abbreviations over time, while emails are immutable.
I tried adding dfn: (filename) and s: (subject) support, but
couldn't come up with cases where it really made sense for
/$MSGID/. /$COMMIT_OID/s/ may benefit from it, since patchid:
could be flaky due to non-standard diff generation options.
Eric Wong [Mon, 22 Aug 2022 06:44:12 +0000 (06:44 +0000)]
viewvcs: use :utf8 for opening patch, too
We'll also force --encoding=UTF-8 for "git show" even
if that's the default in git, since the rest of our code
already assumes UTF-8.
Eric Wong [Mon, 22 Aug 2022 02:33:46 +0000 (02:33 +0000)]
viewvcs: start improving display of git commits
For non-merge git commits, we already have ViewDiff for
displaying patch emails, we can reuse it to display non-merge
git commits.
AFAIK, this is the first web-based git repository viewer
to display the output of "git-patch-id --stable".
It currently fills in the search form box with "patchid:",
but maybe it'll do more than that.
More work will be done to support bidirectional mapping
of commits to emails in the future.
Eric Wong [Mon, 22 Aug 2022 02:33:45 +0000 (02:33 +0000)]
viewvcs: drop pointless variable assignment
Not needed since commit:
41f03a3bd4b13dfa (viewvcs: do not show final error message twice, 2019-01-27)
Eric Wong [Mon, 22 Aug 2022 02:33:44 +0000 (02:33 +0000)]
qspawn: improve error reporting and handling
First off, avoid potential circular references (via {qx_arg}) by
dropping the {-qsp} field from $ctx and SolverGit objects.
Instead, we only share a reference to an optional error buffer
string {qsp_err}.
We'll also attempt to call qspawn.wcb if qx_cb fails, and warn
in more places w/o checking for $env since we now rely on warn()
instead of $env->{'psgi.errors'}.
This makes error handling simpler and safer in future callers.
Eric Wong [Mon, 22 Aug 2022 02:33:43 +0000 (02:33 +0000)]
qspawn: add type comments in a few places
This makes things easier-to-follow in a minimally-typed language.
Eric Wong [Mon, 22 Aug 2022 02:33:42 +0000 (02:33 +0000)]
www: /s/: 404 for unconfigured coderepos
The $r404 variable is unset if we have a valid inbox, but no
coderepos configured for that inbox, thus we must `r(404)'
explicitly.
Eric Wong [Mon, 22 Aug 2022 02:33:41 +0000 (02:33 +0000)]
xt/solver: improve diagnostics
I'm making some tweaks to solver and will probably find extra
output useful, and also update to v5.12 while we're at it.
Eric Wong [Mon, 22 Aug 2022 02:33:40 +0000 (02:33 +0000)]
config: fix confusing space in ->repo_objs
It's actually valid Perl to have "$foo ->{field} = ..."
but it's confusing and I noticed it while tracking down
a configuration error.
Eric Wong [Sun, 21 Aug 2022 22:21:00 +0000 (22:21 +0000)]
www: support `+' in inbox names
`+' already seemed to works for IMAP mailboxes and NNTP newsgroup
names and git-config doesn't complain, either. So allow it as
the path components of WWW URLs so projects like `libstdc++' can
use it.
Reported-by: Mark Wielaard <mark@klomp.org>
Tested-by: Mark Wielaard <mark@klomp.org>
Link: https://public-inbox.org/meta/YwKnFCvganW7ErXU@wildebeest.org/
Eric Wong [Sun, 21 Aug 2022 02:35:27 +0000 (02:35 +0000)]
public-inbox 1.9.0
Eric Wong [Sat, 20 Aug 2022 08:25:32 +0000 (08:25 +0000)]
doc: 1.9 release notes update
Getting close to another release, I think...
Eric Wong [Sat, 20 Aug 2022 08:01:35 +0000 (08:01 +0000)]
www: mbox* drop unneeded {base_url} memoizations
That field is not needed since List-* and Archived-At headers
are no longer appended as of commit:
1bf653ad139bf7bb (nntp+www: drop List-* and Archived-At headers, 2020-12-10)
Eric Wong [Sat, 20 Aug 2022 08:01:34 +0000 (08:01 +0000)]
www: use absolute URLs for coderepo URLs
Showing "../../foo.git" looks awkward and isn't conducive to
users who want to "git clone" a URL.