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

Re: [PATCH 1/2] fetch-pack: remove fetch_if_missing=0

From
Kousik Sanagavarapu <five231003@gmail.com>
Date
Feb 20, 2023, 18:13 UTC
Message-ID
<20230220181324.25116-1-five231003@gmail.com>
In-Reply-To
<20200507194354.33347-1-jonathantanmy@google.com>

So here, we are partial-cloning from a shallow remote and some objects are not sent due to our clone filters. Let's say that the shallow remote has a 5-commit history and we are cloning it into another repository with a blob:none filter. The expected behavior is cloning the 5 commits, with no blobs, except for the HEAD.

When executing the above process, it leads to errors:
	fatal: the remote end hung up unexpectedly
	fatal: protocol error: bad pack header
	warning: Clone succeeded, but checkout failed
	You can inspect what was checked out with 'git status'
	and retry with 'git restore --source=HEAD :/'

I looked into it a bit and it seems that packet_read() is not successful. I'm not really sure how packet reading fits into the big picture but it looks like the buffer is not read completely.

It is a similar case with "bad pack header" too. The function read_pack_header() fails because the pack header was not fully read.

Also, is the shallow object not sent when cloning due to the partial clone filter and hence a subsequent fetching is done to ask for this object? If so, then will such a fetch counted as an args->update_shallow?

Previous: Hariom vermaNext: Jonathan Tan
Message 9 of 19 in “[WIP] removed fetch_if_missing global”
  1. 0/2 [WIP] removed fetch_if_missing globalHariom Verma via GitGitGadget, Apr 20, 2020
  2. 1/2 fetch-pack: remove fetch_if_missing=0Hariom Verma via GitGitGadget, Apr 20, 2020
  3. Christian CouderMay 7, 2020
  4. Junio C HamanoMay 7, 2020
  5. Hariom vermaMay 9, 2020
  6. Hariom vermaMay 9, 2020
  7. Jonathan TanMay 7, 2020
  8. Hariom vermaMay 9, 2020
  9. Kousik SanagavarapuFeb 20, 2023
  10. Jonathan TanFeb 22, 2023
  11. Kousik SanagavarapuFeb 22, 2023
  12. 2/2 index-pack: remove fetch_if_missing=0Hariom Verma via GitGitGadget, Apr 20, 2020
  13. Christian CouderMay 7, 2020
  14. Hariom vermaMay 9, 2020
  15. Kousik SanagavarapuFeb 17, 2023
  16. Christian CouderFeb 18, 2023
  17. Kousik SanagavarapuFeb 19, 2023
  18. Christian CouderFeb 19, 2023
  19. Hariom vermaFeb 19, 2023

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.