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

Re: sparse support in pu

From
Sskillzero@gmail.com <skillzero@gmail.com>
Date
Aug 17, 2009, 08:49 UTC
Message-ID
<2729632a0908170149o425544dcw52aeb6ac6ee1437d@mail.gmail.com>
In-Reply-To
<fcaeb9bf0908170117v67e9f8b1ga56edcda14821e91@mail.gmail.com>
On Mon, Aug 17, 2009 at 1:17 AM, Nguyen Thai Ngoc Duy<pclouds@gmail.com> wrote:
Show 12 quoted lines
> On Mon, Aug 17, 2009 at 1:09 PM, <skillzero@gmail.com> wrote:
>> 1. Have people decided whether it should be on by default if you have
>> a .git/info/sparse file? I'd definitely like it to be on by default.
>> When I first tried it, I didn't realize I had to use --sparse to git
>> checkout to get it to use the sparse rules. The same goes for a merge
>> I did that happened to have a file in the excluded area (it included
>> it because I didn't use --sparse to git merge).
>
> I tend to make it enabled by default too. I have made it stricter to
> trigger reading sparse in unpack_trees() -- only do it when
> unpack_opts.update is TRUE. This should make it safer to be enabled by
> default.

Other than it being new and not-widely-tested code, is there any additional risk to having it enabled by default if there are no sparse patterns defined?

It would be nice if .git/info/sparse is there by default (like .git/info/exclude) with some commented out instructions (also like .git/info/exclude).

Show 10 quoted lines
>> 2. Is it not hooked up to git reset yet? I did a git checkout --sparse
>> and things look liked I expected then I did a git reset --hard
>> origin/master and it started checking out all the stuff previously
>> excluded via .git/info/sparse. I tried --sparse, but it didn't know
>> about that option.
>
> Because sparse was disabled by default, and "git reset" did not enable
> it. It'd be interesting to see what "git reset --hard" should do in
> this case: will it apply .git/info/sparse or not, which brings us back
> to the "default or not" question, hmm..

It seems like if it's going to be off by default (which it hopefully won't be) then git reset would need to support --sparse since otherwise, you'd never be able to git reset without undoing your sparse options (unless you did a subsequent git checkout --sparse).

I also noticed that after I did the git reset, the sparse stuff seemed to get into a weird state such that sparse patterns weren't working reliably. For example, I couldn't get it to exclude a directory.

Show 9 quoted lines
>> 3. One thing that was confusing is that I needed a trailing slash on
>> directories in .git/info/sparse to get them excluded. This seems
>> different than .gitignore, which works for me without the trailing
>> slash.
>
> Hmm.. probably because Git feeds directories to .gitignore handling
> functions. There is not much I can do, index does not have
> directories. I don't know if it's worth generating "directories" from
> index.

Maybe just add a note in the documentation? If there's a default .git/info/sparse file then it might be good place to put a note as well.

Previous: Nguyen Thai Ngoc DuyNext: Johannes Schindelin
Message 3 of 21 in “sparse support in pu”
  1. skillzero@gmail.comAug 17, 2009
  2. Nguyen Thai Ngoc DuyAug 17, 2009
  3. skillzero@gmail.comAug 17, 2009
  4. Johannes SchindelinAug 17, 2009
  5. skillzero@gmail.comAug 17, 2009
  6. Johannes SixtAug 17, 2009
  7. Johannes SchindelinAug 17, 2009
  8. Nguyen Thai Ngoc DuyAug 17, 2009
  9. Nguyen Thai Ngoc DuyAug 17, 2009
  10. Johannes SixtAug 17, 2009
  11. Nguyen Thai Ngoc DuyAug 17, 2009
  12. Johannes SixtAug 17, 2009
  13. Nguyen Thai Ngoc DuyAug 17, 2009
  14. Johannes SchindelinAug 17, 2009
  15. Peter HarrisAug 17, 2009
  16. Johannes SchindelinAug 17, 2009
  17. Peter HarrisAug 17, 2009
  18. Junio C HamanoAug 17, 2009
  19. Johannes SchindelinAug 17, 2009
  20. Nguyen Thai Ngoc DuyAug 17, 2009
  21. James PickensAug 17, 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.