Age | Commit message (Collapse) | Author | Files | Lines |
|
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>
|
|
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>
|
|
Mutt treats single quotes and double quotes differently, and this
configuration option requires double quotes.
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
Implement the sendmail cmdline compatibility similarly to how it is done
by git-send-email.
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
|
|
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>
|
|
Version 0.10.0 is out, time to dial this up to 11.
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
|
|
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>
|
|
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>
|
|
Print a link to the online documentation on --help invocation.
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
|
|
A slew of proofreading fixes to documentation.
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
|
|
Also, trim the configuration section and just give a link to the online
docs for it.
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
|
|
Fix the section on commands available for both am and shazam.
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
|
|
We don't need to duplicate b4 on every maintainer subcommand document.
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
|
|
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>
|
|
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>
|
|
Remove outdated sections and link to online documentation at
b4.docs.kernel.org.
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
|
|
Complete the configuration file section and add some cross-references
where needed.
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
|
|
Completes the "ez" set of features added in 0.10.
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
|
|
Despite what it may seem sometimes, working on a series is not an
infinite loop. :)
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
|
|
Document most salient information about b4 send.
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
|
|
This covers most of the workflow details for using b4 prep.
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
|
|
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>
|
|
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>
|
|
Add documentation for b4 am and b4 shazam.
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
|
|
Still lots to do, but we'll have good docs at the end of this.
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
|
|
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>
|
|
Check that it actually starts with https://.
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
Fixes a bug that caused wrong entries in the extra trailers list.
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
Mostly, I want to make sure that readthedocs is building things
correctly. Actual documentation shortly forthcoming.
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
When we're adding a mismatched trailer, tell us why it hasn't been
accepted.
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
|
|
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>
|
|
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>
|
|
When rerolling partial series, check that the trailers are applied
correctly.
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
Fixes regression introduced by trailers refactor.
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
|
|
Add a missing continue that caused incorrectly reported trailer
mismatches.
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
For UX reasons, make --resend a separate switch instead of operating on
the --prefixes RESEND logic.
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
Patatt-0.6.0 is out and we need it for the current version of b4.
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
|
|
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>
|
|
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>
|
|
Fixes a bug with \r\n and \n endings that we're hitting.
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
Do not crash when one of the msgs is a None (usually, the cover commit).
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
|
|
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>
|
|
Fixes types in logger calls.
Reported-by: Maxime Ripard <maxime@cerno.tech>
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
|
|
When getting strategy from branch configs, tell us that it's where it
came from.
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
|
|
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>
|
|
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>
|
|
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>
|
|
Handle some of the potential errors that could come up when tagging
historical versions.
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
If one of the previxes is RESEND, then we don't auto-increment revision.
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
Chain-of-custody order requires that Signed-off-by closes the list of
added trailers.
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
|
|
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>
|
|
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>
|
|
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>
|
|
Yes, I debug with print().
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
|
|
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>
|
|
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>
|
|
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>
|
|
Patatt-0.5.0 is out, so update our submodule info.
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
Minor nitpicking by PyCharm, but not completely unreasonable.
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
|
|
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>
|
|
When performing attestor identity comparisons, lowercase email addresses
and domain names for case-insensitive matching.
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
|
|
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
|
|
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>
|
|
This will soon become patatt-0.5.0, so start using it in our daily
tests.
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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
|
|
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
|
|
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>
|
|
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>
|
|
Allow people to set up their own preferred merge templates, using the
netdev standard as default.
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
We no longer support backfilling (obsolete), so remove it from all
places where it's used.
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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
|
|
Run the check against current tree even if no --guess-base is specified
(it's cheap).
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
|
|
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>
|
|
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>
|
|
We already do this automatically elsewhere, so this causes a problem if
we do it again.
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
|
|
Start a test suite for generated mbox files.
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
|
|
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>
|
|
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>
|
|
Fixes things that should have been fixed in 0.4.5.
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
PyCharm is unhappy with PEP conformance, so shuffle things around a bit
to satisfy it.
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
|
|
Fixes "NOKEY" vs. "BADSIG" problem (again).
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
|
|
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
|
|
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
|
|
Identity verified in person!
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
|
|
Identity not validated, but key retrieved from keys.openpgp.org, which
performs an email roundtrip check.
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
|
|
Fixes wrong error message for keys coming from default keyring.
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
|
|
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>
|
|
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>
|
|
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>
|
|
Now that we can save as maildirs, add them to gitignore as well.
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
|
|
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
|
|
Fixes public key lookups for uncommitted keys.
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
|
|
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
|
|
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>
|
|
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>
|
|
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>
|
|
- 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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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
|