Gerrit Code Review

Last modified by Rob Garth on 2010/04/14 13:48

Gerrit Trivial Rebase Hook

This hook is designed to detect when a patchset uploaded to Gerrit has the same git patch-id as the previous patchset. It then reapplies reviews onto the new patchset using the Gerrit SuExec and Approve commands.

The hook is known to work with Gerrit version and Git version 1.7.

To get the hook, download it from here:

To use the hook, create a patchset-created hook in your Gerrit hooks directory. The patchset-created hook should execute passing it the required arguments (run --help for more info on arguments).

Example invocation of
  # Run as the user running Gerrit on the server hosting Gerrit
  export GIT_DIR=/path/to/git/repos/tools/repo.git
  ./ --change I00e77c7f21021b42de9da39bfe3f29513ae705ed --project tools/repo --commit 00e77c7f21021b42de9da39bfe3f29513ae705ed --patchset 1 --private-key-path $site_path/etc/ssh_host_dsa_key

For more information on Gerrit hooks see:

Contact for help with this hook.

Created by Rob Garth on 2010/04/14 12:13
This wiki is licensed under a Creative Commons 2.0 license
XWiki Enterprise 7.4.3 - Documentation