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

Re: Running vimdiff in read-only mode with git-difftool?

From
David Aguilar <davvid@gmail.com>
Date
May 18, 2009, 05:51 UTC
Message-ID
<20090518055113.GB32259@gmail.com>
In-Reply-To
<9e00fd550905172201n6c95dc1bia48c9ac25d8ec98f@mail.gmail.com>
On Sun, May 17, 2009 at 10:01:02PM -0700, Nick Welch wrote:
Show 8 quoted lines
> I'm running:
> 
> git difftool -y --tool=vimdiff -U99999 --patience
> 
> and I have the following in ~/.gitconfig:
> 
> [difftool "vimdiff"]
>     cmd = "vimdiff -R"
I forgot to mention a couple of things.

If you do change that to e.g. "myvimdiff" you'll need the $LOCAL and $REMOTE params as well; probably something like:

[difftool "myvimdiff"]
	cmd = vim -R -d -c wincmd l \"$LOCAL\" \"$REMOTE\"
$ git difftool -y -t myvimdiff

Secondly, git-difftool receives both the pre and post-image and doesn't actually receive the output of git-diff, so passing --patience unfortunately won't do what you're expecting it to do. Piping the output of git-diff to something like kompare(?) is probably the only way to get the nice --patience result.

It'd be nice if all diff/merge tools supported the patience diff algorithm but that's not the case right now.

-- 
	David
Previous: David AguilarNext: Nick Welch
Message 3 of 4 in “Running vimdiff in read-only mode with git-difftool?”
  1. Nick WelchMay 18, 2009
  2. David AguilarMay 18, 2009
  3. David AguilarMay 18, 2009
  4. Nick WelchMay 18, 2009

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.