Diff should have option to ignore whitespace
On the command-line, git provides options to ignore whitespace.
-
--ignore-space-at-eolignores whitespace changes only at the end of lines. -
-b, --ignore-space-changeignores changes in the amount of whitespace. -
-w, --ignore-all-spaceignores all whitespace when comparing lines
These can be extremely useful, and GitX should expose knobs to turn them on when viewing commits.
There is a preference "Show whitespace differences" that enables/disables the -w option (but only in the history view see SHA: c00f736053437957f84e831781b1c66b42db0d01 ).
I use to have it so that the red highlight was also enabled/disabled with that option, but it appears I forgot to include that in this branch. Though maybe that should really be a separate preference.
I'd love to see better control over this. Rather than in preferences, it should be knobs on the diff view itself (similar to the context slider in the staging area). It should also provide all 3 options. For example, what prompted this ticket was someone made a commit which changed all the line endings in the file, and I wanted to see what the real change was (as the line endings was accidental). So I wanted --ignore-space-at-eol. I'd also like to see these options provided in the staging area, though I'm not certain how this should be done as it interferes with staging per-hunk or per-line.
I agree, the red highlight should be a separate preference, though this one I think does belong in the preferences pane.