@matheusbsbs / matheus-bagliano / commits / f7ad96cfaa
Fork 0

bash completion: difftool accepts the same options as diff

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>

Markus Heidelberg committed Oct 28, 2009 at 10:45 UTC f7ad96cfaaec3b32458ca69d44c50d1397d11d38
1 file changed +8 -2
contrib/completion/git-completion.bash
+8 -2
@@ -958,6 +958,8 @@ __git_mergetools_common="diffuse ecmerge emerge kdiff3 meld opendiff
958
959 _git_difftool ()
960 {
961 + __git_has_doubledash && return
962 +
963 local cur="${COMP_WORDS[COMP_CWORD]}"
964 case "$cur" in
965 --tool=*)
@@ -965,11 +967,15 @@ _git_difftool ()
967 return
968 ;;
969 --*)
968 - __gitcomp "--tool="
970 + __gitcomp "--cached --staged --pickaxe-all --pickaxe-regex
971 + --base --ours --theirs
972 + --no-renames --diff-filter= --find-copies-harder
973 + --relative --ignore-submodules
974 + --tool="
975 return
976 ;;
977 esac
972 - COMPREPLY=()
978 + __git_complete_file
979 }
980
981 __git_fetch_options="