git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* preventing a push
@ 2007-12-18 12:32 Christoph Duelli
  2007-12-18 16:32 ` Linus Torvalds
  0 siblings, 1 reply; 3+ messages in thread
From: Christoph Duelli @ 2007-12-18 12:32 UTC (permalink / raw)
  To: git

Is there a (recommended?) way to prevent accidental pushing (or pulling) 
from one repository into another (like the level command from bk days)?

Best regards
Christoph

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

* Re: preventing a push
  2007-12-18 12:32 preventing a push Christoph Duelli
@ 2007-12-18 16:32 ` Linus Torvalds
  2007-12-18 16:53   ` Christoph Duelli
  0 siblings, 1 reply; 3+ messages in thread
From: Linus Torvalds @ 2007-12-18 16:32 UTC (permalink / raw)
  To: Christoph Duelli; +Cc: git



On Tue, 18 Dec 2007, Christoph Duelli wrote:
>
> Is there a (recommended?) way to prevent accidental pushing (or pulling) from
> one repository into another (like the level command from bk days)?

I used BK for years, never knew about any level thing. I assume that was 
some way to introduce an "ordering" between repositories, where you could 
only push/pull in a controlled manner?

There's no obvious way to do exactly that, but the hooks git has may or 
may not be ok. For example, if you want to disallow pushing into some 
repository entirely (because you _only_ expect people to pull into it), 
you should be able to just make a "pre-receive" hook that always returns 
false. See Documentation/hooks.txt.

NOTE! There is no way to figure out what the pushing repository status is, 
which is why I say there is no way to do a "level"-equivalent thing 
(assuming I guessed what "level" does from the name). However, depending 
on how you allow people to access the machine, the hook obviously can look 
at things like $USER or other environment variables (ie you could make it 
look at what machine the user connected from etc).

But nothing really ever identifies the source repository (on a "git 
level") for a push: as far as git is concerned, all repositories are 
equal, and your hooks would invariably have to use non-git knowledge to 
figure out whether some operation should be allowed or not.

		Linus

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

* Re: preventing a push
  2007-12-18 16:32 ` Linus Torvalds
@ 2007-12-18 16:53   ` Christoph Duelli
  0 siblings, 0 replies; 3+ messages in thread
From: Christoph Duelli @ 2007-12-18 16:53 UTC (permalink / raw)
  To: Linus Torvalds, git

Linus Torvalds schrieb:
> 
> On Tue, 18 Dec 2007, Christoph Duelli wrote:
>> Is there a (recommended?) way to prevent accidental pushing (or pulling) from
>> one repository into another (like the level command from bk days)?
> 
> I used BK for years, never knew about any level thing. I assume that was 
> some way to introduce an "ordering" between repositories, where you could 
> only push/pull in a controlled manner?
Indeed, you can not move changes to a repo with a lower level.

> There's no obvious way to do exactly that, but the hooks git has may or 
> may not be ok. For example, if you want to disallow pushing into some 
> repository entirely (because you _only_ expect people to pull into it), 
> you should be able to just make a "pre-receive" hook that always returns 
> false. See Documentation/hooks.txt.
Ok, I will give hooks a try here.

> NOTE! There is no way to figure out what the pushing repository status is, 
> which is why I say there is no way to do a "level"-equivalent thing 
> (assuming I guessed what "level" does from the name). However, depending 
> on how you allow people to access the machine, the hook obviously can look 
> at things like $USER or other environment variables (ie you could make it 
> look at what machine the user connected from etc).
> 
> But nothing really ever identifies the source repository (on a "git 
> level") for a push: as far as git is concerned, all repositories are 
> equal, and your hooks would invariably have to use non-git knowledge to 
> figure out whether some operation should be allowed or not.
Perhaps it would be more git-like to use branches here. An accidental 
merge from a branch to another is probably less likely than an 
accidental push.

Thanks, and best regards

Christoph

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

end of thread, other threads:[~2007-12-18 16:55 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-12-18 12:32 preventing a push Christoph Duelli
2007-12-18 16:32 ` Linus Torvalds
2007-12-18 16:53   ` Christoph Duelli

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).