Web lists-archives.com

Re: [PATCH] Introduce "precious" file concept




Duy Nguyen <pclouds@xxxxxxxxx> writes:

> But gitattributes.txt explicitly says that it's wrong. One would need
> to do "path/** precious" to achieve the same thing.
>
> So yeah maybe doing this before S_ISDIR() is wrong. The definition of
> `precious` also only says "... is set on _files_". Maybe best to
> ignore attributes on directories? At least it looks like that's how
> all other attributes do.

I could be persuaded in the other direction if there are widespread
uses (or misuses---but once it gets widespread in the wild and turns
out to be useful, it ceases to be misuses and becomes a feature) of
giving an attribute to a directory that affects the treatment of
that directory *itself*, but if there is none, I'd prefer to keep
the attribute "what's tracked only".

Whether it is a good idea to give an attribute to a directory to
affect the treatement of the directory *itself* (eh, rather,
especially if it were a good idea), I'd consider it a misuse as a
short-hand for giving all paths within it the same attribute, given
"path/**" is available, as that would make it impossible to say "I'd
want to affect this directory, but not any of the directories or
files in it".

And if that is not clear in the current documentation set that faces
our developers, perhaps we should make it so.

Thanks.