Command line weirdness

Support for our DiffMerge utility.

Moderator: SourceGear

Post Reply
Mathieu
Posts: 3
Joined: Wed Jul 25, 2007 10:33 pm

Command line weirdness

Post by Mathieu » Wed Jul 25, 2007 10:37 pm

Hello,

I am using DiffMerge in conjunction with perforce visual client (P4V) on Mac OS X 10.4.10.

Perforce will call diffmerge with the two files to compare as a command line arguments. The file names contain spaces and to make it work with DiffMerge I had to create a very simple shell script:

Code: Select all

$ cat dm.sh 
#!/bin/sh
exec /Applications/DiffMerge.app/Contents/MacOS/DiffMerge "$@"
with this script, DiffMerge will compare both files. Executing DiffMerge directly from P4V doesn't work (it opens DiffMerge only, no files are being compared).

The shell script should be a no-op script, it shouldn't make any difference: I am just executing the exact same thing. Any idea as to why I need this strange work-around?

Thanks,
Mathieu.
PS: any plan to build DiffMerge for Solaris 10?[/code]

jeremy_sg
Posts: 1821
Joined: Thu Dec 18, 2003 11:39 am
Location: Sourcegear
Contact:

Post by jeremy_sg » Thu Jul 26, 2007 7:16 am

If you go to the help menu, click About, then the support button, you should be able to see exactly what arguments are being passed from your shell script to DiffMerge. My first suspicion is that Perforce isn't sending the correct arguments, or in the right order to DiffMerge.

Mathieu
Posts: 3
Joined: Wed Jul 25, 2007 10:33 pm

Post by Mathieu » Thu Jul 26, 2007 9:44 am

I would say that for some reason those parameters do not reach DiffMerge:

Code: Select all

SourceGear DiffMerge : Version 3.0.2 (1010)  : WXMAC {2.8.3}

Command Line Arguments: [count 1]
	argv[0]: /Applications/DiffMerge.app/Contents/MacOS/DiffMerge

Active Window Properties:
	Window Title: SourceGear DiffMerge
	Window Type: Empty
[…]
Image

But with the exact same setting (only using a shell script quoted in my previous post):

Code: Select all

SourceGear DiffMerge : Version 3.0.2 (1010)  : WXMAC {2.8.3}

Command Line Arguments: [count 3]
	argv[0]: /Applications/DiffMerge.app/Contents/MacOS/DiffMerge
	argv[1]: /tmp/mlegrand(p4v)/mlegrandMBP.local perforce 1666/depot/scripts/build_targets#head.xml
	argv[2]: /tmp/mlegrand(p4v)/mlegrandMBP.local perforce 1666/depot/scripts/build_targets#1.xml

Active Window Properties:
	Window Title: build_targets#head.xml, build_targets#1.xml - SourceGear DiffMerge
	Window Type: FileDiff
Image

I am not changing anything other than the binary to call in perforce... Anyway to trace the call (aside from using a shell script)?

Thanks,
Mathieu.

ethomson
Posts: 3
Joined: Mon May 08, 2006 2:08 pm

Post by ethomson » Thu Jul 26, 2007 10:55 am

Hello,

I can confirm that the behavior you're reporting does exist in the latest version of P4V for MacOS (Rev. Perforce Visual Client/MACOSX104X86/2007.2/128166) with the latest version of SourceGear DiffMerge (3.0.2.)

I'm not very familiar with Perforce, so please correct me if I'm mistaken, but it appears that this may be a bug in P4V. I get the same behavior with any Diff program I configure. I tested this with another external diff program for MacOS (KDiff3.) Configuring KDiff3 as my merge tool does not invoke it with the correct arguments, however if I wrap KDiff3 with a shell script, it behaves as expected.

I've reported this bug to support@perforce.com, whom you may wish to follow up with.

I hope this helps.

Ed

Mathieu
Posts: 3
Joined: Wed Jul 25, 2007 10:33 pm

Post by Mathieu » Thu Jul 26, 2007 11:03 am

Ok thank you.

I will write to Perforce support as well tomorrow (it's 1am in Singapore). Let me know if you got an answer before that.

Post Reply