radicle-dev / radicle-link

The second iteration of the Radicle code collaboration protocol.
Other
421 stars 39 forks source link

git-protocol: make stateless #741

Closed kim closed 2 years ago

kim commented 2 years ago

While working on replication v3, it becomes apparent that layering more state handling on top of a stateful transport is getting quite convoluted. Thus make all git protocol v2 interactions stateless, ie. a "delegate" represents a single command.

Note that this requires to assemble the capabilities advertisement ourselves, as git upload-pack cannot be taught to send it when using --stateless-rpc.

Signed-off-by: Kim Altintop kim@eagain.st

kim commented 2 years ago

/cc @Byron

You'll notice that, while it works, this is slightly shoehorned onto the stateful-by-default git_protocol::fetch. Specifically, I think indicate_end_of_interaction here should be sent unconditionally to abort the fetch command early. It's not a big deal though, as closing the stream should have the same effect.