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

Re: [PATCH v5] gitk: Use git-difftool for external diffs when git >= 1.7.0

From
David Aguilar <davvid@gmail.com>
Date
Apr 17, 2010, 22:45 UTC
Message-ID
<20100417224556.GB9366@gmail.com>
In-Reply-To
<20100417085230.GC6681@brick.ozlabs.ibm.com>
On Sat, Apr 17, 2010 at 06:52:30PM +1000, Paul Mackerras wrote:
Show 30 quoted lines
> On Thu, Apr 08, 2010 at 02:08:10AM -0700, David Aguilar wrote:
> 
> > git-difftool is used instead of the built-in external diff
> > code when git is >= 1.7.0.  git-difftool's '--extcmd=frotz'
> > feature was first introduced in 1.7.0 and is the mechanism
> > through which we launch the configured difftool.
> > 
> > A benefit of this change is that gitk's external diff feature
> > no longer needs write-access to the current directory.
> 
> I applied this one, and in testing it I noticed that if the git
> difftool invocation fails, for example because the user doesn't have
> meld installed, there is no notification via the GUI.  Instead an
> error message is printed to stderr.  We need to do something more like
> what we do in the old-git case -- use open rather than exec -- and pop
> up an error dialog with error_popup on error so that the user knows
> what the problem is.
> 
> Another minor problem is that the file names that meld (or other diff
> tool) displays are less informative now.  For example I see
> "KyaZ5d_gitk : 8iucke_gitk" as the tab label in meld instead of the
> "[87d24ec87abc...e236e0833ff] gitk" label that we got before, which
> was a little more informative, though the e236e0833ff is the end of
> the second SHA1 rather than the beginning.
> 
> So I backed it out.  The error handling needs to be fixed using
> something like what delete_at_eof does (except that obviously we don't
> have any files to delete).
> 
> Paul.

I'll fix the error handling and add a few more notes to the final commit message.

The title display is tool-specific so there's something we can do about it on a tool-by-tool basis. This'll have to wait until we can break out the tool-dependent parts of git-mergetool--lib as was discussed in the past:

http://lists-archives.org/git/707440-mergetool-lib-add-diffmerge-as-a-pre-configured-mergetool-option.html (sorry, couldn't find it on gmane... :-/)

Jay, you mentioned wanting to give Junio's approach a try as well as looking into what mercurial did with mergetools. Do you have any thoughts about it since then? I can help factor out the backends if you don't think you'll have time to get to it soon.

Once we factor out the backends we'll should have an easier time working in additional variables for doing user-friendly things like passing the --label= flag to meld. git-difftool should be able to do it since its GIT_EXTERNAL_DIFF helper is passed the sha1s.

Thanks all,
-- 
		David
Previous: Paul MackerrasNext: Jay Soffian
Message 11 of 14 in “gitk: Use git-difftool for external diffs”
  1. gitk: Use git-difftool for external diffsDavid Aguilar, Mar 27, 2010
  2. gitk: Use git-difftool for external diffsDavid Aguilar, Mar 28, 2010
  3. gitk: Use git-difftool for external diffsDavid Aguilar, Mar 28, 2010
  4. Markus HeidelbergMar 28, 2010
  5. David AguilarMar 31, 2010
  6. gitk: Use git-difftool for external diffsDavid Aguilar, Mar 31, 2010
  7. Markus HeidelbergApr 2, 2010
  8. David AguilarApr 8, 2010
  9. gitk: Use git-difftool for external diffs when git >= 1.7.0David Aguilar, Apr 8, 2010
  10. Paul MackerrasApr 17, 2010
  11. David AguilarApr 17, 2010
  12. Jay SoffianApr 18, 2010
  13. gitk: Use git-difftool for external diffs when availableDavid Aguilar, Apr 20, 2010
  14. David AguilarJun 8, 2010

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.