Skip to content

Commit

Permalink
bash completion: difftool accepts the same options as diff
Browse files Browse the repository at this point in the history
So complete refs, files after the double-dash and some diff options that
make sense for difftool.

Signed-off-by: Markus Heidelberg <markus.heidelberg@web.de>
Acked-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Markus Heidelberg authored and Junio C Hamano committed Oct 28, 2009
1 parent 93cf50a commit f7ad96c
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions contrib/completion/git-completion.bash
Original file line number Diff line number Diff line change
Expand Up @@ -958,18 +958,24 @@ __git_mergetools_common="diffuse ecmerge emerge kdiff3 meld opendiff

_git_difftool ()
{
__git_has_doubledash && return

local cur="${COMP_WORDS[COMP_CWORD]}"
case "$cur" in
--tool=*)
__gitcomp "$__git_mergetools_common kompare" "" "${cur##--tool=}"
return
;;
--*)
__gitcomp "--tool="
__gitcomp "--cached --staged --pickaxe-all --pickaxe-regex
--base --ours --theirs
--no-renames --diff-filter= --find-copies-harder
--relative --ignore-submodules
--tool="
return
;;
esac
COMPREPLY=()
__git_complete_file
}

__git_fetch_options="
Expand Down

0 comments on commit f7ad96c

Please sign in to comment.