From cddc719bd1647b0dee39cc65f68cd4417610b667 Mon Sep 17 00:00:00 2001 From: Simon Michael Date: Mon, 7 Feb 2022 09:46:55 -1000 Subject: [PATCH] tools: commitlint: allow a git "fixup! " prefix (Allows git commit --fixup and magit c F to work) --- tools/commitlint | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/commitlint b/tools/commitlint index 212f75868..a05bc3270 100755 --- a/tools/commitlint +++ b/tools/commitlint @@ -66,7 +66,8 @@ function checkmsg() # there can be zero or more topic prefixes of increasing depth # a topic prefix must begin with a word character, can contain spaces/slashes/commas # (so potentially multiple topic labels, eg "imp: bs, cf, is: cli/doc: blah blah") - elif ! echo "$SUMMARY" | grep -qE '^( *; *)?\w+( *!)? *: *(\w[\w,/ ]* *: *)*' + # Also permit a git "fixup! " prefix. + elif ! echo "$SUMMARY" | grep -qE '^(fixup! )?( *; *)?\w+( *!)? *: *(\w[\w,/ ]* *: *)*' then # shellcheck disable=SC2059 printf "$FMT" "$HASH" "$SUMMARY" "${RED}[FAIL]"