{"thread":{"id":"35136","subject":"Git line ending trouble","startedAt":"2013-10-14T11:21:47Z","lastAt":"2013-10-14T11:21:47Z","messageCount":1,"participants":["Dennis van der Wal"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"228925","messageId":"CE8193B5.3913E%d.vanderwal@comparegroup.eu","threadId":"35136","inReplyTo":null,"subject":"Git line ending trouble","fromName":"Dennis van der Wal","fromEmail":"d.vanderwal@comparegroup.eu","sentAt":"2013-10-14T11:21:47Z","receivedAt":"2013-10-14T11:21:47Z","isPatch":false,"sender":{"key":"d.vanderwal@comparegroup.eu","avatar":null},"body":"Hello everyone,\n\nRecently we have migrated from Subversion to Git in a multiplatform,\nthough mostly Windows oriented working environment. During the course of\nthis migration we ran into newline issues between people using Mac and\nWindows. When investigating the issue we noticed that the migration\nprocess had created many entries in the .gitattributes like \"path/to/file\n-text\", explaining the problem.\n\nTo fix this problem we tried cleaning up the .gitattributes file and then\nre-adding the files to Git so they would be stored with LF type line\nendings (https://help.github.com/articles/dealing-with-line-endings). This\nseemed to work until I noticed some weird behaviour, namely that whenever\nI executed the aforementioned steps the number of files changed would\ndiffer.\n\nTo verify this observation I tried the following experiment. I cloned one\nof the migrated repositories 4 times, each of them cloned cleanly into a\ndifferent directory. Then for each, on master, I executed the following\ncommands:\n  echo \"* text=auto\" > .gitattributes\n  git add .\n  git commit -m \"Create basic .gitattributes file.\"\n  git rm -r --cached .\n  git reset --hard\n  git add .\n  git commit -m \"Normalise line endings.\"\nNote that the .gitattributes used to consist of one line \"* text=auto\n!eol\" and many of the \"path/to/file -text\" entries I mentioned before, but\nnow has all content replaced with \"* text=auto\".\n\nEach time the second commit command yielded a different result, ranging\nfrom 0 files changed to 738 files changed and most of them hovering around\nthe 500+ mark. I tried with both version 1.7.12.4 and 1.8.4 on Mac OSX\nMountain Lion (10.8.5).\n\nSo my question to this mailing list is: Is this deviation in number of\nfiles changed a known problem and if so is there a known workaround? I\ntried looking for this particular observation, but I found it hard to come\nup with a search query describing this issue.\n\nSincerely,\nDennis van der Wal\nJava Developer at Compare Group\n"}]}