shumphrey / fugitive-gitlab.vim

A vim extension to fugitive.vim for GitLab support
MIT License
267 stars 21 forks source link

Support non-origin remotes for commit omnicompletion #19

Open mcepl opened 6 years ago

mcepl commented 6 years ago

I have managed in the end to make omnicompletion to work. I have added g:gitlab_api_keys variable:

let g:fugitive_gitlab_domains = [
    \ 'https://gitlab.com',
    \ 'https://gitlab.internal.site.com'
    \ ]

let g:gitlab_api_keys = {'gitlab.com': 'somethingverysecret'}

Then I had to discover that appropriate remote for git must be origin (that's a pity, I usually use upstream as a name of my remote; but I can survive).

shumphrey commented 6 years ago

Regarding the documentation, I'm not sure what else I could add, those settings are listed in the README and the vim doc, certainly open to suggestions.

Regarding the origin remote, I completely agree. Its a real shame that it requires origin. I spent some time trying to work out a way of using different remotes, but its quite complicated. vim-rhubarb requires origin for the omnicompletion remote also. There are several issues with the remote calculation, including what should happen when a git repo has a remote for github and gitlab (which is something I have) or gitlab.com and private gitlab. I do intend to revisit this problem in the future.

mcepl commented 6 years ago

You are right about everything else. Could we get at least some variable like g:gitlab_upstreams (dict with names of upstream defaulting to origin)?