about summary refs log tree commit homepage
path: root/lib/PublicInbox/LeiRediff.pm
DateCommit message (Collapse)
2021-11-02lei <rediff|rm|tag>: stdin implies `-F eml'
These commands are usually run on a single message, so saving the user the trouble of typing `-F eml' on the command-line seems reasonable. I don't think commands like "index" and "import" will be too useful for single messages, though.
2021-11-02lei: simplify common LeiInput users with ->wq1_start
This method replaces a common pattern of starting workers, preparing internal auth ops, and asynchronous waiting of command completion. It also adds missing LeiAuth support to rediff and rm which rarely need auth.
2021-10-13treewide: use warn() or carp() instead of env->{psgi.errors}
Large chunks of our codebase and 3rd-party dependencies do not use ->{psgi.errors}, so trying to standardize on it was a fruitless endeavor. Since warn() and carp() are standard mechanism within Perl, just use that instead and simplify a bunch of existing code.
2021-10-13lei: use standard warn() in more places
warn() is easier to augment with context information, and frankly unavoidable in the presence of 3rd-party libraries we don't control.
2021-10-02lei mail-diff: diagnostic command to diff mail contents
This is useful in finding the cause of deduplication bugs, and possibly the cause of missing threads reported by Konstantin in <20211001130527.z7eivotlgqbgetzz@meerkat.local> usage: u=https://yhbt.net/lore/all/87czop5j33.fsf@tynnyri.adurom.net/raw lei mail-diff $u
2021-09-27lei rediff: add --drq and --dequote-only
More switches which can be useful for users who pipe from text editors. --drq can be helpful while writing patch review email replies, and perhaps --dequote-only, too.
2021-09-27lei rediff: quiet warnings from Import and Eml
lei rediff is expected to see partial patch fragments and such, so silence warnings when something isn't exactly a valid email message.
2021-09-06lei_auth: simplify users
There's no need to alias net_merge_all in each WQ class which uses LeiAuth, `$obj->$sub' works even when `$sub' is a fully-qualified subroutine name with `::' in it. perlobj(1) documents it under "Method Call Variations".
2021-09-03lei: ->child_error less error-prone
I was calling "child_error(1, ...)" in a few places where I meant to be calling "child_error(1 << 8, ...)" and inadvertantly triggering SIGHUP in script/lei. Since giving a zero exit code to child_error makes no sense, just allow falsy values to default to 1 << 8.
2021-08-11lei: attempt to canonicalize away "/../" pathnames
As documented, File::Spec->canonpath does not canonicalize "/../". While we want to do our best to preserve symlinks in pathnames, leaving "/../" can mislead our inotify|kqueue usage.
2021-06-08lei: generalize auxiliary WQ handling
op_wait_event is now more lei-specific since we no longer have to care about oneshot and use a synchronous loop. {ikw} (import-keywords) started a trend, but LeiPmdir (parallel Maildir) is an upcoming WQ class that will follow this idea. Eventually, {l2m} usage may be updated to follow this, too.
2021-05-30lei: support implicit stdin by default
This adds implicit stdin suppport for p2q and lcat, while rm and rediff no longer need explicit support for it.
2021-05-21lei rediff: fix construction of git-diff options
When generating git-diff options, lei-rediff extracts the single character option from the lei option spec. However, there's no check that the regular expression actually matches, leading to an unintentional git-diff option when there isn't a short option (e.g., --inter-hunk-context=1 maps to the invalid `git diff --color -w1'). Check for a match before trying to extract the single character option. Fixes: cf0c7ce3ce81b5c3 (lei rediff: regenerate diffs from stdin)
2021-05-06lei_rediff: reduce overhead of tmp store
We don't need Xapian positional info when searching for blob pre/post-images. Furthermore, rediff will usually be used for a single email or at most, one patchset. So there's little point in parallelizing or having multiple shards.
2021-05-05lei rediff: do not automatically store patches/mails
We can use a temporary lei/store to avoid cluttering up future search results. This is especially useful since we expect "lei rediff" to be useful for non-email diffs and individual attachments, too.
2021-05-05lei rediff: capture and regenerate file modes
Don't lose file mode information when regenerating a diff.
2021-05-05lei rediff: regenerate diffs from stdin
Sometimes a mailed patch is generated with non-ideal output, (lacking context, noisy whitespace changes, etc.), or a user wants to use the same external diff viewer they've configured git to use. Since we have SolverGit to regenerate arbitrary blobs from patches; this new command allows us to regenerate a diff with different options using the blobs SolverGit gives us. The amount of git-diff(1) options is mind numbing, so it's likely I missed some favorites or botched the getopt spec translation. This also fixes Inbox::base_url to check psgi.url_scheme before attempting to generate URLs and avoid uninitialized variable warnings. Oddly, the "lei blob" tests did not trigger these uninitialized warnings. Note: this will automatically import+index the message(s) it's regenerating, because solver relies on being able to lookup pre/postimage OIDs and read blobs.