Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a "remote_priority" configuration option #103

Open
ahal opened this issue Feb 29, 2024 · 1 comment
Open

Add a "remote_priority" configuration option #103

ahal opened this issue Feb 29, 2024 · 1 comment
Assignees
Labels
enhancement New feature or request

Comments

@ahal
Copy link

ahal commented Feb 29, 2024

Is your feature request related to a problem? Please describe.
I tend to point the origin remote at my personal forks, then create an upstream remote to point at the canonical repo. I'd like a way to be able to use the upstream remote if it exists, but fallback to origin if it doesn't.

Describe the solution you'd like
A new configuration called remote_priority could be used. This would be an array that specifies the remotes in order of preference they should be used. E.g:

remote_priority = {"upstream", "origin"}

This would default to an empty array. When determining the user specified remote to use, we'd first iterate over all remotes in this list and return the first one that exists. If no remotes exist (or the array is empty), we'd use opt.remote as usual.

Additional context
I may be willing to work on this feature if it's something you'd accept.

@ahal ahal added the enhancement New feature or request label Feb 29, 2024
@linrongbin16
Copy link

hi @ahal , selection in multiple remote upstreams is supported in: https://github.com/linrongbin16/gitlinker.nvim.

Also see: #91 .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants