0

I've been going through cleaning up my company's repository for LF normalization, following this method here, all the way up to git status: https://stackoverflow.com/a/4683783/1827734

I've used this set of settings in my .gitattributes file:

*                       text=auto
*.sln                   text eol=crlf
*.asax                  text eol=crlf
*.cs                    text eol=crlf diff=csharp
*.csproj                text eol=crlf

The codebase is mostly java files, but there are a few C# files (.cs, .sln, etc) that git is trying to mark as changed. I've could verify that it was a CRLF -> LF conversion for other files in the codebase because of the warning that shows when you git diff them, but there is no warning like that for these files (as expected). I've tried using other diff programs like Meld to see if they show something else (using cat and piping to pbcopy, making sure to show whitespace differences), they're reported as identical. When I use the --ignore-space-at-eol or --ignore-space-change flags, no differences show, so it's leading me to believe that there's some white space change somewhere that git sees but I can't even see how that would be possible after using different diff programs.

The only other guess I'd have is the BOM character at the beginning of the file; it's the only thing that stands out as different about these files, yet the values shown are also identical: old file new file

Using: * OSX 10.10.5 * git version 2.3.8 (Apple Git-58)

Community
  • 1
  • 1
BrDaHa
  • 5,138
  • 5
  • 32
  • 47
  • It is showing that the entire file has changed? – Dave Zych Sep 30 '15 at 16:38
  • Run a `git diff -b`. The `-b` flag forces it to ignore whitespace. I know you said a diffing program shows no diff but that program might also ignore whitespace changes. – Dave Zych Sep 30 '15 at 16:40
  • the problem is that any variation of ignoreing whitespace will show no diff, but (defaulting to) showing whitespace changes will show the entire file changed, with no actual (from what I can tell) whitespace changes. In my git diff you can usually see whitespace changes, and for CRLF -> LF , there will be a warning. I'm just worried that there's a whitespace change that's not showing in the git diff for some reason – BrDaHa Sep 30 '15 at 17:38

0 Answers0