From: Derrick Stolee <derrickstolee@github.com>
To: Victoria Dye via GitGitGadget <gitgitgadget@gmail.com>,
git@vger.kernel.org
Cc: gitster@pobox.com, newren@gmail.com, Victoria Dye <vdye@github.com>
Subject: Re: [PATCH v2 2/3] unpack-trees: increment cache_bottom for sparse directories
Date: Mon, 21 Mar 2022 15:03:01 -0400 [thread overview]
Message-ID: <df403c7b-5152-492a-96b5-575ccc1520de@github.com> (raw)
In-Reply-To: <cf8dc50c300a08f54d0cf69c82d4d979922a8143.1647532536.git.gitgitgadget@gmail.com>
On 3/17/2022 11:55 AM, Victoria Dye via GitGitGadget wrote:
> From: Victoria Dye <vdye@github.com>
>
> Correct tracking of the 'cache_bottom' for cases where sparse directories
> are present in the index.
Thank you for the detailed background (that I cut from my reply).
> CORRECTING CACHE_BOTTOM
> -----------------------
> The problems observed in 't1092' come from 'cache_bottom' lagging behind in
> cases where the cache tree-based advancement doesn't occur. To solve this,
> then, the fix in 17a1bb570b is "reversed"; rather than skipping
> 'cache_bottom' advancement in 'mark_ce_used()', we skip the directory
> contents-based advancement for sparse directories. Now, every index entry
> can be accounted for in 'cache_bottom':
I have sufficient background to be confident that you are doing the
right thing here!
> -test_expect_failure 'add outside sparse cone' '
> +test_expect_success 'add outside sparse cone' '
> -test_expect_failure 'status/add: outside sparse cone' '
> +test_expect_success 'status/add: outside sparse cone' '
> -test_expect_failure 'reset with pathspecs inside sparse definition' '
> +test_expect_success 'reset with pathspecs inside sparse definition' '
Love to see it.
> if (matches) {
> - o->cache_bottom += matches;
> + /*
> + * Only increment the cache_bottom if the
> + * directory isn't a sparse directory index
> + * entry (if it is, it was already incremented)
> + * in 'mark_ce_used()'
> + */
> + if (!src[0] || !S_ISSPARSEDIR(src[0]->ce_mode))
> + o->cache_bottom += matches;
> return mask;
Looks great.
Thanks,
-Stolee
next prev parent reply other threads:[~2022-03-21 19:03 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-03-16 20:11 [PATCH 0/3] Fix use of 'cache_bottom' in sparse index Victoria Dye via GitGitGadget
2022-03-16 20:12 ` [PATCH 1/3] t1092: add sparse directory before cone in test repo Victoria Dye via GitGitGadget
2022-03-16 20:12 ` [PATCH 2/3] unpack-trees: increment cache_bottom for sparse directories Victoria Dye via GitGitGadget
2022-03-16 20:12 ` [PATCH 3/3] Revert "unpack-trees: improve performance of next_cache_entry" Victoria Dye via GitGitGadget
2022-03-16 20:21 ` [PATCH 0/3] Fix use of 'cache_bottom' in sparse index Junio C Hamano
2022-03-17 15:55 ` [PATCH v2 " Victoria Dye via GitGitGadget
2022-03-17 15:55 ` [PATCH v2 1/3] t1092: add sparse directory before cone in test repo Victoria Dye via GitGitGadget
2022-03-17 15:55 ` [PATCH v2 2/3] unpack-trees: increment cache_bottom for sparse directories Victoria Dye via GitGitGadget
2022-03-21 19:03 ` Derrick Stolee [this message]
2022-03-21 20:52 ` Junio C Hamano
2022-03-17 15:55 ` [PATCH v2 3/3] Revert "unpack-trees: improve performance of next_cache_entry" Victoria Dye via GitGitGadget
2022-03-21 19:12 ` [PATCH v2 0/3] Fix use of 'cache_bottom' in sparse index Derrick Stolee
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=df403c7b-5152-492a-96b5-575ccc1520de@github.com \
--to=derrickstolee@github.com \
--cc=git@vger.kernel.org \
--cc=gitgitgadget@gmail.com \
--cc=gitster@pobox.com \
--cc=newren@gmail.com \
--cc=vdye@github.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).