How do I adapt cherry-picking in Gerrit to work smoothly with a Subversion and Perforce git mirror?

155 views
Skip to first unread message

Øyvind Harboe

unread,
May 8, 2012, 4:59:56 AM5/8/12
to repo-d...@googlegroups.com
Q: Is there a supported way to insert a Gerrit cherry-pick hook that allows me to modify how cherry-picking is done?

Background


I have a setup where I use Gerrit against a Subversion (or Perforce) back-end where I would like to have the Gerrit submit automated and the Gerrit git mirror automatically synchronized.

Here is my setup:

- I've done a git svn/p4 clone and pushed that branch to the Gerrit server
- Reviews can now be cherry-picked onto the Gerrit branch
- Submits are allowed directly to the Subversion/Perforce server.

To synchronize the Gerrit git branch, the following sequence is executed from a *client*:

git svn fetch
# Hmm... hopefully we don't get any conflicts.
git svn rebase
# In case we have some new reviews, we submit them to Subversion
git svn dcommit
# *OUCH* we have to force a push to update the Gerrit branch as it is rewritten.
git push gerrit HEAD:master -f

I would much prefer to adapt the "Gerrit cherry-pick" to do the the submit directly to Subversion/Perforce:

- there would be no forced pushes to the Gerrit server
- if we fail to submit to Subversion, we can simply refuse the cherry-pick and the user can resolve the situation





Reply all
Reply to author
Forward
0 new messages