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

[PATCH v2 0/3] clone: document partial clone section

From
Teng Long via GitGitGadget <gitgitgadget@gmail.com>
Date
Apr 13, 2020, 15:25 UTC
Message-ID
<pull.745.v2.git.git.1586791560.gitgitgadget@gmail.com>
In-Reply-To
<pull.745.git.git.1585792946341.gitgitgadget@gmail.com>

Partial clones are created using 'git clone', but there is no related help information in the git-clone documentation during a period. Add a relevant section to help users understand what partial clones are and how they differ from normal clones.

The section briefly introduces the applicable scenarios and some precautions of partial clone. If users want to know more about its technical design and other details, users can view the link of git-partial-clone(7) according to the guidelines in the section.

Derrick Stolee (2):
  partial-clone: set default filter with --partial
  clone: document --partial and --filter options
Dyrone Teng (1):
  clone: document partial clone section
 Documentation/git-clone.txt   | 87 ++++++++++++++++++++++++++++++++++-
 list-objects-filter-options.c | 18 ++++++++
 list-objects-filter-options.h |  8 +++-
 t/t5616-partial-clone.sh      | 42 +++++++++++++----
 4 files changed, 143 insertions(+), 12 deletions(-)
base-commit: 6c85aac65fb455af85745130ce35ddae4678db84
Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-git-745%2Fdyrone%2Fmaster-v2
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-git-745/dyrone/master-v2
Pull-Request: https://github.com/git/git/pull/745
Range-diff vs v1:
 -:  ----------- > 1:  6f340d9aadf partial-clone: set default filter with --partial
 -:  ----------- > 2:  9baf4c8ba38 clone: document --partial and --filter options
 1:  f063efa545b ! 3:  c1a44a35095 clone: document partial clone section
     @@ Commit message
          clone: document partial clone section
      
          Partial clones are created using 'git clone', but there is no related
     -    help information in the git-clone documentation during a period. Add
     -    a relevant section to help users understand what partial clones are
     -    and how they differ from normal clones.
     +    help information in the git-clone documentation. Add a relevant section
     +    to help users understand what partial clones are and how they differ
     +    from normal clones.
      
          The section briefly introduces the applicable scenarios and some
          precautions of partial clone. If users want to know more about its
          technical design and other details, users can view the link of
          git-partial-clone(7) according to the guidelines in the section.
      
     -    Signed-off-by: Teng Long <dyroneteng@gmail.com>
     +    Signed-off-by: Dyrone Teng <dyroneteng@gmail.com>
      
       ## Documentation/git-clone.txt ##
      @@ Documentation/git-clone.txt: or `--mirror` is given)
     @@ Documentation/git-clone.txt: or `--mirror` is given)
      +-------------
      +
      +By default, `git clone` will download every reachable object, including
     -+every version of every file in the history of the repository. The **partial clone**
     -+feature allows Git to transfer fewer objects and request them from the
     -+remote only when they are needed, so some reachable objects can be
     -+omitted from the initial `git clone` and subsequent `git fetch`
     -+operations. In this way, a partial clone can reduce the network traffic
     -+costs and disk space usage when git is working under a large repository.
     ++every version of every file in the history of the repository. The
     ++**partial clone** feature allows Git to transfer fewer objects and
     ++request them from the remote only when they are needed, so some
     ++reachable objects can be omitted from the initial `git clone` and
     ++subsequent `git fetch` operations.
      +
      +To use the partial clone feature, you can run `git clone` with the 
     -+`--filter=<filter-spec>` option. If the repository has a deep history
     -+and you don't want to download any blobs, the form `filter=blob:none`
     -+will omit all the blobs. If the repository has some large blobs and you
     -+want to prevent some large blobs being downloaded by an appropriate
     -+threshold, the form `--filter=blob:limit=<n>[kmg]` omits blobs larger
     -+than n bytes or units (see linkgit:git-rev-list[1]).
     ++`--filter=<filter-spec>` option. If you want to clone a repository
     ++without download any blobs, the form `filter=blob:none` will omit all
     ++the blobs. If the repository has some large blobs and you want to
     ++prevent some large blobs being downloaded by an appropriate threshold,
     ++the form `--filter=blob:limit=<n>[kmg]`omits blobs larger than n bytes
     ++or units (see linkgit:git-rev-list[1]).
      +
     -+When using a partial clone, Git will request missing objects from the
     -+remote(s) when necessary. Several commands that do not involve a request
     -+over a network may now trigger these requests.
     ++As mentioned before, a partially cloned repository may have to request
     ++the missing objects when they are needed. So some 'local' commands may
     ++fail without a network connection to the remote repository.
      +
      +For example, The <repository> contains two branches which names 'master'
      +and 'topic. Then, we clone the repository by
     @@ Documentation/git-clone.txt: or `--mirror` is given)
      +were downloaded previously.
      +
      +`git log` may also make a surprise with partial clones. `git log
     -+--<path>` will not cause downloads with the blob filters, because it's
     -+only reading commits. `git log -p -- <path>` will download blobs to
     -+generate the patch output and git log --raw will download all blobs
     -+that changed at recent commits in order to compute renames.
     ++-- <pathspec>` will not cause downloads with the blob filters, because
     ++it's only reading commits and trees. In addition to any options that
     ++require git to look at the contents of blobs, like "-p" and "--stat"
     ++, options that cause git to report pathnames, like "--summary" and
     ++"--raw", will trigger lazy/on-demand fetching of blobs, as they are
     ++needed to detect inexact renames.
     ++
     ++linkgit:partial-clone[1]
      +
       :git-clone: 1
       include::urls.txt[]
-- 
gitgitgadget
Previous: Derrick StoleeNext: Derrick Stolee via GitGitGadget
Message 5 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.