I'm stunned and stoked to have gotten git push over XMPP working today. And am nearly out of steam, it was a wild ride..

To xmpp::joey@kitenet.net
  * [new branch]      master -> refs/xmpp/newmaster

The surprising part is how close my initial implementation came to just working on the first try. It had around 3 bugs, which took hours of staring at debugging output to find:

  1. The git push action was run in the same thread as the XMPP client, which prevented the client from continuing to run and relaying messages.
  2. The git-receive-pack side waited on the wrong thread, so didn't notice when the program was done.
  3. I accidentally used the wrong attribute name when sending a ReceivePackDone message.

But all in all, it just worked.

Here's a sample of the actual data sent when one file is added to the repository (also includes the corresponding update to the git-annex branch):



Git said this push took 385 bytes; after base64 encoding to transport it over XMPP as shown above, it needs 701 bytes, and the XMPP envelope and encryption adds more overhead (although the XMPP connection may also be compressed?)

Not the most efficient git transport, but still a practical one!

Big thanks by the way to meep, who posted a comment reminding me about git-remote-helpers. This was the right thing to use for XMPP over git, it lets the git remote be configured with url = xmpp::user@host.

Next, I need to get the assistant to use this for syncing. Currently, it only pushes a test branch.