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

Re: [PATCH v2] cache-tree: skip some blob checks in partial clone

From
Junio C Hamano <gitster@pobox.com>
Date
Oct 10, 2018, 01:19 UTC
Message-ID
<xmqqh8huoay1.fsf@gitster-ct.c.googlers.com>
In-Reply-To
<20181009184037.246871-1-jonathantanmy@google.com>
Jonathan Tan <jonathantanmy@google.com> writes:
> After feedback, I restricted this to partial clone. Once restricted, I
> agree with Ben that this can be done for all users of
> cache_tree_update(), not just unpack-trees, so I have removed the
> ability to control the behavior using a flag.
Makes sense.  Great.
Show 9 quoted lines
> I also took the opportunity to simplify the missing check by using a
> variable.
>  
> +		ce_missing_ok = mode == S_IFGITLINK || missing_ok ||
> +			(repository_format_partial_clone &&
> +			 ce_skip_worktree(ce));
>  		if (is_null_oid(oid) ||
> -		    (mode != S_IFGITLINK && !missing_ok && !has_object_file(oid))) {
> +		    (!ce_missing_ok && !has_object_file(oid))) {

OK. "An attempt to check out null object is bad, and otherwise, unless we determined that it is OK to lack the object recorded in ce, it is bad too. By the way, the way we determine if it is OK to be missing the object is given above". Easier to read than the original.

Previous: Jonathan Tan
Message 7 of 7 in “unpack-trees: allow missing CE_SKIP_WORKTREE objs”
  1. unpack-trees: allow missing CE_SKIP_WORKTREE objsJonathan Tan, Oct 8, 2018
  2. Junio C HamanoOct 9, 2018
  3. Junio C HamanoOct 9, 2018
  4. Ben PeartOct 9, 2018
  5. Ben PeartOct 9, 2018
  6. cache-tree: skip some blob checks in partial cloneJonathan Tan, Oct 9, 2018
  7. Junio C HamanoOct 10, 2018

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.