Posted by Buzz in python
Again this is a late blog post about some code committed several months ago, in this case the code was committed 09/06/2009
It is a very short python script to force a subversion commit message to be greater than 10 characters in length
Installation:
svn export http://svn.saiweb.co.uk/branches/python/svn_force_message.py /path/to/your/svn/hooks/pre-commit
chmod +x /path/to/your/svn/hooks/pre-commit
Note installation this way will replace your current pre-commit hooks file.
Tags:
commit,
force,
Subversion
No Comments »
Some two months after the fact, I thought it may well be time to post a blog on this little code snippet.
As some of you have noticed every commit message to my subversion repository is infact updating my twitter.
This code was uploaded to subversion on 10/06/2009, so sorry for the late write up!
Requirements
Python 2.5 or higher
Subversion server
Installation
- svn co http://svn.saiweb.co.uk/branches/python/svn_tweeter.py /usr/bin/svn_tweeter
- chmod +x /usr/bin/svn_tweeter
- cd /path/to/svn/hooks
- Edit post-commit with your favorite text editor
1
| /usr/bin/python /usr/bin/svn_tweeter -u twitterusername -p twitterpassword -r $REV -s $REPOS |
Now try a commit, and check your syslog for entries from the script.
Aug 24 11:36:26 132 python: SVN_TWEETER: http://twitter.com/statuses/update.json query complete
UPDATE 24/03/2011 Twitter has removed basic authentication, you must use oauth (admittedly it has been like this for a fair while now) use this nagios_bot instead
Tags:
hooks,
post-commit,
Subversion,
svn,
twitter
No Comments »