Age | Commit message (Collapse) | Author |
|
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>
|