auto add reviewer per commit

2,300 views
Skip to first unread message

localghost

unread,
Jul 1, 2011, 4:53:14 AM7/1/11
to Repo and Gerrit Discussion
Hi

I need to configure git to automatically add different reviewer per
each commit. Which reviewer should be added depends on commit log
message (it will contain a special tag). Does anyone know if it is
even possible with gerrit 2.1.6.1?

I've thought about replacing standard push command with a custom
script that would discover (somehow) commits' ids that should be
pushed and push each one individually, setting proper reviewer using
`git receive-pack --reviewer`. However, I'm not sure how to check
which commits are new or modified and which one are already on gerrit
(not yet merged). Anyone have any idea how to obtain such info from
git/gerrit?

Thanks in advance for any suggestions.

Eberhard Beilharz

unread,
Jul 4, 2011, 2:20:28 AM7/4/11
to repo-d...@googlegroups.com

What about doing that in the patchset-created hook on gerrit?

Maria Ö

unread,
Jul 8, 2011, 5:36:56 AM7/8/11
to Repo and Gerrit Discussion
I like this idea, but how can I add reviewers at this point? As far as
I know, we can only add reviewers during push, using the recieve-
pack.

/Maria

Barre Lovén

unread,
Jul 8, 2011, 5:52:54 AM7/8/11
to Repo and Gerrit Discussion
Hello,
I am having the same problem, it seems however that a reviewer must be
added during push:

git push --receive-pack='git receive-pack --reviewer r...@com.com'
ssh://m...@example.com:29418/project.git HEAD:refs/for/master

so how would you do this from a hook?

cheers,

/B


On Jul 4, 8:20 am, Eberhard Beilharz <e...@sil.org> wrote:

Shawn Pearce

unread,
Jul 10, 2011, 10:45:57 PM7/10/11
to Barre Lovén, Repo and Gerrit Discussion
On Fri, Jul 8, 2011 at 02:52, Barre Lovén <brt...@gmail.com> wrote:
> I am having the same problem, it seems however that a reviewer must be
> added during push:
>
> git push --receive-pack='git receive-pack --reviewer r...@com.com'
> ssh://m...@example.com:29418/project.git HEAD:refs/for/master
>
> so how would you do this from a hook?

In 2.2.2 you will be able to add reviewers over SSH using the new
gerrit modify-reviewers command.

Barre Lovén

unread,
Jul 11, 2011, 3:58:20 AM7/11/11
to Repo and Gerrit Discussion
Thank You, sitting tight, waiting for 2.2.2! Any hints when it will be
out?

Cheers,
/B

On Jul 11, 4:45 am, Shawn Pearce <s...@google.com> wrote:
> On Fri, Jul 8, 2011 at 02:52, Barre Lovén <brtk...@gmail.com> wrote:
> > I am having the same problem, it seems however that areviewermust be
> > added during push:
>
> > git push --receive-pack='git receive-pack --reviewerr...@com.com'
> > ssh:/...@example.com:29418/project.git HEAD:refs/for/master
>
> > so how would you do this from a hook?
>
> In 2.2.2 you will be able toaddreviewers over SSH using the new
> gerrit modify-reviewers command.

Shawn Pearce

unread,
Jul 11, 2011, 9:58:36 AM7/11/11
to Barre Lovén, Repo and Gerrit Discussion
On Mon, Jul 11, 2011 at 00:58, Barre Lovén <brt...@gmail.com> wrote:
> Thank You, sitting tight, waiting for 2.2.2! Any hints when it will be
> out?

When we can get the release notes written and start the -rc cycle... :-\

Reply all
Reply to author
Forward
0 new messages