Skip to content

Instantly share code, notes, and snippets.

@cpelley
Last active April 21, 2017 15:13
Show Gist options
  • Save cpelley/5c00a474039a46bd6d97a1648a652d4a to your computer and use it in GitHub Desktop.
Save cpelley/5c00a474039a46bd6d97a1648a652d4a to your computer and use it in GitHub Desktop.
svn conflcit resolution (vimdiff + graphical diff)
#!/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