{"thread":{"id":"27222","subject":"[QUESTION] '--color-words' for 'git add -p'?","startedAt":"2011-04-29T16:42:10Z","lastAt":"2011-04-29T22:38:14Z","messageCount":2,"participants":["Valentin Haenel","Jeff King"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"166754","messageId":"20110429164210.GA14937@kudu.in-berlin.de","threadId":"27222","inReplyTo":null,"subject":"[QUESTION] '--color-words' for 'git add -p'?","fromName":"Valentin Haenel","fromEmail":"valentin@fsfe.org","sentAt":"2011-04-29T16:42:10Z","receivedAt":"2011-04-29T16:42:10Z","isPatch":false,"sender":{"key":"valentin@fsfe.org","avatar":null},"body":"Hi,\n\nis it possible to use some kind of magic to get 'git add -p' to display\ndiff with '--color-words' option? I tried GIT_DIFF_OPTS but w/o success.\n\nthx\n\nV-\n"},{"id":"166782","messageId":"20110429223814.GB3434@sigill.intra.peff.net","threadId":"27222","inReplyTo":"20110429164210.GA14937@kudu.in-berlin.de","subject":"Re: [QUESTION] '--color-words' for 'git add -p'?","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2011-04-29T22:38:14Z","receivedAt":"2011-04-29T22:38:14Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Fri, Apr 29, 2011 at 06:42:10PM +0200, Valentin Haenel wrote:\n\n> is it possible to use some kind of magic to get 'git add -p' to display\n> diff with '--color-words' option? I tried GIT_DIFF_OPTS but w/o success.\n\nNo, it's not currently. The output of --color-words cannot be applied as\na patch, so we would have to do something like diff an extra time, match\nup the hunks, show the user one hunk, and then apply the other.\n\nIn fact, that is what we already do to get color at all. It works very\nwell there, since we know the hunks will match exactly. I'm not 100%\nsure, though, that color-words will produce exactly the same set of\nhunks that a regular line-oriented diff will. Which would be a problem.\n\n-Peff\n"}]}