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

Re: [PATCH 02/10] unpack-trees: move all skip-worktree check back to unpack_trees()

From
Nguyen Thai Ngoc Duy <pclouds@gmail.com>
Date
Nov 16, 2010, 02:19 UTC
Message-ID
<AANLkTimO2fZ13BEL51GVTOChkzAD+jLm5HWAuc-+Rutc@mail.gmail.com>
In-Reply-To
<AANLkTi=cvt2W1Eqj7KmtM+ng-BS7wRTM=+49gq5n+ghs@mail.gmail.com>
2010/11/15 Thiago Farina <tfransosi@gmail.com>:
Show 16 quoted lines
> 2010/11/15 Nguyễn Thái Ngọc Duy <pclouds@gmail.com>:
>>  cache.h        |    1 +
>>  unpack-trees.c |   69 ++++++++++++++++++++++++++++++++++++++++++++++++++-----
>>  2 files changed, 63 insertions(+), 7 deletions(-)
>>
>> diff --git a/cache.h b/cache.h
>> index 33decd9..d87708a 100644
>> --- a/cache.h
>> +++ b/cache.h
>> @@ -182,6 +182,7 @@ struct cache_entry {
>>  #define CE_WT_REMOVE (0x400000) /* remove in work directory */
>>
>>  #define CE_UNPACKED  (0x1000000)
>> +#define CE_NEW_SKIP_WORKTREE (0x2000000)
>>
> Would be good to remove the () around the hex here and else in this file?

That was the tradition of CE_*. I don't know why () is there. Will do a preparation patch to remove all () first.

Show 28 quoted lines
>
>>  /*
>>  * Extended on-disk flags
>> diff --git a/unpack-trees.c b/unpack-trees.c
>> index 803445a..9acd9be 100644
>> --- a/unpack-trees.c
>> +++ b/unpack-trees.c
>> @@ -258,7 +258,7 @@ static int apply_sparse_checkout(struct cache_entry *ce, struct unpack_trees_opt
>>  {
>>        int was_skip_worktree = ce_skip_worktree(ce);
>>
>> -       if (!ce_stage(ce) && will_have_skip_worktree(ce, o))
>> +       if (ce->ce_flags & CE_NEW_SKIP_WORKTREE)
>>                ce->ce_flags |= CE_SKIP_WORKTREE;
>>        else
>>                ce->ce_flags &= ~CE_SKIP_WORKTREE;
>> @@ -834,6 +834,49 @@ static int unpack_callback(int n, unsigned long mask, unsigned long dirmask, str
>>        return mask;
>>  }
>>
>> +static void set_new_skip_worktree_1(struct unpack_trees_options *o)
>> +{
>> +       int i;
>> +
>> +       for (i = 0;i < o->src_index->cache_nr;i++) {
> Could you add spaces after ; for readability, please? There is another
> for below that needs this to.
>
Yes. I kept reminding myself of doing that, then forgot.
-- 
Duy
Previous: Thiago FarinaNext: Jonathan Nieder
Message 10 of 34 in “Sparse checkout fixes and improvements”
  1. 00/10 Sparse checkout fixes and improvementsNguyễn Thái Ngọc Duy, Nov 15, 2010
  2. 01/10 add: do not rely on dtype being NULL behaviorNguyễn Thái Ngọc Duy, Nov 15, 2010
  3. Jonathan NiederNov 15, 2010
  4. Nguyen Thai Ngoc DuyNov 16, 2010
  5. Jonathan NiederNov 16, 2010
  6. Junio C HamanoNov 16, 2010
  7. Nguyen Thai Ngoc DuyNov 17, 2010
  8. 02/10 unpack-trees: move all skip-worktree check back to unpack_trees()Nguyễn Thái Ngọc Duy, Nov 15, 2010
  9. Thiago FarinaNov 15, 2010
  10. Nguyen Thai Ngoc DuyNov 16, 2010
  11. Jonathan NiederNov 15, 2010
  12. Nguyen Thai Ngoc DuyNov 16, 2010
  13. 03/10 unpack-trees: add function to update ce_flags based on sparse patternsNguyễn Thái Ngọc Duy, Nov 15, 2010
  14. Jonathan NiederNov 15, 2010
  15. Jonathan NiederNov 15, 2010
  16. 04/10 unpack-trees: fix sparse checkout's "unable to match directories" faultNguyễn Thái Ngọc Duy, Nov 15, 2010
  17. Jonathan NiederNov 15, 2010
  18. Nguyen Thai Ngoc DuyNov 16, 2010
  19. 05/10 unpack-trees: optimize full checkout caseNguyễn Thái Ngọc Duy, Nov 15, 2010
  20. Jonathan NiederNov 15, 2010
  21. 06/10 templates: add info/sparse-checkoutNguyễn Thái Ngọc Duy, Nov 15, 2010
  22. 07/10 checkout: add -S to update sparse checkoutNguyễn Thái Ngọc Duy, Nov 15, 2010
  23. Jonathan NiederNov 15, 2010
  24. Miles BaderNov 15, 2010
  25. Nguyen Thai Ngoc DuyNov 17, 2010
  26. Nguyen Thai Ngoc DuyNov 16, 2010
  27. 08/10 checkout: add --full to fully populate working directoryNguyễn Thái Ngọc Duy, Nov 15, 2010
  28. Jonathan NiederNov 15, 2010
  29. Nguyen Thai Ngoc DuyNov 16, 2010
  30. 09/10 git-checkout.txt: mention of sparse checkoutNguyễn Thái Ngọc Duy, Nov 15, 2010
  31. 10/10 clean: support cleaning sparse checkout with -SNguyễn Thái Ngọc Duy, Nov 15, 2010
  32. Jonathan NiederNov 15, 2010
  33. Nguyen Thai Ngoc DuyNov 16, 2010
  34. Jonathan NiederNov 16, 2010

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.