git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH v2 13/19] upload-pack: add filter-objects to protocol documentation

From
JHJeff Hostetler <git@jeffhostetler.com>
Date
Jul 13, 2017, 17:34 UTC
Message-ID
<20170713173459.3559-14-git@jeffhostetler.com>
In-Reply-To
<20170713173459.3559-1-git@jeffhostetler.com>
From: Jeff Hostetler <jeffhost@microsoft.com>
Signed-off-by: Jeff Hostetler <jeffhost@microsoft.com>
---
 Documentation/technical/pack-protocol.txt         | 16 ++++++++++++++++
 Documentation/technical/protocol-capabilities.txt |  7 +++++++
 2 files changed, 23 insertions(+)
diff --git a/Documentation/technical/pack-protocol.txt b/Documentation/technical/pack-protocol.txt
index a349171..dce6e04 100644
--- a/Documentation/technical/pack-protocol.txt
+++ b/Documentation/technical/pack-protocol.txt
@@ -212,6 +212,7 @@ out of what the server said it could do with the first 'want' line.
   upload-request    =  want-list
 		       *shallow-line
 		       *1depth-request
+		       [filter-request]
 		       flush-pkt
 
   want-list         =  first-want
@@ -226,7 +227,13 @@ out of what the server said it could do with the first 'want' line.
   first-want        =  PKT-LINE("want" SP obj-id SP capability-list)
   additional-want   =  PKT-LINE("want" SP obj-id)
 
+  filter-request    =  PKT-LINE("filter-omit-all-blobs") /
+		       PKT-LINE("filter-omit-large-blobs" SP magnitude) /
+		       PKT-LINE("filter-use-sparse" SP obj-id)
+
   depth             =  1*DIGIT
+
+  magnitude         =  1*DIGIT [ "k" | "m" | "g" ]
 ----
 
 Clients MUST send all the obj-ids it wants from the reference
@@ -249,6 +256,15 @@ complete those commits. Commits whose parents are not received as a
 result are defined as shallow and marked as such in the server. This
 information is sent back to the client in the next step.
 
+The client can optionally request that pack-objects omit various
+objects from the packfile using one of several filtering techniques.
+These are intended for use with partial/narrow clone/fetch operations.
+"filter-omit-all-blobs" requests that all blobs be omitted from
+the packfile.  "filter-omit-large-blobs" requests that blobs larger
+than the requested size be omitted, unless they have a ".git*"
+special filename.  "filter-use-sparse" requests blob filtering based
+upon a sparse-checkout specification in the given blob id.
+
 Once all the 'want's and 'shallow's (and optional 'deepen') are
 transferred, clients MUST send a flush-pkt, to tell the server side
 that it is done sending the list.
diff --git a/Documentation/technical/protocol-capabilities.txt b/Documentation/technical/protocol-capabilities.txt
index 26dcc6f..7011eb3 100644
--- a/Documentation/technical/protocol-capabilities.txt
+++ b/Documentation/technical/protocol-capabilities.txt
@@ -309,3 +309,10 @@ to accept a signed push certificate, and asks the <nonce> to be
 included in the push certificate.  A send-pack client MUST NOT
 send a push-cert packet unless the receive-pack server advertises
 this capability.
+
+filter-objects
+--------------
+
+If the upload-pack server advertises the 'filter-objects' capability,
+fetch-pack may send "filter-*" commands to request a partial/narrow
+clone/fetch where the server omits various objects from the packfile.
-- 
2.9.3
Previous: Jeff HostetlerNext: Jeff Hostetler
Message 8 of 20 in “WIP object filtering for partial clone”
  1. 00/19 WIP object filtering for partial cloneJeff Hostetler, Jul 13, 2017
  2. 01/19 dir: refactor add_excludes()Jeff Hostetler, Jul 13, 2017
  3. 03/19 list-objects: filter objects in traverse_commit_listJeff Hostetler, Jul 13, 2017
  4. 06/19 list-objects-filters: add use-sparse-checkout filterJeff Hostetler, Jul 13, 2017
  5. 07/19 object-filter: common declarations for object filteringJeff Hostetler, Jul 13, 2017
  6. 11/19 pack-objects: add object filtering supportJeff Hostetler, Jul 13, 2017
  7. 10/19 t6112: rev-list object filtering testJeff Hostetler, Jul 13, 2017
  8. 13/19 upload-pack: add filter-objects to protocol documentationJeff Hostetler, Jul 13, 2017
  9. 17/19 clone: add filter argumentsJeff Hostetler, Jul 13, 2017
  10. 18/19 index-pack: relax consistency checks for omitted objectsJeff Hostetler, Jul 13, 2017
  11. 12/19 pack-objects: add filtering help textJeff Hostetler, Jul 13, 2017
  12. 14/19 upload-pack: add object filteringJeff Hostetler, Jul 13, 2017
  13. 15/19 fetch-pack: add object filtering supportJeff Hostetler, Jul 13, 2017
  14. 16/19 connected: add filter_allow_omitted option to APIJeff Hostetler, Jul 13, 2017
  15. 19/19 fetch: add object filtering to fetchJeff Hostetler, Jul 13, 2017
  16. 08/19 rev-list: add object filtering supportJeff Hostetler, Jul 13, 2017
  17. 09/19 rev-list: add filtering help textJeff Hostetler, Jul 13, 2017
  18. 02/19 oidset2: create oidset subclass with object length and pathnameJeff Hostetler, Jul 13, 2017
  19. 05/19 list-objects-filters: add omit-large-blobs filterJeff Hostetler, Jul 13, 2017
  20. 04/19 list-objects-filters: add omit-all-blobs filterJeff Hostetler, Jul 13, 2017

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.