From: Duy Nguyen <pclouds@gmail.com>
To: Christian Couder <christian.couder@gmail.com>
Cc: "Git Mailing List" <git@vger.kernel.org>,
"Junio C Hamano" <gitster@pobox.com>, "Jeff King" <peff@peff.net>,
"Ævar Arnfjörð Bjarmason" <avarab@gmail.com>,
"David Turner" <dturner@twopensource.com>,
"Eric Sunshine" <sunshine@sunshineco.com>,
"Torsten Bögershausen" <tboegi@web.de>,
"Christian Couder" <chriscool@tuxfamily.org>
Subject: Re: [PATCH v6 09/11] config: add core.untrackedCache
Date: Sat, 23 Jan 2016 07:50:37 +0700 [thread overview]
Message-ID: <CACsJy8B+qC_hR1+5PqwAVfsmLtSowFvkQrvN16qO_LCHDxGb9g@mail.gmail.com> (raw)
In-Reply-To: <1453283984-8979-10-git-send-email-chriscool@tuxfamily.org>
On Wed, Jan 20, 2016 at 4:59 PM, Christian Couder
<christian.couder@gmail.com> wrote:
> diff --git a/read-cache.c b/read-cache.c
> index 84616c8..1d5696c 100644
> --- a/read-cache.c
> +++ b/read-cache.c
> @@ -1622,6 +1622,20 @@ int read_index_from(struct index_state *istate, const char *path)
> return istate->cache_nr;
>
> ret = do_read_index(istate, path, 0);
> +
> + switch (git_config_get_untracked_cache()) {
> + case -1: /* keep: do nothing */
> + break;
> + case 0: /* false */
> + remove_untracked_cache(istate);
> + break;
> + case 1: /* true */
> + add_untracked_cache(istate);
> + break;
> + default: /* unknown value: do nothing */
> + break;
> + }
> +
It would be safer to do this after a split index is merged. That is,
after merge_base_index() in this function. It's not wrong, because uc
can't be in the base index. But who knows what people will do in the
future. Because there are two exits in this function, maybe you can
rename check_ce_order() to post_read_index_from() and do this check
there too.
> split_index = istate->split_index;
> if (!split_index || is_null_sha1(split_index->base_sha1)) {
> check_ce_order(istate);
--
Duy
next prev parent reply other threads:[~2016-01-23 0:51 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-01-20 9:59 [PATCH v6 00/11] Untracked cache improvements Christian Couder
2016-01-20 9:59 ` [PATCH v6 01/11] dir: free untracked cache when removing it Christian Couder
2016-01-20 9:59 ` [PATCH v6 02/11] update-index: use enum for untracked cache options Christian Couder
2016-01-23 0:44 ` Duy Nguyen
2016-01-23 11:02 ` Christian Couder
2016-01-20 9:59 ` [PATCH v6 03/11] update-index: add --test-untracked-cache Christian Couder
2016-01-20 9:59 ` [PATCH v6 04/11] update-index: add untracked cache notifications Christian Couder
2016-01-20 9:59 ` [PATCH v6 05/11] update-index: move 'uc' var declaration Christian Couder
2016-01-20 9:59 ` [PATCH v6 06/11] dir: add {new,add}_untracked_cache() Christian Couder
2016-01-20 9:59 ` [PATCH v6 07/11] dir: add remove_untracked_cache() Christian Couder
2016-01-20 9:59 ` [PATCH v6 08/11] dir: simplify untracked cache "ident" field Christian Couder
2016-01-20 9:59 ` [PATCH v6 09/11] config: add core.untrackedCache Christian Couder
2016-01-23 0:50 ` Duy Nguyen [this message]
2016-01-23 0:56 ` Stefan Beller
2016-01-24 15:31 ` Christian Couder
2016-01-20 9:59 ` [PATCH v6 10/11] test-dump-untracked-cache: don't modify the untracked cache Christian Couder
2016-01-20 9:59 ` [PATCH v6 11/11] t7063: add tests for core.untrackedCache Christian Couder
2016-01-20 22:33 ` [PATCH v6 00/11] Untracked cache improvements Junio C Hamano
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=CACsJy8B+qC_hR1+5PqwAVfsmLtSowFvkQrvN16qO_LCHDxGb9g@mail.gmail.com \
--to=pclouds@gmail.com \
--cc=avarab@gmail.com \
--cc=chriscool@tuxfamily.org \
--cc=christian.couder@gmail.com \
--cc=dturner@twopensource.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=peff@peff.net \
--cc=sunshine@sunshineco.com \
--cc=tboegi@web.de \
/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 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 NNTP newsgroup(s).