git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Christoph Duelli <duelli@melosgmbh.de>
To: Linus Torvalds <torvalds@linux-foundation.org>, git@vger.kernel.org
Subject: Re: preventing a push
Date: Tue, 18 Dec 2007 17:53:10 +0100	[thread overview]
Message-ID: <4767FAF6.6050204@melosgmbh.de> (raw)
In-Reply-To: <alpine.LFD.0.9999.0712180819480.21557@woody.linux-foundation.org>

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

      reply	other threads:[~2007-12-18 16:55 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4767FAF6.6050204@melosgmbh.de \
    --to=duelli@melosgmbh.de \
    --cc=git@vger.kernel.org \
    --cc=torvalds@linux-foundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).