Reword documentation of ref-update and commit-received hooks There has been confusion about the purpose of these hooks. Rewrite the documentation to hopefully make it clearer. Change-Id: I86c80072d2d9f05c9d926f0a6a5014590af45b05
diff --git a/src/main/resources/Documentation/hooks.md b/src/main/resources/Documentation/hooks.md index c4622cc..2c00a95 100644 --- a/src/main/resources/Documentation/hooks.md +++ b/src/main/resources/Documentation/hooks.md
@@ -11,11 +11,12 @@ ### ref-update -This is called when a ref update request is received by Gerrit. It allows a -request to be rejected before it is committed to the Gerrit repository. If -the script exits with non-zero return code the update will be rejected. Any -output from the script will be returned to the user, regardless of the return -code. +This is called when a ref update request (direct push, non-fastforward update, or +ref deletion) is received by Gerrit. It allows a request to be rejected before it +is committed to the Gerrit repository. + +If the hook exits with non-zero return code the update will be rejected. Any output +from the hook will be returned to the user, regardless of the return code. ``` ref-update --project <project name> --refname <refname> --uploader <uploader> --oldrev <sha1> --newrev <sha1> @@ -23,10 +24,11 @@ ### commit-received -This is called when a push request is received by Gerrit. It allows a push to be -rejected before it is committed to the Gerrit repository. If the script exits -with non-zero return code the push will be rejected. Any output from the script -will be returned to the user, regardless of the return code. +This is called when a commit is received for review by Gerrit. It allows a push to +be rejected before the review is created. + +If the hook exits with non-zero return code the push will be rejected. Any output +from the hook will be returned to the user, regardless of the return code. ``` commit-received --project <project name> --refname <refname> --uploader <uploader> --oldrev <sha1> --newrev <sha1> --cmdref <refname>