Git is showing me an entire file is changed, when I can't seem to figure out the changes. This is cygwin git, but it also happens in msysgit
$ git --version
git version 2.1.1
$ diff <(git show HEAD:File.cs) <(cat File.cs)
// Shows no differences
$ diff <(git show HEAD:File.cs | xxd) <(xxd File.cs)
// Shows no differences
$ git diff
// shows the entire file has changed
$ git hash-object <(git show HEAD:File.cs)
7b3762473342a5b040835bfef9f6b45c109ba48b
$ git hash-object <(cat File.cs)
7b3762473342a5b040835bfef9f6b45c109ba48b
$ git hash-object File.cs
7b3762473342a5b040835bfef9f6b45c109ba48b
I have
$ git config --get core.fileMode
false
and
$ git config --get core.autocrlf
true
I truly have no idea what's going on, everything wants them to be the same, yet git wants to create a commit saying the entire contents was deleted and recreated. Does anyone who knows git plumbing better have a suggestion?. All I can think of is git show is removing/normalizing odd line endings.
UPDATE:
I'm pretty sure its happening because development process is like this. Checkout from git, rsync to dev machine, develop, rsync back. I believe rsync is messing with the line endings some. It's just weird that gits not reporting about the line endings, and it seems to get really confused about what the hell is happening. Even though diffing the binary representation of the files seem to be identical.
UPDATE 2:
So this is super annoying, and I feel like I have stumbled upon a bug in git.
For instance
$ git gc
$ git checkout -- .
$ git clean -fd
$ git status
> shows a heap of modified files
I'm pretty sure that should show no changes, no matter where its run, but I get a list of 20 odd things :(