|
Version Control Integrations > Git Integration > Git Server Hooks |
|
|
ccollab admin trigger ensure-review-started (for Git) |
|
Use the ensure-review-started trigger to ensure that a review for the specified changelist has been started. The trigger blocks the submit operation if there is no review for the changelist in Collaborator, and displays an error message telling that the changes need to be reviewed before submitting them to the Git repository. Command Line Syntax: ccollab [global-options] admin trigger ensure-review-started [--review-id-regex <value>] <changelist-id>
Installation To install this trigger you will typically create an update hook. If you already have an update hook, you can add our tool wherever it is appropriate; otherwise you will need to create an executable hook as described in the Git documentation. The update hook should iterate over the commits being pushed and call this trigger for each one of them, and then exit with a non-zero exit code if any of the trigger invocations failed. Example shell script: #!/bin/sh refname="$1" oldrev="$2" newrev="$3" for commit in `git rev-list $oldrev..$newrev -- ''` do /collab/install/ccollab --url <collabUrl> --user <collabUser> --password <collabPasswd> --scm git admin trigger ensure-review-started $commit exitcode=$(($exitcode + $?)) done exit $exitcode Note our use of "exit" to ensure that the hook script terminates with a non-zero exit code if our trigger rejects one of the commits. |
|
© 2003-2025 SmartBear Software. All rights reserved. |