[MERGE] Added support for a hook before sending the commit message to the editor.

Monty Taylor monty at inaugust.com
Sat Feb 2 06:29:50 GMT 2008


Ian Clatworthy wrote:
> Ian Clatworthy wrote:
> 
>> How about passing the current text and information into the hook and
>> passing the new values back out? That way, the hook could alter either
>> as it sees fit.

Yes... and it would also work better with multiple hooks, too.

> On second thoughts with an eye towards supporting command line hooks
> more easily, maybe it makes more sense to have 2 separate hooks, one for
> the message (pre-commit-message) and one for the information
> (pre-commit-info). We can still pass the current text in and get the new
> text returned. In Python, the hooks would look something like:
> 
>     start_msg = ""
>     for hook in Branch.hooks['pre_commit_message']:
>         start_msg = hook(tree, selected_list, start_msg)
> 
> For command line hooks, stdin and stdout could be used for existing and
> new texts respectively.

Yes, ok. I've got a long plane flight tomorrow. I plan to work on this
(and a few other things)

Thanks!
Monty



More information about the bazaar mailing list