svn commit helper (displays diff); diff must be manually deleted before committing the changes
authorTomas Zeman <tzeman@volny.cz>
Wed, 18 Dec 2013 09:20:53 +0100
changeset 39 1fc1aab8014b
parent 38 3afc2ae852e5
child 40 7b691c3bba6c
child 42 8a7132bd1a3d
svn commit helper (displays diff); diff must be manually deleted before committing the changes
scripts/svn
scripts/svn-diff-editor
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/scripts/svn	Wed Dec 18 09:20:53 2013 +0100
@@ -0,0 +1,16 @@
+#!/bin/sh
+# See: http://push.cx/2007/seeing-subversion-diffs-for-commit-messages
+#
+
+REALSVN=/usr/bin/svn
+
+ARGS="$@"
+
+if [ "$1" = "commit" -o "$1" = "ci" ]; then
+    shift # pop off $1 for diff
+    TEMPLATE=`mktemp svn-ci.XXXXXXX`
+    $REALSVN diff "$@" > "$TEMPLATE"
+    $REALSVN $ARGS --editor-cmd="$HOME/bin/svn-diff-editor '$TEMPLATE'"
+else
+    $REALSVN $ARGS
+fi
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/scripts/svn-diff-editor	Wed Dec 18 09:20:53 2013 +0100
@@ -0,0 +1,6 @@
+#!/bin/sh
+
+echo >> "$2"
+cat "$1" >> "$2"
+rm "$1"
+$EDITOR "$2"