Skip to content

Commit

Permalink
tools/verifygitlog.py: Ignore comment lines in commit messages.
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
jimmo authored and dpgeorge committed Oct 6, 2022
1 parent 366c801 commit f6d06b3
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion tools/verifygitlog.py
Expand Up @@ -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):
Expand Down

0 comments on commit f6d06b3

Please sign in to comment.