diff --git a/scripts/check_commit_message b/scripts/check_commit_message index 09d7a849fc..dddc57b641 100755 --- a/scripts/check_commit_message +++ b/scripts/check_commit_message @@ -1,4 +1,5 @@ #!/usr/bin/env python +"""Checks that a commit message conforms the the style guide.""" import sys # Get the commit message location @@ -10,6 +11,10 @@ lines = list((line.rstrip() for line in open(commit_msg_filepath, 'r'))) # Remove all commented lines lines = [line for line in lines if len(line) == 0 or line[0] != '#'] +# Skip if this is an automated backport +if len(lines) >= 2 and 'cherry picked from commit' in lines[-2]: + sys.exit(0) + exit_code = 0 # Error: no commit message