From: Matthieu Moy Date: Fri, 16 Dec 2011 18:21:07 GMT Subject: Re: [BUG] attribute "eol" with "crlf" Message-ID: In-Reply-To: Ralf Thielow writes: > There's a bug in git-1.7.8 if you use the attribute "eol" with "crlf". > > Steps to reproduce: > - add and commit a text file which uses 0d0a for line breaks > 7465 7374 0d0a 0d0a 7465 7374 0d0a test....test.. > - add ".gitattributes" with "*.txt eol=crlf" > - change a line in the file > - execute "git checkout [file]" > > The result is: > 7465 7374 0d0d 0a0d 0d0a 7465 7374 0d0d test......test.. It seems to me to be the expected behavior. You committed a file whose line endings are not normalized to LF in the repository, and asked for a conversion LF -> CRLF on checkout, which Git did. Git can't know exactly the moment when you edit .gitattributes, so it can't do the conversion at the time you add the eol=crlf attribute. It does it on checkout. > 0d0a was replaced by 0d0d0a. I'd say 0a (LF) was replaced by 0d0a (CRLF). What behavior would you have expected? -- Matthieu Moy http://www-verimag.imag.fr/~moy/