Age | Commit message (Collapse) | Author | Files | Lines |
|
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>
|
|
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
|
|
Time for a small dot-release.
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
|
|
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>
|
|
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>
|
|
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>
|
|
Time for another minor release.
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
|
|
Get ready to release 0.12.3.
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
Lore links look nicer when we don't escape the '@'.
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
Time for some bugfixing backports.
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
|
|
Release 0.12.2 containing bugfixes.
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
|
|
Tiny tweak to make sure that manpages are rendered correctly.
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
Prepare for a round of backports.
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
|
|
Crashing on Python-3.8 is sufficient grounds for a bump release.
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
|
|
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>
|
|
Older python versions do not accept list[], only List[].
Reported-by: Jon Cormier <jcormier@criticallink.com>
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
|
|
Prepare hotfixes for 0.12 stable.
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
|
|
Prepare for 0.12.0 release.
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
Preparing for the 0.12 release.
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
|
|
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
Use textwrap's internal tooling to properly align indented lines.
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
|
|
We only want to break on whitespace.
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
|
|
This tests for the bug reported here:
https://github.com/python/cpython/issues/100884
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
|
|
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>
|
|
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>
|
|
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>
|
|
Properly catch when a sent tag doesn't exist and move on to the next
one.
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
0.11 branched to stable-0.11.y, so update master version to 0.12-dev.
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
|
|
Fixes a small regression that wasn't including a Date header on the
cover letter.
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
|
|
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>
|
|
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>
|
|
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>
|
|
List series history information in the output of --show-info.
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
|
|
We were matching just address to the full name/address.
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
The --reflect flag is new in 0.11.
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
|
|
It's --reflect, not --reroll.
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
|
|
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>
|
|
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>
|
|
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>
|
|
Mention why it's useful to run "--compare-to" before sending in a new
revision.
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
|
|
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>
|
|
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>
|
|
Update manpages to match the latest changes in command switches.
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
We need more tests here, but this will perform a basic comparison test.
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
Test that we properly preserve --- info in commits.
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
When we're sending via SMTP, make sure we've properly set the SMTP
policy.
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
|
|
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>
|
|
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>
|
|
Fix tests to pass a BytesIO/binary handler for BytesGenerator purposes.
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
|
|
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>
|
|
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>
|
|
We should record the version of git as well as the version of b4 used.
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
|
|
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>
|
|
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>
|
|
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>
|
|
We're no longer relying on --use-project, so drop that from the
documentation.
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
|
|
Remove unused imports left over from previous --check-newer
implementation and set typing on all defs.
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
|
|
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>
|
|
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>
|
|
Tests prep and simple trailers cases.
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
|
|
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>
|
|
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>
|
|
Improve our test harness by properly using pytest fixtures.
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
|
|
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>
|
|
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>
|
|
It's from the requests library, so we don't care about seeing it.
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
It is useful to be able to see the difference between the version that
you have previously sent and the current working branch. This is the
initial implementation that can be further improved to allow passing
range-diff options.
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
|
|
If we don't find a sendemail.from, then fall back to using user.email
and hope for the best.
Reported-by: Neil Armstrong <neil.armstrong@linaro.org>
Link: https://msgid.link/eb5d38af-ed64-38fd-2515-e489120cbb0b@linaro.org
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
|
|
Mutt treats single quotes and double quotes differently, and this
configuration option requires double quotes.
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
|
|
For all the good things it has going for it, mutt has some questionable
design choices, like how it handles piping multiple messages. Instead of
supporting a sensible option like "pipe as a valid mbox", it will
instead simply concatenate all messages together.
The only option is to tell mutt to use a $pipe_sep variable, but then
the receiving end has to know which string was used. This change
supports passing --stdin-line-sep to mbox/am/shazam commands. See docs
for details.
Suggested-by: Peter Zijlstra <peterz@infradead.org>
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
|
|
Fixes a regression introduced to b4 trailers due to the recent refactor.
Fixes: 6c215d8347 (ez: don't send a cover letter for a 1-patch series)
Reported-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Link: https://msgid.link/YyzW46WQ47HUKTSx@google.com
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
|
|
Do the right thing in case we receive addresses with names via cmdline,
e.g.:
b4 send --to 'Firstname Lastname <first.last@example.com>'
Reported-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Link: https://msgid.link/YyzPSrTcGliahL+a@google.com
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
|
|
Change the behaviour of single-patch series. Instead of insisting on
sending the cover letter, mix it into the patch itself by appending it
to the below-the-cut portion of the patch.
Suggested-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>
Link: https://msgid.link/3b1af982-83f1-d5ed-6df1-c654df481899@baylibre.com
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
|
|
When generating patches from commit range, add a diffstat for a fuller
compatibility with the default git-format-patch behaviour.
Reported-by: Guillaume Ranquet <granquet@baylibre.com>
Link: https://msgid.link/CABnWg9uBOGqJMq=yCtn7SoEME=+2u1-ZK9ftb6=_jRhkhL_jiw@mail.gmail.com
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
|
|
The patchwork documentation was incorrect:
1. it was claiming that 0.9 supported patchwork
2. it was claiming that some settings had defaults
This should fix both problems.
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
|
|
Implement the sendmail cmdline compatibility similarly to how it is done
by git-send-email.
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
|
|
B4 is not a long-running process, so we don't need to explicitly close
the smtp connection. This avoids the problem of checking if "smtp" is
actually an external sendmail-compatible command.
Reported-by: Leon Romanovsky <leon@kernel.org>
Link: https://msgid.link/YymDlmJG8fNhvHSY@unreal
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
|
|
Version 0.10.0 is out, time to dial this up to 11.
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
|
|
Update install_requires to match the latest supported versions and pull
in git-filter-repo on default install.
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
|
|
With bots frequently responding to patch submissions and providing a
suggested trailer to include *once the problem is fixed*, give folks an
option to ignore any trailers from certain email addresses via the
trailers-ignore-from config setting.
Suggested-by: Lucas De Marchi <lucas.demarchi@intel.com>
Link: https://msgid.link/20220916163101.2ij6uznmymqvgklt@ldmartin-desk2.lan
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
|
|
Print a link to the online documentation on --help invocation.
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
|
|
A slew of proofreading fixes to documentation.
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
|
|
Also, trim the configuration section and just give a link to the online
docs for it.
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
|
|
Fix the section on commands available for both am and shazam.
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
|
|
We don't need to duplicate b4 on every maintainer subcommand document.
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
|
|
Add a more visible note that generating a patatt key is not required if
you already have a PGP key configured.
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
|
|
Some features are only available in recent versions of b4, so mark those
that are new to v0.8 and later.
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
|
|
Remove outdated sections and link to online documentation at
b4.docs.kernel.org.
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
|
|
Complete the configuration file section and add some cross-references
where needed.
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
|
|
Completes the "ez" set of features added in 0.10.
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
|
|
Despite what it may seem sometimes, working on a series is not an
infinite loop. :)
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
|
|
Document most salient information about b4 send.
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
|
|
This covers most of the workflow details for using b4 prep.
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
|
|
The hope is to complete the rest tomorrow so we can plan version 0.10.0
release some time in the next short while.
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
|
|
Some of the articles are still barely more than stubs, but it's better
than nothing at all.
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
|
|
Add documentation for b4 am and b4 shazam.
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
|
|
Still lots to do, but we'll have good docs at the end of this.
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
|
|
If we find a ~/.b4-config, we load it up before parsing any other
configuration values we find. This allows us to override any worktree
defaults by user-specific settings.
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
|
|
Check that it actually starts with https://.
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
|
|
With .b4-config being able to specify endpoint defaults, allow users to
override it in their local configuration by setting send-endpoint-web to
"no" (or any other non-URL string).
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
|
|
There are many different exceptions thrown by the DKIM dns resolver, so
we can't possibly expect and catch them all cleanly. Do a blanket
try/catch for anything that bubbles up and mark DKIM as failed when that
happens.
Reported-by: Mark Brown <broonie@kernel.org>
Link: https://msgid.link/Yx8kXFRXB0chuYkL@sirena.org.uk
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
|
|
Folks who want to be able to contribute patches should be able to do it
with b4 itself.
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
|
|
We want to be able to allow projects using b4 for patch submission to
define some toplevel parameters, such as where to send the series, or
which endpoint to use. We only use this for b4.send- options, and for
now don't override anything set in any other config files.
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
|
|
Fixes a bug that caused wrong entries in the extra trailers list.
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
|
|
The comments are throwing off our trailer parsing, so move the trailers
below the comments describing how to use trailers.
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
|
|
Instead of running tocmd and cccmd at send-time, move it to the prep
stage and store the results in the cover letter. This will allow
developers to finecomb where the series should be sent.
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
|
|
Initial work on making the automatic addressee selection a bit more
robust. I am not sure this is going quite the right way, but I wanted to
make a point where we can go back to in case things go down the wrong
path.
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
|
|
I was going to write a lot more today, but *gestures widely at
everything*. Hopefully, more to come tomorrow.
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
|
|
Largely, this mirrors the README, but provides more information about
installing and upgrading from pip vs. using the git checkout directly.
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
|
|
Mostly, I want to make sure that readthedocs is building things
correctly. Actual documentation shortly forthcoming.
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
|
|
The goal is to build it via github/rtd integration, so get a stub going
so we can test that setup.
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
|
|
For folks who prefer to do the actual sending using git-send-email or
any other mechanism, provide a way to trigger the reroll magic manually.
Suggested-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Link: https://msgid.link/Yxecq5DHE5oW0XJD@google.com
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
|
|
I don't believe anything actually uses it, but it needed to be fixed
anyway. I still might use it as part of the git pull archiving service.
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
|
|
We were not properly running dedupe on cached threads, so fix it by only
caching post-dedupe messages.
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
|
|
When "b4 am" or "b4 mbox" is passed an arbitrary URL that matches a
public-inbox scheme but that doesn't match the midmask URL, assume the
user knows what they are doing and attempt to retrieve the mbox.
Suggested-by: Philippe Blain <levraiphilippeblain@gmail.com>
Link: https://msgid.link/f2b0f3c1-d98d-979d-1513-18f2491f4267@gmail.com
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
|