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

[PATCH v2 2/3] clone: document --partial and --filter options

From
Derrick Stolee via GitGitGadget <gitgitgadget@gmail.com>
Date
Apr 13, 2020, 15:25 UTC
Message-ID
<9baf4c8ba383414e41d3d7726cf40c39cbf197e7.1586791560.git.gitgitgadget@gmail.com>
In-Reply-To
<pull.745.v2.git.git.1586791560.gitgitgadget@gmail.com>
From: Derrick Stolee <dstolee@microsoft.com>

The previous change added the "--partial[=<size>]" option to "git clone" equivalent to "--filter=blob:none" or "--filter=blob:limit=<size>" but did not document that addition. It turns out that the "--filter=<filter-spec>" option was not documented anywhere in the "git clone" page, and instead is detailed carefully in "git rev-list" where it serves a different purpose.

Add a small bit about these options in the documentation. It would be worth some time to create a subsection in the "git clone" documentation about partial clone as a concept and how it can be a surprising experience. For example, "git checkout" will likely trigger a pack download.

Signed-off-by: Derrick Stolee <dstolee@microsoft.com>
---
 Documentation/git-clone.txt | 15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)
diff --git a/Documentation/git-clone.txt b/Documentation/git-clone.txt
index bf24f1813ad..eafa1c39927 100644
--- a/Documentation/git-clone.txt
+++ b/Documentation/git-clone.txt
@@ -15,7 +15,8 @@ SYNOPSIS
 	  [--dissociate] [--separate-git-dir <git dir>]
 	  [--depth <depth>] [--[no-]single-branch] [--no-tags]
 	  [--recurse-submodules[=<pathspec>]] [--[no-]shallow-submodules]
-	  [--[no-]remote-submodules] [--jobs <n>] [--sparse] [--] <repository>
+	  [--[no-]remote-submodules] [--jobs <n>] [--sparse]
+	  [--partial[=<size>]|--filter=<filter>] [--] <repository>
 	  [<directory>]
 
 DESCRIPTION
@@ -162,6 +163,18 @@ objects from the source repository into a pack in the cloned repository.
 	of the repository. The sparse-checkout file can be
 	modified to grow the working directory as needed.
 
+--partial[=<size>]::
+--filter=<filter-spec>::
+	Use the partial clone feature and request that the server sends
+	a subset of reachable objects according to a given object filter.
+	When using `--filter`, the supplied `<filter-spec>` is used for
+	the partial clone filter. When using `--partial` with no `<size>`,
+	the `blob:none` filter is applied to filter all blobs. When using
+	`--partial=<size>` the `blob:limit=<size>` filter is applied to
+	filter all blobs with size larger than `<size>`. For more details
+	on filter specifications, see the `--filter` option in
+	linkgit:git-rev-list[1].
+
 --mirror::
 	Set up a mirror of the source repository.  This implies `--bare`.
 	Compared to `--bare`, `--mirror` not only maps local branches of the
-- 
gitgitgadget
Previous: Derrick Stolee via GitGitGadgetNext: Dyrone Teng via GitGitGadget
Message 7 of 24 in “clone: document partial clone section”
  1. clone: document partial clone sectionTeng Long via GitGitGadget, Apr 2, 2020
  2. Derrick StoleeApr 2, 2020
  3. Junio C HamanoApr 2, 2020
  4. Derrick StoleeApr 2, 2020
  5. 0/3 clone: document partial clone sectionTeng Long via GitGitGadget, Apr 13, 2020
  6. 1/3 partial-clone: set default filter with --partialDerrick Stolee via GitGitGadget, Apr 13, 2020
  7. 2/3 clone: document --partial and --filter optionsDerrick Stolee via GitGitGadget, Apr 13, 2020
  8. 3/3 clone: document partial clone sectionDyrone Teng via GitGitGadget, Apr 13, 2020
  9. Philippe BlainOct 27, 2020
  10. Junio C HamanoApr 13, 2020
  11. Derrick StoleeApr 14, 2020
  12. Junio C HamanoApr 14, 2020
  13. Derrick StoleeApr 14, 2020
  14. Derrick StoleeApr 14, 2020
  15. clone: document partial clone sectionTeng Long via GitGitGadget, Oct 27, 2020
  16. Philippe BlainOct 27, 2020
  17. Junio C HamanoOct 27, 2020
  18. clone: document partial clone sectionTeng Long via GitGitGadget, Feb 25, 2021
  19. Philippe BlainFeb 25, 2021
  20. clone: document partial clone sectionTeng Long via GitGitGadget, Mar 2, 2021
  21. Junio C HamanoMar 3, 2021
  22. Fix inconsistent signed-off-by abd author nameTeng Long, May 6, 2021
  23. 1/1 clone: document partial clone sectionTeng Long, May 6, 2021
  24. Bagas SanjayaMay 7, 2021

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.