I want to use P4merge as my external diff tool for files in SVN when comparing local to unchanged. I just spent several hours on this when I should have been coding.
What do I need to do on OSX platform?
Perforce, the company best known for its enterprise version control platform, also offers a solid diff tool: P4Merge is free of charge and comes with a basic feature set that makes it an interesting option on Windows, macOS and Linux.
P4Merge is a visual diff tool that displays the differences between file versions and helps you to resolve conflicts and merge competing versions into one.
This is kind of hacky and only replaces the diff tool, not the merge tool but here it goes:
Create a python script named p4merge-diff-cmd
:
#!/usr/bin/env python
import sys
import os.path
P4MERGE = '/Applications/p4merge.app/Contents/Resources/launchp4merge'
p4merge_args= [P4MERGE]
for arg in sys.argv[1:]:
if os.path.exists(arg):
p4merge_args.append(os.path.abspath(arg))
os.execv(P4MERGE, p4merge_args)
and make it executable
chmod a+x p4merge-diff-cmd
Then, in your ~/.subversion/config
file change the line
# diff-cmd = diff_program (diff, gdiff, etc.)
to
diff-cmd = /full/path/to/p4merge-diff-cmd
Now svn diff <file>
should launch p4merge
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With