Closed jearbear closed 4 years ago
Oh I realized the first solution isn't too hard. Does something like this seem reasonable?
diff --git a/autoload/gina/command/browse.vim b/autoload/gina/command/browse.vim
index 78e9de8..d713922 100644
--- a/autoload/gina/command/browse.vim
+++ b/autoload/gina/command/browse.vim
@@ -141,7 +141,11 @@ function! s:get_remote_url(git, commit1, commit2) abort
endif
endfor
let remote_name = empty(remote_name) ? 'origin' : remote_name
- return get(config, printf('remote.%s.url', remote_name), '')
+ let result = gina#process#call(a:git, ['remote', 'get-url', remote_name])
+ if result.status
+ throw gina#process#errormsg(result)
+ endif
+ return result.content[0]
endfunction
function! s:build_base_url(remote_url, scheme) abort
It seems reasonable. Please send a PR 👍
Closed by #250
I have this in my
.gitconfig
:The current method of fetching the remote url seems to rely on
git config
and effectively doesgit config remote.origin.url
, but this will provide the url withgh:...
which doesn't work withGina browse
, giving me this error:I see two ways of fixing this:
get_remote_url
function to make a call out togit remote get-url origin
which will return the fully resolved path. A similar approach was done for vim-fugitive: https://github.com/tpope/vim-fugitive/pull/874, though I'm not sure how involved it'll be for gina.vim.git
, perform some internal translation based on ifinsteadOf
is present in the config. I imagine this is way more work than it's worth.