Reputation: 1645
Note: this is similar to WebStorm git difftool -d closes immediately without waiting for user, but for Beyond Compare
When I run git difftool -d
with Beyond Compare set as my default difftool, git closes right away without letting Beyond Compare show any comparisons. How do I fix that?
Upvotes: 3
Views: 423
Reputation: 1
There are chances, that your version of Beyond Compare does not work as expected. See discussion Scooter's forum. Check at commandline prompt if
bcomp file1 file2
waits until closing the window.bcomp dir1 dir2
waits until closing the window.bcompare -solo dir1 dir2
waits until closing the window.(1) probably works.
(2) Is not expected to wait, according to the forum.
(3) I found that this does not work either, although it should, according to command line reference.
If even (3) does not help, you can edit mergetools/bc
file. Add this line to the end of diff_cmd()
:
[ -d "$LOCAL" -o -d "$REMOTE" ] && [ -t 0 ] && read -p "Press ENTER to continue..."
Location of the file is /lib/git-core/mergetools/bc
or something similar. In my gitforwindows, it is c:\Program Files\Git\mingw64\libexec\git-core\mergetools\bc
.
Upvotes: 0
Reputation: 1645
Much like similar issues, I had Beyond Compare open and it likes to run as a single instance. Though, that wasn't my entire problem. My diff tool was referencing the wrong executable. BCompare.exe
is the primary executable that will be a single instance if it can. BComp.exe
is the executable you should be using for the merge tool.
Why? It is actually kind of cool I think. The second one opens the first if an instance isn't open (obviously). The interesting part here is that the second waits for the associated documents/tasks to be closed in the main program before returning a value. This means that you can open additional files in a Beyond Compare instance opened by git and git will still get a return code for the initial file when you close that file. I am tempted to do some fancy drawing to illustrate, but I currently don't the time or skills to do that.
If that doesn't solve your issue, you can tack on -solo
to the command. It will open another UI instance in that case though.
Upvotes: 3