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

trustExitCode doesn't apply to vimdiff mergetool

From
Dun Peal <dunpealer@gmail.com>
Date
Nov 27, 2016, 02:44 UTC
Message-ID
<CAD03jn5PAZcFeesaq2osjo7cYd1frWZeN0odNqTh+AMxSEmLgQ@mail.gmail.com>
I'm using vimdiff as my mergetool, and have the following lines in ~/.gitconfig:
[merge]
    tool = vimdiff
[mergetool "vimdiff"]
    trustExitCode = true

My understanding from the docs is that this sets mergetool.vimdiff.trustExitCode to true, thereby concluding that a merge hasn't been successful if vimdiff's exit code is non-zero.

Unfortunately, when I exit Vim using `:cq` - which returns code 1 - the merge is still presumed to have succeeded.

Is there a way to accomplish the desired effect, such that exiting vimdiff with a non-zero code would prevent git from resolving the conflict in the merged file?

Next: Jeff King
Message 1 of 8 in “trustExitCode doesn't apply to vimdiff mergetool”
  1. Dun PealNov 27, 2016
  2. Jeff KingNov 27, 2016
  3. Dun PealNov 27, 2016
  4. Jeff KingNov 27, 2016
  5. David AguilarNov 28, 2016
  6. Jeff KingNov 28, 2016
  7. David AguilarNov 28, 2016
  8. Junio C HamanoNov 28, 2016

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.