File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -157,9 +157,15 @@ for COMMIT in ${COMMITS}; do
157157 SUBJECT=$( echo " $COMMIT_MSG " | head -n1)
158158 BODY=$( echo " $COMMIT_MSG " | tail -n +2)
159159
160- # Check subject length (72 chars)
160+ # Check subject length (72 chars), except for revert commits.
161+ is_revert_commit=false
162+ if [[ " $SUBJECT " =~ ^(Arm\ backend:\ )? Revert(\ | $) ]]; then
163+ is_revert_commit=true
164+ fi
165+
161166 SUBJECT_MAX_LEN=72
162- if [ ${# SUBJECT} -gt ${SUBJECT_MAX_LEN} ]; then
167+ if [ ${# SUBJECT} -gt ${SUBJECT_MAX_LEN} ] && \
168+ [[ $is_revert_commit == false ]]; then
163169 echo -e " ${ERROR} Subject exceeds ${SUBJECT_MAX_LEN} characters:" \
164170 " '${SUBJECT} '" >&2
165171
@@ -216,7 +222,8 @@ for COMMIT in ${COMMITS}; do
216222 fi
217223
218224 # Require 'Arm backend: ' prefix when the commit only touches Arm backend/examples files
219- if [[ $only_arm_changes == true && $has_arm_backend_prefix == false ]]; then
225+ if [[ $only_arm_changes == true && $has_arm_backend_prefix == false && \
226+ $is_revert_commit == false ]]; then
220227 echo -e " ${ERROR} Subject must start with 'Arm backend: ' when only backends/arm or examples/arm files are modified." >&2
221228 FAILED=1
222229 fi
You can’t perform that action at this time.
0 commit comments