views:

474

answers:

2

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 ...

+1  A: 

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 &
troelskn
This is the basic answer and works. Thanks!
talkaboutquality
A: 

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)
VonC
@VonC since you answered the other SO question about WinMerge, referenced in my question, I feel ok asking for this clarification here on this "thread" since you brought up the '/s' switch for WinMerge. My question is -- if I'm using troelskn's suggestion and depending on my WinMerge entry in the ClearCase map file to open WinMerge, exactly how do I add the '/s' into the map file so that it will work as you describe? I tried just adding ' /s' on the end of my text_file_delta xcompare C:\Program Files\WinMerge\WinMergeU.exeline but I got an error.
talkaboutquality
@VonC Thanks for your note. Where should I look to see the exact requirements of a ClearCase map file, from which you took these constraints? I'm wondering if I can name a batch file .exe to work? Or could I / do I have to write, compile, and link a simple program in C that simply calls WinMergeU.exe /s and call _that_ WinMergeU_slash_s.exe?
talkaboutquality