[nycbug-talk] [OT] - Subversion Conflicts

Marco Scoffier marco at metm.org
Mon Jun 29 18:02:38 EDT 2009


Matt Juszczak wrote:
> Yup, agreed. This isn't an SVN thing. This is more "how do I make
> freebsd somehow keep all files in a directory, recursively, owned by the 
> same user/group".  
It's called the setgid bit.
chmod 2775 all the directories in your tree.
chown www:users everything in the tree
If you give write permissions to the group.
You only need the setgid to be set.

The problem is, as you noted above, that users' umask setting can 
override this setgid bit when they create new directories, so you set 
the users' umask. 
you want so set it to 0002  which becomes 775 permissions on new 
directories which is what you want.

here is a script using group repp and reseting the umask so that things 
work as you want them to :

#make directory
[marco at voip ~]$ mkdir test
#set group
[marco at voip ~]$ chown :repp test
[marco at voip ~]$ ls -ld test
drwxr-xr-x  2 marco  repp  512 Jun 29 19:01 test
#setgid
[marco at voip ~]$ chmod 2775 test
[marco at voip ~]$ ls -ld test
drwxrwsr-x  2 marco  repp  512 Jun 29 19:01 test
#make subdir
[marco at voip ~]$ mkdir test/one
[marco at voip ~]$ ls -l test
total 2
drwxr-xr-x  2 marco  repp  512 Jun 29 19:02 one
# default umask is wrong
[marco at voip ~]$ umask
0022
# reset umask
[marco at voip ~]$ umask 0002
[marco at voip ~]$ umask
0002
# second directory keeps proper permissions
[marco at voip ~]$ mkdir test/two
[marco at voip ~]$ ls -l test
total 4
drwxr-xr-x  2 marco  repp  512 Jun 29 19:02 one
drwxrwxr-x  2 marco  repp  512 Jun 29 19:02 two
# and they stick on into subdirectories
[marco at voip ~]$ mkdir test/two/sub
[marco at voip ~]$ ls -l test/two/
total 2
drwxrwxr-x  2 marco  repp  512 Jun 29 19:08 sub

I've done this multiple times for the  repository itself using svn+ssh.  
Never where people check out the files. 

It seems that rcs was set up to be used in this way -- where the files 
are checked out.  A user checks out a file and it is locked to that 
user, until he checks it back in.

Marco



More information about the talk mailing list