{"thread":{"id":"22762","subject":"[PATCH] Document shallow/unshallow/deepen protocol request and response.","startedAt":"2010-02-22T23:47:37Z","lastAt":"2010-02-22T23:47:37Z","messageCount":1,"participants":["dborowitz@google.com"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"135369","messageId":"1266882457-21665-1-git-send-email-dborowitz@google.com","threadId":"22762","inReplyTo":null,"subject":"[PATCH] Document shallow/unshallow/deepen protocol request and response.","fromName":"","fromEmail":"dborowitz@google.com","sentAt":"2010-02-22T23:47:37Z","receivedAt":"2010-02-22T23:47:37Z","isPatch":true,"sender":{"key":"dborowitz@google.com","avatar":"https://avatars.githubusercontent.com/u/194927?v=4"},"body":"From: Dave Borowitz <dborowitz@google.com>\n\nThis patch fixes a TODO in the pack protocol documentation about the\nprotocol for shallow clones. I'll be the first to admit I may not\nunderstand shallow clones fully, but this patch is hopefully a good\nstarting point.\n\n---\n Documentation/technical/pack-protocol.txt |   36 +++++++++++++++++++++-------\n 1 files changed, 27 insertions(+), 9 deletions(-)\n\ndiff --git a/Documentation/technical/pack-protocol.txt b/Documentation/technical/pack-protocol.txt\nindex 9a5cdaf..d3392f5 100644\n--- a/Documentation/technical/pack-protocol.txt\n+++ b/Documentation/technical/pack-protocol.txt\n@@ -194,6 +194,7 @@ effect, out of what the server said it could do with the first 'want' line.\n \n ----\n   upload-request    =  want-list\n+\t\t       shallow-request\n \t\t       have-list\n \t\t       compute-end\n \n@@ -204,6 +205,11 @@ effect, out of what the server said it could do with the first 'want' line.\n   first-want        =  PKT-LINE(\"want\" SP obj-id SP capability-list LF)\n   additional-want   =  PKT-LINE(\"want\" SP obj-id LF)\n \n+  shallow-request   =  *shallow-line\n+\t\t       deepen-line\n+  shallow-line      =  PKT-LINE(\"shallow\" SP obj-id LF)\n+  deepen-line       =  PKT-LINE(\"deepen\" SP 1*DIGIT LF)\n+\n   have-list         =  *have-line\n   have-line         =  PKT-LINE(\"have\" SP obj-id LF)\n   compute-end       =  flush-pkt / PKT-LINE(\"done\")\n@@ -215,15 +221,23 @@ discovery phase as 'want' lines. Clients MUST send at least one\n obj-id in a 'want' command which did not appear in the response\n obtained through ref discovery.\n \n-If client is requesting a shallow clone, it will now send a 'deepen'\n-line with the depth it is requesting.\n+If client is requesting a shallow clone, it will now send a 'shallow'\n+line for each shallow commit it currently has, followed by a 'deepen'\n+line for the depth it is requesting.\n+\n+The server will respond to a shallow clone request with several\n+'shallow'/'unshallow' lines. The server MUST send one 'shallow' line for\n+each new commit that will be shallow following the deepen operation, and\n+the server MUST send one 'unshallow' line for each shallow commit the\n+client has that will no longer be shallow after the deepen. The server\n+SHOULD NOT send 'shallow' lines for shallow commits the client has that\n+remain shallow. The server MUST NOT mention an obj-id in an 'unshallow'\n+line that the client did not mention in a corresponding 'shallow' line.\n \n Once all the \"want\"s (and optional 'deepen') are transferred,\n clients MUST send a flush-pkt. If the client has all the references\n on the server, client flushes and disconnects.\n \n-TODO: shallow/unshallow response and document the deepen command in the ABNF.\n-\n Now the client will send a list of the obj-ids it has using 'have'\n lines.  In multi_ack mode, the canonical implementation will send up\n to 32 of these at a time, then will send a flush-pkt.  The canonical\n@@ -289,11 +303,15 @@ if there is no common base found.\n Then the server will start sending its packfile data.\n \n ----\n-  server-response = *ack_multi ack / nak\n-  ack_multi       = PKT-LINE(\"ACK\" SP obj-id ack_status LF)\n-  ack_status      = \"continue\" / \"common\" / \"ready\"\n-  ack             = PKT-LINE(\"ACK SP obj-id LF)\n-  nak             = PKT-LINE(\"NAK\" LF)\n+  server-response  = [shallow-response]\n+\t\t    *ack_multi ack / nak\n+  shallow-response = *shallow-line\n+\t\t     *unshallow-line\n+  unshallow-line   = PKT-LINE(\"unshallow\" SP obj-id LF)\n+  ack_multi        = PKT-LINE(\"ACK\" SP obj-id ack_status LF)\n+  ack_status       = \"continue\" / \"common\" / \"ready\"\n+  ack              = PKT-LINE(\"ACK SP obj-id LF)\n+  nak              = PKT-LINE(\"NAK\" LF)\n ----\n \n A simple clone may look like this (with no 'have' lines):\n-- \n1.7.0.rc2.28.gf476c0\n"}]}