about summary refs log tree commit homepage
path: root/lib/PublicInbox/ViewVCS.pm
DateCommit message (Collapse)
2019-04-04viewvcs: match 8000-byte lookup for git
No need to scan the entire string, but prefer to match git behavior. This might be faster if/when Perl can create substrings efficiently using CoW. Fix a 80-column violation while we're at it.
2019-04-04viewvcs: preliminary support for showing non-blobs
Eventually, we'll have special displays for various git objects (commit, tree, tag). But for now, we'll just use git-show to spew whatever comes from git.
2019-04-02viewvcs: check for premature EOF from git-cat-file
Not entirely sure what is causing this, but it appears to be causing infinite loops when attempting to display certain blobs. Fortunately, the fair scheduling of public-inbox-httpd prevented this from becoming a real problem aside from increasing CPU usage.
2019-02-13ensure bytes::length is available to callers
We were relying on Danga::Socket using the "bytes" pragma, previously. Nowadays, the "bytes" pragma is not recommended in general, but bytes::length remains acceptable for getting the byte-size of a scalar.
2019-02-05hlmod: do_hl* performs src_escape immediately
We want to be able to take advantage of this in other modules
2019-02-05hlmod: make into a singleton
It turns out there's no point in having multiple instances of this or having to worry about destruction or destruction ordering. This will make it easier to reuse the one instance we have across different modules.
2019-02-05viewvcs: cleanup utf8 handling
Favor in-place utf8::decode since it's a bit faster without method dispatch overhead; and don't care about validity just yet. HlMod->do_hl itself should return "utf8" strings, since other parts of our code can use it, so it's not the job of ViewVCS to post-process HlMod output.
2019-02-01viewvcs: allow '0' as a valid filename for blob downloads
Only to be pedantic...
2019-01-31doc: remove completed TODO items
2019-01-31qspawn: documentation updates
This will become critical for future changes to display git commits, diffs, and trees. Use "qspawn.wcb" instead of "qspawn.response" to enhance readability.
2019-01-31viewvcs: support streaming large blobs
Forking off git-cat-file here for streaming large blobs is reasonably efficient, at least no worse than using git-http-backend for serving clones. So let our limiter framework deal with it. git itself isn't great for large files, and AFAIK there's no stable/widely-available mechanisms for reading smaller chunks of giant blobs in git itself. Tested with some giant GPU headers in the Linux kernel.
2019-01-29viewvcs: avoid segfault with highlight.pm at shutdown
Proper ordering of destruction seems required to avoid segfaults at shutdown.
2019-01-28hval: add src_escape for highlight post-processing
We need to post-process "highlight" output to ensure it doesn't contain odd bytes which cause "wide character" warnings or require odd glyphs in source form.
2019-01-27viewvcs: wire up syntax-highlighting for blobs
And update 216dark.css to match a color scheme I'm used to; which is fairly minimal and doesn't use all the classes "highlight" provides.
2019-01-27viewvcs: do not show final error message twice
SolverGit::ERR already writes the exception to the debug log before calling {user_cb}, so there's no need for viewvcs to append it.
2019-01-26solver: rewrite to use Qspawn->psgi_qx and pi-httpd.async
The psgi_qx routine in the now-abandoned "repobrowse" branch allows us to break down blob-solving at each process execution point. It reuses the Qspawn facility for git-http-backend(1), allowing us to limit parallel subprocesses independently of Perl worker count. This is actually a 2-3% slower a fully-synchronous execution; but it is fair to other clients as it won't monopolize the server for hundreds of milliseconds (or even seconds) at a time.
2019-01-20viewvcs: disable white-space prewrap in blob view
We need to keep line-numbers from <a> tags synced to the actual line numbers in the code when working in smaller viewports. Maybe I only work on reasonable projects, but excessively long lines seem to be less of a problem in code than they are in emails.
2019-01-20view: enforce trailing slash for /$INBOX/$OID/s/ endpoints
As with our use of the trailing slash in $MESSAGE_ID/T/ and '$MESSAGE_ID/t/' endpoints, this for 'wget -r --mirror' compatibility as well as allowing sysadmins to quickly stand up a static directory with "index.html" in it to reduce load.
2019-01-20view: enable naming hints for raw blob downloads
Meaningful names in URLs are nice, and it can make life easier for supporting syntax-highlighting
2019-01-19view: wire up diff and vcs viewers with solver