Definitive guide to svn post-commit emails with nice colored diffs on DreamHost
Posted by Kelvin on 08 Jun 2010 at 02:59 am | Tagged as: programming
Step 1
Step 2
This command will try to do something, then most probably fail. That's OK.
Step 3
Change ~/.cpan/CPAN/MyConfig.pm to contain:
'makepl_arg' => q[PREFIX=/home/username/perl LIB=/home/username/perl/lib],
'mbuildpl_arg' => q[install_base=/home/username/perl],
Step 4
This should now install properly
Step 5
Running
should produce:
Step 6
vim post-commit
Paste this
REPOS="$1"
REV="$2"
PATH=/usr/bin:/bin:~/perl/bin
PROJECT=CHANGEME
export PERL5LIB="$HOME/perl/lib/perl5:$PERL5LIB"
svnnotify --repos-path "$REPOS" \
--revision "$REV" \
--svnlook /usr/bin/svnlook \
--to CHANGEME \
--from $COMMITTER@$PROJECT.com \
--with-diff --subject-cx --handler HTML::ColorDiff \
--max-diff-length 15000 --subject-prefix commit-
The last line
--max-diff-length 15000 --subject-prefix commit-
is optional.
Save and exit.
