[RFC] Changing the generate_commit_message_template and commit_message_template hook APIs

Gary van der Merwe garyvdm at gmail.com
Mon Sep 14 13:28:16 BST 2009


So a major concern is a key difference between bzr commit - the
command line + editor interface, and bzr qcommit, The cli only allows
you to edit the message provided by commit_message_template hooks
after the files to be committed are specified, and qcommit allows you
to edit the message, and the list of files a the same time.

It would hence be good if qcommit would allow the message to be
updated when the list of files to be committed is changed. This could
be achieved in the following way:

* When the qcommit dialogue opens, get a message template. Set the
message edit box to the template, and store a copy of this template as
"base_message".

* When the list of files changes, get a new message template. Then do
a 3 way merge, with the text from the message edit box as THIS, the
new template as OTHER, and "base_message" stored from the previous
message template as the BASE. Resolve any conflicts by using the text
from THIS. Set the message edit box to the result of this merge.
Store the new message template as "base_message" for the next merge.

I'll hack this up as a poc, and see how it works.

P.S. I checked out the code for etckeeper, and found that it does not
implement a commit_message_template hook. It just passes the message
that it wants via "bzr commit -m ...". So the only plugin that
implements a commit_message_template hook that I am aware of it
bzr-builddeb. I would. Again, if any one knows of any other plugins,
please let me know.

Gary



More information about the bazaar mailing list