Group write permissions on files in Git repo

954 views
Skip to first unread message

Igor Seliakov

unread,
May 3, 2012, 9:23:28 AM5/3/12
to repo-d...@googlegroups.com
Hi, All!

We use Gerrit 2.3 for code review in conjunction with Git repository. We do not use Gerrit as a permanent proxy for Git.
It means that sometimes we post changes for review in Gerrit (and then Gerrit pushes the reviewed changes into Git) and sometimes we push changes into Git directly without Gerrit.

The issue we have:
When gerrit pushes changes into git it creates new object files in git without write permissions for a group. I don't know how to change that.
Write permissions for the group is important for us because if I want to push something into Git directly and I'm changing the object(s) created by Gerrit user I receive an error about lack of permissions.

We created a user for gerrit called "gerrit2"
We created a joined group X where all the developers and gerrit2 user are added.
gerrit2 user has a primary group X
We also configured Git adding "sharedrepository = all" to it's config file

Could someone help me please ?

Shawn Pearce

unread,
May 3, 2012, 10:18:39 AM5/3/12
to Igor Seliakov, repo-d...@googlegroups.com
On Thu, May 3, 2012 at 6:23 AM, Igor Seliakov <seli...@gmail.com> wrote:
> We use Gerrit 2.3 for code review in conjunction with Git repository. We do
> not use Gerrit as a permanent proxy for Git.
> It means that sometimes we post changes for review in Gerrit (and then
> Gerrit pushes the reviewed changes into Git) and sometimes we push changes
> into Git directly without Gerrit.
>
> The issue we have:
> When gerrit pushes changes into git it creates new object files in git
> without write permissions for a group. I don't know how to change that.
> Write permissions for the group is important for us because if I want to
> push something into Git directly and I'm changing the object(s) created by
> Gerrit user I receive an error about lack of permissions.

Generally we advise people to just grant Push permission to developers
in Gerrit, and let Gerrit proxy everything. Or at least proxy the
writes. So thus far we haven't run into this problem.

Its probably caused by the umask of the Gerrit server being 0077 or
something equally useless for your use case. You might need to make
sure the umask of the daemon is starting with something more
permissive.

Igor Seliakov

unread,
May 3, 2012, 11:09:15 AM5/3/12
to repo-d...@googlegroups.com
Thanks, Shawn.

I identified that umask for "gerrit2" user was set to '022' which is wrong. Now I changed it to '002'. I hope this will help.

Igor.
Reply all
Reply to author
Forward
0 new messages