[clug] Trac: the working pre-commit and post-commit hooks

Paul Wayper paulway at mabula.net
Thu Jan 8 12:17:50 GMT 2009


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi everyone,

One of the things we explored during the talk tonight was the pre-commit and
post-commit hook scripts for Subversion to integrate with Trac.  The
post-commit hook recognises a couple of keywords (e.g. 'closes #___', 're
#___') and posts the commit log message to the Trac ticket, and the pre-commit
hook makes sure that if you don't put one of those messages in your commit
log, the commit will be rejected.  (Yes, that may not appeal to some people,
but it's the way I like it.  Anyway...)

Trac supplies the trac-p{re,ost}-commit-hook scripts which actually do the
heavy lifting, but the key elements are the scripts in the
subversion/repository/hooks directory.  The templates given don't actually
work very well with Trac, and it took me some time to hack my current versions
together.  Of course, the ones I have now not particularly pretty, but
functionality was my goal, not neatness.  You can find them at:

http://tangram.dnsalias.net/~paulway/pre-commit
http://tangram.dnsalias.net/~paulway/post-commit

Patches, comments and ideas accepted.  Of course, now I should set up a
Subversion repository for them and a Trac project to track work o

Hope this helps,

Paul

BTW, another amusement for the group was this blog:
http://pipeline.corante.com/archives/things_i_wont_work_with/ - hope that
amuses a few more people as well.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org

iEYEARECAAYFAkll7u4ACgkQu7W0U8VsXYJhrwCcDKsq7HJdHc9M7bxC7fmBaw8Z
5ZMAn0Pcdu3bbYKrGQYeGlqEQF63in69
=7QZi
-----END PGP SIGNATURE-----


More information about the linux mailing list