Running post-commit hooks on the server?

Daniel Pittman daniel at rimspace.net
Sat Oct 6 09:27:54 BST 2007


G'day.

Sorry if this is a silly question; I have been unable to find a
conclusive answer anywhere in the documentation or through
experimentation with Bazaar.

I want to know what the best mechanism for integrating a few bits of
process into Bazaar, specifically:

I want to be able to run some commands on a remote system when a change
is pushed to it.  Specifically, in this case, to maintain the "source"
tree for a website in a central location and ensure that it is
rebuilt and republished when I commit changes to the central repository
from the branch on my laptop.

Importantly, though, I want to make sure that /every/ remote branch of
that central repository behaves this way when it pushes changes.  

If I have to rely on remembering to set this up each time we branch we
have already lost; someone will forget and pain will ensue.


I would also like to ensure that commit emails are sent out when the
central repository is updated, even when the client pushing is a Windows
machine.


The second thing I would like to do is to hook in some client-side
checks prior to a commit, and/or to a push -- ideally distinct actions.

I would like to be able to reject the addition of files when they don't
match rules of the project -- no spaces in filenames, for example.

I would also like to make sure that the project passed a round of
testing before changes left the developers box -- but I don't want to
stop them "checkpointing" a half finished feature into the local history
just because it doesn't pass all the tests yet.


So, it looks like the answer to the first part -- rebuilding and sending
email -- is to use the "smart" server.  If so, where is the use of hooks
in the "smart server" documented so I know how to have it do these
things?


I don't know what the answer to the second part is other than to write
my own plugin, correct?  It didn't look like there was anything
pre-existing.

Regards,
        Daniel
-- 
Daniel Pittman <daniel at cybersource.com.au>           Phone: 03 9621 2377
Level 4, 10 Queen St, Melbourne             Web: http://www.cyber.com.au
Cybersource: Australia's Leading Linux and Open Source Solutions Company




More information about the bazaar mailing list