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

Re: Fetching single tag in shallow clone almost unshallow the clone

From
Bagas Sanjaya <bagasdotme@gmail.com>
Date
May 28, 2021, 12:46 UTC
Message-ID
<524c529d-e2f3-3432-55c5-cb05fe8ecf02@gmail.com>
In-Reply-To
<d641512e-657f-6dfc-adf4-1b1889439553@gmail.com>
Hi,
> You should add a --depth here, too. Git doesn't remember that you want
> a certain depth, because that doesn't work in perpetuity.
> 

OK. I can specify --depth that I want, but often I forget how deep my clone when fetching tag with --depth, so that it has the same depth as before fetching tag. What should I do?

Show 6 quoted lines
> You are hitting the issue I documented in my comparison between partial
> and shallow clones [1]: The commit history for go1.16.1 goes "around"
> your shallow boundary. See the image immediately above the "Comparing
> Clone Options" section.
> 
> [1] https://github.blog/2020-12-21-get-up-to-speed-with-partial-clone-and-shallow-clone/#user-content-shallow-clones

So basically when I request fetching something out of shallow boundary, Git "unshallow" by fetching the whole remaining history (but not implies --unshallow).

I found out that shallow clones perform on repos that have linear history policy (that is no merge commits). For example, on linear history repo, deepening shallow clone with `git fetch --deepen <n>` deepens the shallow boundary by <n> commits, whereas on repo with merge commits, doing the same may drastically zig-zag number of commits on the clone (at one instance can be more commits, at the other can be fewer).

-- 
An old man doll... just what I always wanted! - Clara
Previous: Derrick Stolee
Message 3 of 3 in “Fetching single tag in shallow clone almost unshallow the clone”
  1. Bagas SanjayaMay 28, 2021
  2. Derrick StoleeMay 28, 2021
  3. Bagas SanjayaMay 28, 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.