Problems with a gitosis port

Michael Hudson michael.hudson at canonical.com
Mon Nov 24 21:06:32 GMT 2008


Adam Olsen wrote:
> On Sat, Nov 22, 2008 at 3:11 AM, Michael Hudson
> <michael.hudson at canonical.com> wrote:
>> Well, that's a lack of imagination :)  The smart server process doesn't
>> interact with the file system directly, but rather with a transport.
>> The transport doesn't have to perform all the requests asked of it.
>> (This is how Launchpad works).
> 
> Ok, so the idea might possibly be to create a new transport?

Right.

> I've
> looked in bzrlib.transports.__init__ and I can see there that it's
> possible to register my own transports.  Would it be a good idea, on
> the server side, to create a plugin that subclasses the ssh.py
> transport?

No.

Let me try to make more sense.

When you are dealing with a branch over bzr+ssh there are of course
several layers.  On the client side, whatever you're doing is done in
terms of the transport API, where the transport comes from
get_transport("bzr+ssh://...").

In the bzr+ssh case, the transport will be a RemoteTransport (I think
that's the name anyway...) which talks, over ssh, to the bzr serve
process running on the server.  The bzr serve process talks to another
transport, usually a LocalTransport, to carry out the operations that
need doing.  I'm suggesting you swizzle in a different transport here,
instead of the LocalTransport, that knows which repositories a given
user is allowed to modify.

> I've looked through bzrlib.smart, bzrlib.medium, bzrlib.protocol and
> though it seems pretty concise, it does feel a little overwhelming not
> knowing any of the codebase.

I'm sure!

> I don't want you to do my work for me, but a hint on where to start
> for something like this would be great.  Basically, when a bzr+ssh
> connection is made, I need to somehow find out which repository the
> user is requesting and act upon it.

The above won't help you with what you say you need here.  But I doubt
you really need what you say here -- you're slightly suggesting a
solution when I'd be more able to help if you explained the problem.
Can you explain your problem in more detail?  Bearing in mind that I
don't know much about gitosis.

(If you really do need to know the full path on connection to the
server, I think it's probably possible with a plugin, but it will
require more work server side, I think).

Cheers,
mwh



More information about the bazaar mailing list