From ff72e3f1543618095ffa03799a93b04f9f868a60 Mon Sep 17 00:00:00 2001 From: Johannes Altmanninger Date: Sat, 2 Apr 2022 12:24:38 +0200 Subject: [PATCH] completions/git: speed up loading git.fish when "git-foo" completions already exists git.fish loads git-foo.fish completions. As reported in #8831, this can be slow when the user has run something like complete git-foo -w 'git diff' because git.fish runs 'complete -C "git-autofixup "' at load time. Commit 09161761c (Complete custom "git-foo" commands from "git foo", 2021-01-24) did that to avoid adding filename completions for "git foo". Drop that check. This means that users who don't want filename completion for "git foo", need to define at least one custom completion for "git-foo", like complete git-foo -f --- share/completions/git.fish | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/share/completions/git.fish b/share/completions/git.fish index 4d1b33e4a..68bf3c0e5 100644 --- a/share/completions/git.fish +++ b/share/completions/git.fish @@ -2185,9 +2185,6 @@ for file in $PATH/git-* contains -- $subcommand $__fish_git_custom_commands_completion and continue - complete -C "git-$subcommand " >/dev/null - if test (complete -c git-$subcommand | count) -gt 0 - complete -c git -f -n "__fish_git_using_command $subcommand" -a "(__fish_git_complete_custom_command $subcommand)" - end + complete -c git -f -n "__fish_git_using_command $subcommand" -a "(__fish_git_complete_custom_command $subcommand)" set -a __fish_git_custom_commands_completion $subcommand end