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

Community
  • 1
  • 1
talkaboutquality
  • 1,312
  • 2
  • 16
  • 34
  • Just completed my answer in response to your comment. – VonC Dec 22 '09 at 01:17
  • I am not aware of any formal specifications for the map file. You can try create a custom exe (I have not test that approach). The constraints I mentioned are from direct experimentations. – VonC Dec 22 '09 at 18:26
  • Most tries with some options returned: `"cleartool: Error: Operation "compare" unavailable for manager "text_file_delta" (Operation pathname was: "C:\Program Files (x86)\IBM\RationalSDLC\ClearCase\lib\mgrs\"WinMergeU.exe /s ")` – VonC Dec 22 '09 at 18:28
  • @VonC thanks for all your help too -- if I get time to try the custom exe I'll let you and all know the results. – talkaboutquality Dec 24 '09 at 09:05

2 Answers2

2

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
  • 115,121
  • 27
  • 131
  • 155
1

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)
Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • @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.exe line but I got an error. – talkaboutquality Dec 21 '09 at 09:35
  • @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 Dec 22 '09 at 11:05