From f06dcf9d1fa0cd7cb1bd562cdaaebf50dff325ea Mon Sep 17 00:00:00 2001 From: Nikos Nikoleris Date: Mon, 16 Nov 2020 12:09:34 +0000 Subject: [PATCH] util: Relax commit message checker to allow fixups Change-Id: I094de0a9cb65af0ba0a8700d77cd51c6537d7beb Signed-off-by: Nikos Nikoleris Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/37598 Tested-by: kokoro Reviewed-by: Daniel Carvalho Reviewed-by: Jason Lowe-Power Reviewed-by: Bobby R. Bruce Maintainer: Jason Lowe-Power --- util/git-commit-msg.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/util/git-commit-msg.py b/util/git-commit-msg.py index 2bddf1283..db0fbddcc 100755 --- a/util/git-commit-msg.py +++ b/util/git-commit-msg.py @@ -109,10 +109,12 @@ commit_message = open(sys.argv[1]).read() commit_message_lines = commit_message.splitlines() commit_header = commit_message_lines[0] commit_header_match = \ - re.search("^(\S[\w\-][,\s*[\w\-]+]*:.+\S$)", commit_header) + re.search("^(fixup! )?(\S[\w\-][,\s*[\w\-]+]*:.+\S$)", commit_header) if ((commit_header_match is None)): _printErrorQuit("Invalid commit header") -_validateTags(commit_header) +if commit_header_match.group(1) == "fixup! ": + sys.exit(0) +_validateTags(commit_header_match.group(2)) # Make sure commit title does not exceed threshold. This line is limited to # a smaller number because version control systems may add a prefix, causing -- 2.30.2