git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH v6 09/11] config: add core.untrackedCache

From
Duy Nguyen <pclouds@gmail.com>
Date
Jan 23, 2016, 00:50 UTC
Message-ID
<CACsJy8B+qC_hR1+5PqwAVfsmLtSowFvkQrvN16qO_LCHDxGb9g@mail.gmail.com>
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:

Show 22 quoted lines
> 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
Previous: Christian CouderNext: Stefan Beller
Message 13 of 18 in “Untracked cache improvements”
  1. 00/11 Untracked cache improvementsChristian Couder, Jan 20, 2016
  2. 01/11 dir: free untracked cache when removing itChristian Couder, Jan 20, 2016
  3. 02/11 update-index: use enum for untracked cache optionsChristian Couder, Jan 20, 2016
  4. Duy NguyenJan 23, 2016
  5. Christian CouderJan 23, 2016
  6. 03/11 update-index: add --test-untracked-cacheChristian Couder, Jan 20, 2016
  7. 04/11 update-index: add untracked cache notificationsChristian Couder, Jan 20, 2016
  8. 05/11 update-index: move 'uc' var declarationChristian Couder, Jan 20, 2016
  9. 06/11 dir: add {new,add}_untracked_cache()Christian Couder, Jan 20, 2016
  10. 07/11 dir: add remove_untracked_cache()Christian Couder, Jan 20, 2016
  11. 08/11 dir: simplify untracked cache "ident" fieldChristian Couder, Jan 20, 2016
  12. 09/11 config: add core.untrackedCacheChristian Couder, Jan 20, 2016
  13. Duy NguyenJan 23, 2016
  14. Stefan BellerJan 23, 2016
  15. Christian CouderJan 24, 2016
  16. 10/11 test-dump-untracked-cache: don't modify the untracked cacheChristian Couder, Jan 20, 2016
  17. 11/11 t7063: add tests for core.untrackedCacheChristian Couder, Jan 20, 2016
  18. Junio C HamanoJan 20, 2016

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.