From 012773436e5683078dbb8d07706b3e2180ec8a21 Mon Sep 17 00:00:00 2001 From: Collin Styles Date: Fri, 13 Dec 2019 12:27:22 -0800 Subject: [PATCH] Suggest unique remote branches for git-switch From the `git-switch` documentation: If is not found but there does exist a tracking branch in exactly one remote (call it ) with a matching name, treat as equivalent to $ git switch -c --track / --- share/completions/git.fish | 1 + 1 file changed, 1 insertion(+) diff --git a/share/completions/git.fish b/share/completions/git.fish index e6f481239..83586f6a1 100644 --- a/share/completions/git.fish +++ b/share/completions/git.fish @@ -1534,6 +1534,7 @@ complete -f -c git -n '__fish_git_using_command restore; and __fish_contains_opt # switch options complete -f -c git -n '__fish_git_needs_command' -a switch -d 'Switch to a branch' complete -k -f -c git -n '__fish_git_using_command switch' -a '(__fish_git_branches)' +complete -k -f -c git -n '__fish_git_using_command switch' -a '(__fish_git_unique_remote_branches)' -d 'Unique Remote Branch' complete -f -c git -n '__fish_git_using_command switch' -r -s c -l create -d 'Create a new branch' complete -f -c git -n '__fish_git_using_command switch' -r -s C -l force-create -d 'Force create a new branch' complete -f -c git -n '__fish_git_using_command switch' -s d -l detach -d 'Switch to a commit for inspection and discardable experiment'