Skip to content

Instantly share code, notes, and snippets.

@amacgregor
Last active August 29, 2015 13:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save amacgregor/9253969 to your computer and use it in GitHub Desktop.
Save amacgregor/9253969 to your computer and use it in GitHub Desktop.
Easy SVN commits
#!/bin/bash
# Created by: syphoxy
SVN_COMMIT_FILES="$(mktemp /tmp/svn-commit-files.XXXXX)"
svn status \
| awk '{ $1 = ""; print $0 }' \
| sed -Ee 's/^[ ]+//; s/[ ]+$//' > "$SVN_COMMIT_FILES" \
&& [ -f "$SVN_COMMIT_FILES" ] \
&& [ "$(wc -l < "$SVN_COMMIT_FILES")" -ge 1 ] \
&& vim "$SVN_COMMIT_FILES" \
&& svn commit --targets "$SVN_COMMIT_FILES"
echo -n "Cleaning up files .. "
rm -f "$SVN_COMMIT_FILES"
echo "done."
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment