How to get cleartool diff to return to command line while diff viewer is still open?
Question
As described in one of the answers to SO question "Any way to use a custom diff tool with cleartool/clearcase?" I have installed WinMerge and a single diff opens fine in WinMerge based on a command of the form
cleartool diff -g filename filename@@clearcase-virtual-path-to-version-I-want-to_compare-to
But when I run that command in cygwin, it does not return to the command prompt until I exit WinMerge.
I want to execute a few such commands from a .bat file or shell script (one for each file in the change set of a given ClearCase activity) and have it either open multiple WinMerge instances, or multiple windows in a single WinMerge instance.
I was able to do that once but I've forgotten how. Can someone remind me?
I sense that this is not really a ClearCase question, but perhaps a DOS or shell question about spawning processes from the cygwin command line ...
Solution
Put an ampersand at the end of the line to run it in the background:
cleartool diff -g filename filename@@clearcase-virtual-path-to-version-I-want-to_compare-to &
OTHER TIPS
As mentioned in the Winmerge Command Line man page
/s limits WinMerge windows to a single instance. For example, if WinMerge is already running, a new compare opens in the same instance. Without this parameter, multiple windows are allowed: depending on other settings, a new compare might open in the existing window or in a new window.
So you could call WinMerge multiple time:
- either through a background process (like troelskn suggests)
or through a DOS
call
call "c:\Program Files (x86)\WinMerge\WinMergeU.exe" /s ...
should be able to launch only one WinMerge instance and continue the DOS script.
Note: this does not work with the map
file I mention in this other SO answer, since a map
file needs:
- an executable (
.bat
or.cmd
will not work) - no options (
WinMergeU.exe
works,WinMergeU.exe /s
will not)