From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS53758 23.128.96.0/24 X-Spam-Status: No, score=-4.4 required=3.0 tests=AWL,BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A, RCVD_IN_DNSWL_MED,SPF_HELO_PASS,SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by dcvr.yhbt.net (Postfix) with ESMTP id ABBDA1F8C6 for ; Mon, 30 Aug 2021 13:19:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236622AbhH3NUL (ORCPT ); Mon, 30 Aug 2021 09:20:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60540 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229446AbhH3NUK (ORCPT ); Mon, 30 Aug 2021 09:20:10 -0400 Received: from mail-qk1-x72c.google.com (mail-qk1-x72c.google.com [IPv6:2607:f8b0:4864:20::72c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F0B6BC061575 for ; Mon, 30 Aug 2021 06:19:16 -0700 (PDT) Received: by mail-qk1-x72c.google.com with SMTP id bk29so15506450qkb.8 for ; Mon, 30 Aug 2021 06:19:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=91YSpiKeABasp2Rvx3H4Wmb5VOcSNV2TA3A1FNLh1So=; b=GML2KMij9cv7ej6hXAVknPndXRn2ubuRMcluWXYxdW4Q19u58ad9g9waLwaokUtdVV PJYG6yn0WcxmE1bptto1aCICSynrVVYkgYmt5UwK7n9hN6EI4VaUjHPCEuukDnZAuJ4p EkUeIhAHlGaX0K851VFwc3lqhIwdgkfkl7qquORNQAy/Wwwun/w939o8a2aae9/pmpax V87DT+WgtHg/bNBhRsLuu9aIWfu5fGzO9nCK50cHpNQMNFa2WqB8kU10EXj6H4Fy5Zx0 mnugcybiqTEsVJiInEjR9mJZ0marw9XyVFANqEEj/6H4wkG8NuR7mhRGSdXlGvVrvuH4 ZXRA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=91YSpiKeABasp2Rvx3H4Wmb5VOcSNV2TA3A1FNLh1So=; b=lZIQ6rZFFZLHnXmmzU9Sss/H1YcK717HhWBrwjMBhlpRsSJ71MHe5x4aF1GfqHwjlD JqR1LSNuzJ9LJsopXdV4lLpWEWiwLrrWxMkr0VLSDrXlqVmkZhL9OKq7JJvB05/NHoEr fvtRpeqV6fURgo/hBtBCHYQK6vOH7kbSQqTr6cXVYUeoiU9bZBcLlIKEh/npc/Gpk0tE 8io+B+UQhRI5OF4SS9CJPdBL5KshswFhSKOhtNxBXT61pBEOi+kgCQIraNHTLilwqt9m 0HryIgjXum5c/QsoQNPRegzACBtz//JB3GSO0isEkPkQ7+4lPm8OrE777PfdGKepQ/hf k10g== X-Gm-Message-State: AOAM533xpVwmvX9q8AtaE+nlHtJZ2YwbobRzmZZZlsBEDCRXUCpt8uVR e2eic5wZHLvK+9fCgd6b14Y= X-Google-Smtp-Source: ABdhPJyXV/7FVJ8r+9VBO/eK/l6Mw9+vNxsq+2nRWli3oX1lseDiwiS0OLFyNkEOqzFeWmhfK7iKPA== X-Received: by 2002:a05:620a:79b:: with SMTP id 27mr22168641qka.248.1630329556003; Mon, 30 Aug 2021 06:19:16 -0700 (PDT) Received: from ?IPv6:2600:1700:e72:80a0:f479:1655:2af5:7e8e? ([2600:1700:e72:80a0:f479:1655:2af5:7e8e]) by smtp.gmail.com with ESMTPSA id x83sm11273325qkb.118.2021.08.30.06.19.14 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 30 Aug 2021 06:19:15 -0700 (PDT) Subject: Re: [PATCH v4 04/10] sparse-index: use WRITE_TREE_MISSING_OK To: Elijah Newren , Derrick Stolee via GitGitGadget Cc: Git Mailing List , Junio C Hamano , Matheus Tavares Bernardino , Johannes Schindelin , Eric Sunshine , =?UTF-8?Q?Ren=c3=a9_Scharfe?= , Derrick Stolee , Derrick Stolee References: From: Derrick Stolee Message-ID: <2870fcb8-a356-c2c2-d084-b560326e1ad4@gmail.com> Date: Mon, 30 Aug 2021 09:19:15 -0400 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.13.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org On 8/27/2021 5:33 PM, Elijah Newren wrote: > On Tue, Aug 24, 2021 at 2:51 PM Derrick Stolee via GitGitGadget > wrote: >> >> From: Derrick Stolee >> >> When updating the cache tree in convert_to_sparse(), the >> WRITE_TREE_MISSING_OK flag indicates that trees might be computed that >> do not already exist within the object database. > > Okay. > >> This happens in cases >> such as 'git add' creating new trees that it wants to store in >> anticipation of a following 'git commit'. > > This doesn't make any sense to me. Does 'git add' call > convert_to_sparse()? I don't see why it would; wouldn't the calls to > convert_to_sparse() come via sparse-checkout init/set commands? If > I'm correct on that, and 'git add' wants to create new trees, then by > the time convert_to_sparse() is called in some subsequent git > operation, then convert_to_sparse would already have the trees it > needs. If someone adds a change outside the sparse-checkout cone, then the index is expanded in-memory, then is converted to sparse when the index is written again. > I thought the reason you would need this is someone modified and > staged a change to a file underneath a directory that will be > sparsified away; at the time of convert_to_sparse(), a tree object may > not have yet been written for the new tree with the newly modified > file (because those tend to be written at commit time), but you'd need > it at the time you sparsified. Yes. I think we are trying to say the same thing. Thanks, -Stolee