From b0132821acb8df3c5d55b3be5dbdd1ec0c5ac7d4 Mon Sep 17 00:00:00 2001 From: ridiculousfish Date: Sun, 14 Apr 2013 00:46:40 -0700 Subject: [PATCH] Use 'command git' instead of git to defeat certain git aliases https://github.com/fish-shell/fish-shell/pull/622 --- share/completions/git.fish | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/share/completions/git.fish b/share/completions/git.fish index 4bb51961d..78cba49e5 100644 --- a/share/completions/git.fish +++ b/share/completions/git.fish @@ -1,11 +1,12 @@ # fish completion for git +# Use 'command git' to avoid interactions for aliases from git to (e.g.) hub function __fish_git_branches - git branch --no-color -a ^/dev/null | grep -v ' -> ' | sed -e 's/^..//' -e 's/^remotes\///' + command git branch --no-color -a ^/dev/null | grep -v ' -> ' | sed -e 's/^..//' -e 's/^remotes\///' end function __fish_git_tags - git tag + command git tag end function __fish_git_heads @@ -14,7 +15,7 @@ function __fish_git_heads end function __fish_git_remotes - git remote + command git remote end function __fish_git_ranges @@ -48,7 +49,7 @@ function __fish_git_using_command end # aliased command - set -l aliased (git config --get "alias.$cmd[2]" | sed 's/ .*$//') + set -l aliased (command git config --get "alias.$cmd[2]" | sed 's/ .*$//') if [ $argv[1] = "$aliased" ] return 0 end @@ -266,4 +267,4 @@ complete -f -c git -n '__fish_git_using_command submodule' -a 'sync' -d 'Sync su complete -f -c git -n '__fish_git_needs_command' -a whatchanged -d 'Show logs with difference each commit introduces' ## Aliases (custom user-defined commands) -complete -c git -n '__fish_git_needs_command' -a '(git config --get-regexp alias | sed "s/^alias\.\([^ ]*\).*/\1/")' -d 'Alias (user-defined command)' +complete -c git -n '__fish_git_needs_command' -a '(command git config --get-regexp alias | sed "s/^alias\.\([^ ]*\).*/\1/")' -d 'Alias (user-defined command)'