Re: [PATCH v3 6/8] attr: be careful about sparse directories

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 8/19/2021 4:53 PM, Elijah Newren wrote:
> On Tue, Aug 17, 2021 at 6:23 AM Derrick Stolee via GitGitGadget
> <gitgitgadget@xxxxxxxxx> wrote:
>> +       /*
>> +        * In the case of cone-mode sparse-checkout, getting the
>> +        * .gitattributes file from a directory is meaningless: all
>> +        * contained paths will be sparse if the .gitattributes is also
>> +        * sparse. In the case of a sparse index, it is critical that we
>> +        * don't go looking for one as it will expand the index.
>> +        */
> 
> "all contained paths will be sparse if the .gitattributes is also sparse"?
> 
> Do you mean something more like "the .gitattributes only applies for
> files under the given directory, and if the directory is sparse, then
> neither the .gitattributes file or any other file under that directory
> will be present" ?

Yes, you understand correctly and explain it better. Thanks.
 
> Also, out of curiosity, I was suggesting in the past we do something
> like this for .gitignore files, for the same reason.  Do we have such
> logic in place, or is that another area of the code that hasn't been
> handled yet?

I don't believe this has been handled. It definitely is less obvious
what to do there, because the point of .gitignore is to skip files that
exist in the working tree even if Git didn't put them there. Meanwhile,
.gitattributes is about how Git writes tracked files, but Git doesn't
write sparse tracked files.

> Though the code appears correct, I too am curious about the questions
> Dscho asked about the code in this patch.
 
Thanks,
-Stolee



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux