From: Michael J Gruber Date: Fri, 25 Feb 2011 09:36:39 +0000 (+0100) Subject: mergetool-lib: call vim in readonly mode for diffs X-Git-Tag: v1.7.4.2~19^2 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=853c0ffe42fef0bd1abd5cc69d5e93fdd5a708aa;p=git.git mergetool-lib: call vim in readonly mode for diffs When [g]vimdiff is called for files which are opened already, the editor complains about the existing swap file. But we do not want to write anything when called from difftool. So, make difftool use "-R" for the vim family. This - prevents the use of a swap file and - marks the buffers readonly. Signed-off-by: Michael J Gruber Signed-off-by: Junio C Hamano --- diff --git a/git-mergetool--lib.sh b/git-mergetool--lib.sh index 77d4aee20..78ce49e98 100644 --- a/git-mergetool--lib.sh +++ b/git-mergetool--lib.sh @@ -182,7 +182,7 @@ run_merge_tool () { fi check_unchanged else - "$merge_tool_path" -f -d -c "wincmd l" \ + "$merge_tool_path" -R -f -d -c "wincmd l" \ "$LOCAL" "$REMOTE" fi ;; @@ -193,7 +193,7 @@ run_merge_tool () { "$LOCAL" "$MERGED" "$REMOTE" check_unchanged else - "$merge_tool_path" -f -d -c "wincmd l" \ + "$merge_tool_path" -R -f -d -c "wincmd l" \ "$LOCAL" "$REMOTE" fi ;;