threads / discuss / 19862

visualise the output of git-diff?

Subject: visualise the output of git-diff?

## tl;dr

4 messages between Jun 19, 2009 and Jun 19, 2009.

replies: 3people: 4as markdown or json

Kārlis Repsons· Jun 19, 2009, 07:32 UTC · lore

Hi, this is about displaying git-diff results: in case of long text lines, where only a single word may be changed, it would be useful, if that single difference would be displayed in a different colour, but is it possible? And about pager - are you people all using less or there are also some non-console viewers available?

Kārlis
Teemu Likonen· Jun 19, 2009, 07:52 UTC · re: Kārlis Repsons · lore

Re: visualise the output of git-diff?

On 2009-06-19 07:32 (UTC), Kārlis Repsons wrote:
> this is about displaying git-diff results: in case of long text lines,
> where only a single word may be changed, it would be useful, if that
> single difference would be displayed in a different colour, but is it
> possible?

At least there is "git diff --color-words" but it may not be what you want.

> And about pager - are you people all using less or there are also some
> non-console viewers available?
I mostly use "less" but sometimes also "kompare" which is excellent:
    git diff | kompare -
David Aguilar· Jun 19, 2009, 08:47 UTC · re: Teemu Likonen · lore

Re: visualise the output of git-diff?

On Fri, Jun 19, 2009 at 10:52:08AM +0300, Teemu Likonen wrote:
Show 11 quoted lines
> On 2009-06-19 07:32 (UTC), Kārlis Repsons wrote:
> 
> At least there is "git diff --color-words" but it may not be what you
> want.
> 
> > And about pager - are you people all using less or there are also some
> > non-console viewers available?
> 
> I mostly use "less" but sometimes also "kompare" which is excellent:
> 
>     git diff | kompare -

And of course.. don't forget about git-difftool =) http://kernel.org/pub/software/scm/git/docs/git-difftool.html

	$ git difftool -t kompare
	$ git difftool -t diffuse
	$ git difftool -t xxdiff

The quality of the visualization is only limited by the quality of your difftool. We support lots of them. From the docs:

"Valid merge toosl are: kdiff3, kompare, tkdiff, meld, xxdiff, emerge, vimdiff, gvimdiff, ecmerge, diffuse, opendiff and araxis."

Like mergetool, difftool has an extension mechanism in case the built-ins are not sufficient.

Have fun,
-- 
		David
Wincent Colaiuta· Jun 19, 2009, 08:42 UTC · re: Kārlis Repsons · lore

Re: visualise the output of git-diff?

El 19/6/2009, a las 9:32, Kārlis Repsons escribió:
Show 6 quoted lines
> Hi,
> this is about displaying git-diff results:
> in case of long text lines, where only a single word may be changed,  
> it would
> be useful, if that single difference would be displayed in a different
> colour, but is it possible?

I started working on a patch for that feature a while back and then got snowed under by other work, but it's still on my TODO list. There was some discussion on the list about the idea.

The relevant thread starts with
	
	Message-ID: <53497057-1ADE-4300-9F35-B218959606FE@wincent.com>
	Subject: RFC: git diff colorization idea
Browsable copy here:
	http://article.gmane.org/gmane.comp.version-control.git/106805

Cheers, Wincent

← back to recent threads