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

Re: .gittattributes handling has deficiencies

From: Steffen Prohaska <hidden>
Date: 2016-06-15 22:43:43

On Oct 22, 2007, at 12:29 PM, Johannes Schindelin wrote:
On Mon, 22 Oct 2007, Steffen Prohaska wrote:
quoted
.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.
Exactly. The order of reading .gitattributes from the working
directory or the index doesn't matter. The current mechanism
has a more fundamental deficiency.

Changes of.gitattributes can influence how the same content
is checked out to the work tree. If .gitattributes change the
checkout may need to be updated, even if the real content did
not change.

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