Subject: Re: Can I prevent someone clone my git repository?

From: "Shawn O. Pearce" <[email-masked]>
Date: Thu, 8 Jan 2009 07:29:34 -0800

Johannes Schindelin <[email-masked]> wrote:
> On Thu, 8 Jan 2009, Miklos Vajna wrote:
> 
> > On Thu, Jan 08, 2009 at 12:27:59PM +0100, Johannes Schindelin <[email-masked]> wrote:
> > > > like git://your-host/repository.git
> > > 
> > > If the people are on different IPs, a hook can restrict who may clone, 
> > > since commit v1.6.1-rc1~109.
> > 
> > Hmm, but I think there is no hook called "pre-send" or so that could 
> > return status code 1 to prevent receiving, so that commit on its own 
> > does not does what Emily needs here.
> 
> Oops.  I assumed there is a pre-upload hook, but apparently I was wrong.
> 
> Would be easy to introduce that hook, though...

Well, sure, but Emily is asking about "no clone".

Does that mean that users can ask for incremental updates, but not
initial clones where there is nothing in common?

If so then any sort of hook needs an input parameter and needs
to be called after the commit negotation is complete, so the hook
can be told "the other side has some stuff" or "the other side has
nothing at all".

FWIW I was just yesterday talking to a co-worker about adding this
sort of behavior to Gerrit2.  Cloning the Linux kernel over its
internal sshd is quite a bit slower than doing it over native git,
so we were talking about blocking initial clones.  Everything in
a Gerrit server should be opensource and available over git://,
so its just a limit to save server resources.

-- 
Shawn.