summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJim Mussared <jim.mussared@gmail.com>2022-10-06 10:06:56 +1100
committerDamien George <damien@micropython.org>2022-10-07 00:19:40 +1100
commitf6d06b3ce0f476f9edeaeae855876c83b61d9175 (patch)
treed6ca7556be53727e1f93312221dc811b7883d03b
parent366c801b3553191241e329c2f6d7f718f49af105 (diff)
tools/verifygitlog.py: Ignore comment lines in commit messages.
The "signed-off" check assumes that the Signed-off-by: line is the last, but there may me many lines of comments after this. Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
-rwxr-xr-xtools/verifygitlog.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/tools/verifygitlog.py b/tools/verifygitlog.py
index f9d98106d..5d45e4a4c 100755
--- a/tools/verifygitlog.py
+++ b/tools/verifygitlog.py
@@ -102,7 +102,10 @@ def run(args):
filename = args[-1]
verbose("checking commit message from", filename)
with open(args[-1]) as f:
- lines = [line.rstrip("\r\n") for line in f]
+ # Remove comment lines as well as any empty lines at the end.
+ lines = [line.rstrip("\r\n") for line in f if not line.startswith("#")]
+ while not lines[-1]:
+ lines.pop()
verify_message_body(lines, err)
else: # Normal operation, pass arguments to git log
for sha in git_log("%h", *args):