aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWill Deacon <will@kernel.org>2024-03-04 13:42:40 +0000
committerKonstantin Ryabitsev <konstantin@linuxfoundation.org>2024-03-04 16:28:40 -0500
commit8a3d8bfae18ad1f4c72b91e6a8d37e12f9b5dcb4 (patch)
treec568bedcd69a7b377a6ecbe56df91a7563be70bc
parentbe3b0af6dfd18d42f91b39bd0070ae51206b2660 (diff)
downloadb4-8a3d8bfae18ad1f4c72b91e6a8d37e12f9b5dcb4.tar.gz
ty: Try subject matching for every commit before using trackers
Nicolin reports that 'b4 ty' produced a "thank you" letter with incorrect commit IDs: https://lore.kernel.org/r/ZeDtfKMUXnOnJOic@Asurada-Nvidia This appears to be because of the creative use of Message-Ids in the series at: https://lore.kernel.org/r/0-v6-96275f25c39d+2d4-smmuv3_newapi_p1_jgg@nvidia.com For example, comparing the Message-Id of patches 1 and 11 of that series, we can see that one is a substring of the other: Message-Id: <1-v6-96275f25c39d+2d4-smmuv3_newapi_p1_jgg@nvidia.com> Message-Id: <11-v6-96275f25c39d+2d4-smmuv3_newapi_p1_jgg@nvidia.com> This confuses auto_locate_series(), as it will end up matching the Message-Id of patch 1 with the Link: tag in patch 11 and therefore get the wrong patch/commit association. Fix this problem by trying to match each commit based on the Subject before falling back to the fuzzier tracker-based matching. Reported-by: Nicolin Chen <nicolinc@nvidia.com> Signed-off-by: Will Deacon <will@kernel.org>
-rw-r--r--src/b4/ty.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/b4/ty.py b/src/b4/ty.py
index a8bdabf..950c357 100644
--- a/src/b4/ty.py
+++ b/src/b4/ty.py
@@ -217,7 +217,13 @@ def auto_locate_series(gitdir: Optional[str], jsondata: dict, branch: str,
success = True
matches += 1
break
- elif len(patch) > 2 and len(patch[2]) and len(commit[2]):
+
+ if success:
+ continue
+
+ # try to locate by tracker
+ for pwhash, commit in commits.items():
+ if len(patch) > 2 and len(patch[2]) and len(commit[2]):
for tracker in commit[2]:
if tracker.find(patch[2]) >= 0:
logger.debug('Matched using recorded message-id')