Last active
April 21, 2017 15:13
-
-
Save cpelley/5c00a474039a46bd6d97a1648a652d4a to your computer and use it in GitHub Desktop.
svn conflcit resolution (vimdiff + graphical diff)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Configure your favorite diff program here. | |
DIFF="/usr/bin/vimdiff" | |
# Subversion provides the paths we need as the sixth and seventh | |
# parameters. | |
LEFT=${6} | |
RIGHT=${7} | |
# Call "svn diff --force" to end up here with binary files. | |
if identify $LEFT &> /dev/null; then | |
# Perform image comparison where possible. | |
confirm && imgdiff $LEFT $RIGHT --delete | |
elif ! istext $LEFT; then | |
# Binary format on what appears not to be an image. | |
echo "Cannot display: file marked as a binary type and is not a supported image fileformat." | |
else | |
# Standard text diff. | |
confirm && $DIFF $LEFT $RIGHT; | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment