aboutsummaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)AuthorFilesLines
2022-09-30ez: initial prep --compare-to implementationHEADmasterKonstantin Ryabitsev5-33/+86
It is useful to be able to see the difference between the version that you have previously sent and the current working branch. This is the initial implementation that can be further improved to allow passing range-diff options. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2022-09-28Fall back on user.email if sendemail.from not setKonstantin Ryabitsev1-0/+5
If we don't find a sendemail.from, then fall back to using user.email and hope for the best. Reported-by: Neil Armstrong <neil.armstrong@linaro.org> Link: https://msgid.link/eb5d38af-ed64-38fd-2515-e489120cbb0b@linaro.org Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2022-09-27docs: use double quotes for pipe_sepKonstantin Ryabitsev2-2/+2
Mutt treats single quotes and double quotes differently, and this configuration option requires double quotes. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2022-09-27mbox/am: add --stdin-line-sep optionKonstantin Ryabitsev7-4/+63
For all the good things it has going for it, mutt has some questionable design choices, like how it handles piping multiple messages. Instead of supporting a sensible option like "pipe as a valid mbox", it will instead simply concatenate all messages together. The only option is to tell mutt to use a $pipe_sep variable, but then the receiving end has to know which string was used. This change supports passing --stdin-line-sep to mbox/am/shazam commands. See docs for details. Suggested-by: Peter Zijlstra <peterz@infradead.org> Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2022-09-22ez: fix commit corruption on trailers -uKonstantin Ryabitsev1-1/+1
Fixes a regression introduced to b4 trailers due to the recent refactor. Fixes: 6c215d8347 (ez: don't send a cover letter for a 1-patch series) Reported-by: Dmitry Torokhov <dmitry.torokhov@gmail.com> Link: https://msgid.link/YyzW46WQ47HUKTSx@google.com Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2022-09-22ez: handle full 'Firstname Lastname <email>' parametersKonstantin Ryabitsev1-8/+11
Do the right thing in case we receive addresses with names via cmdline, e.g.: b4 send --to 'Firstname Lastname <first.last@example.com>' Reported-by: Dmitry Torokhov <dmitry.torokhov@gmail.com> Link: https://msgid.link/YyzPSrTcGliahL+a@google.com Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2022-09-22ez: don't send a cover letter for a 1-patch seriesKonstantin Ryabitsev3-86/+194
Change the behaviour of single-patch series. Instead of insisting on sending the cover letter, mix it into the patch itself by appending it to the below-the-cut portion of the patch. Suggested-by: Amjad Ouled-Ameur <aouledameur@baylibre.com> Link: https://msgid.link/3b1af982-83f1-d5ed-6df1-c654df481899@baylibre.com Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2022-09-22ez: generate patch with diffstatKonstantin Ryabitsev1-1/+2
When generating patches from commit range, add a diffstat for a fuller compatibility with the default git-format-patch behaviour. Reported-by: Guillaume Ranquet <granquet@baylibre.com> Link: https://msgid.link/CABnWg9uBOGqJMq=yCtn7SoEME=+2u1-ZK9ftb6=_jRhkhL_jiw@mail.gmail.com Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2022-09-20docs: fix patchwork documentationKonstantin Ryabitsev2-14/+15
The patchwork documentation was incorrect: 1. it was claiming that 0.9 supported patchwork 2. it was claiming that some settings had defaults This should fix both problems. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2022-09-20smtp: more fully implement sendemail cmdline compatibilityKonstantin Ryabitsev1-1/+12
Implement the sendmail cmdline compatibility similarly to how it is done by git-send-email. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2022-09-20Skip running smtp.quit to avoid checks for smtp serverKonstantin Ryabitsev1-1/+0
B4 is not a long-running process, so we don't need to explicitly close the smtp connection. This avoids the problem of checking if "smtp" is actually an external sendmail-compatible command. Reported-by: Leon Romanovsky <leon@kernel.org> Link: https://msgid.link/YymDlmJG8fNhvHSY@unreal Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2022-09-16Update master version to 0.11-devKonstantin Ryabitsev1-1/+1
Version 0.10.0 is out, time to dial this up to 11. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2022-09-16setup: update install_requiresKonstantin Ryabitsev1-4/+5
Update install_requires to match the latest supported versions and pull in git-filter-repo on default install. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2022-09-16trailers: add a trailers-ignore-from config optionKonstantin Ryabitsev4-3/+68
With bots frequently responding to patch submissions and providing a suggested trailer to include *once the problem is fixed*, give folks an option to ignore any trailers from certain email addresses via the trailers-ignore-from config setting. Suggested-by: Lucas De Marchi <lucas.demarchi@intel.com> Link: https://msgid.link/20220916163101.2ij6uznmymqvgklt@ldmartin-desk2.lan Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2022-09-16command: add a link to online documentationKonstantin Ryabitsev1-1/+2
Print a link to the online documentation on --help invocation. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2022-09-16docs: proofread and fixesKonstantin Ryabitsev10-104/+159
A slew of proofreading fixes to documentation. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2022-09-15man: add prep, send, trailers subcommandsKonstantin Ryabitsev2-149/+261
Also, trim the configuration section and just give a link to the online docs for it. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2022-09-15docs: --save-maildir is not available with shazamKonstantin Ryabitsev1-6/+6
Fix the section on commands available for both am and shazam. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2022-09-15docs: remove redundant "b4" from section titlesKonstantin Ryabitsev6-12/+12
We don't need to duplicate b4 on every maintainer subcommand document. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2022-09-15docs: add an admonition about existing PGP keysKonstantin Ryabitsev1-1/+7
Add a more visible note that generating a patatt key is not required if you already have a PGP key configured. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2022-09-15docs: add "available since" version numbersKonstantin Ryabitsev3-23/+34
Some features are only available in recent versions of b4, so mark those that are new to v0.8 and later. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2022-09-15README: link to online documentationKonstantin Ryabitsev1-40/+1
Remove outdated sections and link to online documentation at b4.docs.kernel.org. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2022-09-15docs: add some cross-referencesKonstantin Ryabitsev3-22/+46
Complete the configuration file section and add some cross-references where needed. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2022-09-15docs: add b4 trailers documentationKonstantin Ryabitsev1-1/+36
Completes the "ez" set of features added in 0.10. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2022-09-15docs: break out of infinite loopKonstantin Ryabitsev1-1/+1
Despite what it may seem sometimes, working on a series is not an infinite loop. :) Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2022-09-15docs: add the bulk of the b4 send documentationKonstantin Ryabitsev1-1/+222
Document most salient information about b4 send. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2022-09-15docs: add the bulk of documentation for b4 prepKonstantin Ryabitsev1-1/+245
This covers most of the workflow details for using b4 prep. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2022-09-14docs: add overview for the contributor sectionKonstantin Ryabitsev4-7/+76
The hope is to complete the rest tomorrow so we can plan version 0.10.0 release some time in the next short while. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2022-09-14docs: complete most of the maintainer docsKonstantin Ryabitsev10-16/+316
Some of the articles are still barely more than stubs, but it's better than nothing at all. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2022-09-14docs: document b4 am/shazam optionsKonstantin Ryabitsev3-50/+218
Add documentation for b4 am and b4 shazam. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2022-09-13docs: add more docs for configuration optionsKonstantin Ryabitsev3-90/+316
Still lots to do, but we'll have good docs at the end of this. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2022-09-13Improve worktree-default configuration loadingKonstantin Ryabitsev2-13/+22
If we find a ~/.b4-config, we load it up before parsing any other configuration values we find. This allows us to override any worktree defaults by user-specific settings. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2022-09-13Improve the web endpoint validity checkKonstantin Ryabitsev2-3/+3
Check that it actually starts with https://. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2022-09-13Only accept web urls as valid endpointsKonstantin Ryabitsev3-5/+14
With .b4-config being able to specify endpoint defaults, allow users to override it in their local configuration by setting send-endpoint-web to "no" (or any other non-URL string). Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2022-09-13Don't crash on DKIM resolver failuresKonstantin Ryabitsev1-2/+9
There are many different exceptions thrown by the DKIM dns resolver, so we can't possibly expect and catch them all cleanly. Do a blanket try/catch for anything that bubbles up and mark DKIM as failed when that happens. Reported-by: Mark Brown <broonie@kernel.org> Link: https://msgid.link/Yx8kXFRXB0chuYkL@sirena.org.uk Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2022-09-12Add toplevel .b4-config for b4 itselfKonstantin Ryabitsev1-0/+4
Folks who want to be able to contribute patches should be able to do it with b4 itself. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2022-09-12Allow defining in-tree .b4-config for send- parametersKonstantin Ryabitsev1-5/+22
We want to be able to allow projects using b4 for patch submission to define some toplevel parameters, such as where to send the series, or which endpoint to use. We only use this for b4.send- options, and for now don't override anything set in any other config files. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2022-09-12ez: fix crash on send-series-to/cc defined in configKonstantin Ryabitsev1-1/+1
Fixes a bug that caused wrong entries in the extra trailers list. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2022-09-12ez: modify default template to move trailers below commentsKonstantin Ryabitsev1-3/+3
The comments are throwing off our trailer parsing, so move the trailers below the comments describing how to use trailers. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2022-09-12ez: auto-populate To: and Cc: trailers at prep timeKonstantin Ryabitsev3-71/+164
Instead of running tocmd and cccmd at send-time, move it to the prep stage and store the results in the cover letter. This will allow developers to finecomb where the series should be sent. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2022-09-12ez: split --no-auto-to-cc into two commandsKonstantin Ryabitsev2-12/+14
Initial work on making the automatic addressee selection a bit more robust. I am not sure this is going quite the right way, but I wanted to make a point where we can go back to in case things go down the wrong path. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2022-09-08docs: reorder, add some more stubs, and some contentKonstantin Ryabitsev6-10/+277
I was going to write a lot more today, but *gestures widely at everything*. Hopefully, more to come tomorrow. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2022-09-07docs: add installation instructionsKonstantin Ryabitsev1-1/+67
Largely, this mirrors the README, but provides more information about installing and upgrading from pip vs. using the git checkout directly. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2022-09-07docs: add stubs for subtopicsKonstantin Ryabitsev13-3/+84
Mostly, I want to make sure that readthedocs is building things correctly. Actual documentation shortly forthcoming. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2022-09-07docs: create sphinx docs stubKonstantin Ryabitsev2-0/+12
The goal is to build it via github/rtd integration, so get a stub going so we can test that setup. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2022-09-07ez: add prep --manual-reroll COVER_MSGIDKonstantin Ryabitsev3-20/+40
For folks who prefer to do the actual sending using git-send-email or any other mechanism, provide a way to trigger the reroll magic manually. Suggested-by: Dmitry Torokhov <dmitry.torokhov@gmail.com> Link: https://msgid.link/Yxecq5DHE5oW0XJD@google.com Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2022-09-06Fix pr explode functionalityKonstantin Ryabitsev2-86/+55
I don't believe anything actually uses it, but it needed to be fixed anyway. I still might use it as part of the git pull archiving service. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2022-09-02Fix dedupe on using cached threadsKonstantin Ryabitsev1-5/+12
We were not properly running dedupe on cached threads, so fix it by only caching post-dedupe messages. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2022-09-01mbox: accept arbitrary public-inbox URLsKonstantin Ryabitsev1-1/+7
When "b4 am" or "b4 mbox" is passed an arbitrary URL that matches a public-inbox scheme but that doesn't match the midmask URL, assume the user knows what they are doing and attempt to retrieve the mbox. Suggested-by: Philippe Blain <levraiphilippeblain@gmail.com> Link: https://msgid.link/f2b0f3c1-d98d-979d-1513-18f2491f4267@gmail.com Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2022-09-01trailers: improve debugging of mismatched trailersKonstantin Ryabitsev1-4/+5
When we're adding a mismatched trailer, tell us why it hasn't been accepted. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2022-09-01Fix regression that resulted in ignored -pKonstantin Ryabitsev1-1/+1
Looks like at some point we started ignoring the -p flag, so restore this to the expected functionality Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2022-09-01ez: add b4 -F to allow (re-)creating branches from threadsKonstantin Ryabitsev3-37/+153
It is now possible to create a b4-tracked branch from an arbitrary thread (or from a previously sent b4-tracked series): b4 prep -F [msgid-of-the-series] Example: $ b4 prep -F 20220901194310.115427-1-tony.luck@intel.com Grabbing thread from lore.kernel.org/all/20220901194310.115427-1-tony.luck%40intel.com/t.mbox.gz Checking attestation on all messages, may take a moment... --- ✓ [PATCH 1/3] EDAC/skx_common: Use driver decoder first ✓ [PATCH 2/3] EDAC/skx_common: Make output format similar ✓ [PATCH 3/3] EDAC/i10nm: Add driver decoder for Ice Lake and Tremont CPUs --- ✓ Signed: DKIM/intel.com --- Created new branch b4/edac_improve_memory Applying 3 patches --- Applying: EDAC/skx_common: Use driver decoder first Applying: EDAC/skx_common: Make output format similar Applying: EDAC/i10nm: Add driver decoder for Ice Lake and Tremont CPUs --- NOTE: any follow-up trailers were ignored; apply them with b4 trailers -u This makes it easier to start tracking pre-existing series with b4 prep. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2022-09-01tests: test partial reroll correctnessKonstantin Ryabitsev3-0/+221
When rerolling partial series, check that the trailers are applied correctly. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2022-09-01send-receive: don't keep db connections open for longKonstantin Ryabitsev1-1/+3
We expect to be mostly sitting idle, so close any pooled db connections after 5 minutes of inactivity. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2022-09-01trailers: ignore non-recognized link trailersKonstantin Ryabitsev1-0/+3
If a link contains a '@', we wrongly consider it a person-trailer. Ignore any URL-containing trailers that we don't explicitly recognize. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2022-08-31trailers: ignore merges when looking at the commit logKonstantin Ryabitsev1-1/+1
When finding the range of most recent commits for b4 trailers -u, ignore any merge commits. Reported-by: Vishal Verma <vishal@kernel.org> Link: https://msgid.link/2517d5cdff57048a13e85b9604957b73b69724c3.camel@kernel.org Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2022-08-31send-receive: close connections once we're doneKonstantin Ryabitsev1-0/+7
As opposed to b4 itself, this is a long-running process, so we need to remember to close connections after we're done with them as opposed to them automatically getting cleaned up on b4 exit. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2022-08-31Fix regression with b4 trailers -uKonstantin Ryabitsev2-8/+7
Fixes regression introduced by trailers refactor. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2022-08-31Fix regression incorrectly reporting mismatchesKonstantin Ryabitsev1-1/+2
Add a missing continue that caused incorrectly reported trailer mismatches. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2022-08-31Refactor how we handle trailersKonstantin Ryabitsev21-153/+1112
With the addition of b4 trailers it became pretty obvious that the way we originally implemented trailers didn't age well. This refactor does the following: - introduces LoreTrailer class to replace passing trailers as tuples - reimplements trailer-order with strict adherence to chain-of-custody rules - adds tests to most common trailer follow-up/ordering cases Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2022-08-30ez: reimplement --resendKonstantin Ryabitsev2-90/+170
Instead of --resend just being a flag to add a RESEND prefix, allow us to actually resend a previously sent series using the tag we have applied and stored in sent/. E.g. if we have previously sent a v2, thus automatically rerolling a v3, we can resend a v2 again without needing to do anything else by using: b4 send --resend v2 alternatively, we can use a full tag name: b4 send --resend sent/some-series-topic-v2 Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2022-08-30Implement sending mail via local commandKonstantin Ryabitsev2-11/+30
The git-send-email configuration allows smtpserver to be defined as a path to a local sendmail-like command. Implement the same logic in b4, allowing fuller compatibility with git-send-email. Suggested-by: Maxime Ripard <maxime@cerno.tech> Link: https://msgid.link/20220830122217.h52zswusnlb3iggq@meerkat.local Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2022-08-29Improve sendemail identity handlingKonstantin Ryabitsev1-2/+5
The sendemail sections are supposed to be fall-throughs where a named section overrides the values provided by the global section. This implements the required logic to be compliant with git. Suggested-by: Rob Herring <robh@kernel.org> Link: https://msgid.link/20220825182506.1449442-1-robh@kernel.org Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2022-08-29ez: Fix adding 'RESEND' to patch subjectRob Herring1-1/+1
If --resend option is given, the 'RESEND' prefix is not added to the patch subject(s). This is because the original command line prefix list is passed rather than the modified prefix list. Signed-off-by: Rob Herring <robh@kernel.org> Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2022-08-29Force CRLF lineseps only right before sending via smtpKonstantin Ryabitsev1-2/+2
We could be sending the patches via a web endpoint, for which we don't need to force CRLF line endings. Convert into CRLF only immediately before sending the message out via smtp. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2022-08-29send-receive: improve logging and returned errorsKonstantin Ryabitsev2-84/+171
Adds file logging, improves errors returned to the client, and makes templates more easily configurable via the config file. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2022-08-24setup.py: bump python_requires to 3.8Philippe Blain1-1/+1
Since c95e4d1 (am: Fix broken guessbranch handling, 2022-03-31), b4 uses the 'extend' action for the '--guess-branch' argument. This action is new in Python 3.8 [1], but setup.py still lists Python 3.6 as the minimum version. This leads Pip to allow installing or upgrading b4 on Python 3.6 or 3.7, but then any invocation of b4 fails with an error from the argparse module ending with: ValueError: unknown action "extend" Fix this by bumping python_requires to 3.8. [1] https://docs.python.org/3/library/argparse.html#action Signed-off-by: Philippe Blain <levraiphilippeblain@gmail.com> Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2022-08-23send-receive: add support for writing to public-inboxKonstantin Ryabitsev1-20/+47
Implement writing to public-inbox repositories using the ezpi library. This allows us to store messages as-is before we do any mangling for From/Reply-to. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2022-08-23ez: move the RESEND prefix into --resend switchKonstantin Ryabitsev3-23/+33
For UX reasons, make --resend a separate switch instead of operating on the --prefixes RESEND logic. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2022-08-23ez: only use web endpoint when sending patchesKonstantin Ryabitsev3-6/+8
Force the use of smtp server when sending anything other than patches (e.g. b4 ty automated responses). Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2022-08-23send-receive: add some anti-spam protectionsKonstantin Ryabitsev1-9/+45
The goal of this service is to accept and send patches, nothing else. It's not a replacement for an SMTP server, just a replacement for really terrible SMTP servers that mangle patches. So, add some anti-spam protections: - only accept email that looks like patches or cover letters - don't accept anything other than text/plain mail - require that one of the to/cc addresses matches a predefined list of recognized mailing lists Not a guarantee that this service won't get abused, but it's a start to make sure that it won't be quite as tasty of a target. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2022-08-22ez: allow defining commands for getting To: and Cc: addressesKonstantin Ryabitsev1-5/+11
We will still use get_maintainer.pl if we find it, but it is now possible to override it with send-auto-to-cmd and send-auto-cc-cmd config values. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2022-08-22ez: allow passing --since to b4 trailersKonstantin Ryabitsev2-9/+8
Reduce the default range to 1.month and allow overriding with other values when trying to update trailers from arbitrary ML threads. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2022-08-22Update patatt to 0.6.0 and up version in requirements.txtKonstantin Ryabitsev2-1/+1
Patatt-0.6.0 is out and we need it for the current version of b4. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2022-08-19ez: fix logic error when using arbitrary threads for trailer updatesKonstantin Ryabitsev1-4/+5
Fixes a logic error that was picking the wrong starting commit in the "most recent contiguous range of our commits". Reported-by: Conor Dooley <conor.dooley@microchip.com> Link: https://msgid.link/e2ca58f1-3c10-0dc6-ebdb-3ca088b430d7@conchuod.ie Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2022-08-19ez: implement large chunk of web endpoint submissionKonstantin Ryabitsev5-96/+381
This implements most of the web endpoint submission functionality. Completely undocumented and needs a lot more testing before it's useful, but we're getting close. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2022-08-19Update patatt to latest upstreamKonstantin Ryabitsev1-0/+0
Fixes a bug with \r\n and \n endings that we're hitting. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2022-08-17ez: initial rework of web submission endpointKonstantin Ryabitsev4-122/+245
Reimplement initial enrolment with the web submission endpoint. A lot more work is required before this is useful, but we're at least able to authenticate received messages. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2022-08-16ez: support enrolling branches using tagsKonstantin Ryabitsev2-35/+84
Allow using tags when enrolling branches instead of only allowing branch names. In fact, with the default "commit" strategy we can even enroll using something like HEAD~3, but that's not recommended for newbies -- just pass the branch name. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2022-08-15ez: do not bail on untracked files for prep tasksKonstantin Ryabitsev1-1/+3
We're not going to care about untracked files for most of b4 prep operations, so don't error out when they are present and we're running "is the tree clean" checks. Suggested-by: Maxime Ripard <maxime@cerno.tech> Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2022-08-08ez: chdir to toplevel when running get_maintainerKonstantin Ryabitsev2-2/+15
The scripts expect to be running from the toplevel directory, so make sure to switch back to git topdir before running get_maintainer.pl Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2022-07-28ez: fix regression when running b4 trailersKonstantin Ryabitsev1-0/+2
Do not crash when one of the msgs is a None (usually, the cover commit). Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2022-07-28ez: minor fixes to logic and outputKonstantin Ryabitsev1-2/+2
Fixes a logical problem where we showed duplicate addresses in the list, and unwraps headers before we print them out. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2022-07-28ez: fix typos on logger callsKonstantin Ryabitsev1-2/+2
Fixes types in logger calls. Reported-by: Maxime Ripard <maxime@cerno.tech> Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2022-07-27ez: tell us where we got current strategyKonstantin Ryabitsev1-0/+1
When getting strategy from branch configs, tell us that it's where it came from. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2022-07-27ez: implement tip-commit strategyKonstantin Ryabitsev2-36/+69
First go at implementing the tip-commit strategy. It shares a lot with the 'commit' strategy, but there are gotchas for situations where the cover letter commit is suddenly not the tip commit any more (rebase, new commits, etc). Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2022-07-27ez: implement enrolling branches with commit strategyKonstantin Ryabitsev1-19/+40
It's a bit scary to hard-reset the branch and then cherry-pick the range over it, but it should be working reliably in the vast majority of cases. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2022-07-27ez: record cover strategy on branch creation/enrollmentKonstantin Ryabitsev1-4/+8
Just in case someone desides to switch the global cover strategy to something else, record the current branch strategy as part of the branch config. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2022-07-27ez: some cleanups and error handling for revision taggingKonstantin Ryabitsev1-44/+51
Handle some of the potential errors that could come up when tagging historical versions. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2022-07-26ez: another overhaul of commands and flagsKonstantin Ryabitsev3-128/+168
Another, hopefully final overhaul of commands and flags: - "b4 ez-series" is now "b4 prep" - "b4 ez-trailers" is now "b4 trailers" - "b4 ez-send" is now "b4 send" I've also split on-disk output into two different commands: b4 prep --format-patch <outdir>: does not set To/Cc and doesn't do any From magic. In effect, it's as close as it gets to git format-patch output compatibility. b4 send --dry-run -o <outdir>: generates the messages exactly as they are about to be sent, then writes them out to the directory specified. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2022-07-26ez-send: fix To: inclusion and address collectionKonstantin Ryabitsev2-2/+7
Fix a logic bug that prevented the To: header from being added on --dry-run and do a better job making sure the addresses are valid and sane. Reported-by: Mattijs Korpershoek <mkorpershoek@baylibre.com> Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2022-07-25ez-send: initial support for tagging sent revisionsKonstantin Ryabitsev1-1/+49
After we sent off the revision, create the structure in the tree that would allow us to go back to that revision regardless of what changes we make to the working branch. This is tricky for the default "commit" strategy, because we want to remove the cover letter from the history and store its final version in the tag applied to the tip commit. For this, we create a detached head, cherry-pick the range without the cover, and then tag the resulting detached head. Future work will make it possible to prep and send these as pull requests. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2022-07-22Fix regression introduced by ez-trailers workKonstantin Ryabitsev1-1/+2
I need to refactor the entire approach to trailers so we stop passing around tuples. It made sense at the time, but now it's just a source of bugs. Reported-by: Mark Brown <broonie@kernel.org> Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2022-07-22ez: bail on unknown cover letter strategyKonstantin Ryabitsev1-1/+10
We currently only support "commit" and "branch-description" strategies. Two more may be implemented in the future, but I need to figure out if commit reordering can be done with git-filter-repo or not. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2022-07-20ez-send: don't wrap headers in format-patch modeKonstantin Ryabitsev1-7/+7
When writing out message in format-patch compatibility mode, do not wrap headers, otherwise checkpatch or git-send-email may complain. Reported-by: Sudeep Holla <sudeep.holla@arm.com> Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2022-07-20ez-send: give ability to bail out before sendingKonstantin Ryabitsev1-1/+28
Just in case something got screwed up, give folks an overview of what will be sent and ability to bail out before sending things off. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2022-07-20ez-send: don't auto-increment revision on RESENDKonstantin Ryabitsev1-0/+5
If one of the previxes is RESEND, then we don't auto-increment revision. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2022-07-20ez-series: add --show-revision and --force-revisionKonstantin Ryabitsev2-1/+30
Show current revision with --show-revision and allow setting it to an arbitrary integer using --force-revision. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2022-07-20ez-trailers: fix regression when applying trailersKonstantin Ryabitsev1-1/+1
We were wrongly triggering trailer updates when there were, in fact, no outstanding trailer updates to apply. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2022-07-20ez: refactor based on initial feedbackKonstantin Ryabitsev3-215/+421
Significant refactor of (formerly) "b4 submit" based on initial feedback: 1. Split "b4 submit" into three different commands: - ez-series: for managing the series cover letters, tracking info, etc - ez-trailers: for retrieving trailers and updating commits (works on any branch, not just ez-series branches) - ez-send: for sending branches managed by ez-series 2. Refactor to support multiple cover letter strategies: - the default "commit" strategy that keeps the cover letter in an empty commit (should be backwards-compatible with "b4 submit") - the non-invasive "branch-description" strategy that keeps the cover letter in the branch.branchname.description configuration setting and tracking in branch.branchname.b4-tracking - the not-yet-implemented "tag" strategy that mimics the behaviour of git-publish The strategy can be set via b4.ez-cover-strategy variable, e.g. in your .gitconfig: [b4] ez-cover-strategy = branch-description Note, that converting from one strategy to another doesn't work and will probably explode in weird ways right now. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2022-07-19submit: compress tracking data in the headerKonstantin Ryabitsev1-2/+4
Reduce the size of the X-b4-tracking header by gzip-compressing the json output before base64-ing it. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2022-07-19submit: reverse order returned by rev-listKonstantin Ryabitsev1-1/+1
git-rev-list returns patches in reverse chronological order by default, which is the opposite of what we need. Add a --reverse to the call to get the expected behaviour. Reported-by: Mattijs Korpershoek <mkorpershoek@baylibre.com> Link: https://lore.kernel.org/tools/87ilnti947.fsf@baylibre.com/ Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2022-07-18submit: store tracking info in the cover letter headerKonstantin Ryabitsev1-1/+7
Stick tracking info into the special header of the cover letter, which should allow us to fully recreate the branch from lore. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2022-07-16submit: fix signed-off-by logic in --update-trailersKonstantin Ryabitsev1-34/+42
We weren't quite doing the right thing when --update-trailers was used with --signoff, so this should fix the behaviour and the output. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2022-07-15Fixes when working with utf-8 contentKonstantin Ryabitsev2-4/+10
When using set_payload(), we should pass along the charset as well, otherwise we run into trouble when converting to/from bytes again. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2022-07-15Initial implementation of b4 submitKonstantin Ryabitsev9-213/+1427
This is the first rough implementation of "b4 submit". Currently implemented: - b4 submit --new : to start a new branch - b4 submit --edit-cover : to edit the cover message - b4 submit --update-trailers : to receive latest trailer updates from the mailing lists - b4 submit --send : sends the messages using existing git.sendemail configs For details, see "b4 submit --help". Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2022-06-27Ignore non-ascii follow-up trailersKonstantin Ryabitsev1-0/+3
The trailer *names* should always be ascii. While it is possible to imagine that some project would have non-ascii trailer names like: Signalé-par: Developpeur Un <d1@example.com> Co-développé-avec: Developpeur Deux <d2@example.com> Nonetheless, I am not aware of any project doing this, and this allows us to weed out a bunch of false-positives from bad forwards. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2022-06-27Move Signed-off-by below Link trailer when running with -slKonstantin Ryabitsev1-2/+2
Chain-of-custody order requires that Signed-off-by closes the list of added trailers. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2022-06-27Remove support for trailer-orderKonstantin Ryabitsev5-72/+33
Per discussion on the mailing lists, reordering trailers is almost never the right decision, so remove support for trailer ordering completely. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2022-06-27Remove "b4 attest" subcommandKonstantin Ryabitsev4-99/+0
We've deprecated "b4 attest" two versions ago, so remove it completely now. Everyone should use "patatt attest" instead. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2022-06-21Dedupe msgid listKonstantin Ryabitsev1-0/+4
We don't want to use the set() here, since we want to preserve the order, so use an auxiliary set for dupe tracking. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2022-06-21Remove stray print()Konstantin Ryabitsev1-1/+0
Yes, I debug with print(). Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2022-06-21Initial patchwork integration supportKonstantin Ryabitsev5-6/+124
A lot of maintainers use patchwork alongside b4, to make it easier to track patches and rely on some CI integration. This commit adds some basic patchwork integration: - on "b4 am", "b4 shazam", "b4 pr" we will mark the relevant patchwork entries as "Under Review" - on "b4 ty" we can set these patches as "Accepted" - on "b4 ty -d" we can set them as "Deferred" To make it work, the following entries must be present in the repository used with b4: [b4] pw-key = (your API token) pw-url = https://patchwork.kernel.org pw-project = (your project, e.g. linux-usb) pw-review-state = under-review pw-accept-state = accepted pw-discard-state = deferred To get your patchwork API token, go to your patchwork profile page. The pw-accept-state and pw-discard-state can be overridden using the --pw-set-state flag to "b4 ty". E.g. if you wanted to mark the patches as "Not applicable": b4 ty -d 5 --pw-set-state not-applicable Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2022-06-17Prepare for 0.9.0 releasev0.9.0Konstantin Ryabitsev3-9/+9
It is time to roll out 0.9.0 for wider use. Update requirements to the latest supported and tested versions. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2022-06-17Remove EXPERIMENTAL from attestation supportKonstantin Ryabitsev1-2/+2
We've been using patch attestation for over a year now, so remove the EXPERIMENTAL claim -- it's no more experimental by this point than the rest of b4. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2022-06-17Update patatt submodule to v0.5.0Konstantin Ryabitsev1-0/+0
Patatt-0.5.0 is out, so update our submodule info. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2022-06-17Add ability to exit before git-merge is invokedKonstantin Ryabitsev4-11/+80
It may be useful for the maintainer to review b4 retrieval/validation output before git-merge is invoked, so add a pause requiring an Enter or Ctrl-C. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2022-06-16Implement "b4 shazam -M" that execs git-mergeKonstantin Ryabitsev4-49/+115
In addition to just being able to fetch a series into FETCH_HEAD, also add an option to exec git-merge automatically so that people don't have to cut-and-paste the merge command to use with paths to the cover letter. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2022-06-16Add a note about proxying requestsKonstantin Ryabitsev2-20/+37
Proxying requests is possible via the HTTPS_PROXY env variable, so make a note of that in the manpage. Suggested-by: David Vernet <void@manifault.com> Link: https://lore.kernel.org/tools/20220218153128.914071-1-void@manifault.com Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2022-06-16Allow breaking threads using --no-parentKonstantin Ryabitsev5-112/+250
It is a common request to be able to get a partial thread in case someone submitted an auxiliary standalone patch in the middle of a larger patch series. Passing the msgid of the start of the thread along with --no-parent should tell b4 to break the thread at the start of the message-id specified and only consider that message and its children. Suggested-by: Mark Brown <broonie@kernel.org> Link: https://lore.kernel.org/tools/YpTI9lhCfA7shi6j@sirena.org.uk/ Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2022-06-15Cosmetic cleanups to make PyCharm happierKonstantin Ryabitsev3-16/+16
Minor nitpicking by PyCharm, but not completely unreasonable. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2022-06-15Improve identity matching for DKIMKonstantin Ryabitsev1-1/+4
Sometimes the DKIM record will have the full email address instead of just the @domainname.com part. For those cases, drop the local part so we don't falsely claim domain mismatching during b4-am runs. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2022-06-14Lowercase identities for comparisonKonstantin Ryabitsev1-3/+3
When performing attestor identity comparisons, lowercase email addresses and domain names for case-insensitive matching. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2022-06-14am: Fix broken guessbranch handlingRob Herring2-3/+3
b4's usage of git-log '--branches' option is broken. The option takes a glob pattern *only* and must have an '=', but b4 ends up passing '--branches <guessbranch>' to git-log. This will kind of work, but is not checking only 'guessbranch'. For example, these 3 commands all do something different: git log -1 --branches=master git log -1 --branches master git log -1 --branches=*aster A maintainer wanting to apply a patch or series likely has a small set of known branches they apply patches to. Using a glob pattern is not a good fit for that. Instead, allow --guess-branch to be repeated and to take fixed refs. Signed-off-by: Rob Herring <robh@kernel.org> Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org> Link: https://lore.kernel.org/r/20220331195346.1384515-1-robh@kernel.org
2022-06-14Remove unnecessary lookup when /all/ is used in midmaskKonstantin Ryabitsev1-4/+13
On lore.kernel.org we provide a unified index of all mailing lists in /all/, which removes the need to perform a redirect lookup when querying by message-id. However, some public-inbox instances may not have that, so we still need to be able to fall back to that redirect lookup. Adapt a patch from Rob Herring to support both situations. Link: https://lore.kernel.org/tools/20220225031135.4136158-1-robh@kernel.org/ Suggested-by: Rob Herring <robh@kernel.org> Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2022-06-14Update patatt to latestKonstantin Ryabitsev1-0/+0
This will soon become patatt-0.5.0, so start using it in our daily tests. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2022-03-30Add support for mailmap and excluding mail in b4-tyKonstantin Ryabitsev3-12/+62
With codeaurora.org accounts no longer accepting mail, add support to exclude addresses when generating b4-ty mail. Additionally, support mailmap replacements by running every address through "git check-mailmap". Requested-by: Mark Brown <broonie@kernel.org> Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2022-02-01Allow whitespace at the start of non-wrapped trailersKonstantin Ryabitsev1-1/+1
Sometimes folks indent their trailers with whitespace, so relax the rules to recognize this situation. In theory, this shouldn't introduce false-positives. Suggested-by: Rob Herring <robh@kernel.org> Link: https://lore.kernel.org/r/20211214214327.4003631-1-robh@kernel.org Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2021-11-02Reimplement unicode control character logicKonstantin Ryabitsev1-29/+25
Instead of hardcoding the logic to bail at all presence of control characters, soften it a bit to only error out when we see the presence of Cfs in the absence of any other character from a non-latin character set in the same line. Additionally, show exactly where the Cfs were found when printing out the error message. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2021-11-01mbox: initial support to check for unicode control charsKonstantin Ryabitsev3-5/+40
Implement initial support for checking if the patch message contains unicode control characters that can be used to trick code reviewer into accepting maliciously formatted code. Link: https://lore.kernel.org/tools/20211101175020.5r4cwmy4qppi7dis@meerkat.local/ Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2021-11-01ty: fix problems with smtplib and 8BITMIMEKonstantin Ryabitsev2-8/+19
There appears to be a bug in smtplib that doesn't properly support 8-bit content even when upstream SMTP gateway supports 8BITMIME (they all do, it's not 90s any more). Work around this by passing the message payload as bytes instead of string. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2021-10-20ty: fix bugs introduced when switching -s to -tKonstantin Ryabitsev2-4/+4
Test out and fix the bugs introduced by switching flags. Reported-by: Jens Axboe <axboe@kernel.dk> Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2021-10-20ty: document flag changesKonstantin Ryabitsev2-10/+49
We've replaced "b4 ty -s" with "b4 ty -t" to better disambiguate it from "b4 -S" which does the actual mail sending. This commit documents this change, plus adds -S,--send-email and --dry-run flags. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2021-10-20shazam: change default behaviour to be "apply-here"Konstantin Ryabitsev2-7/+9
Based on the feedback, change the default behaviour of "b4 shazam" to apply patches to the current tree instead of doing FETCH_HEAD magic. This is still available when used with -H,--make-fetch-head flag. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2021-10-19Initial implementation of native mail sendingKonstantin Ryabitsev3-30/+125
I'm felling comfortable that "b4 ty" is sufficiently mature at this point to implement sending thank-yous directly. This is only the initial implementation that covers only the very basic parts of git's sendemail configuration options, but this should actually cover 90% of cases if not more. One important caveat -- I moved the "b4 ty -s" flag to be "b4 ty -t" in order to disambiguate it from the capital -S (that actually does the sending). Since "b4 ty" is still marked as an experimental feature, I feel we can do this without much impact. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2021-10-19Fix shazam for multiple git worktreesRob Herring1-5/+15
The shazam command makes assumptions that '.git' is a directory which is not the case with multiple worktree. Use 'git rev-parse' instead to retrieve the correct paths. Signed-off-by: Rob Herring <robh@kernel.org> Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org> Link: https://lore.kernel.org/r/20211019144600.225058-1-robh@kernel.org
2021-10-07validate: Use patatt's configured keyring as fallbackKees Cook1-1/+5
If b4 doesn't have an explicit keyringsrc configured, attempt to fetch it from patatt configuration instead. This avoids some very confusing situations where patatt would validate and b4 would reject. (I had an expired pubkey in my gpg default keyring, but the same pubkey had an updated expiration date in patatt's keyring.) Signed-off-by: Kees Cook <keescook@chromium.org> Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org> Link: https://lore.kernel.org/r/20211007165551.2312946-1-keescook@chromium.org
2021-10-07Add keyring key for keescookKonstantin Ryabitsev1-0/+1295
Add Keys Cook's key to the repo keyring, since he's sending lots of patches lately. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2021-09-30shazam: document template usage in manpageKonstantin Ryabitsev2-5/+18
The flags and functionality of shazam may still change, so not documenting the rest of the usage yet. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2021-09-30shazam: implement custom merge message templatesKonstantin Ryabitsev4-31/+79
Allow people to set up their own preferred merge templates, using the netdev standard as default. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2021-09-29shazam: implement better merging stringsKonstantin Ryabitsev1-0/+32
b4 shazam will now: 1. give you a better default message for merging FETCH_HEAD 2. reuse the conver letter for the merge message, giving you the example invocation for using it Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2021-09-29shazam: allow configuring "git am" flagsKonstantin Ryabitsev1-2/+6
Setting b4.git-am-flags should allow you to specify what additional flags to pass to "git am" before shazaming a bunch of patches on to the current branch. Example entry in ~/.gitconfig [b4] git-am-flags = -s Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2021-09-24am/shazam: Restore thank-you recordingKees Cook1-0/+3
After the shazam refactoring, the thank-you recording went missing from both the "b4 shazam -A" and "b4 am" workflows. Restore the calls. Signed-off-by: Kees Cook <keescook@chromium.org> Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2021-09-21Simplify sparse worktree preparationKonstantin Ryabitsev1-8/+2
Looks like we don't need to have the files in place to run "git am", so skip that step and just init the sparsest possible tree. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2021-09-21Add "b4 shazam" that is like b4 am + git amKonstantin Ryabitsev3-124/+210
By popular demand, provide a way to apply series straight to a git repository. By default, we're still going the safest possible route: - create a sparse worktree consisting just of the files being modified - run "git am" against the temporary worktree - if "git am" went well, fetch from the temporary worktree into our current tree and leave everything in FETCH_HEAD - unless we're running "b4 shazam -A" in which case we just apply to the current HEAD (exact equivalent of b4 am -o- | git am) Further changes to come based on feedback. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2021-09-01Up version to 0.8.0 and prep for relasev0.8.0Konstantin Ryabitsev3-4/+4
New version of lore.kernel.org is live today, so release the version of b4 that works best with it. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2021-08-25Normalize linebreaks when reconstituting bodyKonstantin Ryabitsev1-5/+3
When generating am-ready patch series, separate each standard body part with a single pair of newlines regardless of how many the original message contained. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2021-08-18Document listid-preference config parameterKonstantin Ryabitsev2-0/+14
When we query /all/, we often get duplicates if a message was crossposted to multiple lists and some of those lists altered the message subject/body (e.g. legacy mailman, groups.io, etc). The listid-preference parameter allows us to dedupe based on lists that are least likely to mangle the messages. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2021-08-18Missed backfill call cleanupKonstantin Ryabitsev1-8/+2
We no longer support backfilling (obsolete), so remove it from all places where it's used. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2021-08-18Remove kludges that were needed before /all/Konstantin Ryabitsev2-82/+13
Extindex allows us to get rid of a couple of kludges: - we no longer need to manually backfill, as /all/ contains all sources - we can just query /all/ for new series Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2021-08-17Filter duplicate results when querying new seriesKonstantin Ryabitsev1-0/+5
When querying against /all/, we may get multiple hits for the same subject, so deal with it early. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2021-08-17Move dedupe code into central locationKonstantin Ryabitsev1-28/+36
We want to dedupe all threads we retrieve from public-inbox, so do this in the central place instead of only when doing get_strict_tread(). Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2021-08-17Reimplement deduping based on list-id preferenceKonstantin Ryabitsev1-9/+39
Instead of relying on DKIM validation, use list-id preference when dealing with multiple messages matching the same message-id. We may end up adding an attestation check to it as well in the future. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2021-08-16When deduping, prefer DKIM-validating messagesKonstantin Ryabitsev1-9/+13
With newer lore.kernel.org and /all/, we get duplicate messages when message bodies are different due to one of the messages passing through a DKIM-compliant list, and another one through something that injects in-body or in-subject junk. When dealing with duplicates, check both for DKIM status and prefer the message that actually passes DKIM validation. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2021-08-05Handle decoding incorrectly encoded headersKonstantin Ryabitsev1-1/+1
Sometimes the encoding indicated in the header lies and it's not actualy that codepage at all. When that happens, just replace errors and continue. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2021-08-03Parse just headers when extracting message ID from stdin mboxKyle Meyer1-1/+3
When the mbox and am subcommands grab a message ID from the mbox on stdin, they call message_from_bytes(), which in turn calls BytesParser().parsebytes(s). parsebytes() has a headersonly parameter that can be used to tell it to stop parsing after reading the headers. The headers are all that's needed here, so use BytesParser directly and set headersonly. Signed-off-by: Kyle Meyer <kyle@kyleam.com> Link: https://lore.kernel.org/tools/20210717164836-mutt-send-email-mst@kernel.org/ Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2021-08-03Avoid decoding errors when extracting message ID from stdinKyle Meyer2-2/+2
The mbox, am, and pr subcommands accept an mbox on stdin and extract the message ID. When stdin.read() is called, Python assumes the encoding is locale.getpreferredencoding(False). This may not match the content encoding, leading to a decoding error. Instead feed the stdin bytes to message_from_bytes(), which leads to a decode('ASCII', errors='surrogateescape') underneath. That's sufficient to get the message ID from the ASCII headers. Reported-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Kyle Meyer <kyle@kyleam.com> Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2021-08-03Don't consider signature contents for trailersKonstantin Ryabitsev1-2/+8
Drop anything in the body below "-- " before parsing the contents for trailers. This won't catch all possible situations, as the "-- " standard is a bit of a dying standard, so add a list of known baddies like "Phone:" and "Email:" that are likely to trip us up. Reported-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Link: https://lore.kernel.org/tools/20210719213535.vw3u4yg5mgxqysaf@pengutronix.de/ Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2021-08-03Sanitize msgid before using it as savenameKonstantin Ryabitsev1-1/+2
Before using the msgid as part of the filename, clean it up to only contains sensible characters. Reported-by: Rob Herring <robherring2@gmail.com> Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2021-06-22Fix wrong statement on patches without indexesKonstantin Ryabitsev1-1/+1
Some patches don't have index information, so don't say they "apply clean to current tree" when they don't. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2021-06-22Allow '.git' to be a file for worktreesRob Herring1-1/+1
With multiple git worktrees, '.git' can be a file pointing to the real '.git' directory, so the current check for a directory is too strict. Signed-off-by: Rob Herring <robh@kernel.org> Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org> Link: https://lore.kernel.org/r/20210621204335.1627303-1-robh@kernel.org
2021-06-22Tweak --guess-base outputKonstantin Ryabitsev1-9/+8
Run the check against current tree even if no --guess-base is specified (it's cheap). Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2021-06-22Additional --guess-base refinementsKonstantin Ryabitsev3-29/+46
Use --all by default, instead of limiting ourselves just to the current HEAD. This is actually a faster operation, because we don't have to pre-filter results. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2021-06-21Reimplement --guess-baseKonstantin Ryabitsev3-77/+116
Based on some feedback, attempt to reimplement --guess-base by looking at the file index hashes and using --find-object to locate when they were last changed. We limit this using --since and --until, so that we aren't trying to look through the entire history of the repo. For the --until date, we take the date of the patch. For the --since date, we take the timedelta using the number of days specified by --guess-lookback (default is 14 days). Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2021-06-17Don't append .git unnecessarilyKonstantin Ryabitsev1-1/+0
We already do this automatically elsewhere, so this causes a problem if we do it again. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2021-06-11Test to make sure mbox files contain unixfromKonstantin Ryabitsev1-0/+35
Start a test suite for generated mbox files. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2021-06-11Save mbox files with proper unixfromKonstantin Ryabitsev3-14/+12
In order to avoid some of the more obscure charset encoding problems, we switched to using as_string() for generating messages before saving them in an mbox file. However, this uncovered a bug where the unixfrom was not actually generated and saved, despite as_bytes() and as_string() supposedly behaving identically. See: https://docs.python.org/3/library/email.message.html#email.message.EmailMessage.as_string This commit fixes the problem by properly setting the unixfrom and using the recommended (and hopefully less buggy) email.generator interface when saving mailboxes. Reported-by: Geert Uytterhoeven <geert@linux-m68k.org> Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2021-06-10Start using pytest for the test frameworkKonstantin Ryabitsev8-3/+94
Since we're not caring about 2.x compatibility, pytest seems to be a good candidate for this job. Obviously, there's a lot of ground to cover, but the goal is to do all future modifications with tests added so we can reduce regressions. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2021-06-09Update patatt to latest 0.4.6Konstantin Ryabitsev1-0/+0
Fixes things that should have been fixed in 0.4.5. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2021-06-09Fix sloppy trailer handlingKonstantin Ryabitsev1-4/+2
When returning sloppy trailers, make sure we always return a 4-member list, which includes the provenant LoreMessage itself. Reported-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2021-06-09Fix for recent function API changesKonstantin Ryabitsev1-2/+4
Returning a simple list of messages from get_am_ready broke a few other auxiliary functions invoked when run with -o- or -Q. Reported-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2021-06-08Perform an encoding bug avoidance danceKonstantin Ryabitsev1-1/+10
This is a kludge that I'm putting in place to avoid hitting an encoding bug with Python. We really shouldn't be making a fake RFC2822 message just so we can parse it again right away, so this is a temporary measure until I refactor how it's done. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2021-06-08Check if the name is nullKonstantin Ryabitsev1-1/+3
I'm not sure if it's a good strategy to use GitHub usernames and username@github.com addresses for this purpose, as we really need to be able to reach someone when we process their submissions. However, for the time being at least don't output None. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2021-06-08Initial support for github pull requestsKonstantin Ryabitsev1-14/+78
You can now do "b4 pr https://github.com/foo/bar/pull/NNN" and have it fetched into FETCH_HEAD. However, this also works when combined with --explode, which is the main reason for this feature's existence. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2021-06-08Fix crasher on unsigned FETCH_HEADKonstantin Ryabitsev1-12/+13
If the FETCH_HEAD is not signed, then keyid is going to be None. Don't attempt to look up UIDs in such situations. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2021-06-08Tentative suport for sending exploded seriesKonstantin Ryabitsev2-33/+66
I've been working on a way to automatically convert pull requests into series, complete with mailing them out to arbitrary destinations. This would allow folks to send a pull request to a dedicated list and have it automatically converted into a well-formed series. This is a tentative implementation that relies on git-send-email to do most of the heavy lifting. I have misgivings about using git-send-email for this purpose, but it does reduce the amount of duplicated code we would have otherwise had to write, and allows us to hook into things like tocmd/cccmd, etc. For example, adding the following to your .git/config: [sendemail "autopr"] smtpserver = [your.server.here] smtpserverport = 587 smtpencryption = tls smtpuser = [your-user] smtppass = [your-pass] transferEncoding = 8bit suppressFrom = yes confirm = never validate = no tocmd = "$(git rev-parse --show-toplevel)/scripts/get_maintainer.pl --norolestats --nol" cccmd = "$(git rev-parse --show-toplevel)/scripts/get_maintainer.pl --norolestats --nom" This would allow doing the following: b4 pr -e -f "AutoPR Exploder <autopr@yourdomain.here>" -s autopr [--dry-run] The pull request will be exploded into a patch series and sent to all the proper destinations as returned by get_maintainer.pl. We construct the message headers in a way that allow regular code review and "b4 am" usage after the auto-exploded series is sent out. If testing goes well, we'll implement this as a kernel.org service and then hook a similar implementation via Gitlab/Github. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2021-06-07Save exploded pull requests as maildirs as wellKonstantin Ryabitsev3-22/+36
This moves maildir saving code into __init__.py so that we can benefit from it via other subcommands, such as pr. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2021-06-07Shuffle DKIM logging code around a bitKonstantin Ryabitsev1-1/+3
PyCharm is unhappy with PEP conformance, so shuffle things around a bit to satisfy it. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2021-06-07Update to latest patatt versionKonstantin Ryabitsev1-0/+0
Fixes "NOKEY" vs. "BADSIG" problem (again). Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2021-06-07Include dkim log output when -d/--debug argument is passedPaul Barker1-1/+12
We can pass a logger object to dkim.verify() which will be used to report internal errors and debugging info. This can be helpful when investigating DKIM verification issues but is probably not wanted during normal operation so the log level of each message is reset to DEBUG. Each message is also prefixed with 'DKIM: ' to identify its origin when debug output is enabled. Signed-off-by: Paul Barker <paul@pbarker.dev> Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org> Link: https://lore.kernel.org/r/20210607100252.8253-3-paul@pbarker.dev
2021-06-07Handle MIME encoded-word in DKIM-Signature headersPaul Barker1-0/+4
As recently found in patatt [1], mail gateways and archivers may mangle headers like DKIM-Signature if they are sent as an excessively long line. An example of this occuring was found when the DKIM-Signature header generated by Microsoft Office 365 collided with the header re-encoding performed by lists.sr.ht when generating mbox archive files. This encoding causes dkim.verify() to fail. The Python email.header module provides the decode_header() and make_header() functions which can be used to handle MIME encoded-word syntax or other header manglings which may occur. Fixing up the header content using these functions before calling dkim.verify() allows the verification to succeed. [1]: https://lore.kernel.org/tools/20210531140539.7630-1-paul@pbarker.dev/ Signed-off-by: Paul Barker <paul@pbarker.dev> Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org> Link: https://lore.kernel.org/r/20210607100252.8253-2-paul@pbarker.dev
2021-06-07Add my own attestation keyKonstantin Ryabitsev1-0/+367
Identity verified in person! Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2021-06-07Add attestation key 74975C81B7E66BACKonstantin Ryabitsev1-0/+57
Identity not validated, but key retrieved from keys.openpgp.org, which performs an email roundtrip check. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2021-06-03Update patatt to 0.4.5Konstantin Ryabitsev1-0/+0
Fixes wrong error message for keys coming from default keyring. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2021-06-03Account for in-body headers when trimming bodyKonstantin Ryabitsev2-88/+98
When we discover that a message can only be attested after we trim the body, we *must* set the body to that version, otherwise an attacker could append arbitrary content past the l= value boundary. We already do this in the current form, but we weren't properly handing in-body headers like From: and Subject: that are used to indicate to git the patch author vs. committer. This patch set fixes that and also streamlines a few other places where we were already relying on git mailinfo calls. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2021-06-03Fix partial reroll TUI visuals for v1->v2Konstantin Ryabitsev1-7/+6
Before: ✓ [PATCH v2 1/8] selftests/x86: Test signal frame XSTATE header corruption handling ✓ [PATCH v2 2/8] x86/fpu: Prevent state corruption in __fpu__restore_sig() ✓ [PATCH 3/8] x86/fpu: Invalidate FPU state after a failed XRSTOR from a user buffer ✓ [PATCH 4/8] x86/fpu: Limit xstate copy size in xstateregs_set() ✓ [PATCH v2 5/8] x86/fpu: Sanitize xstateregs_set() ✓ [PATCH 6/8] x86/fpu: Add address range checks to copy_user_to_xstate() ✓ [PATCH 7/8] x86/fpu: Clean up the fpu__clear() variants ✓ [PATCH 8/8] x86/fpu: Deduplicate copy_xxx_to_xstate() After: ✓ [PATCH v2 1/8] selftests/x86: Test signal frame XSTATE header corruption handling ✓ [PATCH v2 2/8] x86/fpu: Prevent state corruption in __fpu__restore_sig() ✓ [PATCH v1->v2 3/8] x86/fpu: Invalidate FPU state after a failed XRSTOR from a user buffer ✓ [PATCH v1->v2 4/8] x86/fpu: Limit xstate copy size in xstateregs_set() ✓ [PATCH v2 5/8] x86/fpu: Sanitize xstateregs_set() ✓ [PATCH v1->v2 6/8] x86/fpu: Add address range checks to copy_user_to_xstate() ✓ [PATCH v1->v2 7/8] x86/fpu: Clean up the fpu__clear() variants ✓ [PATCH v1->v2 8/8] x86/fpu: Deduplicate copy_xxx_to_xstate() Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2021-06-02Implement trim_body supportKonstantin Ryabitsev2-3/+50
When a message has a developer signature but is failing the signature check, rerun it again with trim_body. If that passes, we know that the signature is failing due to mailing list junk appended to the bottom of the message. In that case, automatically trim the message body so we have exactly what the developer attested and signed. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2021-06-02Add *.maildir to gitignoreKonstantin Ryabitsev1-0/+1
Now that we can save as maildirs, add them to gitignore as well. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2021-06-01Fix cache aging cleanup of threadsRob Herring1-1/+1
The cache aging for threads was not running resulting in failures to fetch new messages in threads. Fix the empty cache check which should be for no '.msgs' directories. Fixes: 4950093c0c3e ("Don't use mboxo for anything") Signed-off-by: Rob Herring <robh@kernel.org> Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org> Link: https://lore.kernel.org/r/20210601200835.940887-1-robh@kernel.org
2021-05-28Update to newer patatt versionKonstantin Ryabitsev1-0/+0
Fixes public key lookups for uncommitted keys. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2021-05-28Limit 'From mboxrd@z' replacement to start of messageKyle Meyer1-1/+1
save_git_am_mbox() replaces 'From mboxrd@z ' with 'From git@z ' to make it clear that the output format is not mboxrd. However, all occurrences in the message are replaced, corrupting patches that contain 'From mboxrd@z '. Restrict the replacement to the first line of the message. Signed-off-by: Kyle Meyer <kyle@kyleam.com> Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org> Link: https://lore.kernel.org/r/20210528042635.24959-1-kyle@kyleam.com
2021-05-26Up version to final 0.7.0v0.7.0Konstantin Ryabitsev1-1/+1
I think we are ready to go with the 0.7.0 release. There's always more tweaks to add, but at this point we can benefit from wider usage. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2021-05-26Add new b4 pr flagsKonstantin Ryabitsev2-0/+9
The -f and -l flags are mostly used for archival purposes -- they allow to convert a pull request into a mini-archive which includes relevant discussions around all of the commits involved in it. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2021-05-26Check uids on the key when using default keyringKonstantin Ryabitsev2-2/+15
When the signature is validated using the default keyring, run an additional check on the UIDs and show the discrepancy if the identity used in the X-Developer-Signature header is different from the UIDs we have on the key. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2021-05-25Update attestation section in the READMEKonstantin Ryabitsev1-12/+17
- the default attestation policy is now "softfail" - include instructions about installing the patatt submodule Better read-the-docs style documentation will be coming in 0.8. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2021-05-25Don't depend on List-Archive lore headerKonstantin Ryabitsev3-53/+67
The newer version of public-inbox is not injecting its own List-Archive headers, so stop relying on it for any purpose. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2021-05-25Handle situations where -f only has an emailKonstantin Ryabitsev1-0/+2
Normally, -f would be 'Some Service <service@example.org>', but in case it's just "service@example.org", wrap it in angle brackets properly. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2021-05-25Fix pr -l where we introduced var collisionKonstantin Ryabitsev1-33/+33
When we're retrieving linked messages, make sure we don't clash with the variable holding the overall mbox. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2021-05-25Bump patatt to 0.4.2Konstantin Ryabitsev1-0/+0
This version returns a failure early when body modification is recognized. This is especially useful if we have to shell out to gnupg for validation. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2021-05-25Avoid type error when local mbox lacks specified message IDKyle Meyer1-1/+1
Calling b4-am with --use-local=MBOX is supposed to abort with "Could not find MID in MBOX" if the mbox doesn't contain the specified message ID. As of 4950093c0 (Don't use mboxo for anything, 2021-05-18), a type error is signaled because get_strict_thread() returns None when there are no matches, and get_msgs() feeds this result to len(). Update get_msgs() to instead check whether the returned value evaluates to false. Signed-off-by: Kyle Meyer <kyle@kyleam.com> Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org> Link: https://lore.kernel.org/r/20210523025812.26456-1-kyle@kyleam.com