So, I've recently added a .gitattributes file to one of our repositories to try to force consistent line endings:
# All Perl Sources should use Unix style line endings
*.pl text eol=lf
*.pm text eol=lf
But both myself and a lot of other developers are encountering a lot of "phantom changes" where git seems to detect the file as "changed" even though there's no change. Every line shows up as added, then deleted.
I suspect it's getting confused about line endings (and thus detecting each line as changed), but what's weird here is:
- I can't reset the file (the reset is completed, but the file remains as an unstaged change)
- Changing the line endings in the affected text file does not affect whether it shows up as a changed file.
Has anyone encountered this before, and is there a way to avoid or resolve this issue?