vscode-pull-request-github
vscode-pull-request-github copied to clipboard
`Failed to execute git` thrown when attempting to view PR Description in "GitHub" tab
Failed to execute git
is thrown when clicking on the "Description" button under pull requests.
There doesn't appear to be any errors thrown in the extension's output, but it occurs when clicking on the "Description" button under the pull request. Opening the pull request under the "GitHub Pull Request" tab instead of the "GitHub" tab does fetch the information correctly.
I found #5668 and #5743 to be somewhat similar to this issue, however that error seems to occur in "write" operations, whereas this fails to fetch information from GitHub.
- Extension version: v0.80.0
- VSCode Version: 1.86.0 (tested and still not working in 1.86.1)
- OS: Nobara Linux 39 (KDE Plasma) x86_64
- Repository Clone Configuration (single repository/fork of an upstream repository): single repository
- Github Product (Github.com/Github Enterprise version x.x.x): Github.com
Steps to Reproduce:
- Click on the "Description" button under a pull request under the "GitHub" tab on the left.
It seems that this only occurs when I'm not fully signed in- I was prompted in the pull request screen to "Sign In for Additional Permissions", which seemed to resolve the issue (I had to click the arrow to check out the PR and click on the PR name to view the details)
I wasn't prompted to sign in through the account icon or when attempting to access the PR description from the GitHub tab though.
What helped me was executing git fetch
before opening the description. I do not have actual logs at hand but git
is not happy about not having local branch PR is created from
Next time someone sees this, can you please share the output from the Output view for "git"?
Next time someone sees this, can you please share the output from the Output view for "git"?
Same thing happens for me. Here is the output from both github pull request and git
github pull request
2024-03-07 11:16:59.153 [info] FolderRepositoryManager+0> Found GitHub repo for pr #711: yes
2024-03-07 11:16:59.850 [info] FolderRepositoryManager+0> Found GitHub pr repo for pr #711: yes
2024-03-07 11:16:59.850 [info] GitHubRepository> Fetch branch release - enter
2024-03-07 11:17:00.049 [info] GitHubRepository> Fetch branch release - done: true
git
2024-03-07 11:16:56.963 [info] > git check-ignore -v -z --stdin [26ms]
2024-03-07 11:16:59.273 [info] > git log --format=%H%n%aN%n%aE%n%at%n%ct%n%P%n%D%n%B -z origin/krupalinakrani/web-675-implement-new-navbar-and-dropdowns..origin/release [122ms]
2024-03-07 11:16:59.273 [info] fatal: ambiguous argument 'origin/krupalinakrani/web-675-implement-new-navbar-and-dropdowns..origin/release': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'
2024-03-07 11:16:59.273 [info] > git config --local -l [124ms]
@alexr00 I can confirm that these are the same outputs form "Git" and "Github Pull Requests" after clicking on PR description.
@makeitraina thanks for posting
@alexr00
Today my extension got updated to v0.82.0
. For me the issue still persists with the same symptoms observed in Git output
[info] > git log --format=%H%n%aN%n%aE%n%at%n%ct%n%P%n%D%n%B -z origin/branch1..origin/develop [65ms]
[info] fatal: ambiguous argument 'origin/branch1..origin/develop': unknown revision or path not in the working tree.
[info] > git config --local -l [77ms]
[info] > git config --local branch.branch1 [1ms]
[warning] git config failed: Failed to execute git
(real branch name is changed to branch1
in logs above)
VSCode is configured not to sync repository automatically. Could this be an issue?
// settings.json
"git.autofetch": false,
When I do git fetch
in terminal everything works fine then
If your PR did not make it to newest extension version just ignore my post
Thanks
Just putting this out there in case someone ends up in a similar situation, and it could be helpful: I had the same issue, but running plain git fetch
did not resolve it as the git log
command that was run by the extension was actually referencing upstream/main
, i.e.:
git log --format=%H%n%aN%n%aE%n%at%n%ct%n%P%n%D%n%B -z <remote_pr_branch>..upstream/main
However, in my .git/config
, the remote "origin" was pointing to my own fork, and not the "upstream" repo that the PR was actually created on, while remote "upstream" was actually not defined. So yeah, a bit of a messed up setup, but long story short, running git fetch upstream
solved the problem.
To verify:
- Make sure you don't have the git extension configured to automatically fetch
- Have a GitHub repo clone that has not fetched in a while
- Open that folder in GitHub
- Expand one of the most recent PRs, specifically one who's branch you haven't fetched.
- Verify you don't get the error
Fix is available in version 0.82.1.
#5863