{"thread":{"id":"23135","subject":"running \"git init --shared\" on an existing repo","startedAt":"2010-03-22T06:30:01Z","lastAt":"2010-03-22T09:45:11Z","messageCount":3,"participants":["Sitaram Chamarty","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"137520","messageId":"2e24e5b91003212330r2f3fd118y18386ef61c28ee89@mail.gmail.com","threadId":"23135","inReplyTo":null,"subject":"running \"git init --shared\" on an existing repo","fromName":"Sitaram Chamarty","fromEmail":"sitaramc@gmail.com","sentAt":"2010-03-22T06:30:01Z","receivedAt":"2010-03-22T06:30:01Z","isPatch":false,"sender":{"key":"sitaramc@gmail.com","avatar":"https://avatars.githubusercontent.com/u/43316?v=4"},"body":"Hi all,\n\nIf you forget to use \"--shared\" on your (bare) repo, and now need to\nadjist it after the fact to make perms work ok, you ought to be able\nto just run \"git init --bare --shared\" and things should be fine.\n\nAnd it seems there was a beginning made.  builtin/init-db.c at line 220 says:\n\n            /*\n             * We would have created the above under user's umask -- under\n             * shared-repository settings, we would need to fix them up.\n             */\n            if (shared_repository) {\n                    adjust_shared_perm(get_git_dir());\n                    adjust_shared_perm(git_path(\"refs\"));\n                    adjust_shared_perm(git_path(\"refs/heads\"));\n                    adjust_shared_perm(git_path(\"refs/tags\"));\n            }\n\nIdeally, we should do the same to:\n\nhooks\ninfo\nobjects\nobjects/??\nobjects/info\nobjects/pack\n\nalso.  The othes are easy, but does git internals have a defined way\nof doing that objects/?? part or should it just be the long way (it's\nbeen ages since I did any C but I'd be willing to try...)\n\n--\nSitaram\n"},{"id":"137521","messageId":"7v8w9kq1ia.fsf@alter.siamese.dyndns.org","threadId":"23135","inReplyTo":"2e24e5b91003212330r2f3fd118y18386ef61c28ee89@mail.gmail.com","subject":"Re: running \"git init --shared\" on an existing repo","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2010-03-22T07:06:05Z","receivedAt":"2010-03-22T07:06:05Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Sitaram Chamarty <sitaramc@gmail.com> writes:\n\n> And it seems there was a beginning made.  builtin/init-db.c at line 220 says:\n>\n>             /*\n>              * We would have created the above under user's umask -- under\n>              * shared-repository settings, we would need to fix them up.\n>              */\n\nThat \"the above\" refers to \"in this process that created the repository\ndirectory and populated it halfway by calling copy_templates()\", and never\n\"some time ago by some other process that created the repository, in which\nthis process is now being run\", so it is not fair to say \"a beginning\".\n\nYou would need to run \"find $GIT_DIR -print0 | xargs -0 chown/mod ...\" or\na moral equivalent of it, I guess.  Shouldn't be a rocket surgery ;-)\n"},{"id":"137532","messageId":"2e24e5b91003220245p7de5cd7dqc5f21230c244a268@mail.gmail.com","threadId":"23135","inReplyTo":"2e24e5b91003220244v2d21bf3ay5b18d1ef40781be2@mail.gmail.com","subject":"Fwd: running \"git init --shared\" on an existing repo","fromName":"Sitaram Chamarty","fromEmail":"sitaramc@gmail.com","sentAt":"2010-03-22T09:45:11Z","receivedAt":"2010-03-22T09:45:11Z","isPatch":false,"sender":{"key":"sitaramc@gmail.com","avatar":"https://avatars.githubusercontent.com/u/43316?v=4"},"body":"oops-- forgot to \"reply all\"; so it only went to Junio...\n\n\n---------- Forwarded message ----------\nFrom: Sitaram Chamarty <sitaramc@gmail.com>\nDate: Mon, Mar 22, 2010 at 3:14 PM\nSubject: Re: running \"git init --shared\" on an existing repo\nTo: Junio C Hamano <gitster@pobox.com>\n\n\nOn Mon, Mar 22, 2010 at 12:36 PM, Junio C Hamano <gitster@pobox.com> wrote:\n> Sitaram Chamarty <sitaramc@gmail.com> writes:\n>\n>> And it seems there was a beginning made.  builtin/init-db.c at line 220 says:\n>>\n>>             /*\n>>              * We would have created the above under user's umask -- under\n>>              * shared-repository settings, we would need to fix them up.\n>>              */\n>\n> That \"the above\" refers to \"in this process that created the repository\n> directory and populated it halfway by calling copy_templates()\", and never\n> \"some time ago by some other process that created the repository, in which\n> this process is now being run\", so it is not fair to say \"a beginning\".\n\nPossible, but the fact remains that when you do that \"some time ago\",\nand then come back and do this, it *does* fix up the perms of refs,\nrefs/heads, and refs/tags.\n\n> You would need to run \"find $GIT_DIR -print0 | xargs -0 chown/mod ...\" or\n> a moral equivalent of it, I guess.  Shouldn't be a rocket surgery ;-)\n\ntrue... the toruble with using perl for years is that it sorta spoils\nyou; I need to actually *think* now, despite it not being rocket\nsurgery :-)\n\nI will send a patch by and by...  I wonder if cheating and calling\nsystem(\"find <whatever> -type d -exec chmod g+s\") will be acceptable\n;-)\n\n--\nSitaram\n\n\n\n-- \nSitaram\n"}]}