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

[PATCH 2/2] mergetools/vimdiff: trust Vim's exit code

From
David Aguilar <davvid@gmail.com>
Date
Nov 29, 2016, 09:38 UTC
Message-ID
<20161129093820.24722-1-davvid@gmail.com>

Allow vimdiff users to signal that they do not want to use the result of a merge by exiting with ":cquit", which tells Vim to exit with an error code.

This is better than the current behavior because it allows users to directly flag that the merge is bad, using a standard Vim feature, rather than relying on a timestamp heuristic that is unforgiving to users that save in-progress merge files.

The original behavior can be restored by configuring mergetool.vimdiff.trustExitCode to false.

Reported-by: Dun Peal <dunpealer@gmail.com>
Signed-off-by: David Aguilar <davvid@gmail.com>
---
I've included anyone that has ever touched the vimdiff feature on the Cc:
list since I'm assuming that you use vimdiff.

This change is a slight change in default behavior when using mergetool with vimdiff, but I think it's a better default overall.

 mergetools/vimdiff | 4 ++++
 1 file changed, 4 insertions(+)
diff --git a/mergetools/vimdiff b/mergetools/vimdiff
index a841ffdb4..10d86f3e1 100644
--- a/mergetools/vimdiff
+++ b/mergetools/vimdiff
@@ -42,3 +42,7 @@ translate_merge_tool_path() {
 		;;
 	esac
 }
+
+exit_code_trustable () {
+	true
+}
-- 
2.11.0.rc3.6.g2e567fd
Message 1 of 1 in “mergetools/vimdiff: trust Vim's exit code”
  1. 2/2 mergetools/vimdiff: trust Vim's exit codeDavid Aguilar, Nov 29, 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.