aboutsummaryrefslogtreecommitdiff
path: root/b4/ty.py
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-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-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-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-03-30Add support for mailmap and excluding mail in b4-tyKonstantin Ryabitsev
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>
2021-11-01ty: fix problems with smtplib and 8BITMIMEKonstantin Ryabitsev
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 Ryabitsev
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-19Initial implementation of native mail sendingKonstantin Ryabitsev
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-09-30shazam: implement custom merge message templatesKonstantin Ryabitsev
Allow people to set up their own preferred merge templates, using the netdev standard as default. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2020-12-01Fix b4 ty auto-matchingKonstantin Ryabitsev
When I changed auto_locate_series to return the exact patch number in addition to the matching commit_id, I introduced an off-by-one that caused all tracked series to start matching. Reported-by: Mark Brown <broonie@kernel.org> Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2020-11-30Fix headers generated by "b4 ty"Konstantin Ryabitsev
Make sure we always create a Date: header, and that we're not crashing when we try to parse a message without a Date: header. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2020-11-24Improve ty with cherrypicked subsetsKonstantin Ryabitsev
Record patch counters when we start tracking series so we properly indicate in the thank-you note which ones got applied. Additionally, indicate in the subject when we're reporting on a subset of a larger series. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2020-10-02Fix header encoding introduced by earlier fixKonstantin Ryabitsev
It seems we don't have much control over what as_bytes() does, so switch to using as_string(), setting our policy, and making sure that content-transfer-encoding is set to 8bit. Reported-by: Mark Brown <broonie@kernel.org> Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2020-10-01Set charset in order to generate MIME headersKonstantin Ryabitsev
Apparently, merely passing policy= doesn't generate the full set of required headers, so make sure we do set_charset('utf-8'). Reported-by: Michał Mirosław <mirq-linux@rere.qmqm.pl> Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2020-05-15Relax branch sanity-checking logicKonstantin Ryabitsev
Git has a lot of internal logic matching free-form branch names to actual branches, so don't try to second-guess what it finds acceptable. Reported-by: Mark Brown <broonie@kernel.org> Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2020-05-11Make sure to always use the full refnameKonstantin Ryabitsev
Git will try to helpfully disambiguate, but we just need consistency, so always ask for a full refname. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2020-05-11Deal with cases when [branch] is not specifiedKonstantin Ryabitsev
Not all local branches are going to have matching [branch] entries -- sometimes there is only a [remote]. Deal with both cases. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2020-05-11Do not match everything in -a, only -sKonstantin Ryabitsev
While trying to be more permissive with messages selected manually with -s, we broke auto-thankanator by making it match everything. Reported-by: Mark Brown <broonie@kernel.org> Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2020-05-07Match applied patches using message-idKonstantin Ryabitsev
Track message-id for each patch and try to apply to the Link: or Message-Id: trailers, if we find them. Suggested-by: Jason Gunthorpe <jgg@ziepe.ca> Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2020-05-07Improve remote/branch mappingKonstantin Ryabitsev
Our mapping of local to remote branches was very naive and failed when remote names didn't exactly match heads. Improve it using suggestions from Will Deacon. Link: https://linux.kernel.org/g/tools/message/140 Reported-by: Will Deacon <will@kernel.org> Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2020-05-07Switch ty -s and -d to allow friendly rangesKonstantin Ryabitsev
Instead of insisting that people put in specific numbers, allow them to specify ranges, such as: b4 ty -s 1-3,5,7- Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2020-04-24Use "local tree" instead of "undefined"Konstantin Ryabitsev
This is our fail-through treename, so if we weren't able to figure out anything about it, then call it a "local tree" instead of "undefined". Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2020-04-22Properly deal with merge to non-current branchKonstantin Ryabitsev
When running rev-list, be mindful of which branch we need to operate on, otherwise it always runs on the current branch. Reported-by: Mark Brown <broonie@kernel.org> Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2020-04-17Expand templates with ${branch} and ${treename}Konstantin Ryabitsev
You can use ${branch} and ${treename} (if you set b4.thanks-treename). See .example files on some hints on how to use them. Suggested-by: Mark Brown <broonie@kernel.org> Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2020-04-15Changes to b4 ty based on developer feedbackKonstantin Ryabitsev
- Properly expand ~ and env vars like $HOME in template paths - Allow partial matching of series (with a warning) - Allow using remote branches with -b - Always fall back to subject matching for patches - Tweak to the summary output Suggested-by: Mark Brown <broonie@kernel.org> Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2020-04-15Keep track of how many messages we createKonstantin Ryabitsev
Don't tell us to run git send-email when there's nothing to send. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2020-04-15Be more useful during non-auto matchingKonstantin Ryabitsev
Instead of bailing out when we can't find a match for a series, skip it and move to the next one in the queue. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2020-04-15Switch to using patchwork-compatible hashesKonstantin Ryabitsev
Using strict attestation hashes for auto-thankinator is problematic, because "git am" uses a certain degree of fuzzing, so when we try to find applied patches by running "git diff" on actual commits, line counts may not be bit-for-bit identical. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2020-04-10Use ~/.signature if it exists for tpt defaultsKonstantin Ryabitsev
If we find a ~/.signature, then use it for making a default ${signature} value, otherwise make a "Name <email>" boring one. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2020-04-10Add summaries to default templatesKonstantin Ryabitsev
They are much more useful if b4.thanks-commit-url-mask is set, but even without them this will list all subjects and corresponding commit IDs. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2020-04-10Don't use git patch-id for patch trackingKonstantin Ryabitsev
Looks like some of the patches sent from quilt (at least from Andrew Morton) are not properly parsed by git patch-id, so use our own patch hashing routines, even if this means we're likely going to miss some of the patches that were edited by maintainers. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2020-04-09Add b4 ty that aims to simplify common feedbackKonstantin Ryabitsev
New experimental feature that aims to simplify a very common "thanks, applied" kind of feedback often expected of maintainers. Still needs documentation to explain its usage. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>