]> Sergey Matveev's repositories - public-inbox.git/log
public-inbox.git
17 months agofetch: use v5.12
Eric Wong [Mon, 28 Nov 2022 05:32:00 +0000 (05:32 +0000)]
fetch: use v5.12

Another tiny step towards improved startup performance by
avoiding one .pm file.

17 months agolei_mirror: shorten remote names
Eric Wong [Mon, 28 Nov 2022 05:31:59 +0000 (05:31 +0000)]
lei_mirror: shorten remote names

The lengthy-but-human-meaningful remote names are more expensive
at runtime and increase packed-refs space.

17 months agoclone: require `--objstore=' for default location
Eric Wong [Mon, 28 Nov 2022 05:31:58 +0000 (05:31 +0000)]
clone: require `--objstore=' for default location

Allowing just `--objstore' without `=' was confusing,
since it could eat one of the required parameters (URL or
DESTINATION).

17 months agoclone: use v5.12
Eric Wong [Mon, 28 Nov 2022 05:31:57 +0000 (05:31 +0000)]
clone: use v5.12

Another small step in what will probably a be a decades-long
quest to reduce startup time by a few milliseconds.

17 months agoclone: drop unnecessary requires
Eric Wong [Mon, 28 Nov 2022 05:31:56 +0000 (05:31 +0000)]
clone: drop unnecessary requires

These packages are all require-ed elsewhere.

17 months agoclone: move --dry-run handling to lei_mirror
Eric Wong [Mon, 28 Nov 2022 05:31:55 +0000 (05:31 +0000)]
clone: move --dry-run handling to lei_mirror

lei will probably support dry-run in more places, too.

17 months agolei_mirror: forkgroups use `git fetch --multiple'
Eric Wong [Mon, 28 Nov 2022 05:31:54 +0000 (05:31 +0000)]
lei_mirror: forkgroups use `git fetch --multiple'

This offloads network parallelization and safety off to git
itself while reducing the amount of unnecessary process spawning
we do.  This also improves readability of pack-refs invocations
and reduces the need for them.

To prevent heavily-forked repos from hitting system command-line
size limits, we group refs to be updated in the "fgrptmp" group.

17 months agolei_mirror: fix --dry-run for forkgroups
Eric Wong [Mon, 28 Nov 2022 05:31:53 +0000 (05:31 +0000)]
lei_mirror: fix --dry-run for forkgroups

We must not make permanent changes to the FS if --dry-run is in use.

17 months agolei_mirror: make basename more descriptive
Eric Wong [Mon, 28 Nov 2022 05:31:52 +0000 (05:31 +0000)]
lei_mirror: make basename more descriptive

This makes it easier for humans to distinguish between
"Alice/project.git" and "Bob/project.git"

17 months agolei_mirror: drop git <1.8.5 support
Eric Wong [Mon, 28 Nov 2022 05:31:51 +0000 (05:31 +0000)]
lei_mirror: drop git <1.8.5 support

Supporting git <1.8.5 via fetch on non-forkgroup repos would
make auto-GC dangerous, and I want to support auto-GC instead
of relying on the preciousObjects extension.

Since git 1.8.5 is 9 years old at this point, and grokmirror
(used by the only CentOS 7.x user I know of) already relies on
newer git, simplify our code and only fetch into forkgroups.

17 months agolei_mirror: do not show ref updates w/o --verbose
Eric Wong [Mon, 28 Nov 2022 05:31:50 +0000 (05:31 +0000)]
lei_mirror: do not show ref updates w/o --verbose

It's too noisy IMHO, and UIs are always opinionated.

17 months agolei_mirror: preserve permissions of existing alternates file
Eric Wong [Mon, 28 Nov 2022 05:31:49 +0000 (05:31 +0000)]
lei_mirror: preserve permissions of existing alternates file

We don't want to be clobbering permissions when changing to
relative paths.  Furthermore, we can avoid writing to the
alternates file if there are no changes.

17 months agolei_mirror: force --no-tags when fetching forkgroups
Eric Wong [Mon, 28 Nov 2022 05:31:48 +0000 (05:31 +0000)]
lei_mirror: force --no-tags when fetching forkgroups

We can't have multiple remotes writing to refs/tags/*
(instead of refs/remotes/*/tags) due to potential conflicts.

17 months agolei_mirror: set description for non-inboxes, too
Eric Wong [Mon, 28 Nov 2022 05:31:47 +0000 (05:31 +0000)]
lei_mirror: set description for non-inboxes, too

We can still set $GIT_DIR/description when cloning coderepos with
--inbox-config=never

17 months agolei_mirror: always pack refs for coderepos
Eric Wong [Mon, 28 Nov 2022 05:31:46 +0000 (05:31 +0000)]
lei_mirror: always pack refs for coderepos

Unlike object packing, ref packing is cheap and fast.

17 months agoclone: flesh out --objstore behavior and document
Eric Wong [Mon, 28 Nov 2022 05:31:45 +0000 (05:31 +0000)]
clone: flesh out --objstore behavior and document

We can support absolute paths to avoid surprising behaviors,
but relative paths are preferred since the goal is to be
accessible over the "dumb" HTTP git transport (the dumb
transport is uses less memory and CPU on the server).

17 months agolei_mirror: ensure git <1.8.5 fallback can use torsocks
Eric Wong [Mon, 28 Nov 2022 05:31:44 +0000 (05:31 +0000)]
lei_mirror: ensure git <1.8.5 fallback can use torsocks

Since we fall back to `git fetch' on versions of git without
`git update-ref --stdin' support, we must also support
torsocks use on Tor .onion URLs

17 months agolei_mirror: cleanup process reaping logic
Eric Wong [Mon, 28 Nov 2022 05:31:43 +0000 (05:31 +0000)]
lei_mirror: cleanup process reaping logic

We can put more of the default --jobs logic and loop handling
inside a sub to simplify callers.

17 months agolei_mirror: support --objstore and forkgroups
Eric Wong [Mon, 28 Nov 2022 05:31:42 +0000 (05:31 +0000)]
lei_mirror: support --objstore and forkgroups

The {forkgroup} directive of grokmirror 2.x manifest.js.gz
can facilitate more space savings and improved pack performance
with pack.islands.

17 months agolei_mirror: simplify clone_v2_prep
Eric Wong [Mon, 28 Nov 2022 05:31:41 +0000 (05:31 +0000)]
lei_mirror: simplify clone_v2_prep

Since everything relies on the instance-specific {todo} queue,
there's no need to have sub-specific queues.

17 months agolei_mirror: avoid convoluted lazy_cb usage
Eric Wong [Mon, 28 Nov 2022 05:31:40 +0000 (05:31 +0000)]
lei_mirror: avoid convoluted lazy_cb usage

lazy_cb should only be used for lei command dispatch and
completion callbacks when the method isn't known at startup.
There's zero reason to use it when the method is known
ahead-of-time, especially when there's a comment pointing
reviewers towards the only possible method it can dispatch.

17 months agolei_mirror: hoist out dump_manifest sub
Eric Wong [Mon, 28 Nov 2022 05:31:39 +0000 (05:31 +0000)]
lei_mirror: hoist out dump_manifest sub

We can reuse it in PublicInbox::Fetch, too.

17 months agolei_mirror: do not write Makefile for --inbox-config=never
Eric Wong [Mon, 28 Nov 2022 05:31:38 +0000 (05:31 +0000)]
lei_mirror: do not write Makefile for --inbox-config=never

We want to be able to clone non-inbox git repos, too.

17 months agolei_mirror: add `index' target to generated Makefile
Eric Wong [Mon, 28 Nov 2022 05:31:37 +0000 (05:31 +0000)]
lei_mirror: add `index' target to generated Makefile

It can probably be a useful hint to avoid misleading users
into always using `--reindex'.

17 months agolei_mirror: cleanup File::Temp OO usage
Eric Wong [Mon, 28 Nov 2022 05:31:36 +0000 (05:31 +0000)]
lei_mirror: cleanup File::Temp OO usage

There's no need to capture or rely on the File::Temp->filename
in most cases since most Perl functions accept file handles all
the same.

17 months agolei_mirror: ensure curl exits 22 on HTTP 404 responses
Eric Wong [Mon, 28 Nov 2022 05:31:35 +0000 (05:31 +0000)]
lei_mirror: ensure curl exits 22 on HTTP 404 responses

Oops, this is actually a long-standing bug :x

17 months agolei_mirror: require Perl v5.12+
Eric Wong [Mon, 28 Nov 2022 05:31:34 +0000 (05:31 +0000)]
lei_mirror: require Perl v5.12+

Another tiny step towards improve startup performance by
relying on Perl 5.12 strictness and avoiding strict.pm

17 months agoclone: support --inbox-version
Eric Wong [Mon, 28 Nov 2022 05:31:33 +0000 (05:31 +0000)]
clone: support --inbox-version

This is part of `lei add-external --mirror', and it makes
sense to have for development and testing.  We'll also add
a fallback in case somebody tries --inbox-version and fails
due to a newer remote instances of public-inbox.

17 months agolei_mirror: simplify v2 code paths
Eric Wong [Mon, 28 Nov 2022 05:31:32 +0000 (05:31 +0000)]
lei_mirror: simplify v2 code paths

We can simply reuse the parallelization of the manifest
code path for non-manifest v2 clones, now.

17 months agolei_mirror: support manifest {references} for v2 epochs
Eric Wong [Mon, 28 Nov 2022 05:31:31 +0000 (05:31 +0000)]
lei_mirror: support manifest {references} for v2 epochs

This may be useful in case a v1 inbox gets forked into v2
(untested).

17 months agolei_mirror: differentiate -entv vs -ent
Eric Wong [Mon, 28 Nov 2022 05:31:30 +0000 (05:31 +0000)]
lei_mirror: differentiate -entv vs -ent

It makes the code easier-to-follow when we have a single
versus multiple entities (`v' for vector, à la `argv').

17 months agolei_mirror: fix glob semantics to match end-of-path
Eric Wong [Mon, 28 Nov 2022 05:31:29 +0000 (05:31 +0000)]
lei_mirror: fix glob semantics to match end-of-path

Globs such as `*/foo' should not match `*/foobar',
this allows cloning only `git' and not
`gitolite-transparency-log` off lore

17 months agolei_mirror: require PublicInbox::Lock at use
Eric Wong [Mon, 28 Nov 2022 05:31:28 +0000 (05:31 +0000)]
lei_mirror: require PublicInbox::Lock at use

It's easier to understand why we lazy-load Lock for v2-only
code paths when we require it near its first use.

17 months agolei_mirror: do not fetch descriptions if using manifest
Eric Wong [Mon, 28 Nov 2022 05:31:27 +0000 (05:31 +0000)]
lei_mirror: do not fetch descriptions if using manifest

If a manifest exists, we can expect the description to always be
present, thus there's no need to make a separate HTTP(S) request
since we can use it as-is from the manifest for v1||coderepos
and strip / \[epoch [0-9]+\]\z/ from v1.

17 months agolei_mirror: defend against infinite loops
Eric Wong [Mon, 28 Nov 2022 05:31:26 +0000 (05:31 +0000)]
lei_mirror: defend against infinite loops

A reference chain of 1000 ought to be enough, I think...

17 months agolei_mirror: fix infinite loop in dependency resolution
Eric Wong [Mon, 28 Nov 2022 05:31:25 +0000 (05:31 +0000)]
lei_mirror: fix infinite loop in dependency resolution

We need to account for dependencies which are marked `done'.

17 months agolei_mirror: allow --epoch on mixed v1/v2 clones
Eric Wong [Mon, 28 Nov 2022 05:31:24 +0000 (05:31 +0000)]
lei_mirror: allow --epoch on mixed v1/v2 clones

It's entirely possible an instance will have both v1 and v2
inboxes (or v2 inboxes and coderepos).  Don't punish --epoch
users by forcing them to run multiple commands.

17 months agolei_mirror: reduce scope of v2 lock
Eric Wong [Mon, 28 Nov 2022 05:31:23 +0000 (05:31 +0000)]
lei_mirror: reduce scope of v2 lock

Guarding against parallel clones isn't realistic, really, only
setting up all.git, and even then, I'm not 100% sure the lock
is useful.

17 months agolei_mirror: retrieve v2 description properly
Eric Wong [Mon, 28 Nov 2022 05:31:22 +0000 (05:31 +0000)]
lei_mirror: retrieve v2 description properly

17 months agoclone: support --inbox-config option
Eric Wong [Mon, 28 Nov 2022 05:31:21 +0000 (05:31 +0000)]
clone: support --inbox-config option

This allows avoiding 404s when trying _/text/config/raw on code
repositories.

17 months agolei_mirror: reduce noise on interrupted clones
Eric Wong [Mon, 28 Nov 2022 05:31:20 +0000 (05:31 +0000)]
lei_mirror: reduce noise on interrupted clones

We don't need git-config or other commands failing loudly.
`git clone' and subcommands it spawns may still spew, but it's no
worse than interrupting `git clone' itself, now.

We accomplish this by localizing $LIVE (formerly %LIVE) and
detecting when its auto-vivification into a hashref goes
out-of-scope during the `DESTRUCT' ${^GLOBAL_PHASE}.

We can't use ${^GLOBAL_PHASE}, yet, either, since it appeared in
Perl 5.14 and we're still migrating slowly to Perl 5.12 before
going to 5.14.

17 months agolei_mirror: support {reference} for v1 manifest clones
Eric Wong [Mon, 28 Nov 2022 05:31:19 +0000 (05:31 +0000)]
lei_mirror: support {reference} for v1 manifest clones

This will be generalized to v2, as well.

17 months agolei_mirror: initialize placeholders with "head" from manifest
Eric Wong [Mon, 28 Nov 2022 05:31:18 +0000 (05:31 +0000)]
lei_mirror: initialize placeholders with "head" from manifest

This only affects v2 epochs, but ensures our bases are covered,
at least.  We'll have to update PublicInbox::Fetch later to
deal with "head" entries in manifest.js.gz, too.

17 months agoclone: support --dry-run / -n flag
Eric Wong [Mon, 28 Nov 2022 05:31:17 +0000 (05:31 +0000)]
clone: support --dry-run / -n flag

It still makes HTTP(S) requests to retrieve the manifest or
scrape HTML, but doesn't make permanent changes to the FS
(aside from modifying {acm}time of ${TMPDIR-/tmp}).

17 months agolei_mirror: set gitweb.owner from manifest
Eric Wong [Mon, 28 Nov 2022 05:31:16 +0000 (05:31 +0000)]
lei_mirror: set gitweb.owner from manifest

This is mainly for coderepos, but sometimes public-inboxes
get shared via cgit/gitweb, too.

17 months agolei_mirror: load most modules up-front
Eric Wong [Mon, 28 Nov 2022 05:31:15 +0000 (05:31 +0000)]
lei_mirror: load most modules up-front

lei lazy loads LeiMirror itself lazily, anyways, and it only
supports HTTP(S) mirrors, so there's no point in delaying most
of the modules it loads.  Some of the inbox-specific and
v2-specific stuff can be lazy-loaded, however, since this
will support mirroring non-inbox repositories, too.

17 months agolei_mirror: load File::Path unconditionally
Eric Wong [Mon, 28 Nov 2022 05:31:14 +0000 (05:31 +0000)]
lei_mirror: load File::Path unconditionally

File::Temp already uses it, so there's no sense in conditionally
require-ing it to save startup time.

17 months agolei_mirror: consolidate clone process management
Eric Wong [Mon, 28 Nov 2022 05:31:13 +0000 (05:31 +0000)]
lei_mirror: consolidate clone process management

This simplifies our code by having fewer places check process
limits and perform reaping.  We'll also print command names
immediately before executing, instead of right before waiting
for running processes.

17 months agolei_mirror: add a hint for skipped epoch permissions
Eric Wong [Mon, 28 Nov 2022 05:31:12 +0000 (05:31 +0000)]
lei_mirror: add a hint for skipped epoch permissions

Some users may think it's git-specific thing to enable
writability, rather than a *nix permissions thing.  Clarify that
it's a standard *nix thing.

17 months agolei_mirror: elide description retrieval for v1|coderepo
Eric Wong [Mon, 28 Nov 2022 05:31:11 +0000 (05:31 +0000)]
lei_mirror: elide description retrieval for v1|coderepo

manifest.js.gz can provide the description without an extra
HTTP(S) requests, so attempt to use it whenever we're using
the manifest.

17 months agolei_mirror: simplify _get_txt_start callers
Eric Wong [Mon, 28 Nov 2022 05:31:10 +0000 (05:31 +0000)]
lei_mirror: simplify _get_txt_start callers

We can avoid needless select()-based sleeps by always
using TMPDIR for temporary files, and just slurping the
small config or description file.

This will make it easier to reuse the description from
the manifest in the next commit.

17 months agomanifest: update module blurb + v5.12
Eric Wong [Mon, 28 Nov 2022 05:31:09 +0000 (05:31 +0000)]
manifest: update module blurb + v5.12

Helps steer new contributors (or forgetful old ones) in the
right direction.

17 months agoswitch inotify/kevent stuff to v5.12
Eric Wong [Mon, 28 Nov 2022 05:31:08 +0000 (05:31 +0000)]
switch inotify/kevent stuff to v5.12

Another tiny step towards an eventual startup time improvements
by avoiding strict.pm

17 months agolei_mirror: retrieve description text asynchronously, too
Eric Wong [Mon, 28 Nov 2022 05:31:07 +0000 (05:31 +0000)]
lei_mirror: retrieve description text asynchronously, too

We can easily parallelize this, so do it.

17 months agolei_mirror: move directory creation to v2-only path
Eric Wong [Mon, 28 Nov 2022 05:31:06 +0000 (05:31 +0000)]
lei_mirror: move directory creation to v2-only path

We rely on `git clone' to create the destination directory
for v1 and coderepos, so having it in _try_config_start was
senseless.

17 months agolei_mirror: default to single job by default
Eric Wong [Mon, 28 Nov 2022 05:31:05 +0000 (05:31 +0000)]
lei_mirror: default to single job by default

Parallel git clones are expensive on the server-side, and
smaller machines (which we encourage) can't handle them, well.

We'll also set `-q' since parallel clones will have output step
all over each other.

17 months agoclone: support parallel v1 clones
Eric Wong [Mon, 28 Nov 2022 05:31:04 +0000 (05:31 +0000)]
clone: support parallel v1 clones

This opens the door to parallel cloning of coderepos, too.  We
can also get rid of needless AutoReap usage, here, too since
it's usage has been 100% synchronous and not DESTROY-based as
they are in tests.

17 months agolei_mirror: rely on global process reaper
Eric Wong [Mon, 28 Nov 2022 05:31:03 +0000 (05:31 +0000)]
lei_mirror: rely on global process reaper

We no longer rely on SIGCHLD for predictability, and instead
call waitpid at safe points.  This will make it easier for us to
do parallel mirroring of multiple inboxes while preserving
proper dependencies via ->DESTROY callbacks.

17 months agolei_mirror: rely on DESTROY to index v2 inbox
Eric Wong [Mon, 28 Nov 2022 05:31:02 +0000 (05:31 +0000)]
lei_mirror: rely on DESTROY to index v2 inbox

This will give us more freedom in upcoming commits
to ensure indexing only happens after all all epochs
are cloned.

17 months agolei_mirror: async config retrieval for v2 w/ manifest
Eric Wong [Mon, 28 Nov 2022 05:31:01 +0000 (05:31 +0000)]
lei_mirror: async config retrieval for v2 w/ manifest

Another step towards being able to minimize mirror time by
supporting parallelization.

17 months agoclone: parallelize v2 epoch clones
Eric Wong [Mon, 28 Nov 2022 05:31:00 +0000 (05:31 +0000)]
clone: parallelize v2 epoch clones

This is a first step in supporting completely parallelized
clones.  Eventually, everything will be parallelized and
dependencies will be managed via callbacks.

17 months agoclone: support --include and --exclude with multi-clone
Eric Wong [Mon, 28 Nov 2022 05:30:59 +0000 (05:30 +0000)]
clone: support --include and --exclude with multi-clone

These will be handy when someone is interested in a subset of
inboxes on a large hosting site.

17 months agoclone: support multi-inbox clone
Eric Wong [Mon, 28 Nov 2022 05:30:58 +0000 (05:30 +0000)]
clone: support multi-inbox clone

This is to ensure we can do `public-inbox-clone https://yhbt.net/lore'
or `public-inbox-clone https://lore.kernel.org/' and clone all
inboxes (and whatever else git stores).

17 months agofilter/rubylang: adjust filter for new list software
Eric Wong [Sat, 26 Nov 2022 07:24:02 +0000 (07:24 +0000)]
filter/rubylang: adjust filter for new list software

The host serving ruby-core and ruby-dev no longer set
X-Mail-Count, but the serial number remains active in
the Subject.

17 months agonntpd: fix LISTGROUP with range
mephi42 [Mon, 28 Nov 2022 20:25:21 +0000 (21:25 +0100)]
nntpd: fix LISTGROUP with range

This reverts 0c62cffc2389 ("nntp: listgroup_range_i: remove useless
`map' op") and adds a test that demonstrates the breakage: the server
returns lines like

    ARRAY(0x556dace73f08)

instead of message numbers.

Fixes: 0c62cffc2389 ("nntp: listgroup_range_i: remove useless `map' op")
17 months agodskqxs:carp
Eric Wong [Mon, 28 Nov 2022 20:34:06 +0000 (20:34 +0000)]
dskqxs:carp

17 months agocontent_hash: handle References as octets
Eric Wong [Sun, 27 Nov 2022 09:15:47 +0000 (09:15 +0000)]
content_hash: handle References as octets

The alsa-devel archives on lore has some UTF-8 References:
headers, so we need to treat them as octets, again, otherwise
(re)indexing triggers cascading failures.

Fixes: 5198c976ce8b "eml: header_raw converts octets to Perl UTF-8"
17 months agoexamples/nginx_proxy: recommend `proxy_buffering off'
Eric Wong [Sat, 26 Nov 2022 09:55:16 +0000 (09:55 +0000)]
examples/nginx_proxy: recommend `proxy_buffering off'

public-inbox-httpd has always been designed to handle slow
clients efficiently via non-blocking sockets and epoll|kqueue.

Thus the proxy buffering capabilities of nginx were a needless
waste of memory and filesystem traffic and increases response
latency.

nginx does provide an HTTPS-capable reverse-proxy to talk to
varnish, however, any other HTTPS-capable reverse proxy works,
too.

17 months agoSaPlugin::ListMirror: follow RFC 2919 List-ID rules
Eric Wong [Fri, 25 Nov 2022 11:44:35 +0000 (11:44 +0000)]
SaPlugin::ListMirror: follow RFC 2919 List-ID rules

List-ID headers are sometimes populated with a descriptive phrase
before the angle-bracketed value and making things difficult to
match.

Tweak our handling to allow checking the angle-bracketed portion
only in accordance with RFC 2919.

Handling of all other headers and senselessly non-bracketed
values for List-ID remain unchanged.

17 months agoeml: header_raw converts octets to Perl UTF-8
Eric Wong [Thu, 24 Nov 2022 21:31:55 +0000 (21:31 +0000)]
eml: header_raw converts octets to Perl UTF-8

This fixes the display of raw (non-RFC 2047) names and subjects
in HTML message views.

SMTPUTF8 (RFC 6531) allows raw UTF-8 in headers without RFC 2047
encoding, so let Perl handle it as a character sequence for the
rest of our consumers.  Thus, the old special case in
PublicInbox::Smsg->populate is no longer necessary and gone.

The one regression notice so far (and fixed here) is compressed
IMAP envelope responses still needs raw bytes since the zlib
wrapper is designed for octets, not Perl UTF-8 chars.  Thus we
reverse utf8::decode with utf8::encode in PublicInbox::IMAP::_esc.

->header_set also forces encoding to bytes, since all existing
callers would either be dealing with ->header_raw results or
be RFC-2047-encoded anyways.

Reindexing is not necessary with this change due to the prior
PublicInbox::Smsg->populate special case.

Reported-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
Link: https://public-inbox.org/meta/20221124153715.3nenjpjzj43vqxr2@meerkat.local/
17 months agolei_curl: use http.proxy config from git if available
Eric Wong [Wed, 23 Nov 2022 04:09:58 +0000 (04:09 +0000)]
lei_curl: use http.proxy config from git if available

Since HTTP(S) URLs hit by lei or public-inbox-{clone,fetch} are
expected to be git endpoints anyways, fall back to using
http.proxy from git configs to save the user from having to
maintain the same configuration for different things.

17 months agoconfig: urlmatch $? does not influence our exits
Eric Wong [Wed, 23 Nov 2022 04:09:57 +0000 (04:09 +0000)]
config: urlmatch $? does not influence our exits

We don't want to leak $? from `git config' failures into
lei nor public-inbox-* processes.

17 months agolei_curl: set --proxy for curl(1) properly
Eric Wong [Wed, 23 Nov 2022 04:09:56 +0000 (04:09 +0000)]
lei_curl: set --proxy for curl(1) properly

curl(1) doesn't accept `--proxy=' with the `=', apparently :x

17 months agolei q|up: limit default write --jobs for IMAP(S)
Eric Wong [Mon, 14 Nov 2022 08:07:02 +0000 (08:07 +0000)]
lei q|up: limit default write --jobs for IMAP(S)

Eric Wong <e@80x24.org> wrote:
> Thanks for confirming things work as intended.  I think the
> default should be clamped, though... 15 seems a bit high for
> smaller IMAP servers *shrug*

--------8<-------
Subject: [PATCH] lei q|up: limit default write --jobs for IMAP(S)

IMAP(S) servers often limit per-user connections, so avoid
bumping into limits to improve the out-of-the-box experience.
4 seems like a conservative default, since we already chose
that number for remote HTTP(S) endpoints.

Link: https://public-inbox.org/meta/20220910201958.GA12212@dcvr/
18 months agotxt2pre: linkify lei/store => lei-store-format.html
Eric Wong [Thu, 3 Nov 2022 00:48:38 +0000 (00:48 +0000)]
txt2pre: linkify lei/store => lei-store-format.html

Linking to the manpage probably helps clarify what `lei/store'
refers to without too much clutter in the raw POD source.

18 months agodoc: lei-import: link to lei-store-format(5)
Eric Wong [Thu, 3 Nov 2022 00:48:37 +0000 (00:48 +0000)]
doc: lei-import: link to lei-store-format(5)

Users should know where `lei import' writes to.

18 months agodoc: txt2pre: modernize and use v5.12
Eric Wong [Thu, 3 Nov 2022 00:48:36 +0000 (00:48 +0000)]
doc: txt2pre: modernize and use v5.12

Another teeny step towards v5.12.

18 months agodoc: txt2pre: linkify "lei COMMAND" form
Eric Wong [Thu, 3 Nov 2022 00:48:35 +0000 (00:48 +0000)]
doc: txt2pre: linkify "lei COMMAND" form

While manpages are named `L<lei-COMMAND(1)>', `lei COMMAND'
can be worth linkifying for ease-of-navigation, too.

18 months agodoc: lei: improve description of *-search commands
Eric Wong [Thu, 3 Nov 2022 00:48:34 +0000 (00:48 +0000)]
doc: lei: improve description of *-search commands

The `OUTPUT' use may not be immediately apparent, clarify
that it's from `lei q'.

18 months agodoc: txt2pre: linkify new commands
Eric Wong [Thu, 3 Nov 2022 00:48:33 +0000 (00:48 +0000)]
doc: txt2pre: linkify new commands

lei-index, public-inbox-netd, and public-inbox-pop3d
were not properly linkified in our HTML documentation.

18 months agolei: fix globbing semantics to match end-of-filename
Eric Wong [Tue, 1 Nov 2022 09:36:12 +0000 (09:36 +0000)]
lei: fix globbing semantics to match end-of-filename

Globs such as `*/foo' should not match `*/foobar'.  I noticed
this while adding glob support to public-inbox-clone.

This may subtly break some existing cases, but there aren't many
lei users, yet, and globbing semantics should match what most
other glob-using programs, do...

We'll also make `lei ls-mail-sync' behave more consistently with
`lei ls-external', as far as the basename matching fallback
goes.

18 months agolei up: improve error for multiple lei.q values
Eric Wong [Mon, 31 Oct 2022 21:52:59 +0000 (21:52 +0000)]
lei up: improve error for multiple lei.q values

Point users towards the lei.internal.rawstr variable which
may be tripping up handling of lei.q after `lei edit-search'.

18 months agotests: expand relative @INC paths
Eric Wong [Tue, 25 Oct 2022 11:43:18 +0000 (11:43 +0000)]
tests: expand relative @INC paths

Since the lei-daemon may chdir around and lazy-loads package, we
must ensure @INC uses absolute paths so it can find stuff after
(f)chdir.

I noticed this in running `perl -I lib -w t/lei-q-kw.t'
instead of my usual `prove -bvw t/lei-q-kw.t' to save some
cycles.

18 months agolei_mirror: delimit names by `\n' to improve die message
Eric Wong [Thu, 20 Oct 2022 08:43:14 +0000 (08:43 +0000)]
lei_mirror: delimit names by `\n' to improve die message

Attempting to clone a top-level manifest should work,
eventually.  But for now, make the list of git repos
more readable.

18 months agolei_mirror: make _finish_add_external call more obvious
Eric Wong [Thu, 20 Oct 2022 08:43:13 +0000 (08:43 +0000)]
lei_mirror: make _finish_add_external call more obvious

I get easily confused, sometimes :x

18 months agotreewide: replace /^I: / prefix with /^# /
Eric Wong [Thu, 20 Oct 2022 08:43:12 +0000 (08:43 +0000)]
treewide: replace /^I: / prefix with /^# /

This is like more familiar to readers of TAP (Test Anywhere
Protocol) output, as well as shell and Perl scripters which also
use `#' for comments.

AFAIK, nobody is parsing our stderr, and I'm not sure how
standardized the `I:' prefix is (nor `W:' and `E:' are).  It's
already the prevailing style in Lei* code, too, so things have
been moving in that direction for a bit.

18 months agogithttpbackend: remove unused $BIN variable
Eric Wong [Thu, 20 Oct 2022 08:43:11 +0000 (08:43 +0000)]
githttpbackend: remove unused $BIN variable

It hasn't been used in many years since commit
c1630b7dc4ef (githttpbackend: match Content-Type of git-http-backend(1), 2016-07-03)

18 months agoanother step towards git SHA-256 support
Eric Wong [Thu, 20 Oct 2022 08:43:10 +0000 (08:43 +0000)]
another step towards git SHA-256 support

While SHA-256 isn't supported for inboxes, yet
xt/git-http-backend.t now runs properly against a SHA-256 code
repository

18 months agoclone|fetch: preserve mtime of modified manifest.js.gz
Eric Wong [Thu, 20 Oct 2022 08:43:09 +0000 (08:43 +0000)]
clone|fetch: preserve mtime of modified manifest.js.gz

When we cull manifest.js.gz for ignored epochs, attempt to
preserve mtime of the updated manifest.js.gz since it can
be used to optimize future fetches.

18 months agosigfd: set SIGWINCH for MIPS and PA-RISC on Linux
Eric Wong [Mon, 17 Oct 2022 09:30:53 +0000 (09:30 +0000)]
sigfd: set SIGWINCH for MIPS and PA-RISC on Linux

SIGWINCH is actually different for these architectures on Linux
according to the signal(7) man page.

Note: AFAICS there's no parisc machine in the GCC Farm[1],
so it remains untested.  I've only tested mips64 for mips,
but I expect them to both work.

OpenBSD (on gcc231) octeon defines SIGWINCH as the common `28',
so it appears Linux is the only one with arch-dependent signal
numbers (ditto with syscalls).

[1] https://cfarm.tetaneutral.net/machines/list/

18 months agosyscall: avoid needless string comparison on x86-64
Eric Wong [Mon, 17 Oct 2022 09:30:52 +0000 (09:30 +0000)]
syscall: avoid needless string comparison on x86-64

For common x86-64 systems, we can avoid a needless
string comparison on `mips64' by restructuring the
branches for architecture detection.

18 months agoSIGWINCH is 28 on Darwin-based OSes
Nicolás Ojeda Bär [Sat, 15 Oct 2022 08:12:46 +0000 (10:12 +0200)]
SIGWINCH is 28 on Darwin-based OSes

[ew: avoid mention of non-Free platform]

Acked-by: Eric Wong <e@80x24.org>
18 months agodskqxs: fix loop to allow `next'
Eric Wong [Tue, 11 Oct 2022 00:05:54 +0000 (00:05 +0000)]
dskqxs: fix loop to allow `next'

`do {} while(...)' loops in Perl don't support `next', actually :x
This only affects *BSD platforms with IO::KQueue installed.

Fixes: d6674af04cb74a4e "httpd|nntpd: avoid missed signal wakeups"
18 months agowww: viewvcs: display annotated tags as discreet objects
Eric Wong [Mon, 10 Oct 2022 21:34:22 +0000 (21:34 +0000)]
www: viewvcs: display annotated tags as discreet objects

This emphasizes annotated tags as their own object type in the
web UI while being able to link to the existing show_commit()
linkification and dfblob: search.

18 months agoxt/solver: skip on missing publicinbox.git.coderepo
Eric Wong [Mon, 10 Oct 2022 21:34:21 +0000 (21:34 +0000)]
xt/solver: skip on missing publicinbox.git.coderepo

Solver tests can never succeed without coderepos configured,
since that's the whole point of solver.  And improve the
original skip message to note that it's about the `git'
public-inbox, not `git' itself.

18 months agoviewvcs: avoid one ascii_html call
Eric Wong [Mon, 10 Oct 2022 21:34:20 +0000 (21:34 +0000)]
viewvcs: avoid one ascii_html call

We can reuse its result for the button text.

18 months agowww_coderepo: allow searching one extindex|inbox
Eric Wong [Sat, 8 Oct 2022 08:24:48 +0000 (08:24 +0000)]
www_coderepo: allow searching one extindex|inbox

I'm not sure how to best make a UI for one coderepo to many
inboxes/extindices, yet; but at least allow a simple 1:1
mapping, for now.  This ensures /$CODEREPO/$OID/s/ can work
as effectively as /$INBOX/$OID/s/ when looking for emails
associated with a git commit.

18 months agowww: cgit: fix fallback to WwwCoderepo on array responses
Eric Wong [Sat, 8 Oct 2022 08:24:47 +0000 (08:24 +0000)]
www: cgit: fix fallback to WwwCoderepo on array responses

For fast PSGI responses which don't require returning a coderef,
just reuse qspawn.wcb directly on the arrayref to avoid an undef
$wcb from firing in psgi_return_init_cb.

I only noticed this because the ViewVCS search form is broken
for /$CODEREPO/$OID/s/ endpoints at the moment.

18 months agowww_coderepo: update blurb on the goal/purpose of this
Eric Wong [Sat, 8 Oct 2022 08:24:46 +0000 (08:24 +0000)]
www_coderepo: update blurb on the goal/purpose of this

I think putting too much functionality in web services leads
to ignorance of local/offline tools, so this web UI will give
hints here and there for web users.  Things like diff options
can get expensive and become cache-unfriendly on the web server,
so promoting local tools can reduce overall network traffic
and server load.

18 months agowww_coderepo: wire up snapshots from summary
Eric Wong [Sat, 8 Oct 2022 08:24:45 +0000 (08:24 +0000)]
www_coderepo: wire up snapshots from summary

This also ensures we won't waste CPU cycles on snapshots
which aren't configured if somebody attempts them by
guessing URLs.