Question

I am experiencing something a bit weird when using git. I am using git on my Windows 7 machine.

I wanted to review some code changes, so I fired up gitk to check what was in the commit I wanted to review. In my list of changed files i highlight the first file and can see the diff to the left of that. But I have Beyond Compare intalled, and right click the first file and choose "External Diff". This works fine, and I can diff the file in Beyond Compare.

But when I try to do the same with the second file, it fails. Beyond Compare opens, and I can see that two files are displayed in the paths, but they don't exist.

When I go look at my filesystem I can see that "git.gitk-tmp.7992" exists (the folder refernced) but it is empty, and therefore of course Beyond Compare and git difftool can't pick them up.

Something similar happens when I try to do a "git difftool" between two branches.

I can't figure out why it won't create those temp file?!?

I am hoping somebody can shed a little light on this.

Thanks

Was it helpful?

Solution

I don't know Beyond Compare that well, but I'll give it a try :

When you run the external diff the first time, it launches BC. The second time, it launches a new BC process, which find the previous one, so it sends a message to the first instance, then quits.

When you click on external diff in gitk, it creates temp files, run the given command, wait for the program to exit, then delete temp files. When you already have an instance of BC, the second one quits almost instantly, so you can't find them.

That's the best I can do - Try digging BC's manual and forums.

OTHER TIPS

gracchus's answer was spot on and helped me to solve my problem.

In Beyond Compare's case, users should use BComp.exe in gitk instead of the BCompare.exe (which I was using).

BComp.exe:

This is a Win32 GUI program. If launched from a version control system, it should work just fine. If launched from a console window, the console (or batch file) will not wait for it.

BCompare.exe:

This is the main application. Only one copy will run at a time, regardless of how many windows you have open. If you launch a second copy it will tell the existing copy to start a comparison and exit immediately.

I use gitk + WinMerge and have encountered the same problem. I avoid this error by closing all instances of WinMerge before call the External diff command or changing the WinMerge settings:

Options > General > Uncheck the "Allow only one instance to run" checkbox.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top