Skip to content

Commit

Permalink
Squashed commit of the following:
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
ridiculousfish committed Apr 27, 2013
1 parent f770895 commit 807c5f2
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions share/completions/git.fish
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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'
Expand Down

0 comments on commit 807c5f2

Please sign in to comment.