From: Pete B. <pb...@gm...> - 2010-12-05 22:56:41
|
On 2010.12.05 22:19, Michael Plante wrote: > This is really > strange, as though git has some memory across branch switches other than > what's in the config -- like it's not cleaning up the working copy if it > only changes in line endings when you switch branches...this may be a git > bug. Mmm, that could explain the weird results I had on supertest. > As an example, if I apply the patch on top of your master now in Linux > (with autocrlf/safecrlf unspecified, so false), it does work: > > $ git clone http://git.libusb.org/libusb-pbatard.git . OK, if you clone my master, the files should be CRLF in your local git repo > $ emacs .gitattributes > [...changed to eol=crlf...] > > $ git status > # modified: msvc/libusb.dsw > no changes added to commit (use "git add" and/or "git commit -a") > > $ hexdump -C msvc/libusb.dsw |less > 00000030 74 20 56 65 72 73 69 6f 6e 20 36 2e 30 30 0d 0a |t Version > 6.00..| > ^^ ^^ > Weird? git marks it modified, yet the working copy is clearly still CRLF. > (Note that I did not do any add/commit ops here.) Maybe git expects that if you use eol=crlf, the repo should have LF (because CRLF conversion is applied on checkout) But since repo is CRLF we have the following when diffing: local CRLF -> stripped to LF (because eol=crlf) -> compared to CRLF => flagged as modified. Could that explain this behaviour? Regards, /Pete |