From 06fd3bb3494d305e862c226a1398b47a23fcbff0 Mon Sep 17 00:00:00 2001 From: Konstantin Ryabitsev Date: Fri, 19 Aug 2022 16:26:14 -0400 Subject: ez: fix logic error when using arbitrary threads for trailer updates Fixes a logic error that was picking the wrong starting commit in the "most recent contiguous range of our commits". Reported-by: Conor Dooley Link: https://msgid.link/e2ca58f1-3c10-0dc6-ebdb-3ca088b430d7@conchuod.ie Signed-off-by: Konstantin Ryabitsev --- b4/ez.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/b4/ez.py b/b4/ez.py index 3615130..05b9081 100644 --- a/b4/ez.py +++ b/b4/ez.py @@ -650,9 +650,7 @@ def update_trailers(cmdargs: argparse.Namespace) -> None: logger.critical('CRITICAL: could not find any commits where committer=%s', myemail) sys.exit(1) - prevparent = None - end = None - commit = None + prevparent = prevcommit = end = None for line in lines: commit, parent = line.split() if end is None: @@ -660,10 +658,13 @@ def update_trailers(cmdargs: argparse.Namespace) -> None: if prevparent is None: prevparent = parent continue + if prevcommit is None: + prevcommit = commit if prevparent != commit: break prevparent = parent - start = f'{commit}~1' + prevcommit = commit + start = f'{prevcommit}~1' else: logger.critical('CRITICAL: Please specify -F msgid to look up trailers from remote.') sys.exit(1) -- cgit v1.2.3