aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2022-08-23ez: only use web endpoint when sending patchesKonstantin Ryabitsev
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 Ryabitsev
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 Ryabitsev
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 Ryabitsev
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 Ryabitsev
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 Ryabitsev
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 Ryabitsev
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 Ryabitsev
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 Ryabitsev
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 Ryabitsev
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 Ryabitsev
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 Ryabitsev
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 Ryabitsev
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 Ryabitsev
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 Ryabitsev
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 Ryabitsev
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 Ryabitsev
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 Ryabitsev
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 Ryabitsev
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 Ryabitsev
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 Ryabitsev
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 Ryabitsev
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 Ryabitsev
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 Ryabitsev
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 Ryabitsev
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 Ryabitsev
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 Ryabitsev
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 Ryabitsev
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 Ryabitsev
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 Ryabitsev
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 Ryabitsev
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 Ryabitsev
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 Ryabitsev
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 Ryabitsev
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 Ryabitsev
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 Ryabitsev
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 Ryabitsev
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 Ryabitsev
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 Ryabitsev
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 Ryabitsev
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 Ryabitsev
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 Ryabitsev
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 Ryabitsev
Yes, I debug with print(). Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2022-06-21Initial patchwork integration supportKonstantin Ryabitsev
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 Ryabitsev
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 Ryabitsev
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 Ryabitsev
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 Ryabitsev
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 Ryabitsev
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 Ryabitsev
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>