From 807c5f2ef224ea2fb6e2866f4a7f531b78703d43 Mon Sep 17 00:00:00 2001 From: ridiculousfish Date: Fri, 26 Apr 2013 21:42:31 -0700 Subject: [PATCH] Squashed commit of the following: commit 839e9c2ec00fcd72b19f1d415bee26af7f51f8aa Author: lledey Date: Tue Apr 23 13:28:23 2013 +0200 Fix git branch completion if grep output is not the default one Signed-off-by: lledey commit 7798ed05744636f67d177bcb47d48d6aeca12787 Author: lledey Date: Tue Apr 23 10:35:35 2013 +0200 Fix git branch completion if grep output is not the default one Signed-off-by: lledey --- share/completions/git.fish | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/share/completions/git.fish b/share/completions/git.fish index 78cba49e5..0df7d2c93 100644 --- a/share/completions/git.fish +++ b/share/completions/git.fish @@ -2,7 +2,7 @@ # Use 'command git' to avoid interactions for aliases from git to (e.g.) hub function __fish_git_branches - command git branch --no-color -a ^/dev/null | grep -v ' -> ' | sed -e 's/^..//' -e 's/^remotes\///' + command git branch --no-color -a ^/dev/null | sgrep -v ' -> ' | sed -e 's/^..//' -e 's/^remotes\///' end function __fish_git_tags @@ -24,10 +24,10 @@ function __fish_git_ranges __fish_git_branches return 0 end - + set -l to (commandline -ot | perl -ne 'if (index($_, "..") > 0) { my @parts = split(/\.\./); print $parts[1]; }') - for from_ref in (__fish_git_heads | grep -e "$from") - for to_ref in (__fish_git_heads | grep -e "$to") + for from_ref in (__fish_git_heads | sgrep -e "$from") + for to_ref in (__fish_git_heads | sgrep -e "$to") printf "%s..%s\n" $from_ref $to_ref end end @@ -236,7 +236,7 @@ complete -f -c git -n '__fish_git_using_command status' -l ignore-submodules -x ### tag complete -f -c git -n '__fish_git_needs_command' -a tag -d 'Create, list, delete or verify a tag object signed with GPG' -complete -f -c git -n '__fish_git_using_command tag; and __fish_not_contain_opt -s d; and __fish_not_contain_opt -s v; and test (count (commandline -opc | grep -v -e \'^-\')) -eq 3' -a '(__fish_git_branches)' -d 'Branch' +complete -f -c git -n '__fish_git_using_command tag; and __fish_not_contain_opt -s d; and __fish_not_contain_opt -s v; and test (count (commandline -opc | sgrep -v -e \'^-\')) -eq 3' -a '(__fish_git_branches)' -d 'Branch' complete -f -c git -n '__fish_git_using_command tag' -s d -d 'Remove a tag' complete -f -c git -n '__fish_git_using_command tag' -s v -d 'Verify signature of a tag' complete -f -c git -n '__fish_git_using_command tag' -s f -d 'Force overwriting exising tag'