Skip to content

Commit b4c7216

Browse files
lmarlowgitster
authored andcommitted
bash completion: Add completion for 'git mergetool'
The --tool= long option to "git mergetool" can be completed with: kdiff3 tkdiff meld xxdiff emerge vimdiff gvimdiff ecmerge opendiff Signed-off-by: Lee Marlow <[email protected]> Acked-by: Shawn O. Pearce <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent f491239 commit b4c7216

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

contrib/completion/git-completion.bash

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1001,6 +1001,25 @@ _git_merge ()
10011001
__gitcomp "$(__git_refs)"
10021002
}
10031003

1004+
_git_mergetool ()
1005+
{
1006+
local cur="${COMP_WORDS[COMP_CWORD]}"
1007+
case "$cur" in
1008+
--tool=*)
1009+
__gitcomp "
1010+
kdiff3 tkdiff meld xxdiff emerge
1011+
vimdiff gvimdiff ecmerge opendiff
1012+
" "" "${cur##--tool=}"
1013+
return
1014+
;;
1015+
--*)
1016+
__gitcomp "--tool="
1017+
return
1018+
;;
1019+
esac
1020+
COMPREPLY=()
1021+
}
1022+
10041023
_git_merge_base ()
10051024
{
10061025
__gitcomp "$(__git_refs)"
@@ -1650,6 +1669,7 @@ _git ()
16501669
ls-remote) _git_ls_remote ;;
16511670
ls-tree) _git_ls_tree ;;
16521671
merge) _git_merge;;
1672+
mergetool) _git_mergetool;;
16531673
merge-base) _git_merge_base ;;
16541674
mv) _git_mv ;;
16551675
name-rev) _git_name_rev ;;

0 commit comments

Comments
 (0)