From cde597d4f44d155bee02fde5bc85330a8e68f921 Mon Sep 17 00:00:00 2001 From: David Pursehouse Date: Thu, 30 May 2013 10:16:17 +0900 Subject: [PATCH] Improve documentation of commit validation Mention that the plugin can reject commits by throwing an exception. Make it clearer that the validation also applies to commits made within the Gerrit Web UI. Change-Id: Ibd58aed5cd2a25ebe882020c7a530942c18dd8cd --- Documentation/config-validation.txt | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/Documentation/config-validation.txt b/Documentation/config-validation.txt index ab5d04a967..fd8c0bd3a6 100644 --- a/Documentation/config-validation.txt +++ b/Documentation/config-validation.txt @@ -2,14 +2,18 @@ Gerrit Code Review - Commit Validation ====================================== Gerrit supports link:dev-plugins.html[plugin-based] validation of -uploaded commits. +commits. -This allows plugins to perform additional validation checks against -uploaded commits, and send back a warning or error message to the git -client. +Plugins implementing the `CommitValidationListener` interface can +perform additional validation checks against new commits. -To make use of this feature, a plugin must implement the `CommitValidationListener` -interface. +If the commit fails the validation, the plugin can either provide a +message that will be sent back to the git client, or throw an exception +which will cause the commit to be rejected. + +Validation applies to both commits uploaded via `git push`, and new +commits generated via Gerrit's Web UI features such as the rebase, revert +and cherry-pick buttons. Out of the box, Gerrit includes a plugin that checks the length of the subject and body lines of commit messages on uploaded commits.