auxves / vscode-syncify

A reliable way of syncing your VSCode settings and extensions
https://arnohovhannisyan.space/vscode-syncify
MIT License
15 stars 1 forks source link

[BUG] Switch Profiles results in Git error message #30

Closed dxman closed 4 years ago

dxman commented 4 years ago

Syncify Version

I am using Syncify v3.9.1

Describe the bug

When I attempt to switch Syncify profiles, I am presented with a Git-related error message (see screenshot). I'm pretty sure I've diagnosed the issue, so see below.

To Reproduce

Steps to reproduce the behavior:

  1. Started with "Syncer" setting set to "Repo", successfully uploaded my settings to the default profile.
  2. Created a second profile on a different Git branch.
  3. Open Command Palette and execute the "Syncify: Switch Profile" (resulted in a warning message, but I assumed that I did something incorrectly, and so unfortunately didn't capture the message contents.)
  4. Restarted VS Code (optional? I did it in response to the above warning.)
  5. Confirmed in my Syncify settings that the current profile switched to the new one, despite the above warning.
  6. Modified VS Code settings.
  7. Open Command Palette and execute the "Syncify: Upload" command (success)
  8. Open Command Palette and execute the "Syncify: Switch Profile" command (results in the error in the screenshot below)

Expected behavior

Switch Profile succeeds.

Screenshots

syncify-error

Additional context

(Windows 10, VS Code v1.41.0, Git v2.20.1)

I believe that this is caused by the version of Git that I have installed. Based on a quick Google search, it appears that the "git switch" command was added in v2.23, but my machine is running v2.20.1. At the time of writing, the latest version is v2.24.1.

There appear to be two options to fix: either simply document that the extension requires a certain version of Git, or update the extension to use backward-compatible Git commands.

Unfortunately, I am unable to upgrade Git on this particular machine, but I will test on a different machine and provide an update when I get a chance.

auxves commented 4 years ago

@dxman Can you try reproducing it with this version? VSIX.

dxman commented 4 years ago

Sure thing.

After installing the VSIX, I ran the "Switch Profile" command, the status bar showed the "Downloading..." message, and it appears to have completed with no errors. I immediately opened my settings.json file, but there did not appear to be any changes, so I checked the "Last Modified" timestamp in Windows Explorer. It still showed yesterday's date.

I then restarted VS Code and attempted to switch back to my original profile. At that point, I got the following error message: syncify-error-2

Just let me know if there's any other useful info I can provide.

auxves commented 4 years ago

@dxman I just published v3.9.3, which should fix this problem by using checkout instead of switch on old git versions. We can keep this issue open for a bit to make sure that the fix works on your machine.

dxman commented 4 years ago

Apologies for going silent; was away for the holidays. Confirmed that the latest version is working for me.