blob: 15ed563e211a8899201c0aca0081a56351a1f4c3 [file]
% We don't send email if the commit message says DRAFT, so don't allow submit either.
submit_filter(In, Out) :-
In =.. [submit | I],
gerrit:commit_message_matches('DRAFT'),
!,
gerrit:commit_author(Id),
Error = label('Cannot-Submit-DRAFT-Commit', reject(Id)),
Out =.. [submit, Error | I].
% Don't allow submit of DO NOT SUBMIT commit message either.
submit_filter(In, Out) :-
In =.. [submit | I],
gerrit:commit_message_matches('DO NOT SUBMIT'),
!,
gerrit:commit_author(Id),
Error = label('Cannot-Submit-DO-NOT-SUBMIT-Commit', reject(Id)),
Out =.. [submit, Error | I].
% Otherwise, pass submit rule through.
submit_filter(In, Out) :- In = Out.