Skip to content

Instantly share code, notes, and snippets.

@westonruter
Last active February 23, 2016 18:11
Show Gist options
  • Save westonruter/279b4b408f4791be647a to your computer and use it in GitHub Desktop.
Save westonruter/279b4b408f4791be647a to your computer and use it in GitHub Desktop.
function svn {
if [ "$1" == 'commit' ] || [ "$1" == 'ci' ]; then
repo_url=$( command svn info | grep -E '^URL:' | cut -c6- )
echo "Repo URL: $repo_url"
echo
echo "Staged changes for commit:"
command svn status -q
echo -n "Lines: "
command svn diff | wc -l
echo -n "Sanity check countdown... 5"
for i in $( seq 4 0 ); do
sleep 1
echo -ne "\b$i"
done
echo
read -p "Are you sure you want to commit? [y/n] " -n 1 -r
if [[ ! $REPLY =~ ^[Yy]$ ]]; then
echo
echo "Aborting!"
return 1
fi
echo
fi
command svn "$@"
}
export -f svn
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment