git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Side-by-side diff and patch visualization
@ 2007-09-19 11:40 Wincent Colaiuta
  2007-09-19 12:09 ` Jeff King
  2007-09-19 12:23 ` David Kastrup
  0 siblings, 2 replies; 5+ messages in thread
From: Wincent Colaiuta @ 2007-09-19 11:40 UTC (permalink / raw)
  To: Git Mailing List

Does anybody know of any tools for doing side-by-side visualizations  
of diffs and patches which work well with Git?

By side-by-side I mean something like what's shown in this screen shot:

<http://wincent.com/images/side-by-side-diff.png>

For simple diffs there is little advantage here over a raw textual  
diff, but as patch complexity and size increase the side-by-side diff  
can sometimes prove itself to be more useful:

- totally flexible notion of context (you can scroll as far as you  
want in either direction)

- this flexibility comes with the same rapid movement between changes  
(ie. up/down cursor keys to jump between hunks no matter how far  
apart they are)

- for complex diffs, truly comprehending the nature of the changes  
may be easier in a side-by-side format

- as icing on cake, the implementation in the screenshot highlights  
the removed/added portions within each line

Now, that screenshot is actually of Apple's FileMerge app on Mac OS X  
and it would be fairly straightforward to write a dump wrapper script  
that either just interpreted the output of git-diff, or could be used  
in conjunction with GIT_EXTERNAL_DIFF, to feed files into opendiff  
two at a time, but that wouldn't allow you to easily visualize diffs  
which touch many paths.

So, can anyone recommend a tool which can do this kind of side-by- 
side visualization and plays nicely with Git? Experience with  
opendiff and git-mergetool has spoilt me here. For most cases I would  
continue to use vanilla git-diff (or gitk), but when I see a change  
that I'd like to visualize side-by-side I'd like to be able to use  
this alternative diff viewer (or can gitk already do side-by-side  
diffs and I just haven't seen how to turn them on?). Bonus points if  
I could not only view existing commits, but proposed commits too (ie.  
the ability to feed in a patch and see a side-by-side visualization  
of what the diff would look like if applied).

If nothing exists I will look at quickly hacking something together  
(most likely something that just reads the output of git-diff), but  
it will be just that, a quick hack.

Cheers,
Wincent

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Side-by-side diff and patch visualization
  2007-09-19 11:40 Side-by-side diff and patch visualization Wincent Colaiuta
@ 2007-09-19 12:09 ` Jeff King
  2007-09-19 12:36   ` Wincent Colaiuta
  2007-09-19 13:08   ` Andy Parkins
  2007-09-19 12:23 ` David Kastrup
  1 sibling, 2 replies; 5+ messages in thread
From: Jeff King @ 2007-09-19 12:09 UTC (permalink / raw)
  To: Wincent Colaiuta; +Cc: Git Mailing List

On Wed, Sep 19, 2007 at 01:40:17PM +0200, Wincent Colaiuta wrote:

> Does anybody know of any tools for doing side-by-side visualizations of 
> diffs and patches which work well with Git?

Have you tried kompare?

  git-diff HEAD~5 | kompare -

-Peff

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Side-by-side diff and patch visualization
  2007-09-19 11:40 Side-by-side diff and patch visualization Wincent Colaiuta
  2007-09-19 12:09 ` Jeff King
@ 2007-09-19 12:23 ` David Kastrup
  1 sibling, 0 replies; 5+ messages in thread
From: David Kastrup @ 2007-09-19 12:23 UTC (permalink / raw)
  To: git

Wincent Colaiuta <win@wincent.com> writes:

> Does anybody know of any tools for doing side-by-side visualizations
> of diffs and patches which work well with Git?
>
> So, can anyone recommend a tool which can do this kind of side-by- 
> side visualization and plays nicely with Git?

I use M-x ediff-revision RET in Emacs for this.  There is also M-x
smerge-ediff RET for resolving a file with merge conflict markers, and
M-x ediff-merge-revisions-with-ancestor RET.

The side-by-side layout is chosen by typing | into the control window
for the merge.

Looking at a patch in respect of two versions can be done with M-x
ediff-patch-file RET.

-- 
David Kastrup

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Side-by-side diff and patch visualization
  2007-09-19 12:09 ` Jeff King
@ 2007-09-19 12:36   ` Wincent Colaiuta
  2007-09-19 13:08   ` Andy Parkins
  1 sibling, 0 replies; 5+ messages in thread
From: Wincent Colaiuta @ 2007-09-19 12:36 UTC (permalink / raw)
  To: Jeff King; +Cc: Git Mailing List

El 19/9/2007, a las 14:09, Jeff King escribió:

> On Wed, Sep 19, 2007 at 01:40:17PM +0200, Wincent Colaiuta wrote:
>
>> Does anybody know of any tools for doing side-by-side  
>> visualizations of
>> diffs and patches which work well with Git?
>
> Have you tried kompare?
>
>   git-diff HEAD~5 | kompare -
>
> -Peff

Ah, didn't know about that one. From the look of it that is exactly  
the kind of extremely simple viewer that I was wanting.

Cheers,
Wincent

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Side-by-side diff and patch visualization
  2007-09-19 12:09 ` Jeff King
  2007-09-19 12:36   ` Wincent Colaiuta
@ 2007-09-19 13:08   ` Andy Parkins
  1 sibling, 0 replies; 5+ messages in thread
From: Andy Parkins @ 2007-09-19 13:08 UTC (permalink / raw)
  To: git; +Cc: Jeff King, Wincent Colaiuta

On Wednesday 2007 September 19, Jeff King wrote:

> Have you tried kompare?
>
>   git-diff HEAD~5 | kompare -

You can also throw in the "--unified" switch to see the whole file, rather 
than just the bits that have changed (if that's what you like).

 git-diff --unified=9999999 HEAD~5 | kompare -


Andy

-- 
Dr Andy Parkins, M Eng (hons), MIET
andyparkins@gmail.com

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2007-09-19 13:08 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-09-19 11:40 Side-by-side diff and patch visualization Wincent Colaiuta
2007-09-19 12:09 ` Jeff King
2007-09-19 12:36   ` Wincent Colaiuta
2007-09-19 13:08   ` Andy Parkins
2007-09-19 12:23 ` David Kastrup

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).