{"thread":{"id":"25482","subject":"Highlighting whitespace on removal with git diff","startedAt":"2010-10-20T00:46:11Z","lastAt":"2010-10-20T06:10:38Z","messageCount":3,"participants":["Stonky Fandango","Kevin Ballard","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"153839","messageId":"AANLkTik7a8OQz2+SVTm+HjZkCtbjm6O9d12biCJ8MyZz@mail.gmail.com","threadId":"25482","inReplyTo":null,"subject":"Highlighting whitespace on removal with git diff","fromName":"Stonky Fandango","fromEmail":"stonkyfandango@gmail.com","sentAt":"2010-10-20T00:46:11Z","receivedAt":"2010-10-20T00:46:11Z","isPatch":false,"sender":{"key":"stonkyfandango@gmail.com","avatar":null},"body":"When I do say 'git diff', and I have added a line with a trailing\nwhitespace, i get a red square box highlighting the added whitespace.\n(on the '+' diff line)\nWhat I want, is the reverse - so when I delete an existing whitespace,\nI get something similar, for example a blue box highlighting the\ndeleted whitespace (on the '-' diff line)\n\nCurrently the only notificate I get is identical\n'-' and '+' diff lines, but no indication of the whitespace deleted\n\nI know I can do this with graphical tools, but ideally would like some way\nusing the standard console git diff - if this is possible.\n\nI have  the following in my .gitconfig\n---\n[color \"diff\"]\nwhitespace = red reverse\n[core]\n whitespace=-indent-with-non-tab,trailing-space,cr-at-eol,tab-in-indent\n---\n\nThanks,\n"},{"id":"153848","messageId":"D058D986-2A83-4979-A461-F7CB34EF9448@sb.org","threadId":"25482","inReplyTo":"AANLkTik7a8OQz2+SVTm+HjZkCtbjm6O9d12biCJ8MyZz@mail.gmail.com","subject":"Re: Highlighting whitespace on removal with git diff","fromName":"Kevin Ballard","fromEmail":"kevin@sb.org","sentAt":"2010-10-20T03:15:33Z","receivedAt":"2010-10-20T03:15:33Z","isPatch":false,"sender":{"key":"kevin@sb.org","avatar":"https://avatars.githubusercontent.com/u/714?v=4"},"body":"The highlight isn't telling you what changed on the line. It's telling you that this added line has trailing whitespace, and your core.whitespace config value is set such that this is considered an error.\n\n-Kevin Ballard\n\nOn Oct 19, 2010, at 5:46 PM, Stonky Fandango wrote:\n\n> When I do say 'git diff', and I have added a line with a trailing\n> whitespace, i get a red square box highlighting the added whitespace.\n> (on the '+' diff line)\n> What I want, is the reverse - so when I delete an existing whitespace,\n> I get something similar, for example a blue box highlighting the\n> deleted whitespace (on the '-' diff line)\n> \n> Currently the only notificate I get is identical\n> '-' and '+' diff lines, but no indication of the whitespace deleted\n> \n> I know I can do this with graphical tools, but ideally would like some way\n> using the standard console git diff - if this is possible.\n> \n> I have  the following in my .gitconfig\n> ---\n> [color \"diff\"]\n> whitespace = red reverse\n> [core]\n>  whitespace=-indent-with-non-tab,trailing-space,cr-at-eol,tab-in-indent\n> ---\n> \n> Thanks,\n> --\n> To unsubscribe from this list: send the line \"unsubscribe git\" in\n> the body of a message to majordomo@vger.kernel.org\n> More majordomo info at  http://vger.kernel.org/majordomo-info.html\n"},{"id":"153851","messageId":"7v4ochxuld.fsf@alter.siamese.dyndns.org","threadId":"25482","inReplyTo":"D058D986-2A83-4979-A461-F7CB34EF9448@sb.org","subject":"Re: Highlighting whitespace on removal with git diff","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2010-10-20T06:10:38Z","receivedAt":"2010-10-20T06:10:38Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Kevin Ballard <kevin@sb.org> writes:\n\n> The highlight isn't telling you what changed on the line. It's telling\n> you that this added line has trailing whitespace, and your\n> core.whitespace config value is set such that this is considered an\n> error.\n>\n> -Kevin Ballard\n\nWhich means that, in order to check for a whitespace error you removed in\nyour change, you can give \"-R\" (reverse) option to your \"git diff\".\n"}]}