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

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

From
SPSteffen Prohaska <prohaska-wjoc1khpmeg@public.gmane.org>
Date
Jan 30, 2008, 07:00 UTC
Message-ID
<75E9DFB9-BE1B-4B60-921D-EE0898DFA9F3@zib.de>
In-Reply-To
<20080130040336.GN24004-o8xcbExO1WpAfugRpC6u6w@public.gmane.org>
[ I put the git list on CC and chose a new topic. ]
On Jan 30, 2008, at 5:03 AM, Shawn O. Pearce wrote:
Show 34 quoted lines
>
> Johannes Schindelin <Johannes.Schindelin-Mmb7MZpHnFY@public.gmane.org> wrote:
>> On Mon, 28 Jan 2008, Shawn O. Pearce wrote:
>>> Johannes Schindelin <Johannes.Schindelin-Mmb7MZpHnFY@public.gmane.org> wrote:
>>>>
>>>> Another thing (and this concerns you, Shawn): there is this lovely
>>>> program called git-gui, and it has most of what we will ever  
>>>> want to
>>>> drive from git-cheetah.  Is there any method to call git-gui  
>>>> such that
>>>> it performs a certain command, or is there a chance to get such a
>>>> method?
>>
>> I did not mean to remote control it, just to start it with a default
>> action, such as "diff file <xyz> to HEAD", or "diff directory  
>> <xyz> to
>> index".
>
> Oh, like we do for `git gui blame HEAD file` ?  :-)
>
> That isn't too difficult.  git-gui currently cannot show a diff of
> a directory, it can only diff a single file at a time, but yea,
> it wouldn't be hard to add a `git gui diff file` to have it open
> up and show the current difference of index<->file or HEAD<->index
> for that path.
>
> 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.

A difficulty they face is that in a git workflow they often need to diff between two trees and this case is currently not handled in a sensible way if you want to view the diffs graphically. Well you could set GIT_EXTERNAL_DIFF to a graphical tool. But then git would pop-up a new instance of your graphical tool for every single file and this is certainly not what you expect (I tried it once and immediately stopped this experiment).

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?

	Steffen
Next: Shawn O. Pearce
Message 1 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.