Re: Request for detailed documentation of git pack protocol
- From
Shawn O. Pearce <spearce@spearce.org>
- Date
- Jun 3, 2009, 14:17 UTC
- Message-ID
- <20090603141718.GC3355@spearce.org>
- In-Reply-To
- <m3r5y1a91m.fsf@localhost.localdomain>
Jakub Narebski <jnareb@gmail.com> wrote:
Show 11 quoted lines
> "Robin H. Johnson" <robbat2@gentoo.org> writes: > > > Relatedly with the "done" message, I'm in the process of writing a hook > > that allows the server to deny the client at this point, instead of > > building and sending a pack. > > I am not sure if it would be possible to fit a hook there, but perhaps > it would be possible to add such `pre-upload` hook... Note that it > would have to somehow work for both git:// and ssh:// protocols, and > perhaps also for "dumb" protocols such as http:// (and other > curl-based) and deprecated rsync://
Uh, that hook can't be used on HTTP or rsync. How do you expect the HTTP or rsync client to execute a process on the server? It can't, the server isn't git aware. Its only valid on smart protocols.
Show 8 quoted lines
> > My intended use is to block initial clones while still allowing updates > > (as long as you've got a tree at least commit X recent, I'll talk to > > you). Initial and too-old clients get a message to go and download a > > bundle instead. > > Wouldn't it be better to make use of mirror-sync (which sadly is in > planning stages only; see SoC2009Ideas page on git wiki) to redirect > to some other repository to be used for cloning requests?
Yes. But mirror-sync isn't here yet, and is a lot more work to create than hacking upload-pack.c to invoke a hook.
-- Shawn.