[MERGE #102747] pre_commit hook
bitsink+bazaar at gmail.com
Mon Sep 3 05:59:57 BST 2007
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.
I think a pre_commit hook should be invoked as soon as possible after
everything is supposedly in place. Before that, it should be called
"pre-pre-commit" as John suggested.
More information about the bazaar