All of lore.kernel.org
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: "Nguyễn Thái Ngọc Duy" <pclouds@gmail.com>
Cc: git@vger.kernel.org, t.gummerer@gmail.com
Subject: Re: [PATCH] read-cache: fix untracked cache invalidation when split-index is used
Date: Mon, 08 Jun 2015 09:49:02 -0700	[thread overview]
Message-ID: <xmqq7frecfi9.fsf@gitster.dls.corp.google.com> (raw)
In-Reply-To: <1433673652-27720-1-git-send-email-pclouds@gmail.com> ("Nguyễn	Thái Ngọc Duy"'s message of "Sun, 7 Jun 2015 17:40:52 +0700")

Nguyễn Thái Ngọc Duy  <pclouds@gmail.com> writes:

> Before this change, t7063.17 fails. The actual action though happens at
> t7063.16 where the entry "two" is added back to index after being
> removed in the .13. Here we expect a directory invalidate at .16 and
> none at .17 where untracked cache is refreshed. But things do not go as
> expected when GIT_TEST_SPLIT_INDEX is set.
>
> The different behavior that happens at .16 when split index is used: the
> entry "two", when deleted at .13, is simply marked "deleted". When .16
> executes, the entry resurfaces from the version in base index. This
> happens in merge_base_index() where add_index_entry() is called to add
> "two" back from the base index.
>
> This is where the bug comes from. The add_index_entry() is called with
> ADD_CACHE_KEEP_CACHE_TREE flag because this version of "two" is not new,
> it does not break either cache-tree or untracked cache. The code should
> check this flag and not invalidate untracked cache. This causes a second
> invalidation violates test expectation. The fix is obvious.
>
> Noticed-by: Thomas Gummerer <t.gummerer@gmail.com>
> Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
> ---
>  PS. perhaps I should rename ADD_CACHE_KEEP_CACHE_TREE to
>  ADD_CACHE_KEEP_CACHE, or add a new flag .._KEEP_UNTRACKED_CACHE to
>  avoid confusion.

That may not be a bad idea, indeed.

>  Untracked cache, split index and the last part (*) all aim at a
>  smaller user audience with large work trees. They are not really what
>  a common user needs, but I hope they do have users.

I do hope that this can be made for everybody, though.  Any project
will get larger, not smaller, over time and these two (I am not sure
what you refer to as 'last part', though) are meant to support
projects with larger working trees better.  After all, that is why I
merged the untracked-cache series reasonably early to 'master' in
this cycle to give us time to shake out little issues like this one.
I think we killed two so far since it has been merged to 'master',
so the plan is working rather nicely ;-).

Thanks.

      reply	other threads:[~2015-06-08 16:49 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-05 23:31 [PATCH] t7063: fix breakage with split index Thomas Gummerer
2015-06-07  6:20 ` Junio C Hamano
2015-06-07 10:40   ` [PATCH] read-cache: fix untracked cache invalidation when split-index is used Nguyễn Thái Ngọc Duy
2015-06-08 16:49     ` 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

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

  git send-email \
    --in-reply-to=xmqq7frecfi9.fsf@gitster.dls.corp.google.com \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=pclouds@gmail.com \
    --cc=t.gummerer@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.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.