Shared filesystem repository with group permissions

Hi! I am just starting with Pijul and would like to collaborate on a repository with other users on the same Linux machine. Is there a configuration option allowing users in the same group to work from a shared repository locally? A workflow like this is what I am after:

sudo pijul init /var/lib/pijul/repository_name
sudo groupadd repository_group
sudo chgrp -R repository_group /var/lib/pijul/repository_name
sudo usermod -aG repository_group user1
sudo usermod -aG repository_group user2

Now, each user wants to work from the repository in their home directory:

user1@machine:~$ pijul clone /var/lib/pijul/repository_name
user1@machine:~$ cd repository_name
user1@machine:~/repository_name$  echo "Bonjour" > test.txt
user1@machine:~/repository_name$  pijul add test.txt
user1@machine:~/repository_name$  pijul record
user1@machine:~/repository_name$  pijul push

Everything works fine so far, but, unfortunately, the group’s permissions are not maintained on push, so now when the following user tries to clone the repository, they see an error:

user2@machine:~$ pijul clone /var/lib/pijul/repository_name
Repository created at /home/user2/test_repo
Downloading changes  [==================================================] 1/1 [00:00:00]
Applying changes     [==================================================] 1/1 [00:00:00]
Error: Permission denied (os error 13)

Git has the core.sharedRepository option, to help with umask issues. Is there a similar setting that I can use with Pijul?

1 Like

Have you tried setting SGID on the repo and using umask 002?

Alternatively, since it looks like the only way you write to the repo is with push, what I’d do is have a single user that owns the repo, and push over local SSH. No messing around with file ownership and permissions that way.

Setting SGID did not change the outcome, unfortunately. I think your idea of having a shared user with a local SSH as a workaround might be easiest for now. Thanks for the suggestions @dblsaiko.