I have the following output with git-diff.
- // sort list based on value
+ // sort list based on value
Note: Git 2.5+ (Q2 2015) will propose a more specific option for whitespace detection.
Traditionally, we only cared about whitespace breakages introduced in new lines.
Some people want to paint whitespace breakages on old lines, too. When they see a whitespace breakage on a new line, they can spot the same kind of whitespace breakage on the corresponding old line and want to say "Ah, those breakages are there but they were inherited from the original, so let's not touch them for now."
--ws-error-highlight=<kind>option, that lets them pass a comma separated list of
contextto specify what lines to highlight whitespace errors on.
Highlight whitespace errors on lines specified by
<kind>in the color specified by
<kind>is a comma separated list of
When this option is not given, only whitespace errors in
newlines are highlighted.
--ws-error-highlight=new,oldhighlights whitespace errors on both deleted and added lines.
allcan be used as a short-hand for
For instance, the old commit had one whitespace error (
bbb), but you can focus on the new errors only:
(test done after
Update Git 2.11+ (Q4 2016, a year and half later) :
git config diff.wsErrorHighlight [old,new,context]
git diff/log --ws-error-highlight=<kind> lacked the corresponding configuration variable to set it by default. That is added in Git 2.11.