{"thread":{"id":"9941","subject":"Side-by-side diff and patch visualization","startedAt":"2007-09-19T11:40:17Z","lastAt":"2007-09-19T13:08:20Z","messageCount":5,"participants":["Wincent Colaiuta","Jeff King","David Kastrup","Andy Parkins"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"53572","messageId":"A92611E8-1035-46A6-AFEF-9C8A6F93AFB1@wincent.com","threadId":"9941","inReplyTo":null,"subject":"Side-by-side diff and patch visualization","fromName":"Wincent Colaiuta","fromEmail":"win@wincent.com","sentAt":"2007-09-19T11:40:17Z","receivedAt":"2007-09-19T11:40:17Z","isPatch":false,"sender":{"key":"greg@hurrell.net","avatar":"https://avatars.githubusercontent.com/u/7074?v=4"},"body":"Does anybody know of any tools for doing side-by-side visualizations  \nof diffs and patches which work well with Git?\n\nBy side-by-side I mean something like what's shown in this screen shot:\n\n<http://wincent.com/images/side-by-side-diff.png>\n\nFor simple diffs there is little advantage here over a raw textual  \ndiff, but as patch complexity and size increase the side-by-side diff  \ncan sometimes prove itself to be more useful:\n\n- totally flexible notion of context (you can scroll as far as you  \nwant in either direction)\n\n- this flexibility comes with the same rapid movement between changes  \n(ie. up/down cursor keys to jump between hunks no matter how far  \napart they are)\n\n- for complex diffs, truly comprehending the nature of the changes  \nmay be easier in a side-by-side format\n\n- as icing on cake, the implementation in the screenshot highlights  \nthe removed/added portions within each line\n\nNow, that screenshot is actually of Apple's FileMerge app on Mac OS X  \nand it would be fairly straightforward to write a dump wrapper script  \nthat either just interpreted the output of git-diff, or could be used  \nin conjunction with GIT_EXTERNAL_DIFF, to feed files into opendiff  \ntwo at a time, but that wouldn't allow you to easily visualize diffs  \nwhich touch many paths.\n\nSo, can anyone recommend a tool which can do this kind of side-by- \nside visualization and plays nicely with Git? Experience with  \nopendiff and git-mergetool has spoilt me here. For most cases I would  \ncontinue to use vanilla git-diff (or gitk), but when I see a change  \nthat I'd like to visualize side-by-side I'd like to be able to use  \nthis alternative diff viewer (or can gitk already do side-by-side  \ndiffs and I just haven't seen how to turn them on?). Bonus points if  \nI could not only view existing commits, but proposed commits too (ie.  \nthe ability to feed in a patch and see a side-by-side visualization  \nof what the diff would look like if applied).\n\nIf nothing exists I will look at quickly hacking something together  \n(most likely something that just reads the output of git-diff), but  \nit will be just that, a quick hack.\n\nCheers,\nWincent\n"},{"id":"53574","messageId":"20070919120956.GA20715@coredump.intra.peff.net","threadId":"9941","inReplyTo":"A92611E8-1035-46A6-AFEF-9C8A6F93AFB1@wincent.com","subject":"Re: Side-by-side diff and patch visualization","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2007-09-19T12:09:56Z","receivedAt":"2007-09-19T12:09:56Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Wed, Sep 19, 2007 at 01:40:17PM +0200, Wincent Colaiuta wrote:\n\n> Does anybody know of any tools for doing side-by-side visualizations of \n> diffs and patches which work well with Git?\n\nHave you tried kompare?\n\n  git-diff HEAD~5 | kompare -\n\n-Peff\n"},{"id":"53578","messageId":"86y7f22695.fsf@lola.quinscape.zz","threadId":"9941","inReplyTo":"A92611E8-1035-46A6-AFEF-9C8A6F93AFB1@wincent.com","subject":"Re: Side-by-side diff and patch visualization","fromName":"David Kastrup","fromEmail":"dak@gnu.org","sentAt":"2007-09-19T12:23:50Z","receivedAt":"2007-09-19T12:23:50Z","isPatch":false,"sender":{"key":"dak@gnu.org","avatar":"https://avatars.githubusercontent.com/u/52141349?v=4"},"body":"Wincent Colaiuta <win@wincent.com> writes:\n\n> Does anybody know of any tools for doing side-by-side visualizations\n> of diffs and patches which work well with Git?\n>\n> So, can anyone recommend a tool which can do this kind of side-by- \n> side visualization and plays nicely with Git?\n\nI use M-x ediff-revision RET in Emacs for this.  There is also M-x\nsmerge-ediff RET for resolving a file with merge conflict markers, and\nM-x ediff-merge-revisions-with-ancestor RET.\n\nThe side-by-side layout is chosen by typing | into the control window\nfor the merge.\n\nLooking at a patch in respect of two versions can be done with M-x\nediff-patch-file RET.\n\n-- \nDavid Kastrup\n"},{"id":"53577","messageId":"5340F4CD-929F-4D87-94D0-367122284FDA@wincent.com","threadId":"9941","inReplyTo":"20070919120956.GA20715@coredump.intra.peff.net","subject":"Re: Side-by-side diff and patch visualization","fromName":"Wincent Colaiuta","fromEmail":"win@wincent.com","sentAt":"2007-09-19T12:36:03Z","receivedAt":"2007-09-19T12:36:03Z","isPatch":false,"sender":{"key":"greg@hurrell.net","avatar":"https://avatars.githubusercontent.com/u/7074?v=4"},"body":"El 19/9/2007, a las 14:09, Jeff King escribió:\n\n> On Wed, Sep 19, 2007 at 01:40:17PM +0200, Wincent Colaiuta wrote:\n>\n>> Does anybody know of any tools for doing side-by-side  \n>> visualizations of\n>> diffs and patches which work well with Git?\n>\n> Have you tried kompare?\n>\n>   git-diff HEAD~5 | kompare -\n>\n> -Peff\n\nAh, didn't know about that one. From the look of it that is exactly  \nthe kind of extremely simple viewer that I was wanting.\n\nCheers,\nWincent\n"},{"id":"53580","messageId":"200709191408.21527.andyparkins@gmail.com","threadId":"9941","inReplyTo":"20070919120956.GA20715@coredump.intra.peff.net","subject":"Re: Side-by-side diff and patch visualization","fromName":"Andy Parkins","fromEmail":"andyparkins@gmail.com","sentAt":"2007-09-19T13:08:20Z","receivedAt":"2007-09-19T13:08:20Z","isPatch":false,"sender":{"key":"andyparkins@gmail.com","avatar":null},"body":"On Wednesday 2007 September 19, Jeff King wrote:\n\n> Have you tried kompare?\n>\n>   git-diff HEAD~5 | kompare -\n\nYou can also throw in the \"--unified\" switch to see the whole file, rather \nthan just the bits that have changed (if that's what you like).\n\n git-diff --unified=9999999 HEAD~5 | kompare -\n\n\nAndy\n\n-- \nDr Andy Parkins, M Eng (hons), MIET\nandyparkins@gmail.com\n"}]}