Age | Commit message (Collapse) | Author |
|
If we're processing a full https URL to the message, then unquote the
message ID before we use it.
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
|
|
Don't attempt a len() on an object that may be None. This happens when
there are patches prepared with a tool like quilt that don't include
indexes.
Reported-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
|
|
b4 tries to handle subject lines such as "[PATCHvX]" by replacing
the subject line in situ, but seems to do a rather bad job of it,
resulting in only the first patch of the series being picked up.
Fetching <20201026134931.28246-1-mark.rutland@arm.com> does exhibit
the problem.
Fixing the re.sub() expression allows normal funtionalities to be
restored, and the above series to be fetched.
Fixes: 6bf644f14b3f ("Deal with [PATCHvX] subject")
Signed-off-by: Marc Zyngier <maz@kernel.org>
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
|
|
It seems we don't have much control over what as_bytes() does, so switch
to using as_string(), setting our policy, and making sure that
content-transfer-encoding is set to 8bit.
Reported-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
|
|
Handle several corner cases when trying to cherrypick from incomplete
series.
Reported-by: Krzysztof Kozlowski <krzk@kernel.org>
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
|
|
Error out when we don't find any patches in an mbox when trying to diff
series.
Reported-by: Krzysztof Kozlowski <krzk@kernel.org>
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
|
|
We don't need to needlessly convert to unicode when dumping to stdout,
especially when it can lead to crashers when we encounter other
charsets.
Reported-by: Rob Herring <robh@kernel.org>
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
|
|
Apparently, merely passing policy= doesn't generate the full set of
required headers, so make sure we do set_charset('utf-8').
Reported-by: Michał Mirosław <mirq-linux@rere.qmqm.pl>
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
|
|
I can't think of any trailers that are shorter than 2 characters, so
tweak the regex to avoid one of the possible false positives.
Reported-by: Jonathan Corbet <corbet@lwn.net>
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
|
|
Don't check if a potential cover letter has a diffstat when processing
follow-up trailers.
Reported-by: Greg Kroah-Hartman <greg@kroah.com>
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
|
|
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
|
|
The get_body_parts() method added in ba6c790 (Parse body parts into
usual chunks, 2020-04-27) strips lines that look like trailers from
the last paragraph, storing the other lines to add back to the
message. However, if the commit message has only a single paragraph,
get_body_parts() returns early, unconditionally returning an empty
string for the message even if non-trailer lines were encountered.
Return the collected non-trailer lines, if any, as the message.
Signed-off-by: Kyle Meyer <kyle@kyleam.com>
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
|
|
The get_body_parts() method added in ba6c790 (Parse body parts into
usual chunks, 2020-04-27) splits the commit message body on "\n---\n"
and takes the second half as the "basement" of the patch. The body is
stripped of flanking new lines, though, so a delimiter beginning with
a new line isn't appropriate for commit messages without a message
body. Make the starting new line optional.
Note that this doesn't matter in the end in terms of the final applied
patch. Before 31f33fd (Fix body part parsing when '---' is not used,
2020-06-08), the expected patch output was produced despite the diff
lines being processed as the message body. After that commit, the
information following the triple dash is a bit off, but it doesn't
matter because git discards it anyway.
Signed-off-by: Kyle Meyer <kyle@kyleam.com>
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
|
|
It's a simple if/else to support maildirs for local operations, so let's
handle mbox -m to be a maildir.
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
|
|
Use 12 characters for the commit ID, similar to what
git log --oneline uses.
10 chars of ID is sometimes not enough and git.kernel.org
returns "Bad object ID". Example:
https://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux.git/commit/?id=482dcb2a04
Signed-off-by: Tudor Ambarus <tudor.ambarus@microchip.com>
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
|
|
Fix a crash when multiple patches fail attestation. Also fixes fancy
chechmarks.
Reported-by: Christian Brauner <christian.brauner@ubuntu.com>
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
|
|
Normally, we'd expect to always have a space between PATCH and other
prefixes, but be forgiving if it's not present.
Reported-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
|
|
Return early if we don't have a cover letter or patch 1/X to use as
basis for the subject-based query.
Reported-by: Christian Brauner <christian.brauner@ubuntu.com>
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
|
|
An apostrophe was added at the end of each generated link.
Drop it.
Signed-off-by: Tudor Ambarus <tudor.ambarus@microchip.com>
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
|
|
Don't crash if there is no matching ] in the subject. The culprit:
https://lore.kernel.org/lkml/20200612142621.GA8009@lenoir
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
|
|
Fix the same bug we've fixed before in another place -- when charset is
set to oddball value like charset=a, fallback to utf-8 and hope for the
best.
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
|
|
Ready for more bugfixes.
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
|
|
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
|
|
Fix mbox file naming problems introduced by adding "-o -".
Reported-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
|
|
Show the actual trailer name we're complaining about.
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
|
|
When the cover letter is missing and we're starting in the middle of the
thread, do not discard messages in the mbox that come before the msgid
that we want.
Reported-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
|
|
If the commit message is not separated from the diff using '---' as is
commonly the case, fall back to splitting by the word "diff".
Reported-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
|
|
Git mailinfo output is going to be in the same character set as
specified in the message headers, so we should not assume that we can
read it back in unicode.
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
|
|
Since we're piping out to stdout, there's obviously no reason to show
what the "git am" command should be -- especially if we delete the
temporary mbox file after the command completes.
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
|
|
By request, provide a way to output the results of b4 am to stdout. This
way it can be piped straight to "git am".
E.g.:
b4 diff 20200526205322.23465-1-mic@digikod.net -o - | git am
Requested-by: Rob Herring <robh@kernel.org>
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
|
|
Let's keep our code sources in plain old ascii.
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
|
|
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
|
|
I think it's time to have more people poking at the diff functionality.
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
|
|
Make sure we a) attempt to backfill the series if they are incomplete,
b) error out if the series is incomplete anyway
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
|
|
The original code used for b4 diff was to prepare for a 3-way merge by
making sure that all blob indexes exist in the local repo. Add this
functionality to "b4 am" and document all the features added in the
0.5.0 branch.
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
|
|
When we can't auto-find the previous version (usually because the cover
letter subject changes), suggest what to do: run b4 am -T and b4 diff on
both mboxes.
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
|
|
Sometimes we are unable to properly look up previous series -- usually
because the cover letter title changes. For those cases, it is now
possible to diff two arbitrary mbox files prepared with "b4 am -T".
There's also a smattering of other fixes in there because I'm too
lazy to properly stage my patches.
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
|
|
Also, make sure we display which versions we are diffing.
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
|
|
Don't make developers do copy-pasting unnecessarily. Switch to
outputting the diff by default, with flag options to save to file or
just show what needs to be done.
Additionally, adds caching to lookups and remember previously generated
fake-am ranges so we don't continuously generate loose objects on repeat
runs.
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
|
|
Need to figure this out earlier, but at least don't try to compare two
versions to itself.
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
|
|
Based on feedback from Jason Gunthorpe, implement diffing of series by
creating fake git-am commit ranges. Here's an easy example:
b4 diff 20200511192156.1618284-1-mic@digikod.net
Suggested-by: Jason Gunthorpe <jgg@ziepe.ca>
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
|
|
Git has a lot of internal logic matching free-form branch names to
actual branches, so don't try to second-guess what it finds acceptable.
Reported-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
|
|
Add changes to -P,--cherry-pick to the man page.
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
|
|
In addition to numerical ranges, -P is now also able to do:
- "-P _" to grab just the msgid used with "b4 am"
- "-P *glob*" to filter by commit message subject
Suggested-by: Rob Herring <robh@kernel.org>
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
|
|
Found via auto-testing in:
https://lore.kernel.org/linux-sgx/20200421215316.56503-13-jarkko.sakkinen@linux.intel.com/raw
This is wrong on many levels:
Content-Type: text/plain; charset=a
Assume utf-8 when something like this happens and don't fail.
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
|
|
Don't crash if the message in the References: is not available in the
thread.
Reported-by: Bjorn Helgaas <helgaas@kernel.org>
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
|
|
Git will try to helpfully disambiguate, but we just need consistency, so
always ask for a full refname.
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
|
|
Not all local branches are going to have matching [branch] entries --
sometimes there is only a [remote]. Deal with both cases.
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
|
|
While trying to be more permissive with messages selected manually with
-s, we broke auto-thankanator by making it match everything.
Reported-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
|
|
- we are now using ranges for ty -s/-d
- add am -P documentation for cherry-picking subsets of patches
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
|