Skip to content

Commit 38ee42c

Browse files
authored
feat: show remote url as description when completing git remotes (#1168)
Makes it easier to tell where a remote points to
1 parent 2bccba6 commit 38ee42c

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

custom-completions/git/git-completions.nu

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,9 @@ def "nu-complete git available upstream" [] {
102102
}
103103

104104
def "nu-complete git remotes" [] {
105-
^git remote | lines | each { |line| $line | str trim }
105+
^git remote --verbose
106+
| parse --regex '(?<value>\S+)\s+(?<description>\S+)'
107+
| uniq-by value # Deduplicate where fetch and push remotes are the same
106108
}
107109

108110
def "nu-complete git log" [] {

0 commit comments

Comments
 (0)