[RFC] Changing the generate_commit_message_template and commit_message_template hook APIs

John Arbash Meinel john at arbash-meinel.com
Sun Sep 13 18:22:31 BST 2009


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

Robert Collins wrote:
> Gary van der Merwe wrote:
>> Hi
> 
>> I want to add a feature to qcommit that retrieves a commit message
>> from commit_message_template hooks (so that I can use qcommit and
>> bzr-builddeb together.) I have put together a proof of concept that
>> works nicely, which you can find at
>> lp:~garyvdm/qbzr/read_commit_message_hook. (link to diff:
>> http://bazaar.launchpad.net/~garyvdm/qbzr/read_commit_message_hook/revision/933)
> 
>> Currently, when generate_commit_message_template gets called, it gets
>> passed a bzrlib.Commit object. In qcommit, we never create such an
>> object (we run bzr commit is a sub process.) In my proof of concept, I
>> have created a MockCommitObj, which has all the fields that get used
>> by the bzr-builddeb commit_message_template hook. This seems error
>> prone, so I would like to change the api to be more cleanly defined.
> 
> Why not just invoke tree.commit directly in qbzr?
> 
> I don't see that a 'more clear' definition will help, if the template
> code wants to derive data about the commit that /is happening/, unless
> you are doing a commit, it will break.
> 
> -Rob
> 

They run commit in a subprocess to make sure that the main thread stays
responsive. They could probably run it in a thread, but a subprocess is
a little bit more isolated.

As for the rest, I think Gary mentioned that they want to populate their
editor *before* they start commit, not in the middle. This is also the
time where people would be doing file selection, etc. So they want to
know what they are going to do early rather than late.

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

iEYEARECAAYFAkqtKlcACgkQJdeBCYSNAAPIDwCfSRd5+zA0glatEy8izi2dlZLH
Oj0AoLWdhM7FqI3XqGfzveHffsq7LKFf
=CZSm
-----END PGP SIGNATURE-----



More information about the bazaar mailing list