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

Re: On --depth=funny value

From
Duy Nguyen <pclouds@gmail.com>
Date
Jan 9, 2013, 04:18 UTC
Message-ID
<CACsJy8CA-a0=HqTY9heJBhPO4M5jyLk=tf253rRKCRuTWz5teg@mail.gmail.com>
In-Reply-To
<7vy5g383sy.fsf_-_@alter.siamese.dyndns.org>
On Wed, Jan 9, 2013 at 9:53 AM, Junio C Hamano <gitster@pobox.com> wrote:
>  * First, let's *not* do "git fetch --depth=inf"; if you want to
>    unplug the bottom of your shallow clone, be more explicit and
>    introduce a new option, e.g. "git fetch --unshallow", or
>    something.

No problem. "Something" could be --no-depth or --no-shallow. I think any of them is better than --unshallow.

Show 5 quoted lines
>  * We would like to update "clone --depth=1" to end up with a tip
>    only repository, but let's not to touch "git fetch" (and "git
>    clone") and make them send 0 over the wire when the command line
>    tells them to use "--depth=1" (i.e. let's not do the "off-by-one"
>    thing).
You can't anyway. Depth 0 on the wire is considered invalid by upload-pack.
Show 9 quoted lines
>    Instead, fix "upload-pack" (the bug is in get_shallow_commits()
>    in shallow.c, I think), so that it counts correctly.  When the
>    other end asks for a history with 1-commit deep, it should return
>    a history that is 1-commit deep, and tell the other end about the
>    parents of the returned history, instead of returning a history
>    that is 2 commmits deep.  So when talking with a newer server,
>    clients will get correct number of commits; when talkng with an
>    older server, clients will get a bit more than they asked, but
>    nothing will break.

I'll need to look at get_shallow_commits() anyway for the unshallow patch. I'll probably do this too.

-- 
Duy
Previous: Junio C HamanoNext: Junio C Hamano
Message 7 of 18 in “add warning for depth=0 in git clone.”
  1. add warning for depth=0 in git clone.Stefan Beller, Jan 8, 2013
  2. Stefan BellerJan 8, 2013
  3. Jonathan NiederJan 8, 2013
  4. Jonathan NiederJan 8, 2013
  5. Duy NguyenJan 9, 2013
  6. On --depth=funny valueJunio C Hamano, Jan 9, 2013
  7. Duy NguyenJan 9, 2013
  8. Junio C HamanoJan 9, 2013
  9. Duy NguyenJan 9, 2013
  10. Duy NguyenJan 9, 2013
  11. Stefan BellerJan 9, 2013
  12. 1/2 fetch, upload-pack: add --no-shallow for infinite depthNguyễn Thái Ngọc Duy, Jan 11, 2013
  13. 2/2 upload-pack: fix off-by-one depth calculation in shallow cloneNguyễn Thái Ngọc Duy, Jan 11, 2013
  14. Junio C HamanoJan 11, 2013
  15. Junio C HamanoJan 11, 2013
  16. 1/3 fetch: add --unshallow for turning shallow repo into complete oneNguyễn Thái Ngọc Duy, Jan 11, 2013
  17. 2/3 upload-pack: fix off-by-one depth calculation in shallow cloneNguyễn Thái Ngọc Duy, Jan 11, 2013
  18. 3/3 fetch: elaborate --depth actionNguyễn Thái Ngọc Duy, Jan 11, 2013

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.