Pack protocol

Wrgl's pack protocol has a lot of similarities with Git's pack-protocol. Just like Git, Wrgl has two sets of protocols, one for pushing from client to server, one for fetching from server to client. But unlike Git, Wrgl only supports transfering data over HTTP transport.

Another deviation is the replacement of pktline format with JSON format for light-weight communications. Packfile is still used to transfer objects but unlike Git, Wrgl does not use packfile in any other way except as a transport medium.

Fetch data

This protocol is what power wrgl fetch. Just like Git, the process start with reference discovery. The client hits the /refs/ endpoint to find out which refs are more up-to-date before negotiating with the server which set of objects to include in the packfile. Once both client and server can agree on a minimum set of objects to download, a packfile is created and transfered to the client. Both the negotiation and the packfile transfer are done over /upload-pack/ endpoint.

Push data

This is what happen under the hood when user run wrgl push. Again, the process does not deviate far from Git's. The client hits /refs/ to find out which refs need to be updated. It then send a list of update proposals to the /receive-pack/ endpoint. Once the server agrees on the updates, the client starts sending objects in packfile format also to the /receive-pack/ endpoint.