aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKonstantin Ryabitsev <konstantin@linuxfoundation.org>2023-07-19 14:45:49 -0400
committerKonstantin Ryabitsev <konstantin@linuxfoundation.org>2023-07-19 14:45:49 -0400
commita951b8fe4a5f9bfd915e4a6cf998539d5f063834 (patch)
treef9923134a1734793746ec043c22326ec8ef69ce5
parent902480fcb975912222ebf4a4b5972ec23948a412 (diff)
downloadkorg-helpers-a951b8fe4a5f9bfd915e4a6cf998539d5f063834.tar.gz
git-patchwork-bot: support histogram patches
When we cannot match a commit to any patches, try to regenerate it again with the histogram algorithm in case the original patch was sent using that option. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
-rwxr-xr-xgit-patchwork-bot.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/git-patchwork-bot.py b/git-patchwork-bot.py
index 1cb123a..8941b97 100755
--- a/git-patchwork-bot.py
+++ b/git-patchwork-bot.py
@@ -1228,8 +1228,11 @@ def pwrun(repo: str, rsettings: Dict[str, Union[str, list, dict]]) -> None:
logger.info(' Regenerating %s using --histogram diff algorithm', rev)
info = git_get_rev_info(repo, rev, algorithm='histogram')
hpwhash = get_patchwork_hash(info)
- logger.info(' Matching by --histogram hash: %s (%s)', hpwhash, logline)
- patch_ids = get_patchwork_patches_by_project_hash(rm, project_id, hpwhash)
+ if hpwhash != pwhash:
+ logger.info(' Matching by --histogram hash: %s (%s)', hpwhash, logline)
+ patch_ids = get_patchwork_patches_by_project_hash(rm, project_id, hpwhash)
+ else:
+ logger.info(' diff --histogram resulted in the same hash, ignoring')
if not patch_ids:
logger.info(' No match for: %s', logline)
continue