xmpp push control flow

It might even work, although nothing yet triggers XMPP pushes.

Also added a set of deferred push messages. Only one push can run at a
time, and unrelated push messages get deferred. The set will never grow
very large, because it only puts two types of messages in there, that
can only vary in the client doing the push.
This commit is contained in:
Joey Hess 2012-11-08 16:44:23 -04:00
parent 08916ef695
commit fb3b9412e4
6 changed files with 174 additions and 45 deletions

View file

@ -56,30 +56,38 @@ For pairing, a chat message is sent, containing:
### git push over XMPP
To request that a peer push to us, a chat message can be sent:
To request that a remote push to us, a chat message can be sent.
<git-annex xmlns='git-annex' pushrequest="uuid" />
The push request is typically sent directed at the account associated
with the remote, not to a specific client. So it can result in multiple
responses.
When a peer is ready to send a git push, it sends:
<git-annex xmlns='git-annex' startingpush="uuid" />
If that's a response to a pushrequest, it'll be directed at only the client
that requested the push. If a push request is being initiated, it'll be sent
to the account assicated with the remote.
The receiver runs `git receive-pack`, and sends back its output in
one or more chat messages:
one or more chat messages, directed to a specific client:
<git-annex xmlns='git-annex' rp="">
007b27ca394d26a05d9b6beefa1b07da456caa2157d7 refs/heads/git-annex report-status delete-refs side-band-64k quiet ofs-delta
</git-annex>
The sender replies with the data from `git push` (which does not need
to actually be started until this point):
The sender replies with the data from `git push`, in
one or more chat messages, directed to the receiver:
<git-annex xmlns='git-annex' sp="">
data
</git-annex>
When `git receive-pack` edits, the receiver indicates its exit
status:
status with a chat message, directed at the sender:
<git-annex xmlns='git-annex' rpdone="0" />