diff options
author | Ira Weiny <ira.weiny@intel.com> | 2023-12-07 21:42:37 -0800 |
---|---|---|
committer | Konstantin Ryabitsev <konstantin@linuxfoundation.org> | 2024-01-23 18:09:48 -0500 |
commit | 76426faacd9216b0a7115262c0058eb29e2d1d69 (patch) | |
tree | c2d9642476e6e5a03cbb5fd0d81b4231e1397e8e | |
parent | dc0c5559df0ba626dd42d4fe144419585ea609ba (diff) | |
download | b4-76426faacd9216b0a7115262c0058eb29e2d1d69.tar.gz |
am: Build patch series when additional patches appear in a thread
Dan reported that am/shazam cherry-pick was failing with a particular
CXL series.[1]
$ b4 shazam -S -P _ 20231116-fix-cdat-devm-free-v1-1-b148b40707d7@intel.com
Grabbing thread from lore.kernel.org/all/20231116-fix-cdat-devm-free-v1-1-b148b40707d7@intel.com/t.mbox.gz
Checking for newer revisions
Grabbing search results from lore.kernel.org
Analyzing 8 messages in the thread
Specified msgid is not present in the series, cannot cherrypick
The reason is series processing failed to detect that a non reply follow
on message containing a patch was not a replacement for the original.
The way this patch was submitted (without a 'Re:' subject prefix) is
actually a good thing. This is because a reply would have implied a v2
to the original patch rather than a follow on patch as intended.
Teach b4 to interpret a thread like this by adding the additional patch
to the series with a warning. The series can then be applied as normal
or with a cherry-pick as was necessary in this case.
A run after the fix looks like this:
$ b4 shazam -S -P _ 20231116-fix-cdat-devm-free-v1-1-b148b40707d7@intel.com
Grabbing thread from lore.kernel.org/all/20231116-fix-cdat-devm-free-v1-1-b148b40707d7@intel.com/t.mbox.gz
Checking for newer revisions
Grabbing search results from lore.kernel.org
Analyzing 8 messages in the thread
WARNING: duplicate messages found at index 1
Subject 1: cxl/cdat: Free correct buffer on checksum error
Subject 2: cxl/pci: Get rid of pointer arithmetic reading CDAT table
2 is not a reply... assume additional patch
Checking attestation on all messages, may take a moment...
---
✓ [PATCH] cxl/cdat: Free correct buffer on checksum error
✗ No key: ed25519/ira.weiny@intel.com
✓ Signed: DKIM/intel.com
+ Reviewed-by: Robert Richter <rrichter@amd.com> (✓ DKIM/amd.com)
+ Reviewed-by: Fan Ni <fan.ni@samsung.com> (✗ DKIM/gmail.com)
+ Reviewed-by: Dave Jiang <dave.jiang@intel.com> (✓ DKIM/intel.com)
---
Total patches: 1 (cherrypicked: <20231116-fix-cdat-devm-free-v1-1-b148b40707d7@intel.com>)
---
Base: using specified base-commit 7475e51b87969e01a6812eac713a1c8310372e8a
Applying: cxl/cdat: Free correct buffer on checksum error
[1] https://lore.kernel.org/all/20231116-fix-cdat-devm-free-v1-1-b148b40707d7@intel.com/
Reported-by: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: Ira Weiny <ira.weiny@intel.com>
Tested-by: Dan Williams <dan.j.williams@intel.com>
Link: https://msgid.link/20231207-series-from-non-reply-reply-v1-1-cb02de53857c@intel.com
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
-rw-r--r-- | b4/__init__.py | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/b4/__init__.py b/b4/__init__.py index 89256a0..511fe4d 100644 --- a/b4/__init__.py +++ b/b4/__init__.py @@ -546,10 +546,20 @@ class LoreSeries: if self.patches[lmsg.counter] is not None: # Okay, weird, is the one in there a reply? omsg = self.patches[lmsg.counter] + + logger.warn('WARNING: duplicate messages found at index %s', lmsg.counter) + logger.warn(' Subject 1: %s', lmsg.subject) + logger.warn(' Subject 2: %s', omsg.subject) if omsg.reply or (omsg.counters_inferred and not lmsg.counters_inferred): # Replace that one with this one - logger.debug(' replacing existing: %s', omsg.subject) + logger.warn(' 2 is a reply... replacing existing: %s', omsg.subject) + self.patches[lmsg.counter] = lmsg + else: + logger.warn(' 2 is not a reply... assume additional patch') + self.patches.append(None) + self.expected = self.expected + 1 self.patches[lmsg.counter] = lmsg + self.patches[lmsg.counter + 1] = omsg else: self.patches[lmsg.counter] = lmsg self.complete = not (None in self.patches[1:]) |