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

Re: [PATCH 2/2] fetch-pack: respect --no-update-shallow in v2

From
Jeff King <peff@peff.net>
Date
Mar 26, 2019, 18:18 UTC
Message-ID
<20190326181806.GA24105@sigill.intra.peff.net>
In-Reply-To
<20190326173706.175638-1-jonathantanmy@google.com>
On Tue, Mar 26, 2019 at 10:37:06AM -0700, Jonathan Tan wrote:
Show 14 quoted lines
> > Perhaps it's worth passing down the shallows array we get from the
> > caller of fetch_pack(). Something like the patch below (I think it is
> > never NULL, which means in your patch 1 you can simplify the conditional
> > for the BUG).
> 
> [snip patch]
> 
> You're right that it is never NULL - I have removed that check. As for
> passing down the shallows array that we get from the caller of
> fetch_pack(), that would get confusing because we end up modifying the
> shallows array in some code paths, and the transport is sometimes reused
> (for example, when backfilling tags). I have instead made a
> shallows_scratch variable in fetch_pack(), and made it pass it down
> (like in the diff you provided).

Yeah, I confess to having spent quite a few minutes trying to figure out the difference between "shallows" and "shallow_info", whether one wrote into the other, and who was responsible for filling each in. So I will not complain if you have a way of writing it that is less confusing. :)

-Peff
Previous: Jonathan TanNext: Jonathan Tan
Message 10 of 18 in “Last big GIT_TEST_PROTOCOL_VERSION=2 fix, hopefully”
  1. 0/2 Last big GIT_TEST_PROTOCOL_VERSION=2 fix, hopefullyJonathan Tan, Mar 25, 2019
  2. 1/2 fetch-pack: call prepare_shallow_info only if v0Jonathan Tan, Mar 25, 2019
  3. Jeff KingMar 26, 2019
  4. 2/2 fetch-pack: respect --no-update-shallow in v2Jonathan Tan, Mar 25, 2019
  5. Jeff KingMar 26, 2019
  6. Duy NguyenMar 26, 2019
  7. Jeff KingMar 26, 2019
  8. Duy NguyenMar 26, 2019
  9. Jonathan TanMar 26, 2019
  10. Jeff KingMar 26, 2019
  11. 0/2 Last big GIT_TEST_PROTOCOL_VERSION=2 fix, hopefullyJonathan Tan, Mar 26, 2019
  12. 1/2 fetch-pack: call prepare_shallow_info only if v0Jonathan Tan, Mar 26, 2019
  13. 2/2 fetch-pack: respect --no-update-shallow in v2Jonathan Tan, Mar 26, 2019
  14. Jeff KingMar 26, 2019
  15. Jeff KingMar 26, 2019
  16. 0/2 Last big GIT_TEST_PROTOCOL_VERSION=2 fix, hopefullyJonathan Tan, Mar 26, 2019
  17. 1/2 fetch-pack: call prepare_shallow_info only if v0Jonathan Tan, Mar 26, 2019
  18. 2/2 fetch-pack: respect --no-update-shallow in v2Jonathan Tan, Mar 26, 2019

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.