mirror of
https://github.com/fish-shell/fish-shell
synced 2024-12-26 12:53:13 +00:00
Better git alias completion
Config entries that contained the word "alias" but were not in fact aliases no longer are treated as aliases.
This commit is contained in:
parent
b8181f9eb8
commit
e2be71cbe4
1 changed files with 5 additions and 1 deletions
|
@ -87,6 +87,10 @@ function __fish_git_complete_stashes
|
||||||
command git stash list --format=format:"%gd:%gs" | sed 's/:/\t/'
|
command git stash list --format=format:"%gd:%gs" | sed 's/:/\t/'
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function __fish_git_aliases
|
||||||
|
command git config --get-regexp '^alias\.' | sed -n "s/^alias\.\([^ ]*\).*/\1/p"
|
||||||
|
end
|
||||||
|
|
||||||
# general options
|
# general options
|
||||||
complete -f -c git -n 'not __fish_git_needs_command' -l help -d 'Display the manual of a git command'
|
complete -f -c git -n 'not __fish_git_needs_command' -l help -d 'Display the manual of a git command'
|
||||||
|
|
||||||
|
@ -387,4 +391,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'
|
complete -f -c git -n '__fish_git_needs_command' -a whatchanged -d 'Show logs with difference each commit introduces'
|
||||||
|
|
||||||
## Aliases (custom user-defined commands)
|
## Aliases (custom user-defined commands)
|
||||||
complete -c git -n '__fish_git_needs_command' -a '(command git config --get-regexp alias | sed "s/^alias\.\([^ ]*\).*/\1/")' -d 'Alias (user-defined command)'
|
complete -c git -n '__fish_git_needs_command' -a '(__fish_git_aliases)' -d 'Alias (user-defined command)'
|
||||||
|
|
Loading…
Reference in a new issue