Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed to execute git thrown when attempting to view PR Description in "GitHub" tab #5744

Closed
jheinem1 opened this issue Feb 11, 2024 · 10 comments · Fixed by #5832
Closed

Failed to execute git thrown when attempting to view PR Description in "GitHub" tab #5744

jheinem1 opened this issue Feb 11, 2024 · 10 comments · Fixed by #5832
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug candidate Issue identified as probable candidate for fixing in the next release verified Verification succeeded

Comments

@jheinem1
Copy link

jheinem1 commented Feb 11, 2024

Failed to execute git is thrown when clicking on the "Description" button under pull requests.

image

image

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:

  1. Click on the "Description" button under a pull request under the "GitHub" tab on the left.
@jheinem1
Copy link
Author

jheinem1 commented Feb 11, 2024

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)

image

I wasn't prompted to sign in through the account icon or when attempting to access the PR description from the GitHub tab though.

@ramunas-k
Copy link

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

@alexr00
Copy link
Member

alexr00 commented Mar 7, 2024

Next time someone sees this, can you please share the output from the Output view for "git"?

@alexr00 alexr00 added the info-needed Issue requires more information from poster label Mar 7, 2024
@alexr00 alexr00 removed this from the March 2024 milestone Mar 7, 2024
@makeitraina
Copy link

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
Screenshot 2024-03-07 at 11 17 09 AM

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
Screenshot 2024-03-07 at 11 17 53 AM

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]

@ramunas-k
Copy link

@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 alexr00 added bug Issue identified by VS Code Team member as probable bug and removed info-needed Issue requires more information from poster labels Mar 14, 2024
@alexr00 alexr00 added this to the March 2024 milestone Mar 14, 2024
alexr00 added a commit that referenced this issue Mar 14, 2024
alexr00 added a commit that referenced this issue Mar 14, 2024
@ramunas-k
Copy link

@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

@GeigerJ2
Copy link

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.

@alexr00 alexr00 added the candidate Issue identified as probable candidate for fixing in the next release label Mar 20, 2024
@alexr00
Copy link
Member

alexr00 commented Mar 20, 2024

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

@alexr00
Copy link
Member

alexr00 commented Mar 20, 2024

Fix is available in version 0.82.1.

@police999a
Copy link

#5863

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue identified by VS Code Team member as probable bug candidate Issue identified as probable candidate for fixing in the next release verified Verification succeeded
Projects
None yet
6 participants