Re: Git attributes ignored for root directory

2 messages, 2 authors, 2016-06-15 · open the first message on its own page

Re: Git attributes ignored for root directory

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:52:11

Gioele Barabucci [off-list ref] writes:
On 05/10/2011 19:38, Junio C Hamano wrote:
quoted
quoted
In fact the support for gitattributes using patterns involving "." was
pretty spotty in v1.7.6 too.  For example,
The attribute patterns (or exclude patterns for that matter) were never
designed to name "the current directory". The way to name "everything *in*
this directory" has always been to say "*" (the "* text=auto" example in
the documentation says it shows how to set the attribute "for all
files"). Admittedly the pattern may miss ".*" files.
What if I do not want to say things about the "content" of the
directory but about the directory itself? This is exactly my case.
Oh, that is totally different. We do not store directories, and they do
not have attributes, period.

Re: Git attributes ignored for root directory

From: Gioele Barabucci <hidden>
Date: 2016-06-15 22:52:11

On 05/10/2011 20:35, Junio C Hamano wrote:
quoted
What if I do not want to say things about the "content" of the
directory but about the directory itself? This is exactly my case.
Oh, that is totally different. We do not store directories, and they do
not have attributes, period.
While that is true (yet many beg git to natively support empty dirs…), 
`.gitignore` does deal with directories. As you quoted,

 > If the pattern ends with a slash, it is removed for the purpose
 > of the following description, but it would only find a match with
 > a directory. In other words, foo/ will match a directory foo and
 > paths underneath it

Isn't applying the same logic to `.gitattributes` be the most 
straightforward solution? Also code-wise, I suppose.

Bye,

-- 
Gioele Barabucci [off-list ref]
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help