{"thread":{"id":"10423","subject":"[PATCH] don't set-group-id on directories on apple","startedAt":"2007-10-22T07:55:18Z","lastAt":"2007-10-23T04:30:23Z","messageCount":4,"participants":["Scott R Parish","Johannes Schindelin","Scott Parish"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"56837","messageId":"20071022075459.GA1157@srparish.net","threadId":"10423","inReplyTo":null,"subject":"[PATCH] don't set-group-id on directories on apple","fromName":"Scott R Parish","fromEmail":"srp@srparish.net","sentAt":"2007-10-22T07:55:18Z","receivedAt":"2007-10-22T07:55:18Z","isPatch":true,"sender":{"key":"srp@srparish.net","avatar":"https://gravatar.com/avatar/870e5b6fc4f710cf4db5684bd9af7f2cee5734b3dab3209b13e00cf64f6c9f0e?d=mp&s=160"},"body":"\"git init --shared=all\" was failing because chmod was returning\nEPERM. According to the man page, the set-group-id behavior is\nalready default: man 2 mkdir:\n\n  The directory's group ID is set to that of the parent directory\n  in which it is created.\n\nSigned-off-by: Scott R Parish <srp@srparish.net>\n---\n path.c |    2 ++\n 1 files changed, 2 insertions(+), 0 deletions(-)\n\ndiff --git a/path.c b/path.c\nindex 4260952..4089753 100644\n--- a/path.c\n+++ b/path.c\n@@ -282,8 +282,10 @@ int adjust_shared_perm(const char *path)\n \t\t\t : (shared_repository == PERM_EVERYBODY\n \t\t\t    ? (S_IXGRP|S_IXOTH)\n \t\t\t    : 0));\n+#if !defined(__APPLE__)\n \tif (S_ISDIR(mode))\n \t\tmode |= S_ISGID;\n+#endif\n \tif ((mode & st.st_mode) != mode && chmod(path, mode) < 0)\n \t\treturn -2;\n \treturn 0;\n-- \n1.5.3.4.209.g5d1ce-dirty\n"},{"id":"56879","messageId":"Pine.LNX.4.64.0710221234070.25221@racer.site","threadId":"10423","inReplyTo":"20071022075459.GA1157@srparish.net","subject":"Re: [PATCH] don't set-group-id on directories on apple","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2007-10-22T14:16:01Z","receivedAt":"2007-10-22T14:16:01Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Mon, 22 Oct 2007, Scott R Parish wrote:\n\n> \"git init --shared=all\" was failing because chmod was returning\n> EPERM.\n\nNot here.  This is git version 1.5.3.rc4.1716.gc3498, and \"uname -a\" says\n\nDarwin michael-stirrats-mac-mini.local 8.10.0 Darwin Kernel Version \n8.10.0: Wed May 23 16:50:59 PDT 2007; root:xnu-792.21.3~1/RELEASE_PPC \nPower Macintosh powerpc\n\nIs it possible that you have stricter permission settings?  Or that you \ntry to re-initialise a repository that somebody else initialised \noriginally?\n\nCiao,\nDscho\n"},{"id":"56882","messageId":"20071022142945.GO16291@srparish.net","threadId":"10423","inReplyTo":"Pine.LNX.4.64.0710221234070.25221@racer.site","subject":"Re: [PATCH] don't set-group-id on directories on apple","fromName":"Scott Parish","fromEmail":"srp@srparish.net","sentAt":"2007-10-22T14:29:45Z","receivedAt":"2007-10-22T14:29:45Z","isPatch":true,"sender":{"key":"srp@srparish.net","avatar":"https://gravatar.com/avatar/870e5b6fc4f710cf4db5684bd9af7f2cee5734b3dab3209b13e00cf64f6c9f0e?d=mp&s=160"},"body":"On Mon, Oct 22, 2007 at 03:16:01PM +0100, Johannes Schindelin wrote:\n\n> On Mon, 22 Oct 2007, Scott R Parish wrote:\n> \n> > \"git init --shared=all\" was failing because chmod was returning\n> > EPERM.\n> \n> Not here.  This is git version 1.5.3.rc4.1716.gc3498, and \"uname -a\" says\n> \n> Darwin michael-stirrats-mac-mini.local 8.10.0 Darwin Kernel Version \n> 8.10.0: Wed May 23 16:50:59 PDT 2007; root:xnu-792.21.3~1/RELEASE_PPC \n> Power Macintosh powerpc\n\nDarwin poplar.local 8.10.1 Darwin Kernel Version 8.10.1: Wed May 23 16:33:00 PDT 2007; root:xnu-792.22.5~1/RELEASE_I386 i386 i386\n\n> Is it possible that you have stricter permission settings?\n\nThis is a possibility, but i have no idea what that might be. I've\ntried googling around without any luck (except for a post about\nreading \"mkdir(2)\").\n\n> Or that you try to re-initialise a repository that somebody else\n> initialised originally?\n\nNo, this was a failure when running tests (t1301-shared-repo.sh)\n\nsRp\n\n-- \nScott Parish\nhttp://srparish.net/\n"},{"id":"56953","messageId":"20071023043022.GB17089@srparish.net","threadId":"10423","inReplyTo":"20071022142945.GO16291@srparish.net","subject":"Re: [PATCH] don't set-group-id on directories on apple","fromName":"Scott Parish","fromEmail":"srp@srparish.net","sentAt":"2007-10-23T04:30:23Z","receivedAt":"2007-10-23T04:30:23Z","isPatch":true,"sender":{"key":"srp@srparish.net","avatar":"https://gravatar.com/avatar/870e5b6fc4f710cf4db5684bd9af7f2cee5734b3dab3209b13e00cf64f6c9f0e?d=mp&s=160"},"body":"On Mon, Oct 22, 2007 at 07:29:45AM -0700, Scott Parish wrote:\n\n> On Mon, Oct 22, 2007 at 03:16:01PM +0100, Johannes Schindelin wrote:\n> \n> > On Mon, 22 Oct 2007, Scott R Parish wrote:\n> > \n> > > \"git init --shared=all\" was failing because chmod was returning EPERM.\n> > \n> > Not here. \n> > \n> > Is it possible that you have stricter permission settings?\n\nI finally figured it out. I keep my home directory encrypted, but\nits pretty slow (especially compiles) and i don't care who steals\nopen source code i'm playing with, so i keep that in /Users/Shared.\nSince mkdir() on darwin keeps the parents group by default, the\ngroup on my git clone was wheel, which i'm not a member of.\n\nsRp\n\n-- \nScott Parish\nhttp://srparish.net/\n"}]}