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

Re: Multiple fetches when unshallowing a shallow clone

From
Jeff King <peff@peff.net>
Date
Dec 4, 2015, 21:51 UTC
Message-ID
<20151204215158.GA27987@sigill.intra.peff.net>
In-Reply-To
<CACs8u9Qvqn4KDMKo+RHsQaf+dw+CGtWrOpoUJzaZAqD1rFRiuw@mail.gmail.com>
On Fri, Dec 04, 2015 at 04:38:16PM -0500, Jason Paller-Rzepka wrote:
> It appears that it happens when the shallow history grows to include a
> commit that's pointed to by a previously unseen tag.  For example,
> when I deepen a checkout of git to depth 8, I hit v2.5.2, and a second
> fetch takes place.
Yeah. The code is in builtin/fetch.c:backfill_tags.
> But why would fetching a tag (or set of tags) merit a depth of zero?
> Doesn't depth 1 mean "give me the the objects, and none of their
> descendants"?  Why use 0?
That comes from this line:
  transport_set_option(transport, TRANS_OPT_DEPTH, "0");

That line blame back to b888d61 (Make fetch a builtin, 2007-09-10), which isn't incredibly helpful.

I think that comes from the original git-fetch.sh, which had:
  ?*)
          # do not deepen a shallow tree when following tags
          shallow_depth=

Which makes sense. I think the code at that point is not aware that we just "unshallowed" and can therefore drop the depth parameter altogether. But I admit I am not all that familiar with the shallow code.

+cc Duy, who can probably say something way more intelligent about this off the top of his head. :)

-Peff
Previous: Stefan BellerNext: Junio C Hamano
Message 7 of 19 in “Multiple fetches when unshallowing a shallow clone”
  1. Jason Paller-RzepkaNov 30, 2015
  2. Stefan BellerDec 4, 2015
  3. Jeff KingDec 4, 2015
  4. Stefan BellerDec 4, 2015
  5. Jason Paller-RzepkaDec 4, 2015
  6. Stefan BellerDec 4, 2015
  7. Jeff KingDec 4, 2015
  8. Junio C HamanoDec 4, 2015
  9. Duy NguyenDec 5, 2015
  10. Junio C HamanoDec 6, 2015
  11. Jeff KingDec 6, 2015
  12. Jeff KingDec 6, 2015
  13. Duy NguyenDec 6, 2015
  14. Jason Paller-RzepkaDec 7, 2015
  15. Junio C HamanoDec 7, 2015
  16. Jeff KingDec 7, 2015
  17. Junio C HamanoDec 4, 2015
  18. Jeff KingDec 4, 2015
  19. Duy NguyenDec 7, 2015

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.