Thread (88 messages) flat view 88 messages, 6 authors, 2021-09-08

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

From: Derrick Stolee <hidden>
Date: 2021-08-20 15:39:16

On 8/19/2021 4:53 PM, Elijah Newren wrote:
On Tue, Aug 17, 2021 at 6:23 AM Derrick Stolee via GitGitGadget
[off-list ref] wrote:
quoted
+       /*
+        * 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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help