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
github_remote_list() not picking up GHE host #1897
Here is my remote (note no 'github' string is present in the hostname):
>gert::git_remote_list()
# A tibble: 1 × 2nameurl*<chr><chr>1originhttps://ghe-gsk-prod.metworx.com/account/reponame
I believe the source of the issue is in github_remote_list() which contains the lines:
parsed<- parse_github_remotes(set_names(x$url, x$name))
# TODO: generalize here for GHE hosts that don't include 'github'is_github<- grepl("github", parsed$host)
and since 'github' doesn't match anything in https://ghe-gsk-prod.metworx.com/account/reponame, this causes the issue above. The TODO comment indicates that the author was aware.
This was introduced in commit 43f6d2d and I'd be grateful if this useful function could be made to work on non 'github' matching GHE host names!
Yeah, basically I was waiting to see if anyone actually felt this pain. The simplest thing to do when introducing GHE support was to recognize such a host by looking for "github". I'm not entirely sure what I will do about this, but thanks for opening the issue. It's good to know that someone has banged their shins on this in real life.
In the meantime, have you considered renaming your GHE instance? 😜
OK thanks. I've opted to make my own little version without the is_github test. But hopefully there can be an easy solution to this in future, then I can get rid of my hack and... usethis
Merging #2098 is a step in the right direction, but it does not solve @tsahota's problem.
Discussion with @jameslairdsmith in #2098 reveals that there are 2 relevant GitHub Enterprise products:
GitHub Enterprise Cloud (which usethis should now play nicely with)
GitHub Enterprise Server (which remains unhandled)
The URLs for GHEC are very predictable and can therefore be handled as slight variations on what we do to recognize and process github.com URLs.
The URLs for GHES are not predictable and support will require the ability for the user to literally tell us exactly what their GHE hostname is. So this issue remains open.
Activity
jennybc commentedon Sep 22, 2023
Yeah, basically I was waiting to see if anyone actually felt this pain. The simplest thing to do when introducing GHE support was to recognize such a host by looking for "github". I'm not entirely sure what I will do about this, but thanks for opening the issue. It's good to know that someone has banged their shins on this in real life.
In the meantime, have you considered renaming your GHE instance? 😜
tsahota commentedon Sep 23, 2023
OK thanks. I've opted to make my own little version without the
is_githubtest. But hopefully there can be an easy solution to this in future, then I can get rid of my hack and... usethisjennybc commentedon Jul 29, 2025
Merging #2098 is a step in the right direction, but it does not solve @tsahota's problem.
Discussion with @jameslairdsmith in #2098 reveals that there are 2 relevant GitHub Enterprise products:
The URLs for GHEC are very predictable and can therefore be handled as slight variations on what we do to recognize and process github.com URLs.
The URLs for GHES are not predictable and support will require the ability for the user to literally tell us exactly what their GHE hostname is. So this issue remains open.