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 2.1.2.2 and Git version 1.7.

To get the hook, download it from here:
https://www.codeaurora.org/patches/quic/la/gerrit/trivial_rebase.py

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

Example invocation of trivial_rebase.py:
  # Run as the user running Gerrit on the server hosting Gerrit
  export GIT_DIR=/path/to/git/repos/tools/repo.git
  ./trivial_rebase.py --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:
http://gerrit.googlecode.com/svn/documentation/2.1.2/config-hooks.html

Contact nasser@codeaurora.org for help with this hook.

Tags:
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