Skip to content

Commit 0a339c3

Browse files
committed
check-patches: ignore reverts
Ignore titles when they look like revert commits. Signed-off-by: Robin Jarry <[email protected]>
1 parent ea44955 commit 0a339c3

File tree

1 file changed

+13
-11
lines changed

1 file changed

+13
-11
lines changed

devtools/check-patches

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -55,17 +55,19 @@ for rev in $revisions; do
5555
title=$(git log --format='%s' -1 "$rev")
5656
fail=false
5757

58-
if [ "$(echo "$title" | wc -m)" -gt 72 ]; then
59-
err "title is longer than 72 characters, please make it shorter"
60-
fi
61-
if ! echo "$title" | grep -qE '^[a-z0-9,{}/_-]+: '; then
62-
err "title lacks a lowercase topic prefix (e.g. 'ipv6:')"
63-
fi
64-
if echo "$title" | grep -qE '^[a-z0-9,{}/_-]+: [A-Z][a-z]'; then
65-
err "title starts with an capital letter, please use lower case"
66-
fi
67-
if ! echo "$title" | grep -qE '[A-Za-z0-9]$'; then
68-
err "title ends with punctuation, please remove it"
58+
if ! echo "$title" | grep -qE '^Revert ".+"$'; then
59+
if [ "$(echo "$title" | wc -m)" -gt 72 ]; then
60+
err "title is longer than 72 characters, please make it shorter"
61+
fi
62+
if ! echo "$title" | grep -qE '^[a-z0-9,{}/_-]+: '; then
63+
err "title lacks a lowercase topic prefix (e.g. 'ipv6:')"
64+
fi
65+
if echo "$title" | grep -qE '^[a-z0-9,{}/_-]+: [A-Z][a-z]'; then
66+
err "title starts with an capital letter, please use lower case"
67+
fi
68+
if ! echo "$title" | grep -qE '[A-Za-z0-9]$'; then
69+
err "title ends with punctuation, please remove it"
70+
fi
6971
fi
7072

7173
author=$(git log --format='%an <%ae>' -1 "$rev")

0 commit comments

Comments
 (0)