Hi,
Here is a patch to gitk that allows to run an external diff viewer.
I think it might be a suitable solution.=20
It can be configured in Edit/Preferences/External diff tool.
To see the diff between two files:
- select revisions to diff
- right click on a file in the patched files list view
- choose "External diff"
Any feedback is welcome.
Thomas
Le mercredi 30 janvier 2008 =C3=A0 02:13 -0500, Shawn O. Pearce a =C3=A9cri=
t :
quoted text > Steffen Prohaska <prohaska@zib.de> wrote:
> > On Jan 30, 2008, at 5:03 AM, Shawn O. Pearce wrote:
> > >
> > >Doing a diff against a random other tree-ish, or between two random
> > >tree-ishes would be possible, but a lot more of a challenge.
> > >
> > >The diff viewer in git-gui isn't exactly a reusable widget.
> > >We'd need to refactor that so it could take patch output from any
> > >of the patch generating git commands. Doing such is on my list
> > >of things I'd like to fix in git-gui, but I haven't had time to
> > >do it yet.
> >=20
> > Hmm, I'm not sure if such a full diff viewer is the most
> > important thing to address. Most users (especially Windows
> > users) already have a favorite graphical diff tool and they expect
> > a mechanism to plug it into a git workflow.
>=20
> I hear this a lot from a co-worker. He really wants a side-by-side
> diff tool in git, as he doesn't like reading patches. Me, I've
> never been able to read a side-by-side diff tool, but I can grok
> a unified diff quite easily. To each his own, and git should help
> users as much as it can.
> =20
> > I think a tool that presents the list of files with differences
> > and can launch an external tool for one of these files would be
> > very helpful. I started to think about a command line version,
> > git-difftool, implementing this idea, but do not yet have code.
> > A GUI version would be preferable for cheetah anyway. Maybe the
> > patch viewer you sketched above could provide a way to launch an
> > external tool for any of the files touched by the patch? If the
> > widget would be reusable maybe it could also be used in gitk?
>=20
> Yea, that makes sense. But we may want to go the other way,
> that is reuse gitk's patch viewer. Or something. The two tools
> (git-gui and gitk) grew their diff viewers independently, though
> I have to say that git-gui's was inspired by gitk's, and the work
> that Paul did on gitool waaaaay back when.
>=20
> Right now though I doubt there's a single line of code in common
> between them. Hmm, I think they both use the Tk "text" widget.
> And a blue-ish color for hunk headers. :)
>=20
>=20
> Adding a feature to git-gui to launch an external diff of that
> file against the index or HEAD shouldn't be too difficult, and I
> think is what would be most natural for the current UI. The ugly
> part is pulling out the HEAD/index version into a temporary file
> and passing a nice -L (or something like) option to the user's diff
> viewer so they don't see the nasty temporary file name, but instead
> see a string that matches what git-gui is showing them. And that
> option is going to differ for like every tool out there. :-\
>=20