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

Re: Using Filemerge.app as a git-diff viewer

From
Jonathan del Strother <maillist@steelskies.com>
Date
Nov 21, 2007, 11:20 UTC
Message-ID
<2736C1E3-6294-49B0-96A2-8BCCFA27EDCD@steelskies.com>
In-Reply-To
<47440912.8010800@cam.ac.uk>
On 21 Nov 2007, at 10:31, Toby White wrote:
Show 15 quoted lines
> Mac OS X bundles a rather nice graphical diff viewer (Filemerge.app)
> with its developer tools.
>
> While git-merge knows how to use this as a merge tool, I couldn't
> find any way to easily use Filemerge as a viewer for the output
> of git-diff.
>
> (http://thread.gmane.org/gmane.comp.version-control.git/58702
> discusses the problem, and recommends piping git-diff into kompare.
> Filemerge unfortunately won't accept diff output on stdin)
>
> So I wrote a quick script (below) which does what I need. Of all
> the available git-diff flags, it only understands "--cached", and
> up to two commit objects, and no paths, but that's enough for me.
> Within those constraints, it has the same semantics as git-diff.
> ...

Handy, thanks. Just as a note to anyone who runs into the same problems as me - I couldn't persuade this script to work at first. On my Leopard install, mktemp needs a template argument to run. After replacing both `mktemp -d`s in this script with `mktemp -d /tmp/diff.XXXXX`, it works nicely.

Jon
Previous: Toby WhiteNext: Jeff King
Message 2 of 9 in “Using Filemerge.app as a git-diff viewer”
  1. Toby WhiteNov 21, 2007
  2. Jonathan del StrotherNov 21, 2007
  3. Jeff KingNov 21, 2007
  4. Wincent ColaiutaNov 21, 2007
  5. Jeff KingNov 21, 2007
  6. Jakub NarebskiNov 21, 2007
  7. Toby WhiteNov 21, 2007
  8. Wincent ColaiutaNov 21, 2007
  9. Jeff KingNov 21, 2007

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.