]> git.ipfire.org Git - thirdparty/public-inbox.git/log
thirdparty/public-inbox.git
8 years agorepobrowse/git/atom: remove unused subroutine
Eric Wong [Thu, 26 Jan 2017 07:58:28 +0000 (07:58 +0000)] 
repobrowse/git/atom: remove unused subroutine

We never ended up using it.

8 years agorepobrowse: simplify command generation for git commands
Eric Wong [Thu, 26 Jan 2017 04:27:02 +0000 (04:27 +0000)] 
repobrowse: simplify command generation for git commands

This shortens the code quite a bit at a negligible performance cost,
and the diffstat agrees.

8 years agorepobrowse: git summary view uses psgi_qx
Eric Wong [Sun, 22 Jan 2017 22:10:46 +0000 (22:10 +0000)] 
repobrowse: git summary view uses psgi_qx

This reduces one synchronous dependency from the hot path,
and psgi_return will be used in the future.

8 years agot/httpd-unix: better diagnostics and comments for test
Eric Wong [Sun, 22 Jan 2017 01:52:25 +0000 (01:52 +0000)] 
t/httpd-unix: better diagnostics and comments for test

I've hit random test failures on this, so attempt to improve
diagnostics and improve documentation for this test.

8 years agorepobrowse: preserve newlines in Atom feed
Eric Wong [Sat, 21 Jan 2017 11:50:58 +0000 (11:50 +0000)] 
repobrowse: preserve newlines in Atom feed

Commit messages are assumed to be displayed in a terminal
with a fixed width font, so we must preserve newlines and
all whitespace as-is so ASCII art may be displayed properly.

8 years agorepobrowse: simplify git log parsing implementation
Eric Wong [Sat, 21 Jan 2017 11:34:31 +0000 (11:34 +0000)] 
repobrowse: simplify git log parsing implementation

Based on what was done for the Atom feed, this will allow us to
simplify state management through metaprogramming and avoid
placeholder characters ('D' for decoration) for empty fields.

8 years agorepobrowse: fix full URL generation in Atom feed
Eric Wong [Sat, 21 Jan 2017 04:41:06 +0000 (04:41 +0000)] 
repobrowse: fix full URL generation in Atom feed

We must not drop the leading slash in the URI.  This
regression was introduced when we dropped Plack::Request
dependency.

8 years agorepobrowse: avoid extra hash assignments for Atom feed
Eric Wong [Sat, 21 Jan 2017 04:35:27 +0000 (04:35 +0000)] 
repobrowse: avoid extra hash assignments for Atom feed

This should make the code somewhat easier-to-follow.

8 years agorepobrowse: git Atom feed uses Qspawn->psgi_return
Eric Wong [Sat, 21 Jan 2017 02:29:52 +0000 (02:29 +0000)] 
repobrowse: git Atom feed uses Qspawn->psgi_return

This allows us to wait on "git log" output in a non-blocking manner
while being able to throttle on backpressure from slow clients
when used with pi-httpd.

8 years agorepobrowse: git Atom feed uses Qspawn->psgi_qx
Eric Wong [Sat, 21 Jan 2017 02:29:51 +0000 (02:29 +0000)] 
repobrowse: git Atom feed uses Qspawn->psgi_qx

This allows pi-httpd to service other I/O while we wait on "git
symbolic-ref" to run.  And psgi_return will be used in the next
commit...

8 years agoqspawn: better annotate where $qx_cb is called
Eric Wong [Sat, 21 Jan 2017 02:29:50 +0000 (02:29 +0000)] 
qspawn: better annotate where $qx_cb is called

Hopefully this makes the code easier-to-follow for random
readers.  This requires a small amount of modification to
our one caller, but this is a new, unstable API (as is
nearly all of our code).

8 years agorepobrowse: expath is always defined
Eric Wong [Wed, 18 Jan 2017 08:17:50 +0000 (08:17 +0000)] 
repobrowse: expath is always defined

Remove an outdated comment while we're at it, too.

8 years agohttp: cast a wider net to prevent circular references
Eric Wong [Wed, 18 Jan 2017 07:35:35 +0000 (07:35 +0000)] 
http: cast a wider net to prevent circular references

We can more effectly nuke circular references by clearing
the entire PSGI $env, not just particular keys, when
there are self-referential fields such as "qspawn.response"
in our environment.

8 years agorepobrowse: git snapshot waits for all commands asynchronously
Eric Wong [Wed, 18 Jan 2017 07:27:03 +0000 (07:27 +0000)] 
repobrowse: git snapshot waits for all commands asynchronously

This new asynchronous API, psgi_qx, will allow us to take
advantage of non-blocking I/O from even small commands;
as those may still need to wait for slow operations.

8 years agoqspawn: better description
Eric Wong [Tue, 17 Jan 2017 19:38:36 +0000 (19:38 +0000)] 
qspawn: better description

We'll probably use this in a lot of places...

8 years agorepobrowse: verbose git tree display uses qspawn for ls-tree
Eric Wong [Sun, 15 Jan 2017 03:11:14 +0000 (03:11 +0000)] 
repobrowse: verbose git tree display uses qspawn for ls-tree

For now, qspawn provides resource management for dealing with
expensive "git ls-tree" processes.

8 years agorepobrowse: use qspawn for plain tree views
Eric Wong [Sun, 15 Jan 2017 02:26:39 +0000 (02:26 +0000)] 
repobrowse: use qspawn for plain tree views

We may eventually handle tree parsing ourselves (since we
already git cat-file), but for now we can rely on ls-tree
to give good output and qspawn to manage resource allocation.

8 years agorepobrowse: git: drop unused diff parsing routines
Eric Wong [Wed, 11 Jan 2017 08:46:35 +0000 (08:46 +0000)] 
repobrowse: git: drop unused diff parsing routines

We don't need these legacy routines anymore and use the
newer stream-friendly _sed interface.

8 years agohttpd/async: stop running command if client disconnects
Eric Wong [Fri, 13 Jan 2017 23:10:25 +0000 (23:10 +0000)] 
httpd/async: stop running command if client disconnects

If an HTTP client disconnects while we're piping the output of a
process to them, break the pipe of the process to reclaim
resources as soon as possible.

8 years agorepobrowse: simplify conditional for cat-file input
Eric Wong [Fri, 13 Jan 2017 22:53:20 +0000 (22:53 +0000)] 
repobrowse: simplify conditional for cat-file input

expath is always defined, even to an empty string,
so simplify the conditional for checking it.

8 years agorename "GitAsyncRd" to "GitAsync"
Eric Wong [Fri, 13 Jan 2017 22:28:36 +0000 (22:28 +0000)] 
rename "GitAsyncRd" to "GitAsync"

This wrapper class actually does both reading and
writing, and a shorter name is nicer.

8 years agogitasyncrd: pass a reference to Danga::Socket::write
Eric Wong [Fri, 13 Jan 2017 22:24:45 +0000 (22:24 +0000)] 
gitasyncrd: pass a reference to Danga::Socket::write

D::S creates a reference for this, anyways, so avoid
the extra work by doing it ourselves.

8 years agorepobrowse: comment describing Git wrapper creation
Eric Wong [Fri, 13 Jan 2017 22:05:10 +0000 (22:05 +0000)] 
repobrowse: comment describing Git wrapper creation

Metaprogramming can be difficult-to-read after several
months, so leave comments in place to describe common
usage results of.

8 years agorepobrowse: port git log view to qspawn streaming interface
Eric Wong [Fri, 13 Jan 2017 02:13:18 +0000 (02:13 +0000)] 
repobrowse: port git log view to qspawn streaming interface

This will prevent too many processes from being spawned at once
while also allowing us to respond to backpressure from slow
clients.

8 years agorepobrowse: make git diff output use qspawn
Eric Wong [Wed, 11 Jan 2017 04:12:29 +0000 (04:12 +0000)] 
repobrowse: make git diff output use qspawn

This is a potentially expensive operation, so we may want to
give it it's own limiter channel.

8 years agodiff: note the dangers of gigantic anchors hash
Eric Wong [Wed, 11 Jan 2017 04:12:28 +0000 (04:12 +0000)] 
diff: note the dangers of gigantic anchors hash

8 years agoasync: improve and fix out-of-date comments
Eric Wong [Wed, 11 Jan 2017 04:12:27 +0000 (04:12 +0000)] 
async: improve and fix out-of-date comments

8 years agorepobrowse: qspawn + streaming for git commit display
Eric Wong [Wed, 11 Jan 2017 04:12:26 +0000 (04:12 +0000)] 
repobrowse: qspawn + streaming for git commit display

This prevents "git show" processes from monopolizing
the system and allows us to better handle backpressure
from gigantic commits.

8 years agoqspawn: fix bad error reporting on errors
Eric Wong [Wed, 11 Jan 2017 04:12:25 +0000 (04:12 +0000)] 
qspawn: fix bad error reporting on errors

Oops :x

8 years agogithttpbackend: use psgi_return shortcut
Eric Wong [Sun, 8 Jan 2017 04:39:18 +0000 (04:39 +0000)] 
githttpbackend: use psgi_return shortcut

This drastically cuts down the amount of duplicate code
we have in this branch.

8 years agohttpd/async: remove needless sysread wrapper
Eric Wong [Sun, 8 Jan 2017 04:31:30 +0000 (04:31 +0000)] 
httpd/async: remove needless sysread wrapper

We don't appear to be using it anywhere

8 years agoMerge remote-tracking branch 'origin/master' into repobrowse
Eric Wong [Sun, 8 Jan 2017 04:25:51 +0000 (04:25 +0000)] 
Merge remote-tracking branch 'origin/master' into repobrowse

* origin/master:
  inbox: properly register cleanup timer for git processes
  search: remove subject_summary
  searchmsg: favor direct hash access over accessor methods
  remove incorrect comment about strftime + locales
  config: allow per-inbox nntpserver
  inbox: eliminate weaken usage entirely
  inbox: describe the full key name
  config: remove unused get() method
  config: always use namespaced "publicinboxlimiter"
  qspawn: prepare to support runtime reloading of Limiter
  http: remove weaken usage, reduce anonsub capture scope
  httpd/async: remove weaken usage
  http: fix spelling error
  watch: watchspam affects all configured inboxes
  doc: minor updates to design notes

8 years agoinitial git async work
Eric Wong [Sat, 31 Dec 2016 11:16:47 +0000 (11:16 +0000)] 
initial git async work

This will allow us to handle network operations while waiting
on "git cat-file" to seek and unpack things.

8 years agoinbox: drop $ref arg for writing destination buffer
Eric Wong [Sat, 7 Jan 2017 22:56:03 +0000 (22:56 +0000)] 
inbox: drop $ref arg for writing destination buffer

We never used this feature, so lets drop it for now
since we can have fine-grained memory release with
reference counting, anyways.

8 years agoinbox: properly register cleanup timer for git processes
Eric Wong [Sat, 7 Jan 2017 02:10:23 +0000 (02:10 +0000)] 
inbox: properly register cleanup timer for git processes

We still need to cleanup git processes occasionally, since
"git cat-file --batch" does not release old packs (and
git processes are fairly expensive).

For SQLite and Xapian file handles, they should be capable
of managing themselves without too much trouble, so lets
try keeping them for the lifetime of a process.

8 years agosearch: remove subject_summary
Eric Wong [Sat, 7 Jan 2017 01:44:52 +0000 (01:44 +0000)] 
search: remove subject_summary

Apparently it never actually got used, and the world seems
fine without it, so we can drop it.

While we're at it, consider removing our subject_path
usage from existence, too.  We are not using fancy subject-line
based URLs, here.

8 years agosearchmsg: favor direct hash access over accessor methods
Eric Wong [Sat, 7 Jan 2017 01:44:51 +0000 (01:44 +0000)] 
searchmsg: favor direct hash access over accessor methods

This is faster, smaller, and more straighforward to me with
fewer layers of indirection.

8 years agoremove incorrect comment about strftime + locales
Eric Wong [Sat, 7 Jan 2017 01:44:50 +0000 (01:44 +0000)] 
remove incorrect comment about strftime + locales

We only need strftime to be locale-independent when generating
dates for email and HTTP headers.  Purely numeric dates can
use strftime for ease-of-readability.

8 years agoconfig: allow per-inbox nntpserver
Eric Wong [Sat, 7 Jan 2017 01:44:49 +0000 (01:44 +0000)] 
config: allow per-inbox nntpserver

This allows certain inboxes to override the global nntpserver
(perhaps under a different domain).

8 years agoinbox: eliminate weaken usage entirely
Eric Wong [Sat, 7 Jan 2017 01:44:48 +0000 (01:44 +0000)] 
inbox: eliminate weaken usage entirely

We can do a better job initializing the data structure
so we no longer need to rely on weak references to cleanup
when we ditch the config on reload.

8 years agoinbox: describe the full key name
Eric Wong [Sat, 7 Jan 2017 01:44:47 +0000 (01:44 +0000)] 
inbox: describe the full key name

Hopefully make this easier for future generations to understand.

8 years agoconfig: remove unused get() method
Eric Wong [Sat, 7 Jan 2017 01:44:46 +0000 (01:44 +0000)] 
config: remove unused get() method

This seems like an unnecessary abstraction, or an abstraction
on the wrong level.

8 years agoconfig: always use namespaced "publicinboxlimiter"
Eric Wong [Sat, 7 Jan 2017 01:44:45 +0000 (01:44 +0000)] 
config: always use namespaced "publicinboxlimiter"

I'm not sure if we'll ever support sharing a config file
with other tools, but maybe we will, and "limiter" is
too generic.

8 years agoqspawn: prepare to support runtime reloading of Limiter
Eric Wong [Sat, 7 Jan 2017 01:44:44 +0000 (01:44 +0000)] 
qspawn: prepare to support runtime reloading of Limiter

We may allow the {max} value of a limiter to be changed
in the future, so lets start accounting for it before we
spawn followup processes.

8 years agohttp: remove weaken usage, reduce anonsub capture scope
Eric Wong [Wed, 4 Jan 2017 11:20:51 +0000 (11:20 +0000)] 
http: remove weaken usage, reduce anonsub capture scope

Avoiding weaken here is no more dangerous than the existing
circular refs (e.g. psgix.io) we create and manage throughout
the lifetime of the connection.  So, trust ourselves to maintain
the data structure properly and avoid triggering extra memory
usage.

While we're at it, avoid having anonymous subroutines capture
more variables than necessary to simplify reference auditing.

8 years agohttpd/async: remove weaken usage
Eric Wong [Wed, 4 Jan 2017 11:20:50 +0000 (11:20 +0000)] 
httpd/async: remove weaken usage

We do not need to use weaken() here, so avoid it to simplify our
interactions with Perl; as weaken requires additional storage
and (it seems) time complexity.

8 years agohttp: fix spelling error
Eric Wong [Wed, 4 Jan 2017 11:20:49 +0000 (11:20 +0000)] 
http: fix spelling error

Oops.  And we'll be fixing circular references from now...

8 years agowatch: watchspam affects all configured inboxes
Eric Wong [Mon, 2 Jan 2017 13:16:15 +0000 (13:16 +0000)] 
watch: watchspam affects all configured inboxes

If a message is spam in one mailbox, it is spam in all others a
particular user/group will care about.

8 years agorepobrowse: avoid empty pathspecs for future git compatibility
Eric Wong [Mon, 26 Dec 2016 03:04:08 +0000 (03:04 +0000)] 
repobrowse: avoid empty pathspecs for future git compatibility

At the moment, we always set expath, so it will always be
defined.

8 years agodoc: minor updates to design notes
Eric Wong [Mon, 26 Dec 2016 21:41:15 +0000 (21:41 +0000)] 
doc: minor updates to design notes

ssoma is not worth marketing, but perhaps our mirror of
the git mailing list archives is...

8 years agospawn: remove non-blocking support, here
Eric Wong [Mon, 26 Dec 2016 09:58:02 +0000 (09:58 +0000)] 
spawn: remove non-blocking support, here

It is never used, and inappropriate to support in generic code.

HTTPD::Async already sets non-blocking, and it's better to do it
in -httpd-specific code since we know our -httpd can handle it.

8 years agorepobrowse: port git snapshot over to qspawn
Eric Wong [Mon, 26 Dec 2016 09:44:44 +0000 (09:44 +0000)] 
repobrowse: port git snapshot over to qspawn

This is expensive, so we will utilize the qspawn system
to prevent excessive overhead.

8 years agorepobrowse: port patch generation over to qspawn
Eric Wong [Sun, 25 Dec 2016 08:53:19 +0000 (08:53 +0000)] 
repobrowse: port patch generation over to qspawn

And start generalizing the qspawn usage code for PSGI
with psgi_return.

8 years agogit: lazy initialization of error output
Eric Wong [Sun, 25 Dec 2016 08:52:41 +0000 (08:52 +0000)] 
git: lazy initialization of error output

We may not keep this feature after all, but for now we'll hold
off on creating it to cheapen instantiation.

8 years agoMerge remote-tracking branch 'origin/master' into repobrowse
Eric Wong [Mon, 26 Dec 2016 05:25:36 +0000 (05:25 +0000)] 
Merge remote-tracking branch 'origin/master' into repobrowse

* origin/master: (25 commits)
  evcleanup: ensure deferred close from timers are handled ASAP
  httpd/async: improve variable naming
  githttpbackend: minor cleanups to improve readability
  githttpbackend: simplify compatibility code
  githttpbackend: minor readability improvement
  http: fix clobbering of $null_io
  linkify: modify argument in place
  view: do not modify array during iteration
  view: stop chomping off whitespace at ends of messages
  view: remove unused parameter
  search: lookup_mail handles modified DBs
  doc: various comments on async handling
  searchthread: simplify API and remove needless OO
  searchthread: update comment about loop prevention
  searchmsg: remove ensure_metadata
  tests: add thread-all testing for benchmarking
  searchmsg: do not memoize {date} field
  searchmsg: remove locale-dependency for ->date
  t/config.t: fix feedmax default
  wwwtext: link to RFC4685 (Atom Threading)
  ...

8 years agoevcleanup: ensure deferred close from timers are handled ASAP
Eric Wong [Mon, 26 Dec 2016 03:05:15 +0000 (03:05 +0000)] 
evcleanup: ensure deferred close from timers are handled ASAP

Danga::Socket defers close() syscalls until the end of the event
loop to avoid FD recycling.  Unfortunately, this is dependent on
IO events firing and waking the process up from
poll/kevent/epoll_wait.

Without any I/O activity, a socket could remain in the
@Danga::Socket::ToClose array indefinitely.  Thus, we will
trigger a fake IO event after running all timers to trigger
the deferred close in Danga::Socket::PostEventLoop.

8 years agot/repobrowse_git_httpd: remove XS parser dependency
Eric Wong [Mon, 26 Dec 2016 02:15:29 +0000 (02:15 +0000)] 
t/repobrowse_git_httpd: remove XS parser dependency

Relying on the XS parser has been optional since March 2016:
commit 7dd78012da81d48e5e73e56c3255895dfa9de1f5
("http: use Plack::HTTPParser for HTTP parsing")

8 years agohttpd/async: improve variable naming
Eric Wong [Sun, 25 Dec 2016 08:09:48 +0000 (08:09 +0000)] 
httpd/async: improve variable naming

We only refer to PublicInbox::HTTP objects here, so '$io'
was a bad name.

8 years agogithttpbackend: minor cleanups to improve readability
Eric Wong [Sun, 25 Dec 2016 07:33:02 +0000 (07:33 +0000)] 
githttpbackend: minor cleanups to improve readability

Fewer returns improves readability and the diffstat agrees.

8 years agogithttpbackend: simplify compatibility code
Eric Wong [Sun, 25 Dec 2016 06:52:03 +0000 (06:52 +0000)] 
githttpbackend: simplify compatibility code

Fewer conditionals means theres fewer code paths to test
and makes things easier-to-read.

8 years agogithttpbackend: minor readability improvement
Eric Wong [Sun, 25 Dec 2016 06:39:13 +0000 (06:39 +0000)] 
githttpbackend: minor readability improvement

Use a more meaningful variable name for the Qspawn
object, since this module is the reference for its
use.

8 years agohttp: fix clobbering of $null_io
Eric Wong [Sun, 25 Dec 2016 09:40:25 +0000 (09:40 +0000)] 
http: fix clobbering of $null_io

Oops, this would be disatrous if we started handling
bigger request bodies or slow clients.

Fixes: c008654229a9 ("avoid IO::File for anonymous temporary files")
8 years agolinkify: modify argument in place
Eric Wong [Sat, 24 Dec 2016 11:52:44 +0000 (11:52 +0000)] 
linkify: modify argument in place

This results in over 1% speedup doing $MESSAGE_ID/T/ HTML
generation for a 368-message thread.

8 years agoview: do not modify array during iteration
Eric Wong [Sat, 24 Dec 2016 11:52:43 +0000 (11:52 +0000)] 
view: do not modify array during iteration

This results in a half percent speedup or so doing
$MESSAGE_ID/T/ HTML generation for a 368 message thread.

8 years agoview: stop chomping off whitespace at ends of messages
Eric Wong [Sat, 24 Dec 2016 11:52:42 +0000 (11:52 +0000)] 
view: stop chomping off whitespace at ends of messages

This allows a 3-4% speedup in $MESSAGE_ID/T/ page generation
speed for a 368+ message thread.  It also more faithfully
preserves the message as intended; even if the it makes the
sender look like a space-wasting slob :P

8 years agoview: remove unused parameter
Eric Wong [Sat, 24 Dec 2016 11:52:41 +0000 (11:52 +0000)] 
view: remove unused parameter

And add a comment about it to remind our future selves.

8 years agosearch: lookup_mail handles modified DBs
Eric Wong [Thu, 22 Dec 2016 08:00:26 +0000 (08:00 +0000)] 
search: lookup_mail handles modified DBs

We call lookup_mail all over the place, be sure we can handle
database modifications in those cases.

8 years agodoc: various comments on async handling
Eric Wong [Thu, 22 Dec 2016 07:29:17 +0000 (07:29 +0000)] 
doc: various comments on async handling

Notes for future developers (myself included) since we
can't assume people can read my mind.

8 years agorepobrowse: remove Plack::Request dependency
Eric Wong [Thu, 22 Dec 2016 04:38:13 +0000 (04:38 +0000)] 
repobrowse: remove Plack::Request dependency

This does not make installation easier, but lightens runtime a
bit.  Plack::Request is unnecessary bloat and indirection which
does things behind our back.  $env has all the stuff we need.

8 years agosearchthread: simplify API and remove needless OO
Eric Wong [Tue, 20 Dec 2016 23:42:36 +0000 (23:42 +0000)] 
searchthread: simplify API and remove needless OO

This simplifies callers to prevent errors and avoids
needless object-orientation in favor of a single procedure
call to handle threading and ordering.

8 years agosearchthread: update comment about loop prevention
Eric Wong [Tue, 20 Dec 2016 23:42:35 +0000 (23:42 +0000)] 
searchthread: update comment about loop prevention

It definitely is necessary to prevent looping with the
%seen hash.

8 years agorepobrowse: git plain: fixup request handling
Eric Wong [Tue, 20 Dec 2016 23:20:11 +0000 (23:20 +0000)] 
repobrowse: git plain: fixup request handling

Leftover from commit d4cec3bc3e439ab6ea9a2f89da5f98033bd95b4f
("repobrowse: start reducing Plack::Request dependencies")

8 years agosearchmsg: remove ensure_metadata
Eric Wong [Tue, 20 Dec 2016 03:03:57 +0000 (03:03 +0000)] 
searchmsg: remove ensure_metadata

Instead, only preload the ->mid field for threading,
as we only need ->thread and ->path once in Search->get_thread
(but we will need the ->mid field repeatedly).

This more than doubles View->load_results performance on
according to thread-all on an inbox with over 300K messages.

8 years agotests: add thread-all testing for benchmarking
Eric Wong [Tue, 20 Dec 2016 03:03:56 +0000 (03:03 +0000)] 
tests: add thread-all testing for benchmarking

I'll be using this to improve message threading performance.

8 years agosearchmsg: do not memoize {date} field
Eric Wong [Sat, 17 Dec 2016 12:04:11 +0000 (12:04 +0000)] 
searchmsg: do not memoize {date} field

We only generate the ->date once in NNTP, so creating
the hash entry is a waste.

8 years agosearchmsg: remove locale-dependency for ->date
Eric Wong [Sat, 17 Dec 2016 12:04:10 +0000 (12:04 +0000)] 
searchmsg: remove locale-dependency for ->date

strftime is locale-dependent, which can cause surprising
failures for some users.

8 years agot/config.t: fix feedmax default
Eric Wong [Sat, 17 Dec 2016 05:50:30 +0000 (05:50 +0000)] 
t/config.t: fix feedmax default

Oops :x

8 years agowwwtext: link to RFC4685 (Atom Threading)
Eric Wong [Wed, 14 Dec 2016 21:00:13 +0000 (21:00 +0000)] 
wwwtext: link to RFC4685 (Atom Threading)

This should give this feature some more visibility.

8 years agoatom: implement message threading per RFC 4685
Eric Wong [Tue, 13 Dec 2016 02:33:30 +0000 (02:33 +0000)] 
atom: implement message threading per RFC 4685

This will allows certain feed readers to render a message thread
as described in <https://www.jwz.org/doc/threading.html>.

Feed readers with knowledge of of RFC 4685 are unknown to us at
this time, but perhaps this will encourage future implementations.

Existing feed readers I've tested (newsbeuter, feed2imap) seem
to ignore these tags gracefully without degradation.

8 years agofeed: support publicinbox.<name>.feedmax
Eric Wong [Sat, 17 Dec 2016 04:27:52 +0000 (04:27 +0000)] 
feed: support publicinbox.<name>.feedmax

This allows users to customize by using smaller or larger Atom
feeds than the default value of 25 entries.

8 years agoTODO: note IO::KQueue for the ticket
Eric Wong [Wed, 14 Dec 2016 23:53:06 +0000 (23:53 +0000)] 
TODO: note IO::KQueue for the ticket

Do not require users to have network access to know what
the link refers to.

8 years agot/thread-cycle: no need for Xapian to run this test
Eric Wong [Wed, 14 Dec 2016 19:28:53 +0000 (19:28 +0000)] 
t/thread-cycle: no need for Xapian to run this test

We don't actually use anything from SearchMsg,
just the class name.

8 years agowwwtext: remove outdated comment
Eric Wong [Wed, 14 Dec 2016 20:58:00 +0000 (20:58 +0000)] 
wwwtext: remove outdated comment

I originally envisioned wwwtext being more flexible and able to
serve arbitrary blobs; but at this point I consider it redundant
and public-inbox is not wiki software.

8 years agorepobrowse: start reducing Plack::Request dependencies
Eric Wong [Wed, 14 Dec 2016 00:31:30 +0000 (00:31 +0000)] 
repobrowse: start reducing Plack::Request dependencies

We'll be migrating away from it to minimize dependencies
and surprises, just like the rest of public-inbox did
several months ago.

8 years agoMerge remote-tracking branch 'origin/repobrowse' into repobrowse
Eric Wong [Tue, 13 Dec 2016 21:56:39 +0000 (21:56 +0000)] 
Merge remote-tracking branch 'origin/repobrowse' into repobrowse

* origin/repobrowse: (98 commits)
  t/repobrowse_git_httpd.t: ensure signature exists for split
  t/repobrowse_git_tree.t: fix test for lack of bold
  repobrowse: fix alignment of gitlink entries
  repobrowse: show invalid type for tree views
  repobrowse: do not bold directory names in tree view
  repobrowse: reduce checks for response fh
  repobrowse: larger, short-lived buffer for reading patches
  repobrowse: reduce risk of callback reference cycles
  repobrowse: snapshot support for cgit compatibility
  test: disable warning for Plack::Test::Impl
  repobrowse: avoid confusing linkification for "diff"
  repobrowse: git commit view uses pi-httpd.async
  repobrowse: more consistent variable naming for /commit/
  repobrowse: show roughly equivalent "diff-tree" invocation
  repobrowse: reduce local variables for state management
  repobrowse: summary handles multiple README types
  repobrowse: remove bold decorations from diff view
  repobrowse: common git diff parsing code
  repobrowse: implement diff view for compatibility
  examples/repobrowse.psgi: disable Chunked response by default
  ...

8 years agosearchmsg: remove unused EPOCH_822 constant
Eric Wong [Tue, 13 Dec 2016 03:10:13 +0000 (03:10 +0000)] 
searchmsg: remove unused EPOCH_822 constant

This hasn't been needed since our Email::Abstract removal
for message threading.

8 years agonntp: avoid useless use of strftime
Eric Wong [Tue, 13 Dec 2016 03:10:12 +0000 (03:10 +0000)] 
nntp: avoid useless use of strftime

There's no need to use strftime if we'll be converting the date
by hand, anyways.

8 years agonntp: add test case for the "DATE" command
Eric Wong [Tue, 13 Dec 2016 03:10:11 +0000 (03:10 +0000)] 
nntp: add test case for the "DATE" command

We may not always use strftime and may implement caching.
But for now, just add a test.

8 years agodaemon: set $now time for NNTP shutdown
Eric Wong [Mon, 12 Dec 2016 12:14:02 +0000 (12:14 +0000)] 
daemon: set $now time for NNTP shutdown

commit 6e238ee3396719e578d6a90e177a71ce9f8c1ca0
("nntp: respect 3 minute idle time for shutdown")
was incomplete, and needed this change to Daemon
to be effective.

In the future, there will be more common code between
NNTP.pm and HTTP.pm

8 years agodoc: simplify makefile snippet
Eric Wong [Mon, 12 Dec 2016 12:07:21 +0000 (12:07 +0000)] 
doc: simplify makefile snippet

We have these manpages, and will always have them, so stop
trying to pretend we're doing something about maintainability,
here.

8 years agoinit: preserve permissions of existing config file
Eric Wong [Mon, 12 Dec 2016 12:02:45 +0000 (12:02 +0000)] 
init: preserve permissions of existing config file

This matches git-config(1) behavior, and implied user
intent when it comes to programatically editing files.

8 years agosearch: retry document loading from Xapian
Eric Wong [Sat, 10 Dec 2016 23:35:43 +0000 (23:35 +0000)] 
search: retry document loading from Xapian

In addition to needing to retry enquire queries, we also need
to protect document loading from the Xapian DB and retry on
modification, as it seems to throw the same errors.

Checking the $@ ref for Search::Xapian::DatabaseModifiedError
is actually in the test suite for both the XS and SWIG Xapian
bindings, so we should be good as far as forward/backwards
compatibility.

8 years agosearch: always sort thread results in ascending time order
Eric Wong [Sat, 10 Dec 2016 01:09:51 +0000 (01:09 +0000)] 
search: always sort thread results in ascending time order

This makes life easier for the threading algorithm, as we can
use the implied ordering of timestamps to avoid temporary ghosts
and resulting container vivication.

This would've also allowed us to hide the bug (in most cases)
fixed by the patch titled "thread: last Reference always wins",
in case that needs to be reverted due to infinite looping.

8 years agothread: last Reference always wins
Eric Wong [Sat, 10 Dec 2016 01:09:50 +0000 (01:09 +0000)] 
thread: last Reference always wins

Since we use SearchMsg from Xapian data, we can be
assured we do not get self-referential {references}
field.

However, we may need to be more careful when checking
has_descendent for loops, as blindly calling add_child
could open us up to that possibility...

8 years agoview: skip ghosts with no direct children
Eric Wong [Sat, 10 Dec 2016 01:09:49 +0000 (01:09 +0000)] 
view: skip ghosts with no direct children

Otherwise, a malicious or broken client could populate the
thread skeleton with invalid References.  We only care about
ghosts which messages correctly refer to, not totally bogus ones
which may be the result of long line or token truncation +
wrapping in MUA headers.

8 years agoview: reduce indentation for skeleton generation
Eric Wong [Sat, 10 Dec 2016 01:09:48 +0000 (01:09 +0000)] 
view: reduce indentation for skeleton generation

This should reduce the number of subroutine calls needed
for the common case of real (non-ghost) messages as well
as shortening code.

8 years agothread: fix comment describing its existence
Eric Wong [Sat, 10 Dec 2016 01:09:47 +0000 (01:09 +0000)] 
thread: fix comment describing its existence

Mail::Thread is UNavailable on many distros, meaning ordinary
users will have to rely on CPAN, a Perl-specific packaging tool.

8 years agoview: favor SearchMsg for In-Reply-To over Email::MIME
Eric Wong [Sat, 10 Dec 2016 03:21:29 +0000 (03:21 +0000)] 
view: favor SearchMsg for In-Reply-To over Email::MIME

This should avoid warnings during thread skeleton generation if
ever the Xapian database disagrees with View.pm about which is
the proper direct parent of a message.  We will treat the data
in Xapian as the truth (if Xapian is available).

8 years agosearch: favor In-Reply-To over last References iff IRT exists
Eric Wong [Sat, 10 Dec 2016 01:09:46 +0000 (01:09 +0000)] 
search: favor In-Reply-To over last References iff IRT exists

Some email clients set the References headers backwards, so
trust the In-Reply-To header if (and only if) it exists and
is parseable as direct parent of the current message.

For affected repos, this will require reindexing (via
"public-inbox-index --reindex"), but there will be no
version bump for this bugfix.

8 years agolinkify: implement Markdown link compatibility (again)
Eric Wong [Tue, 6 Dec 2016 23:40:33 +0000 (23:40 +0000)] 
linkify: implement Markdown link compatibility (again)

Although unescaped parentheses in URLs are technically allowed,
they are uncommon.  However, Markdown-like syntaxes are
unfortunately common for URLs, so we might as well support them.

This fixes parentheses detection at sentence endings, as seen
in practice on emails.