Sending commit emails from a central location

John Arbash Meinel john at arbash-meinel.com
Fri Jun 22 15:28:19 BST 2007


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

Robert Collins wrote:
> On Thu, 2007-06-21 at 21:41 +0100, Adeodato Simó wrote:
>> Hello guys.
>>
>> I've always liked commit emails for some projects, and bzr-email is not
>> really a solution for me, because everybody has to individually
>> configure the plugin, etc. I'm told post_commit will one day work on the
>> server side, when using bzr+ssh://, but alas, people could still push
>> with sftp://.
>>
>> So I sat down today and wrote a tool to watch branches on the machine
>> they're hosted, and send mails from there. This ensures that every
>> pushed commit gets an email.
>>
>> Sending this mail in case this tool is of interest to somebody else. :-)
>>
>>   http://chistera.yi.org/~adeodato/code/bzr/bzr-hookless-email/
>>
>> P.S.: Code from bzr-email/emailer.py was stolen for this. Maybe it'd be
>> nice to have in bzrlib code to generate a "commit email".
> 
> A few thoughts..
> Firstly, you can reuse bzr-email/emailer.py:
> ====
> from bzrlib.plugins.email import emailer
> ====
> 
> No need to copy code at all.
> 
> Secondly, if you configure branch.conf to send email, the email plugin
> should send it correctly even if you are committing over sftp to a
> central branch.
> 
> -Rob
> 

It does, but his point is that he wants multiple contributers to the
same shared repository, and doesn't want to ask all of them to install
bzr-email.

Just as an aside, this is my configuration, which does work quite well
with a central repository that I commit my work to:

[sftp://juju/srv/bzr/public/branches/bzr]
public_branch = http://bzr.arbash-meinel.com/branches/bzr
public_branch:policy = appendpath
post_commit_to = Bazaar Commits <bazaar-commits at lists.canonical.com>

[bzr+ssh://juju/srv/bzr/public/branches/bzr]
public_branch = http://bzr.arbash-meinel.com/branches/bzr
public_branch:policy = appendpath
post_commit_to = Bazaar Commits <bazaar-commits at lists.canonical.com>


With those 6 (7?) lines, all of my public branches have mail generated
with the right urls. Now I may be unique in that I generally work in
(heavy) checkouts to my local server, so that all my commits are made
public at commit time.

I don't think the bzr-email plugin supports it yet, but we could also
create a post-push hook, so that revisions that get pushed are also
emailed. (Which works better for people who commit "offline" and then
push the changes to a public location).

That said, your bzr-hookless-email has a lot of value. You should
consider registering it in Launchpad, just in case your network
connection goes down/to get a bug tracker/etc.

John
=:->
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.3 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFGe9yDJdeBCYSNAAMRAsd0AKCMqpZ6wzTvW1wKwo3DNMjb8jymFACeIbjW
Pn76obHXr4icouAs6s73Ivs=
=szMU
-----END PGP SIGNATURE-----



More information about the bazaar mailing list