git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: git gui diff widget (was Re: [msysGit] Re: [cheetah] Questions about NOTES)

From
TAThomas Arcila <tarcila-s5sjkpinsos@public.gmane.org>
Date
Jan 30, 2008, 07:58 UTC
Message-ID
<1201679921.6348.10.camel@bod-tarcila2.ad.mc.com>
In-Reply-To
<20080130071304.GS24004-o8xcbExO1WpAfugRpC6u6w@public.gmane.org>
Hi,

Here is a patch to gitk that allows to run an external diff viewer. I think it might be a suitable solution. 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 à 02:13 -0500, Shawn O. Pearce a écrit :
Show 52 quoted lines
> Steffen Prohaska <prohaska-wjoc1KHpMeg@public.gmane.org> 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.
> > 
> > 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.
> 
> 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.
>  
> > 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?
> 
> 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.
> 
> 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.  :)
> 
> 
> 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.  :-\
> 
Previous: Shawn O. PearceNext: Steffen Prohaska
Message 3 of 4 in “git gui diff widget (was Re: [msysGit] Re: [cheetah] Questions about NOTES)”
  1. Steffen ProhaskaJan 30, 2008
  2. Shawn O. PearceJan 30, 2008
  3. Thomas ArcilaJan 30, 2008
  4. Steffen ProhaskaJan 30, 2008

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.