rules.pl: change DRAFT to DO NOT REVIEW, and make triggers case-insensitive
diff --git a/rules.pl b/rules.pl index 15ed563..6b5fbac 100644 --- a/rules.pl +++ b/rules.pl
@@ -1,19 +1,21 @@ -% We don't send email if the commit message says DRAFT, so don't allow submit either. +% We don't send email if the commit message says DO NOT REVIEW, so don't allow submit either. +% Case insensitive because the mail filter rules are. submit_filter(In, Out) :- In =.. [submit | I], - gerrit:commit_message_matches('DRAFT'), + gerrit:commit_message_matches('[Dd][Oo][ \t\r\n]+[Nn][Oo][Tt][ \t\r\n]+[Rr][Ee][Vv][Ii][Ee][Ww]'), !, gerrit:commit_author(Id), - Error = label('Cannot-Submit-DRAFT-Commit', reject(Id)), + Error = label('Do-Not-Review', reject(Id)), Out =.. [submit, Error | I]. % Don't allow submit of DO NOT SUBMIT commit message either. +% Using same label as above to avoid yet another column in the CL dashboard on Gerrit. submit_filter(In, Out) :- In =.. [submit | I], - gerrit:commit_message_matches('DO NOT SUBMIT'), + gerrit:commit_message_matches('[Dd][Oo][ \t\r\n]+[Nn][Oo][Tt][ \t\r\n]+[Ss][Uu][Bb][Mm][Ii][Tt]'), !, gerrit:commit_author(Id), - Error = label('Cannot-Submit-DO-NOT-SUBMIT-Commit', reject(Id)), + Error = label('Do-Not-Review', reject(Id)), Out =.. [submit, Error | I]. % Otherwise, pass submit rule through.