blob: fd901e98bb06563a4d3b1ccb8dd130b3f13ef132 [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'),
!,
Error = label('Cannot-Submit-DRAFT-Commit', need(_)),
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'),
!,
Error = label('Cannot-Submit-DO-NOT-SUBMIT-Commit', need(_)),
Out =.. [submit, Error | I].
% Otherwise, pass submit rule through.
submit_filter(In, Out) :- In = Out.