Merge branch 'jx/proc-receive-hook'
[git] / mergetools / vimdiff
1 diff_cmd () {
2         "$merge_tool_path" -R -f -d \
3                 -c 'wincmd l' -c 'cd $GIT_PREFIX' "$LOCAL" "$REMOTE"
4 }
5
6 merge_cmd () {
7         case "$1" in
8         *vimdiff)
9                 if $base_present
10                 then
11                         "$merge_tool_path" -f -d -c '4wincmd w | wincmd J' \
12                                 "$LOCAL" "$BASE" "$REMOTE" "$MERGED"
13                 else
14                         "$merge_tool_path" -f -d -c 'wincmd l' \
15                                 "$LOCAL" "$MERGED" "$REMOTE"
16                 fi
17                 ;;
18         *vimdiff2)
19                 "$merge_tool_path" -f -d -c 'wincmd l' \
20                         "$LOCAL" "$MERGED" "$REMOTE"
21                 ;;
22         *vimdiff3)
23                 if $base_present
24                 then
25                         "$merge_tool_path" -f -d -c 'hid | hid | hid' \
26                                 "$LOCAL" "$REMOTE" "$BASE" "$MERGED"
27                 else
28                         "$merge_tool_path" -f -d -c 'hid | hid' \
29                                 "$LOCAL" "$REMOTE" "$MERGED"
30                 fi
31                 ;;
32         esac
33 }
34
35 translate_merge_tool_path() {
36         case "$1" in
37         nvimdiff*)
38                 echo nvim
39                 ;;
40         gvimdiff*)
41                 echo gvim
42                 ;;
43         vimdiff*)
44                 echo vim
45                 ;;
46         esac
47 }
48
49 exit_code_trustable () {
50         true
51 }
52
53 list_tool_variants () {
54         for prefix in '' g n; do
55                 for suffix in '' 2 3; do
56                         echo "${prefix}vimdiff${suffix}"
57                 done
58         done
59 }