Skip to content

Commit f6d06b3

Browse files
jimmodpgeorge
authored andcommitted
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 <[email protected]>
1 parent 366c801 commit f6d06b3

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

tools/verifygitlog.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,10 @@ def run(args):
102102
filename = args[-1]
103103
verbose("checking commit message from", filename)
104104
with open(args[-1]) as f:
105-
lines = [line.rstrip("\r\n") for line in f]
105+
# Remove comment lines as well as any empty lines at the end.
106+
lines = [line.rstrip("\r\n") for line in f if not line.startswith("#")]
107+
while not lines[-1]:
108+
lines.pop()
106109
verify_message_body(lines, err)
107110
else: # Normal operation, pass arguments to git log
108111
for sha in git_log("%h", *args):

0 commit comments

Comments
 (0)