gh-stack icon indicating copy to clipboard operation
gh-stack copied to clipboard

Remapping hostname prevents using `gh stack submit`

Open jeff-younker opened this issue 4 months ago • 2 comments

I use a synthetic hostname mapping in ~/.gitconfig (1) in conjunction with my .ssh/config (2) to select the SSH host key and user identity. In this case, the synthetic hostname is fastalyze.github.com. When I run gh stack submit this happens:

gh stack submit
Checking stack state...
✗ failed to create GitHub client: determining repository: unable to determine current repository, none of the git remotes configured for this repository point to a known GitHub host

I suspect there is a check for stacked PR support based on the hostname, and it's not recognizing fastalyze.github.com.

(1) ~/.gitconfig stanza:

[url "[email protected]:fastalyze/"]
    insteadOf = [email protected]:fastalyze/

[url "[email protected]:fastalyze/"]
        insteadOf = https://github.com/fastalyze/

(2) .ssh/config stanza:

host fastalyze.github.com
    Hostname github.com
    User "jeff-younker"
    IdentityFile ~/.ssh/id_fastalyze
    IdentityAgent none

jeff-younker avatar Jul 28 '26 10:07 jeff-younker

I opened an upstream fix in cli/go-gh#274. The root cause is in repository.Current: it translates SSH alias URLs, but continues filtering with cached repository metadata from before translation. The PR refreshes that metadata while preserving fetch/push precedence; it covers the same SSH hostname remapping path described here.

This will still need to merge and then be consumed by gh-stack before the issue is resolved.

benekuehn avatar Jul 30 '26 06:07 benekuehn

I am also suffering from this problem. The work around mentioned in #381 using the GH_REPO=.../... trick seems to also work here

jessie828 avatar Aug 07 '26 14:08 jessie828