From: Michael P. <mic...@gm...> - 2010-12-05 23:16:29
|
Pete Batard wrote: >> 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. I mixed up the discussion. The stuff you snipped as the important stuff, and is related to the above. The stuff you did not snip was just slightly odd, but not a problem. >> > 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 Yes. >> > $ 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? Yeah, and I figured as much, but, like I said, this is NOT a problem. That works fine, no issue. It's the stuff you cut out of my email that I think highlights the problem. I'm repasting here: >> $ git clone http://git.libusb.org/libusb-pbatard.git . >> $ git checkout -b prest pbr288 # pbr288 is the common ancestor >> $ git checkout -b pbst origin/supertest >> $ hexdump -C libusb.dsw |less >> [...shows LF-only...] >> $ git checkout master >> $ git checkout pbst >> $ hexdump -C libusb.dsw |less >> [...shows CRLF...] Can you explain that? Sorry for mixing a problem with a simple non-problem point of interest in the same email. Michael |