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

Swap file trouble with gvimdiff

From
MMarco <netuse@lavabit.com>
Date
Feb 24, 2011, 19:34 UTC
Message-ID
<20110224203412.29b732b9@glyph>
Hi,
I use gvimdiff as difftool. The relevant .gitconfig entries look as follows:
[diff]
	tool = gvimdiff
[difftool]
	prompt = false

But when one diffs a file alredy opened in another window it clashes because gvimdiff recognises the swap file and throws a message.

It would make sense to pass the option »-n« to gvimdiff to avoid creating a swap file, since it is not needed here.

I haven't found the place where the command line and arguments for the supported difftools are placed, so I created a new entry in the .gitconfig

[diff]
	tool = bettergvimdiff
[difftool "bettergvimdiff"]
	cmd = "gvimdiff -f -n \"$LOCAL\" \"$REMOTE\""

I want to know if this is a »correct« solution and — if not — how you solve the problem.

Marco
Next: Michael J Gruber
Message 1 of 4 in “Swap file trouble with gvimdiff”
  1. MarcoFeb 24, 2011
  2. mergetool-lib: call vim in readonly mode for diffsMichael J Gruber, Feb 25, 2011
  3. Junio C HamanoFeb 25, 2011
  4. David AguilarFeb 27, 2011

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.