I've successfully used a custom external diff tool (an exe) for Sourcetree within Windows. That was super simple. Just put the exe path with backslashes and the two bare arguments in the arguments. However, I've tried a batch file, a shell script and a perl script as my external diff tool without success.
Currently, I've tried putting quotes around the diff command, used forward, backwards and double backwards slashes in the path. I've also tried the same variations on the arguments, including:
\"$REMOTE\" \"$LOCAL\"
Nothing seems to work. Each of the 3 scripts I've written just echo the variables passed to the script. This way I can begin developing my custom diff invocation. Here's the perl script I'm currently using
#!/usr/bin/perl # get total arg passed to this script my $total = $#ARGV + 1; my $counter = 1; # get script name my $scriptname = $0; print "Total args passed to $scriptname : $total\n"; # Use loop to print all args stored in an array called @ARGV foreach my $a(@ARGV) { print "Arg # $counter : $a\n"; $counter++; } print "Press ENTER to exit:"; <STDIN>;
Running "perl c:\devtools\test.pl asdf jkl;" results in:
C:\devtools>perl test.pl asdf jkl; Total args passed to test.pl : 2 Arg # 1 : asdf Arg # 2 : jkl; Press ENTER to exit:
My current sourcetree diff command is:
perl C:\devtools\test.pl
with arguments:
$LOCAL $REMOTE
I've been working on this for a long time and I can't even get a command window to pop up!
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.