git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: "Derrick Stolee via GitGitGadget" <gitgitgadget@gmail.com>
Cc: git@vger.kernel.org, pclouds@gmail.com,
	Derrick Stolee <derrickstolee@github.com>
Subject: Re: [PATCH v2] dir: force untracked cache with core.untrackedCache
Date: Thu, 17 Feb 2022 14:51:27 -0800	[thread overview]
Message-ID: <xmqq5ypd6r9s.fsf@gitster.g> (raw)
In-Reply-To: <pull.1058.v2.git.1645131630140.gitgitgadget@gmail.com> (Derrick Stolee via GitGitGadget's message of "Thu, 17 Feb 2022 21:00:29 +0000")

"Derrick Stolee via GitGitGadget" <gitgitgadget@gmail.com> writes:

> From: Derrick Stolee <derrickstolee@github.com>
>
> The GIT_FORCE_UNTRACKED_CACHE environment variable writes the untracked
> cache more frequently than the core.untrackedCache config variable. This
> is due to how read_directory() handles the creation of an untracked
> cache.
>
> Before this change, Git would not create the untracked cache extension
> for an index that did not already have one. Users would need to run a
> command such as 'git update-index --untracked-cache' before the index
> would actually contain an untracked cache.
>
> In particular, users noticed that the untracked cache would not appear
> even with core.untrackedCache=true. Some users reported setting
> GIT_FORCE_UNTRACKED_CACHE=1 in their engineering system environment to
> ensure the untracked cache would be created.
>
> The decision to not write the untracked cache without an environment
> variable tracks back to fc9ecbeb9 (dir.c: don't flag the index as dirty
> for changes to the untracked cache, 2018-02-05). The motivation of that
> change is that writing the index is expensive, and if the untracked
> cache is the only thing that needs to be written, then it is more
> expensive than the benefit of the cache. However, this also means that
> the untracked cache never gets populated, so the user who enabled it via
> config does not actually get the extension until running 'git
> update-index --untracked-cache' manually or using the environment
> variable.
>
> We have had a version of this change in the microsoft/git fork for a few
> major releases now. It has been working well to get users into a good
> state. Yes, that first index write is slow, but the remaining index
> writes are much faster than they would be without this change.
>
> Signed-off-by: Derrick Stolee <derrickstolee@github.com>
> ---

Will queue.

Thanks.

      reply	other threads:[~2022-02-17 22:51 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-14 17:37 [PATCH] dir: force untracked cache with core.untrackedCache Derrick Stolee via GitGitGadget
2022-02-14 20:16 ` Junio C Hamano
2022-02-14 20:40   ` Derrick Stolee
2022-02-17 21:00 ` [PATCH v2] " Derrick Stolee via GitGitGadget
2022-02-17 22:51   ` Junio C Hamano [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=xmqq5ypd6r9s.fsf@gitster.g \
    --to=gitster@pobox.com \
    --cc=derrickstolee@github.com \
    --cc=git@vger.kernel.org \
    --cc=gitgitgadget@gmail.com \
    --cc=pclouds@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).