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

Re: [PATCH v2] fetch: remove fetch_if_missing=0

From
Junio C Hamano <gitster@pobox.com>
Date
Nov 6, 2019, 01:45 UTC
Message-ID
<xmqq7e4dydzv.fsf@gitster-ct.c.googlers.com>
In-Reply-To
<20191105185619.207173-1-jonathantanmy@google.com>
Jonathan Tan <jonathantanmy@google.com> writes:
Show 24 quoted lines
> In fetch_pack() (and all functions it calls), pass
> OBJECT_INFO_SKIP_FETCH_OBJECT whenever we query an object that could be
> a tree or blob that we do not want to be lazy-fetched even if it is
> absent. Thus, the only lazy-fetches occurring for trees and blobs are
> when resolving deltas.
>
> Thus, we can remove fetch_if_missing=0 from builtin/fetch.c. Remove
> this, and also add a test ensuring that such objects are not
> lazy-fetched. (We might be able to remove fetch_if_missing=0 from other
> places too, but I have limited myself to builtin/fetch.c in this commit
> because I have not written tests for the other commands yet.)
>
> Note that commits and tags may still be lazy-fetched. I limited myself
> to objects that could be trees or blobs here because Git does not
> support creating such commit- and tag-excluding clones yet, and even if
> such a clone were manually created, Git does not have good support for
> fetching a single commit (when fetching a commit, it and all its
> ancestors would be sent).
>
> Signed-off-by: Jonathan Tan <jonathantanmy@google.com>
> ---
> Changes from v1:
> - Added NEEDSWORK in test, suggested by Jonathan Nieder
> - Used printf in test, suggested by Eric Sunshine

Nice. The less we use big "plug the machinery to lazily fetch for now" switch, the better, I think.

> +setup_triangle () {
> +	rm -rf big-blob.txt server client promisor-remote &&
> +
> +	printf "line %d\n" $(test_seq 1 100) >big-blob.txt

I'll tweak this line while queueing with a trailing " &&" (no need to resend only for this).

Previous: Eric SunshineNext: Junio C Hamano
Message 10 of 12 in “fetch: remove fetch_if_missing=0”
  1. fetch: remove fetch_if_missing=0Jonathan Tan, Nov 1, 2019
  2. Jonathan NiederNov 1, 2019
  3. Junio C HamanoNov 2, 2019
  4. Eric SunshineNov 2, 2019
  5. Junio C HamanoNov 2, 2019
  6. Jonathan TanNov 5, 2019
  7. Jonathan NiederNov 5, 2019
  8. fetch: remove fetch_if_missing=0Jonathan Tan, Nov 5, 2019
  9. Eric SunshineNov 5, 2019
  10. Junio C HamanoNov 6, 2019
  11. Junio C HamanoNov 8, 2019
  12. Junio C HamanoNov 8, 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.