Default SVN permissions on .svn directory when adding a new directory
I have a Linux test server in which sometimes the code of a system is being updated by user1 or user2. Both are included in the "users" group. For usual modifications there is no problem as all the files have the g开发者_开发技巧+w permission.
However if user1 adds a new directory (using svn add) it has to manually set the g+w permission or the user2 will have problems with that directory (as by default subversion creates the .svn directory with a 755 permission).
Is there any subversion setting to make this process automatically? or a post-commit hook is the only way?
It is not an urgent matter, so just wondering...
Thank you in advance.
Note: One alternative of course is to each of those users to have their own copy, but for that specific system it was the easiest way to do it (as they don't have to set the environment twice).
A couple of quick ideas:
Have a cron job periodically sanitize permissions on the tree. This is what I've done in the past with shared filesystem areas like this, especially to enforce a particular group name that's not a default group for either user.
Set each user's umask (i.e. in .bashrc) so that newly created files are group-writable. i.e.:
umask u=rwx,g=rwx,o=r
will result in new files created as -rw-rw-r--, and new directories created as drwxrwxr--
Sorry that neither of these is svn-specific, if I turn up a way to set an "svn umask" I'll check back with an edit.
SVN book suggests replacing the svn binary with a wrapper shell script that first sets the umask, then runs the actual svn command.
精彩评论