aboutsummaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)AuthorFilesLines
2024-01-02Properly write out bare-address trailersstable-0.12.yKonstantin Ryabitsev4-1/+118
Not all trailers will have both a name and address, specifically not the Cc: trailer that sends to a list. Fixes: 26615095533f ("trailers: do not quote names when special chars are present") Reported-by: Geert Uytterhoeven <geert@linux-m68k.org> Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2024-01-02Up version to 0.12.5-devKonstantin Ryabitsev1-1/+1
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2023-10-20Up release to 0.12.4v0.12.4Konstantin Ryabitsev1-1/+1
Time for a small dot-release. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2023-10-16trailers: do not quote names when special chars are presentKonstantin Ryabitsev4-1/+113
When fixing potential email address rendering problems, we do not need to be as stringent about the contents of the git trailer as when we are dealing with actual email headers. For example, we do not need to quote names containing things like commas or parentheses. Reported-by: Matthew Wilcox <willy@infradead.org> Fixes: 832010c4d50 ("trailers: normalize address after parsing") Closes: https://bugzilla.kernel.org/show_bug.cgi?id=218017 Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2023-09-11Only pass -f to sendmail if envelopesender is setKonstantin Ryabitsev1-5/+4
To be more compatible with how git-send-email works, only pass -f to the sendmail command if sendemail.envelopesender is set. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2023-09-11ez: ignore invalid unicode returned by get_maintainerKonstantin Ryabitsev1-2/+2
There's a bug in get_maintainer.pl that returns invalid unicode in certain situations (see bug linked below). We can't fix this in b4, but at least we can avoid crashing when we encounter this problem. Reported-by: Duje Mihanović <duje.mihanovic@skole.hr> Link: https://msgid.link/1940519.PYKUYFuaPT@radijator Closes: https://bugzilla.kernel.org/show_bug.cgi?id=217713 Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2023-09-11Up version to 0.12.4-devKonstantin Ryabitsev1-1/+1
Time for another minor release. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2023-06-23Up release to 0.12.3v0.12.3Konstantin Ryabitsev1-1/+1
Get ready to release 0.12.3. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2023-06-23ez: store sent prefixes with the tag messageKonstantin Ryabitsev1-1/+5
For resend purposes, we need to store the prefixes that were used for sending that series at the time. This way when --resend is used, we can restore the subject line to what it was at the time. Reported-by: Erik Schilling <erik.schilling@linaro.org> Link: https://msgid.link/CTDVYQ01B09D.1FUED4Y6IQUKI@fedora Closes: https://bugzilla.kernel.org/show_bug.cgi?id=217564 Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2023-06-22Properly quote the address before adding into FromKonstantin Ryabitsev1-4/+1
Make sure we properly quote the address in From: before we add it to the am message. Reported-by: Josselin Poiret <dev@jpoiret.xyz> Link: https://msgid.link/5de6864e5999c398700712fdce5d52c77d8b0a2a.1686057776.git.dev@jpoiret.xyz Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2023-06-22shazam: switch to top of git tree before running git-amKonstantin Ryabitsev2-3/+4
According to reports, running "git am" when not at the top of the tree can result in the dirty tree state (see linked conversation). This ensures that we switch back to the top of the git tree before running "git am" and then switch back. Reported-by: Andrew Cooper <andrew.cooper3@citrix.com> Link: https://msgid.link/4e4757cf-7351-9aff-fada-2b03ff82b2dc@citrix.com Closes: https://bugzilla.kernel.org/show_bug.cgi?id=217393 Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2023-06-22trailers: normalize address after parsingKonstantin Ryabitsev1-0/+2
For person-trailers, normalize the address after we have parsed it, which removes some of the common email-added junk (mailto:, extra <>, etc). Reported-by: Andrew Cooper <andrew.cooper3@citrix.com> Closes: https://bugzilla.kernel.org/show_bug.cgi?id=217430 Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2023-06-22Fix wrong CTR header after 8bit cover content is mixed inKonstantin Ryabitsev1-0/+3
When we mix in cover content into the patch that previously only had 7bit data, re-check the new payload and set C-T-R to 8bit if the new payload is no longer ascii. Reported-by: Erik Schilling <erik.schilling@linaro.org> Closes: https://bugzilla.kernel.org/show_bug.cgi?id=217563 Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2023-06-21ez: make it easier to send single-patch seriesKonstantin Ryabitsev1-16/+17
Do not force developers to edit the cover letter when information from it is not going to be included into the single-patch message anyway. Suggested-by: Mark Brown <broonie@kernel.org> Closes: https://bugzilla.kernel.org/show_bug.cgi?id=217388 Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2023-06-21ez: make message-ids use today's dateKonstantin Ryabitsev1-3/+8
When creating the message-id of the series to be sent, we're reusing the change-id, which includes the origin date when that change-id was first created. Change this to today's date in order to be more conforming to how git-send-email does it. Suggested-by: Christian Brauner <brauner@kernel.org> Closes: https://bugzilla.kernel.org/show_bug.cgi?id=217359 Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2023-06-21ez: only include base-branch when using non-default strategyKonstantin Ryabitsev1-1/+3
When we are using the default "commit" strategy, we do not really use the base-branch info for anything. Keeping it in the tracking json for historical reasons actually confuses people, because the base-branch is not updated when operations such as "git rebase" are performed. For this reason, only include "base-branch" when we're using a strategy other than "commit". Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2023-06-21Fix to properly handle under-scissors patches with a unixfrom lineKonstantin Ryabitsev1-7/+12
When a patch below the scissors line contains a Unixfrom, we need to properly escape that before passing the message to git-mailinfo. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2023-06-21Clean headers before adding them to the pre-scissors emailKonstantin Ryabitsev1-3/+3
Since we are creating a new message, we should make sure that the headers are cleaned up before we use them to create the message we'll be passing to git-mailinfo. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2023-06-21b4: Fix envelopeSender handlingMaxime Ripard1-1/+4
The manpage for git-send-email states that: Specify the envelope sender used to send the emails. This is useful if your default address is not the address that is subscribed to a list. In order to use the From address, set the value to "auto". If you use the sendmail binary, you must have suitable privileges for the -f parameter. Default is the value of the sendemail.envelopeSender configuration variable; if that is unspecified, choosing the envelope sender is left to your MTA. However, b4 just reuses the value of sendemail.envelopeSender and passes it down directly to the sendmail binary if relevant, which means that if we were using the value "auto", we now have sendemail called with -f auto instead of the proper mail address, confusing sendmail. We can fix this by interpreting the auto value as suggested in the manpage. Signed-off-by: Maxime Ripard <mripard@kernel.org> Link: https://msgid.link/20230602152554.2046764-1-mripard@kernel.org Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2023-06-21am, shazam: allow cherry-picking an out-of-series patchPhilippe Blain1-1/+8
Reviewers sometimes include a patch as a reply when reviewing a contributor's series, for example, to suggest tweaks or additional changes. The contributor might want to add that patch to their series for the next revision. Currently, using 'b4 shazam -P_ $msgid', where msgid is the message-id or full URL of the reviewer's message, does not work: $ b4 am -o- -P_ ZDnCMegeiw0kT5oj@nand.local Analyzing 2 messages in the thread No patches found. mbox.py::make_am returns early because the LoreSeries 'lser' returned by lmbx.get_series is empty ('None'). It is empty because when using '-P_', b4::retrieve_messages only retrieves the specific message-id given (and its replies), so the LoreSeries 'lmbx' created in make_am does not have any series. Also check if the user asked to cherry-pick a specific message-id before returning early in make_am. This allows us to reach the 'if cmdargs.cherrypick == '_'' condition, but then we iterate on lser.patches to find the patch to cherry-pick, and so get a runtime error: $ b4 am -o- -P_ ZDnCMegeiw0kT5oj@nand.local Analyzing 2 messages in the thread Traceback (most recent call last): File "/Users/Philippe/Code/b4/b4/command.py", line 381, in <module> cmd() File "/Users/Philippe/Code/b4/b4/command.py", line 364, in cmd cmdargs.func(cmdargs) File "/Users/Philippe/Code/b4/b4/command.py", line 91, in cmd_am b4.mbox.main(cmdargs) File "/Users/Philippe/Code/b4/b4/mbox.py", line 719, in main make_am(msgs, cmdargs, msgid) File "/Users/Philippe/Code/b4/b4/mbox.py", line 82, in make_am for lmsg in lser.patches[1:]: AttributeError: 'NoneType' object has no attribute 'patches' Fix this by creating a fake LoreSeries and adding to it any followup messages in 'lmbx' with a diff in the body. Signed-off-by: Philippe Blain <levraiphilippeblain@gmail.com> Link: https://msgid.link/20230415-am-cherry-pick-suggestion-v1-2-8951a2274256@gmail.com Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2023-06-21mbox.py::make_am: simplify check for early returnPhilippe Blain1-4/+4
In mbox.py::make_am, we check if the 'lser' LoreSeries returned by lmbx.get_series is empty, and return early with a different critical message depending on wether wantver was given or not. Simplify the logic a bit by using a nested if instead of two subsequent ones. This will make the following commit's diff simpler. Signed-off-by: Philippe Blain <levraiphilippeblain@gmail.com> Link: https://msgid.link/20230415-am-cherry-pick-suggestion-v1-1-8951a2274256@gmail.com Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2023-06-21ez: Fix 'trailers -F' used on a single commitRob Herring1-0/+2
Running 'b4 trailers -u -F <msgid>' on a single commit fails: CRITICAL: Failed to convert range to patches: Could not run rev-list None~1..409ee53c38a1d9a60e76ffa92088cfad07cea850 The problem is the loop is exited after 1 iteration and prevcommit is never set. Signed-off-by: Rob Herring <robh@kernel.org> Link: https://msgid.link/20230330201529.2744290-1-robh@kernel.org Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2023-06-21b4.sh: keep existing PYTHONPATH if setDominique Martinet1-1/+2
for setups depending on PYTHONPATH being set to provide dependencies e.g. requests, b4.sh overriding of the variable is too strong. Set current directory and patatt's first but keep PYTHONPATH if it was not empty. While we are here, remove useless use of env: the shell does the job just fine if the variable is set before exec Signed-off-by: Dominique Martinet <asmadeus@codewreck.org> Link: https://msgid.link/20230402-wrapper-keep-pythonpath-v1-1-e2bc5e556a67@codewreck.org Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2023-06-21b4: Allow prep new branch while on a b4 managed branchIra Weiny1-1/+5
Creating a new branch from a specified fork point should be allowed when sitting on a b4 managed branch. For example this fails: $ b4 prep -n foo -f master Created new branch b4/foo Created the default cover letter, you can edit with --edit-cover. $ b4 prep -n bar -f master CRITICAL: This appears to already be a b4-prep managed branch. Allow a specified fork point to be used regardless of the b4 state of the current branch. Make -n and -e options mutually exclusive early on to clarify the difference between them in practical usage. With this change the following works as expected. $ git co b4/allow-new-w-fork-point Switched to branch 'b4/allow-new-w-fork-point' $ b4 prep -n bar -f master Created new branch b4/bar Created the default cover letter, you can edit with --edit-cover. $ b4 prep -n foobar -e master -f master CRITICAL: -n NEW_SERIES_NAME and -e [ENROLL_BASE] can not be used together. Cc: tools@linux.kernel.org Cc: konstantin@linuxfoundation.org Signed-off-by: Ira Weiny <ira.weiny@intel.com> Link: https://msgid.link/20230517-allow-new-w-fork-point-v1-1-22d2cb938e16@intel.com Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2023-06-21docs: fix smtpServerPort optionErik Schilling1-1/+1
The right name includes a "Server". Link: https://git-scm.com/docs/git-send-email#Documentation/git-send-email.txt---smtp-server-portltportgt Signed-off-by: Erik Schilling <erik.schilling@linaro.org> Link: https://msgid.link/20230523-fix-smpt-port-config-v1-1-cdc99e39b866@linaro.org Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2023-06-21trailers: add 'Closes' as recognized link trailerMatthieu Baerts3-2/+4
The Closes tag has been used for quite a long time in the Linux kernel, mainly by DRM and MPTCP subsystems. It is used by some bug trackers like GitHub, GitLab and bugzilla.kernel.org to automate the closure of issues when a patch is accepted. In Linux 6.3, checkpatch started to complain about this tag because it has never been described in the documentation. The situation has changed in Linux 6.4 [1]: I initially just wanted to allow the Closes tag but some reviewers pointed out that bots reading mailing lists like RegzBot would be interested to have it instead of the Link tag when any kind of bug is being closed. So now after a Reported-by, checkpatch.pl now suggests to add a Closes with a link. In other words, it is now more common to see this Closes tag in the Linux kernel. It is certainly used in many other projects than the Linux kernel. This Closes tag is treated as a Link tag. Note that existing test files have been modified. You will probably need to run "pytest --cache-clear" to avoid using the previous version. Link: https://lore.kernel.org/all/20230314-doc-checkpatch-closes-tag-v4-0-d26d1fa66f9f@tessares.net/ [1] Reported-by: Nick Desaulniers <ndesaulniers@google.com> Closes: https://lore.kernel.org/all/CAKwvOdm=Zk8YhrPptN3k7UQo+1n7Ws=Qox=BwTR9bbjPJJYz8A@mail.gmail.com/ Signed-off-by: Matthieu Baerts <matthieu.baerts@tessares.net> Link: https://msgid.link/20230525-closes-tags-v1-2-ed41b1773cb6@tessares.net Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2023-06-21trailers: accept recognized link trailersMatthieu Baerts3-2/+6
It looks like all all link trailers were ignored. Now we accept 'link' and 'buglink' that were already in the list of non person categories. Note that existing test files have been modified. You will probably need to run "pytest --cache-clear" to avoid using the previous version. Fixes: 7d1a05e ("trailers: ignore non-recognized link trailers") Signed-off-by: Matthieu Baerts <matthieu.baerts@tessares.net> Link: https://msgid.link/20230525-closes-tags-v1-1-ed41b1773cb6@tessares.net Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2023-06-21Consider '@' safe in msgid URLsKonstantin Ryabitsev1-1/+1
Lore links look nicer when we don't escape the '@'. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2023-04-19ez: better fix for "no follow-up trailers" conditionKonstantin Ryabitsev1-5/+4
Previous fix for bug 217331 didn't properly handle the situation when trailers were sent to the cover letter, so implement a better fix. Fixes: 00e423af1a (ez-trailers: don't crash when there are no follow-ups received) Closes: https://bugzilla.kernel.org/show_bug.cgi?id=217331 Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2023-04-19Add subscribe/unsubscribe to badtrailersKonstantin Ryabitsev1-1/+2
There are truly horrible mailing list solutions that insist on dumping junk all over message bodies. Help developers cope by adding more known-bad junk to the "not trailers" list. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2023-04-19ez: do not trust local commands to properly reflectKonstantin Ryabitsev1-1/+16
As we just discovered, Google's sendgmr is not properly compatible with sendmail flags, and will ignore addresses passed via the CLI, instead always using the ones from the headers. This is opposite to what --reflect is designed to do, so bail out with a loud error, but give a way to override it via a custom variable. Reported-by: Nick Desaulniers <ndesaulniers@google.com> Link: https://bugzilla.kernel.org/show_bug.cgi?id=217332 Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2023-04-19ez-trailers: don't crash when there are no follow-ups receivedKonstantin Ryabitsev1-1/+4
If there are no follow-up trailers to process, bail early as opposed to crashing. Reported-by: Mark Brown <broonie@kernel.org> Closes: https://bugzilla.kernel.org/show_bug.cgi?id=217331 Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2023-04-19Up version to 0.12.3-devKonstantin Ryabitsev1-1/+1
Time for some bugfixing backports. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2023-03-10Prepare for 0.12.2v0.12.2Konstantin Ryabitsev1-1/+1
Release 0.12.2 containing bugfixes. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2023-03-10man: fix rst2man renderingKonstantin Ryabitsev2-1/+7
Tiny tweak to make sure that manpages are rendered correctly. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2023-03-10Add Date: and Subject: to badtrailersKonstantin Ryabitsev1-1/+1
Fixes some corner-cases where we find Date: and Subject: headers in weird places. Reported-by: Marc Kleine-Budde <mkl@pengutronix.de> Link: https://msgid.link/87mt5d2xue.fsf@hardanger.mail-host-address-is-not-set Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2023-03-10ty: Fix git-config regexp in get_branch_info()Michael Ellerman1-1/+1
The regexp used to get the branch configuration in get_branch_info() is subtly wrong. If there are multiple branches starting with the same prefix, the configuration for all of them will be returned, which can lead to the wrong branch info being used. eg. Running b4 -d ty, with extra logging of every line in get_config_from_git() shows: Running git --no-pager config -z --get-regexp branch\.foo\.* branch.foo.remote . branch.foo.merge refs/heads/foo-test branch.foo-test.remote . branch.foo-test.merge refs/heads/foo-base Although the regexp has two escaped dots, the 2nd one is seemingly consumed by the '*', leading to the regexp matching "foo" and "foo-test". This can be observed on the command line: $ git branch -t foo origin/master $ git branch -t foo-test origin/master $ git --no-pager config --get-regexp "branch\.foo\.*" branch.foo.remote . branch.foo.merge refs/heads/foo-test branch.foo-test.remote . branch.foo-test.merge refs/heads/foo-base The real problem is that we meant to pass a regexp of "branch\.foo\..*", so change the code to use that, which fixes the problem: $ git --no-pager config --get-regexp "branch\.foo\..*" branch.foo.remote origin branch.foo.merge refs/heads/master Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> Link: https://msgid.link/20230310055753.1609529-1-mpe@ellerman.id.au Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2023-03-10Fix: wrong From attribution on trim_body required for attestationKonstantin Ryabitsev1-4/+8
In very certain conditions, we lost the in-body From: and used the outer header from: - it needed to be a patatt-signed message - you had to have the key for proper verification - the mailing list server had to have appended some trailer junk In this case, we reconstituted the body from the trimmed verification results, but didn't properly put back the From: and Subject: data that was stripped from it. It used to still work properly, until we implemented the proper scissors handling in 0.10. Reported-by: Palmer Dabbelt <palmer@dabbelt.com> Link: https://msgid.link/mhng-2765f5e1-e3d9-4f36-82e2-1212e13b0cdd@palmer-ri-x1c9a Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2023-03-08ez: add ability to use markdown headers in coverKonstantin Ryabitsev1-1/+8
The cover letter will remove any lines starting with "#" before the cover letter is sent. However, some developers like to use markdown styling for better readability of their cover letters, and that generally uses "#" characters to denote headers. This change allows escaping these lines with ">#" so they are preserved in the final rendered cover. Link: https://vt.social/@lina/109982650960236704 Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2023-03-03test: don't require running from gitKonstantin Ryabitsev1-1/+1
Fix tests so they can also run from a released tarball. Reported-by: Héctor Orón Martínez <zumbi@debian.org> Link: https://msgid.link/CAODfWeFXwz4Ci5A=VaUvmyZL2daYe48+OOrjvq6wC-KTJS4hRA@mail.gmail.com Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2023-03-03ez: send: make argument to --resend optionalThomas Weißschuh4-7/+13
This frees the user from having to specifying an explicit version to resend. Most of the time this should be the latest version. Link: https://msgid.link/20230217-resend-auto-version-v2-1-0830b9733993@t-8ch.de Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2023-03-03ez: get_series_details: correctly compute 'base_commit' for all strategiesPhilippe Blain1-3/+6
In f0fad6e (ez: refactor based on initial feedback, 2022-07-20), support was added for the 'branch-description' strategy, but 'get_series_details' was not changed to account for the fact that if the cover letter is stored in the branch description, base_commit and start_commit should be the same commit. This was also missed when 9e95d52 (ez: implement tip-commit strategy, 2022-07-27) added support for the 'tip-commit' strategy and changed get_series_details to adjust the end commit of the series. Fix that by setting 'base_commit' to 'start_commit's parent only for the 'commit' strategy, and to 'start_commit' for other strategies. Signed-off-by: Philippe Blain <levraiphilippeblain@gmail.com> Link: https://msgid.link/20230221-fix-base-commit-for-non-commit-strategies-v1-1-0e31f1333d76@gmail.com Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2023-03-03Abstract out our own get_payload for better charset supportKonstantin Ryabitsev3-39/+46
When we use msg.get_payload(decode=True), we can't blindly call .decode() on that, because we need to pay attention to the charset of the message. We're already doing various checks for this elsewhere, so move that logic into a static method and use that whenever we need to get payload of a message that we didn't construct ourselves. Reported-by: Rob Herring <robh@kernel.org> Link: https://msgid.link/CAL_JsqJULTWSv8Ww3g=gdLTUqpcgJRD5HFXO_qsUK7L0JN7caw@mail.gmail.com Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2023-03-03init: up version to 0.12.2-devKonstantin Ryabitsev1-1/+1
Prepare for a round of backports. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2023-01-26Prepare for 0.12.1v0.12.1Konstantin Ryabitsev1-1/+1
Crashing on Python-3.8 is sufficient grounds for a bump release. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2023-01-26Update patatt to 0.6.3Konstantin Ryabitsev1-0/+0
There's a tiny fix in 0.6.3 that produces more RFC-compliant headers (if we go with the most pedantic reading of said RFC). Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2023-01-26Use typing compatible with python 3.8Konstantin Ryabitsev1-2/+2
Older python versions do not accept list[], only List[]. Reported-by: Jon Cormier <jcormier@criticallink.com> Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2023-01-26Up version to v0.12.1-devKonstantin Ryabitsev1-1/+1
Prepare hotfixes for 0.12 stable. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2023-01-20Up version to 0.12.0v0.12.0Konstantin Ryabitsev1-1/+1
Prepare for 0.12.0 release. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2023-01-19ez: always hide cover to/cc trailersKonstantin Ryabitsev6-39/+10
These tend to be super long for most patch series, so make hiding the cover letter To/Cc trailers the default and only behaviour. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2023-01-19Use a separate clear_cache functionKonstantin Ryabitsev1-11/+11
Instead of calling save_cache with a None, just use a separate function for clearing cache. This also fixes a logic bug in the cache clearing implementation that was causing a crash (missing return). Reported-by: Geert Uytterhoeven <geert@linux-m68k.org> Link: https://msgid.link/CAMuHMdVow8RkPzJ3F+tUqqFpuYX_-nrFNnNeskdc+Fr3T-O55Q@mail.gmail.com Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2023-01-19Improve compatibility for name quoting in addressesKonstantin Ryabitsev1-2/+7
Use actual list of special characters that require quoting in the name part of name <address> pairs. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2023-01-19Revert "ez: don't use --fork-point with merge-base"Konstantin Ryabitsev1-2/+2
This reverts commit 22e506935733d25ddbc49cc5cce1cd0b21c002e4. Apparently, this change broke tests, so back it out until we can investigate better. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2023-01-19ez: don't use --fork-point with merge-baseKonstantin Ryabitsev1-2/+2
Per discussion, don't use --fork-point when calling git-merge-base. We don't really want the historically accurate forkpoing point for our purposes, we just need to find the nearest common commit with the tracking branch. Suggested-by: Vishal Verma <vishal@kernel.org> Link: https://msgid.link/f886465ad1b69fad361aab450fbbc2fca14326b1.camel@kernel.org Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2023-01-19ez: fix minor off-by-one in Date header generationKonstantin Ryabitsev1-1/+1
When we generate patches, we set the Date: header to increment by one second with each consecutive patch. Start this counting with +1 to the series timestamp, to make sure that the cover letter is one second earlier than the first patch. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2023-01-19ez: when we find an smtp configuration, always use thatKonstantin Ryabitsev1-9/+14
This allows us to define a patch submission endpoint as a default setting, but use sendemail configs when they are defined. Suggested-by: Rob Herring <robh@kernel.org> Link: https://msgid.link/CAL_JsqLU8qb-aNGDZ45mq8_e=Oin6QY+8vBdfyUSPBFDVCFJEA@mail.gmail.com Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2023-01-19man: up the version and document b4 mbox -rKonstantin Ryabitsev2-4/+9
Preparing for the 0.12 release. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2023-01-13keys: add tessares.net/matthieu.baerts/defaultKonstantin Ryabitsev1-0/+124
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2023-01-13ez: treat cover-letter as git commit msgMatthieu Baerts1-18/+23
It is common to write the cover-letter in a merge commit message. For this reason, it is recommended to wrap it at 72 chars and have a short title. It is like a git commit message at the end while lines starting with '#' will be ignored. For this reason and to "trick" the text editor, the temp file is now called COMMIT_EDITMSG like the one generated by 'git commit'. At the end, the file didn't contain any restructured-text format. While at it, the default template is also wrapped to 72 chars. Signed-off-by: Matthieu Baerts <matthieu.baerts@tessares.net> Link: https://msgid.link/20230112-cover-letter-72-chars-v1-1-69b15b1e3fef@tessares.net Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2023-01-12prep: Allow configuration options when enrolling/creating branchRob Herring2-21/+23
I tried 'b4 prep -c -e v6.2-rc1' thinking I could populate the To/Cc list and enroll a branch in one step, but got this: Will collect To: addresses using get_maintainer.pl Will collect Cc: addresses using get_maintainer.pl Traceback (most recent call last): File "/home/rob/.local/bin/b4", line 33, in <module> sys.exit(load_entry_point('b4', 'console_scripts', 'b4')()) File "/home/rob/proj/b4/b4/command.py", line 359, in cmd cmdargs.func(cmdargs) File "/home/rob/proj/b4/b4/command.py", line 76, in cmd_prep b4.ez.cmd_prep(cmdargs) File "/home/rob/proj/b4/b4/ez.py", line 1875, in cmd_prep return auto_to_cc() File "/home/rob/proj/b4/b4/ez.py", line 1797, in auto_to_cc tos, ccs, tag_msg, patches = get_prep_branch_as_patches() File "/home/rob/proj/b4/b4/ez.py", line 1113, in get_prep_branch_as_patches prefixes = tracking['series'].get('prefixes', list()) KeyError: 'series' Auto populating the To/Cc list currently has to be run by itself. That's an unnecessary restriction, and it is useful to do that as part of setting up a new or existing branch. The same applies to '--force-revision', '--set-prefixes', and '--edit-cover'. A side effect is these options will now be silently ignored if given with other sub-commands (e.g. --show-revision). Signed-off-by: Rob Herring <robh@kernel.org> Link: https://msgid.link/20230110-prep-opts-v1-2-8e7d7b861849@kernel.org Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2023-01-12prep: Fix splat with --auto-to-cc when a branch has no commitsRob Herring1-1/+6
Running 'b4 prep -c' on a branch with no commits will splat. Print a friendly message instead. Signed-off-by: Rob Herring <robh@kernel.org> Link: https://msgid.link/20230110-prep-opts-v1-1-8e7d7b861849@kernel.org Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2023-01-11Add save_mboxrd_mbox method for mbox savingKonstantin Ryabitsev2-3/+10
We shouldn't be calling save_git_am_mbox when we're not actually saving something for git-am consumption. Reported-by: Rob Herring <robh@kernel.org> Link: https://msgid.link/CAL_JsqKgd0ecQQFaJ243H=ir9hNvNoprDsSAsYNbsEOudUxDFg@mail.gmail.com Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2023-01-11tests: explicitly clone master branch from git bundleThomas Weißschuh1-1/+1
If not specified git tries to use the local default branch when cloning from a bundle. If the configuration "init.defaultBranch" is not "master" then the clone from the bundle will not actually clone anything, breaking all the tests. Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de> Link: https://msgid.link/20230108-tests-default-branch-v1-1-58000cfdf024@t-8ch.de Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2023-01-10ez: refuse to invoke send if repo is not cleanKonstantin Ryabitsev1-0/+6
Since a "send" operation will require repo modification when we tag it, refuse to operate if repo status is not clean. Reported-by: Rob Herring <robh@kernel.org> Link: https://msgid.link/CAL_JsqLU8qb-aNGDZ45mq8_e=Oin6QY+8vBdfyUSPBFDVCFJEA@mail.gmail.com Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2023-01-10Tweak wrap_header to allow decode/encode/clean operationsKonstantin Ryabitsev2-66/+69
Sometimes we want to decode headers into 8bit-clean, sometimes we want to encode them, and sometimes we want to leave everything as-is. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2023-01-10Work around another python email module bugKonstantin Ryabitsev2-27/+56
This works around the problem with commas in non-ascii names not being properly wrapped in quotes: https://github.com/python/cpython/issues/100900 Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2023-01-10ez: make X-B4-Tracking wrapping consistentKonstantin Ryabitsev1-2/+2
Use textwrap's internal tooling to properly align indented lines. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2023-01-09Don't break on hyphen when wrapping headersKonstantin Ryabitsev1-1/+2
We only want to break on whitespace. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2023-01-09tests: add another test for very long email addressKonstantin Ryabitsev1-0/+3
This tests for the bug reported here: https://github.com/python/cpython/issues/100884 Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2023-01-09Implement our own msg_to_bytesKonstantin Ryabitsev2-87/+135
WARNING: experimental. More testing needed. Attempt to work around the bugs we have found in the Python email module by implementing our own, very simple, dumping of message to bytes. Since we *only* work with plaintext non-mime messages, our needs are really quite simple and it should therefore be possible to avoid hitting Python's bugs by using our own header encoding tools. I'm not thrilled with this, but my bugs reported to Python have been sitting without any movement and even if the problem is fixed upstream, it will take months or years before we stop hitting these bugs in the wild. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2023-01-06ez: change behaviour for per-commit trailersKonstantin Ryabitsev1-25/+6
In order to be more compatible with what is expected from git-send-email (the principle of least surprise), treat other per-commit person-trailers the same way we treat Cc: trailers. They only receive the cover letter and those patches where they are in trailers. Suggested-by: Nathan Chancellor <nathan@kernel.org> Link: https://msgid.link/Y7h5%2FxItaBke0WbE%40dev-arch.thelio-3990X Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2023-01-06mbox: add --refetch commandKonstantin Ryabitsev3-3/+45
One of the changes in 0.11 was making "b4 am" generate messages in the same format as produced by "git format-patch" -- with minimal headers and performing the in-body-From and header-from replacements as necessary. This command allows refetching all messages in a mailbox file so they have their original headers and bodies. Suggested-by: Mark Brown <broonie@kernel.org> Link: https://msgid.link/Y7hb17cciwrXm4E1@sirena.org.uk Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2023-01-05ez: don't crash on non-existent tag in show_infoKonstantin Ryabitsev1-2/+5
Properly catch when a sent tag doesn't exist and move on to the next one. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2023-01-03ez: avoid header wrapping when writing to fileKonstantin Ryabitsev1-2/+5
Python's email module and git-send-email don't agree on what should happen with headers of certain lengths. Python likes to wrap things as follows: Subject: [PATCH v5 4/5] arm64: dts: rockchip: sync px30 DTSI with Linux kernel v6.1 This is kosher with RFC, but git-send-email has trouble parsing this format (which is really a problem with git-send-email, but I also agree that Python could be just breaking the line at the word boundary instead of moving the entire thing to the next line. This was introduced when we switched to the SMTP policy for dryrun output, which enforces header lengths. Reported-by: Quentin Schulz <quentin.schulz@theobroma-systems.com> Link: https://msgid.link/b79c49b3-5815-7100-e99c-440e1840b3f9@theobroma-systems.com Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2023-01-03ez: dedupe cover letter CCs taken from individual patchesKonstantin Ryabitsev1-1/+3
Make sure we don't duplicate addresses already added to CCs from previous individual patches. Reported-by: Nathan Chancellor <nathan@kernel.org> Link: https://msgid.link/Y6zeRaKlqNhh72OD@dev-arch.thelio-3990X Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2022-12-29Handle series with more than 999 patchesKonstantin Ryabitsev1-1/+1
Git will send up to 9999 patches in a series, so fix our regex to properly recognize series with more than 999 patches. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2022-12-27Always run log with --no-abbrev-commitKonstantin Ryabitsev1-0/+5
Some operations don't quite work when log.abbrevCommit is set, so make sure that we pass --no-abbrev-commit whenever we encounter a "git log" command. Reported-by: Bill Pemberton <wfp5p@worldbroken.com> Link: https://msgid.link/01304af2-3412-8385-3336-4dda9104336e@worldbroken.com Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2022-12-21ez: use default web endpoint when in the kernel repoKonstantin Ryabitsev4-19/+27
If we recognize that we're in the kernel repo (there is a Kconfig at toplevel), and if there are no [sendemail] entries defined anywhere in the config, default to using the kernel.org endpoint for sending patches. This should make it easier to get started from minimal configs. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2022-12-20ez: give better error message when patatt signing failsKonstantin Ryabitsev2-12/+29
Avoid giving an obtuse traceback when we don't find any usable keys (patatt or PGP) and suggest what the user can do to fix the problem. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2022-12-20ez: don't crash when there's no [sendemail] sectionKonstantin Ryabitsev1-2/+2
Do not crash if we do not have a [sendemail] section, which is normal for anyone using a web submission endpoint. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2022-12-19Update version to 0.12-devKonstantin Ryabitsev1-1/+1
0.11 branched to stable-0.11.y, so update master version to 0.12-dev. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2022-12-13ez: don't forget to set Date on the cover letterKonstantin Ryabitsev2-5/+6
Fixes a small regression that wasn't including a Date header on the cover letter. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2022-12-13Use git-credential if smtppass is not setKonstantin Ryabitsev1-0/+21
When we have smtpuser but smtpass is not set, invoke git-credential to request the password. Suggested-by: Luca Weiss <luca.weiss@fairphone.com> Link: https://msgid.link/COXAHN6YWLQH.33YW8LAHHXH21@otso Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2022-12-12ez: add a large REFLECT MODE noticeKonstantin Ryabitsev1-0/+8
It can be confusing and worrying to see the To: and Cc: headers populated in a message sent with --reflect. Not everyone necessarily knows that these headers aren't actually used for actual message delivery and all that matters is what you give the remote server during the "RCPT TO" stage of the SMTP connection. Add a large notice to alert contributors about this, so they don't worry that they accidentally sent something they didn't intend to send. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2022-12-12Fix regression on messages with attachmentsKonstantin Ryabitsev1-1/+8
Passing original messages through git mailinfo for scissors removal doesn't do the right thing when there are attachments like PGP signatures involved. Create an intermediary message containing minimal headers from the original message and just the body that we have identified as containing the patch. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2022-12-09ez: add sent-series info to b4 --show-infoKonstantin Ryabitsev1-0/+5
List series history information in the output of --show-info. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2022-12-09ez: fix regression that was causing duplicated addresseesKonstantin Ryabitsev1-2/+2
We were matching just address to the full name/address. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2022-12-09ez: add prep --show-infoKonstantin Ryabitsev6-11/+72
This dumps information about the current series in a format that can be parsed by other shell tools. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2022-12-09Always use re.split when splitting along '---'Konstantin Ryabitsev2-3/+3
Some lines may contain long dashes at the end, and some --- sections may not have a newline at the front. Always use re.split to avoid any problems with false-positives or false-negatives. Reported-by: Mark Brown <broonie@kernel.org> Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2022-12-09ez: refactor single-patch-series codeKonstantin Ryabitsev2-254/+246
The way I initially implemented single-patch series handling was too hurky and caused repeated problems with things like resend. This is a cleaner reimplementation of the same functionality. Link: https://social.kernel.org/notice/AQQySDDBI14Eqo3HZw # what is "hurky" Reported-by: Mark Brown <broonie@kernel.org> Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2022-12-08ez: don't require cover letter subjectKonstantin Ryabitsev1-3/+5
This should properly recognize when a cover letter doesn't have a single-line subject. Reported-by: Mark Brown <broonie@kernel.org> Link: https://msgid.link/Y5EbjU%2BW7vcqtE%2Fd%40sirena.org.uk Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2022-12-08ez: always hide cover-letter To/Cc trailers from single-patch seriesKonstantin Ryabitsev2-11/+39
When we're sending a single-patch series, hide the cover-letter To: and Cc: trailers from the mix-in content that goes under the ---. TODO: The To/Cc handling in general can be refactored to be more coherent. We're spending a lot of effort writing and then re-parsing the header/trailer addresses. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2022-12-08send-receive: don't write to the repo in reflect modeKonstantin Ryabitsev1-2/+2
The logic was incomplete and we were still writing to the public-inbox repo in reflect mode. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2022-12-08send: fix a bug with per-patch extra Cc'sKonstantin Ryabitsev2-4/+6
We weren't properly handling single-patch Cc's when not using the web endpoint (everyone was getting the entire series anyway). This should fix the functionality so one-off CC's will actually just get the cover letter and the patches intended for them. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2022-12-07send-receive: allow subjects with just [PATCH]Konstantin Ryabitsev1-1/+1
Single-patch v1 series have just [PATCH] at the start, so testing for "[PATCH " was causing a false-positive for "is this a patch" anti-abuse test. Reported-by: Noralf Trønnes <noralf@tronnes.org> Link: https://msgid.link/f8d14fd5-58e0-853d-64e0-72cc60e69629@tronnes.org Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2022-12-06ez: fix bugs when creating a prep-branch from single-patch seriesKonstantin Ryabitsev2-3/+14
We weren't properly setting the from-thread tracking variable when the series that we used as our base didn't have a cover letter (such as, a single-patch series). Additionally, there was a regression introduced by rewriting the message retrieval function that was ignoring the --from-thread parameter due to a collision on the "msgid" keyword in argparse. Reported-by: Mark Brown <broonie@kernel.org> Link: https://msgid.link/Y4%2FhIf%2Bo%2Fe3AtBCD%40sirena.org.uk Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2022-12-06ez: fix prep -n with a fork-point specifiedKonstantin Ryabitsev1-1/+3
Fix logic when a fork-point is used with the default commit strategy. Reported-by: Mark Brown <broonie@kernel.org> Link: https://msgid.link/Y4+9Fz7lkzSnFV72@sirena.org.uk Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2022-12-06docs: mark --reflect as 0.11+Konstantin Ryabitsev1-1/+1
The --reflect flag is new in 0.11. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2022-12-06docs: fix typo in the flag for --reflectKonstantin Ryabitsev1-4/+4
It's --reflect, not --reroll. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2022-12-06ez: show what actions will be done on sendKonstantin Ryabitsev1-13/+33
When we present the submitter with an option to Ctrl-C, show them exactly what will happen if they don't. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2022-12-06ez: implement b4 send --reflect modeKonstantin Ryabitsev7-24/+112
This implements a special testing mode that can be invoked with --reflect. It will still populate the To/Cc headers with the destination addresses, but will only email the address in "From:". This should be particularly useful when using the web endpoint, because this allows someone to check what their series will look like with the post-processing that is applied by the endpoint (for DMARC purposes, for example). Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2022-12-06ez: also allow seting extra prefixes via the cover letter subjectKonstantin Ryabitsev2-4/+19
In addition to using the --set-prefixes command, allow people to track extra prefixes via the cover letter subject line. Either approach can be used, with the cmdline switch working better for single-patch series, perhaps. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2022-12-05docs: minor update to the "--compare-to" docsKonstantin Ryabitsev1-1/+3
Mention why it's useful to run "--compare-to" before sending in a new revision. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2022-12-05docs: update documentation for "b4 ty"Konstantin Ryabitsev1-0/+4
This records that it's possible to configure "b4 ty" to always directly send email instead of requiring the -S flag. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2022-12-05ez: reimplement extra prefix functionalityKonstantin Ryabitsev8-37/+78
Previously, to add extra prefixes to the subject one had to pass them every time as "b4 send --prefixes". This is awkward, because many subsystems require that an identifier is added to all patches, such as "netdev" or "bpf", so we really should have a more permanent way to add prefixes to the series. This reimplements the functionality via "b4 prep --set-prefixes", e.g.: b4 prep --set-prefixes netdev Similarly, an RFC set of patches would get something like: b4 prep --set-refixes RFC netdev To delete any extra prefixes: b4 prep --set-prefixes '' Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2022-12-05man: update with 0.11 latest informationKonstantin Ryabitsev2-10/+42
Update manpages to match the latest changes in command switches. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2022-12-05kr: fix for API changes and add a default outputKonstantin Ryabitsev1-1/+3
When just running "b4 kr" nothing happened, so give at least some kind of message until we have a more fleshed out "b4 kr" command. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2022-12-05Don't use SMTP policy for DKIM validationKonstantin Ryabitsev1-1/+1
Using the SMTP policy causes some headers to be unnecessarily re-encoded into qp- or b64-escaped values, resulting in DKIM validation failures. Go back to using our custom policy to avoid false-negatives. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2022-12-02ez: change logic for individual patch Cc handlingKonstantin Ryabitsev1-4/+42
Based on feedback, change how we handle Cc: trailers in individual patches. Instead of adding them to the global Cc list, leave them per-patch, so automated tooling doesn't receive patches not intended for it. Individual patch CCs just receive the cover letter plus that patch. Link: https://msgid.link/20221201141642.uvonbrny4rhuacl5@meerkat.local Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2022-12-01b4: patatt: Update patatt from 0.6.0 => 0.6.2Douglas Anderson1-0/+0
As of commit 3847a92a365a ("validate: Use patatt's configured keyring as fallback"), you can see that we call patatt.get_config_from_git() in some cases. The patatt module doesn't have get_config_from_git() as of 0.6.0. Update to 0.6.2, the newest version. Fixes: 3847a92a365a ("validate: Use patatt's configured keyring as fallback") Signed-off-by: Douglas Anderson <dianders@chromium.org> Link: https://msgid.link/20221201152814.1381855-1-dianders@chromium.org Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2022-12-01send-receive: work around some bugs in python's encoding handlerKonstantin Ryabitsev1-5/+11
Expect to receive 7bit-clean header content from the client-side of b4 send and clean it up properly when doing header substitution. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2022-12-01tests: add a basic test for 7bit-header-handlingKonstantin Ryabitsev2-0/+34
We need more tests here, but this will perform a basic comparison test. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2022-12-01Work around deficientices in Python's email.policy implementationsKonstantin Ryabitsev2-11/+62
I have discovered some annoying bugs[1] in the way Python handles 8bit content in the headers, so implement a sevenbitification routine to make sure that all content we send is 7bit-clean in the headers. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2022-11-30Fix crasher on handling renamed filesKonstantin Ryabitsev1-2/+3
Fix a small logical error when handling renamed files in preparation for diff and 3-way. Fixes: 10cabf05b0404f7a87522180750d003985211814 (Fix 'LoreSeries::make_fake_am_range' with renamed, then modified file) Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2022-11-30Fix a crash on invalid To: and Cc: headersKonstantin Ryabitsev1-2/+10
Unfortunately, vger creates non-parseable To: headers when there's nothing in the To: field: To: unlisted-recipients:; (no To-header on input) This commit fixes the crash. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2022-11-29Don't use from_string/as_string wherever possibleKonstantin Ryabitsev4-19/+13
Switch to using as_bytes/from_bytes wherever possible in order to avoid problems when sending mail to SMTP servers not capable of handling clean 8bit header data. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2022-11-29Fix 'LoreSeries::make_fake_am_range' with renamed, then modified filePhilippe Blain1-19/+24
When invoking 'b4 diff', LoreSeries::make_fake_am_range is used to create the old and new versions of a series in a temporary worktree. The code is currently unprepared for a series that renames a file and then modifies it in a subsequent commit. The first issue is that LoreMessage::get_indexes fails to set blob_indexes for a renamed file since the 'diff --git' header for such a change has different file names for the "old" and "new" file, but that function skips any diff where "old" and "new" do not match. Fix that by removing that condition. The second issue is that LoreSeries::make_fake_am_range itself is unprepared for a series that renames a file and then modifies it in a separate commit. This is because when processing each commit to create the "Initial fake commit", the file is added to the index with its new name when the commit that modifies it is processed. This causes the 'git am' invocation to fail at the earlier rename patch, because the new file name is already in the index (since it was created in the "Initial fake commit"). Fix this by also recording the new file name in the 'blob_indexes' tuple, in addition to the old file name and hash, and making use of this new information in 'make_fake_am_range' by explicitely checking for rename patches when processing each commit to create the "Initial fake commit", adjusting the 'seenfiles' list accordingly. Note that we must also adjust the other user of 'blob_indexes', LoreSeries::populate_indexes. For consistency, also rename local variables: - in 'get_indexes', rename 'curfile' to 'oldfile' - in 'populate_indexes', rename 'fn' (filename) and 'bh' (blob hash) to 'ofn' and 'obh' (old ") - in 'make_fake_am_range', rename 'fn' and 'fi' (file index) to 'ofn' and 'ofi' (idem) Signed-off-by: Philippe Blain <levraiphilippeblain@gmail.com> Link: https://msgid.link/20221107134054.75514-1-levraiphilippeblain@gmail.com Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2022-11-29Remove b4 version from signatureKonstantin Ryabitsev1-1/+1
We already have the version recorded in X-Mailer, so remove it from the signature and leave just the git version. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2022-11-29tests: update tests for ez/preserve-tripledashKonstantin Ryabitsev3-24/+79
Test that we properly preserve --- info in commits. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2022-11-29ez: preserve content under '---' in commitsKonstantin Ryabitsev1-5/+14
Git commits may contain info under the '---', which is sent along with the patch, but is ignored when the patch is being applied to a tree. When we process received trailer updates, make sure we don't strip this extra info from actual commits in the git tree. Reported-by: Maxime Ripard <maxime@cerno.tech> Link: https://msgid.link/20221109141459.ud2wofasq2jozmks@houat Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2022-11-29ez: make sure base-branch is setKonstantin Ryabitsev1-4/+6
When our cover strategy isn't "commit", we need to make sure that base-branch is always set. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2022-11-25am: output minimal headers for am-ready mboxesKonstantin Ryabitsev16-87/+22
When generating am-ready mboxes, write them out with minimal headers. If someone needs to treat these as real mboxes for the purposes of responding to messages, they need to "b4 mbox" anyway, since they will probably want to see the entire thread context. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2022-11-24send-receive: improve From: rewritingKonstantin Ryabitsev2-8/+34
This improves From: header rewriting in a number of ways: 1. Adds the original address via the recipient delimiter, so we don't send everything from the same address. Mostly, this should hopefully help with tools like patchwork that still don't properly pay attention to the X-Original-From field. 2. Only adds the in-body From: header if a message contains a diff (i.e. not to cover letters). Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2022-11-24send-receive: properly set SMTP policy on smtp sendKonstantin Ryabitsev1-3/+2
When we're sending via SMTP, make sure we've properly set the SMTP policy. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2022-11-24ez: make x-b4-tracking header versionedKonstantin Ryabitsev1-2/+9
Instead of just dumping the base64 encoded string into the header value, version it so we can modify its behaviour in the future. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2022-11-24send: use SMTP policy when generating messages for SMTP deliveryKonstantin Ryabitsev1-11/+8
We're still better off using 7bit-escaped headers when doing actual SMTP delivery, so if we're going to actually talk to an SMTP server, use email.policy.SMTP to escape all 8bit content in the headers. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2022-11-24Fix tests for the BytesGenerator internal changeKonstantin Ryabitsev3-4/+30
Fix tests to pass a BytesIO/binary handler for BytesGenerator purposes. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2022-11-24Use BytesGenerator for saving am-ready mboxesKonstantin Ryabitsev4-22/+25
Switch to using BytesGenerator when saving mboxes for git-am consumption. This fixes the problem of the default generator forcing headers to 7-bit. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2022-11-22Don't convert to bytes for verification payloadKonstantиn Ryabitsev1-1/+1
I'm not sure why I was encoding into bytes here, as it's not necessary at all. This additionally uncovered an annoying gotcha: auth_verify will crash when the simplejson library is not available, because in that case the requests library will use python's standard json, which does not accept bytes as dict values. Since simplejson merely decodes all bytes back into unicode strings, just removing the encode() call here should be enough to work with both backend libraries without any changes required on the API end. Reported-by: Noralf Trønnes <noralf@tronnes.org> Link: https://msgid.link/4161738f-e2df-2d8e-7646-2c61df2f76b9@tronnes.org Signed-off-by: Konstantиn Ryabitsev <konstantin@linuxfoundation.org>
2022-11-22Update signature stringKonstantin Ryabitsev1-1/+1
We should record the version of git as well as the version of b4 used. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2022-11-15Ensure that we always decode message payloadKonstantin Ryabitsev5-20/+29
We can never be sure when we're receiving a message that's been QP- or base64-encoded, so make sure that whenever we're using get_payload(), that we decode it. Reported-by: Dmitry Torokhov <dmitry.torokhov@gmail.com> Link: https://msgid.link/Y2ScVwTlqH/zz36J@google.com Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2022-11-01trailers: recognize a follow-up trailer even if missing Re: in subjectKonstantin Ryabitsev4-1/+84
Sometimes the subject of a message is missing a Re: (or any other marker we recognize as "this is a reply"), but it's a reply nevertheless. If such message is containing a follow-up trailer and no patch of its own, then add it to replies. Reported-by: Geert Uytterhoeven <geert@linux-m68k.org> Link: https://msgid.link/CAMuHMdUsfc-NNHswtS8jjhWFwk4fX2yvynKh4q0x_u01bnUQBA@mail.gmail.com Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2022-10-31ez: set proper from address when sendemail.from is presentKonstantin Ryabitsev3-24/+42
When we have a sendemail.from, we should be using it over whatever our user.name and user.email is set to. Reported-by: Quentin Schulz <quentin.schulz@theobroma-systems.com> Link: https://msgid.link/9bdb42f7-661a-77ed-97e5-33ba7a31fd9e@theobroma-systems.com Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2022-10-28docs: remove --use-project documentation (gone)Konstantin Ryabitsev3-15/+0
We're no longer relying on --use-project, so drop that from the documentation. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2022-10-28mbox: general cleanupsKonstantin Ryabitsev1-10/+6
Remove unused imports left over from previous --check-newer implementation and set typing on all defs. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2022-10-27Drop --use-project and reimplement --check-newerKonstantin Ryabitsev5-170/+95
New public-inbox instances have much better querying capabilities, so drop the use of --use-project and reimplement check-newer to use actual query language. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2022-10-27ez: fix subject matching for trailers -uKonstantin Ryabitsev2-7/+21
When comparing trailers by subject instead of by patch-id, we trying to match a stripped subject (without all [PATCH foo] prefixes) with a non-stripped subject, which is why it was failing and we *only* matched by patch-id. Reported-by: Rob Herring <robh@kernel.org> Link: https://msgid.link/CAL_JsqJVY5Mk0e+wLXQBJnY0OwR=vh24MhqTqmaozBjaBAULKQ@mail.gmail.com Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2022-10-27tests: add initial tests for ezKonstantin Ryabitsev9-30/+639
Tests prep and simple trailers cases. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2022-10-27tests: test shazam -M and shazam -HKonstantin Ryabitsev4-3/+85
This required adding some hacky code so we don't execvp from inside a test, but it's semi-kosher per pytest docs. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2022-10-27Improve --offline-mode and add --no-stdinKonstantin Ryabitsev6-73/+84
As part of continued test harness work, improve support for --offline-mode and add --no-stdin, as suggested (but on a global level, not just for pr). Suggested-by: Palmer Dabbelt <palmer@rivosinc.com> Link: https://msgid.link/20221012230211.29402-1-palmer@rivosinc.com Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2022-10-26tests: properly use fixturesKonstantin Ryabitsev5-34/+106
Improve our test harness by properly using pytest fixtures. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2022-10-26Add global --offline-mode switchKonstantin Ryabitsev4-1/+16
This isn't yet implemented across all subcommands, but it gives us a central place to turn off all functionality that requires the user to be online (DKIM lookups, remote public-inbox hits, etc). This is currently mostly useful for tests. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2022-10-25tests: initial framework to test git-modifying functionalityKonstantin Ryabitsev5-2/+316
I need a framework to test functionality that modifies git repos directly. This is the initial work to get that in place, though it needs to be significantly enhanced to make sure that we don't use my local configs. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2022-10-25Silence the pyopenssl deprecation warningKonstantin Ryabitsev1-0/+2
It's from the requests library, so we don't care about seeing it. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2022-10-19am: ignore base-commit info if commit not presentKonstantin Ryabitsev1-0/+8
When a base-commit is specified, but the actual commit is not present in the repository, then ignore it and use best-guess logic instead. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2022-10-19Do not treat trailers containing :// as person-trailersKonstantin Ryabitsev1-1/+1
Email addresses cannot contain ://, so when we encounter that, we know that it is an utility, not a person-trailer. Reported-by: Rob Herring <robh@kernel.org> Link: https://msgid.link/CAL_JsqJVY5Mk0e+wLXQBJnY0OwR=vh24MhqTqmaozBjaBAULKQ@mail.gmail.com Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2022-10-19ez: do not crash on empty cover letterKonstantin Ryabitsev2-2/+7
The cover letter may contain no content, especially if it's the first revision of a single-patch series. Do not crash when this happens. Reported-by: Bjorn Helgaas <helgaas@kernel.org> Link: https://msgid.link/20221019193959.GA34903@bhelgaas Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2022-10-18shazam: Don't use "git merge --edit" when non-interactivePalmer Dabbelt1-1/+6
Most text editors are interactive, so call "git merge --no-edit" when in b4's non-interactive mode. Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com> Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2022-10-18ty: add ability to always send mailKonstantin Ryabitsev2-3/+13
When b4.ty-send-email is set to "yes", we will always send mail directly instead of generating .thanks files. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2022-10-18Add a doc for contributorsPalmer Dabbelt1-0/+10
No idea if this is accurate, but I'm trying to send some patches and didn't find anything else documenting how to do so. I'm following my own guide to see how accurate it is... Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com> Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2022-10-18mbox: Exit with error code if no messages were foundNicolas Schier1-1/+1
When mbox.main() is unable to retrieve any messages, some kind of error happend (e.g. msgid has not been found). Forward error state to the parent process by exiting with exit code 1, to allow proper handling. Signed-off-by: Nicolas Schier <n.schier@avm.de> Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2022-09-30ez: initial prep --compare-to implementationKonstantin Ryabitsev5-33/+86
It is useful to be able to see the difference between the version that you have previously sent and the current working branch. This is the initial implementation that can be further improved to allow passing range-diff options. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2022-09-28Fall back on user.email if sendemail.from not setKonstantin Ryabitsev1-0/+5
If we don't find a sendemail.from, then fall back to using user.email and hope for the best. Reported-by: Neil Armstrong <neil.armstrong@linaro.org> Link: https://msgid.link/eb5d38af-ed64-38fd-2515-e489120cbb0b@linaro.org Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2022-09-27docs: use double quotes for pipe_sepKonstantin Ryabitsev2-2/+2
Mutt treats single quotes and double quotes differently, and this configuration option requires double quotes. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2022-09-27mbox/am: add --stdin-line-sep optionKonstantin Ryabitsev7-4/+63
For all the good things it has going for it, mutt has some questionable design choices, like how it handles piping multiple messages. Instead of supporting a sensible option like "pipe as a valid mbox", it will instead simply concatenate all messages together. The only option is to tell mutt to use a $pipe_sep variable, but then the receiving end has to know which string was used. This change supports passing --stdin-line-sep to mbox/am/shazam commands. See docs for details. Suggested-by: Peter Zijlstra <peterz@infradead.org> Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2022-09-22ez: fix commit corruption on trailers -uKonstantin Ryabitsev1-1/+1
Fixes a regression introduced to b4 trailers due to the recent refactor. Fixes: 6c215d8347 (ez: don't send a cover letter for a 1-patch series) Reported-by: Dmitry Torokhov <dmitry.torokhov@gmail.com> Link: https://msgid.link/YyzW46WQ47HUKTSx@google.com Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2022-09-22ez: handle full 'Firstname Lastname <email>' parametersKonstantin Ryabitsev1-8/+11
Do the right thing in case we receive addresses with names via cmdline, e.g.: b4 send --to 'Firstname Lastname <first.last@example.com>' Reported-by: Dmitry Torokhov <dmitry.torokhov@gmail.com> Link: https://msgid.link/YyzPSrTcGliahL+a@google.com Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2022-09-22ez: don't send a cover letter for a 1-patch seriesKonstantin Ryabitsev3-86/+194
Change the behaviour of single-patch series. Instead of insisting on sending the cover letter, mix it into the patch itself by appending it to the below-the-cut portion of the patch. Suggested-by: Amjad Ouled-Ameur <aouledameur@baylibre.com> Link: https://msgid.link/3b1af982-83f1-d5ed-6df1-c654df481899@baylibre.com Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2022-09-22ez: generate patch with diffstatKonstantin Ryabitsev1-1/+2
When generating patches from commit range, add a diffstat for a fuller compatibility with the default git-format-patch behaviour. Reported-by: Guillaume Ranquet <granquet@baylibre.com> Link: https://msgid.link/CABnWg9uBOGqJMq=yCtn7SoEME=+2u1-ZK9ftb6=_jRhkhL_jiw@mail.gmail.com Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2022-09-20docs: fix patchwork documentationKonstantin Ryabitsev2-14/+15
The patchwork documentation was incorrect: 1. it was claiming that 0.9 supported patchwork 2. it was claiming that some settings had defaults This should fix both problems. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2022-09-20smtp: more fully implement sendemail cmdline compatibilityKonstantin Ryabitsev1-1/+12
Implement the sendmail cmdline compatibility similarly to how it is done by git-send-email. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2022-09-20Skip running smtp.quit to avoid checks for smtp serverKonstantin Ryabitsev1-1/+0
B4 is not a long-running process, so we don't need to explicitly close the smtp connection. This avoids the problem of checking if "smtp" is actually an external sendmail-compatible command. Reported-by: Leon Romanovsky <leon@kernel.org> Link: https://msgid.link/YymDlmJG8fNhvHSY@unreal Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2022-09-16Update master version to 0.11-devKonstantin Ryabitsev1-1/+1
Version 0.10.0 is out, time to dial this up to 11. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2022-09-16setup: update install_requiresKonstantin Ryabitsev1-4/+5
Update install_requires to match the latest supported versions and pull in git-filter-repo on default install. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2022-09-16trailers: add a trailers-ignore-from config optionKonstantin Ryabitsev4-3/+68
With bots frequently responding to patch submissions and providing a suggested trailer to include *once the problem is fixed*, give folks an option to ignore any trailers from certain email addresses via the trailers-ignore-from config setting. Suggested-by: Lucas De Marchi <lucas.demarchi@intel.com> Link: https://msgid.link/20220916163101.2ij6uznmymqvgklt@ldmartin-desk2.lan Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2022-09-16command: add a link to online documentationKonstantin Ryabitsev1-1/+2
Print a link to the online documentation on --help invocation. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2022-09-16docs: proofread and fixesKonstantin Ryabitsev10-104/+159
A slew of proofreading fixes to documentation. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2022-09-15man: add prep, send, trailers subcommandsKonstantin Ryabitsev2-149/+261
Also, trim the configuration section and just give a link to the online docs for it. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2022-09-15docs: --save-maildir is not available with shazamKonstantin Ryabitsev1-6/+6
Fix the section on commands available for both am and shazam. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2022-09-15docs: remove redundant "b4" from section titlesKonstantin Ryabitsev6-12/+12
We don't need to duplicate b4 on every maintainer subcommand document. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2022-09-15docs: add an admonition about existing PGP keysKonstantin Ryabitsev1-1/+7
Add a more visible note that generating a patatt key is not required if you already have a PGP key configured. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2022-09-15docs: add "available since" version numbersKonstantin Ryabitsev3-23/+34
Some features are only available in recent versions of b4, so mark those that are new to v0.8 and later. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2022-09-15README: link to online documentationKonstantin Ryabitsev1-40/+1
Remove outdated sections and link to online documentation at b4.docs.kernel.org. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2022-09-15docs: add some cross-referencesKonstantin Ryabitsev3-22/+46
Complete the configuration file section and add some cross-references where needed. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2022-09-15docs: add b4 trailers documentationKonstantin Ryabitsev1-1/+36
Completes the "ez" set of features added in 0.10. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2022-09-15docs: break out of infinite loopKonstantin Ryabitsev1-1/+1
Despite what it may seem sometimes, working on a series is not an infinite loop. :) Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2022-09-15docs: add the bulk of the b4 send documentationKonstantin Ryabitsev1-1/+222
Document most salient information about b4 send. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2022-09-15docs: add the bulk of documentation for b4 prepKonstantin Ryabitsev1-1/+245
This covers most of the workflow details for using b4 prep. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2022-09-14docs: add overview for the contributor sectionKonstantin Ryabitsev4-7/+76
The hope is to complete the rest tomorrow so we can plan version 0.10.0 release some time in the next short while. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2022-09-14docs: complete most of the maintainer docsKonstantin Ryabitsev10-16/+316
Some of the articles are still barely more than stubs, but it's better than nothing at all. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2022-09-14docs: document b4 am/shazam optionsKonstantin Ryabitsev3-50/+218
Add documentation for b4 am and b4 shazam. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2022-09-13docs: add more docs for configuration optionsKonstantin Ryabitsev3-90/+316
Still lots to do, but we'll have good docs at the end of this. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2022-09-13Improve worktree-default configuration loadingKonstantin Ryabitsev2-13/+22
If we find a ~/.b4-config, we load it up before parsing any other configuration values we find. This allows us to override any worktree defaults by user-specific settings. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2022-09-13Improve the web endpoint validity checkKonstantin Ryabitsev2-3/+3
Check that it actually starts with https://. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2022-09-13Only accept web urls as valid endpointsKonstantin Ryabitsev3-5/+14
With .b4-config being able to specify endpoint defaults, allow users to override it in their local configuration by setting send-endpoint-web to "no" (or any other non-URL string). Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2022-09-13Don't crash on DKIM resolver failuresKonstantin Ryabitsev1-2/+9
There are many different exceptions thrown by the DKIM dns resolver, so we can't possibly expect and catch them all cleanly. Do a blanket try/catch for anything that bubbles up and mark DKIM as failed when that happens. Reported-by: Mark Brown <broonie@kernel.org> Link: https://msgid.link/Yx8kXFRXB0chuYkL@sirena.org.uk Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2022-09-12Add toplevel .b4-config for b4 itselfKonstantin Ryabitsev1-0/+4
Folks who want to be able to contribute patches should be able to do it with b4 itself. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2022-09-12Allow defining in-tree .b4-config for send- parametersKonstantin Ryabitsev1-5/+22
We want to be able to allow projects using b4 for patch submission to define some toplevel parameters, such as where to send the series, or which endpoint to use. We only use this for b4.send- options, and for now don't override anything set in any other config files. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2022-09-12ez: fix crash on send-series-to/cc defined in configKonstantin Ryabitsev1-1/+1
Fixes a bug that caused wrong entries in the extra trailers list. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2022-09-12ez: modify default template to move trailers below commentsKonstantin Ryabitsev1-3/+3
The comments are throwing off our trailer parsing, so move the trailers below the comments describing how to use trailers. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2022-09-12ez: auto-populate To: and Cc: trailers at prep timeKonstantin Ryabitsev3-71/+164
Instead of running tocmd and cccmd at send-time, move it to the prep stage and store the results in the cover letter. This will allow developers to finecomb where the series should be sent. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2022-09-12ez: split --no-auto-to-cc into two commandsKonstantin Ryabitsev2-12/+14
Initial work on making the automatic addressee selection a bit more robust. I am not sure this is going quite the right way, but I wanted to make a point where we can go back to in case things go down the wrong path. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2022-09-08docs: reorder, add some more stubs, and some contentKonstantin Ryabitsev6-10/+277
I was going to write a lot more today, but *gestures widely at everything*. Hopefully, more to come tomorrow. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2022-09-07docs: add installation instructionsKonstantin Ryabitsev1-1/+67
Largely, this mirrors the README, but provides more information about installing and upgrading from pip vs. using the git checkout directly. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2022-09-07docs: add stubs for subtopicsKonstantin Ryabitsev13-3/+84
Mostly, I want to make sure that readthedocs is building things correctly. Actual documentation shortly forthcoming. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2022-09-07docs: create sphinx docs stubKonstantin Ryabitsev2-0/+12
The goal is to build it via github/rtd integration, so get a stub going so we can test that setup. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2022-09-07ez: add prep --manual-reroll COVER_MSGIDKonstantin Ryabitsev3-20/+40
For folks who prefer to do the actual sending using git-send-email or any other mechanism, provide a way to trigger the reroll magic manually. Suggested-by: Dmitry Torokhov <dmitry.torokhov@gmail.com> Link: https://msgid.link/Yxecq5DHE5oW0XJD@google.com Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2022-09-06Fix pr explode functionalityKonstantin Ryabitsev2-86/+55
I don't believe anything actually uses it, but it needed to be fixed anyway. I still might use it as part of the git pull archiving service. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2022-09-02Fix dedupe on using cached threadsKonstantin Ryabitsev1-5/+12
We were not properly running dedupe on cached threads, so fix it by only caching post-dedupe messages. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2022-09-01mbox: accept arbitrary public-inbox URLsKonstantin Ryabitsev1-1/+7
When "b4 am" or "b4 mbox" is passed an arbitrary URL that matches a public-inbox scheme but that doesn't match the midmask URL, assume the user knows what they are doing and attempt to retrieve the mbox. Suggested-by: Philippe Blain <levraiphilippeblain@gmail.com> Link: https://msgid.link/f2b0f3c1-d98d-979d-1513-18f2491f4267@gmail.com Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>