{"thread":{"id":"24428","subject":"git init --bare --shared does not set group for some files/dirs","startedAt":"2010-07-18T10:14:41Z","lastAt":"2010-07-18T12:08:20Z","messageCount":2,"participants":["Ville Skyttä","Ilari Liusvaara"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"145743","messageId":"201007181314.41894.ville.skytta@iki.fi","threadId":"24428","inReplyTo":null,"subject":"git init --bare --shared does not set group for some files/dirs","fromName":"Ville Skyttä","fromEmail":"ville.skytta@iki.fi","sentAt":"2010-07-18T10:14:41Z","receivedAt":"2010-07-18T10:14:41Z","isPatch":false,"sender":{"key":"ville.skytta@iki.fi","avatar":"https://avatars.githubusercontent.com/u/109152?v=4"},"body":"Hello,\n\ngit init --bare --shared does not set the group for some files.  See below; it \ndid set g+s for all dirs, and did set the group for the root dir, config, \nHEAD, and objects, but failed to set group for branches, description, hooks, \ninfo, and refs.  I discussed/reproduced this on #git today with drizzd and was \ninstructed to post here.\n\nIn particular, I hit a problem with this and the refs dir; members of the \ndesired group (gituser in my example) can not write into it.  I can obviously \nfix this locally with chgrp, but for which files/dirs should the gituser group \nbe set, and are there some files/dirs that it is intentionally not set?\n\n# git --version\ngit version 1.7.1.1\n# groupadd gituser\n# mkdir foo\n# chgrp gituser foo\n# cd foo\n# git init --bare --shared\nInitialized empty shared Git repository in /tmp/foo/\n# ls -ld . *\ndrwxrwsr-x 7 root gituser 4096 Jul 18 13:05 .\ndrwxrwsr-x 2 root root    4096 Jul 18 13:05 branches\n-rw-rw-r-- 1 root gituser  126 Jul 18 13:05 config\n-rw-rw-r-- 1 root root      73 Jul 18 13:05 description\n-rw-rw-r-- 1 root gituser   23 Jul 18 13:05 HEAD\ndrwxrwsr-x 2 root root    4096 Jul 18 13:05 hooks\ndrwxrwsr-x 2 root root    4096 Jul 18 13:05 info\ndrwxrwsr-x 4 root gituser 4096 Jul 18 13:05 objects\ndrwxrwsr-x 4 root root    4096 Jul 18 13:05 refs\n"},{"id":"145745","messageId":"20100718120820.GA20761@LK-Perkele-V2.elisa-laajakaista.fi","threadId":"24428","inReplyTo":"201007181314.41894.ville.skytta@iki.fi","subject":"Re: git init --bare --shared does not set group for some files/dirs","fromName":"Ilari Liusvaara","fromEmail":"ilari.liusvaara@elisanet.fi","sentAt":"2010-07-18T12:08:20Z","receivedAt":"2010-07-18T12:08:20Z","isPatch":false,"sender":{"key":"ilari.liusvaara@elisanet.fi","avatar":null},"body":"On Sun, Jul 18, 2010 at 01:14:41PM +0300, Ville Skyttä wrote:\n> Hello,\n> \n> git init --bare --shared does not set the group for some files.  See below; it \n> did set g+s for all dirs, and did set the group for the root dir, config, \n> HEAD, and objects, but failed to set group for branches, description, hooks, \n> info, and refs.  I discussed/reproduced this on #git today with drizzd and was \n> instructed to post here.\n> \n> In particular, I hit a problem with this and the refs dir; members of the \n> desired group (gituser in my example) can not write into it.  I can obviously \n> fix this locally with chgrp, but for which files/dirs should the gituser group \n> be set, and are there some files/dirs that it is intentionally not set?\n\nAFAIK, there are none that intentionally don't have it (at least usually every\nfile and directory there has the repository group as owner). The usual quick\nand dirty rules are:\n\n- For fetching, +r for all regular files, +rx for all directories.\n- For pushing, +r for all regular files (but +rw for regular files under\n/logs/ if any), +rwx for all directories.\n\nBTW: '/branches/' is used by pre-1.5 remotes stuff and pretty much totally\nobsolete.\n\n-Ilari\n"}]}