Group write permissions on files in Git repo

Showing 1-3 of 3 messages
Group write permissions on files in Git repo Igor Seliakov 5/3/12 6:23 AM
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 ?
Re: Group write permissions on files in Git repo Shawn Pearce 5/3/12 7:18 AM
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.
Re: Group write permissions on files in Git repo Igor Seliakov 5/3/12 8:09 AM
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.