aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar ridiculousfish <corydoras@ridiculousfish.com>2013-04-26 21:42:31 -0700
committerGravatar ridiculousfish <corydoras@ridiculousfish.com>2013-04-26 21:42:31 -0700
commit807c5f2ef224ea2fb6e2866f4a7f531b78703d43 (patch)
tree389d4d961afb0c1666162a5a3be24c65f8950099
parentf7708955b61fe09351bf8b75d0e64b9faeac34a2 (diff)
Squashed commit of the following:
commit 839e9c2ec00fcd72b19f1d415bee26af7f51f8aa Author: lledey <lledey@gmail.com> 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 <lledey@gmail.com> commit 7798ed05744636f67d177bcb47d48d6aeca12787 Author: lledey <lledey@gmail.com> 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 <lledey@gmail.com>
-rw-r--r--share/completions/git.fish10
1 files changed, 5 insertions, 5 deletions
diff --git a/share/completions/git.fish b/share/completions/git.fish
index 78cba49e..0df7d2c9 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'