MAC, Linux replacement command line SVN diff for P4merge, Vimdiff

Source: Internet
Author: User
Tags diff perforce svn

2015-01-21 21:25:52

Here first the programmer of the Big God's blog address (PS: Great god, I am not to copy oh, really afraid of their own forgotten), http://www.ccvita.com/445.html, there are many articles, I was handy search to browse the next, there are big God's weight loss photos. Hee Hee

Today, when I was learning git, I said that I could define a merge and diff program to replace the default diff program when the git diff command was executed, just as I recently beat SVN diff on my Mac's terminal every day. I just want to try to replace SVN's default diff, but I don't know where SVN's svn diff command is configured by default, so Google is on top of that big God. (The great God is the great God, I have just thought of something great God has been playing rotten)

No, the above is the background of this note, hope can give follow-up with similar ideas of peers and memory very poor self to leave a "record."

Step one: Download, install P4merge (a nice and free graphical tool for merging and resolving conflicts)

  : Www.perforce.com/product/components/perforce-visual-merge-and-diff-tools

Mac under installation directory:/applications/p4merge.app/contents/macos/p4merge

Step Two: Write two simple shell scripts, especially simple

Script 1:/usr/local/bin/extmerge:

1 #!/bin/sh2 /applications/p4merge.app/contents/macos/p4merge $*

    

Script 2:/usr/local/bin/extdiff:

1 #!/bin/sh2"$6""$7"

Verify that the two scripts are executable:

1 sudo chmod +x/usr/local/bin/extmerge2sudochmod +x/usr/local/bin/extdiff

Step three: Modify the ~/.subversion/config file,

Place them

1 diff-cmd = diff_program (diff, Gdiff, etc.)

Replaced by

1 diff-cmd =/usr/local/bin/extdiff

Fourth step: Execute under Source ~/.subversion/config, will output some errors, no tube! Sao years, wayward to perform SVN diff bar, see what happened.

Fifth step: Replace the Vimdiff. (Please visit the main blog address of the beginning of the article), the following is a copy from the great God where the Vimdiff replacement method.

Note:

Shameless copy of the big God shell script, you will not bite me. (In case the big God is not happy that day, do not let us learn to read how to do)

#!/bin/SH# Configure your favorite diff program path diff="vimdiff"# SVN diff command will pass two file parameters left =${6}right=${7}# the command format required to stitch into the DIFF command $diff $LEFT $RIGHT

Rename this file to Svndiff, put it in the/usr/local/bin/directory, and give the execution permission, the rest of the replacement operation as above.

    

MAC, Linux replacement command line SVN diff for P4merge, Vimdiff

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.