Gerrit - avoid developer merge code after code review

557 views
Skip to first unread message

Richard

unread,
Dec 22, 2010, 4:13:35 PM12/22/10
to Repo and Gerrit Discussion
Hi,

I have a question about how I can merge the new changes to Gerrit
master branch after code review.

Let's say I have:

1) Server (gerrithost) - host Gerrit repository
2) PC - local repository

step1: (PC) git clone gerrithost/
project #
clone repo from Gerrit master
step2:
(PC)
# make some changes and commit
step3: (PC) git push gerrithost/project HEAD:refs/for/
master # push the code change for review
step4: CodeReviewer review the change through Gerrit web
interface # review
step5: (PC) git push gerrithost/project
master # push the code
to Gerrit master

Note: step5 is from "Code Review with Gerrit, a mostly visual guide"
<http://unethicalblogger.com/node/241>.

The problem is step5: developer push the code to Gerrit master branch,
not CodeReviewer.

My question is: is there anyway for CodeReviewer to push code changes
from "magic <for>" to Gerrit master?

Thanks,
Richard

Magnus Bäck

unread,
Dec 22, 2010, 4:25:28 PM12/22/10
to Repo and Gerrit Discussion
On Wednesday, December 22, 2010 at 22:13 CET,
Richard <richar...@gmail.com> wrote:

> I have a question about how I can merge the new changes to Gerrit
> master branch after code review.

[...]

> step5: (PC) git push gerrithost/project
> master # push the code
> to Gerrit master
>
> Note: step5 is from "Code Review with Gerrit, a mostly visual guide"
> <http://unethicalblogger.com/node/241>.
>
> The problem is step5: developer push the code to Gerrit master branch,
> not CodeReviewer.
>
> My question is: is there anyway for CodeReviewer to push code changes
> from "magic <for>" to Gerrit master?

That article describes very a very atypical workflow that's both
inconvenient and requires developers (or whoever wants to submit a
change) to have push branch permissions (i.e. they can bypass code
review). The article also doesn't show someone actually approving
the change (i.e. giving it Code Review +2, just +1 is given which
by default isn't sufficient to allow the change to be submitted).

The standard way of merging/submitting a change to the destination
branch is by having someone click the Submit Patch Set button in the
web UI. Access to this operation can be restricted to certain groups
of users.

--
Magnus B�ck Opinions are my own and do not necessarily
SW Configuration Manager represent the ones of my employer, etc.
Sony Ericsson

Matthias Sohn

unread,
Dec 22, 2010, 5:08:38 PM12/22/10
to Richard, Repo and Gerrit Discussion
2010/12/22 Richard <richar...@gmail.com>
Look at the Android workflow to see what's the default workflow when using gerrit:
 
--
Matthias

Richard

unread,
Dec 23, 2010, 9:11:06 AM12/23/10
to Repo and Gerrit Discussion
Thanks both of you.

Richard
Reply all
Reply to author
Forward
0 new messages