blob: 7ef646b4effb09b1d7f61faf0abdecfa16a5fd46 [file] [log] [blame]
David Pursehouseec31ddf2013-02-22 15:49:03 +09001Gerrit Code Review - Commit Validation
2======================================
3
4Gerrit supports link:dev-plugins.html[plugin-based] validation of
David Pursehousecde597d42013-05-30 10:16:17 +09005commits.
David Pursehouseec31ddf2013-02-22 15:49:03 +09006
David Pursehouse8f9e9f52013-05-30 10:35:24 +09007[[new-commit-validation]]
8New commit validation
9---------------------
10
11
David Pursehousecde597d42013-05-30 10:16:17 +090012Plugins implementing the `CommitValidationListener` interface can
13perform additional validation checks against new commits.
David Pursehouseec31ddf2013-02-22 15:49:03 +090014
David Pursehousecde597d42013-05-30 10:16:17 +090015If the commit fails the validation, the plugin can either provide a
16message that will be sent back to the git client, or throw an exception
17which will cause the commit to be rejected.
18
19Validation applies to both commits uploaded via `git push`, and new
20commits generated via Gerrit's Web UI features such as the rebase, revert
21and cherry-pick buttons.
David Pursehouseec31ddf2013-02-22 15:49:03 +090022
David Pursehouse9437b7b2012-11-05 23:48:58 +090023Out of the box, Gerrit includes a plugin that checks the length of the
24subject and body lines of commit messages on uploaded commits.
25
David Pursehouse8f9e9f52013-05-30 10:35:24 +090026[[pre-merge-validation]]
27Pre-merge validation
28--------------------
29
30
31Plugins implementing the `MergeValidationListener` interface can
32perform additional validation checks against commits before they
33are merged to the git repository.
34
35If the commit fails the validation, the plugin can throw an exception
36which will cause the merge to fail.
37
David Pursehouseec31ddf2013-02-22 15:49:03 +090038
39GERRIT
40------
41Part of link:index.html[Gerrit Code Review]
42
Yuxuan 'fishy' Wang99cb68d2013-10-31 17:26:00 -070043
44SEARCHBOX
45---------