Skip to content

Instantly share code, notes, and snippets.

@wecanspeak
Created December 13, 2013 06:05
Show Gist options
  • Save wecanspeak/7940388 to your computer and use it in GitHub Desktop.
Save wecanspeak/7940388 to your computer and use it in GitHub Desktop.
svn diff by vimdiff and rescue from multiple vim quits
#!/bin/sh
DIFF="/usr/bin/vimdiff"
LEFT=${6} # old file
RIGHT=${7} # new file
L_TITLE=${3} # file name and revision of old file
R_TITLE=${5} # file name and revision of new file
bold=`tput bold`
normal=`tput sgr0`
read -p "diff [${bold}${L_TITLE}${normal}]-[${bold}$R_TITLE${normal}]? [y/n]" yn
if [ "$yn" = "y" ] || [ "$yn" = "Y" ]; then
$DIFF $LEFT $RIGHT
else
echo "skip diff"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment