All of lore.kernel.org
 help / color / mirror / Atom feed
* running "git init --shared" on an existing repo
@ 2010-03-22  6:30 Sitaram Chamarty
  2010-03-22  7:06 ` Junio C Hamano
  0 siblings, 1 reply; 3+ messages in thread
From: Sitaram Chamarty @ 2010-03-22  6:30 UTC (permalink / raw)
  To: Git Mailing List

Hi all,

If you forget to use "--shared" on your (bare) repo, and now need to
adjist it after the fact to make perms work ok, you ought to be able
to just run "git init --bare --shared" and things should be fine.

And it seems there was a beginning made.  builtin/init-db.c at line 220 says:

            /*
             * We would have created the above under user's umask -- under
             * shared-repository settings, we would need to fix them up.
             */
            if (shared_repository) {
                    adjust_shared_perm(get_git_dir());
                    adjust_shared_perm(git_path("refs"));
                    adjust_shared_perm(git_path("refs/heads"));
                    adjust_shared_perm(git_path("refs/tags"));
            }

Ideally, we should do the same to:

hooks
info
objects
objects/??
objects/info
objects/pack

also.  The othes are easy, but does git internals have a defined way
of doing that objects/?? part or should it just be the long way (it's
been ages since I did any C but I'd be willing to try...)

--
Sitaram

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: running "git init --shared" on an existing repo
  2010-03-22  6:30 running "git init --shared" on an existing repo Sitaram Chamarty
@ 2010-03-22  7:06 ` Junio C Hamano
       [not found]   ` <2e24e5b91003220244v2d21bf3ay5b18d1ef40781be2@mail.gmail.com>
  0 siblings, 1 reply; 3+ messages in thread
From: Junio C Hamano @ 2010-03-22  7:06 UTC (permalink / raw)
  To: Sitaram Chamarty; +Cc: Git Mailing List

Sitaram Chamarty <sitaramc@gmail.com> writes:

> And it seems there was a beginning made.  builtin/init-db.c at line 220 says:
>
>             /*
>              * We would have created the above under user's umask -- under
>              * shared-repository settings, we would need to fix them up.
>              */

That "the above" refers to "in this process that created the repository
directory and populated it halfway by calling copy_templates()", and never
"some time ago by some other process that created the repository, in which
this process is now being run", so it is not fair to say "a beginning".

You would need to run "find $GIT_DIR -print0 | xargs -0 chown/mod ..." or
a moral equivalent of it, I guess.  Shouldn't be a rocket surgery ;-)

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Fwd: running "git init --shared" on an existing repo
       [not found]   ` <2e24e5b91003220244v2d21bf3ay5b18d1ef40781be2@mail.gmail.com>
@ 2010-03-22  9:45     ` Sitaram Chamarty
  0 siblings, 0 replies; 3+ messages in thread
From: Sitaram Chamarty @ 2010-03-22  9:45 UTC (permalink / raw)
  To: Git Mailing List

oops-- forgot to "reply all"; so it only went to Junio...


---------- Forwarded message ----------
From: Sitaram Chamarty <sitaramc@gmail.com>
Date: Mon, Mar 22, 2010 at 3:14 PM
Subject: Re: running "git init --shared" on an existing repo
To: Junio C Hamano <gitster@pobox.com>


On Mon, Mar 22, 2010 at 12:36 PM, Junio C Hamano <gitster@pobox.com> wrote:
> Sitaram Chamarty <sitaramc@gmail.com> writes:
>
>> And it seems there was a beginning made.  builtin/init-db.c at line 220 says:
>>
>>             /*
>>              * We would have created the above under user's umask -- under
>>              * shared-repository settings, we would need to fix them up.
>>              */
>
> That "the above" refers to "in this process that created the repository
> directory and populated it halfway by calling copy_templates()", and never
> "some time ago by some other process that created the repository, in which
> this process is now being run", so it is not fair to say "a beginning".

Possible, but the fact remains that when you do that "some time ago",
and then come back and do this, it *does* fix up the perms of refs,
refs/heads, and refs/tags.

> You would need to run "find $GIT_DIR -print0 | xargs -0 chown/mod ..." or
> a moral equivalent of it, I guess.  Shouldn't be a rocket surgery ;-)

true... the toruble with using perl for years is that it sorta spoils
you; I need to actually *think* now, despite it not being rocket
surgery :-)

I will send a patch by and by...  I wonder if cheating and calling
system("find <whatever> -type d -exec chmod g+s") will be acceptable
;-)

--
Sitaram



-- 
Sitaram

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2010-03-22  9:45 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-03-22  6:30 running "git init --shared" on an existing repo Sitaram Chamarty
2010-03-22  7:06 ` Junio C Hamano
     [not found]   ` <2e24e5b91003220244v2d21bf3ay5b18d1ef40781be2@mail.gmail.com>
2010-03-22  9:45     ` Fwd: " Sitaram Chamarty

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.