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

Re: [RFC PATCH v3 8/8] --sparse for porcelains

From
Jakub Narebski <jnareb@gmail.com>
Date
Aug 14, 2009, 20:23 UTC
Message-ID
<200908142223.07994.jnareb@gmail.com>
In-Reply-To
<fcaeb9bf0908130538x396b1208s43d312107e3e198c@mail.gmail.com>
Dnia czwartek 13. sierpnia 2009 14:38, Nguyen Thai Ngoc Duy napisał:
Show 35 quoted lines
> On 8/13/09, Jakub Narebski <jnareb@gmail.com> wrote:
>> Nguyen Thai Ngoc Duy <pclouds@gmail.com> writes:
>>> 2009/8/12 Junio C Hamano <gitster@pobox.com>:
>>
>>>> It could also require core.sparseworktree configuration set to true if we
>>>> are really paranoid, but without the actual sparse specification file
>>>> flipping that configuration to true would not be useful anyway, so in
>>>> practice, giving --sparse-work-tree option to these Porcelain commands
>>>> would be no-op, but --no-sparse-work-tree option would be useful to
>>>> ignore $GIT_DIR/info/sparse and populate the work tree fully.
>>>
>>> Only part "ignore $GIT_DIR/info/sparse" is correct.
>>> "--no-sparse-work-tree" would not clear CE_VALID from all entries in
>>> index (which is good, if you are using CE_VALID for another purpose).
>>>
>>> To quit sparse checkout, you must create an empty
>>> $GIT_DIR/info/sparse, then do "git checkout" or "git read-tree -m -u
>>> HEAD" so that the tree is full populated, then you can remove
>>> $GIT_DIR/info/sparse. Quite unintuitive..
>>
>>
>> Hmmm... this looks like either argument for introducing --full option
>>  to git-checkout (ignore CE_VALID bit, checkout everything, and clean
>>  CE_VALID (?))...
>>
>>  ...or for going with _separate_ bit for partial checkout, like in the
>>  very first version of this series, which otherwise functions like
>>  CE_VALID, or is just used to mark that CE_VALID was set using sparse.
> 
> In my opinion, making an empty .git/info/sparse to fully populate
> worktree is not too bad. I wanted to have plumbing-level support in
> git so that you could try sparse checkout on your projects (possibly
> with a few additional scripts to make your life easier). Then good
> Porcelain UI may emerge later (or in worst case, people would roll
> their own sparse checkout).

Deciding whether sparse checkout should use CE_VALID only, or should it (as it was in the very first version of series) use additional flag, either CE_NO_CHECKOUT, or CE_VALID_IS_USED_HERE_FOR_SPARSE_CHECKOUT ;-) is a design decision about *plumbing-level* support.

Note that shallow clone, while using the same mechanism as grafts file, nevertheless use separate file; so perhaps sparse checkout while using the same mechanism as --assume-unchanged should use additional flag.

BTW. you might want to use GIT_SPARSE_FILE, similar to GIT_INDEX_FILE; see the fact that plumbing doesn't have .gitignore not .git/info/excludes hardcoded... well, except for --standard-excludes. This way full checkout would be as simple as using

  $ GIT_SPARSE_FILE= git checkout -- .
-- 
Jakub Narebski
Poland
Previous: Nguyen Thai Ngoc DuyNext: Junio C Hamano
Message 15 of 53 in “Sparse checkout”
  1. 0/8 Sparse checkoutNguyễn Thái Ngọc Duy, Aug 11, 2009
  2. 1/8 Prevent diff machinery from examining assume-unchanged entries on worktreeNguyễn Thái Ngọc Duy, Aug 11, 2009
  3. 2/8 Avoid writing to buffer in add_excludes_from_file_1()Nguyễn Thái Ngọc Duy, Aug 11, 2009
  4. 3/8 Read .gitignore from index if it is assume-unchangedNguyễn Thái Ngọc Duy, Aug 11, 2009
  5. 4/8 excluded_1(): support exclude "directories" in indexNguyễn Thái Ngọc Duy, Aug 11, 2009
  6. 5/8 dir.c: export excluded_1() and add_excludes_from_file_1()Nguyễn Thái Ngọc Duy, Aug 11, 2009
  7. 6/8 unpack-trees.c: generalize verify_* functionsNguyễn Thái Ngọc Duy, Aug 11, 2009
  8. 7/8 Support sparse checkout in unpack_trees() and read-treeNguyễn Thái Ngọc Duy, Aug 11, 2009
  9. 8/8 --sparse for porcelainsNguyễn Thái Ngọc Duy, Aug 11, 2009
  10. Junio C HamanoAug 12, 2009
  11. Nguyen Thai Ngoc DuyAug 12, 2009
  12. Nguyen Thai Ngoc DuyAug 13, 2009
  13. Jakub NarebskiAug 13, 2009
  14. Nguyen Thai Ngoc DuyAug 13, 2009
  15. Jakub NarebskiAug 14, 2009
  16. Junio C HamanoAug 15, 2009
  17. Jakub NarebskiAug 15, 2009
  18. Johannes SchindelinAug 16, 2009
  19. Johannes SchindelinAug 17, 2009
  20. Nguyen Thai Ngoc DuyAug 17, 2009
  21. Johannes SchindelinAug 17, 2009
  22. Nguyen Thai Ngoc DuyAug 17, 2009
  23. Johannes SchindelinAug 17, 2009
  24. Nguyen Thai Ngoc DuyAug 17, 2009
  25. Junio C HamanoAug 17, 2009
  26. Nguyen Thai Ngoc DuyAug 17, 2009
  27. Johannes SchindelinAug 17, 2009
  28. Junio C HamanoAug 17, 2009
  29. Johannes SchindelinAug 17, 2009
  30. skillzero@gmail.comAug 17, 2009
  31. Johannes SchindelinAug 17, 2009
  32. Jakub NarebskiAug 18, 2009
  33. skillzero@gmail.comAug 18, 2009
  34. Nguyen Thai Ngoc DuyAug 18, 2009
  35. git find (was: [RFC PATCH v3 8/8] --sparse for porcelains)Jakub Narebski, Aug 18, 2009
  36. Nguyen Thai Ngoc DuyAug 18, 2009
  37. Jakub NarebskiAug 18, 2009
  38. Jakub NarebskiAug 18, 2009
  39. skillzero@gmail.comAug 18, 2009
  40. Junio C HamanoAug 17, 2009
  41. Johannes SchindelinAug 17, 2009
  42. Jakub NarebskiAug 17, 2009
  43. Johannes SixtAug 12, 2009
  44. Nguyen Thai Ngoc DuyAug 12, 2009
  45. Raja R HarinathAug 12, 2009
  46. Johannes SixtAug 13, 2009
  47. skillzero@gmail.comAug 11, 2009
  48. Jakub NarebskiAug 11, 2009
  49. skillzero@gmail.comAug 11, 2009
  50. Nguyen Thai Ngoc DuyAug 12, 2009
  51. skillzero@gmail.comAug 12, 2009
  52. Junio C HamanoAug 12, 2009
  53. Nguyen Thai Ngoc DuyAug 13, 2009

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.