Vscode-pull-request-github: Unable to create a GitHub permalink for the selection. Check that your local branch is tracking a remote branch.

Created on 9 May 2020  路  7Comments  路  Source: microsoft/vscode-pull-request-github

  • Extension version: 0.16.0
  • VSCode Version: 1.45.0
  • OS: macOS 10.15.4

Steps to Reproduce:

  1. CMD+Shift+P enter "Copy GitHub Permalink"
  2. Then you should get

Unable to create a GitHub permalink for the selection. Check that your local branch is tracking a remote branch.

image

The integration with pull requests and issues is working fine. But I can no longer copy the permalink.

Most helpful comment

Thanks @lerebear, this sounds like a duplicate of https://github.com/microsoft/vscode-pull-request-github/issues/1878. You're right that the problem is the .git suffix, there's currently a PR out to fix this issue.

All 7 comments

Can you share the output of git remote -v? Do you have the setting githubPullRequests.remotes configured?

Hi @alexr00

Can you share the output of git remote -v?

origin  [email protected]:org/repo.git (fetch)
origin  [email protected]:org/repo.git (push)

githubPullRequests.remotes configured?

I do not. The only reference for githubPullRequests I found was this 馃憞

    "githubPullRequests.queries": [

        {
            "label": "Waiting For My Review",
            "query": "is:open review-requested:${user}"
        },
        {
            "label": "Assigned To Me",
            "query": "is:open assignee:${user}"
        },
        {
            "label": "Created By Me",
            "query": "is:open author:${user}"
        }
    ]

I couldn't reproduce the error today. It was happening consistently since I posted the issue.

Please ping this issue if you see it again and I will reopen.

@alexr00 it is happening again 馃憞

image

image

git remote -v
origin  [email protected]:org/private-repo.git (fetch)
origin  [email protected]:org/private-repo.git (push)

@phstc I added some better error messages to track this down in version 0.17.0, which was released in the last day. Can you update the extension and see if there's a different error message?

I'm seeing this problem also, and the error message I'm receiving reads as follows:

Unable to create a GitHub permalink for the selection. Can't get the owner and repository from the git remote url.

Unfortunately I'm working in a private repository, so I'd rather not share the true output of git remote -v, but the remote appears to be set correctly and it's of the form https://github.com/<org>/<repo> (fetch).

I looked for the error message in this repository and from there found this line:

https://github.com/microsoft/vscode-pull-request-github/blob/8fd98be135221723cdca78fae52440a38fb44560/src/issues/util.ts#L360

Comparing that with the form of my git remote, it appears that this might be caused by the \.git$ suffix at the end of that regular expression (my remote does not end in ".git"). I'm not sure why my remote doesn't end in that suffix, but might it be viable to make it optional? Looks like the function will produce the right result without it.

Thanks @lerebear, this sounds like a duplicate of https://github.com/microsoft/vscode-pull-request-github/issues/1878. You're right that the problem is the .git suffix, there's currently a PR out to fix this issue.

Was this page helpful?
0 / 5 - 0 ratings