You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Allow configured Git remotes to be used for the '-R' argument #1481
In a setting where the upstream repo is on github.com and you also have a mirror on a GitHub Enterprise Server, this feature would save even more typing.
My current workaround is to define a git alias url = remote get-url. Then, instead of
I'm interested in this feature, too. It would be nice to be able to run a one-off like gh pr list -R upstream when upstream is a different remote than what's configured via gh repo set-default.
One thing that probably needs to be decided is how it should handle a remote name that happens to match the :owner/:repo pattern - i.e. given a configuration like:
Should -R forks/someone use the configured remote (github.com/someone/repository), or should that always attempt to use the github.com repository that matches (github.com/forks/someone in that example)? I tend to prefer the behavior of always favoring a configured remote, but I'm not sure if the maintainers would want any :owner/:repo parameter to assume github.com (as it currently does)
@andyfeller@williammartin Curious if you have thoughts on this (and if you're supportive of the feature in general, or if you'd be against such a contribution)?
Should -R forks/someone use the configured remote (github.com/someone/repository), or should that always attempt to use the github.com repository that matches (github.com/forks/someone in that example)? I tend to prefer the behavior of always favoring a configured remote, but I'm not sure if the maintainers would want any :owner/:repo parameter to assume github.com (as it currently does)
@andyfeller@williammartin Curious if you have thoughts on this (and if you're supportive of the feature in general, or if you'd be against such a contribution)?
Apologies for letting this hide in the backlog of notifications 😓
If we had this support, I'd assume we first check the remotes before falling back on an actual remote GitHub repository. There are fewer remotes and should be fairly easy. The main challenge is that remote names allow characters and formats that look closely like a GitHub name with owner.
All of that said, I think the biggest challenge is the scope of a change like this as 1) it affects a lot of commands and 2) it cuts across various layers. For example, the code below powers the -R, --repo logic across multiple commands, which would need to determine if the provided repo matches the remotes before falling back to a GitHub repo.
Activity
phil-blain commentedon Aug 3, 2020
See also : #317
choeppler commentedon Jun 21, 2024
In a setting where the upstream repo is on github.com and you also have a mirror on a GitHub Enterprise Server, this feature would save even more typing.
My current workaround is to define a git alias
url = remote get-url. Then, instead ofI can
Still, the possibility to specify a remote directly, would make life even easier 😄
Ariel096 commentedon Jun 21, 2024
rmacklin commentedon Jul 24, 2024
I'm interested in this feature, too. It would be nice to be able to run a one-off like
gh pr list -R upstreamwhenupstreamis a different remote than what's configured viagh repo set-default.One thing that probably needs to be decided is how it should handle a remote name that happens to match the
:owner/:repopattern - i.e. given a configuration like:Should
-R forks/someoneuse the configured remote (github.com/someone/repository), or should that always attempt to use the github.com repository that matches (github.com/forks/someonein that example)? I tend to prefer the behavior of always favoring a configured remote, but I'm not sure if the maintainers would want any:owner/:repoparameter to assume github.com (as it currently does)@andyfeller @williammartin Curious if you have thoughts on this (and if you're supportive of the feature in general, or if you'd be against such a contribution)?
andyfeller commentedon Sep 18, 2024
Apologies for letting this hide in the backlog of notifications 😓
If we had this support, I'd assume we first check the remotes before falling back on an actual remote GitHub repository. There are fewer remotes and should be fairly easy. The main challenge is that remote names allow characters and formats that look closely like a GitHub name with owner.
All of that said, I think the biggest challenge is the scope of a change like this as 1) it affects a lot of commands and 2) it cuts across various layers. For example, the code below powers the
-R, --repologic across multiple commands, which would need to determine if the provided repo matches the remotes before falling back to a GitHub repo.cli/pkg/cmdutil/repo_override.go
Lines 22 to 70 in 71b2aea