[MERGE #102747] pre_commit hook

Ian Clatworthy ian.clatworthy at internode.on.net
Mon Sep 3 07:08:58 BST 2007


Nam Nguyen wrote:
> On 9/3/07, Ian Clatworthy <ian.clatworthy at internode.on.net> wrote:
>> FWIW, what isn't obvious to me though is whether it's better or worse to
>> run the pre-commit hooks before or after the commit() method. Does it
>> matter either way? If there are multiple places in the code where we
>> *could* run them, should the policy with pre-commit hooks be to do them
>> as early as possible or as late as possible?
> 
> As far as the doc goes, CommitBuilder.revision_tree() is only valid
> after a CommitBuilder.commit() has been called. This revision tree is
> useful for a pre_commit hook in case it wants to export a tree to some
> temp directory and do a `make check` on it. I would expect that to be
> a typical use case for a pre_commit hook.

That sounds right to me.

I'll go ahead and merge this now as it was previously approved by Aaron.

Ian C.



More information about the bazaar mailing list