tools/verifygitlog.py: Show invalid commit subjects in quotes.
If a commit subject line has any trailing whitespace it won't match the repository validation rules, and the line will show up as part of the relevant error message. However, since there's no quotation marks around the offending text, the trailing whitespace may go unnoticed, and given that the commit message is then discarded when the commit operation is retried this can get fairly annoying. This commit simply modifies the error output for invalid subject lines to add quotation marks around the offending text, so trailing whitespace is much easier to see. Signed-off-by: Alessandro Gatti <a.gatti@frob.it>
This commit is contained in:
committed by
Damien George
parent
7ca6e5eb68
commit
4729a89504
@@ -47,7 +47,7 @@ def git_log(pretty_format, *args):
|
|||||||
|
|
||||||
|
|
||||||
def diagnose_subject_line(subject_line, subject_line_format, err):
|
def diagnose_subject_line(subject_line, subject_line_format, err):
|
||||||
err.error("Subject line: " + subject_line)
|
err.error('Subject line: "' + subject_line + '"')
|
||||||
if not subject_line.endswith("."):
|
if not subject_line.endswith("."):
|
||||||
err.error('* must end with "."')
|
err.error('* must end with "."')
|
||||||
if not re.match(r"^[^!]+: ", subject_line):
|
if not re.match(r"^[^!]+: ", subject_line):
|
||||||
|
|||||||
Reference in New Issue
Block a user