* Shared repositories and umask
@ 2006-02-15 12:19 Martin Mares
2006-02-15 13:05 ` Petr Baudis
0 siblings, 1 reply; 5+ messages in thread
From: Martin Mares @ 2006-02-15 12:19 UTC (permalink / raw)
To: git
Hello, world!\n
I'm playing with a shared repository and I am still unable to get the
file and directory permissions kept correctly, that is writeable to
a group.
Setting the `core.sharedrepository' flag helps a bit, but not completely:
the object files and directories are group-writeable, but for example new
head refs aren't.
The documentation hints on setting umask, but I would really like to avoid
doing that globally, because the user accounts are used for many other
things as well where the permissions should be tighter.
It seems that a correct solution would be to add an `umask' option to
the repository config and make enter_repo() adjust the umask accordingly.
I was thinking about doing the same in setup_git_directory() for the
local commands, but that probably doesn't make much sense since many commands
are in fact scripts creating files themselves.
If you agree, I will send a patch.
Have a nice fortnight
--
Martin `MJ' Mares <mj@ucw.cz> http://atrey.karlin.mff.cuni.cz/~mj/
Faculty of Math and Physics, Charles University, Prague, Czech Rep., Earth
Q: How many Prolog programmers does it take to change a light bulb? A: No.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Shared repositories and umask
2006-02-15 12:19 Shared repositories and umask Martin Mares
@ 2006-02-15 13:05 ` Petr Baudis
2006-02-15 13:51 ` Johannes Schindelin
2006-02-15 14:06 ` Martin Mares
0 siblings, 2 replies; 5+ messages in thread
From: Petr Baudis @ 2006-02-15 13:05 UTC (permalink / raw)
To: Martin Mares; +Cc: git
Hi,
Dear diary, on Wed, Feb 15, 2006 at 01:19:07PM CET, I got a letter
where Martin Mares <mj@ucw.cz> said that...
> I'm playing with a shared repository and I am still unable to get the
> file and directory permissions kept correctly, that is writeable to
> a group.
>
> Setting the `core.sharedrepository' flag helps a bit, but not completely:
> the object files and directories are group-writeable, but for example new
> head refs aren't.
actually, this is not necessary, since when pushing to shared
repositories, the new ref is created in the directory as a lockfile and
then moved over the original ref - this makes the ref updating safe and
raceless, while also making it enough to have the refs directory
group-writable.
Therefore, it shouldn't be actually necessary to meddle with umask
anymore. The documentation is obsolete; I'll remove the relevant bits
from Cogito docs.
--
Petr "Pasky" Baudis
Stuff: http://pasky.or.cz/
Of the 3 great composers Mozart tells us what it's like to be human,
Beethoven tells us what it's like to be Beethoven and Bach tells us
what it's like to be the universe. -- Douglas Adams
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Shared repositories and umask
2006-02-15 13:05 ` Petr Baudis
@ 2006-02-15 13:51 ` Johannes Schindelin
2006-02-15 13:59 ` Petr Baudis
2006-02-15 14:06 ` Martin Mares
1 sibling, 1 reply; 5+ messages in thread
From: Johannes Schindelin @ 2006-02-15 13:51 UTC (permalink / raw)
To: Petr Baudis; +Cc: Martin Mares, git
Hi,
On Wed, 15 Feb 2006, Petr Baudis wrote:
> Dear diary, on Wed, Feb 15, 2006 at 01:19:07PM CET, I got a letter
> where Martin Mares <mj@ucw.cz> said that...
> > I'm playing with a shared repository and I am still unable to get the
> > file and directory permissions kept correctly, that is writeable to
> > a group.
> >
> > Setting the `core.sharedrepository' flag helps a bit, but not completely:
> > the object files and directories are group-writeable, but for example new
> > head refs aren't.
>
> actually, this is not necessary, since when pushing to shared
> repositories, the new ref is created in the directory as a lockfile and
> then moved over the original ref - this makes the ref updating safe and
> raceless, while also making it enough to have the refs directory
> group-writable.
IIRC the relevant discussion was started by this:
http://thread.gmane.org/gmane.comp.version-control.git/13856
> Therefore, it shouldn't be actually necessary to meddle with umask
> anymore. The documentation is obsolete; I'll remove the relevant bits
> from Cogito docs.
Basically, if you just want a shared repository, you don't need to set the
umask. However, if you want to work in the working directory (multiple
users), you have to set the umask (it is not enough that the git tools do
that, because you are likely to work with other programs as well).
Hth,
Dscho
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Shared repositories and umask
2006-02-15 13:51 ` Johannes Schindelin
@ 2006-02-15 13:59 ` Petr Baudis
0 siblings, 0 replies; 5+ messages in thread
From: Petr Baudis @ 2006-02-15 13:59 UTC (permalink / raw)
To: Johannes Schindelin; +Cc: Martin Mares, git
Hi,
Dear diary, on Wed, Feb 15, 2006 at 02:51:50PM CET, I got a letter
where Johannes Schindelin <Johannes.Schindelin@gmx.de> said that...
> On Wed, 15 Feb 2006, Petr Baudis wrote:
> > Therefore, it shouldn't be actually necessary to meddle with umask
> > anymore. The documentation is obsolete; I'll remove the relevant bits
> > from Cogito docs.
>
> Basically, if you just want a shared repository, you don't need to set the
> umask. However, if you want to work in the working directory (multiple
> users), you have to set the umask (it is not enough that the git tools do
> that, because you are likely to work with other programs as well).
yes, but that's kind of rare workflow - I guess mostly when you have
your website in GIT and update the working copy in the post-update hook
- but then you can easily setup umask in the hook as well.
--
Petr "Pasky" Baudis
Stuff: http://pasky.or.cz/
Of the 3 great composers Mozart tells us what it's like to be human,
Beethoven tells us what it's like to be Beethoven and Bach tells us
what it's like to be the universe. -- Douglas Adams
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Shared repositories and umask
2006-02-15 13:05 ` Petr Baudis
2006-02-15 13:51 ` Johannes Schindelin
@ 2006-02-15 14:06 ` Martin Mares
1 sibling, 0 replies; 5+ messages in thread
From: Martin Mares @ 2006-02-15 14:06 UTC (permalink / raw)
To: Petr Baudis; +Cc: git
> Therefore, it shouldn't be actually necessary to meddle with umask
> anymore. The documentation is obsolete; I'll remove the relevant bits
> from Cogito docs.
Thanks for the hint!
Have a nice fortnight
--
Martin `MJ' Mares <mj@ucw.cz> http://atrey.karlin.mff.cuni.cz/~mj/
Faculty of Math and Physics, Charles University, Prague, Czech Rep., Earth
First law of socio-genetics: Celibacy is not hereditary.
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2006-02-15 14:06 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-02-15 12:19 Shared repositories and umask Martin Mares
2006-02-15 13:05 ` Petr Baudis
2006-02-15 13:51 ` Johannes Schindelin
2006-02-15 13:59 ` Petr Baudis
2006-02-15 14:06 ` Martin Mares
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox