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

Re: [PATCH 3/3] Mark new entries skip-worktree appropriately

From
Nguyen Thai Ngoc Duy <pclouds@gmail.com>
Date
Jul 31, 2010, 03:13 UTC
Message-ID
<AANLkTikhXy1KjA5=SJ9ZwS_XtV99aHPkeo3XoPXqxeKh@mail.gmail.com>
In-Reply-To
<20100731023219.GB906@burratino>
2010/7/31 Jonathan Nieder <jrnieder@gmail.com>:
Show 22 quoted lines
> Nguyễn Thái Ngọc Duy wrote:
>
>> Sparse checkout updates worktree based on the old and new
>> skip-worktree status when $GIT_DIR/info/sparse-checkout changes:
>>
>> old = ce_skip_worktree(ce);           // current skip-worktree
>> new = will_have_skip_work_tree(ce);   // from $GIT..sparse-checkout
>> if (old && !new) add_file_back(ce);   // shrink checkout area
>> if (!old && new) remove_file_out(ce); [1] // enlarge checkout area
>>
>> New entries after merging will always have skip-worktree unset
>> (i.e. old = 0). If those files are filtered out by
>> $GIT_DIR/info/sparse-checkout (i.e. new != 0), then case [1] will
>> happen. But there is nothing to remove because they're new.
>
> When using unpack_trees to add a new file, there is no in-file
> index entry to grab the previous skip worktree bit from.  If it
> is outside the checkout area, we should pretend it was skipped before,
> too; otherwise a checkout can cause a file on disk whose name
> coincides with a newly added outside-worktree file to be deleted.
>
> Do I understand correctly?
Yes.
-- 
Duy
Previous: Jonathan NiederNext: Jonathan Nieder
Message 7 of 17 in “Fix sparse checkout not removing files from index”
  1. 1/3 Fix sparse checkout not removing files from indexNguyễn Thái Ngọc Duy, Jul 26, 2010
  2. 2/3 unpack-trees.c: Do not check ce_stage in will_have_skip_worktree()Nguyễn Thái Ngọc Duy, Jul 26, 2010
  3. Jonathan NiederJul 31, 2010
  4. Nguyen Thai Ngoc DuyJul 31, 2010
  5. 3/3 Mark new entries skip-worktree appropriatelyNguyễn Thái Ngọc Duy, Jul 26, 2010
  6. Jonathan NiederJul 31, 2010
  7. Nguyen Thai Ngoc DuyJul 31, 2010
  8. Jonathan NiederJul 31, 2010
  9. Jonathan NiederJul 30, 2010
  10. Nguyen Thai Ngoc DuyJul 30, 2010
  11. Jonathan NiederJul 30, 2010
  12. Jonathan NiederJul 31, 2010
  13. 1/2 t1011 (sparse checkout): style nitpicksJonathan Nieder, Jul 31, 2010
  14. 2/2 read-tree -m -u: always remove relevant files when narrowing checkoutJonathan Nieder, Jul 31, 2010
  15. Nguyen Thai Ngoc DuyJul 31, 2010
  16. Jonathan NiederJul 31, 2010
  17. Nguyen Thai Ngoc DuyJul 31, 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.