mirror of
https://github.com/fish-shell/fish-shell
synced 2024-12-26 04:43:10 +00:00
[git completions] Minor cleanup
This commit is contained in:
parent
bc976a913c
commit
4057cfdce5
1 changed files with 28 additions and 33 deletions
|
@ -171,7 +171,7 @@ function __fish_git_ranges
|
||||||
return 0
|
return 0
|
||||||
end
|
end
|
||||||
|
|
||||||
set -l to (set -q both[2]; and echo $both[2])
|
set -l to $both[2]
|
||||||
# Remove description from the from-ref, not the to-ref.
|
# Remove description from the from-ref, not the to-ref.
|
||||||
for from_ref in (__fish_git_refs | string match "$from" | string replace -r \t'.*$' '')
|
for from_ref in (__fish_git_refs | string match "$from" | string replace -r \t'.*$' '')
|
||||||
for to_ref in (__fish_git_refs | string match "*$to*") # if $to is empty, this correctly matches everything
|
for to_ref in (__fish_git_refs | string match "*$to*") # if $to is empty, this correctly matches everything
|
||||||
|
@ -182,10 +182,8 @@ end
|
||||||
|
|
||||||
function __fish_git_needs_command
|
function __fish_git_needs_command
|
||||||
set cmd (commandline -opc)
|
set cmd (commandline -opc)
|
||||||
if [ (count $cmd) -eq 1 ]
|
|
||||||
return 0
|
|
||||||
else
|
|
||||||
set -l skip_next 1
|
set -l skip_next 1
|
||||||
|
set -q cmd[2]; or return 0
|
||||||
# Skip first word because it's "git" or a wrapper
|
# Skip first word because it's "git" or a wrapper
|
||||||
for c in $cmd[2..-1]
|
for c in $cmd[2..-1]
|
||||||
test $skip_next -eq 0
|
test $skip_next -eq 0
|
||||||
|
@ -212,8 +210,6 @@ function __fish_git_needs_command
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
return 0
|
return 0
|
||||||
end
|
|
||||||
return 1
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
@ -906,8 +902,7 @@ complete -f -c git -n '__fish_git_using_command tag' -s v -l verify -d 'Verify s
|
||||||
complete -f -c git -n '__fish_git_using_command tag' -s f -l force -d 'Force overwriting exising tag'
|
complete -f -c git -n '__fish_git_using_command tag' -s f -l force -d 'Force overwriting exising tag'
|
||||||
complete -f -c git -n '__fish_git_using_command tag' -s l -l list -d 'List tags'
|
complete -f -c git -n '__fish_git_using_command tag' -s l -l list -d 'List tags'
|
||||||
complete -f -c git -n '__fish_git_using_command tag' -l contains -xa '(__fish_git_commits)' -d 'List tags that contain a commit'
|
complete -f -c git -n '__fish_git_using_command tag' -l contains -xa '(__fish_git_commits)' -d 'List tags that contain a commit'
|
||||||
complete -f -c git -n '__fish_git_using_command tag; and __fish_contains_opt -s d' -a '(__fish_git_tags)' -d 'Tag'
|
complete -f -c git -n '__fish_git_using_command tag; and __fish_contains_opt -s d delete -s v verify' -a '(__fish_git_tags)' -d 'Tag'
|
||||||
complete -f -c git -n '__fish_git_using_command tag; and __fish_contains_opt -s v' -a '(__fish_git_tags)' -d 'Tag'
|
|
||||||
# TODO options
|
# TODO options
|
||||||
|
|
||||||
### stash
|
### stash
|
||||||
|
|
Loading…
Reference in a new issue