completions/git: show url as description for remote completion

This commit is contained in:
kpbaks
2025-04-13 14:28:08 +02:00
parent 692b53ab85
commit 54971621de
2 changed files with 4 additions and 1 deletions

View File

@@ -62,6 +62,7 @@ New or improved bindings
Completions
^^^^^^^^^^^
- ``git`` completions now show the remote url as a description when completing remotes.
Improved terminal support
^^^^^^^^^^^^^^^^^^^^^^^^^

View File

@@ -96,7 +96,9 @@ function __fish_git_refs
end
function __fish_git_remotes
__fish_git remote 2>/dev/null
# Example of output parsed:
# "remote.upstream.url git@github.com:fish-shell/fish-shell.git" -> "upstream\tgit@github.com:fish-shell/fish-shell.git"
__fish_git config --get-regexp 'remote\.[a-z]+\.url' | string replace -rf 'remote\.(.*)\.url (.*)' '$1\t$2'
end
function __fish_git_files