Search code examples
beyondcomparebeyondcompare4

Using Beyond Compare with remote linux server -- open changeset in single session


I have an environment where I work on a Windows PC, where my workspace is on a remote linux server, which I can ssh to. I am working on a Dos Batch file to automatically compare all modified files in my workspace. So far I have something that will open all the files, but for some reason, it opens each file in a separate session, and it's a pain switching between windows. I'm wondering if there are any tricks to open all files in the same session with different tabs. Currently, my script looks like:

plink ott-ads -l %user% -i %ppk_file% ^
  "cd %root%; for f in %files%; do git show %commitid%:$f > $f.gitupstream; done; echo $files | tr ' ' '\n' | dospath > files.dos.gitupstream;"

for /F "tokens=*" %%A in (%dosroot%\files.dos.gitupstream) do echo "C:\Program Files\Beyond Compare 4\BCompare.exe %%A.gitupstream %%A" & START /B "C:\Program Files\Beyond Compare 4\BCompare.exe" %%A.gitupstream %%A

(where %files% is a prepopulated list of files to compare, and %commitid% is the commit I want to compare against, and dospath is a simple script that translates a linux path into a dos one)

This link seems to suggest using a script to 'synchronize with BC4', but it doesn't suggest how to do this. Any ideas would be welcome. (Note: using "beyond compare 4" and windows 10)


Solution

  • There are 3 ways to solve this:

    1. If the git repository is on your Windows machine, configure Beyond Compare as an external difftool, then run git difftool --dir-diff to launch a diff in the Folder Compare.

    2. If you can install Beyond Compare for Linux on the remote machine, another option is to configure Beyond Compare as the diff tool for git on that machine, use an X-Window client on your Windows machine to display BC for Linux remotely, then run git difftool --dir-diff.

    3. Export the revisions to be compared on the Linux machine to folders, then use Beyond Compare 4 Pro's built-in SFTP support to load the two folders in the Folder Compare on your Windows machine. bcompare.exe sftp://user@server/1 sftp://user@server/2