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

Re: Multiple fetches when unshallowing a shallow clone

From
Duy Nguyen <pclouds@gmail.com>
Date
Dec 5, 2015, 05:33 UTC
Message-ID
<CACsJy8BSNm6=E6Mo6etv_Lvdd2kpqQ7EEMBAoP-AQraYy3xU8w@mail.gmail.com>
In-Reply-To
<xmqqh9jxrfy5.fsf@gitster.mtv.corp.google.com>
On Fri, Dec 4, 2015 at 11:45 PM, Junio C Hamano <gitster@pobox.com> wrote:
Show 15 quoted lines
> Jeff King <peff@peff.net> writes:
>
>>> 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.
>
> Hmm, "0" means "no depth limitations", which is exactly what we want
> in this "unshallow" case, I would think.  The behaviour observed is

No depth 0 means "do not change depth", which is why Jeff saw no 'deepen' lines (and those lines should be rejected any way). It's equivalent of doing "git fetch" without --depth.

Show 7 quoted lines
> just like a regular fetch that auto-follows tags, where it has to
> make a second fetch if the primary fetch fails to include everything
> that is needed for propagating the tag for whatever reason.
>
> Having said that, IIRC, these days a depth limited clone is created
> implicitly with --single-branch option, and I am not sure what the
> right behaviour for the auto-following of tags in such a repository.

I suppose followtags feature has been around long enough that we can simply trust that and skip the second fetch? But it's not that easy for subsequent fetches after the initial fetch in git-clone, because we no longer know if --single-branch was used (of if there is any new branch fetched since).

-- 
Duy
Previous: Junio C HamanoNext: Junio C Hamano
Message 9 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.