gitlabhq/gitlabhq — pull request #1719 by SaitoWu (2012-10-17 08:06:27+00:00)
Title: add shared repository support

### Problem

The origin bug report is here: https://groups.google.com/forum/?fromgroups=#!topic/gitlabhq/l1wSZmULJSo

### Cause

This is a grack and gitolite cowork problem.

If u push over SSH, ur `.git/objects` 's permission look like this:

drwxrwx--- git:git

when u push over HTTP, ur `.git/objects` 's permission looks like this:

drwxr-xr-x gitlab:gitlab

so, `git` user didn't have group write permission on that object, and `gitlab` user will always have push permission.

### Fix

To fix this problem, we need add a git config to each repo.

[core]
sharedRepository = 0660

this will always give objects folder a `drwxrws---` permission. like gitolites umask variable.

Gitolite support `git config` varible.

Our `gitolite-client` also support config variable, its easy to use:

repo.set_git_config("core.sharedRepository", "0660")

also we need edit `.gitolite.rc` file

GIT_CONFIG_KEYS => '.*'

when we done what we do.

our new repo will have this in the config:

[core]
repositoryformatversion = 0
filemode = true
bare = true
sharedRepository = 0660

And all things will work again.

### TL;DR

merge this patch

edit `.gitolite.rc` file, `GIT_CONFIG_KEYS => '.*'`

will fix this problem.