completion: use __gitcomp_builtin in _git_difftool

Since we can't automatically extract diff options for completion yet, difftool will take all options from $__git_diff_common_options. This brings _a lot_ more completable options to difftool. --ignore-submodules is added to $__git_diff_common_options to avoid regression in difftool. But it's a good thing anyway even for other diff commands. Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Nguyễn Thái Ngọc Duy committed Feb 9, 2018 at 18:01 UTC 6cc4bc15f92e85b41d9da9075905f20c6a9008fe
1 file changed +6 -6
contrib/completion/git-completion.bash
+6 -6
@@ -1394,7 +1394,7 @@ __git_diff_common_options="--stat --numstat --shortstat --summary
1394 --dirstat --dirstat= --dirstat-by-file
1395 --dirstat-by-file= --cumulative
1396 --diff-algorithm=
1397 - --submodule --submodule=
1397 + --submodule --submodule= --ignore-submodules
1398 "
1399
1400 _git_diff ()
@@ -1435,11 +1435,11 @@ _git_difftool ()
1435 return
1436 ;;
1437 --*)
1438 - __gitcomp "--cached --staged --pickaxe-all --pickaxe-regex
1439 - --base --ours --theirs
1440 - --no-renames --diff-filter= --find-copies-harder
1441 - --relative --ignore-submodules
1442 - --tool="
1438 + __gitcomp_builtin difftool "$__git_diff_common_options
1439 + --base --cached --ours --theirs
1440 + --pickaxe-all --pickaxe-regex
1441 + --relative --staged
1442 + "
1443 return
1444 ;;
1445 esac