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

Git checkout pull request error - fatal: Invalid symmetric difference expression #5888

Open
adammw opened this issue Apr 4, 2024 · 1 comment
Assignees
Labels
info-needed Issue requires more information from poster

Comments

@adammw
Copy link

adammw commented Apr 4, 2024

Previously reported in #2831 but closed without reproduction steps.

  • Extension version: v0.83.2024030509 (pre-release)
    VSCode Version: 1.87.2 (Universal)
    Commit: 863d2581ecda6849923a2118d93a088b0745d9d6
    Date: 2024-03-08T15:21:31.043Z
    Electron: 27.3.2
    ElectronBuildId: 26836302
    Chromium: 118.0.5993.159
    Node.js: 18.17.1
    V8: 11.8.172.18-electron.0
    OS: Darwin x64 23.4.0
  • Repository Clone Configuration (single repository/fork of an upstream repository):
  • Github Product (Github.com/Github Enterprise version x.x.x): Github.com

In logs, after checking out a pull request without the latest master branch being updated locally, this error occurs and some diffs fail to display correctly..

2024-04-04 13:14:26.295 [error] Failed to parse patch for outdated comments: Failed to execute git {
  "exitCode": 128,
  "gitCommand": "diff",
  "stdout": "",
  "stderr": "fatal: Invalid symmetric difference expression 33e91028cd47d4770f2044144cf187c990c87f9a...6f50700e45acbc4fad052f03b2809432070dac38\n"
}

Steps to Reproduce:

  1. Clone a repo, open with VSCode with extension enabled
  2. Make changes to master branch on a separate remote checkout (ie not in the same local directory/computer)
  3. Make a PR to that repo
  4. With the original clone, open the pull request in the extension and right-click "Checkout Pull Request"
  5. Notice this error occurs due to the local repo not having the up-to-date master branch commit.

Error can be resolved with a simple git fetch origin to fetch the new master commit object. The extension should do this as required.

@alexr00 alexr00 self-assigned this Apr 5, 2024
@alexr00
Copy link
Member

alexr00 commented Apr 5, 2024

@adammw thanks for the detailed steps! I'm still not able to repro. There are several setting that impact whether branches are fetched and pulled. Can you share you VS Code settings?

@alexr00 alexr00 added the info-needed Issue requires more information from poster label Apr 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
info-needed Issue requires more information from poster
Projects
None yet
Development

No branches or pull requests

2 participants