vscode-gitlens icon indicating copy to clipboard operation
vscode-gitlens copied to clipboard

External difftool command issue

Open jskccom opened this issue 1 year ago • 5 comments

Description

I have a git repository that has space characters in the folder path names. The Gitlens command that is executed when right-clicking and selecting "Open changes with -> open changes (difftool)" does not work for this scenario given that the path is not surrounded by quotation marks. I have confirmed that this is also not an accepted command when using Git Bash. When adding the single quotation marks to the path, the command then works.

Looking at the debug output in VS Code when selecting "Open changes with -> open changes (difftool)", it generates this command, which fails as Git does not like it. git difftool --no-prompt --tool=ACT 818bc5534985df0fc14c9c1dcd9d055e20b9ec02 c516fd579c1eaccffbb3d89c80eea949287de728 -- RapidPall/Program blocks/DeviceControlBlocks/Lift/LiftApp2.xml Instead I believe it should include single quotation marks around the path, like below. This command then works in both VS Code and Git Bash. git difftool --no-prompt --tool=ACT 818bc5534985df0fc14c9c1dcd9d055e20b9ec02 c516fd579c1eaccffbb3d89c80eea949287de728 -- 'RapidPall/Program blocks/DeviceControlBlocks/Lift/LiftApp2.xml'

GitLens Version

v2024.1.1304

VS Code Version

Version: 1.85.1 (user setup) Commit: 0ee08df0cf4527e40edc9aa28f4b5bd38bbff2b2 Date: 2023-12-13T09:49:37.021Z Electron: 25.9.7 ElectronBuildId: 25551756 Chromium: 114.0.5735.289 Node.js: 18.15.0 V8: 11.4.183.29-electron.0 OS: Windows_NT x64 10.0.19045

Git Version

git version 2.43.0.windows.1

Logs, Screenshots, Screen Captures, etc

image

jskccom avatar Jan 15 '24 03:01 jskccom

Hello @jskccom, testing a few difftools (Beyond Compare and Winmerge), I am not having an issue using GitLens to open changes (difftool) when there is a space in the path. You should be able to handle this with your .gitconfig - can you share what you have for your difftool?

jkelroy avatar Jan 23 '24 23:01 jkelroy

Hi @jkelroy, thanks for looking into this. The difftool is here https://support.industry.siemens.com/cs/document/109797235/simatic-automation-compare-tool-?dti=0&lc=en-DO, it supports comparison for IEC 61131-3 software languages. If you want any further information about it which you can't access then I can provide it. As you say, it could be an issue with the difftool itself, I can contact the developers of it to raise it as an issue if that turns out to be true. The thing is the external diff using this difftool works with Atlassian Sourcetree tool and Tortoise Git tool, but when I did some research before submitting this issue, I believe those 2 tools use 'libgit2' library for Git commands while VS Code & GitLens doesn't. VS Code & GitLens is the preferred tool though so I'm hoping I can get it working. I have tried working with the .gitconfig but to no avail, and only breaking the functionality working for Sourcetree and Tortoise Git. image

jskccom avatar Jan 24 '24 00:01 jskccom

@jskccom Can you try putting double (or single) quotes around $LOCAL and $REMOTE to see if it resolves the issue?

eamodio avatar Jan 31 '24 21:01 eamodio

Hi @eamodio , for the double quotes I get a syntax error in the debug output, and for the single quotes I get a "module not found" error.

See attached images.

image

image

jskccom avatar Feb 01 '24 04:02 jskccom

I have the same issue, with the same tool (ACTool.exe) but I believe the problem is with quoting the final pathname as described by @jskccom rather than the specific tool.

venzy avatar Jun 19 '24 05:06 venzy