Thread (14 messages) flat view 14 messages, 4 authors, 2016-06-15

Re: .gittattributes handling has deficiencies

From: Johannes Schindelin <hidden>
Date: 2016-06-15 22:43:43

Hi,

On Mon, 22 Oct 2007, Steffen Prohaska wrote:
.gitattributes is first looked for in the working directory, and if not 
there, .gitattributes is read from the index.
Of course we could change that to do it the other way round.  But this 
would contradict expectations when you edit .gitattributes and then 
checkout single files without having git-add'ed .gitattributes first.

The biggest problem in your setup, however, is not if .gitattributes is 
read from the index or the working directory.  The biggest problem is that 
files are not touched when their contents have not changed.

IOW if you have .gitattributes in the to-be-checked-out branch which say 
that README is crlf, and in the current branch it is not, and README's 
_contents_ are identical in both branches, a "git checkout 
<that-other-branch>" will not rewrite README, and consequently not change 
the working copy to crlf.

Ciao,
Dscho
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help